Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/al_eth/al_eth.c
Show First 20 Lines • Show All 266 Lines • ▼ Show 20 Lines | if ((al_is_device_supported(dev)) != 0) { | ||||
return (BUS_PROBE_DEFAULT); | return (BUS_PROBE_DEFAULT); | ||||
} | } | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
static int | static int | ||||
al_attach(device_t dev) | al_attach(device_t dev) | ||||
{ | { | ||||
struct al_eth_lm_context *lm_context; | |||||
struct al_eth_adapter *adapter; | struct al_eth_adapter *adapter; | ||||
struct sysctl_oid_list *child; | struct sysctl_oid_list *child; | ||||
struct sysctl_ctx_list *ctx; | struct sysctl_ctx_list *ctx; | ||||
struct sysctl_oid *tree; | struct sysctl_oid *tree; | ||||
struct ifnet *ifp; | struct ifnet *ifp; | ||||
uint32_t dev_id; | uint32_t dev_id; | ||||
uint32_t rev_id; | uint32_t rev_id; | ||||
int bar_udma; | int bar_udma; | ||||
Show All 15 Lines | al_attach(device_t dev) | ||||
adapter = device_get_softc(dev); | adapter = device_get_softc(dev); | ||||
adapter->dev = dev; | adapter->dev = dev; | ||||
adapter->board_type = ALPINE_INTEGRATED; | adapter->board_type = ALPINE_INTEGRATED; | ||||
snprintf(adapter->name, AL_ETH_NAME_MAX_LEN, "%s", | snprintf(adapter->name, AL_ETH_NAME_MAX_LEN, "%s", | ||||
device_get_nameunit(dev)); | device_get_nameunit(dev)); | ||||
AL_RX_LOCK_INIT(adapter); | AL_RX_LOCK_INIT(adapter); | ||||
g_adapters[g_adapters_count] = adapter; | g_adapters[g_adapters_count] = adapter; | ||||
lm_context = &adapter->lm_context; | |||||
bar_udma = PCIR_BAR(AL_ETH_UDMA_BAR); | bar_udma = PCIR_BAR(AL_ETH_UDMA_BAR); | ||||
adapter->udma_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, | adapter->udma_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, | ||||
&bar_udma, RF_ACTIVE); | &bar_udma, RF_ACTIVE); | ||||
if (adapter->udma_res == NULL) { | if (adapter->udma_res == NULL) { | ||||
device_printf(adapter->dev, | device_printf(adapter->dev, | ||||
"could not allocate memory resources for DMA.\n"); | "could not allocate memory resources for DMA.\n"); | ||||
err = ENOMEM; | err = ENOMEM; | ||||
▲ Show 20 Lines • Show All 3,268 Lines • Show Last 20 Lines |