Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ixgbe/if_ix.c
Show First 20 Lines • Show All 364 Lines • ▼ Show 20 Lines | |||||
* Additional comments are in ixgbe_netmap.h . | * Additional comments are in ixgbe_netmap.h . | ||||
* | * | ||||
* <dev/netmap/ixgbe_netmap.h> contains functions for netmap support | * <dev/netmap/ixgbe_netmap.h> contains functions for netmap support | ||||
* that extend the standard driver. | * that extend the standard driver. | ||||
*/ | */ | ||||
#include <dev/netmap/ixgbe_netmap.h> | #include <dev/netmap/ixgbe_netmap.h> | ||||
#endif /* DEV_NETMAP */ | #endif /* DEV_NETMAP */ | ||||
static MALLOC_DEFINE(M_IXGBE, "ix", "ix driver allocations"); | MALLOC_DEFINE(M_IXGBE, "ix", "ix driver allocations"); | ||||
/************************************************************************ | /************************************************************************ | ||||
* ixgbe_probe - Device identification routine | * ixgbe_probe - Device identification routine | ||||
* | * | ||||
* Determines if the driver should be loaded on | * Determines if the driver should be loaded on | ||||
* adapter based on its PCI vendor/device ID. | * adapter based on its PCI vendor/device ID. | ||||
* | * | ||||
* return BUS_PROBE_DEFAULT on success, positive on failure | * return BUS_PROBE_DEFAULT on success, positive on failure | ||||
▲ Show 20 Lines • Show All 127 Lines • ▼ Show 20 Lines | #endif | ||||
/* Allocate our TX/RX Queues */ | /* Allocate our TX/RX Queues */ | ||||
if (ixgbe_allocate_queues(adapter)) { | if (ixgbe_allocate_queues(adapter)) { | ||||
error = ENOMEM; | error = ENOMEM; | ||||
goto err_out; | goto err_out; | ||||
} | } | ||||
/* Allocate multicast array memory. */ | /* Allocate multicast array memory. */ | ||||
adapter->mta = malloc(sizeof(*adapter->mta) * | adapter->mta = malloc(sizeof(*adapter->mta) * | ||||
MAX_NUM_MULTICAST_ADDRESSES, M_DEVBUF, M_NOWAIT); | MAX_NUM_MULTICAST_ADDRESSES, M_IXGBE, M_NOWAIT); | ||||
if (adapter->mta == NULL) { | if (adapter->mta == NULL) { | ||||
device_printf(dev, "Can not allocate multicast setup array\n"); | device_printf(dev, "Can not allocate multicast setup array\n"); | ||||
error = ENOMEM; | error = ENOMEM; | ||||
goto err_late; | goto err_late; | ||||
} | } | ||||
/* Initialize the shared code */ | /* Initialize the shared code */ | ||||
hw->allow_unsupported_sfp = allow_unsupported_sfp; | hw->allow_unsupported_sfp = allow_unsupported_sfp; | ||||
▲ Show 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | |||||
err_late: | err_late: | ||||
ixgbe_free_transmit_structures(adapter); | ixgbe_free_transmit_structures(adapter); | ||||
ixgbe_free_receive_structures(adapter); | ixgbe_free_receive_structures(adapter); | ||||
err_out: | err_out: | ||||
if (adapter->ifp != NULL) | if (adapter->ifp != NULL) | ||||
if_free(adapter->ifp); | if_free(adapter->ifp); | ||||
ixgbe_free_pci_resources(adapter); | ixgbe_free_pci_resources(adapter); | ||||
free(adapter->mta, M_DEVBUF); | free(adapter->mta, M_IXGBE); | ||||
return (error); | return (error); | ||||
} /* ixgbe_attach */ | } /* ixgbe_attach */ | ||||
/************************************************************************ | /************************************************************************ | ||||
* ixgbe_detach - Device removal routine | * ixgbe_detach - Device removal routine | ||||
* | * | ||||
* Called when the driver is being removed. | * Called when the driver is being removed. | ||||
* Stops the adapter and deallocates all the resources | * Stops the adapter and deallocates all the resources | ||||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | #ifdef DEV_NETMAP | ||||
netmap_detach(adapter->ifp); | netmap_detach(adapter->ifp); | ||||
#endif /* DEV_NETMAP */ | #endif /* DEV_NETMAP */ | ||||
ixgbe_free_pci_resources(adapter); | ixgbe_free_pci_resources(adapter); | ||||
bus_generic_detach(dev); | bus_generic_detach(dev); | ||||
if_free(adapter->ifp); | if_free(adapter->ifp); | ||||
ixgbe_free_transmit_structures(adapter); | ixgbe_free_transmit_structures(adapter); | ||||
ixgbe_free_receive_structures(adapter); | ixgbe_free_receive_structures(adapter); | ||||
free(adapter->mta, M_DEVBUF); | free(adapter->mta, M_IXGBE); | ||||
IXGBE_CORE_LOCK_DESTROY(adapter); | IXGBE_CORE_LOCK_DESTROY(adapter); | ||||
return (0); | return (0); | ||||
} /* ixgbe_detach */ | } /* ixgbe_detach */ | ||||
/************************************************************************ | /************************************************************************ | ||||
* ixgbe_shutdown - Shutdown entry point | * ixgbe_shutdown - Shutdown entry point | ||||
▲ Show 20 Lines • Show All 5,248 Lines • Show Last 20 Lines |