Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

sis900.c 34KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260
  1. /* -*- Mode:C; c-basic-offset:4; -*- */
  2. /*
  3. sis900.c: An SiS 900/7016 PCI Fast Ethernet driver for Etherboot
  4. Copyright (C) 2001 Entity Cyber, Inc.
  5. Revision: 1.0 March 1, 2001
  6. Author: Marty Connor (mdc@thinguin.org)
  7. Adapted from a Linux driver which was written by Donald Becker
  8. and modified by Ollie Lho and Chin-Shan Li of SiS Corporation.
  9. Rewritten for Etherboot by Marty Connor.
  10. This software may be used and distributed according to the terms
  11. of the GNU Public License (GPL), incorporated herein by reference.
  12. References:
  13. SiS 7016 Fast Ethernet PCI Bus 10/100 Mbps LAN Controller with OnNow Support,
  14. preliminary Rev. 1.0 Jan. 14, 1998
  15. SiS 900 Fast Ethernet PCI Bus 10/100 Mbps LAN Single Chip with OnNow Support,
  16. preliminary Rev. 1.0 Nov. 10, 1998
  17. SiS 7014 Single Chip 100BASE-TX/10BASE-T Physical Layer Solution,
  18. preliminary Rev. 1.0 Jan. 18, 1998
  19. http://www.sis.com.tw/support/databook.htm */
  20. /* Revision History */
  21. /*
  22. 07 Dec 2003 timlegge - Enabled Multicast Support
  23. 06 Dec 2003 timlegge - Fixed relocation issue in 5.2
  24. 04 Jan 2002 Chien-Yu Chen, Doug Ambrisko, Marty Connor Patch to Etherboot 5.0.5
  25. Added support for the SiS 630ET plus various bug fixes from linux kernel
  26. source 2.4.17.
  27. 01 March 2001 mdc 1.0
  28. Initial Release. Tested with PCI based sis900 card and ThinkNIC
  29. computer.
  30. 20 March 2001 P.Koegel
  31. added support for sis630e and PHY ICS1893 and RTL8201
  32. Testet with SIS730S chipset + ICS1893
  33. */
  34. /* Includes */
  35. #include "etherboot.h"
  36. #include "nic.h"
  37. #include "pci.h"
  38. #include "timer.h"
  39. #include "sis900.h"
  40. /* Globals */
  41. static int sis900_debug = 0;
  42. static unsigned short vendor, dev_id;
  43. static unsigned long ioaddr;
  44. static u8 pci_revision;
  45. static unsigned int cur_phy;
  46. static unsigned int cur_rx;
  47. static BufferDesc txd;
  48. static BufferDesc rxd[NUM_RX_DESC];
  49. static unsigned char txb[TX_BUF_SIZE];
  50. static unsigned char rxb[NUM_RX_DESC * RX_BUF_SIZE];
  51. #if 0
  52. static struct mac_chip_info {
  53. const char *name;
  54. u16 vendor_id, device_id, flags;
  55. int io_size;
  56. } mac_chip_table[] = {
  57. { "SiS 900 PCI Fast Ethernet", PCI_VENDOR_ID_SIS, PCI_DEVICE_ID_SIS900,
  58. PCI_COMMAND_IO|PCI_COMMAND_MASTER, SIS900_TOTAL_SIZE},
  59. { "SiS 7016 PCI Fast Ethernet",PCI_VENDOR_ID_SIS, PCI_DEVICE_ID_SIS7016,
  60. PCI_COMMAND_IO|PCI_COMMAND_MASTER, SIS900_TOTAL_SIZE},
  61. {0,0,0,0,0} /* 0 terminated list. */
  62. };
  63. #endif
  64. static void sis900_read_mode(struct nic *nic, int phy_addr, int *speed, int *duplex);
  65. static void amd79c901_read_mode(struct nic *nic, int phy_addr, int *speed, int *duplex);
  66. static void ics1893_read_mode(struct nic *nic, int phy_addr, int *speed, int *duplex);
  67. static void rtl8201_read_mode(struct nic *nic, int phy_addr, int *speed, int *duplex);
  68. static void vt6103_read_mode(struct nic *nic, int phy_addr, int *speed, int *duplex);
  69. static struct mii_chip_info {
  70. const char * name;
  71. u16 phy_id0;
  72. u16 phy_id1;
  73. void (*read_mode) (struct nic *nic, int phy_addr, int *speed, int *duplex);
  74. } mii_chip_table[] = {
  75. {"SiS 900 Internal MII PHY", 0x001d, 0x8000, sis900_read_mode},
  76. {"SiS 7014 Physical Layer Solution", 0x0016, 0xf830,sis900_read_mode},
  77. {"AMD 79C901 10BASE-T PHY", 0x0000, 0x6B70, amd79c901_read_mode},
  78. {"AMD 79C901 HomePNA PHY", 0x0000, 0x6B90, amd79c901_read_mode},
  79. {"ICS 1893 Integrated PHYceiver" , 0x0015, 0xf440,ics1893_read_mode},
  80. // {"NS 83851 PHY",0x2000, 0x5C20, MIX },
  81. {"RTL 8201 10/100Mbps Phyceiver" , 0x0000, 0x8200,rtl8201_read_mode},
  82. {"VIA 6103 10/100Mbps Phyceiver", 0x0101, 0x8f20,vt6103_read_mode},
  83. {0,0,0,0}
  84. };
  85. static struct mii_phy {
  86. struct mii_phy * next;
  87. struct mii_chip_info * chip_info;
  88. int phy_addr;
  89. u16 status;
  90. } mii;
  91. // PCI to ISA bridge for SIS640E access
  92. static struct pci_id pci_isa_bridge_list[] = {
  93. { 0x1039, 0x0008,
  94. "SIS 85C503/5513 PCI to ISA bridge"},
  95. };
  96. static struct pci_driver sis_bridge_driver =
  97. PCI_DRIVER ( "sis_bridge", pci_isa_bridge_list, PCI_NO_CLASS );
  98. /* Function Prototypes */
  99. static int sis900_probe(struct dev *dev, struct pci_device *pci);
  100. static u16 sis900_read_eeprom(int location);
  101. static void sis900_mdio_reset(long mdio_addr);
  102. static void sis900_mdio_idle(long mdio_addr);
  103. static u16 sis900_mdio_read(int phy_id, int location);
  104. #if 0
  105. static void sis900_mdio_write(int phy_id, int location, int val);
  106. #endif
  107. static void sis900_init(struct nic *nic);
  108. static void sis900_reset(struct nic *nic);
  109. static void sis900_init_rxfilter(struct nic *nic);
  110. static void sis900_init_txd(struct nic *nic);
  111. static void sis900_init_rxd(struct nic *nic);
  112. static void sis900_set_rx_mode(struct nic *nic);
  113. static void sis900_check_mode(struct nic *nic);
  114. static void sis900_transmit(struct nic *nic, const char *d,
  115. unsigned int t, unsigned int s, const char *p);
  116. static int sis900_poll(struct nic *nic, int retrieve);
  117. static void sis900_disable(struct dev *dev);
  118. static void sis900_irq(struct nic *nic, irq_action_t action);
  119. /**
  120. * sis900_get_mac_addr: - Get MAC address for stand alone SiS900 model
  121. * @pci_dev: the sis900 pci device
  122. * @net_dev: the net device to get address for
  123. *
  124. * Older SiS900 and friends, use EEPROM to store MAC address.
  125. * MAC address is read from read_eeprom() into @net_dev->dev_addr.
  126. */
  127. static int sis900_get_mac_addr(struct pci_device * pci_dev __unused, struct nic *nic)
  128. {
  129. u16 signature;
  130. int i;
  131. /* check to see if we have sane EEPROM */
  132. signature = (u16) sis900_read_eeprom( EEPROMSignature);
  133. if (signature == 0xffff || signature == 0x0000) {
  134. printf ("sis900_probe: Error EERPOM read %hX\n", signature);
  135. return 0;
  136. }
  137. /* get MAC address from EEPROM */
  138. for (i = 0; i < 3; i++)
  139. ((u16 *)(nic->node_addr))[i] = sis900_read_eeprom(i+EEPROMMACAddr);
  140. return 1;
  141. }
  142. /**
  143. * sis96x_get_mac_addr: - Get MAC address for SiS962 or SiS963 model
  144. * @pci_dev: the sis900 pci device
  145. * @net_dev: the net device to get address for
  146. *
  147. * SiS962 or SiS963 model, use EEPROM to store MAC address. And EEPROM
  148. * is shared by
  149. * LAN and 1394. When access EEPROM, send EEREQ signal to hardware first
  150. * and wait for EEGNT. If EEGNT is ON, EEPROM is permitted to be access
  151. * by LAN, otherwise is not. After MAC address is read from EEPROM, send
  152. * EEDONE signal to refuse EEPROM access by LAN.
  153. * The EEPROM map of SiS962 or SiS963 is different to SiS900.
  154. * The signature field in SiS962 or SiS963 spec is meaningless.
  155. * MAC address is read into @net_dev->dev_addr.
  156. */
  157. static int sis96x_get_mac_addr(struct pci_device * pci_dev __unused, struct nic *nic)
  158. {
  159. /* long ioaddr = net_dev->base_addr; */
  160. long ee_addr = ioaddr + mear;
  161. u32 waittime = 0;
  162. int i;
  163. printf("Alternate function\n");
  164. outl(EEREQ, ee_addr);
  165. while(waittime < 2000) {
  166. if(inl(ee_addr) & EEGNT) {
  167. /* get MAC address from EEPROM */
  168. for (i = 0; i < 3; i++)
  169. ((u16 *)(nic->node_addr))[i] = sis900_read_eeprom(i+EEPROMMACAddr);
  170. outl(EEDONE, ee_addr);
  171. return 1;
  172. } else {
  173. udelay(1);
  174. waittime ++;
  175. }
  176. }
  177. outl(EEDONE, ee_addr);
  178. return 0;
  179. }
  180. /**
  181. * sis630e_get_mac_addr: - Get MAC address for SiS630E model
  182. * @pci_dev: the sis900 pci device
  183. * @net_dev: the net device to get address for
  184. *
  185. * SiS630E model, use APC CMOS RAM to store MAC address.
  186. * APC CMOS RAM is accessed through ISA bridge.
  187. * MAC address is read into @net_dev->dev_addr.
  188. */
  189. static int sis630e_get_mac_addr(struct pci_device * pci_dev __unused, struct nic *nic)
  190. {
  191. u8 reg;
  192. int i;
  193. struct pci_device isa_bridge;
  194. /* find PCI to ISA bridge */
  195. memset(&isa_bridge, 0, sizeof(isa_bridge));
  196. if ( ! find_pci_device ( &isa_bridge, &sis_bridge_driver ) )
  197. return 0;
  198. pci_read_config_byte(&isa_bridge, 0x48, &reg);
  199. pci_write_config_byte(&isa_bridge, 0x48, reg | 0x40);
  200. for (i = 0; i < ETH_ALEN; i++)
  201. {
  202. outb(0x09 + i, 0x70);
  203. ((u8 *)(nic->node_addr))[i] = inb(0x71);
  204. }
  205. pci_write_config_byte(&isa_bridge, 0x48, reg & ~0x40);
  206. return 1;
  207. }
  208. /**
  209. * sis630e_get_mac_addr: - Get MAC address for SiS630E model
  210. * @pci_dev: the sis900 pci device
  211. * @net_dev: the net device to get address for
  212. *
  213. * SiS630E model, use APC CMOS RAM to store MAC address.
  214. * APC CMOS RAM is accessed through ISA bridge.
  215. * MAC address is read into @net_dev->dev_addr.
  216. */
  217. static int sis635_get_mac_addr(struct pci_device * pci_dev __unused, struct nic *nic)
  218. {
  219. u32 rfcrSave;
  220. u32 i;
  221. rfcrSave = inl(rfcr + ioaddr);
  222. outl(rfcrSave | RELOAD, ioaddr + cr);
  223. outl(0, ioaddr + cr);
  224. /* disable packet filtering before setting filter */
  225. outl(rfcrSave & ~RFEN, rfcr + ioaddr);
  226. /* load MAC addr to filter data register */
  227. for (i = 0 ; i < 3 ; i++) {
  228. outl((i << RFADDR_shift), ioaddr + rfcr);
  229. *( ((u16 *)nic->node_addr) + i) = inw(ioaddr + rfdr);
  230. }
  231. /* enable packet filitering */
  232. outl(rfcrSave | RFEN, rfcr + ioaddr);
  233. return 1;
  234. }
  235. /*
  236. * Function: sis900_probe
  237. *
  238. * Description: initializes initializes the NIC, retrieves the
  239. * MAC address of the card, and sets up some globals required by
  240. * other routines.
  241. *
  242. * Side effects:
  243. * leaves the ioaddress of the sis900 chip in the variable ioaddr.
  244. * leaves the sis900 initialized, and ready to recieve packets.
  245. *
  246. * Returns: struct nic *: pointer to NIC data structure
  247. */
  248. static int sis900_probe ( struct dev *dev ) {
  249. struct nic *nic = nic_device ( dev );
  250. struct pci_device *pci = pci_device ( dev );
  251. int i;
  252. int found=0;
  253. int phy_addr;
  254. u8 revision;
  255. int ret;
  256. if (pci->ioaddr == 0)
  257. return 0;
  258. nic->irqno = 0;
  259. nic->ioaddr = pci->ioaddr & ~3;
  260. ioaddr = pci->ioaddr & ~3;
  261. vendor = pci->vendor;
  262. dev_id = pci->dev_id;
  263. /* wakeup chip */
  264. pci_write_config_dword(pci, 0x40, 0x00000000);
  265. adjust_pci_device(pci);
  266. /* get MAC address */
  267. ret = 0;
  268. pci_read_config_byte(pci, PCI_REVISION, &revision);
  269. /* save for use later in sis900_reset() */
  270. pci_revision = revision;
  271. if (revision == SIS630E_900_REV)
  272. ret = sis630e_get_mac_addr(pci, nic);
  273. else if ((revision > 0x81) && (revision <= 0x90))
  274. ret = sis635_get_mac_addr(pci, nic);
  275. else if (revision == SIS96x_900_REV)
  276. ret = sis96x_get_mac_addr(pci, nic);
  277. else
  278. ret = sis900_get_mac_addr(pci, nic);
  279. if (ret == 0)
  280. {
  281. printf ("sis900_probe: Error MAC address not found\n");
  282. return 0;
  283. }
  284. /* 630ET : set the mii access mode as software-mode */
  285. if (revision == SIS630ET_900_REV)
  286. outl(ACCESSMODE | inl(ioaddr + cr), ioaddr + cr);
  287. printf("\nsis900_probe: MAC addr %! at ioaddr %#hX\n",
  288. nic->node_addr, ioaddr);
  289. printf("sis900_probe: Vendor:%#hX Device:%#hX\n", vendor, dev_id);
  290. /* probe for mii transceiver */
  291. /* search for total of 32 possible mii phy addresses */
  292. found = 0;
  293. for (phy_addr = 0; phy_addr < 32; phy_addr++) {
  294. u16 mii_status;
  295. u16 phy_id0, phy_id1;
  296. mii_status = sis900_mdio_read(phy_addr, MII_STATUS);
  297. if (mii_status == 0xffff || mii_status == 0x0000)
  298. /* the mii is not accessable, try next one */
  299. continue;
  300. phy_id0 = sis900_mdio_read(phy_addr, MII_PHY_ID0);
  301. phy_id1 = sis900_mdio_read(phy_addr, MII_PHY_ID1);
  302. /* search our mii table for the current mii */
  303. for (i = 0; mii_chip_table[i].phy_id1; i++) {
  304. if ((phy_id0 == mii_chip_table[i].phy_id0) &&
  305. ((phy_id1 & 0xFFF0) == mii_chip_table[i].phy_id1)){
  306. printf("sis900_probe: %s transceiver found at address %d.\n",
  307. mii_chip_table[i].name, phy_addr);
  308. mii.chip_info = &mii_chip_table[i];
  309. mii.phy_addr = phy_addr;
  310. mii.status = sis900_mdio_read(phy_addr, MII_STATUS);
  311. mii.next = NULL;
  312. found=1;
  313. break;
  314. }
  315. }
  316. }
  317. if (found == 0) {
  318. printf("sis900_probe: No MII transceivers found!\n");
  319. return 0;
  320. }
  321. /* Arbitrarily select the last PHY found as current PHY */
  322. cur_phy = mii.phy_addr;
  323. printf("sis900_probe: Using %s as default\n", mii.chip_info->name);
  324. /* initialize device */
  325. sis900_init(nic);
  326. dev->disable = sis900_disable;
  327. nic->poll = sis900_poll;
  328. nic->transmit = sis900_transmit;
  329. nic->irq = sis900_irq;
  330. return 1;
  331. }
  332. /*
  333. * EEPROM Routines: These functions read and write to EEPROM for
  334. * retrieving the MAC address and other configuration information about
  335. * the card.
  336. */
  337. /* Delay between EEPROM clock transitions. */
  338. #define eeprom_delay() inl(ee_addr)
  339. /* Function: sis900_read_eeprom
  340. *
  341. * Description: reads and returns a given location from EEPROM
  342. *
  343. * Arguments: int location: requested EEPROM location
  344. *
  345. * Returns: u16: contents of requested EEPROM location
  346. *
  347. */
  348. /* Read Serial EEPROM through EEPROM Access Register, Note that location is
  349. in word (16 bits) unit */
  350. static u16 sis900_read_eeprom(int location)
  351. {
  352. int i;
  353. u16 retval = 0;
  354. long ee_addr = ioaddr + mear;
  355. u32 read_cmd = location | EEread;
  356. outl(0, ee_addr);
  357. eeprom_delay();
  358. outl(EECS, ee_addr);
  359. eeprom_delay();
  360. /* Shift the read command (9) bits out. */
  361. for (i = 8; i >= 0; i--) {
  362. u32 dataval = (read_cmd & (1 << i)) ? EEDI | EECS : EECS;
  363. outl(dataval, ee_addr);
  364. eeprom_delay();
  365. outl(dataval | EECLK, ee_addr);
  366. eeprom_delay();
  367. }
  368. outl(EECS, ee_addr);
  369. eeprom_delay();
  370. /* read the 16-bits data in */
  371. for (i = 16; i > 0; i--) {
  372. outl(EECS, ee_addr);
  373. eeprom_delay();
  374. outl(EECS | EECLK, ee_addr);
  375. eeprom_delay();
  376. retval = (retval << 1) | ((inl(ee_addr) & EEDO) ? 1 : 0);
  377. eeprom_delay();
  378. }
  379. /* Terminate the EEPROM access. */
  380. outl(0, ee_addr);
  381. eeprom_delay();
  382. // outl(EECLK, ee_addr);
  383. return (retval);
  384. }
  385. #define sis900_mdio_delay() inl(mdio_addr)
  386. /*
  387. Read and write the MII management registers using software-generated
  388. serial MDIO protocol. Note that the command bits and data bits are
  389. send out seperately
  390. */
  391. static void sis900_mdio_idle(long mdio_addr)
  392. {
  393. outl(MDIO | MDDIR, mdio_addr);
  394. sis900_mdio_delay();
  395. outl(MDIO | MDDIR | MDC, mdio_addr);
  396. }
  397. /* Syncronize the MII management interface by shifting 32 one bits out. */
  398. static void sis900_mdio_reset(long mdio_addr)
  399. {
  400. int i;
  401. for (i = 31; i >= 0; i--) {
  402. outl(MDDIR | MDIO, mdio_addr);
  403. sis900_mdio_delay();
  404. outl(MDDIR | MDIO | MDC, mdio_addr);
  405. sis900_mdio_delay();
  406. }
  407. return;
  408. }
  409. static u16 sis900_mdio_read(int phy_id, int location)
  410. {
  411. long mdio_addr = ioaddr + mear;
  412. int mii_cmd = MIIread|(phy_id<<MIIpmdShift)|(location<<MIIregShift);
  413. u16 retval = 0;
  414. int i;
  415. sis900_mdio_reset(mdio_addr);
  416. sis900_mdio_idle(mdio_addr);
  417. for (i = 15; i >= 0; i--) {
  418. int dataval = (mii_cmd & (1 << i)) ? MDDIR | MDIO : MDDIR;
  419. outl(dataval, mdio_addr);
  420. sis900_mdio_delay();
  421. outl(dataval | MDC, mdio_addr);
  422. sis900_mdio_delay();
  423. }
  424. /* Read the 16 data bits. */
  425. for (i = 16; i > 0; i--) {
  426. outl(0, mdio_addr);
  427. sis900_mdio_delay();
  428. retval = (retval << 1) | ((inl(mdio_addr) & MDIO) ? 1 : 0);
  429. outl(MDC, mdio_addr);
  430. sis900_mdio_delay();
  431. }
  432. outl(0x00, mdio_addr);
  433. return retval;
  434. }
  435. #if 0
  436. static void sis900_mdio_write(int phy_id, int location, int value)
  437. {
  438. long mdio_addr = ioaddr + mear;
  439. int mii_cmd = MIIwrite|(phy_id<<MIIpmdShift)|(location<<MIIregShift);
  440. int i;
  441. sis900_mdio_reset(mdio_addr);
  442. sis900_mdio_idle(mdio_addr);
  443. /* Shift the command bits out. */
  444. for (i = 15; i >= 0; i--) {
  445. int dataval = (mii_cmd & (1 << i)) ? MDDIR | MDIO : MDDIR;
  446. outb(dataval, mdio_addr);
  447. sis900_mdio_delay();
  448. outb(dataval | MDC, mdio_addr);
  449. sis900_mdio_delay();
  450. }
  451. sis900_mdio_delay();
  452. /* Shift the value bits out. */
  453. for (i = 15; i >= 0; i--) {
  454. int dataval = (value & (1 << i)) ? MDDIR | MDIO : MDDIR;
  455. outl(dataval, mdio_addr);
  456. sis900_mdio_delay();
  457. outl(dataval | MDC, mdio_addr);
  458. sis900_mdio_delay();
  459. }
  460. sis900_mdio_delay();
  461. /* Clear out extra bits. */
  462. for (i = 2; i > 0; i--) {
  463. outb(0, mdio_addr);
  464. sis900_mdio_delay();
  465. outb(MDC, mdio_addr);
  466. sis900_mdio_delay();
  467. }
  468. outl(0x00, mdio_addr);
  469. return;
  470. }
  471. #endif
  472. /* Function: sis900_init
  473. *
  474. * Description: resets the ethernet controller chip and various
  475. * data structures required for sending and receiving packets.
  476. *
  477. * Arguments: struct nic *nic: NIC data structure
  478. *
  479. * returns: void.
  480. */
  481. static void
  482. sis900_init(struct nic *nic)
  483. {
  484. /* Soft reset the chip. */
  485. sis900_reset(nic);
  486. sis900_init_rxfilter(nic);
  487. sis900_init_txd(nic);
  488. sis900_init_rxd(nic);
  489. sis900_set_rx_mode(nic);
  490. sis900_check_mode(nic);
  491. outl(RxENA| inl(ioaddr + cr), ioaddr + cr);
  492. }
  493. /*
  494. * Function: sis900_reset
  495. *
  496. * Description: disables interrupts and soft resets the controller chip
  497. *
  498. * Arguments: struct nic *nic: NIC data structure
  499. *
  500. * Returns: void.
  501. */
  502. static void
  503. sis900_reset(struct nic *nic __unused)
  504. {
  505. int i = 0;
  506. u32 status = TxRCMP | RxRCMP;
  507. outl(0, ioaddr + ier);
  508. outl(0, ioaddr + imr);
  509. outl(0, ioaddr + rfcr);
  510. outl(RxRESET | TxRESET | RESET | inl(ioaddr + cr), ioaddr + cr);
  511. /* Check that the chip has finished the reset. */
  512. while (status && (i++ < 1000)) {
  513. status ^= (inl(isr + ioaddr) & status);
  514. }
  515. if( (pci_revision >= SIS635A_900_REV) || (pci_revision == SIS900B_900_REV) )
  516. outl(PESEL | RND_CNT, ioaddr + cfg);
  517. else
  518. outl(PESEL, ioaddr + cfg);
  519. }
  520. /* Function: sis_init_rxfilter
  521. *
  522. * Description: sets receive filter address to our MAC address
  523. *
  524. * Arguments: struct nic *nic: NIC data structure
  525. *
  526. * returns: void.
  527. */
  528. static void
  529. sis900_init_rxfilter(struct nic *nic)
  530. {
  531. u32 rfcrSave;
  532. int i;
  533. rfcrSave = inl(rfcr + ioaddr);
  534. /* disable packet filtering before setting filter */
  535. outl(rfcrSave & ~RFEN, rfcr + ioaddr);
  536. /* load MAC addr to filter data register */
  537. for (i = 0 ; i < 3 ; i++) {
  538. u32 w;
  539. w = (u32) *((u16 *)(nic->node_addr)+i);
  540. outl((i << RFADDR_shift), ioaddr + rfcr);
  541. outl(w, ioaddr + rfdr);
  542. if (sis900_debug > 0)
  543. printf("sis900_init_rxfilter: Receive Filter Addrss[%d]=%X\n",
  544. i, inl(ioaddr + rfdr));
  545. }
  546. /* enable packet filitering */
  547. outl(rfcrSave | RFEN, rfcr + ioaddr);
  548. }
  549. /*
  550. * Function: sis_init_txd
  551. *
  552. * Description: initializes the Tx descriptor
  553. *
  554. * Arguments: struct nic *nic: NIC data structure
  555. *
  556. * returns: void.
  557. */
  558. static void
  559. sis900_init_txd(struct nic *nic __unused)
  560. {
  561. txd.link = (u32) 0;
  562. txd.cmdsts = (u32) 0;
  563. txd.bufptr = virt_to_bus(&txb[0]);
  564. /* load Transmit Descriptor Register */
  565. outl(virt_to_bus(&txd), ioaddr + txdp);
  566. if (sis900_debug > 0)
  567. printf("sis900_init_txd: TX descriptor register loaded with: %X\n",
  568. inl(ioaddr + txdp));
  569. }
  570. /* Function: sis_init_rxd
  571. *
  572. * Description: initializes the Rx descriptor ring
  573. *
  574. * Arguments: struct nic *nic: NIC data structure
  575. *
  576. * Returns: void.
  577. */
  578. static void
  579. sis900_init_rxd(struct nic *nic __unused)
  580. {
  581. int i;
  582. cur_rx = 0;
  583. /* init RX descriptor */
  584. for (i = 0; i < NUM_RX_DESC; i++) {
  585. rxd[i].link = virt_to_bus((i+1 < NUM_RX_DESC) ? &rxd[i+1] : &rxd[0]);
  586. rxd[i].cmdsts = (u32) RX_BUF_SIZE;
  587. rxd[i].bufptr = virt_to_bus(&rxb[i*RX_BUF_SIZE]);
  588. if (sis900_debug > 0)
  589. printf("sis900_init_rxd: rxd[%d]=%X link=%X cmdsts=%X bufptr=%X\n",
  590. i, &rxd[i], rxd[i].link, rxd[i].cmdsts, rxd[i].bufptr);
  591. }
  592. /* load Receive Descriptor Register */
  593. outl(virt_to_bus(&rxd[0]), ioaddr + rxdp);
  594. if (sis900_debug > 0)
  595. printf("sis900_init_rxd: RX descriptor register loaded with: %X\n",
  596. inl(ioaddr + rxdp));
  597. }
  598. /* Function: sis_init_rxd
  599. *
  600. * Description:
  601. * sets the receive mode to accept all broadcast packets and packets
  602. * with our MAC address, and reject all multicast packets.
  603. *
  604. * Arguments: struct nic *nic: NIC data structure
  605. *
  606. * Returns: void.
  607. */
  608. static void sis900_set_rx_mode(struct nic *nic __unused)
  609. {
  610. int i, table_entries;
  611. u32 rx_mode;
  612. u16 mc_filter[16] = {0}; /* 256/128 bits multicast hash table */
  613. if((pci_revision == SIS635A_900_REV) || (pci_revision == SIS900B_900_REV))
  614. table_entries = 16;
  615. else
  616. table_entries = 8;
  617. /* accept all multicast packet */
  618. rx_mode = RFAAB | RFAAM;
  619. for (i = 0; i < table_entries; i++)
  620. mc_filter[i] = 0xffff;
  621. /* update Multicast Hash Table in Receive Filter */
  622. for (i = 0; i < table_entries; i++) {
  623. /* why plus 0x04? That makes the correct value for hash table. */
  624. outl((u32)(0x00000004+i) << RFADDR_shift, ioaddr + rfcr);
  625. outl(mc_filter[i], ioaddr + rfdr);
  626. }
  627. /* Accept Broadcast and multicast packets, destination addresses that match
  628. our MAC address */
  629. outl(RFEN | rx_mode, ioaddr + rfcr);
  630. return;
  631. }
  632. /* Function: sis900_check_mode
  633. *
  634. * Description: checks the state of transmit and receive
  635. * parameters on the NIC, and updates NIC registers to match
  636. *
  637. * Arguments: struct nic *nic: NIC data structure
  638. *
  639. * Returns: void.
  640. */
  641. static void
  642. sis900_check_mode(struct nic *nic)
  643. {
  644. int speed, duplex;
  645. u32 tx_flags = 0, rx_flags = 0;
  646. mii.chip_info->read_mode(nic, cur_phy, &speed, &duplex);
  647. if( inl(ioaddr + cfg) & EDB_MASTER_EN ) {
  648. tx_flags = TxATP | (DMA_BURST_64 << TxMXDMA_shift) | (TX_FILL_THRESH << TxFILLT_shift);
  649. rx_flags = DMA_BURST_64 << RxMXDMA_shift;
  650. }
  651. else {
  652. tx_flags = TxATP | (DMA_BURST_512 << TxMXDMA_shift) | (TX_FILL_THRESH << TxFILLT_shift);
  653. rx_flags = DMA_BURST_512 << RxMXDMA_shift;
  654. }
  655. if (speed == HW_SPEED_HOME || speed == HW_SPEED_10_MBPS) {
  656. rx_flags |= (RxDRNT_10 << RxDRNT_shift);
  657. tx_flags |= (TxDRNT_10 << TxDRNT_shift);
  658. }
  659. else {
  660. rx_flags |= (RxDRNT_100 << RxDRNT_shift);
  661. tx_flags |= (TxDRNT_100 << TxDRNT_shift);
  662. }
  663. if (duplex == FDX_CAPABLE_FULL_SELECTED) {
  664. tx_flags |= (TxCSI | TxHBI);
  665. rx_flags |= RxATX;
  666. }
  667. outl (tx_flags, ioaddr + txcfg);
  668. outl (rx_flags, ioaddr + rxcfg);
  669. }
  670. /* Function: sis900_read_mode
  671. *
  672. * Description: retrieves and displays speed and duplex
  673. * parameters from the NIC
  674. *
  675. * Arguments: struct nic *nic: NIC data structure
  676. *
  677. * Returns: void.
  678. */
  679. static void
  680. sis900_read_mode(struct nic *nic __unused, int phy_addr, int *speed, int *duplex)
  681. {
  682. int i = 0;
  683. u32 status;
  684. u16 phy_id0, phy_id1;
  685. /* STSOUT register is Latched on Transition, read operation updates it */
  686. while (i++ < 2)
  687. status = sis900_mdio_read(phy_addr, MII_STSOUT);
  688. *speed = HW_SPEED_10_MBPS;
  689. *duplex = FDX_CAPABLE_HALF_SELECTED;
  690. if (status & (MII_NWAY_TX | MII_NWAY_TX_FDX))
  691. *speed = HW_SPEED_100_MBPS;
  692. if (status & ( MII_NWAY_TX_FDX | MII_NWAY_T_FDX))
  693. *duplex = FDX_CAPABLE_FULL_SELECTED;
  694. /* Workaround for Realtek RTL8201 PHY issue */
  695. phy_id0 = sis900_mdio_read(phy_addr, MII_PHY_ID0);
  696. phy_id1 = sis900_mdio_read(phy_addr, MII_PHY_ID1);
  697. if((phy_id0 == 0x0000) && ((phy_id1 & 0xFFF0) == 0x8200)){
  698. if(sis900_mdio_read(phy_addr, MII_CONTROL) & MII_CNTL_FDX)
  699. *duplex = FDX_CAPABLE_FULL_SELECTED;
  700. if(sis900_mdio_read(phy_addr, 0x0019) & 0x01)
  701. *speed = HW_SPEED_100_MBPS;
  702. }
  703. if (status & MII_STSOUT_LINK_FAIL)
  704. printf("sis900_read_mode: Media Link Off\n");
  705. else
  706. printf("sis900_read_mode: Media Link On %s %s-duplex \n",
  707. *speed == HW_SPEED_100_MBPS ?
  708. "100mbps" : "10mbps",
  709. *duplex == FDX_CAPABLE_FULL_SELECTED ?
  710. "full" : "half");
  711. }
  712. /* Function: amd79c901_read_mode
  713. *
  714. * Description: retrieves and displays speed and duplex
  715. * parameters from the NIC
  716. *
  717. * Arguments: struct nic *nic: NIC data structure
  718. *
  719. * Returns: void.
  720. */
  721. static void
  722. amd79c901_read_mode(struct nic *nic __unused, int phy_addr, int *speed, int *duplex)
  723. {
  724. int i;
  725. u16 status;
  726. for (i = 0; i < 2; i++)
  727. status = sis900_mdio_read(phy_addr, MII_STATUS);
  728. if (status & MII_STAT_CAN_AUTO) {
  729. /* 10BASE-T PHY */
  730. for (i = 0; i < 2; i++)
  731. status = sis900_mdio_read(phy_addr, MII_STATUS_SUMMARY);
  732. if (status & MII_STSSUM_SPD)
  733. *speed = HW_SPEED_100_MBPS;
  734. else
  735. *speed = HW_SPEED_10_MBPS;
  736. if (status & MII_STSSUM_DPLX)
  737. *duplex = FDX_CAPABLE_FULL_SELECTED;
  738. else
  739. *duplex = FDX_CAPABLE_HALF_SELECTED;
  740. if (status & MII_STSSUM_LINK)
  741. printf("amd79c901_read_mode: Media Link On %s %s-duplex \n",
  742. *speed == HW_SPEED_100_MBPS ?
  743. "100mbps" : "10mbps",
  744. *duplex == FDX_CAPABLE_FULL_SELECTED ?
  745. "full" : "half");
  746. else
  747. printf("amd79c901_read_mode: Media Link Off\n");
  748. }
  749. else {
  750. /* HomePNA */
  751. *speed = HW_SPEED_HOME;
  752. *duplex = FDX_CAPABLE_HALF_SELECTED;
  753. if (status & MII_STAT_LINK)
  754. printf("amd79c901_read_mode:Media Link On 1mbps half-duplex \n");
  755. else
  756. printf("amd79c901_read_mode: Media Link Off\n");
  757. }
  758. }
  759. /**
  760. * ics1893_read_mode: - read media mode for ICS1893 PHY
  761. * @net_dev: the net device to read mode for
  762. * @phy_addr: mii phy address
  763. * @speed: the transmit speed to be determined
  764. * @duplex: the duplex mode to be determined
  765. *
  766. * ICS1893 PHY use Quick Poll Detailed Status register
  767. * to determine the speed and duplex mode for sis900
  768. */
  769. static void ics1893_read_mode(struct nic *nic __unused, int phy_addr, int *speed, int *duplex)
  770. {
  771. int i = 0;
  772. u32 status;
  773. /* MII_QPDSTS is Latched, read twice in succession will reflect the current state */
  774. for (i = 0; i < 2; i++)
  775. status = sis900_mdio_read(phy_addr, MII_QPDSTS);
  776. if (status & MII_STSICS_SPD)
  777. *speed = HW_SPEED_100_MBPS;
  778. else
  779. *speed = HW_SPEED_10_MBPS;
  780. if (status & MII_STSICS_DPLX)
  781. *duplex = FDX_CAPABLE_FULL_SELECTED;
  782. else
  783. *duplex = FDX_CAPABLE_HALF_SELECTED;
  784. if (status & MII_STSICS_LINKSTS)
  785. printf("ics1893_read_mode: Media Link On %s %s-duplex \n",
  786. *speed == HW_SPEED_100_MBPS ?
  787. "100mbps" : "10mbps",
  788. *duplex == FDX_CAPABLE_FULL_SELECTED ?
  789. "full" : "half");
  790. else
  791. printf("ics1893_read_mode: Media Link Off\n");
  792. }
  793. /**
  794. * rtl8201_read_mode: - read media mode for rtl8201 phy
  795. * @nic: the net device to read mode for
  796. * @phy_addr: mii phy address
  797. * @speed: the transmit speed to be determined
  798. * @duplex: the duplex mode to be determined
  799. *
  800. * read MII_STATUS register from rtl8201 phy
  801. * to determine the speed and duplex mode for sis900
  802. */
  803. static void rtl8201_read_mode(struct nic *nic __unused, int phy_addr, int *speed, int *duplex)
  804. {
  805. u32 status;
  806. status = sis900_mdio_read(phy_addr, MII_STATUS);
  807. if (status & MII_STAT_CAN_TX_FDX) {
  808. *speed = HW_SPEED_100_MBPS;
  809. *duplex = FDX_CAPABLE_FULL_SELECTED;
  810. }
  811. else if (status & MII_STAT_CAN_TX) {
  812. *speed = HW_SPEED_100_MBPS;
  813. *duplex = FDX_CAPABLE_HALF_SELECTED;
  814. }
  815. else if (status & MII_STAT_CAN_T_FDX) {
  816. *speed = HW_SPEED_10_MBPS;
  817. *duplex = FDX_CAPABLE_FULL_SELECTED;
  818. }
  819. else if (status & MII_STAT_CAN_T) {
  820. *speed = HW_SPEED_10_MBPS;
  821. *duplex = FDX_CAPABLE_HALF_SELECTED;
  822. }
  823. if (status & MII_STAT_LINK)
  824. printf("rtl8201_read_mode: Media Link On %s %s-duplex \n",
  825. *speed == HW_SPEED_100_MBPS ?
  826. "100mbps" : "10mbps",
  827. *duplex == FDX_CAPABLE_FULL_SELECTED ?
  828. "full" : "half");
  829. else
  830. printf("rtl8201_read_config_mode: Media Link Off\n");
  831. }
  832. /**
  833. * vt6103_read_mode: - read media mode for vt6103 phy
  834. * @nic: the net device to read mode for
  835. * @phy_addr: mii phy address
  836. * @speed: the transmit speed to be determined
  837. * @duplex: the duplex mode to be determined
  838. *
  839. * read MII_STATUS register from rtl8201 phy
  840. * to determine the speed and duplex mode for sis900
  841. */
  842. static void vt6103_read_mode(struct nic *nic __unused, int phy_addr, int *speed, int *duplex)
  843. {
  844. u32 status;
  845. status = sis900_mdio_read(phy_addr, MII_STATUS);
  846. if (status & MII_STAT_CAN_TX_FDX) {
  847. *speed = HW_SPEED_100_MBPS;
  848. *duplex = FDX_CAPABLE_FULL_SELECTED;
  849. }
  850. else if (status & MII_STAT_CAN_TX) {
  851. *speed = HW_SPEED_100_MBPS;
  852. *duplex = FDX_CAPABLE_HALF_SELECTED;
  853. }
  854. else if (status & MII_STAT_CAN_T_FDX) {
  855. *speed = HW_SPEED_10_MBPS;
  856. *duplex = FDX_CAPABLE_FULL_SELECTED;
  857. }
  858. else if (status & MII_STAT_CAN_T) {
  859. *speed = HW_SPEED_10_MBPS;
  860. *duplex = FDX_CAPABLE_HALF_SELECTED;
  861. }
  862. if (status & MII_STAT_LINK)
  863. printf("vt6103_read_mode: Media Link On %s %s-duplex \n",
  864. *speed == HW_SPEED_100_MBPS ?
  865. "100mbps" : "10mbps",
  866. *duplex == FDX_CAPABLE_FULL_SELECTED ?
  867. "full" : "half");
  868. else
  869. printf("vt6103_read_config_mode: Media Link Off\n");
  870. }
  871. /* Function: sis900_transmit
  872. *
  873. * Description: transmits a packet and waits for completion or timeout.
  874. *
  875. * Arguments: char d[6]: destination ethernet address.
  876. * unsigned short t: ethernet protocol type.
  877. * unsigned short s: size of the data-part of the packet.
  878. * char *p: the data for the packet.
  879. *
  880. * Returns: void.
  881. */
  882. static void
  883. sis900_transmit(struct nic *nic,
  884. const char *d, /* Destination */
  885. unsigned int t, /* Type */
  886. unsigned int s, /* size */
  887. const char *p) /* Packet */
  888. {
  889. u32 to, nstype;
  890. u32 tx_status;
  891. /* Stop the transmitter */
  892. outl(TxDIS | inl(ioaddr + cr), ioaddr + cr);
  893. /* load Transmit Descriptor Register */
  894. outl(virt_to_bus(&txd), ioaddr + txdp);
  895. if (sis900_debug > 1)
  896. printf("sis900_transmit: TX descriptor register loaded with: %X\n",
  897. inl(ioaddr + txdp));
  898. memcpy(txb, d, ETH_ALEN);
  899. memcpy(txb + ETH_ALEN, nic->node_addr, ETH_ALEN);
  900. nstype = htons(t);
  901. memcpy(txb + 2 * ETH_ALEN, (char*)&nstype, 2);
  902. memcpy(txb + ETH_HLEN, p, s);
  903. s += ETH_HLEN;
  904. s &= DSIZE;
  905. if (sis900_debug > 1)
  906. printf("sis900_transmit: sending %d bytes ethtype %hX\n", (int) s, t);
  907. /* pad to minimum packet size */
  908. while (s < ETH_ZLEN)
  909. txb[s++] = '\0';
  910. /* set the transmit buffer descriptor and enable Transmit State Machine */
  911. txd.bufptr = virt_to_bus(&txb[0]);
  912. txd.cmdsts = (u32) OWN | s;
  913. /* restart the transmitter */
  914. outl(TxENA | inl(ioaddr + cr), ioaddr + cr);
  915. if (sis900_debug > 1)
  916. printf("sis900_transmit: Queued Tx packet size %d.\n", (int) s);
  917. to = currticks() + TX_TIMEOUT;
  918. while ((((volatile u32) tx_status=txd.cmdsts) & OWN) && (currticks() < to))
  919. /* wait */ ;
  920. if (currticks() >= to) {
  921. printf("sis900_transmit: TX Timeout! Tx status %X.\n", tx_status);
  922. }
  923. if (tx_status & (ABORT | UNDERRUN | OWCOLL)) {
  924. /* packet unsuccessfully transmited */
  925. printf("sis900_transmit: Transmit error, Tx status %X.\n", tx_status);
  926. }
  927. /* Disable interrupts by clearing the interrupt mask. */
  928. outl(0, ioaddr + imr);
  929. }
  930. /* Function: sis900_poll
  931. *
  932. * Description: checks for a received packet and returns it if found.
  933. *
  934. * Arguments: struct nic *nic: NIC data structure
  935. *
  936. * Returns: 1 if a packet was recieved.
  937. * 0 if no pacet was recieved.
  938. *
  939. * Side effects:
  940. * Returns (copies) the packet to the array nic->packet.
  941. * Returns the length of the packet in nic->packetlen.
  942. */
  943. static int
  944. sis900_poll(struct nic *nic, int retrieve)
  945. {
  946. u32 rx_status = rxd[cur_rx].cmdsts;
  947. int retstat = 0;
  948. if (sis900_debug > 2)
  949. printf("sis900_poll: cur_rx:%d, status:%X\n", cur_rx, rx_status);
  950. if (!(rx_status & OWN))
  951. return retstat;
  952. if (sis900_debug > 1)
  953. printf("sis900_poll: got a packet: cur_rx:%d, status:%X\n",
  954. cur_rx, rx_status);
  955. if ( ! retrieve ) return 1;
  956. nic->packetlen = (rx_status & DSIZE) - CRC_SIZE;
  957. if (rx_status & (ABORT|OVERRUN|TOOLONG|RUNT|RXISERR|CRCERR|FAERR)) {
  958. /* corrupted packet received */
  959. printf("sis900_poll: Corrupted packet received, buffer status = %X\n",
  960. rx_status);
  961. retstat = 0;
  962. } else {
  963. /* give packet to higher level routine */
  964. memcpy(nic->packet, (rxb + cur_rx*RX_BUF_SIZE), nic->packetlen);
  965. retstat = 1;
  966. }
  967. /* return the descriptor and buffer to receive ring */
  968. rxd[cur_rx].cmdsts = RX_BUF_SIZE;
  969. rxd[cur_rx].bufptr = virt_to_bus(&rxb[cur_rx*RX_BUF_SIZE]);
  970. if (++cur_rx == NUM_RX_DESC)
  971. cur_rx = 0;
  972. /* re-enable the potentially idle receive state machine */
  973. outl(RxENA | inl(ioaddr + cr), ioaddr + cr);
  974. return retstat;
  975. }
  976. /* Function: sis900_disable
  977. *
  978. * Description: Turns off interrupts and stops Tx and Rx engines
  979. *
  980. * Arguments: struct nic *nic: NIC data structure
  981. *
  982. * Returns: void.
  983. */
  984. static void
  985. sis900_disable ( struct nic *nic ) {
  986. /* merge reset and disable */
  987. sis900_init(nic);
  988. /* Disable interrupts by clearing the interrupt mask. */
  989. outl(0, ioaddr + imr);
  990. outl(0, ioaddr + ier);
  991. /* Stop the chip's Tx and Rx Status Machine */
  992. outl(RxDIS | TxDIS | inl(ioaddr + cr), ioaddr + cr);
  993. }
  994. /* Function: sis900_irq
  995. *
  996. * Description: Enable, Disable, or Force, interrupts
  997. *
  998. * Arguments: struct nic *nic: NIC data structure
  999. * irq_action_t action: Requested action
  1000. *
  1001. * Returns: void.
  1002. */
  1003. static void
  1004. sis900_irq(struct nic *nic __unused, irq_action_t action __unused)
  1005. {
  1006. switch ( action ) {
  1007. case DISABLE :
  1008. break;
  1009. case ENABLE :
  1010. break;
  1011. case FORCE :
  1012. break;
  1013. }
  1014. }
  1015. static struct pci_id sis900_nics[] = {
  1016. PCI_ROM(0x1039, 0x0900, "sis900", "SIS900"),
  1017. PCI_ROM(0x1039, 0x7016, "sis7016", "SIS7016"),
  1018. };
  1019. static struct pci_driver sis900_driver =
  1020. PCI_DRIVER ( "SIS900", sis900_nics, PCI_NO_CLASS );
  1021. BOOT_DRIVER ( "SIS900", sis900_probe );