FreeBSD/sys/dev/qlxge/qls_os.c
/*
 * Name:	qls_pci_detach
 * Function:	Unhooks the device from the operating system
 */
qls_pci_detach
Function:    Unhooks the device from the operating system
qls_pci_detach Function : Unhooks the device from the operating system
static int
qls_pci_detach(device_t dev)
{
	qla_host_t *ha = NULL;
	struct ifnet *ifp;
	QL_DPRINT2((dev, "%s: enter\n", __func__));
        if ((ha = device_get_softc(dev)) == NULL) {
                device_printf(dev, "cannot get softc\n");
                return (ENOMEM);
        }
	ifp = ha->ifp;
	(void)QLA_LOCK(ha, __func__, 0);
	qls_stop(ha);
	QLA_UNLOCK(ha, __func__);
	qls_release(ha);
	QL_DPRINT2((dev, "%s: exit\n", __func__));
        return (0);
}
static int qls_pci_detach ( device_t dev ) { qla_host_t * ha = NULL ; struct ifnet * ifp ; QL_DPRINT2 ( ( dev , " \n " , __func__ ) ) ; if ( ( ha = device_get_softc ( dev ) ) == NULL ) { device_printf ( dev , " \n " ) ; return ( ENOMEM ) ; } ifp = ha -> ifp ; ( void ) QLA_LOCK ( ha , __func__ , 0 ) ; qls_stop ( ha ) ; QLA_UNLOCK ( ha , __func__ ) ; qls_release ( ha ) ; QL_DPRINT2 ( ( dev , " \n " , __func__ ) ) ; return ( 0 ) ; }
Name:        qls_pci_detach
 Function:    Unhooks the device from the operating system
Name : qls_pci_detach Function : Unhooks the device from the operating system