選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

3c509.c 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  1. /**************************************************************************
  2. ETHERBOOT - BOOTP/TFTP Bootstrap Program
  3. Author: Martin Renters.
  4. Date: Mar 22 1995
  5. This code is based heavily on David Greenman's if_ed.c driver and
  6. Andres Vega Garcia's if_ep.c driver.
  7. Copyright (C) 1993-1994, David Greenman, Martin Renters.
  8. Copyright (C) 1993-1995, Andres Vega Garcia.
  9. Copyright (C) 1995, Serge Babkin.
  10. This software may be used, modified, copied, distributed, and sold, in
  11. both source and binary form provided that the above copyright and these
  12. terms are retained. Under no circumstances are the authors responsible for
  13. the proper functioning of this software, nor do the authors assume any
  14. responsibility for damages incurred with its use.
  15. 3c509 support added by Serge Babkin (babkin@hq.icb.chel.su)
  16. $Id$
  17. ***************************************************************************/
  18. /* #define EDEBUG */
  19. #include "etherboot.h"
  20. #include "nic.h"
  21. #include "isa.h"
  22. #include "timer.h"
  23. #include "3c509.h"
  24. static unsigned short eth_nic_base;
  25. static enum { none, bnc, utp } connector = none; /* for 3C509 */
  26. #ifdef INCLUDE_3C529
  27. /*
  28. * This table and several other pieces of the MCA support
  29. * code were shamelessly borrowed from the Linux kernel source.
  30. *
  31. * MCA support added by Adam Fritzler (mid@auk.cx)
  32. *
  33. */
  34. struct el3_mca_adapters_struct {
  35. const char *name;
  36. int id;
  37. };
  38. static struct el3_mca_adapters_struct el3_mca_adapters[] = {
  39. { "3Com 3c529 EtherLink III (10base2)", 0x627c },
  40. { "3Com 3c529 EtherLink III (10baseT)", 0x627d },
  41. { "3Com 3c529 EtherLink III (test mode)", 0x62db },
  42. { "3Com 3c529 EtherLink III (TP or coax)", 0x62f6 },
  43. { "3Com 3c529 EtherLink III (TP)", 0x62f7 },
  44. { NULL, 0 },
  45. };
  46. #endif
  47. /**************************************************************************
  48. ETH_RESET - Reset adapter
  49. ***************************************************************************/
  50. static void t509_reset(struct nic *nic)
  51. {
  52. int i;
  53. /***********************************************************
  54. Reset 3Com 509 card
  55. *************************************************************/
  56. /* stop card */
  57. outw(RX_DISABLE, BASE + EP_COMMAND);
  58. outw(RX_DISCARD_TOP_PACK, BASE + EP_COMMAND);
  59. while (inw(BASE + EP_STATUS) & S_COMMAND_IN_PROGRESS)
  60. ;
  61. outw(TX_DISABLE, BASE + EP_COMMAND);
  62. outw(STOP_TRANSCEIVER, BASE + EP_COMMAND);
  63. udelay(1000);
  64. outw(RX_RESET, BASE + EP_COMMAND);
  65. outw(TX_RESET, BASE + EP_COMMAND);
  66. outw(C_INTR_LATCH, BASE + EP_COMMAND);
  67. outw(SET_RD_0_MASK, BASE + EP_COMMAND);
  68. outw(SET_INTR_MASK, BASE + EP_COMMAND);
  69. outw(SET_RX_FILTER, BASE + EP_COMMAND);
  70. /*
  71. * initialize card
  72. */
  73. while (inw(BASE + EP_STATUS) & S_COMMAND_IN_PROGRESS)
  74. ;
  75. GO_WINDOW(0);
  76. /* Disable the card */
  77. outw(0, BASE + EP_W0_CONFIG_CTRL);
  78. /* Configure IRQ to none */
  79. outw(SET_IRQ(0), BASE + EP_W0_RESOURCE_CFG);
  80. /* Enable the card */
  81. outw(ENABLE_DRQ_IRQ, BASE + EP_W0_CONFIG_CTRL);
  82. GO_WINDOW(2);
  83. /* Reload the ether_addr. */
  84. for (i = 0; i < ETH_ALEN; i++)
  85. outb(nic->node_addr[i], BASE + EP_W2_ADDR_0 + i);
  86. outw(RX_RESET, BASE + EP_COMMAND);
  87. outw(TX_RESET, BASE + EP_COMMAND);
  88. /* Window 1 is operating window */
  89. GO_WINDOW(1);
  90. for (i = 0; i < 31; i++)
  91. inb(BASE + EP_W1_TX_STATUS);
  92. /* get rid of stray intr's */
  93. outw(ACK_INTR | 0xff, BASE + EP_COMMAND);
  94. outw(SET_RD_0_MASK | S_5_INTS, BASE + EP_COMMAND);
  95. outw(SET_INTR_MASK, BASE + EP_COMMAND);
  96. outw(SET_RX_FILTER | FIL_GROUP | FIL_INDIVIDUAL | FIL_BRDCST, BASE + EP_COMMAND);
  97. /* configure BNC */
  98. if (connector == bnc) {
  99. outw(START_TRANSCEIVER, BASE + EP_COMMAND);
  100. udelay(1000);
  101. }
  102. /* configure UTP */
  103. else if (connector == utp) {
  104. GO_WINDOW(4);
  105. outw(ENABLE_UTP, BASE + EP_W4_MEDIA_TYPE);
  106. sleep(2); /* Give time for media to negotiate */
  107. GO_WINDOW(1);
  108. }
  109. /* start transceiver and receiver */
  110. outw(RX_ENABLE, BASE + EP_COMMAND);
  111. outw(TX_ENABLE, BASE + EP_COMMAND);
  112. /* set early threshold for minimal packet length */
  113. outw(SET_RX_EARLY_THRESH | ETH_ZLEN, BASE + EP_COMMAND);
  114. outw(SET_TX_START_THRESH | 16, BASE + EP_COMMAND);
  115. }
  116. /**************************************************************************
  117. ETH_TRANSMIT - Transmit a frame
  118. ***************************************************************************/
  119. static char padmap[] = {
  120. 0, 3, 2, 1};
  121. static void t509_transmit(
  122. struct nic *nic,
  123. const char *d, /* Destination */
  124. unsigned int t, /* Type */
  125. unsigned int s, /* size */
  126. const char *p) /* Packet */
  127. {
  128. register unsigned int len;
  129. int pad;
  130. int status;
  131. #ifdef EDEBUG
  132. printf("{l=%d,t=%hX}",s+ETH_HLEN,t);
  133. #endif
  134. /* swap bytes of type */
  135. t= htons(t);
  136. len=s+ETH_HLEN; /* actual length of packet */
  137. pad = padmap[len & 3];
  138. /*
  139. * The 3c509 automatically pads short packets to minimum ethernet length,
  140. * but we drop packets that are too large. Perhaps we should truncate
  141. * them instead?
  142. */
  143. if (len + pad > ETH_FRAME_LEN) {
  144. return;
  145. }
  146. /* drop acknowledgements */
  147. while ((status=inb(BASE + EP_W1_TX_STATUS)) & TXS_COMPLETE ) {
  148. if (status & (TXS_UNDERRUN|TXS_MAX_COLLISION|TXS_STATUS_OVERFLOW)) {
  149. outw(TX_RESET, BASE + EP_COMMAND);
  150. outw(TX_ENABLE, BASE + EP_COMMAND);
  151. }
  152. outb(0x0, BASE + EP_W1_TX_STATUS);
  153. }
  154. while (inw(BASE + EP_W1_FREE_TX) < (unsigned short)len + pad + 4)
  155. ; /* no room in FIFO */
  156. outw(len, BASE + EP_W1_TX_PIO_WR_1);
  157. outw(0x0, BASE + EP_W1_TX_PIO_WR_1); /* Second dword meaningless */
  158. /* write packet */
  159. outsw(BASE + EP_W1_TX_PIO_WR_1, d, ETH_ALEN/2);
  160. outsw(BASE + EP_W1_TX_PIO_WR_1, nic->node_addr, ETH_ALEN/2);
  161. outw(t, BASE + EP_W1_TX_PIO_WR_1);
  162. outsw(BASE + EP_W1_TX_PIO_WR_1, p, s / 2);
  163. if (s & 1)
  164. outb(*(p+s - 1), BASE + EP_W1_TX_PIO_WR_1);
  165. while (pad--)
  166. outb(0, BASE + EP_W1_TX_PIO_WR_1); /* Padding */
  167. /* wait for Tx complete */
  168. while((inw(BASE + EP_STATUS) & S_COMMAND_IN_PROGRESS) != 0)
  169. ;
  170. }
  171. /**************************************************************************
  172. ETH_POLL - Wait for a frame
  173. ***************************************************************************/
  174. static int t509_poll(struct nic *nic, int retrieve)
  175. {
  176. /* common variables */
  177. /* variables for 3C509 */
  178. short status, cst;
  179. register short rx_fifo;
  180. cst=inw(BASE + EP_STATUS);
  181. #ifdef EDEBUG
  182. if(cst & 0x1FFF)
  183. printf("-%hX-",cst);
  184. #endif
  185. if( (cst & S_RX_COMPLETE)==0 ) {
  186. /* acknowledge everything */
  187. outw(ACK_INTR| (cst & S_5_INTS), BASE + EP_COMMAND);
  188. outw(C_INTR_LATCH, BASE + EP_COMMAND);
  189. return 0;
  190. }
  191. status = inw(BASE + EP_W1_RX_STATUS);
  192. #ifdef EDEBUG
  193. printf("*%hX*",status);
  194. #endif
  195. if (status & ERR_RX) {
  196. outw(RX_DISCARD_TOP_PACK, BASE + EP_COMMAND);
  197. return 0;
  198. }
  199. rx_fifo = status & RX_BYTES_MASK;
  200. if (rx_fifo==0)
  201. return 0;
  202. if ( ! retrieve ) return 1;
  203. /* read packet */
  204. #ifdef EDEBUG
  205. printf("[l=%d",rx_fifo);
  206. #endif
  207. insw(BASE + EP_W1_RX_PIO_RD_1, nic->packet, rx_fifo / 2);
  208. if(rx_fifo & 1)
  209. nic->packet[rx_fifo-1]=inb(BASE + EP_W1_RX_PIO_RD_1);
  210. nic->packetlen=rx_fifo;
  211. while(1) {
  212. status = inw(BASE + EP_W1_RX_STATUS);
  213. #ifdef EDEBUG
  214. printf("*%hX*",status);
  215. #endif
  216. rx_fifo = status & RX_BYTES_MASK;
  217. if(rx_fifo>0) {
  218. insw(BASE + EP_W1_RX_PIO_RD_1, nic->packet+nic->packetlen, rx_fifo / 2);
  219. if(rx_fifo & 1)
  220. nic->packet[nic->packetlen+rx_fifo-1]=inb(BASE + EP_W1_RX_PIO_RD_1);
  221. nic->packetlen+=rx_fifo;
  222. #ifdef EDEBUG
  223. printf("+%d",rx_fifo);
  224. #endif
  225. }
  226. if(( status & RX_INCOMPLETE )==0) {
  227. #ifdef EDEBUG
  228. printf("=%d",nic->packetlen);
  229. #endif
  230. break;
  231. }
  232. udelay(1000); /* if incomplete wait 1 ms */
  233. }
  234. /* acknowledge reception of packet */
  235. outw(RX_DISCARD_TOP_PACK, BASE + EP_COMMAND);
  236. while (inw(BASE + EP_STATUS) & S_COMMAND_IN_PROGRESS)
  237. ;
  238. #ifdef EDEBUG
  239. {
  240. unsigned short type = 0; /* used by EDEBUG */
  241. type = (nic->packet[12]<<8) | nic->packet[13];
  242. if(nic->packet[0]+nic->packet[1]+nic->packet[2]+nic->packet[3]+nic->packet[4]+
  243. nic->packet[5] == 0xFF*ETH_ALEN)
  244. printf(",t=%hX,b]",type);
  245. else
  246. printf(",t=%hX]",type);
  247. }
  248. #endif
  249. return (1);
  250. }
  251. /*************************************************************************
  252. 3Com 509 - specific routines
  253. **************************************************************************/
  254. static int
  255. eeprom_rdy(void)
  256. {
  257. int i;
  258. for (i = 0; is_eeprom_busy(IS_BASE) && i < MAX_EEPROMBUSY; i++);
  259. if (i >= MAX_EEPROMBUSY) {
  260. /* printf("3c509: eeprom failed to come ready.\n"); */
  261. /* memory in EPROM is tight */
  262. /* printf("3c509: eeprom busy.\n"); */
  263. return (0);
  264. }
  265. return (1);
  266. }
  267. /*
  268. * get_e: gets a 16 bits word from the EEPROM. we must have set the window
  269. * before
  270. */
  271. static int
  272. get_e(int offset)
  273. {
  274. if (!eeprom_rdy())
  275. return (0xffff);
  276. outw(EEPROM_CMD_RD | offset, IS_BASE + EP_W0_EEPROM_COMMAND);
  277. if (!eeprom_rdy())
  278. return (0xffff);
  279. return (inw(IS_BASE + EP_W0_EEPROM_DATA));
  280. }
  281. static int
  282. send_ID_sequence(int port)
  283. {
  284. int cx, al;
  285. for (al = 0xff, cx = 0; cx < 255; cx++) {
  286. outb(al, port);
  287. al <<= 1;
  288. if (al & 0x100)
  289. al ^= 0xcf;
  290. }
  291. return (1);
  292. }
  293. /*
  294. * We get eeprom data from the id_port given an offset into the eeprom.
  295. * Basically; after the ID_sequence is sent to all of the cards; they enter
  296. * the ID_CMD state where they will accept command requests. 0x80-0xbf loads
  297. * the eeprom data. We then read the port 16 times and with every read; the
  298. * cards check for contention (ie: if one card writes a 0 bit and another
  299. * writes a 1 bit then the host sees a 0. At the end of the cycle; each card
  300. * compares the data on the bus; if there is a difference then that card goes
  301. * into ID_WAIT state again). In the meantime; one bit of data is returned in
  302. * the AX register which is conveniently returned to us by inb(). Hence; we
  303. * read 16 times getting one bit of data with each read.
  304. */
  305. static int
  306. get_eeprom_data(int id_port, int offset)
  307. {
  308. int i, data = 0;
  309. outb(0x80 + offset, id_port);
  310. /* Do we really need this wait? Won't be noticeable anyway */
  311. udelay(10000);
  312. for (i = 0; i < 16; i++)
  313. data = (data << 1) | (inw(id_port) & 1);
  314. return (data);
  315. }
  316. static void __t509_disable(void)
  317. {
  318. outb(0xc0, EP_ID_PORT);
  319. }
  320. static void t509_disable(struct dev *dev)
  321. {
  322. struct nic *nic = (struct nic *)dev;
  323. /* reset and disable merge */
  324. t509_reset(nic);
  325. __t509_disable();
  326. }
  327. static void t509_irq(struct nic *nic __unused, irq_action_t action __unused)
  328. {
  329. switch ( action ) {
  330. case DISABLE :
  331. break;
  332. case ENABLE :
  333. break;
  334. case FORCE :
  335. break;
  336. }
  337. }
  338. /**************************************************************************
  339. ETH_PROBE - Look for an adapter
  340. ***************************************************************************/
  341. #ifdef INCLUDE_3C529
  342. static int t529_probe(struct dev *dev, unsigned short *probe_addrs __unused)
  343. #else
  344. static int t509_probe(struct dev *dev, unsigned short *probe_addrs __unused)
  345. #endif
  346. {
  347. struct nic *nic = (struct nic *)dev;
  348. /* common variables */
  349. int i;
  350. int failcount;
  351. #ifdef INCLUDE_3C529
  352. struct el3_mca_adapters_struct *mcafound = NULL;
  353. int mca_pos4 = 0, mca_pos5 = 0, mca_irq = 0;
  354. #endif
  355. __t509_disable(); /* in case board was active */
  356. for (failcount = 0; failcount < 100; failcount++) {
  357. int data, j, io_base, id_port;
  358. unsigned short k;
  359. int ep_current_tag;
  360. short *p;
  361. #ifdef INCLUDE_3C529
  362. int curboard;
  363. #endif
  364. id_port = EP_ID_PORT;
  365. ep_current_tag = EP_LAST_TAG + 1;
  366. /*********************************************************
  367. Search for 3Com 509 card
  368. ***********************************************************/
  369. #ifdef INCLUDE_3C529
  370. /*
  371. * XXX: We should really check to make sure we have an MCA
  372. * bus controller before going ahead with this...
  373. *
  374. * For now, we avoid any hassle by making it a compile
  375. * time option.
  376. *
  377. */
  378. /* printf("\nWarning: Assuming presence of MCA bus\n"); */
  379. /* Make sure motherboard setup is off */
  380. outb_p(0xff, MCA_MOTHERBOARD_SETUP_REG);
  381. /* Cycle through slots */
  382. for(curboard=0; curboard<MCA_MAX_SLOT_NR; curboard++) {
  383. int boardid;
  384. int curcard;
  385. outb_p(0x8|(curboard&0xf), MCA_ADAPTER_SETUP_REG);
  386. boardid = inb_p(MCA_POS_REG(0));
  387. boardid += inb_p(MCA_POS_REG(1)) << 8;
  388. curcard = 0;
  389. while (el3_mca_adapters[curcard].name) {
  390. if (el3_mca_adapters[curcard].id == boardid) {
  391. mcafound = &el3_mca_adapters[curcard];
  392. mca_pos4 = inb_p(MCA_POS_REG(4));
  393. mca_pos5 = inb_p(MCA_POS_REG(5));
  394. goto donewithdetect;
  395. }
  396. else
  397. curcard++;
  398. }
  399. }
  400. donewithdetect:
  401. /* Kill all setup modes */
  402. outb_p(0, MCA_ADAPTER_SETUP_REG);
  403. if (mcafound) {
  404. eth_nic_base = ((short)((mca_pos4&0xfc)|0x02)) << 8;
  405. mca_irq = mca_pos5 & 0x0f;
  406. ep_current_tag--;
  407. }
  408. else
  409. /*printf("MCA Card not found\n")*/;
  410. #endif
  411. /* Look for the EISA boards, leave them activated */
  412. /* search for the first card, ignore all others */
  413. for(j = 1; j < 16; j++) {
  414. io_base = (j * EP_EISA_START) | EP_EISA_W0;
  415. if (inw(io_base + EP_W0_MFG_ID) != MFG_ID)
  416. continue;
  417. /* we must have found 0x1f if the board is EISA configurated */
  418. if ((inw(io_base + EP_W0_ADDRESS_CFG) & 0x1f) != 0x1f)
  419. continue;
  420. /* Reset and Enable the card */
  421. outb(W0_P4_CMD_RESET_ADAPTER, io_base + EP_W0_CONFIG_CTRL);
  422. udelay(1000); /* Must wait 800 µs, be conservative */
  423. outb(W0_P4_CMD_ENABLE_ADAPTER, io_base + EP_W0_CONFIG_CTRL);
  424. /*
  425. * Once activated, all the registers are mapped in the range
  426. * x000 - x00F, where x is the slot number.
  427. */
  428. eth_nic_base = j * EP_EISA_START;
  429. break;
  430. }
  431. ep_current_tag--;
  432. /* Look for the ISA boards. Init and leave them actived */
  433. /* search for the first card, ignore all others */
  434. outb(0xc0, id_port); /* Global reset */
  435. udelay(1000); /* wait 1 ms */
  436. for (i = 0; i < EP_MAX_BOARDS; i++) {
  437. outb(0, id_port);
  438. outb(0, id_port);
  439. send_ID_sequence(id_port);
  440. data = get_eeprom_data(id_port, EEPROM_MFG_ID);
  441. if (data != MFG_ID)
  442. break;
  443. /* resolve contention using the Ethernet address */
  444. for (j = 0; j < 3; j++)
  445. data = get_eeprom_data(id_port, j);
  446. eth_nic_base =
  447. (get_eeprom_data(id_port, EEPROM_ADDR_CFG) & 0x1f) * 0x10 + 0x200;
  448. outb(ep_current_tag, id_port); /* tags board */
  449. outb(ACTIVATE_ADAPTER_TO_CONFIG, id_port);
  450. ep_current_tag--;
  451. break;
  452. }
  453. if (i >= EP_MAX_BOARDS)
  454. goto no3c509;
  455. /*
  456. * The iobase was found and MFG_ID was 0x6d50. PROD_ID should be
  457. * 0x9[0-f]50
  458. */
  459. GO_WINDOW(0);
  460. k = get_e(EEPROM_PROD_ID);
  461. #ifdef INCLUDE_3C529
  462. /*
  463. * On MCA, the PROD_ID matches the MCA card ID (POS0+POS1)
  464. */
  465. if (mcafound) {
  466. if (mcafound->id != k) {
  467. printf("MCA: PROD_ID in EEPROM does not match MCA card ID! (%hX != %hX)\n", k, mcafound->id);
  468. goto no3c509;
  469. }
  470. } else { /* for ISA/EISA */
  471. if ((k & 0xf0ff) != (PROD_ID & 0xf0ff))
  472. goto no3c509;
  473. }
  474. #else
  475. if ((k & 0xf0ff) != (PROD_ID & 0xf0ff))
  476. goto no3c509;
  477. #endif
  478. #ifdef INCLUDE_3C529
  479. if (mcafound) {
  480. printf("%s board found on MCA at %#hx IRQ %d -",
  481. mcafound->name, eth_nic_base, mca_irq);
  482. } else {
  483. #endif
  484. if(eth_nic_base >= EP_EISA_START)
  485. printf("3C5x9 board on EISA at %#hx - ",eth_nic_base);
  486. else
  487. printf("3C5x9 board on ISA at %#hx - ",eth_nic_base);
  488. #ifdef INCLUDE_3C529
  489. }
  490. #endif
  491. /* test for presence of connectors */
  492. i = inw(IS_BASE + EP_W0_CONFIG_CTRL);
  493. j = (inw(IS_BASE + EP_W0_ADDRESS_CFG) >> 14) & 0x3;
  494. switch(j) {
  495. case 0:
  496. if (i & IS_UTP) {
  497. printf("10baseT\n");
  498. connector = utp;
  499. }
  500. else {
  501. printf("10baseT not present\n");
  502. goto no3c509;
  503. }
  504. break;
  505. case 1:
  506. if (i & IS_AUI)
  507. printf("10base5\n");
  508. else {
  509. printf("10base5 not present\n");
  510. goto no3c509;
  511. }
  512. break;
  513. case 3:
  514. if (i & IS_BNC) {
  515. printf("10base2\n");
  516. connector = bnc;
  517. }
  518. else {
  519. printf("10base2 not present\n");
  520. goto no3c509;
  521. }
  522. break;
  523. default:
  524. printf("unknown connector\n");
  525. goto no3c509;
  526. }
  527. /*
  528. * Read the station address from the eeprom
  529. */
  530. p = (unsigned short *) nic->node_addr;
  531. for (i = 0; i < ETH_ALEN / 2; i++) {
  532. GO_WINDOW(0);
  533. p[i] = htons(get_e(i));
  534. GO_WINDOW(2);
  535. outw(ntohs(p[i]), BASE + EP_W2_ADDR_0 + (i * 2));
  536. }
  537. printf("Ethernet address: %!\n", nic->node_addr);
  538. t509_reset(nic);
  539. nic->irqno = 0;
  540. nic->ioaddr = eth_nic_base;
  541. dev->disable = t509_disable;
  542. nic->poll = t509_poll;
  543. nic->transmit = t509_transmit;
  544. nic->irq = t509_irq;
  545. /* Based on PnP ISA map */
  546. dev->devid.vendor_id = htons(GENERIC_ISAPNP_VENDOR);
  547. dev->devid.device_id = htons(0x80f7);
  548. return 1;
  549. no3c509:
  550. continue;
  551. /* printf("(probe fail)"); */
  552. }
  553. return 0;
  554. }
  555. #ifdef INCLUDE_3C509
  556. static struct isa_driver t509_driver __isa_driver = {
  557. .type = NIC_DRIVER,
  558. .name = "3C509",
  559. .probe = t509_probe,
  560. .ioaddrs = 0,
  561. };
  562. ISA_ROM("3c509","3c509, ISA/EISA");
  563. #endif
  564. #ifdef INCLUDE_3C529
  565. static struct isa_driver t529_driver __isa_driver = {
  566. .type = NIC_DRIVER,
  567. .name = "3C529",
  568. .probe = t529_probe,
  569. .ioaddrs = 0,
  570. };
  571. ISA_ROM("3c529","3c529 == MCA 3c509");
  572. #endif
  573. /*
  574. * Local variables:
  575. * c-basic-offset: 8
  576. * End:
  577. */