Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/cxgbe/t4_main.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 1,625 Lines • ▼ Show 20 Lines | #define T4_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \ | ||||
IFCAP_HWRXTSTMP) | IFCAP_HWRXTSTMP) | ||||
#define T4_CAP_ENABLE (T4_CAP) | #define T4_CAP_ENABLE (T4_CAP) | ||||
static int | static int | ||||
cxgbe_vi_attach(device_t dev, struct vi_info *vi) | cxgbe_vi_attach(device_t dev, struct vi_info *vi) | ||||
{ | { | ||||
struct ifnet *ifp; | struct ifnet *ifp; | ||||
struct sbuf *sb; | struct sbuf *sb; | ||||
int numa_domain; | |||||
vi->xact_addr_filt = -1; | vi->xact_addr_filt = -1; | ||||
callout_init(&vi->tick, 1); | callout_init(&vi->tick, 1); | ||||
/* Allocate an ifnet and set it up */ | /* Allocate an ifnet and set it up */ | ||||
if (bus_get_domain(dev, &numa_domain) != 0) | |||||
ifp = if_alloc(IFT_ETHER); | ifp = if_alloc(IFT_ETHER); | ||||
else | |||||
ifp = if_alloc_domain(IFT_ETHER, numa_domain); | |||||
if (ifp == NULL) { | if (ifp == NULL) { | ||||
device_printf(dev, "Cannot allocate ifnet\n"); | device_printf(dev, "Cannot allocate ifnet\n"); | ||||
return (ENOMEM); | return (ENOMEM); | ||||
} | } | ||||
vi->ifp = ifp; | vi->ifp = ifp; | ||||
ifp->if_softc = vi; | ifp->if_softc = vi; | ||||
if_initname(ifp, device_get_name(dev), device_get_unit(dev)); | if_initname(ifp, device_get_name(dev), device_get_unit(dev)); | ||||
▲ Show 20 Lines • Show All 9,202 Lines • Show Last 20 Lines |