Warnings purge of drivers (continued)
[gpxe.git] / src / drivers / net / natsemi.c
blobc5b87fccc310608f223ae32f45700e5accda14ab
1 /* -*- Mode:C; c-basic-offset:4; -*- */
3 /*
4 natsemi.c: An Etherboot driver for the NatSemi DP8381x series.
6 Copyright (C) 2001 Entity Cyber, Inc.
8 This development of this Etherboot driver was funded by
10 Sicom Systems: http://www.sicompos.com/
12 Author: Marty Connor (mdc@etherboot.org)
13 Adapted from a Linux driver which was written by Donald Becker
15 This software may be used and distributed according to the terms
16 of the GNU Public License (GPL), incorporated herein by reference.
18 Original Copyright Notice:
20 Written/copyright 1999-2001 by Donald Becker.
22 This software may be used and distributed according to the terms of
23 the GNU General Public License (GPL), incorporated herein by reference.
24 Drivers based on or derived from this code fall under the GPL and must
25 retain the authorship, copyright and license notice. This file is not
26 a complete program and may only be used when the entire operating
27 system is licensed under the GPL. License for under other terms may be
28 available. Contact the original author for details.
30 The original author may be reached as becker@scyld.com, or at
31 Scyld Computing Corporation
32 410 Severn Ave., Suite 210
33 Annapolis MD 21403
35 Support information and updates available at
36 http://www.scyld.com/network/netsemi.html
38 References:
40 http://www.scyld.com/expert/100mbps.html
41 http://www.scyld.com/expert/NWay.html
42 Datasheet is available from:
43 http://www.national.com/pf/DP/DP83815.html
47 /* Revision History */
50 13 Dec 2003 timlegge 1.1 Enabled Multicast Support
51 29 May 2001 mdc 1.0
52 Initial Release. Tested with Netgear FA311 and FA312 boards
53 */\f
54 /* Includes */
56 #include "etherboot.h"
57 #include "nic.h"
58 #include "pcibios.h"
59 #include <gpxe/pci.h>
60 #include <gpxe/ethernet.h>
62 /* defines */
64 #define OWN 0x80000000
65 #define DSIZE 0x00000FFF
66 #define CRC_SIZE 4
68 /* Time in ticks before concluding the transmitter is hung. */
69 #define TX_TIMEOUT (4*TICKS_PER_SEC)
71 #define TX_BUF_SIZE 1536
72 #define RX_BUF_SIZE 1536
74 #define NUM_RX_DESC 4 /* Number of Rx descriptor registers. */
76 /* helpful macroes if on a big_endian machine for changing byte order.
77 not strictly needed on Intel */
78 #define get_unaligned(ptr) (*(ptr))
79 #define put_unaligned(val, ptr) ((void)( *(ptr) = (val) ))
80 #define get_u16(ptr) (*(u16 *)(ptr))
81 #define virt_to_le32desc(addr) virt_to_bus(addr)
83 enum pcistuff {
84 PCI_USES_IO = 0x01,
85 PCI_USES_MEM = 0x02,
86 PCI_USES_MASTER = 0x04,
87 PCI_ADDR0 = 0x08,
88 PCI_ADDR1 = 0x10,
91 /* MMIO operations required */
92 #define PCI_IOTYPE (PCI_USES_MASTER | PCI_USES_MEM | PCI_ADDR1)
94 /* Offsets to the device registers.
95 Unlike software-only systems, device drivers interact with complex hardware.
96 It's not useful to define symbolic names for every register bit in the
97 device.
99 enum register_offsets {
100 ChipCmd = 0x00,
101 ChipConfig = 0x04,
102 EECtrl = 0x08,
103 PCIBusCfg = 0x0C,
104 IntrStatus = 0x10,
105 IntrMask = 0x14,
106 IntrEnable = 0x18,
107 TxRingPtr = 0x20,
108 TxConfig = 0x24,
109 RxRingPtr = 0x30,
110 RxConfig = 0x34,
111 ClkRun = 0x3C,
112 WOLCmd = 0x40,
113 PauseCmd = 0x44,
114 RxFilterAddr = 0x48,
115 RxFilterData = 0x4C,
116 BootRomAddr = 0x50,
117 BootRomData = 0x54,
118 SiliconRev = 0x58,
119 StatsCtrl = 0x5C,
120 StatsData = 0x60,
121 RxPktErrs = 0x60,
122 RxMissed = 0x68,
123 RxCRCErrs = 0x64,
124 PCIPM = 0x44,
125 PhyStatus = 0xC0,
126 MIntrCtrl = 0xC4,
127 MIntrStatus = 0xC8,
129 /* These are from the spec, around page 78... on a separate table. */
130 PGSEL = 0xCC,
131 PMDCSR = 0xE4,
132 TSTDAT = 0xFC,
133 DSPCFG = 0xF4,
134 SDCFG = 0x8C
137 /* Bit in ChipCmd. */
138 enum ChipCmdBits {
139 ChipReset = 0x100,
140 RxReset = 0x20,
141 TxReset = 0x10,
142 RxOff = 0x08,
143 RxOn = 0x04,
144 TxOff = 0x02,
145 TxOn = 0x01
148 /* Bits in the RxMode register. */
149 enum rx_mode_bits {
150 AcceptErr = 0x20,
151 AcceptRunt = 0x10,
152 AcceptBroadcast = 0xC0000000,
153 AcceptMulticast = 0x00200000,
154 AcceptAllMulticast = 0x20000000,
155 AcceptAllPhys = 0x10000000,
156 AcceptMyPhys = 0x08000000,
157 RxFilterEnable = 0x80000000
160 typedef struct _BufferDesc {
161 u32 link;
162 volatile u32 cmdsts;
163 u32 bufptr;
164 u32 software_use;
165 } BufferDesc;
167 /* Bits in network_desc.status */
168 enum desc_status_bits {
169 DescOwn = 0x80000000,
170 DescMore = 0x40000000,
171 DescIntr = 0x20000000,
172 DescNoCRC = 0x10000000,
173 DescPktOK = 0x08000000,
174 RxTooLong = 0x00400000
177 /* Globals */
179 static struct nic_operations natsemi_operations;
181 static int natsemi_debug = 1; /* 1 normal messages, 0 quiet .. 7 verbose. */
183 const char *nic_name;
185 static u32 SavedClkRun;
188 static unsigned short vendor, dev_id;
189 static unsigned long ioaddr;
191 static unsigned int cur_rx;
193 static unsigned int advertising;
195 static unsigned int rx_config;
196 static unsigned int tx_config;
198 /* Note: transmit and receive buffers and descriptors must be
199 longword aligned
202 struct {
203 BufferDesc txd __attribute__ ((aligned(4)));
204 BufferDesc rxd[NUM_RX_DESC] __attribute__ ((aligned(4)));
205 unsigned char txb[TX_BUF_SIZE] __attribute__ ((aligned(4)));
206 unsigned char rxb[NUM_RX_DESC * RX_BUF_SIZE] __attribute__ ((aligned(4)));
207 } natsemi_bufs __shared;
208 #define txd natsemi_bufs.txd
209 #define rxd natsemi_bufs.rxd
210 #define txb natsemi_bufs.txb
211 #define rxb natsemi_bufs.rxb
213 /* Function Prototypes */
215 static int natsemi_probe(struct nic *nic,struct pci_device *pci);
216 static int eeprom_read(long addr, int location);
217 static int mdio_read(int phy_id, int location);
218 static void natsemi_init(struct nic *nic);
219 static void natsemi_reset(struct nic *nic);
220 static void natsemi_init_rxfilter(struct nic *nic);
221 static void natsemi_init_txd(struct nic *nic);
222 static void natsemi_init_rxd(struct nic *nic);
223 static void natsemi_set_rx_mode(struct nic *nic);
224 static void natsemi_check_duplex(struct nic *nic);
225 static void natsemi_transmit(struct nic *nic, const char *d, unsigned int t, unsigned int s, const char *p);
226 static int natsemi_poll(struct nic *nic, int retrieve);
227 static void natsemi_disable(struct nic *nic);
228 static void natsemi_irq(struct nic *nic, irq_action_t action);
231 * Function: natsemi_probe
233 * Description: Retrieves the MAC address of the card, and sets up some
234 * globals required by other routines, and initializes the NIC, making it
235 * ready to send and receive packets.
237 * Side effects:
238 * leaves the ioaddress of the natsemi chip in the variable ioaddr.
239 * leaves the natsemi initialized, and ready to recieve packets.
241 * Returns: struct nic *: pointer to NIC data structure
244 static int
245 natsemi_probe ( struct nic *nic, struct pci_device *pci ) {
247 int i;
248 int prev_eedata;
249 uint32_t tmp;
251 if (pci->ioaddr == 0)
252 return 0;
254 adjust_pci_device(pci);
256 /* initialize some commonly used globals */
258 nic->irqno = 0;
259 pci_fill_nic ( nic, pci );
260 nic->ioaddr = pci->ioaddr;
262 ioaddr = pci->ioaddr;
263 vendor = pci->vendor;
264 dev_id = pci->device;
265 nic_name = pci->driver_name;
267 /* natsemi has a non-standard PM control register
268 * in PCI config space. Some boards apparently need
269 * to be brought to D0 in this manner.
271 pci_read_config_dword ( pci, PCIPM, &tmp );
272 if (tmp & (0x03|0x100)) {
273 /* D0 state, disable PME assertion */
274 u32 newtmp = tmp & ~(0x03|0x100);
275 pci_write_config_dword(pci, PCIPM, newtmp);
278 /* get MAC address */
280 prev_eedata = eeprom_read(ioaddr, 6);
281 for (i = 0; i < 3; i++) {
282 int eedata = eeprom_read(ioaddr, i + 7);
283 nic->node_addr[i*2] = (eedata << 1) + (prev_eedata >> 15);
284 nic->node_addr[i*2+1] = eedata >> 7;
285 prev_eedata = eedata;
288 DBG ( "\nnatsemi_probe: MAC addr %s at ioaddr %4.4lx\n",
289 eth_ntoa ( nic->node_addr ), ioaddr);
290 DBG ( "natsemi_probe: Vendor:%#hX Device:%#hX\n", vendor, dev_id );
292 /* Reset the chip to erase any previous misconfiguration. */
293 outl(ChipReset, ioaddr + ChipCmd);
295 advertising = mdio_read(1, 4);
297 u32 chip_config = inl(ioaddr + ChipConfig);
298 printf("%s: Transceiver default autoneg. %s "
299 "10%s %s duplex.\n",
300 nic_name,
301 chip_config & 0x2000 ? "enabled, advertise" : "disabled, force",
302 chip_config & 0x4000 ? "0" : "",
303 chip_config & 0x8000 ? "full" : "half");
305 printf("%s: Transceiver status %hX advertising %hX\n",
306 nic_name, (int)inl(ioaddr + 0x84), advertising);
308 /* Disable PME:
309 * The PME bit is initialized from the EEPROM contents.
310 * PCI cards probably have PME disabled, but motherboard
311 * implementations may have PME set to enable WakeOnLan.
312 * With PME set the chip will scan incoming packets but
313 * nothing will be written to memory. */
314 SavedClkRun = inl(ioaddr + ClkRun);
315 outl(SavedClkRun & ~0x100, ioaddr + ClkRun);
317 /* initialize device */
318 natsemi_init(nic);
319 nic->nic_op = &natsemi_operations;
321 return 1;
324 /* Read the EEPROM and MII Management Data I/O (MDIO) interfaces.
325 The EEPROM code is for the common 93c06/46 EEPROMs with 6 bit addresses.
328 /* Delay between EEPROM clock transitions.
329 No extra delay is needed with 33Mhz PCI, but future 66Mhz access may need
330 a delay. */
331 #define eeprom_delay(ee_addr) inl(ee_addr)
333 enum EEPROM_Ctrl_Bits {
334 EE_ShiftClk = 0x04,
335 EE_DataIn = 0x01,
336 EE_ChipSelect = 0x08,
337 EE_DataOut = 0x02
340 #define EE_Write0 (EE_ChipSelect)
341 #define EE_Write1 (EE_ChipSelect | EE_DataIn)
343 /* The EEPROM commands include the alway-set leading bit. */
344 enum EEPROM_Cmds {
345 EE_WriteCmd=(5 << 6), EE_ReadCmd=(6 << 6), EE_EraseCmd=(7 << 6),
348 static int eeprom_read(long addr, int location)
350 int i;
351 int retval = 0;
352 int ee_addr = addr + EECtrl;
353 int read_cmd = location | EE_ReadCmd;
354 outl(EE_Write0, ee_addr);
356 /* Shift the read command bits out. */
357 for (i = 10; i >= 0; i--) {
358 short dataval = (read_cmd & (1 << i)) ? EE_Write1 : EE_Write0;
359 outl(dataval, ee_addr);
360 eeprom_delay(ee_addr);
361 outl(dataval | EE_ShiftClk, ee_addr);
362 eeprom_delay(ee_addr);
364 outl(EE_ChipSelect, ee_addr);
365 eeprom_delay(ee_addr);
367 for (i = 0; i < 16; i++) {
368 outl(EE_ChipSelect | EE_ShiftClk, ee_addr);
369 eeprom_delay(ee_addr);
370 retval |= (inl(ee_addr) & EE_DataOut) ? 1 << i : 0;
371 outl(EE_ChipSelect, ee_addr);
372 eeprom_delay(ee_addr);
375 /* Terminate the EEPROM access. */
376 outl(EE_Write0, ee_addr);
377 outl(0, ee_addr);
379 return retval;
382 /* MII transceiver control section.
383 The 83815 series has an internal transceiver, and we present the
384 management registers as if they were MII connected. */
386 static int mdio_read(int phy_id, int location)
388 if (phy_id == 1 && location < 32)
389 return inl(ioaddr + 0x80 + (location<<2)) & 0xffff;
390 else
391 return 0xffff;
394 /* Function: natsemi_init
396 * Description: resets the ethernet controller chip and configures
397 * registers and data structures required for sending and receiving packets.
399 * Arguments: struct nic *nic: NIC data structure
401 * returns: void.
404 static void
405 natsemi_init(struct nic *nic)
407 natsemi_reset(nic);
409 /* Disable PME:
410 * The PME bit is initialized from the EEPROM contents.
411 * PCI cards probably have PME disabled, but motherboard
412 * implementations may have PME set to enable WakeOnLan.
413 * With PME set the chip will scan incoming packets but
414 * nothing will be written to memory. */
415 outl(SavedClkRun & ~0x100, ioaddr + ClkRun);
417 natsemi_init_rxfilter(nic);
419 natsemi_init_txd(nic);
420 natsemi_init_rxd(nic);
422 /* Initialize other registers. */
423 /* Configure the PCI bus bursts and FIFO thresholds. */
424 /* Configure for standard, in-spec Ethernet. */
425 if (inl(ioaddr + ChipConfig) & 0x20000000) { /* Full duplex */
426 tx_config = 0xD0801002;
427 rx_config = 0x10000020;
428 } else {
429 tx_config = 0x10801002;
430 rx_config = 0x0020;
432 outl(tx_config, ioaddr + TxConfig);
433 outl(rx_config, ioaddr + RxConfig);
435 natsemi_check_duplex(nic);
436 natsemi_set_rx_mode(nic);
438 outl(RxOn, ioaddr + ChipCmd);
442 * Function: natsemi_reset
444 * Description: soft resets the controller chip
446 * Arguments: struct nic *nic: NIC data structure
448 * Returns: void.
450 static void
451 natsemi_reset(struct nic *nic __unused)
453 outl(ChipReset, ioaddr + ChipCmd);
455 /* On page 78 of the spec, they recommend some settings for "optimum
456 performance" to be done in sequence. These settings optimize some
457 of the 100Mbit autodetection circuitry. Also, we only want to do
458 this for rev C of the chip.
460 if (inl(ioaddr + SiliconRev) == 0x302) {
461 outw(0x0001, ioaddr + PGSEL);
462 outw(0x189C, ioaddr + PMDCSR);
463 outw(0x0000, ioaddr + TSTDAT);
464 outw(0x5040, ioaddr + DSPCFG);
465 outw(0x008C, ioaddr + SDCFG);
467 /* Disable interrupts using the mask. */
468 outl(0, ioaddr + IntrMask);
469 outl(0, ioaddr + IntrEnable);
472 /* Function: natsemi_init_rxfilter
474 * Description: sets receive filter address to our MAC address
476 * Arguments: struct nic *nic: NIC data structure
478 * returns: void.
481 static void
482 natsemi_init_rxfilter(struct nic *nic)
484 int i;
486 for (i = 0; i < ETH_ALEN; i += 2) {
487 outl(i, ioaddr + RxFilterAddr);
488 outw(nic->node_addr[i] + (nic->node_addr[i+1] << 8), ioaddr + RxFilterData);
493 * Function: natsemi_init_txd
495 * Description: initializes the Tx descriptor
497 * Arguments: struct nic *nic: NIC data structure
499 * returns: void.
502 static void
503 natsemi_init_txd(struct nic *nic __unused)
505 txd.link = (u32) 0;
506 txd.cmdsts = (u32) 0;
507 txd.bufptr = virt_to_bus(&txb[0]);
509 /* load Transmit Descriptor Register */
510 outl(virt_to_bus(&txd), ioaddr + TxRingPtr);
511 if (natsemi_debug > 1)
512 printf("natsemi_init_txd: TX descriptor register loaded with: %lx\n",
513 inl(ioaddr + TxRingPtr));
516 /* Function: natsemi_init_rxd
518 * Description: initializes the Rx descriptor ring
520 * Arguments: struct nic *nic: NIC data structure
522 * Returns: void.
525 static void
526 natsemi_init_rxd(struct nic *nic __unused)
528 int i;
530 cur_rx = 0;
532 /* init RX descriptor */
533 for (i = 0; i < NUM_RX_DESC; i++) {
534 rxd[i].link = virt_to_bus((i+1 < NUM_RX_DESC) ? &rxd[i+1] : &rxd[0]);
535 rxd[i].cmdsts = (u32) RX_BUF_SIZE;
536 rxd[i].bufptr = virt_to_bus(&rxb[i*RX_BUF_SIZE]);
537 if (natsemi_debug > 1)
538 printf("natsemi_init_rxd: rxd[%d]=%p link=%X cmdsts=%X bufptr=%4.4x\n",
539 i, &rxd[i], (unsigned int) rxd[i].link, (unsigned int) rxd[i].cmdsts,
540 (unsigned int) rxd[i].bufptr);
543 /* load Receive Descriptor Register */
544 outl(virt_to_bus(&rxd[0]), ioaddr + RxRingPtr);
546 if (natsemi_debug > 1)
547 printf("natsemi_init_rxd: RX descriptor register loaded with: %lx\n",
548 inl(ioaddr + RxRingPtr));
551 /* Function: natsemi_set_rx_mode
553 * Description:
554 * sets the receive mode to accept all broadcast packets and packets
555 * with our MAC address, and reject all multicast packets.
557 * Arguments: struct nic *nic: NIC data structure
559 * Returns: void.
562 static void natsemi_set_rx_mode(struct nic *nic __unused)
564 u32 rx_mode = RxFilterEnable | AcceptBroadcast |
565 AcceptAllMulticast | AcceptMyPhys;
567 outl(rx_mode, ioaddr + RxFilterAddr);
570 static void natsemi_check_duplex(struct nic *nic __unused)
572 int duplex = inl(ioaddr + ChipConfig) & 0x20000000 ? 1 : 0;
574 if (natsemi_debug)
575 printf("%s: Setting %s-duplex based on negotiated link"
576 " capability.\n", nic_name,
577 duplex ? "full" : "half");
578 if (duplex) {
579 rx_config |= 0x10000000;
580 tx_config |= 0xC0000000;
581 } else {
582 rx_config &= ~0x10000000;
583 tx_config &= ~0xC0000000;
585 outl(tx_config, ioaddr + TxConfig);
586 outl(rx_config, ioaddr + RxConfig);
589 /* Function: natsemi_transmit
591 * Description: transmits a packet and waits for completion or timeout.
593 * Arguments: char d[6]: destination ethernet address.
594 * unsigned short t: ethernet protocol type.
595 * unsigned short s: size of the data-part of the packet.
596 * char *p: the data for the packet.
598 * Returns: void.
601 static void
602 natsemi_transmit(struct nic *nic,
603 const char *d, /* Destination */
604 unsigned int t, /* Type */
605 unsigned int s, /* size */
606 const char *p) /* Packet */
608 u32 to, nstype;
609 volatile u32 tx_status;
611 /* Stop the transmitter */
612 outl(TxOff, ioaddr + ChipCmd);
614 /* load Transmit Descriptor Register */
615 outl(virt_to_bus(&txd), ioaddr + TxRingPtr);
616 if (natsemi_debug > 1)
617 printf("natsemi_transmit: TX descriptor register loaded with: %lx\n",
618 inl(ioaddr + TxRingPtr));
620 memcpy(txb, d, ETH_ALEN);
621 memcpy(txb + ETH_ALEN, nic->node_addr, ETH_ALEN);
622 nstype = htons(t);
623 memcpy(txb + 2 * ETH_ALEN, (char*)&nstype, 2);
624 memcpy(txb + ETH_HLEN, p, s);
626 s += ETH_HLEN;
627 s &= DSIZE;
629 if (natsemi_debug > 1)
630 printf("natsemi_transmit: sending %d bytes ethtype %hX\n", (int) s, t);
632 /* pad to minimum packet size */
633 while (s < ETH_ZLEN)
634 txb[s++] = '\0';
636 /* set the transmit buffer descriptor and enable Transmit State Machine */
637 txd.bufptr = virt_to_bus(&txb[0]);
638 txd.cmdsts = (u32) OWN | s;
640 /* restart the transmitter */
641 outl(TxOn, ioaddr + ChipCmd);
643 if (natsemi_debug > 1)
644 printf("natsemi_transmit: Queued Tx packet size %d.\n", (int) s);
646 to = currticks() + TX_TIMEOUT;
648 while (((tx_status=txd.cmdsts) & OWN) && (currticks() < to))
649 /* wait */ ;
651 if (currticks() >= to) {
652 printf("natsemi_transmit: TX Timeout! Tx status %X.\n", (unsigned int) tx_status);
655 if (!(tx_status & 0x08000000)) {
656 printf("natsemi_transmit: Transmit error, Tx status %X.\n", (unsigned int) tx_status);
660 /* Function: natsemi_poll
662 * Description: checks for a received packet and returns it if found.
664 * Arguments: struct nic *nic: NIC data structure
666 * Returns: 1 if packet was received.
667 * 0 if no packet was received.
669 * Side effects:
670 * Returns (copies) the packet to the array nic->packet.
671 * Returns the length of the packet in nic->packetlen.
674 static int
675 natsemi_poll(struct nic *nic, int retrieve)
677 u32 rx_status = rxd[cur_rx].cmdsts;
678 int retstat = 0;
680 if (natsemi_debug > 2)
681 printf("natsemi_poll: cur_rx:%d, status:%X\n", cur_rx, (unsigned int) rx_status);
683 if (!(rx_status & OWN))
684 return retstat;
686 if ( ! retrieve ) return 1;
688 if (natsemi_debug > 1)
689 printf("natsemi_poll: got a packet: cur_rx:%d, status:%X\n",
690 cur_rx, (unsigned int) rx_status);
692 nic->packetlen = (rx_status & DSIZE) - CRC_SIZE;
694 if ((rx_status & (DescMore|DescPktOK|RxTooLong)) != DescPktOK) {
695 /* corrupted packet received */
696 printf("natsemi_poll: Corrupted packet received, buffer status = %X\n",
697 (unsigned int) rx_status);
698 retstat = 0;
699 } else {
700 /* give packet to higher level routine */
701 memcpy(nic->packet, (rxb + cur_rx*RX_BUF_SIZE), nic->packetlen);
702 retstat = 1;
705 /* return the descriptor and buffer to receive ring */
706 rxd[cur_rx].cmdsts = RX_BUF_SIZE;
707 rxd[cur_rx].bufptr = virt_to_bus(&rxb[cur_rx*RX_BUF_SIZE]);
709 if (++cur_rx == NUM_RX_DESC)
710 cur_rx = 0;
712 /* re-enable the potentially idle receive state machine */
713 outl(RxOn, ioaddr + ChipCmd);
715 return retstat;
718 /* Function: natsemi_disable
720 * Description: Turns off interrupts and stops Tx and Rx engines
722 * Arguments: struct nic *nic: NIC data structure
724 * Returns: void.
727 static void
728 natsemi_disable ( struct nic *nic ) {
730 natsemi_init(nic);
732 /* Disable interrupts using the mask. */
733 outl(0, ioaddr + IntrMask);
734 outl(0, ioaddr + IntrEnable);
736 /* Stop the chip's Tx and Rx processes. */
737 outl(RxOff | TxOff, ioaddr + ChipCmd);
739 /* Restore PME enable bit */
740 outl(SavedClkRun, ioaddr + ClkRun);
743 /* Function: natsemi_irq
745 * Description: Enable, Disable, or Force interrupts
747 * Arguments: struct nic *nic: NIC data structure
748 * irq_action_t action: requested action to perform
750 * Returns: void.
753 static void
754 natsemi_irq(struct nic *nic __unused, irq_action_t action __unused)
756 switch ( action ) {
757 case DISABLE :
758 break;
759 case ENABLE :
760 break;
761 case FORCE :
762 break;
766 static struct nic_operations natsemi_operations = {
767 .connect = dummy_connect,
768 .poll = natsemi_poll,
769 .transmit = natsemi_transmit,
770 .irq = natsemi_irq,
774 static struct pci_device_id natsemi_nics[] = {
775 PCI_ROM(0x100b, 0x0020, "dp83815", "DP83815"),
778 PCI_DRIVER ( natsemi_driver, natsemi_nics, PCI_NO_CLASS );
780 DRIVER ( "NATSEMI", nic_driver, pci_driver, natsemi_driver,
781 natsemi_probe, natsemi_disable );