|
@@ -334,24 +334,24 @@ static struct net_device_operations snpnet_operations = {
|
334
|
334
|
static int snpnet_pci_info ( struct efi_device *efidev, struct device *dev ) {
|
335
|
335
|
EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
|
336
|
336
|
EFI_DEVICE_PATH_PROTOCOL *devpath = efidev->path;
|
|
337
|
+ EFI_HANDLE device = efidev->device;
|
337
|
338
|
struct pci_device pci;
|
338
|
|
- EFI_HANDLE device;
|
|
339
|
+ EFI_HANDLE pci_device;
|
339
|
340
|
EFI_STATUS efirc;
|
340
|
341
|
int rc;
|
341
|
342
|
|
342
|
343
|
/* Check for presence of PCI I/O protocol */
|
343
|
344
|
if ( ( efirc = bs->LocateDevicePath ( &efi_pci_io_protocol_guid,
|
344
|
|
- &devpath, &device ) ) != 0 ) {
|
345
|
|
- DBGC ( efidev->device, "SNP %p %s is not a PCI device\n",
|
346
|
|
- efidev->device, efi_devpath_text ( efidev->path ) );
|
|
345
|
+ &devpath, &pci_device ) ) != 0 ) {
|
|
346
|
+ DBGC ( device, "SNP %p %s is not a PCI device\n",
|
|
347
|
+ device, efi_handle_name ( device ) );
|
347
|
348
|
return -EEFI ( efirc );
|
348
|
349
|
}
|
349
|
350
|
|
350
|
351
|
/* Get PCI device information */
|
351
|
|
- if ( ( rc = efipci_info ( device, &pci ) ) != 0 ) {
|
352
|
|
- DBGC ( efidev->device, "SNP %p %s could not get PCI "
|
353
|
|
- "information: %s\n", efidev->device,
|
354
|
|
- efi_devpath_text ( efidev->path ), strerror ( rc ) );
|
|
352
|
+ if ( ( rc = efipci_info ( pci_device, &pci ) ) != 0 ) {
|
|
353
|
+ DBGC ( device, "SNP %p %s could not get PCI information: %s\n",
|
|
354
|
+ device, efi_handle_name ( device ), strerror ( rc ) );
|
355
|
355
|
return rc;
|
356
|
356
|
}
|
357
|
357
|
|
|
@@ -370,15 +370,15 @@ static int snpnet_pci_info ( struct efi_device *efidev, struct device *dev ) {
|
370
|
370
|
* @ret rc Return status code
|
371
|
371
|
*/
|
372
|
372
|
static int snpnet_dev_info ( struct efi_device *efidev, struct device *dev ) {
|
|
373
|
+ EFI_HANDLE device = efidev->device;
|
373
|
374
|
int rc;
|
374
|
375
|
|
375
|
376
|
/* Try getting underlying PCI device information */
|
376
|
377
|
if ( ( rc = snpnet_pci_info ( efidev, dev ) ) == 0 )
|
377
|
378
|
return 0;
|
378
|
379
|
|
379
|
|
- DBGC ( efidev->device, "SNP %p %s could not get underlying device "
|
380
|
|
- "information\n", efidev->device,
|
381
|
|
- efi_devpath_text ( efidev->path ) );
|
|
380
|
+ DBGC ( device, "SNP %p %s could not get underlying device "
|
|
381
|
+ "information\n", device, efi_handle_name ( device ) );
|
382
|
382
|
return -ENOTTY;
|
383
|
383
|
}
|
384
|
384
|
|
|
@@ -406,8 +406,7 @@ int snpnet_start ( struct efi_device *efidev ) {
|
406
|
406
|
EFI_OPEN_PROTOCOL_EXCLUSIVE )))!=0){
|
407
|
407
|
rc = -EEFI ( efirc );
|
408
|
408
|
DBGC ( device, "SNP %p %s cannot open SNP protocol: %s\n",
|
409
|
|
- device, efi_devpath_text ( efidev->path ),
|
410
|
|
- strerror ( rc ) );
|
|
409
|
+ device, efi_handle_name ( device ), strerror ( rc ) );
|
411
|
410
|
goto err_open_protocol;
|
412
|
411
|
}
|
413
|
412
|
|
|
@@ -438,21 +437,21 @@ int snpnet_start ( struct efi_device *efidev ) {
|
438
|
437
|
( ( efirc = snp->snp->Start ( snp->snp ) ) != 0 ) ) {
|
439
|
438
|
rc = -EEFI ( efirc );
|
440
|
439
|
DBGC ( device, "SNP %p %s could not start: %s\n", device,
|
441
|
|
- efi_devpath_text ( efidev->path ), strerror ( rc ) );
|
|
440
|
+ efi_handle_name ( device ), strerror ( rc ) );
|
442
|
441
|
goto err_start;
|
443
|
442
|
}
|
444
|
443
|
if ( ( mode->State == EfiSimpleNetworkInitialized ) &&
|
445
|
444
|
( ( efirc = snp->snp->Shutdown ( snp->snp ) ) != 0 ) ) {
|
446
|
445
|
rc = -EEFI ( efirc );
|
447
|
446
|
DBGC ( device, "SNP %p %s could not shut down: %s\n", device,
|
448
|
|
- efi_devpath_text ( efidev->path ), strerror ( rc ) );
|
|
447
|
+ efi_handle_name ( device ), strerror ( rc ) );
|
449
|
448
|
goto err_shutdown;
|
450
|
449
|
}
|
451
|
450
|
|
452
|
451
|
/* Populate network device parameters */
|
453
|
452
|
if ( mode->HwAddressSize != netdev->ll_protocol->hw_addr_len ) {
|
454
|
453
|
DBGC ( device, "SNP %p %s has invalid hardware address "
|
455
|
|
- "length %d\n", device, efi_devpath_text ( efidev->path ),
|
|
454
|
+ "length %d\n", device, efi_handle_name ( device ),
|
456
|
455
|
mode->HwAddressSize );
|
457
|
456
|
rc = -ENOTSUP;
|
458
|
457
|
goto err_hw_addr_len;
|
|
@@ -461,7 +460,7 @@ int snpnet_start ( struct efi_device *efidev ) {
|
461
|
460
|
netdev->ll_protocol->hw_addr_len );
|
462
|
461
|
if ( mode->HwAddressSize != netdev->ll_protocol->ll_addr_len ) {
|
463
|
462
|
DBGC ( device, "SNP %p %s has invalid link-layer address "
|
464
|
|
- "length %d\n", device, efi_devpath_text ( efidev->path ),
|
|
463
|
+ "length %d\n", device, efi_handle_name ( device ),
|
465
|
464
|
mode->HwAddressSize );
|
466
|
465
|
rc = -ENOTSUP;
|
467
|
466
|
goto err_ll_addr_len;
|
|
@@ -474,8 +473,8 @@ int snpnet_start ( struct efi_device *efidev ) {
|
474
|
473
|
/* Register network device */
|
475
|
474
|
if ( ( rc = register_netdev ( netdev ) ) != 0 )
|
476
|
475
|
goto err_register_netdev;
|
477
|
|
- DBGC ( device, "SNP %p %s registered as %s\n", device,
|
478
|
|
- efi_devpath_text ( efidev->path ), netdev->name );
|
|
476
|
+ DBGC ( device, "SNP %p %s registered as %s\n",
|
|
477
|
+ device, efi_handle_name ( device ), netdev->name );
|
479
|
478
|
|
480
|
479
|
/* Set initial link state */
|
481
|
480
|
if ( snp->snp->Mode->MediaPresentSupported ) {
|
|
@@ -512,6 +511,7 @@ void snpnet_stop ( struct efi_device *efidev ) {
|
512
|
511
|
EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
|
513
|
512
|
struct net_device *netdev = efidev_get_drvdata ( efidev );
|
514
|
513
|
struct snp_nic *snp = netdev->priv;
|
|
514
|
+ EFI_HANDLE device = efidev->device;
|
515
|
515
|
EFI_STATUS efirc;
|
516
|
516
|
int rc;
|
517
|
517
|
|
|
@@ -521,9 +521,8 @@ void snpnet_stop ( struct efi_device *efidev ) {
|
521
|
521
|
/* Stop SNP protocol */
|
522
|
522
|
if ( ( efirc = snp->snp->Stop ( snp->snp ) ) != 0 ) {
|
523
|
523
|
rc = -EEFI ( efirc );
|
524
|
|
- DBGC ( efidev->device, "SNP %p %s could not stop: %s\n",
|
525
|
|
- efidev->device, efi_devpath_text ( efidev->path ),
|
526
|
|
- strerror ( rc ) );
|
|
524
|
+ DBGC ( device, "SNP %p %s could not stop: %s\n", device,
|
|
525
|
+ efi_handle_name ( device ), strerror ( rc ) );
|
527
|
526
|
/* Nothing we can do about this */
|
528
|
527
|
}
|
529
|
528
|
|
|
@@ -533,6 +532,6 @@ void snpnet_stop ( struct efi_device *efidev ) {
|
533
|
532
|
netdev_put ( netdev );
|
534
|
533
|
|
535
|
534
|
/* Close SNP protocol */
|
536
|
|
- bs->CloseProtocol ( efidev->device, &efi_simple_network_protocol_guid,
|
537
|
|
- efi_image_handle, efidev->device );
|
|
535
|
+ bs->CloseProtocol ( device, &efi_simple_network_protocol_guid,
|
|
536
|
+ efi_image_handle, device );
|
538
|
537
|
}
|