You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ns8390.c 31KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018
  1. /**************************************************************************
  2. ETHERBOOT - BOOTP/TFTP Bootstrap Program
  3. Author: Martin Renters
  4. Date: May/94
  5. This code is based heavily on David Greenman's if_ed.c driver
  6. Copyright (C) 1993-1994, David Greenman, Martin Renters.
  7. This software may be used, modified, copied, distributed, and sold, in
  8. both source and binary form provided that the above copyright and these
  9. terms are retained. Under no circumstances are the authors responsible for
  10. the proper functioning of this software, nor do the authors assume any
  11. responsibility for damages incurred with its use.
  12. Multicast support added by Timothy Legge (timlegge@users.sourceforge.net) 09/28/2003
  13. Relocation support added by Ken Yap (ken_yap@users.sourceforge.net) 28/12/02
  14. 3c503 support added by Bill Paul (wpaul@ctr.columbia.edu) on 11/15/94
  15. SMC8416 support added by Bill Paul (wpaul@ctr.columbia.edu) on 12/25/94
  16. 3c503 PIO support added by Jim Hague (jim.hague@acm.org) on 2/17/98
  17. RX overrun by Klaus Espenlaub (espenlaub@informatik.uni-ulm.de) on 3/10/99
  18. parts taken from the Linux 8390 driver (by Donald Becker and Paul Gortmaker)
  19. SMC8416 PIO support added by Andrew Bettison (andrewb@zip.com.au) on 4/3/02
  20. based on the Linux 8390 driver (by Donald Becker and Paul Gortmaker)
  21. **************************************************************************/
  22. #include "etherboot.h"
  23. #include "nic.h"
  24. #include "ns8390.h"
  25. #ifdef INCLUDE_NS8390
  26. #include "pci.h"
  27. #else
  28. #include "isa.h"
  29. #endif
  30. static unsigned char eth_vendor, eth_flags;
  31. #ifdef INCLUDE_WD
  32. static unsigned char eth_laar;
  33. #endif
  34. static unsigned short eth_nic_base, eth_asic_base;
  35. static unsigned char eth_memsize, eth_rx_start, eth_tx_start;
  36. static Address eth_bmem, eth_rmem;
  37. static unsigned char eth_drain_receiver;
  38. #ifdef INCLUDE_WD
  39. static struct wd_board {
  40. const char *name;
  41. char id;
  42. char flags;
  43. char memsize;
  44. } wd_boards[] = {
  45. {"WD8003S", TYPE_WD8003S, 0, MEM_8192},
  46. {"WD8003E", TYPE_WD8003E, 0, MEM_8192},
  47. {"WD8013EBT", TYPE_WD8013EBT, FLAG_16BIT, MEM_16384},
  48. {"WD8003W", TYPE_WD8003W, 0, MEM_8192},
  49. {"WD8003EB", TYPE_WD8003EB, 0, MEM_8192},
  50. {"WD8013W", TYPE_WD8013W, FLAG_16BIT, MEM_16384},
  51. {"WD8003EP/WD8013EP",
  52. TYPE_WD8013EP, 0, MEM_8192},
  53. {"WD8013WC", TYPE_WD8013WC, FLAG_16BIT, MEM_16384},
  54. {"WD8013EPC", TYPE_WD8013EPC, FLAG_16BIT, MEM_16384},
  55. {"SMC8216T", TYPE_SMC8216T, FLAG_16BIT | FLAG_790, MEM_16384},
  56. {"SMC8216C", TYPE_SMC8216C, FLAG_16BIT | FLAG_790, MEM_16384},
  57. {"SMC8416T", TYPE_SMC8416T, FLAG_16BIT | FLAG_790, MEM_8192},
  58. {"SMC8416C/BT", TYPE_SMC8416C, FLAG_16BIT | FLAG_790, MEM_8192},
  59. {"SMC8013EBP", TYPE_SMC8013EBP,FLAG_16BIT, MEM_16384},
  60. {NULL, 0, 0, 0}
  61. };
  62. #endif
  63. #ifdef INCLUDE_3C503
  64. static unsigned char t503_output; /* AUI or internal xcvr (Thinnet) */
  65. #endif
  66. #if defined(INCLUDE_WD)
  67. #define ASIC_PIO WD_IAR
  68. #define eth_probe wd_probe
  69. #if defined(INCLUDE_3C503) || defined(INCLUDE_NE) || defined(INCLUDE_NS8390)
  70. Error you must only define one of INCLUDE_WD, INCLUDE_3C503, INCLUDE_NE, INCLUDE_NS8390
  71. #endif
  72. #endif
  73. #if defined(INCLUDE_3C503)
  74. #define eth_probe t503_probe
  75. #if defined(INCLUDE_NE) || defined(INCLUDE_NS8390) || defined(INCLUDE_WD)
  76. Error you must only define one of INCLUDE_WD, INCLUDE_3C503, INCLUDE_NE, INCLUDE_NS8390
  77. #endif
  78. #endif
  79. #if defined(INCLUDE_NE)
  80. #define eth_probe ne_probe
  81. #if defined(INCLUDE_NS8390) || defined(INCLUDE_3C503) || defined(INCLUDE_WD)
  82. Error you must only define one of INCLUDE_WD, INCLUDE_3C503, INCLUDE_NE, INCLUDE_NS8390
  83. #endif
  84. #endif
  85. #if defined(INCLUDE_NS8390)
  86. #define eth_probe nepci_probe
  87. #if defined(INCLUDE_NE) || defined(INCLUDE_3C503) || defined(INCLUDE_WD)
  88. Error you must only define one of INCLUDE_WD, INCLUDE_3C503, INCLUDE_NE, INCLUDE_NS8390
  89. #endif
  90. #endif
  91. #if defined(INCLUDE_3C503)
  92. #define ASIC_PIO _3COM_RFMSB
  93. #else
  94. #if defined(INCLUDE_NE) || defined(INCLUDE_NS8390)
  95. #define ASIC_PIO NE_DATA
  96. #endif
  97. #endif
  98. #if defined(INCLUDE_NE) || defined(INCLUDE_NS8390) || (defined(INCLUDE_3C503) && !defined(T503_SHMEM)) || (defined(INCLUDE_WD) && defined(WD_790_PIO))
  99. /**************************************************************************
  100. ETH_PIO_READ - Read a frame via Programmed I/O
  101. **************************************************************************/
  102. static void eth_pio_read(unsigned int src, unsigned char *dst, unsigned int cnt)
  103. {
  104. #ifdef INCLUDE_WD
  105. outb(src & 0xff, eth_asic_base + WD_GP2);
  106. outb(src >> 8, eth_asic_base + WD_GP2);
  107. #else
  108. outb(D8390_COMMAND_RD2 |
  109. D8390_COMMAND_STA, eth_nic_base + D8390_P0_COMMAND);
  110. outb(cnt, eth_nic_base + D8390_P0_RBCR0);
  111. outb(cnt>>8, eth_nic_base + D8390_P0_RBCR1);
  112. outb(src, eth_nic_base + D8390_P0_RSAR0);
  113. outb(src>>8, eth_nic_base + D8390_P0_RSAR1);
  114. outb(D8390_COMMAND_RD0 |
  115. D8390_COMMAND_STA, eth_nic_base + D8390_P0_COMMAND);
  116. #ifdef INCLUDE_3C503
  117. outb(src & 0xff, eth_asic_base + _3COM_DALSB);
  118. outb(src >> 8, eth_asic_base + _3COM_DAMSB);
  119. outb(t503_output | _3COM_CR_START, eth_asic_base + _3COM_CR);
  120. #endif
  121. #endif
  122. if (eth_flags & FLAG_16BIT)
  123. cnt = (cnt + 1) >> 1;
  124. while(cnt--) {
  125. #ifdef INCLUDE_3C503
  126. while((inb(eth_asic_base + _3COM_STREG) & _3COM_STREG_DPRDY) == 0)
  127. ;
  128. #endif
  129. if (eth_flags & FLAG_16BIT) {
  130. *((unsigned short *)dst) = inw(eth_asic_base + ASIC_PIO);
  131. dst += 2;
  132. }
  133. else
  134. *(dst++) = inb(eth_asic_base + ASIC_PIO);
  135. }
  136. #ifdef INCLUDE_3C503
  137. outb(t503_output, eth_asic_base + _3COM_CR);
  138. #endif
  139. }
  140. /**************************************************************************
  141. ETH_PIO_WRITE - Write a frame via Programmed I/O
  142. **************************************************************************/
  143. static void eth_pio_write(const unsigned char *src, unsigned int dst, unsigned int cnt)
  144. {
  145. #ifdef COMPEX_RL2000_FIX
  146. unsigned int x;
  147. #endif /* COMPEX_RL2000_FIX */
  148. #ifdef INCLUDE_WD
  149. outb(dst & 0xff, eth_asic_base + WD_GP2);
  150. outb(dst >> 8, eth_asic_base + WD_GP2);
  151. #else
  152. outb(D8390_COMMAND_RD2 |
  153. D8390_COMMAND_STA, eth_nic_base + D8390_P0_COMMAND);
  154. outb(D8390_ISR_RDC, eth_nic_base + D8390_P0_ISR);
  155. outb(cnt, eth_nic_base + D8390_P0_RBCR0);
  156. outb(cnt>>8, eth_nic_base + D8390_P0_RBCR1);
  157. outb(dst, eth_nic_base + D8390_P0_RSAR0);
  158. outb(dst>>8, eth_nic_base + D8390_P0_RSAR1);
  159. outb(D8390_COMMAND_RD1 |
  160. D8390_COMMAND_STA, eth_nic_base + D8390_P0_COMMAND);
  161. #ifdef INCLUDE_3C503
  162. outb(dst & 0xff, eth_asic_base + _3COM_DALSB);
  163. outb(dst >> 8, eth_asic_base + _3COM_DAMSB);
  164. outb(t503_output | _3COM_CR_DDIR | _3COM_CR_START, eth_asic_base + _3COM_CR);
  165. #endif
  166. #endif
  167. if (eth_flags & FLAG_16BIT)
  168. cnt = (cnt + 1) >> 1;
  169. while(cnt--)
  170. {
  171. #ifdef INCLUDE_3C503
  172. while((inb(eth_asic_base + _3COM_STREG) & _3COM_STREG_DPRDY) == 0)
  173. ;
  174. #endif
  175. if (eth_flags & FLAG_16BIT) {
  176. outw(*((unsigned short *)src), eth_asic_base + ASIC_PIO);
  177. src += 2;
  178. }
  179. else
  180. outb(*(src++), eth_asic_base + ASIC_PIO);
  181. }
  182. #ifdef INCLUDE_3C503
  183. outb(t503_output, eth_asic_base + _3COM_CR);
  184. #else
  185. #ifdef COMPEX_RL2000_FIX
  186. for (x = 0;
  187. x < COMPEX_RL2000_TRIES &&
  188. (inb(eth_nic_base + D8390_P0_ISR) & D8390_ISR_RDC)
  189. != D8390_ISR_RDC;
  190. ++x);
  191. if (x >= COMPEX_RL2000_TRIES)
  192. printf("Warning: Compex RL2000 aborted wait!\n");
  193. #endif /* COMPEX_RL2000_FIX */
  194. #ifndef INCLUDE_WD
  195. while((inb(eth_nic_base + D8390_P0_ISR) & D8390_ISR_RDC)
  196. != D8390_ISR_RDC);
  197. #endif
  198. #endif
  199. }
  200. #else
  201. /**************************************************************************
  202. ETH_PIO_READ - Dummy routine when NE2000 not compiled in
  203. **************************************************************************/
  204. static void eth_pio_read(unsigned int src __unused, unsigned char *dst __unused, unsigned int cnt __unused) {}
  205. #endif
  206. /**************************************************************************
  207. enable_multycast - Enable Multicast
  208. **************************************************************************/
  209. static void enable_multicast(unsigned short eth_nic_base)
  210. {
  211. unsigned char mcfilter[8];
  212. int i;
  213. memset(mcfilter, 0xFF, 8);
  214. outb(4, eth_nic_base+D8390_P0_RCR);
  215. outb(D8390_COMMAND_RD2 + D8390_COMMAND_PS1, eth_nic_base + D8390_P0_COMMAND);
  216. for(i=0;i<8;i++)
  217. {
  218. outb(mcfilter[i], eth_nic_base + 8 + i);
  219. if(inb(eth_nic_base + 8 + i)!=mcfilter[i])
  220. printf("Error SMC 83C690 Multicast filter read/write mishap %d\n",i);
  221. }
  222. outb(D8390_COMMAND_RD2 + D8390_COMMAND_PS0, eth_nic_base + D8390_P0_COMMAND);
  223. outb(4 | 0x08, eth_nic_base+D8390_P0_RCR);
  224. }
  225. /**************************************************************************
  226. NS8390_RESET - Reset adapter
  227. **************************************************************************/
  228. static void ns8390_reset(struct nic *nic)
  229. {
  230. int i;
  231. eth_drain_receiver = 0;
  232. #ifdef INCLUDE_WD
  233. if (eth_flags & FLAG_790)
  234. outb(D8390_COMMAND_PS0 | D8390_COMMAND_STP, eth_nic_base+D8390_P0_COMMAND);
  235. else
  236. #endif
  237. outb(D8390_COMMAND_PS0 | D8390_COMMAND_RD2 |
  238. D8390_COMMAND_STP, eth_nic_base+D8390_P0_COMMAND);
  239. if (eth_flags & FLAG_16BIT)
  240. outb(0x49, eth_nic_base+D8390_P0_DCR);
  241. else
  242. outb(0x48, eth_nic_base+D8390_P0_DCR);
  243. outb(0, eth_nic_base+D8390_P0_RBCR0);
  244. outb(0, eth_nic_base+D8390_P0_RBCR1);
  245. outb(0x20, eth_nic_base+D8390_P0_RCR); /* monitor mode */
  246. outb(2, eth_nic_base+D8390_P0_TCR);
  247. outb(eth_tx_start, eth_nic_base+D8390_P0_TPSR);
  248. outb(eth_rx_start, eth_nic_base+D8390_P0_PSTART);
  249. #ifdef INCLUDE_WD
  250. if (eth_flags & FLAG_790) {
  251. #ifdef WD_790_PIO
  252. outb(0x10, eth_asic_base + 0x06); /* disable interrupts, enable PIO */
  253. outb(0x01, eth_nic_base + 0x09); /* enable ring read auto-wrap */
  254. #else
  255. outb(0, eth_nic_base + 0x09);
  256. #endif
  257. }
  258. #endif
  259. outb(eth_memsize, eth_nic_base+D8390_P0_PSTOP);
  260. outb(eth_memsize - 1, eth_nic_base+D8390_P0_BOUND);
  261. outb(0xFF, eth_nic_base+D8390_P0_ISR);
  262. outb(0, eth_nic_base+D8390_P0_IMR);
  263. #ifdef INCLUDE_WD
  264. if (eth_flags & FLAG_790)
  265. outb(D8390_COMMAND_PS1 |
  266. D8390_COMMAND_STP, eth_nic_base+D8390_P0_COMMAND);
  267. else
  268. #endif
  269. outb(D8390_COMMAND_PS1 |
  270. D8390_COMMAND_RD2 | D8390_COMMAND_STP, eth_nic_base+D8390_P0_COMMAND);
  271. for (i=0; i<ETH_ALEN; i++)
  272. outb(nic->node_addr[i], eth_nic_base+D8390_P1_PAR0+i);
  273. for (i=0; i<ETH_ALEN; i++)
  274. outb(0xFF, eth_nic_base+D8390_P1_MAR0+i);
  275. outb(eth_rx_start, eth_nic_base+D8390_P1_CURR);
  276. #ifdef INCLUDE_WD
  277. if (eth_flags & FLAG_790)
  278. outb(D8390_COMMAND_PS0 |
  279. D8390_COMMAND_STA, eth_nic_base+D8390_P0_COMMAND);
  280. else
  281. #endif
  282. outb(D8390_COMMAND_PS0 |
  283. D8390_COMMAND_RD2 | D8390_COMMAND_STA, eth_nic_base+D8390_P0_COMMAND);
  284. outb(0xFF, eth_nic_base+D8390_P0_ISR);
  285. outb(0, eth_nic_base+D8390_P0_TCR); /* transmitter on */
  286. outb(4, eth_nic_base+D8390_P0_RCR); /* allow rx broadcast frames */
  287. enable_multicast(eth_nic_base);
  288. #ifdef INCLUDE_3C503
  289. /*
  290. * No way to tell whether or not we're supposed to use
  291. * the 3Com's transceiver unless the user tells us.
  292. * 'flags' should have some compile time default value
  293. * which can be changed from the command menu.
  294. */
  295. t503_output = (nic->flags) ? 0 : _3COM_CR_XSEL;
  296. outb(t503_output, eth_asic_base + _3COM_CR);
  297. #endif
  298. }
  299. static int ns8390_poll(struct nic *nic, int retrieve);
  300. #ifndef INCLUDE_3C503
  301. /**************************************************************************
  302. ETH_RX_OVERRUN - Bring adapter back to work after an RX overrun
  303. **************************************************************************/
  304. static void eth_rx_overrun(struct nic *nic)
  305. {
  306. int start_time;
  307. #ifdef INCLUDE_WD
  308. if (eth_flags & FLAG_790)
  309. outb(D8390_COMMAND_PS0 | D8390_COMMAND_STP, eth_nic_base+D8390_P0_COMMAND);
  310. else
  311. #endif
  312. outb(D8390_COMMAND_PS0 | D8390_COMMAND_RD2 |
  313. D8390_COMMAND_STP, eth_nic_base+D8390_P0_COMMAND);
  314. /* wait for at least 1.6ms - we wait one timer tick */
  315. start_time = currticks();
  316. while (currticks() - start_time <= 1)
  317. /* Nothing */;
  318. outb(0, eth_nic_base+D8390_P0_RBCR0); /* reset byte counter */
  319. outb(0, eth_nic_base+D8390_P0_RBCR1);
  320. /*
  321. * Linux driver checks for interrupted TX here. This is not necessary,
  322. * because the transmit routine waits until the frame is sent.
  323. */
  324. /* enter loopback mode and restart NIC */
  325. outb(2, eth_nic_base+D8390_P0_TCR);
  326. #ifdef INCLUDE_WD
  327. if (eth_flags & FLAG_790)
  328. outb(D8390_COMMAND_PS0 | D8390_COMMAND_STA, eth_nic_base+D8390_P0_COMMAND);
  329. else
  330. #endif
  331. outb(D8390_COMMAND_PS0 | D8390_COMMAND_RD2 |
  332. D8390_COMMAND_STA, eth_nic_base+D8390_P0_COMMAND);
  333. /* clear the RX ring, acknowledge overrun interrupt */
  334. eth_drain_receiver = 1;
  335. while (ns8390_poll(nic, 1))
  336. /* Nothing */;
  337. eth_drain_receiver = 0;
  338. outb(D8390_ISR_OVW, eth_nic_base+D8390_P0_ISR);
  339. /* leave loopback mode - no packets to be resent (see Linux driver) */
  340. outb(0, eth_nic_base+D8390_P0_TCR);
  341. }
  342. #endif /* INCLUDE_3C503 */
  343. /**************************************************************************
  344. NS8390_TRANSMIT - Transmit a frame
  345. **************************************************************************/
  346. static void ns8390_transmit(
  347. struct nic *nic,
  348. const char *d, /* Destination */
  349. unsigned int t, /* Type */
  350. unsigned int s, /* size */
  351. const char *p) /* Packet */
  352. {
  353. #if defined(INCLUDE_3C503) || (defined(INCLUDE_WD) && ! defined(WD_790_PIO))
  354. Address eth_vmem = bus_to_virt(eth_bmem);
  355. #endif
  356. #ifdef INCLUDE_3C503
  357. if (!(eth_flags & FLAG_PIO)) {
  358. memcpy((char *)eth_vmem, d, ETH_ALEN); /* dst */
  359. memcpy((char *)eth_vmem+ETH_ALEN, nic->node_addr, ETH_ALEN); /* src */
  360. *((char *)eth_vmem+12) = t>>8; /* type */
  361. *((char *)eth_vmem+13) = t;
  362. memcpy((char *)eth_vmem+ETH_HLEN, p, s);
  363. s += ETH_HLEN;
  364. while (s < ETH_ZLEN) *((char *)eth_vmem+(s++)) = 0;
  365. }
  366. #endif
  367. #ifdef INCLUDE_WD
  368. if (eth_flags & FLAG_16BIT) {
  369. outb(eth_laar | WD_LAAR_M16EN, eth_asic_base + WD_LAAR);
  370. inb(0x84);
  371. }
  372. #ifndef WD_790_PIO
  373. /* Memory interface */
  374. if (eth_flags & FLAG_790) {
  375. outb(WD_MSR_MENB, eth_asic_base + WD_MSR);
  376. inb(0x84);
  377. }
  378. inb(0x84);
  379. memcpy((char *)eth_vmem, d, ETH_ALEN); /* dst */
  380. memcpy((char *)eth_vmem+ETH_ALEN, nic->node_addr, ETH_ALEN); /* src */
  381. *((char *)eth_vmem+12) = t>>8; /* type */
  382. *((char *)eth_vmem+13) = t;
  383. memcpy((char *)eth_vmem+ETH_HLEN, p, s);
  384. s += ETH_HLEN;
  385. while (s < ETH_ZLEN) *((char *)eth_vmem+(s++)) = 0;
  386. if (eth_flags & FLAG_790) {
  387. outb(0, eth_asic_base + WD_MSR);
  388. inb(0x84);
  389. }
  390. #else
  391. inb(0x84);
  392. #endif
  393. #endif
  394. #if defined(INCLUDE_3C503)
  395. if (eth_flags & FLAG_PIO)
  396. #endif
  397. #if defined(INCLUDE_NE) || defined(INCLUDE_NS8390) || (defined(INCLUDE_3C503) && !defined(T503_SHMEM)) || (defined(INCLUDE_WD) && defined(WD_790_PIO))
  398. {
  399. /* Programmed I/O */
  400. unsigned short type;
  401. type = (t >> 8) | (t << 8);
  402. eth_pio_write(d, eth_tx_start<<8, ETH_ALEN);
  403. eth_pio_write(nic->node_addr, (eth_tx_start<<8)+ETH_ALEN, ETH_ALEN);
  404. /* bcc generates worse code without (const+const) below */
  405. eth_pio_write((unsigned char *)&type, (eth_tx_start<<8)+(ETH_ALEN+ETH_ALEN), 2);
  406. eth_pio_write(p, (eth_tx_start<<8)+ETH_HLEN, s);
  407. s += ETH_HLEN;
  408. if (s < ETH_ZLEN) s = ETH_ZLEN;
  409. }
  410. #endif
  411. #if defined(INCLUDE_3C503)
  412. #endif
  413. #ifdef INCLUDE_WD
  414. if (eth_flags & FLAG_16BIT) {
  415. outb(eth_laar & ~WD_LAAR_M16EN, eth_asic_base + WD_LAAR);
  416. inb(0x84);
  417. }
  418. if (eth_flags & FLAG_790)
  419. outb(D8390_COMMAND_PS0 |
  420. D8390_COMMAND_STA, eth_nic_base+D8390_P0_COMMAND);
  421. else
  422. #endif
  423. outb(D8390_COMMAND_PS0 |
  424. D8390_COMMAND_RD2 | D8390_COMMAND_STA, eth_nic_base+D8390_P0_COMMAND);
  425. outb(eth_tx_start, eth_nic_base+D8390_P0_TPSR);
  426. outb(s, eth_nic_base+D8390_P0_TBCR0);
  427. outb(s>>8, eth_nic_base+D8390_P0_TBCR1);
  428. #ifdef INCLUDE_WD
  429. if (eth_flags & FLAG_790)
  430. outb(D8390_COMMAND_PS0 |
  431. D8390_COMMAND_TXP | D8390_COMMAND_STA, eth_nic_base+D8390_P0_COMMAND);
  432. else
  433. #endif
  434. outb(D8390_COMMAND_PS0 |
  435. D8390_COMMAND_TXP | D8390_COMMAND_RD2 |
  436. D8390_COMMAND_STA, eth_nic_base+D8390_P0_COMMAND);
  437. }
  438. /**************************************************************************
  439. NS8390_POLL - Wait for a frame
  440. **************************************************************************/
  441. static int ns8390_poll(struct nic *nic, int retrieve)
  442. {
  443. int ret = 0;
  444. unsigned char rstat, curr, next;
  445. unsigned short len, frag;
  446. unsigned short pktoff;
  447. unsigned char *p;
  448. struct ringbuffer pkthdr;
  449. #ifndef INCLUDE_3C503
  450. /* avoid infinite recursion: see eth_rx_overrun() */
  451. if (!eth_drain_receiver && (inb(eth_nic_base+D8390_P0_ISR) & D8390_ISR_OVW)) {
  452. eth_rx_overrun(nic);
  453. return(0);
  454. }
  455. #endif /* INCLUDE_3C503 */
  456. rstat = inb(eth_nic_base+D8390_P0_RSR);
  457. if (!(rstat & D8390_RSTAT_PRX)) return(0);
  458. next = inb(eth_nic_base+D8390_P0_BOUND)+1;
  459. if (next >= eth_memsize) next = eth_rx_start;
  460. outb(D8390_COMMAND_PS1, eth_nic_base+D8390_P0_COMMAND);
  461. curr = inb(eth_nic_base+D8390_P1_CURR);
  462. outb(D8390_COMMAND_PS0, eth_nic_base+D8390_P0_COMMAND);
  463. if (curr >= eth_memsize) curr=eth_rx_start;
  464. if (curr == next) return(0);
  465. if ( ! retrieve ) return 1;
  466. #ifdef INCLUDE_WD
  467. if (eth_flags & FLAG_16BIT) {
  468. outb(eth_laar | WD_LAAR_M16EN, eth_asic_base + WD_LAAR);
  469. inb(0x84);
  470. }
  471. #ifndef WD_790_PIO
  472. if (eth_flags & FLAG_790) {
  473. outb(WD_MSR_MENB, eth_asic_base + WD_MSR);
  474. inb(0x84);
  475. }
  476. #endif
  477. inb(0x84);
  478. #endif
  479. pktoff = next << 8;
  480. if (eth_flags & FLAG_PIO)
  481. eth_pio_read(pktoff, (char *)&pkthdr, 4);
  482. else
  483. memcpy(&pkthdr, bus_to_virt(eth_rmem + pktoff), 4);
  484. pktoff += sizeof(pkthdr);
  485. /* incoming length includes FCS so must sub 4 */
  486. len = pkthdr.len - 4;
  487. if ((pkthdr.status & D8390_RSTAT_PRX) == 0 || len < ETH_ZLEN
  488. || len > ETH_FRAME_LEN) {
  489. printf("Bogus packet, ignoring\n");
  490. return (0);
  491. }
  492. else {
  493. p = nic->packet;
  494. nic->packetlen = len; /* available to caller */
  495. frag = (eth_memsize << 8) - pktoff;
  496. if (len > frag) { /* We have a wrap-around */
  497. /* read first part */
  498. if (eth_flags & FLAG_PIO)
  499. eth_pio_read(pktoff, p, frag);
  500. else
  501. memcpy(p, bus_to_virt(eth_rmem + pktoff), frag);
  502. pktoff = eth_rx_start << 8;
  503. p += frag;
  504. len -= frag;
  505. }
  506. /* read second part */
  507. if (eth_flags & FLAG_PIO)
  508. eth_pio_read(pktoff, p, len);
  509. else
  510. memcpy(p, bus_to_virt(eth_rmem + pktoff), len);
  511. ret = 1;
  512. }
  513. #ifdef INCLUDE_WD
  514. #ifndef WD_790_PIO
  515. if (eth_flags & FLAG_790) {
  516. outb(0, eth_asic_base + WD_MSR);
  517. inb(0x84);
  518. }
  519. #endif
  520. if (eth_flags & FLAG_16BIT) {
  521. outb(eth_laar & ~WD_LAAR_M16EN, eth_asic_base + WD_LAAR);
  522. inb(0x84);
  523. }
  524. inb(0x84);
  525. #endif
  526. next = pkthdr.next; /* frame number of next packet */
  527. if (next == eth_rx_start)
  528. next = eth_memsize;
  529. outb(next-1, eth_nic_base+D8390_P0_BOUND);
  530. return(ret);
  531. }
  532. /**************************************************************************
  533. NS8390_DISABLE - Turn off adapter
  534. **************************************************************************/
  535. static void ns8390_disable(struct dev *dev)
  536. {
  537. struct nic *nic = (struct nic *)dev;
  538. /* reset and disable merge */
  539. ns8390_reset(nic);
  540. }
  541. /**************************************************************************
  542. NS8390_IRQ - Enable, Disable, or Force interrupts
  543. **************************************************************************/
  544. static void ns8390_irq(struct nic *nic __unused, irq_action_t action __unused)
  545. {
  546. switch ( action ) {
  547. case DISABLE :
  548. break;
  549. case ENABLE :
  550. break;
  551. case FORCE :
  552. break;
  553. }
  554. }
  555. /**************************************************************************
  556. ETH_PROBE - Look for an adapter
  557. **************************************************************************/
  558. #ifdef INCLUDE_NS8390
  559. static int eth_probe (struct dev *dev, struct pci_device *pci)
  560. #else
  561. static int eth_probe (struct dev *dev, unsigned short *probe_addrs __unused)
  562. #endif
  563. {
  564. struct nic *nic = (struct nic *)dev;
  565. int i;
  566. #ifdef INCLUDE_NS8390
  567. unsigned short pci_probe_addrs[] = { pci->ioaddr, 0 };
  568. unsigned short *probe_addrs = pci_probe_addrs;
  569. #endif
  570. eth_vendor = VENDOR_NONE;
  571. eth_drain_receiver = 0;
  572. nic->irqno = 0;
  573. #ifdef INCLUDE_WD
  574. {
  575. /******************************************************************
  576. Search for WD/SMC cards
  577. ******************************************************************/
  578. struct wd_board *brd;
  579. unsigned short chksum;
  580. unsigned char c;
  581. for (eth_asic_base = WD_LOW_BASE; eth_asic_base <= WD_HIGH_BASE;
  582. eth_asic_base += 0x20) {
  583. chksum = 0;
  584. for (i=8; i<16; i++)
  585. chksum += inb(eth_asic_base+i);
  586. /* Extra checks to avoid soundcard */
  587. if ((chksum & 0xFF) == 0xFF &&
  588. inb(eth_asic_base+8) != 0xFF &&
  589. inb(eth_asic_base+9) != 0xFF)
  590. break;
  591. }
  592. if (eth_asic_base > WD_HIGH_BASE)
  593. return (0);
  594. /* We've found a board */
  595. eth_vendor = VENDOR_WD;
  596. eth_nic_base = eth_asic_base + WD_NIC_ADDR;
  597. nic->ioaddr = eth_nic_base;
  598. c = inb(eth_asic_base+WD_BID); /* Get board id */
  599. for (brd = wd_boards; brd->name; brd++)
  600. if (brd->id == c) break;
  601. if (!brd->name) {
  602. printf("Unknown WD/SMC NIC type %hhX\n", c);
  603. return (0); /* Unknown type */
  604. }
  605. eth_flags = brd->flags;
  606. eth_memsize = brd->memsize;
  607. eth_tx_start = 0;
  608. eth_rx_start = D8390_TXBUF_SIZE;
  609. if ((c == TYPE_WD8013EP) &&
  610. (inb(eth_asic_base + WD_ICR) & WD_ICR_16BIT)) {
  611. eth_flags = FLAG_16BIT;
  612. eth_memsize = MEM_16384;
  613. }
  614. if ((c & WD_SOFTCONFIG) && (!(eth_flags & FLAG_790))) {
  615. eth_bmem = (0x80000 |
  616. ((inb(eth_asic_base + WD_MSR) & 0x3F) << 13));
  617. } else
  618. eth_bmem = WD_DEFAULT_MEM;
  619. if (brd->id == TYPE_SMC8216T || brd->id == TYPE_SMC8216C) {
  620. /* from Linux driver, 8416BT detects as 8216 sometimes */
  621. unsigned int addr = inb(eth_asic_base + 0xb);
  622. if (((addr >> 4) & 3) == 0) {
  623. brd += 2;
  624. eth_memsize = brd->memsize;
  625. }
  626. }
  627. outb(0x80, eth_asic_base + WD_MSR); /* Reset */
  628. for (i=0; i<ETH_ALEN; i++) {
  629. nic->node_addr[i] = inb(i+eth_asic_base+WD_LAR);
  630. }
  631. printf("\n%s base %#hx", brd->name, eth_asic_base);
  632. if (eth_flags & FLAG_790) {
  633. #ifdef WD_790_PIO
  634. printf(", PIO mode, addr %!\n", nic->node_addr);
  635. eth_bmem = 0;
  636. eth_flags |= FLAG_PIO; /* force PIO mode */
  637. outb(0, eth_asic_base+WD_MSR);
  638. #else
  639. printf(", memory %#x, addr %!\n", eth_bmem, nic->node_addr);
  640. outb(WD_MSR_MENB, eth_asic_base+WD_MSR);
  641. outb((inb(eth_asic_base+0x04) |
  642. 0x80), eth_asic_base+0x04);
  643. outb(((unsigned)(eth_bmem >> 13) & 0x0F) |
  644. ((unsigned)(eth_bmem >> 11) & 0x40) |
  645. (inb(eth_asic_base+0x0B) & 0xB0), eth_asic_base+0x0B);
  646. outb((inb(eth_asic_base+0x04) &
  647. ~0x80), eth_asic_base+0x04);
  648. #endif
  649. } else {
  650. printf(", memory %#x, addr %!\n", eth_bmem, nic->node_addr);
  651. outb(((unsigned)(eth_bmem >> 13) & 0x3F) | 0x40, eth_asic_base+WD_MSR);
  652. }
  653. if (eth_flags & FLAG_16BIT) {
  654. if (eth_flags & FLAG_790) {
  655. eth_laar = inb(eth_asic_base + WD_LAAR);
  656. outb(WD_LAAR_M16EN, eth_asic_base + WD_LAAR);
  657. } else {
  658. outb((eth_laar =
  659. WD_LAAR_L16EN | 1), eth_asic_base + WD_LAAR);
  660. /*
  661. The previous line used to be
  662. WD_LAAR_M16EN | WD_LAAR_L16EN | 1));
  663. jluke@deakin.edu.au reported that removing WD_LAAR_M16EN made
  664. it work for WD8013s. This seems to work for my 8013 boards. I
  665. don't know what is really happening. I wish I had data sheets
  666. or more time to decode the Linux driver. - Ken
  667. */
  668. }
  669. inb(0x84);
  670. }
  671. }
  672. #endif
  673. #ifdef INCLUDE_3C503
  674. #ifdef T503_AUI
  675. nic->flags = 1; /* aui */
  676. #else
  677. nic->flags = 0; /* no aui */
  678. #endif
  679. /******************************************************************
  680. Search for 3Com 3c503 if no WD/SMC cards
  681. ******************************************************************/
  682. if (eth_vendor == VENDOR_NONE) {
  683. int idx;
  684. int iobase_reg, membase_reg;
  685. static unsigned short base[] = {
  686. 0x300, 0x310, 0x330, 0x350,
  687. 0x250, 0x280, 0x2A0, 0x2E0, 0 };
  688. /* Loop through possible addresses checking each one */
  689. for (idx = 0; (eth_nic_base = base[idx]) != 0; ++idx) {
  690. eth_asic_base = eth_nic_base + _3COM_ASIC_OFFSET;
  691. /*
  692. * Note that we use the same settings for both 8 and 16 bit cards:
  693. * both have an 8K bank of memory at page 1 while only the 16 bit
  694. * cards have a bank at page 0.
  695. */
  696. eth_memsize = MEM_16384;
  697. eth_tx_start = 32;
  698. eth_rx_start = 32 + D8390_TXBUF_SIZE;
  699. /* Check our base address. iobase and membase should */
  700. /* both have a maximum of 1 bit set or be 0. */
  701. iobase_reg = inb(eth_asic_base + _3COM_BCFR);
  702. membase_reg = inb(eth_asic_base + _3COM_PCFR);
  703. if ((iobase_reg & (iobase_reg - 1)) ||
  704. (membase_reg & (membase_reg - 1)))
  705. continue; /* nope */
  706. /* Now get the shared memory address */
  707. eth_flags = 0;
  708. switch (membase_reg) {
  709. case _3COM_PCFR_DC000:
  710. eth_bmem = 0xdc000;
  711. break;
  712. case _3COM_PCFR_D8000:
  713. eth_bmem = 0xd8000;
  714. break;
  715. case _3COM_PCFR_CC000:
  716. eth_bmem = 0xcc000;
  717. break;
  718. case _3COM_PCFR_C8000:
  719. eth_bmem = 0xc8000;
  720. break;
  721. case _3COM_PCFR_PIO:
  722. eth_flags |= FLAG_PIO;
  723. eth_bmem = 0;
  724. break;
  725. default:
  726. continue; /* nope */
  727. }
  728. break;
  729. }
  730. if (base[idx] == 0) /* not found */
  731. return (0);
  732. #ifndef T503_SHMEM
  733. eth_flags |= FLAG_PIO; /* force PIO mode */
  734. eth_bmem = 0;
  735. #endif
  736. eth_vendor = VENDOR_3COM;
  737. /* Need this to make ns8390_poll() happy. */
  738. eth_rmem = eth_bmem - 0x2000;
  739. /* Reset NIC and ASIC */
  740. outb(_3COM_CR_RST | _3COM_CR_XSEL, eth_asic_base + _3COM_CR );
  741. outb(_3COM_CR_XSEL, eth_asic_base + _3COM_CR );
  742. /* Get our ethernet address */
  743. outb(_3COM_CR_EALO | _3COM_CR_XSEL, eth_asic_base + _3COM_CR);
  744. nic->ioaddr = eth_nic_base;
  745. printf("\n3Com 3c503 base %#hx, ", eth_nic_base);
  746. if (eth_flags & FLAG_PIO)
  747. printf("PIO mode");
  748. else
  749. printf("memory %#x", eth_bmem);
  750. for (i=0; i<ETH_ALEN; i++) {
  751. nic->node_addr[i] = inb(eth_nic_base+i);
  752. }
  753. printf(", %s, addr %!\n", nic->flags ? "AUI" : "internal xcvr",
  754. nic->node_addr);
  755. outb(_3COM_CR_XSEL, eth_asic_base + _3COM_CR);
  756. /*
  757. * Initialize GA configuration register. Set bank and enable shared
  758. * mem. We always use bank 1. Disable interrupts.
  759. */
  760. outb(_3COM_GACFR_RSEL |
  761. _3COM_GACFR_MBS0 | _3COM_GACFR_TCM | _3COM_GACFR_NIM, eth_asic_base + _3COM_GACFR);
  762. outb(0xff, eth_asic_base + _3COM_VPTR2);
  763. outb(0xff, eth_asic_base + _3COM_VPTR1);
  764. outb(0x00, eth_asic_base + _3COM_VPTR0);
  765. /*
  766. * Clear memory and verify that it worked (we use only 8K)
  767. */
  768. if (!(eth_flags & FLAG_PIO)) {
  769. memset(bus_to_virt(eth_bmem), 0, 0x2000);
  770. for(i = 0; i < 0x2000; ++i)
  771. if (*((char *)(bus_to_virt(eth_bmem+i)))) {
  772. printf ("Failed to clear 3c503 shared mem.\n");
  773. return (0);
  774. }
  775. }
  776. /*
  777. * Initialize GA page/start/stop registers.
  778. */
  779. outb(eth_tx_start, eth_asic_base + _3COM_PSTR);
  780. outb(eth_memsize, eth_asic_base + _3COM_PSPR);
  781. }
  782. #endif
  783. #if defined(INCLUDE_NE) || defined(INCLUDE_NS8390)
  784. {
  785. /******************************************************************
  786. Search for NE1000/2000 if no WD/SMC or 3com cards
  787. ******************************************************************/
  788. unsigned char c;
  789. if (eth_vendor == VENDOR_NONE) {
  790. char romdata[16], testbuf[32];
  791. int idx;
  792. static char test[] = "NE*000 memory";
  793. static unsigned short base[] = {
  794. #ifdef NE_SCAN
  795. NE_SCAN,
  796. #endif
  797. 0 };
  798. /* if no addresses supplied, fall back on defaults */
  799. if (probe_addrs == 0 || probe_addrs[0] == 0)
  800. probe_addrs = base;
  801. eth_bmem = 0; /* No shared memory */
  802. for (idx = 0; (eth_nic_base = probe_addrs[idx]) != 0; ++idx) {
  803. eth_flags = FLAG_PIO;
  804. eth_asic_base = eth_nic_base + NE_ASIC_OFFSET;
  805. eth_memsize = MEM_16384;
  806. eth_tx_start = 32;
  807. eth_rx_start = 32 + D8390_TXBUF_SIZE;
  808. c = inb(eth_asic_base + NE_RESET);
  809. outb(c, eth_asic_base + NE_RESET);
  810. inb(0x84);
  811. outb(D8390_COMMAND_STP |
  812. D8390_COMMAND_RD2, eth_nic_base + D8390_P0_COMMAND);
  813. outb(D8390_RCR_MON, eth_nic_base + D8390_P0_RCR);
  814. outb(D8390_DCR_FT1 | D8390_DCR_LS, eth_nic_base + D8390_P0_DCR);
  815. outb(MEM_8192, eth_nic_base + D8390_P0_PSTART);
  816. outb(MEM_16384, eth_nic_base + D8390_P0_PSTOP);
  817. #ifdef NS8390_FORCE_16BIT
  818. eth_flags |= FLAG_16BIT; /* force 16-bit mode */
  819. #endif
  820. eth_pio_write(test, 8192, sizeof(test));
  821. eth_pio_read(8192, testbuf, sizeof(test));
  822. if (!memcmp(test, testbuf, sizeof(test)))
  823. break;
  824. eth_flags |= FLAG_16BIT;
  825. eth_memsize = MEM_32768;
  826. eth_tx_start = 64;
  827. eth_rx_start = 64 + D8390_TXBUF_SIZE;
  828. outb(D8390_DCR_WTS |
  829. D8390_DCR_FT1 | D8390_DCR_LS, eth_nic_base + D8390_P0_DCR);
  830. outb(MEM_16384, eth_nic_base + D8390_P0_PSTART);
  831. outb(MEM_32768, eth_nic_base + D8390_P0_PSTOP);
  832. eth_pio_write(test, 16384, sizeof(test));
  833. eth_pio_read(16384, testbuf, sizeof(test));
  834. if (!memcmp(testbuf, test, sizeof(test)))
  835. break;
  836. }
  837. if (eth_nic_base == 0)
  838. return (0);
  839. if (eth_nic_base > ISA_MAX_ADDR) /* PCI probably */
  840. eth_flags |= FLAG_16BIT;
  841. eth_vendor = VENDOR_NOVELL;
  842. eth_pio_read(0, romdata, sizeof(romdata));
  843. for (i=0; i<ETH_ALEN; i++) {
  844. nic->node_addr[i] = romdata[i + ((eth_flags & FLAG_16BIT) ? i : 0)];
  845. }
  846. nic->ioaddr = eth_nic_base;
  847. printf("\nNE%c000 base %#hx, addr %!\n",
  848. (eth_flags & FLAG_16BIT) ? '2' : '1', eth_nic_base,
  849. nic->node_addr);
  850. }
  851. }
  852. #endif
  853. if (eth_vendor == VENDOR_NONE)
  854. return(0);
  855. if (eth_vendor != VENDOR_3COM)
  856. eth_rmem = eth_bmem;
  857. ns8390_reset(nic);
  858. dev->disable = ns8390_disable;
  859. nic->poll = ns8390_poll;
  860. nic->transmit = ns8390_transmit;
  861. nic->irq = ns8390_irq;
  862. /* Based on PnP ISA map */
  863. #ifdef INCLUDE_WD
  864. dev->devid.vendor_id = htons(GENERIC_ISAPNP_VENDOR);
  865. dev->devid.device_id = htons(0x812a);
  866. #endif
  867. #ifdef INCLUDE_3C503
  868. dev->devid.vendor_id = htons(GENERIC_ISAPNP_VENDOR);
  869. dev->devid.device_id = htons(0x80f3);
  870. #endif
  871. #ifdef INCLUDE_NE
  872. dev->devid.vendor_id = htons(GENERIC_ISAPNP_VENDOR);
  873. dev->devid.device_id = htons(0x80d6);
  874. #endif
  875. return 1;
  876. }
  877. #ifdef INCLUDE_WD
  878. static struct isa_driver wd_driver __isa_driver = {
  879. .type = NIC_DRIVER,
  880. .name = "WD",
  881. .probe = wd_probe,
  882. .ioaddrs = 0,
  883. };
  884. ISA_ROM("wd","WD8003/8013, SMC8216/8416, SMC 83c790 (EtherEZ)");
  885. #endif
  886. #ifdef INCLUDE_3C503
  887. static struct isa_driver t503_driver __isa_driver = {
  888. .type = NIC_DRIVER,
  889. .name = "3C503",
  890. .probe = t503_probe,
  891. .ioaddrs = 0,
  892. };
  893. ISA_ROM("3c503","3Com503, Etherlink II[/16]");
  894. #endif
  895. #ifdef INCLUDE_NE
  896. static struct isa_driver ne_driver __isa_driver = {
  897. .type = NIC_DRIVER,
  898. .name = "NE*000",
  899. .probe = ne_probe,
  900. .ioaddrs = 0,
  901. };
  902. ISA_ROM("ne","NE1000/2000 and clones");
  903. #endif
  904. #ifdef INCLUDE_NS8390
  905. static struct pci_id nepci_nics[] = {
  906. /* A few NE2000 PCI clones, list not exhaustive */
  907. PCI_ROM(0x10ec, 0x8029, "rtl8029", "Realtek 8029"),
  908. PCI_ROM(0x1186, 0x0300, "dlink-528", "D-Link DE-528"),
  909. PCI_ROM(0x1050, 0x0940, "winbond940", "Winbond NE2000-PCI"), /* Winbond 86C940 / 89C940 */
  910. PCI_ROM(0x1050, 0x5a5a, "winbond940f", "Winbond W89c940F"), /* Winbond 89C940F */
  911. PCI_ROM(0x11f6, 0x1401, "compexrl2000", "Compex ReadyLink 2000"),
  912. PCI_ROM(0x8e2e, 0x3000, "ktiet32p2", "KTI ET32P2"),
  913. PCI_ROM(0x4a14, 0x5000, "nv5000sc", "NetVin NV5000SC"),
  914. PCI_ROM(0x12c3, 0x0058, "holtek80232", "Holtek HT80232"),
  915. PCI_ROM(0x12c3, 0x5598, "holtek80229", "Holtek HT80229"),
  916. PCI_ROM(0x10bd, 0x0e34, "surecom-ne34", "Surecom NE34"),
  917. PCI_ROM(0x1106, 0x0926, "via86c926", "Via 86c926"),
  918. };
  919. static struct pci_driver nepci_driver __pci_driver = {
  920. .type = NIC_DRIVER,
  921. .name = "NE2000/PCI",
  922. .probe = nepci_probe,
  923. .ids = nepci_nics,
  924. .id_count = sizeof(nepci_nics)/sizeof(nepci_nics[0]),
  925. .class = 0,
  926. };
  927. #endif /* INCLUDE_NS8390 */
  928. /*
  929. * Local variables:
  930. * c-basic-offset: 8
  931. * End:
  932. */