int __init init_module(void) { dev_3c501 = el1_probe(-1); if (IS_ERR(dev_3c501)) return PTR_ERR(dev_3c501); return 0; }
static int ethif_probe(struct device *dev) { u_long base_addr = dev->base_addr; if ((base_addr == 0xffe0) || (base_addr == 1)) return 1; /* ENXIO */ if (1 /* All PCI probes are safe, and thus should be first. */ #ifdef CONFIG_DE4X5 /* DEC DE425, DE434, DE435 adapters */ && de4x5_probe(dev) #endif #ifdef CONFIG_DGRS && dgrs_probe(dev) #endif #ifdef CONFIG_EEXPRESS_PRO100B /* Intel EtherExpress Pro100B */ && eepro100_probe(dev) #endif #ifdef CONFIG_EPIC && epic100_probe(dev) #endif #if defined(CONFIG_HP100) && hp100_probe(dev) #endif #if defined(CONFIG_NE2K_PCI) && ne2k_pci_probe(dev) #endif #ifdef CONFIG_PCNET32 && pcnet32_probe(dev) #endif #ifdef CONFIG_RTL8139 && rtl8139_probe(dev) #endif #if defined(CONFIG_VIA_RHINE) && via_rhine_probe(dev) #endif #if defined(CONFIG_VORTEX) && tc59x_probe(dev) #endif #if defined(CONFIG_DEC_ELCP) && tulip_probe(dev) #endif #ifdef CONFIG_YELLOWFIN && yellowfin_probe(dev) #endif /* Next mostly-safe EISA-only drivers. */ #ifdef CONFIG_AC3200 /* Ansel Communications EISA 3200. */ && ac3200_probe(dev) #endif #if defined(CONFIG_ULTRA32) && ultra32_probe(dev) #endif /* Third, sensitive ISA boards. */ #ifdef CONFIG_AT1700 && at1700_probe(dev) #endif #if defined(CONFIG_ULTRA) && ultra_probe(dev) #endif #if defined(CONFIG_SMC9194) && smc_init(dev) #endif #if defined(CONFIG_WD80x3) && wd_probe(dev) #endif #if defined(CONFIG_EL2) /* 3c503 */ && el2_probe(dev) #endif #if defined(CONFIG_HPLAN) && hp_probe(dev) #endif #if defined(CONFIG_HPLAN_PLUS) && hp_plus_probe(dev) #endif #if defined(CONFIG_SEEQ8005) && seeq8005_probe(dev) #endif #ifdef CONFIG_E2100 /* Cabletron E21xx series. */ && e2100_probe(dev) #endif #if defined(CONFIG_NE2000) && ne_probe(dev) #endif #ifdef CONFIG_AT1500 && at1500_probe(dev) #endif #ifdef CONFIG_FMV18X /* Fujitsu FMV-181/182 */ && fmv18x_probe(dev) #endif #ifdef CONFIG_ETH16I && eth16i_probe(dev) /* ICL EtherTeam 16i/32 */ #endif #ifdef CONFIG_EL3 /* 3c509 */ && el3_probe(dev) #endif #ifdef CONFIG_3C515 /* 3c515 */ && tc515_probe(dev) #endif #ifdef CONFIG_ZNET /* Zenith Z-Note and some IBM Thinkpads. */ && znet_probe(dev) #endif #ifdef CONFIG_EEXPRESS /* Intel EtherExpress */ && express_probe(dev) #endif #ifdef CONFIG_EEXPRESS_PRO /* Intel EtherExpress Pro/10 */ && eepro_probe(dev) #endif #ifdef CONFIG_DEPCA /* DEC DEPCA */ && depca_probe(dev) #endif #ifdef CONFIG_EWRK3 /* DEC EtherWORKS 3 */ && ewrk3_probe(dev) #endif #ifdef CONFIG_APRICOT /* Apricot I82596 */ && apricot_probe(dev) #endif #ifdef CONFIG_EL1 /* 3c501 */ && el1_probe(dev) #endif #if defined(CONFIG_WAVELAN) /* WaveLAN */ && wavelan_probe(dev) #endif /* defined(CONFIG_WAVELAN) */ #ifdef CONFIG_EL16 /* 3c507 */ && el16_probe(dev) #endif #ifdef CONFIG_ELPLUS /* 3c505 */ && elplus_probe(dev) #endif #ifdef CONFIG_DE600 /* D-Link DE-600 adapter */ && de600_probe(dev) #endif #ifdef CONFIG_DE620 /* D-Link DE-620 adapter */ && de620_probe(dev) #endif #if defined(CONFIG_SK_G16) && SK_init(dev) #endif #ifdef CONFIG_NI52 && ni52_probe(dev) #endif #ifdef CONFIG_NI65 && ni65_probe(dev) #endif #ifdef CONFIG_LANCE /* ISA LANCE boards */ && lance_probe(dev) #endif #ifdef CONFIG_ATARILANCE /* Lance-based Atari ethernet boards */ && atarilance_probe(dev) #endif #ifdef CONFIG_A2065 /* Commodore/Ameristar A2065 Ethernet Board */ && a2065_probe(dev) #endif #ifdef CONFIG_APNE /* Amiga 1200 PCMCIA NEx000 Ethernet Board */ && apne_probe(dev) #endif #ifdef CONFIG_ARIADNE /* Village Tronic Ariadne Ethernet Board */ && ariadne_probe(dev) #endif #ifdef CONFIG_ARIADNE2 /* Village Tronic Ariadne II Ethernet Board */ && ariadne2_probe(dev) #endif #ifdef CONFIG_HYDRA /* Hydra Systems Amiganet Ethernet board */ && hydra_probe(dev) #endif #ifdef CONFIG_ATARI_BIONET /* Atari Bionet Ethernet board */ && bionet_probe(dev) #endif #ifdef CONFIG_ATARI_PAMSNET /* Atari PAMsNet Ethernet board */ && pamsnet_probe(dev) #endif #ifdef CONFIG_SUNLANCE && sparc_lance_probe(dev) #endif #ifdef CONFIG_TLAN && tlan_probe(dev) #endif #ifdef CONFIG_LANCE && lance_probe(dev) #endif && 1 ) { return 1; /* -ENODEV or -EAGAIN would be more accurate. */ } return 0; }
/* ** Name: void do_init(message *mp) ** Function: Checks for hardware presence. ** Provides initialization of hardware and data structures */ static void do_init(const message * mp) { dpeth_t *dep; dp_conf_t *dcp; message reply_mess; int r, confnr; dep = &de_state; /* Pick a default configuration for this instance. */ confnr = MIN(de_instance, DP_CONF_NR-1); dcp = &dp_conf[confnr]; strcpy(dep->de_name, DevName); dep->de_name[4] = '0' + de_instance; if (dep->de_mode == DEM_DISABLED) { update_conf(dep, dcp); /* First time thru */ if (dep->de_mode == DEM_ENABLED && !el1_probe(dep) && /* Probe for 3c501 */ !wdeth_probe(dep) && /* Probe for WD80x3 */ !ne_probe(dep) && /* Probe for NEx000 */ !el2_probe(dep) && /* Probe for 3c503 */ !el3_probe(dep)) { /* Probe for 3c509 */ printf("%s: warning no ethernet card found at 0x%04X\n", dep->de_name, dep->de_base_port); dep->de_mode = DEM_DISABLED; } } r = OK; /* 'de_mode' may change if probe routines fail, test again */ switch (dep->de_mode) { case DEM_DISABLED: /* Device is configured OFF or hardware probe failed */ r = ENXIO; break; case DEM_ENABLED: /* Device is present and probed */ if (dep->de_flags == DEF_EMPTY) { /* These actions only the first time */ do_first_init(dep, dcp); dep->de_flags |= DEF_ENABLED; } dep->de_flags &= NOT(DEF_PROMISC | DEF_MULTI | DEF_BROAD); if (mp->DL_MODE & DL_PROMISC_REQ) dep->de_flags |= DEF_PROMISC | DEF_MULTI | DEF_BROAD; if (mp->DL_MODE & DL_MULTI_REQ) dep->de_flags |= DEF_MULTI; if (mp->DL_MODE & DL_BROAD_REQ) dep->de_flags |= DEF_BROAD; (*dep->de_flagsf) (dep); break; case DEM_SINK: /* Device not present (sink mode) */ memset(dep->de_address.ea_addr, 0, sizeof(ether_addr_t)); dp_confaddr(dep); /* Station address from env. */ break; default: break; } reply_mess.m_type = DL_CONF_REPLY; reply_mess.DL_STAT = r; if (r == OK) *(ether_addr_t *) reply_mess.DL_HWADDR = dep->de_address; DEBUG(printf("\t reply %d\n", reply_mess.m_type)); if (send(mp->m_source, &reply_mess) != OK) /* Can't send */ panic(SendErrMsg, mp->m_source); return; }
/* ** Name: void do_init(message *mp) ** Function: Checks for hardware presence. ** Provides initialization of hardware and data structures */ static void do_init(message * mp) { int port; dpeth_t *dep; dp_conf_t *dcp; message reply_mess; port = mp->DL_PORT; if (port >= 0 && port < DE_PORT_NR) { dep = &de_table[port]; dcp = &dp_conf[port]; strcpy(dep->de_name, DevName); dep->de_name[4] = '0' + port; if (dep->de_mode == DEM_DISABLED) { update_conf(dep, dcp); /* First time thru */ if (dep->de_mode == DEM_ENABLED && !el1_probe(dep) && /* Probe for 3c501 */ !wdeth_probe(dep) && /* Probe for WD80x3 */ !ne_probe(dep) && /* Probe for NEx000 */ !el2_probe(dep) && /* Probe for 3c503 */ !el3_probe(dep)) { /* Probe for 3c509 */ printf("%s: warning no ethernet card found at 0x%04X\n", dep->de_name, dep->de_base_port); dep->de_mode = DEM_DISABLED; } } /* 'de_mode' may change if probe routines fail, test again */ switch (dep->de_mode) { case DEM_DISABLED: /* Device is configured OFF or hardware probe failed */ port = ENXIO; break; case DEM_ENABLED: /* Device is present and probed */ if (dep->de_flags == DEF_EMPTY) { /* These actions only the first time */ do_first_init(dep, dcp); dep->de_flags |= DEF_ENABLED; } dep->de_flags &= NOT(DEF_PROMISC | DEF_MULTI | DEF_BROAD); if (mp->DL_MODE & DL_PROMISC_REQ) dep->de_flags |= DEF_PROMISC | DEF_MULTI | DEF_BROAD; if (mp->DL_MODE & DL_MULTI_REQ) dep->de_flags |= DEF_MULTI; if (mp->DL_MODE & DL_BROAD_REQ) dep->de_flags |= DEF_BROAD; (*dep->de_flagsf) (dep); dep->de_client = mp->m_source; break; case DEM_SINK: /* Device not present (sink mode) */ memset(dep->de_address.ea_addr, 0, sizeof(ether_addr_t)); dp_confaddr(dep); /* Station address from env. */ break; default: break; } *(ether_addr_t *) reply_mess.m3_ca1 = dep->de_address; } else /* Port number is out of range */ port = ENXIO; reply_mess.m_type = DL_INIT_REPLY; reply_mess.m3_i1 = port; reply_mess.m3_i2 = DE_PORT_NR; DEBUG(printf("\t reply %d\n", reply_mess.m_type)); if (send(mp->m_source, &reply_mess) != OK) /* Can't send */ panic(dep->de_name, SendErrMsg, mp->m_source); return; }
static int ethif_probe(struct device *dev) { u_long base_addr = dev->base_addr; if ((base_addr == 0xffe0) || (base_addr == 1)) return 1; /* ENXIO */ if (1 #if defined(CONFIG_OSFMACH3) && osfmach3_ethif_probe(dev) #endif #ifdef CONFIG_DGRS && dgrs_probe(dev) #endif #if defined(CONFIG_VORTEX) && tc59x_probe(dev) #endif #if defined(CONFIG_SEEQ8005) && seeq8005_probe(dev) #endif #if defined(CONFIG_DEC_ELCP) && tulip_probe(dev) #endif #if defined(CONFIG_HP100) && hp100_probe(dev) #endif #if defined(CONFIG_ULTRA) && ultra_probe(dev) #endif #if defined(CONFIG_ULTRA32) && ultra32_probe(dev) #endif #if defined(CONFIG_SMC9194) && smc_init(dev) #endif #if defined(CONFIG_WD80x3) || defined(WD80x3) && wd_probe(dev) #endif #if defined(CONFIG_EL2) || defined(EL2) /* 3c503 */ && el2_probe(dev) #endif #if defined(CONFIG_HPLAN) || defined(HPLAN) && hp_probe(dev) #endif #if defined(CONFIG_HPLAN_PLUS) && hp_plus_probe(dev) #endif #ifdef CONFIG_AC3200 /* Ansel Communications EISA 3200. */ && ac3200_probe(dev) #endif #ifdef CONFIG_E2100 /* Cabletron E21xx series. */ && e2100_probe(dev) #endif #if defined(CONFIG_NE2000) || defined(NE2000) && ne_probe(dev) #endif #ifdef CONFIG_AT1500 && at1500_probe(dev) #endif #ifdef CONFIG_AT1700 && at1700_probe(dev) #endif #ifdef CONFIG_FMV18X /* Fujitsu FMV-181/182 */ && fmv18x_probe(dev) #endif #ifdef CONFIG_ETH16I && eth16i_probe(dev) /* ICL EtherTeam 16i/32 */ #endif #ifdef CONFIG_EL3 /* 3c509 */ && el3_probe(dev) #endif #ifdef CONFIG_ZNET /* Zenith Z-Note and some IBM Thinkpads. */ && znet_probe(dev) #endif #ifdef CONFIG_EEXPRESS /* Intel EtherExpress */ && express_probe(dev) #endif #ifdef CONFIG_EEXPRESS_PRO /* Intel EtherExpress Pro/10 */ && eepro_probe(dev) #endif #ifdef CONFIG_EEXPRESS_PRO100B /* Intel EtherExpress Pro100B */ && eepro100_probe(dev) #endif #ifdef CONFIG_DEPCA /* DEC DEPCA */ && depca_probe(dev) #endif #ifdef CONFIG_EWRK3 /* DEC EtherWORKS 3 */ && ewrk3_probe(dev) #endif #ifdef CONFIG_DE4X5 /* DEC DE425, DE434, DE435 adapters */ && de4x5_probe(dev) #endif #ifdef CONFIG_APRICOT /* Apricot I82596 */ && apricot_probe(dev) #endif #ifdef CONFIG_EL1 /* 3c501 */ && el1_probe(dev) #endif #if defined(CONFIG_WAVELAN) /* WaveLAN */ && wavelan_probe(dev) #endif /* defined(CONFIG_WAVELAN) */ #ifdef CONFIG_EL16 /* 3c507 */ && el16_probe(dev) #endif #ifdef CONFIG_ELPLUS /* 3c505 */ && elplus_probe(dev) #endif #ifdef CONFIG_DE600 /* D-Link DE-600 adapter */ && de600_probe(dev) #endif #ifdef CONFIG_DE620 /* D-Link DE-620 adapter */ && de620_probe(dev) #endif #if defined(CONFIG_SK_G16) && SK_init(dev) #endif #ifdef CONFIG_NI52 && ni52_probe(dev) #endif #ifdef CONFIG_NI65 && ni65_probe(dev) #endif #ifdef CONFIG_ATARILANCE /* Lance-based Atari ethernet boards */ && atarilance_probe(dev) #endif #ifdef CONFIG_A2065 /* Commodore/Ameristar A2065 Ethernet Board */ && a2065_probe(dev) #endif #ifdef CONFIG_ARIADNE /* Village Tronic Ariadne Ethernet Board */ && ariadne_probe(dev) #endif #ifdef CONFIG_HYDRA /* Hydra Systems Amiganet Ethernet board */ && hydra_probe(dev) #endif #ifdef CONFIG_SUNLANCE && sparc_lance_probe(dev) #endif && 1 ) { return 1; /* -ENODEV or -EAGAIN would be more accurate. */ } return 0; }