/** * Detach driver from device * * @v efidev EFI device */ void snpnet_stop ( struct efi_device *efidev ) { EFI_BOOT_SERVICES *bs = efi_systab->BootServices; struct net_device *netdev = efidev_get_drvdata ( efidev ); struct snp_nic *snp = netdev->priv; EFI_HANDLE device = efidev->device; EFI_STATUS efirc; int rc; /* Unregister network device */ unregister_netdev ( netdev ); /* Stop SNP protocol */ if ( ( efirc = snp->snp->Stop ( snp->snp ) ) != 0 ) { rc = -EEFI ( efirc ); DBGC ( device, "SNP %s could not stop: %s\n", efi_handle_name ( device ), strerror ( rc ) ); /* Nothing we can do about this */ } /* Free network device */ list_del ( &snp->dev.siblings ); netdev_nullify ( netdev ); netdev_put ( netdev ); /* Close SNP protocol */ bs->CloseProtocol ( device, &efi_simple_network_protocol_guid, efi_image_handle, device ); }
/** * Detach driver from device * * @v efidev EFI device */ static void efipci_stop ( struct efi_device *efidev ) { struct pci_device *pci = efidev_get_drvdata ( efidev ); EFI_HANDLE device = efidev->device; pci_remove ( pci ); list_del ( &pci->dev.siblings ); efipci_close ( device ); free ( pci ); }
/** * Detach driver from device * * @v efidev EFI device */ void nii_stop ( struct efi_device *efidev ) { EFI_BOOT_SERVICES *bs = efi_systab->BootServices; struct net_device *netdev = efidev_get_drvdata ( efidev ); struct nii_nic *nii = netdev->priv; EFI_HANDLE device = efidev->device; /* Unregister network device */ unregister_netdev ( netdev ); /* Stop UNDI */ nii_stop_undi ( nii ); /* Close PCI I/O protocols */ nii_pci_close ( nii ); /* Close NII protocol */ bs->CloseProtocol ( device, &efi_nii31_protocol_guid, efi_image_handle, device ); /* Free network device */ list_del ( &nii->dev.siblings ); netdev_nullify ( netdev ); netdev_put ( netdev ); }