Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

ns8390.c 31KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023
  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. #warning "ns8390.c is a horrendous mess and needs to be tidied up"
  23. #if 0
  24. #include "etherboot.h"
  25. #include "nic.h"
  26. #include "ns8390.h"
  27. #ifdef INCLUDE_NS8390
  28. #include "pci.h"
  29. #else
  30. #include "isa.h"
  31. #endif
  32. static unsigned char eth_vendor, eth_flags;
  33. #ifdef INCLUDE_WD
  34. static unsigned char eth_laar;
  35. #endif
  36. static unsigned short eth_nic_base, eth_asic_base;
  37. static unsigned char eth_memsize, eth_rx_start, eth_tx_start;
  38. static Address eth_bmem, eth_rmem;
  39. static unsigned char eth_drain_receiver;
  40. #ifdef INCLUDE_WD
  41. static struct wd_board {
  42. const char *name;
  43. char id;
  44. char flags;
  45. char memsize;
  46. } wd_boards[] = {
  47. {"WD8003S", TYPE_WD8003S, 0, MEM_8192},
  48. {"WD8003E", TYPE_WD8003E, 0, MEM_8192},
  49. {"WD8013EBT", TYPE_WD8013EBT, FLAG_16BIT, MEM_16384},
  50. {"WD8003W", TYPE_WD8003W, 0, MEM_8192},
  51. {"WD8003EB", TYPE_WD8003EB, 0, MEM_8192},
  52. {"WD8013W", TYPE_WD8013W, FLAG_16BIT, MEM_16384},
  53. {"WD8003EP/WD8013EP",
  54. TYPE_WD8013EP, 0, MEM_8192},
  55. {"WD8013WC", TYPE_WD8013WC, FLAG_16BIT, MEM_16384},
  56. {"WD8013EPC", TYPE_WD8013EPC, FLAG_16BIT, MEM_16384},
  57. {"SMC8216T", TYPE_SMC8216T, FLAG_16BIT | FLAG_790, MEM_16384},
  58. {"SMC8216C", TYPE_SMC8216C, FLAG_16BIT | FLAG_790, MEM_16384},
  59. {"SMC8416T", TYPE_SMC8416T, FLAG_16BIT | FLAG_790, MEM_8192},
  60. {"SMC8416C/BT", TYPE_SMC8416C, FLAG_16BIT | FLAG_790, MEM_8192},
  61. {"SMC8013EBP", TYPE_SMC8013EBP,FLAG_16BIT, MEM_16384},
  62. {NULL, 0, 0, 0}
  63. };
  64. #endif
  65. #ifdef INCLUDE_3C503
  66. static unsigned char t503_output; /* AUI or internal xcvr (Thinnet) */
  67. #endif
  68. #if defined(INCLUDE_WD)
  69. #define ASIC_PIO WD_IAR
  70. #define eth_probe wd_probe
  71. #if defined(INCLUDE_3C503) || defined(INCLUDE_NE) || defined(INCLUDE_NS8390)
  72. Error you must only define one of INCLUDE_WD, INCLUDE_3C503, INCLUDE_NE, INCLUDE_NS8390
  73. #endif
  74. #endif
  75. #if defined(INCLUDE_3C503)
  76. #define eth_probe t503_probe
  77. #if defined(INCLUDE_NE) || defined(INCLUDE_NS8390) || defined(INCLUDE_WD)
  78. Error you must only define one of INCLUDE_WD, INCLUDE_3C503, INCLUDE_NE, INCLUDE_NS8390
  79. #endif
  80. #endif
  81. #if defined(INCLUDE_NE)
  82. #define eth_probe ne_probe
  83. #if defined(INCLUDE_NS8390) || defined(INCLUDE_3C503) || defined(INCLUDE_WD)
  84. Error you must only define one of INCLUDE_WD, INCLUDE_3C503, INCLUDE_NE, INCLUDE_NS8390
  85. #endif
  86. #endif
  87. #if defined(INCLUDE_NS8390)
  88. #define eth_probe nepci_probe
  89. #if defined(INCLUDE_NE) || defined(INCLUDE_3C503) || defined(INCLUDE_WD)
  90. Error you must only define one of INCLUDE_WD, INCLUDE_3C503, INCLUDE_NE, INCLUDE_NS8390
  91. #endif
  92. #endif
  93. #if defined(INCLUDE_3C503)
  94. #define ASIC_PIO _3COM_RFMSB
  95. #else
  96. #if defined(INCLUDE_NE) || defined(INCLUDE_NS8390)
  97. #define ASIC_PIO NE_DATA
  98. #endif
  99. #endif
  100. #if defined(INCLUDE_NE) || defined(INCLUDE_NS8390) || (defined(INCLUDE_3C503) && !defined(T503_SHMEM)) || (defined(INCLUDE_WD) && defined(WD_790_PIO))
  101. /**************************************************************************
  102. ETH_PIO_READ - Read a frame via Programmed I/O
  103. **************************************************************************/
  104. static void eth_pio_read(unsigned int src, unsigned char *dst, unsigned int cnt)
  105. {
  106. #ifdef INCLUDE_WD
  107. outb(src & 0xff, eth_asic_base + WD_GP2);
  108. outb(src >> 8, eth_asic_base + WD_GP2);
  109. #else
  110. outb(D8390_COMMAND_RD2 |
  111. D8390_COMMAND_STA, eth_nic_base + D8390_P0_COMMAND);
  112. outb(cnt, eth_nic_base + D8390_P0_RBCR0);
  113. outb(cnt>>8, eth_nic_base + D8390_P0_RBCR1);
  114. outb(src, eth_nic_base + D8390_P0_RSAR0);
  115. outb(src>>8, eth_nic_base + D8390_P0_RSAR1);
  116. outb(D8390_COMMAND_RD0 |
  117. D8390_COMMAND_STA, eth_nic_base + D8390_P0_COMMAND);
  118. #ifdef INCLUDE_3C503
  119. outb(src & 0xff, eth_asic_base + _3COM_DALSB);
  120. outb(src >> 8, eth_asic_base + _3COM_DAMSB);
  121. outb(t503_output | _3COM_CR_START, eth_asic_base + _3COM_CR);
  122. #endif
  123. #endif
  124. if (eth_flags & FLAG_16BIT)
  125. cnt = (cnt + 1) >> 1;
  126. while(cnt--) {
  127. #ifdef INCLUDE_3C503
  128. while((inb(eth_asic_base + _3COM_STREG) & _3COM_STREG_DPRDY) == 0)
  129. ;
  130. #endif
  131. if (eth_flags & FLAG_16BIT) {
  132. *((unsigned short *)dst) = inw(eth_asic_base + ASIC_PIO);
  133. dst += 2;
  134. }
  135. else
  136. *(dst++) = inb(eth_asic_base + ASIC_PIO);
  137. }
  138. #ifdef INCLUDE_3C503
  139. outb(t503_output, eth_asic_base + _3COM_CR);
  140. #endif
  141. }
  142. /**************************************************************************
  143. ETH_PIO_WRITE - Write a frame via Programmed I/O
  144. **************************************************************************/
  145. static void eth_pio_write(const unsigned char *src, unsigned int dst, unsigned int cnt)
  146. {
  147. #ifdef COMPEX_RL2000_FIX
  148. unsigned int x;
  149. #endif /* COMPEX_RL2000_FIX */
  150. #ifdef INCLUDE_WD
  151. outb(dst & 0xff, eth_asic_base + WD_GP2);
  152. outb(dst >> 8, eth_asic_base + WD_GP2);
  153. #else
  154. outb(D8390_COMMAND_RD2 |
  155. D8390_COMMAND_STA, eth_nic_base + D8390_P0_COMMAND);
  156. outb(D8390_ISR_RDC, eth_nic_base + D8390_P0_ISR);
  157. outb(cnt, eth_nic_base + D8390_P0_RBCR0);
  158. outb(cnt>>8, eth_nic_base + D8390_P0_RBCR1);
  159. outb(dst, eth_nic_base + D8390_P0_RSAR0);
  160. outb(dst>>8, eth_nic_base + D8390_P0_RSAR1);
  161. outb(D8390_COMMAND_RD1 |
  162. D8390_COMMAND_STA, eth_nic_base + D8390_P0_COMMAND);
  163. #ifdef INCLUDE_3C503
  164. outb(dst & 0xff, eth_asic_base + _3COM_DALSB);
  165. outb(dst >> 8, eth_asic_base + _3COM_DAMSB);
  166. outb(t503_output | _3COM_CR_DDIR | _3COM_CR_START, eth_asic_base + _3COM_CR);
  167. #endif
  168. #endif
  169. if (eth_flags & FLAG_16BIT)
  170. cnt = (cnt + 1) >> 1;
  171. while(cnt--)
  172. {
  173. #ifdef INCLUDE_3C503
  174. while((inb(eth_asic_base + _3COM_STREG) & _3COM_STREG_DPRDY) == 0)
  175. ;
  176. #endif
  177. if (eth_flags & FLAG_16BIT) {
  178. outw(*((unsigned short *)src), eth_asic_base + ASIC_PIO);
  179. src += 2;
  180. }
  181. else
  182. outb(*(src++), eth_asic_base + ASIC_PIO);
  183. }
  184. #ifdef INCLUDE_3C503
  185. outb(t503_output, eth_asic_base + _3COM_CR);
  186. #else
  187. #ifdef COMPEX_RL2000_FIX
  188. for (x = 0;
  189. x < COMPEX_RL2000_TRIES &&
  190. (inb(eth_nic_base + D8390_P0_ISR) & D8390_ISR_RDC)
  191. != D8390_ISR_RDC;
  192. ++x);
  193. if (x >= COMPEX_RL2000_TRIES)
  194. printf("Warning: Compex RL2000 aborted wait!\n");
  195. #endif /* COMPEX_RL2000_FIX */
  196. #ifndef INCLUDE_WD
  197. while((inb(eth_nic_base + D8390_P0_ISR) & D8390_ISR_RDC)
  198. != D8390_ISR_RDC);
  199. #endif
  200. #endif
  201. }
  202. #else
  203. /**************************************************************************
  204. ETH_PIO_READ - Dummy routine when NE2000 not compiled in
  205. **************************************************************************/
  206. static void eth_pio_read(unsigned int src __unused, unsigned char *dst __unused, unsigned int cnt __unused) {}
  207. #endif
  208. /**************************************************************************
  209. enable_multycast - Enable Multicast
  210. **************************************************************************/
  211. static void enable_multicast(unsigned short eth_nic_base)
  212. {
  213. unsigned char mcfilter[8];
  214. int i;
  215. memset(mcfilter, 0xFF, 8);
  216. outb(4, eth_nic_base+D8390_P0_RCR);
  217. outb(D8390_COMMAND_RD2 + D8390_COMMAND_PS1, eth_nic_base + D8390_P0_COMMAND);
  218. for(i=0;i<8;i++)
  219. {
  220. outb(mcfilter[i], eth_nic_base + 8 + i);
  221. if(inb(eth_nic_base + 8 + i)!=mcfilter[i])
  222. printf("Error SMC 83C690 Multicast filter read/write mishap %d\n",i);
  223. }
  224. outb(D8390_COMMAND_RD2 + D8390_COMMAND_PS0, eth_nic_base + D8390_P0_COMMAND);
  225. outb(4 | 0x08, eth_nic_base+D8390_P0_RCR);
  226. }
  227. /**************************************************************************
  228. NS8390_RESET - Reset adapter
  229. **************************************************************************/
  230. static void ns8390_reset(struct nic *nic)
  231. {
  232. int i;
  233. eth_drain_receiver = 0;
  234. #ifdef INCLUDE_WD
  235. if (eth_flags & FLAG_790)
  236. outb(D8390_COMMAND_PS0 | D8390_COMMAND_STP, eth_nic_base+D8390_P0_COMMAND);
  237. else
  238. #endif
  239. outb(D8390_COMMAND_PS0 | D8390_COMMAND_RD2 |
  240. D8390_COMMAND_STP, eth_nic_base+D8390_P0_COMMAND);
  241. if (eth_flags & FLAG_16BIT)
  242. outb(0x49, eth_nic_base+D8390_P0_DCR);
  243. else
  244. outb(0x48, eth_nic_base+D8390_P0_DCR);
  245. outb(0, eth_nic_base+D8390_P0_RBCR0);
  246. outb(0, eth_nic_base+D8390_P0_RBCR1);
  247. outb(0x20, eth_nic_base+D8390_P0_RCR); /* monitor mode */
  248. outb(2, eth_nic_base+D8390_P0_TCR);
  249. outb(eth_tx_start, eth_nic_base+D8390_P0_TPSR);
  250. outb(eth_rx_start, eth_nic_base+D8390_P0_PSTART);
  251. #ifdef INCLUDE_WD
  252. if (eth_flags & FLAG_790) {
  253. #ifdef WD_790_PIO
  254. outb(0x10, eth_asic_base + 0x06); /* disable interrupts, enable PIO */
  255. outb(0x01, eth_nic_base + 0x09); /* enable ring read auto-wrap */
  256. #else
  257. outb(0, eth_nic_base + 0x09);
  258. #endif
  259. }
  260. #endif
  261. outb(eth_memsize, eth_nic_base+D8390_P0_PSTOP);
  262. outb(eth_memsize - 1, eth_nic_base+D8390_P0_BOUND);
  263. outb(0xFF, eth_nic_base+D8390_P0_ISR);
  264. outb(0, eth_nic_base+D8390_P0_IMR);
  265. #ifdef INCLUDE_WD
  266. if (eth_flags & FLAG_790)
  267. outb(D8390_COMMAND_PS1 |
  268. D8390_COMMAND_STP, eth_nic_base+D8390_P0_COMMAND);
  269. else
  270. #endif
  271. outb(D8390_COMMAND_PS1 |
  272. D8390_COMMAND_RD2 | D8390_COMMAND_STP, eth_nic_base+D8390_P0_COMMAND);
  273. for (i=0; i<ETH_ALEN; i++)
  274. outb(nic->node_addr[i], eth_nic_base+D8390_P1_PAR0+i);
  275. for (i=0; i<ETH_ALEN; i++)
  276. outb(0xFF, eth_nic_base+D8390_P1_MAR0+i);
  277. outb(eth_rx_start, eth_nic_base+D8390_P1_CURR);
  278. #ifdef INCLUDE_WD
  279. if (eth_flags & FLAG_790)
  280. outb(D8390_COMMAND_PS0 |
  281. D8390_COMMAND_STA, eth_nic_base+D8390_P0_COMMAND);
  282. else
  283. #endif
  284. outb(D8390_COMMAND_PS0 |
  285. D8390_COMMAND_RD2 | D8390_COMMAND_STA, eth_nic_base+D8390_P0_COMMAND);
  286. outb(0xFF, eth_nic_base+D8390_P0_ISR);
  287. outb(0, eth_nic_base+D8390_P0_TCR); /* transmitter on */
  288. outb(4, eth_nic_base+D8390_P0_RCR); /* allow rx broadcast frames */
  289. enable_multicast(eth_nic_base);
  290. #ifdef INCLUDE_3C503
  291. /*
  292. * No way to tell whether or not we're supposed to use
  293. * the 3Com's transceiver unless the user tells us.
  294. * 'flags' should have some compile time default value
  295. * which can be changed from the command menu.
  296. */
  297. t503_output = (nic->flags) ? 0 : _3COM_CR_XSEL;
  298. outb(t503_output, eth_asic_base + _3COM_CR);
  299. #endif
  300. }
  301. static int ns8390_poll(struct nic *nic, int retrieve);
  302. #ifndef INCLUDE_3C503
  303. /**************************************************************************
  304. ETH_RX_OVERRUN - Bring adapter back to work after an RX overrun
  305. **************************************************************************/
  306. static void eth_rx_overrun(struct nic *nic)
  307. {
  308. int start_time;
  309. #ifdef INCLUDE_WD
  310. if (eth_flags & FLAG_790)
  311. outb(D8390_COMMAND_PS0 | D8390_COMMAND_STP, eth_nic_base+D8390_P0_COMMAND);
  312. else
  313. #endif
  314. outb(D8390_COMMAND_PS0 | D8390_COMMAND_RD2 |
  315. D8390_COMMAND_STP, eth_nic_base+D8390_P0_COMMAND);
  316. /* wait for at least 1.6ms - we wait one timer tick */
  317. start_time = currticks();
  318. while (currticks() - start_time <= 1)
  319. /* Nothing */;
  320. outb(0, eth_nic_base+D8390_P0_RBCR0); /* reset byte counter */
  321. outb(0, eth_nic_base+D8390_P0_RBCR1);
  322. /*
  323. * Linux driver checks for interrupted TX here. This is not necessary,
  324. * because the transmit routine waits until the frame is sent.
  325. */
  326. /* enter loopback mode and restart NIC */
  327. outb(2, eth_nic_base+D8390_P0_TCR);
  328. #ifdef INCLUDE_WD
  329. if (eth_flags & FLAG_790)
  330. outb(D8390_COMMAND_PS0 | D8390_COMMAND_STA, eth_nic_base+D8390_P0_COMMAND);
  331. else
  332. #endif
  333. outb(D8390_COMMAND_PS0 | D8390_COMMAND_RD2 |
  334. D8390_COMMAND_STA, eth_nic_base+D8390_P0_COMMAND);
  335. /* clear the RX ring, acknowledge overrun interrupt */
  336. eth_drain_receiver = 1;
  337. while (ns8390_poll(nic, 1))
  338. /* Nothing */;
  339. eth_drain_receiver = 0;
  340. outb(D8390_ISR_OVW, eth_nic_base+D8390_P0_ISR);
  341. /* leave loopback mode - no packets to be resent (see Linux driver) */
  342. outb(0, eth_nic_base+D8390_P0_TCR);
  343. }
  344. #endif /* INCLUDE_3C503 */
  345. /**************************************************************************
  346. NS8390_TRANSMIT - Transmit a frame
  347. **************************************************************************/
  348. static void ns8390_transmit(
  349. struct nic *nic,
  350. const char *d, /* Destination */
  351. unsigned int t, /* Type */
  352. unsigned int s, /* size */
  353. const char *p) /* Packet */
  354. {
  355. #if defined(INCLUDE_3C503) || (defined(INCLUDE_WD) && ! defined(WD_790_PIO))
  356. Address eth_vmem = bus_to_virt(eth_bmem);
  357. #endif
  358. #ifdef INCLUDE_3C503
  359. if (!(eth_flags & FLAG_PIO)) {
  360. memcpy((char *)eth_vmem, d, ETH_ALEN); /* dst */
  361. memcpy((char *)eth_vmem+ETH_ALEN, nic->node_addr, ETH_ALEN); /* src */
  362. *((char *)eth_vmem+12) = t>>8; /* type */
  363. *((char *)eth_vmem+13) = t;
  364. memcpy((char *)eth_vmem+ETH_HLEN, p, s);
  365. s += ETH_HLEN;
  366. while (s < ETH_ZLEN) *((char *)eth_vmem+(s++)) = 0;
  367. }
  368. #endif
  369. #ifdef INCLUDE_WD
  370. if (eth_flags & FLAG_16BIT) {
  371. outb(eth_laar | WD_LAAR_M16EN, eth_asic_base + WD_LAAR);
  372. inb(0x84);
  373. }
  374. #ifndef WD_790_PIO
  375. /* Memory interface */
  376. if (eth_flags & FLAG_790) {
  377. outb(WD_MSR_MENB, eth_asic_base + WD_MSR);
  378. inb(0x84);
  379. }
  380. inb(0x84);
  381. memcpy((char *)eth_vmem, d, ETH_ALEN); /* dst */
  382. memcpy((char *)eth_vmem+ETH_ALEN, nic->node_addr, ETH_ALEN); /* src */
  383. *((char *)eth_vmem+12) = t>>8; /* type */
  384. *((char *)eth_vmem+13) = t;
  385. memcpy((char *)eth_vmem+ETH_HLEN, p, s);
  386. s += ETH_HLEN;
  387. while (s < ETH_ZLEN) *((char *)eth_vmem+(s++)) = 0;
  388. if (eth_flags & FLAG_790) {
  389. outb(0, eth_asic_base + WD_MSR);
  390. inb(0x84);
  391. }
  392. #else
  393. inb(0x84);
  394. #endif
  395. #endif
  396. #if defined(INCLUDE_3C503)
  397. if (eth_flags & FLAG_PIO)
  398. #endif
  399. #if defined(INCLUDE_NE) || defined(INCLUDE_NS8390) || (defined(INCLUDE_3C503) && !defined(T503_SHMEM)) || (defined(INCLUDE_WD) && defined(WD_790_PIO))
  400. {
  401. /* Programmed I/O */
  402. unsigned short type;
  403. type = (t >> 8) | (t << 8);
  404. eth_pio_write(d, eth_tx_start<<8, ETH_ALEN);
  405. eth_pio_write(nic->node_addr, (eth_tx_start<<8)+ETH_ALEN, ETH_ALEN);
  406. /* bcc generates worse code without (const+const) below */
  407. eth_pio_write((unsigned char *)&type, (eth_tx_start<<8)+(ETH_ALEN+ETH_ALEN), 2);
  408. eth_pio_write(p, (eth_tx_start<<8)+ETH_HLEN, s);
  409. s += ETH_HLEN;
  410. if (s < ETH_ZLEN) s = ETH_ZLEN;
  411. }
  412. #endif
  413. #if defined(INCLUDE_3C503)
  414. #endif
  415. #ifdef INCLUDE_WD
  416. if (eth_flags & FLAG_16BIT) {
  417. outb(eth_laar & ~WD_LAAR_M16EN, eth_asic_base + WD_LAAR);
  418. inb(0x84);
  419. }
  420. if (eth_flags & FLAG_790)
  421. outb(D8390_COMMAND_PS0 |
  422. D8390_COMMAND_STA, eth_nic_base+D8390_P0_COMMAND);
  423. else
  424. #endif
  425. outb(D8390_COMMAND_PS0 |
  426. D8390_COMMAND_RD2 | D8390_COMMAND_STA, eth_nic_base+D8390_P0_COMMAND);
  427. outb(eth_tx_start, eth_nic_base+D8390_P0_TPSR);
  428. outb(s, eth_nic_base+D8390_P0_TBCR0);
  429. outb(s>>8, eth_nic_base+D8390_P0_TBCR1);
  430. #ifdef INCLUDE_WD
  431. if (eth_flags & FLAG_790)
  432. outb(D8390_COMMAND_PS0 |
  433. D8390_COMMAND_TXP | D8390_COMMAND_STA, eth_nic_base+D8390_P0_COMMAND);
  434. else
  435. #endif
  436. outb(D8390_COMMAND_PS0 |
  437. D8390_COMMAND_TXP | D8390_COMMAND_RD2 |
  438. D8390_COMMAND_STA, eth_nic_base+D8390_P0_COMMAND);
  439. }
  440. /**************************************************************************
  441. NS8390_POLL - Wait for a frame
  442. **************************************************************************/
  443. static int ns8390_poll(struct nic *nic, int retrieve)
  444. {
  445. int ret = 0;
  446. unsigned char rstat, curr, next;
  447. unsigned short len, frag;
  448. unsigned short pktoff;
  449. unsigned char *p;
  450. struct ringbuffer pkthdr;
  451. #ifndef INCLUDE_3C503
  452. /* avoid infinite recursion: see eth_rx_overrun() */
  453. if (!eth_drain_receiver && (inb(eth_nic_base+D8390_P0_ISR) & D8390_ISR_OVW)) {
  454. eth_rx_overrun(nic);
  455. return(0);
  456. }
  457. #endif /* INCLUDE_3C503 */
  458. rstat = inb(eth_nic_base+D8390_P0_RSR);
  459. if (!(rstat & D8390_RSTAT_PRX)) return(0);
  460. next = inb(eth_nic_base+D8390_P0_BOUND)+1;
  461. if (next >= eth_memsize) next = eth_rx_start;
  462. outb(D8390_COMMAND_PS1, eth_nic_base+D8390_P0_COMMAND);
  463. curr = inb(eth_nic_base+D8390_P1_CURR);
  464. outb(D8390_COMMAND_PS0, eth_nic_base+D8390_P0_COMMAND);
  465. if (curr >= eth_memsize) curr=eth_rx_start;
  466. if (curr == next) return(0);
  467. if ( ! retrieve ) return 1;
  468. #ifdef INCLUDE_WD
  469. if (eth_flags & FLAG_16BIT) {
  470. outb(eth_laar | WD_LAAR_M16EN, eth_asic_base + WD_LAAR);
  471. inb(0x84);
  472. }
  473. #ifndef WD_790_PIO
  474. if (eth_flags & FLAG_790) {
  475. outb(WD_MSR_MENB, eth_asic_base + WD_MSR);
  476. inb(0x84);
  477. }
  478. #endif
  479. inb(0x84);
  480. #endif
  481. pktoff = next << 8;
  482. if (eth_flags & FLAG_PIO)
  483. eth_pio_read(pktoff, (char *)&pkthdr, 4);
  484. else
  485. memcpy(&pkthdr, bus_to_virt(eth_rmem + pktoff), 4);
  486. pktoff += sizeof(pkthdr);
  487. /* incoming length includes FCS so must sub 4 */
  488. len = pkthdr.len - 4;
  489. if ((pkthdr.status & D8390_RSTAT_PRX) == 0 || len < ETH_ZLEN
  490. || len > ETH_FRAME_LEN) {
  491. printf("Bogus packet, ignoring\n");
  492. return (0);
  493. }
  494. else {
  495. p = nic->packet;
  496. nic->packetlen = len; /* available to caller */
  497. frag = (eth_memsize << 8) - pktoff;
  498. if (len > frag) { /* We have a wrap-around */
  499. /* read first part */
  500. if (eth_flags & FLAG_PIO)
  501. eth_pio_read(pktoff, p, frag);
  502. else
  503. memcpy(p, bus_to_virt(eth_rmem + pktoff), frag);
  504. pktoff = eth_rx_start << 8;
  505. p += frag;
  506. len -= frag;
  507. }
  508. /* read second part */
  509. if (eth_flags & FLAG_PIO)
  510. eth_pio_read(pktoff, p, len);
  511. else
  512. memcpy(p, bus_to_virt(eth_rmem + pktoff), len);
  513. ret = 1;
  514. }
  515. #ifdef INCLUDE_WD
  516. #ifndef WD_790_PIO
  517. if (eth_flags & FLAG_790) {
  518. outb(0, eth_asic_base + WD_MSR);
  519. inb(0x84);
  520. }
  521. #endif
  522. if (eth_flags & FLAG_16BIT) {
  523. outb(eth_laar & ~WD_LAAR_M16EN, eth_asic_base + WD_LAAR);
  524. inb(0x84);
  525. }
  526. inb(0x84);
  527. #endif
  528. next = pkthdr.next; /* frame number of next packet */
  529. if (next == eth_rx_start)
  530. next = eth_memsize;
  531. outb(next-1, eth_nic_base+D8390_P0_BOUND);
  532. return(ret);
  533. }
  534. /**************************************************************************
  535. NS8390_DISABLE - Turn off adapter
  536. **************************************************************************/
  537. static void ns8390_disable ( struct nic *nic ) {
  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. static struct nic_operations ns8390_operations;
  859. static struct nic_operations ns8390_operations = {
  860. .connect = dummy_connect,
  861. .poll = ns8390_poll,
  862. .transmit = ns8390_transmit,
  863. .irq = ns8390_irq,
  864. .disable = ns8390_disable,
  865. };
  866. nic->nic_op = &ns8390_operations;
  867. /* Based on PnP ISA map */
  868. #ifdef INCLUDE_WD
  869. dev->devid.vendor_id = htons(GENERIC_ISAPNP_VENDOR);
  870. dev->devid.device_id = htons(0x812a);
  871. #endif
  872. #ifdef INCLUDE_3C503
  873. dev->devid.vendor_id = htons(GENERIC_ISAPNP_VENDOR);
  874. dev->devid.device_id = htons(0x80f3);
  875. #endif
  876. #ifdef INCLUDE_NE
  877. dev->devid.vendor_id = htons(GENERIC_ISAPNP_VENDOR);
  878. dev->devid.device_id = htons(0x80d6);
  879. #endif
  880. return 1;
  881. }
  882. #ifdef INCLUDE_WD
  883. static struct isa_driver wd_driver __isa_driver = {
  884. .type = NIC_DRIVER,
  885. .name = "WD",
  886. .probe = wd_probe,
  887. .ioaddrs = 0,
  888. };
  889. ISA_ROM("wd","WD8003/8013, SMC8216/8416, SMC 83c790 (EtherEZ)");
  890. #endif
  891. #ifdef INCLUDE_3C503
  892. static struct isa_driver t503_driver __isa_driver = {
  893. .type = NIC_DRIVER,
  894. .name = "3C503",
  895. .probe = t503_probe,
  896. .ioaddrs = 0,
  897. };
  898. ISA_ROM("3c503","3Com503, Etherlink II[/16]");
  899. #endif
  900. #ifdef INCLUDE_NE
  901. static struct isa_driver ne_driver __isa_driver = {
  902. .type = NIC_DRIVER,
  903. .name = "NE*000",
  904. .probe = ne_probe,
  905. .ioaddrs = 0,
  906. };
  907. ISA_ROM("ne","NE1000/2000 and clones");
  908. #endif
  909. #ifdef INCLUDE_NS8390
  910. static struct pci_id nepci_nics[] = {
  911. /* A few NE2000 PCI clones, list not exhaustive */
  912. PCI_ROM(0x10ec, 0x8029, "rtl8029", "Realtek 8029"),
  913. PCI_ROM(0x1186, 0x0300, "dlink-528", "D-Link DE-528"),
  914. PCI_ROM(0x1050, 0x0940, "winbond940", "Winbond NE2000-PCI"), /* Winbond 86C940 / 89C940 */
  915. PCI_ROM(0x1050, 0x5a5a, "winbond940f", "Winbond W89c940F"), /* Winbond 89C940F */
  916. PCI_ROM(0x11f6, 0x1401, "compexrl2000", "Compex ReadyLink 2000"),
  917. PCI_ROM(0x8e2e, 0x3000, "ktiet32p2", "KTI ET32P2"),
  918. PCI_ROM(0x4a14, 0x5000, "nv5000sc", "NetVin NV5000SC"),
  919. PCI_ROM(0x12c3, 0x0058, "holtek80232", "Holtek HT80232"),
  920. PCI_ROM(0x12c3, 0x5598, "holtek80229", "Holtek HT80229"),
  921. PCI_ROM(0x10bd, 0x0e34, "surecom-ne34", "Surecom NE34"),
  922. PCI_ROM(0x1106, 0x0926, "via86c926", "Via 86c926"),
  923. };
  924. static struct pci_driver nepci_driver =
  925. PCI_DRIVER ( "NE2000/PCI", nepci_nics, PCI_NO_CLASS );
  926. BOOT_DRIVER ( "NE2000/PCI", nepci_probe );
  927. #endif /* INCLUDE_NS8390 */
  928. /*
  929. * Local variables:
  930. * c-basic-offset: 8
  931. * End:
  932. */
  933. #endif