blob: c56a2c62f7deaf094cf1b7e65dcb6bb8ee719bf8 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001
2/*
3 * Index to functions.
4 */
5
6static int el1_probe1(struct net_device *dev, int ioaddr);
7static int el_open(struct net_device *dev);
8static void el_timeout(struct net_device *dev);
9static int el_start_xmit(struct sk_buff *skb, struct net_device *dev);
David Howells7d12e782006-10-05 14:55:46 +010010static irqreturn_t el_interrupt(int irq, void *dev_id);
Linus Torvalds1da177e2005-04-16 15:20:36 -070011static void el_receive(struct net_device *dev);
12static void el_reset(struct net_device *dev);
13static int el1_close(struct net_device *dev);
14static struct net_device_stats *el1_get_stats(struct net_device *dev);
15static void set_multicast_list(struct net_device *dev);
Jeff Garzik7282d492006-09-13 14:30:00 -040016static const struct ethtool_ops netdev_ethtool_ops;
Linus Torvalds1da177e2005-04-16 15:20:36 -070017
18#define EL1_IO_EXTENT 16
19
20#ifndef EL_DEBUG
21#define EL_DEBUG 0 /* use 0 for production, 1 for devel., >2 for debug */
22#endif /* Anything above 5 is wordy death! */
23#define debug el_debug
24static int el_debug = EL_DEBUG;
25
26/*
27 * Board-specific info in dev->priv.
28 */
29
30struct net_local
31{
32 struct net_device_stats stats;
33 int tx_pkt_start; /* The length of the current Tx packet. */
34 int collisions; /* Tx collisions this packet */
35 int loading; /* Spot buffer load collisions */
36 int txing; /* True if card is in TX mode */
37 spinlock_t lock; /* Serializing lock */
38};
39
Jeff Garzik6aa20a22006-09-13 13:24:59 -040040
Linus Torvalds1da177e2005-04-16 15:20:36 -070041#define RX_STATUS (ioaddr + 0x06)
42#define RX_CMD RX_STATUS
43#define TX_STATUS (ioaddr + 0x07)
44#define TX_CMD TX_STATUS
45#define GP_LOW (ioaddr + 0x08)
46#define GP_HIGH (ioaddr + 0x09)
47#define RX_BUF_CLR (ioaddr + 0x0A)
48#define RX_LOW (ioaddr + 0x0A)
49#define RX_HIGH (ioaddr + 0x0B)
50#define SAPROM (ioaddr + 0x0C)
51#define AX_STATUS (ioaddr + 0x0E)
52#define AX_CMD AX_STATUS
53#define DATAPORT (ioaddr + 0x0F)
54#define TX_RDY 0x08 /* In TX_STATUS */
55
56#define EL1_DATAPTR 0x08
57#define EL1_RXPTR 0x0A
58#define EL1_SAPROM 0x0C
59#define EL1_DATAPORT 0x0f
60
61/*
62 * Writes to the ax command register.
63 */
64
65#define AX_OFF 0x00 /* Irq off, buffer access on */
66#define AX_SYS 0x40 /* Load the buffer */
67#define AX_XMIT 0x44 /* Transmit a packet */
68#define AX_RX 0x48 /* Receive a packet */
69#define AX_LOOP 0x0C /* Loopback mode */
70#define AX_RESET 0x80
71
72/*
73 * Normal receive mode written to RX_STATUS. We must intr on short packets
74 * to avoid bogus rx lockups.
75 */
76
77#define RX_NORM 0xA8 /* 0x68 == all addrs, 0xA8 only to me. */
78#define RX_PROM 0x68 /* Senior Prom, uhmm promiscuous mode. */
79#define RX_MULT 0xE8 /* Accept multicast packets. */
80#define TX_NORM 0x0A /* Interrupt on everything that might hang the chip */
81
82/*
83 * TX_STATUS register.
84 */
85
86#define TX_COLLISION 0x02
87#define TX_16COLLISIONS 0x04
88#define TX_READY 0x08
89
90#define RX_RUNT 0x08
91#define RX_MISSED 0x01 /* Missed a packet due to 3c501 braindamage. */
92#define RX_GOOD 0x30 /* Good packet 0x20, or simple overflow 0x10. */
93