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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264
  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);
  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 nic *nic);
  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. static struct nic_operations sis900_operations;
  327. static struct nic_operations sis900_operations = {
  328. .connect = dummy_connect,
  329. .poll = sis900_poll,
  330. .transmit = sis900_transmit,
  331. .irq = sis900_irq,
  332. .disable = sis900_disable,
  333. };
  334. nic->nic_op = &sis900_operations;
  335. return 1;
  336. }
  337. /*
  338. * EEPROM Routines: These functions read and write to EEPROM for
  339. * retrieving the MAC address and other configuration information about
  340. * the card.
  341. */
  342. /* Delay between EEPROM clock transitions. */
  343. #define eeprom_delay() inl(ee_addr)
  344. /* Function: sis900_read_eeprom
  345. *
  346. * Description: reads and returns a given location from EEPROM
  347. *
  348. * Arguments: int location: requested EEPROM location
  349. *
  350. * Returns: u16: contents of requested EEPROM location
  351. *
  352. */
  353. /* Read Serial EEPROM through EEPROM Access Register, Note that location is
  354. in word (16 bits) unit */
  355. static u16 sis900_read_eeprom(int location)
  356. {
  357. int i;
  358. u16 retval = 0;
  359. long ee_addr = ioaddr + mear;
  360. u32 read_cmd = location | EEread;
  361. outl(0, ee_addr);
  362. eeprom_delay();
  363. outl(EECS, ee_addr);
  364. eeprom_delay();
  365. /* Shift the read command (9) bits out. */
  366. for (i = 8; i >= 0; i--) {
  367. u32 dataval = (read_cmd & (1 << i)) ? EEDI | EECS : EECS;
  368. outl(dataval, ee_addr);
  369. eeprom_delay();
  370. outl(dataval | EECLK, ee_addr);
  371. eeprom_delay();
  372. }
  373. outl(EECS, ee_addr);
  374. eeprom_delay();
  375. /* read the 16-bits data in */
  376. for (i = 16; i > 0; i--) {
  377. outl(EECS, ee_addr);
  378. eeprom_delay();
  379. outl(EECS | EECLK, ee_addr);
  380. eeprom_delay();
  381. retval = (retval << 1) | ((inl(ee_addr) & EEDO) ? 1 : 0);
  382. eeprom_delay();
  383. }
  384. /* Terminate the EEPROM access. */
  385. outl(0, ee_addr);
  386. eeprom_delay();
  387. // outl(EECLK, ee_addr);
  388. return (retval);
  389. }
  390. #define sis900_mdio_delay() inl(mdio_addr)
  391. /*
  392. Read and write the MII management registers using software-generated
  393. serial MDIO protocol. Note that the command bits and data bits are
  394. send out seperately
  395. */
  396. static void sis900_mdio_idle(long mdio_addr)
  397. {
  398. outl(MDIO | MDDIR, mdio_addr);
  399. sis900_mdio_delay();
  400. outl(MDIO | MDDIR | MDC, mdio_addr);
  401. }
  402. /* Syncronize the MII management interface by shifting 32 one bits out. */
  403. static void sis900_mdio_reset(long mdio_addr)
  404. {
  405. int i;
  406. for (i = 31; i >= 0; i--) {
  407. outl(MDDIR | MDIO, mdio_addr);
  408. sis900_mdio_delay();
  409. outl(MDDIR | MDIO | MDC, mdio_addr);
  410. sis900_mdio_delay();
  411. }
  412. return;
  413. }
  414. static u16 sis900_mdio_read(int phy_id, int location)
  415. {
  416. long mdio_addr = ioaddr + mear;
  417. int mii_cmd = MIIread|(phy_id<<MIIpmdShift)|(location<<MIIregShift);
  418. u16 retval = 0;
  419. int i;
  420. sis900_mdio_reset(mdio_addr);
  421. sis900_mdio_idle(mdio_addr);
  422. for (i = 15; i >= 0; i--) {
  423. int dataval = (mii_cmd & (1 << i)) ? MDDIR | MDIO : MDDIR;
  424. outl(dataval, mdio_addr);
  425. sis900_mdio_delay();
  426. outl(dataval | MDC, mdio_addr);
  427. sis900_mdio_delay();
  428. }
  429. /* Read the 16 data bits. */
  430. for (i = 16; i > 0; i--) {
  431. outl(0, mdio_addr);
  432. sis900_mdio_delay();
  433. retval = (retval << 1) | ((inl(mdio_addr) & MDIO) ? 1 : 0);
  434. outl(MDC, mdio_addr);
  435. sis900_mdio_delay();
  436. }
  437. outl(0x00, mdio_addr);
  438. return retval;
  439. }
  440. #if 0
  441. static void sis900_mdio_write(int phy_id, int location, int value)
  442. {
  443. long mdio_addr = ioaddr + mear;
  444. int mii_cmd = MIIwrite|(phy_id<<MIIpmdShift)|(location<<MIIregShift);
  445. int i;
  446. sis900_mdio_reset(mdio_addr);
  447. sis900_mdio_idle(mdio_addr);
  448. /* Shift the command bits out. */
  449. for (i = 15; i >= 0; i--) {
  450. int dataval = (mii_cmd & (1 << i)) ? MDDIR | MDIO : MDDIR;
  451. outb(dataval, mdio_addr);
  452. sis900_mdio_delay();
  453. outb(dataval | MDC, mdio_addr);
  454. sis900_mdio_delay();
  455. }
  456. sis900_mdio_delay();
  457. /* Shift the value bits out. */
  458. for (i = 15; i >= 0; i--) {
  459. int dataval = (value & (1 << i)) ? MDDIR | MDIO : MDDIR;
  460. outl(dataval, mdio_addr);
  461. sis900_mdio_delay();
  462. outl(dataval | MDC, mdio_addr);
  463. sis900_mdio_delay();
  464. }
  465. sis900_mdio_delay();
  466. /* Clear out extra bits. */
  467. for (i = 2; i > 0; i--) {
  468. outb(0, mdio_addr);
  469. sis900_mdio_delay();
  470. outb(MDC, mdio_addr);
  471. sis900_mdio_delay();
  472. }
  473. outl(0x00, mdio_addr);
  474. return;
  475. }
  476. #endif
  477. /* Function: sis900_init
  478. *
  479. * Description: resets the ethernet controller chip and various
  480. * data structures required for sending and receiving packets.
  481. *
  482. * Arguments: struct nic *nic: NIC data structure
  483. *
  484. * returns: void.
  485. */
  486. static void
  487. sis900_init(struct nic *nic)
  488. {
  489. /* Soft reset the chip. */
  490. sis900_reset(nic);
  491. sis900_init_rxfilter(nic);
  492. sis900_init_txd(nic);
  493. sis900_init_rxd(nic);
  494. sis900_set_rx_mode(nic);
  495. sis900_check_mode(nic);
  496. outl(RxENA| inl(ioaddr + cr), ioaddr + cr);
  497. }
  498. /*
  499. * Function: sis900_reset
  500. *
  501. * Description: disables interrupts and soft resets the controller chip
  502. *
  503. * Arguments: struct nic *nic: NIC data structure
  504. *
  505. * Returns: void.
  506. */
  507. static void
  508. sis900_reset(struct nic *nic __unused)
  509. {
  510. int i = 0;
  511. u32 status = TxRCMP | RxRCMP;
  512. outl(0, ioaddr + ier);
  513. outl(0, ioaddr + imr);
  514. outl(0, ioaddr + rfcr);
  515. outl(RxRESET | TxRESET | RESET | inl(ioaddr + cr), ioaddr + cr);
  516. /* Check that the chip has finished the reset. */
  517. while (status && (i++ < 1000)) {
  518. status ^= (inl(isr + ioaddr) & status);
  519. }
  520. if( (pci_revision >= SIS635A_900_REV) || (pci_revision == SIS900B_900_REV) )
  521. outl(PESEL | RND_CNT, ioaddr + cfg);
  522. else
  523. outl(PESEL, ioaddr + cfg);
  524. }
  525. /* Function: sis_init_rxfilter
  526. *
  527. * Description: sets receive filter address to our MAC address
  528. *
  529. * Arguments: struct nic *nic: NIC data structure
  530. *
  531. * returns: void.
  532. */
  533. static void
  534. sis900_init_rxfilter(struct nic *nic)
  535. {
  536. u32 rfcrSave;
  537. int i;
  538. rfcrSave = inl(rfcr + ioaddr);
  539. /* disable packet filtering before setting filter */
  540. outl(rfcrSave & ~RFEN, rfcr + ioaddr);
  541. /* load MAC addr to filter data register */
  542. for (i = 0 ; i < 3 ; i++) {
  543. u32 w;
  544. w = (u32) *((u16 *)(nic->node_addr)+i);
  545. outl((i << RFADDR_shift), ioaddr + rfcr);
  546. outl(w, ioaddr + rfdr);
  547. if (sis900_debug > 0)
  548. printf("sis900_init_rxfilter: Receive Filter Addrss[%d]=%X\n",
  549. i, inl(ioaddr + rfdr));
  550. }
  551. /* enable packet filitering */
  552. outl(rfcrSave | RFEN, rfcr + ioaddr);
  553. }
  554. /*
  555. * Function: sis_init_txd
  556. *
  557. * Description: initializes the Tx descriptor
  558. *
  559. * Arguments: struct nic *nic: NIC data structure
  560. *
  561. * returns: void.
  562. */
  563. static void
  564. sis900_init_txd(struct nic *nic __unused)
  565. {
  566. txd.link = (u32) 0;
  567. txd.cmdsts = (u32) 0;
  568. txd.bufptr = virt_to_bus(&txb[0]);
  569. /* load Transmit Descriptor Register */
  570. outl(virt_to_bus(&txd), ioaddr + txdp);
  571. if (sis900_debug > 0)
  572. printf("sis900_init_txd: TX descriptor register loaded with: %X\n",
  573. inl(ioaddr + txdp));
  574. }
  575. /* Function: sis_init_rxd
  576. *
  577. * Description: initializes the Rx descriptor ring
  578. *
  579. * Arguments: struct nic *nic: NIC data structure
  580. *
  581. * Returns: void.
  582. */
  583. static void
  584. sis900_init_rxd(struct nic *nic __unused)
  585. {
  586. int i;
  587. cur_rx = 0;
  588. /* init RX descriptor */
  589. for (i = 0; i < NUM_RX_DESC; i++) {
  590. rxd[i].link = virt_to_bus((i+1 < NUM_RX_DESC) ? &rxd[i+1] : &rxd[0]);
  591. rxd[i].cmdsts = (u32) RX_BUF_SIZE;
  592. rxd[i].bufptr = virt_to_bus(&rxb[i*RX_BUF_SIZE]);
  593. if (sis900_debug > 0)
  594. printf("sis900_init_rxd: rxd[%d]=%X link=%X cmdsts=%X bufptr=%X\n",
  595. i, &rxd[i], rxd[i].link, rxd[i].cmdsts, rxd[i].bufptr);
  596. }
  597. /* load Receive Descriptor Register */
  598. outl(virt_to_bus(&rxd[0]), ioaddr + rxdp);
  599. if (sis900_debug > 0)
  600. printf("sis900_init_rxd: RX descriptor register loaded with: %X\n",
  601. inl(ioaddr + rxdp));
  602. }
  603. /* Function: sis_init_rxd
  604. *
  605. * Description:
  606. * sets the receive mode to accept all broadcast packets and packets
  607. * with our MAC address, and reject all multicast packets.
  608. *
  609. * Arguments: struct nic *nic: NIC data structure
  610. *
  611. * Returns: void.
  612. */
  613. static void sis900_set_rx_mode(struct nic *nic __unused)
  614. {
  615. int i, table_entries;
  616. u32 rx_mode;
  617. u16 mc_filter[16] = {0}; /* 256/128 bits multicast hash table */
  618. if((pci_revision == SIS635A_900_REV) || (pci_revision == SIS900B_900_REV))
  619. table_entries = 16;
  620. else
  621. table_entries = 8;
  622. /* accept all multicast packet */
  623. rx_mode = RFAAB | RFAAM;
  624. for (i = 0; i < table_entries; i++)
  625. mc_filter[i] = 0xffff;
  626. /* update Multicast Hash Table in Receive Filter */
  627. for (i = 0; i < table_entries; i++) {
  628. /* why plus 0x04? That makes the correct value for hash table. */
  629. outl((u32)(0x00000004+i) << RFADDR_shift, ioaddr + rfcr);
  630. outl(mc_filter[i], ioaddr + rfdr);
  631. }
  632. /* Accept Broadcast and multicast packets, destination addresses that match
  633. our MAC address */
  634. outl(RFEN | rx_mode, ioaddr + rfcr);
  635. return;
  636. }
  637. /* Function: sis900_check_mode
  638. *
  639. * Description: checks the state of transmit and receive
  640. * parameters on the NIC, and updates NIC registers to match
  641. *
  642. * Arguments: struct nic *nic: NIC data structure
  643. *
  644. * Returns: void.
  645. */
  646. static void
  647. sis900_check_mode(struct nic *nic)
  648. {
  649. int speed, duplex;
  650. u32 tx_flags = 0, rx_flags = 0;
  651. mii.chip_info->read_mode(nic, cur_phy, &speed, &duplex);
  652. if( inl(ioaddr + cfg) & EDB_MASTER_EN ) {
  653. tx_flags = TxATP | (DMA_BURST_64 << TxMXDMA_shift) | (TX_FILL_THRESH << TxFILLT_shift);
  654. rx_flags = DMA_BURST_64 << RxMXDMA_shift;
  655. }
  656. else {
  657. tx_flags = TxATP | (DMA_BURST_512 << TxMXDMA_shift) | (TX_FILL_THRESH << TxFILLT_shift);
  658. rx_flags = DMA_BURST_512 << RxMXDMA_shift;
  659. }
  660. if (speed == HW_SPEED_HOME || speed == HW_SPEED_10_MBPS) {
  661. rx_flags |= (RxDRNT_10 << RxDRNT_shift);
  662. tx_flags |= (TxDRNT_10 << TxDRNT_shift);
  663. }
  664. else {
  665. rx_flags |= (RxDRNT_100 << RxDRNT_shift);
  666. tx_flags |= (TxDRNT_100 << TxDRNT_shift);
  667. }
  668. if (duplex == FDX_CAPABLE_FULL_SELECTED) {
  669. tx_flags |= (TxCSI | TxHBI);
  670. rx_flags |= RxATX;
  671. }
  672. outl (tx_flags, ioaddr + txcfg);
  673. outl (rx_flags, ioaddr + rxcfg);
  674. }
  675. /* Function: sis900_read_mode
  676. *
  677. * Description: retrieves and displays speed and duplex
  678. * parameters from the NIC
  679. *
  680. * Arguments: struct nic *nic: NIC data structure
  681. *
  682. * Returns: void.
  683. */
  684. static void
  685. sis900_read_mode(struct nic *nic __unused, int phy_addr, int *speed, int *duplex)
  686. {
  687. int i = 0;
  688. u32 status;
  689. u16 phy_id0, phy_id1;
  690. /* STSOUT register is Latched on Transition, read operation updates it */
  691. while (i++ < 2)
  692. status = sis900_mdio_read(phy_addr, MII_STSOUT);
  693. *speed = HW_SPEED_10_MBPS;
  694. *duplex = FDX_CAPABLE_HALF_SELECTED;
  695. if (status & (MII_NWAY_TX | MII_NWAY_TX_FDX))
  696. *speed = HW_SPEED_100_MBPS;
  697. if (status & ( MII_NWAY_TX_FDX | MII_NWAY_T_FDX))
  698. *duplex = FDX_CAPABLE_FULL_SELECTED;
  699. /* Workaround for Realtek RTL8201 PHY issue */
  700. phy_id0 = sis900_mdio_read(phy_addr, MII_PHY_ID0);
  701. phy_id1 = sis900_mdio_read(phy_addr, MII_PHY_ID1);
  702. if((phy_id0 == 0x0000) && ((phy_id1 & 0xFFF0) == 0x8200)){
  703. if(sis900_mdio_read(phy_addr, MII_CONTROL) & MII_CNTL_FDX)
  704. *duplex = FDX_CAPABLE_FULL_SELECTED;
  705. if(sis900_mdio_read(phy_addr, 0x0019) & 0x01)
  706. *speed = HW_SPEED_100_MBPS;
  707. }
  708. if (status & MII_STSOUT_LINK_FAIL)
  709. printf("sis900_read_mode: Media Link Off\n");
  710. else
  711. printf("sis900_read_mode: Media Link On %s %s-duplex \n",
  712. *speed == HW_SPEED_100_MBPS ?
  713. "100mbps" : "10mbps",
  714. *duplex == FDX_CAPABLE_FULL_SELECTED ?
  715. "full" : "half");
  716. }
  717. /* Function: amd79c901_read_mode
  718. *
  719. * Description: retrieves and displays speed and duplex
  720. * parameters from the NIC
  721. *
  722. * Arguments: struct nic *nic: NIC data structure
  723. *
  724. * Returns: void.
  725. */
  726. static void
  727. amd79c901_read_mode(struct nic *nic __unused, int phy_addr, int *speed, int *duplex)
  728. {
  729. int i;
  730. u16 status;
  731. for (i = 0; i < 2; i++)
  732. status = sis900_mdio_read(phy_addr, MII_STATUS);
  733. if (status & MII_STAT_CAN_AUTO) {
  734. /* 10BASE-T PHY */
  735. for (i = 0; i < 2; i++)
  736. status = sis900_mdio_read(phy_addr, MII_STATUS_SUMMARY);
  737. if (status & MII_STSSUM_SPD)
  738. *speed = HW_SPEED_100_MBPS;
  739. else
  740. *speed = HW_SPEED_10_MBPS;
  741. if (status & MII_STSSUM_DPLX)
  742. *duplex = FDX_CAPABLE_FULL_SELECTED;
  743. else
  744. *duplex = FDX_CAPABLE_HALF_SELECTED;
  745. if (status & MII_STSSUM_LINK)
  746. printf("amd79c901_read_mode: Media Link On %s %s-duplex \n",
  747. *speed == HW_SPEED_100_MBPS ?
  748. "100mbps" : "10mbps",
  749. *duplex == FDX_CAPABLE_FULL_SELECTED ?
  750. "full" : "half");
  751. else
  752. printf("amd79c901_read_mode: Media Link Off\n");
  753. }
  754. else {
  755. /* HomePNA */
  756. *speed = HW_SPEED_HOME;
  757. *duplex = FDX_CAPABLE_HALF_SELECTED;
  758. if (status & MII_STAT_LINK)
  759. printf("amd79c901_read_mode:Media Link On 1mbps half-duplex \n");
  760. else
  761. printf("amd79c901_read_mode: Media Link Off\n");
  762. }
  763. }
  764. /**
  765. * ics1893_read_mode: - read media mode for ICS1893 PHY
  766. * @net_dev: the net device to read mode for
  767. * @phy_addr: mii phy address
  768. * @speed: the transmit speed to be determined
  769. * @duplex: the duplex mode to be determined
  770. *
  771. * ICS1893 PHY use Quick Poll Detailed Status register
  772. * to determine the speed and duplex mode for sis900
  773. */
  774. static void ics1893_read_mode(struct nic *nic __unused, int phy_addr, int *speed, int *duplex)
  775. {
  776. int i = 0;
  777. u32 status;
  778. /* MII_QPDSTS is Latched, read twice in succession will reflect the current state */
  779. for (i = 0; i < 2; i++)
  780. status = sis900_mdio_read(phy_addr, MII_QPDSTS);
  781. if (status & MII_STSICS_SPD)
  782. *speed = HW_SPEED_100_MBPS;
  783. else
  784. *speed = HW_SPEED_10_MBPS;
  785. if (status & MII_STSICS_DPLX)
  786. *duplex = FDX_CAPABLE_FULL_SELECTED;
  787. else
  788. *duplex = FDX_CAPABLE_HALF_SELECTED;
  789. if (status & MII_STSICS_LINKSTS)
  790. printf("ics1893_read_mode: Media Link On %s %s-duplex \n",
  791. *speed == HW_SPEED_100_MBPS ?
  792. "100mbps" : "10mbps",
  793. *duplex == FDX_CAPABLE_FULL_SELECTED ?
  794. "full" : "half");
  795. else
  796. printf("ics1893_read_mode: Media Link Off\n");
  797. }
  798. /**
  799. * rtl8201_read_mode: - read media mode for rtl8201 phy
  800. * @nic: the net device to read mode for
  801. * @phy_addr: mii phy address
  802. * @speed: the transmit speed to be determined
  803. * @duplex: the duplex mode to be determined
  804. *
  805. * read MII_STATUS register from rtl8201 phy
  806. * to determine the speed and duplex mode for sis900
  807. */
  808. static void rtl8201_read_mode(struct nic *nic __unused, int phy_addr, int *speed, int *duplex)
  809. {
  810. u32 status;
  811. status = sis900_mdio_read(phy_addr, MII_STATUS);
  812. if (status & MII_STAT_CAN_TX_FDX) {
  813. *speed = HW_SPEED_100_MBPS;
  814. *duplex = FDX_CAPABLE_FULL_SELECTED;
  815. }
  816. else if (status & MII_STAT_CAN_TX) {
  817. *speed = HW_SPEED_100_MBPS;
  818. *duplex = FDX_CAPABLE_HALF_SELECTED;
  819. }
  820. else if (status & MII_STAT_CAN_T_FDX) {
  821. *speed = HW_SPEED_10_MBPS;
  822. *duplex = FDX_CAPABLE_FULL_SELECTED;
  823. }
  824. else if (status & MII_STAT_CAN_T) {
  825. *speed = HW_SPEED_10_MBPS;
  826. *duplex = FDX_CAPABLE_HALF_SELECTED;
  827. }
  828. if (status & MII_STAT_LINK)
  829. printf("rtl8201_read_mode: Media Link On %s %s-duplex \n",
  830. *speed == HW_SPEED_100_MBPS ?
  831. "100mbps" : "10mbps",
  832. *duplex == FDX_CAPABLE_FULL_SELECTED ?
  833. "full" : "half");
  834. else
  835. printf("rtl8201_read_config_mode: Media Link Off\n");
  836. }
  837. /**
  838. * vt6103_read_mode: - read media mode for vt6103 phy
  839. * @nic: the net device to read mode for
  840. * @phy_addr: mii phy address
  841. * @speed: the transmit speed to be determined
  842. * @duplex: the duplex mode to be determined
  843. *
  844. * read MII_STATUS register from rtl8201 phy
  845. * to determine the speed and duplex mode for sis900
  846. */
  847. static void vt6103_read_mode(struct nic *nic __unused, int phy_addr, int *speed, int *duplex)
  848. {
  849. u32 status;
  850. status = sis900_mdio_read(phy_addr, MII_STATUS);
  851. if (status & MII_STAT_CAN_TX_FDX) {
  852. *speed = HW_SPEED_100_MBPS;
  853. *duplex = FDX_CAPABLE_FULL_SELECTED;
  854. }
  855. else if (status & MII_STAT_CAN_TX) {
  856. *speed = HW_SPEED_100_MBPS;
  857. *duplex = FDX_CAPABLE_HALF_SELECTED;
  858. }
  859. else if (status & MII_STAT_CAN_T_FDX) {
  860. *speed = HW_SPEED_10_MBPS;
  861. *duplex = FDX_CAPABLE_FULL_SELECTED;
  862. }
  863. else if (status & MII_STAT_CAN_T) {
  864. *speed = HW_SPEED_10_MBPS;
  865. *duplex = FDX_CAPABLE_HALF_SELECTED;
  866. }
  867. if (status & MII_STAT_LINK)
  868. printf("vt6103_read_mode: Media Link On %s %s-duplex \n",
  869. *speed == HW_SPEED_100_MBPS ?
  870. "100mbps" : "10mbps",
  871. *duplex == FDX_CAPABLE_FULL_SELECTED ?
  872. "full" : "half");
  873. else
  874. printf("vt6103_read_config_mode: Media Link Off\n");
  875. }
  876. /* Function: sis900_transmit
  877. *
  878. * Description: transmits a packet and waits for completion or timeout.
  879. *
  880. * Arguments: char d[6]: destination ethernet address.
  881. * unsigned short t: ethernet protocol type.
  882. * unsigned short s: size of the data-part of the packet.
  883. * char *p: the data for the packet.
  884. *
  885. * Returns: void.
  886. */
  887. static void
  888. sis900_transmit(struct nic *nic,
  889. const char *d, /* Destination */
  890. unsigned int t, /* Type */
  891. unsigned int s, /* size */
  892. const char *p) /* Packet */
  893. {
  894. u32 to, nstype;
  895. u32 tx_status;
  896. /* Stop the transmitter */
  897. outl(TxDIS | inl(ioaddr + cr), ioaddr + cr);
  898. /* load Transmit Descriptor Register */
  899. outl(virt_to_bus(&txd), ioaddr + txdp);
  900. if (sis900_debug > 1)
  901. printf("sis900_transmit: TX descriptor register loaded with: %X\n",
  902. inl(ioaddr + txdp));
  903. memcpy(txb, d, ETH_ALEN);
  904. memcpy(txb + ETH_ALEN, nic->node_addr, ETH_ALEN);
  905. nstype = htons(t);
  906. memcpy(txb + 2 * ETH_ALEN, (char*)&nstype, 2);
  907. memcpy(txb + ETH_HLEN, p, s);
  908. s += ETH_HLEN;
  909. s &= DSIZE;
  910. if (sis900_debug > 1)
  911. printf("sis900_transmit: sending %d bytes ethtype %hX\n", (int) s, t);
  912. /* pad to minimum packet size */
  913. while (s < ETH_ZLEN)
  914. txb[s++] = '\0';
  915. /* set the transmit buffer descriptor and enable Transmit State Machine */
  916. txd.bufptr = virt_to_bus(&txb[0]);
  917. txd.cmdsts = (u32) OWN | s;
  918. /* restart the transmitter */
  919. outl(TxENA | inl(ioaddr + cr), ioaddr + cr);
  920. if (sis900_debug > 1)
  921. printf("sis900_transmit: Queued Tx packet size %d.\n", (int) s);
  922. to = currticks() + TX_TIMEOUT;
  923. while ((((volatile u32) tx_status=txd.cmdsts) & OWN) && (currticks() < to))
  924. /* wait */ ;
  925. if (currticks() >= to) {
  926. printf("sis900_transmit: TX Timeout! Tx status %X.\n", tx_status);
  927. }
  928. if (tx_status & (ABORT | UNDERRUN | OWCOLL)) {
  929. /* packet unsuccessfully transmited */
  930. printf("sis900_transmit: Transmit error, Tx status %X.\n", tx_status);
  931. }
  932. /* Disable interrupts by clearing the interrupt mask. */
  933. outl(0, ioaddr + imr);
  934. }
  935. /* Function: sis900_poll
  936. *
  937. * Description: checks for a received packet and returns it if found.
  938. *
  939. * Arguments: struct nic *nic: NIC data structure
  940. *
  941. * Returns: 1 if a packet was recieved.
  942. * 0 if no pacet was recieved.
  943. *
  944. * Side effects:
  945. * Returns (copies) the packet to the array nic->packet.
  946. * Returns the length of the packet in nic->packetlen.
  947. */
  948. static int
  949. sis900_poll(struct nic *nic, int retrieve)
  950. {
  951. u32 rx_status = rxd[cur_rx].cmdsts;
  952. int retstat = 0;
  953. if (sis900_debug > 2)
  954. printf("sis900_poll: cur_rx:%d, status:%X\n", cur_rx, rx_status);
  955. if (!(rx_status & OWN))
  956. return retstat;
  957. if (sis900_debug > 1)
  958. printf("sis900_poll: got a packet: cur_rx:%d, status:%X\n",
  959. cur_rx, rx_status);
  960. if ( ! retrieve ) return 1;
  961. nic->packetlen = (rx_status & DSIZE) - CRC_SIZE;
  962. if (rx_status & (ABORT|OVERRUN|TOOLONG|RUNT|RXISERR|CRCERR|FAERR)) {
  963. /* corrupted packet received */
  964. printf("sis900_poll: Corrupted packet received, buffer status = %X\n",
  965. rx_status);
  966. retstat = 0;
  967. } else {
  968. /* give packet to higher level routine */
  969. memcpy(nic->packet, (rxb + cur_rx*RX_BUF_SIZE), nic->packetlen);
  970. retstat = 1;
  971. }
  972. /* return the descriptor and buffer to receive ring */
  973. rxd[cur_rx].cmdsts = RX_BUF_SIZE;
  974. rxd[cur_rx].bufptr = virt_to_bus(&rxb[cur_rx*RX_BUF_SIZE]);
  975. if (++cur_rx == NUM_RX_DESC)
  976. cur_rx = 0;
  977. /* re-enable the potentially idle receive state machine */
  978. outl(RxENA | inl(ioaddr + cr), ioaddr + cr);
  979. return retstat;
  980. }
  981. /* Function: sis900_disable
  982. *
  983. * Description: Turns off interrupts and stops Tx and Rx engines
  984. *
  985. * Arguments: struct nic *nic: NIC data structure
  986. *
  987. * Returns: void.
  988. */
  989. static void
  990. sis900_disable ( struct nic *nic ) {
  991. /* merge reset and disable */
  992. sis900_init(nic);
  993. /* Disable interrupts by clearing the interrupt mask. */
  994. outl(0, ioaddr + imr);
  995. outl(0, ioaddr + ier);
  996. /* Stop the chip's Tx and Rx Status Machine */
  997. outl(RxDIS | TxDIS | inl(ioaddr + cr), ioaddr + cr);
  998. }
  999. /* Function: sis900_irq
  1000. *
  1001. * Description: Enable, Disable, or Force, interrupts
  1002. *
  1003. * Arguments: struct nic *nic: NIC data structure
  1004. * irq_action_t action: Requested action
  1005. *
  1006. * Returns: void.
  1007. */
  1008. static void
  1009. sis900_irq(struct nic *nic __unused, irq_action_t action __unused)
  1010. {
  1011. switch ( action ) {
  1012. case DISABLE :
  1013. break;
  1014. case ENABLE :
  1015. break;
  1016. case FORCE :
  1017. break;
  1018. }
  1019. }
  1020. static struct pci_id sis900_nics[] = {
  1021. PCI_ROM(0x1039, 0x0900, "sis900", "SIS900"),
  1022. PCI_ROM(0x1039, 0x7016, "sis7016", "SIS7016"),
  1023. };
  1024. static struct pci_driver sis900_driver =
  1025. PCI_DRIVER ( "SIS900", sis900_nics, PCI_NO_CLASS );
  1026. BOOT_DRIVER ( "SIS900", sis900_probe );