blob: c69bb8ba8b643e48819beffb33cf22221165d7fd [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * sgiseeq.c: Seeq8003 ethernet driver for SGI machines.
3 *
4 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
5 */
Ralf Baechlea4d4d512006-03-08 11:49:31 +00006
7#undef DEBUG
8
Linus Torvalds1da177e2005-04-16 15:20:36 -07009#include <linux/kernel.h>
10#include <linux/module.h>
11#include <linux/errno.h>
12#include <linux/init.h>
13#include <linux/types.h>
14#include <linux/interrupt.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#include <linux/string.h>
16#include <linux/delay.h>
17#include <linux/netdevice.h>
Ralf Baechledf9f5402007-05-11 15:48:58 +010018#include <linux/platform_device.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070019#include <linux/etherdevice.h>
20#include <linux/skbuff.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070021
Linus Torvalds1da177e2005-04-16 15:20:36 -070022#include <asm/sgi/hpc3.h>
23#include <asm/sgi/ip22.h>
Ralf Baechledf9f5402007-05-11 15:48:58 +010024#include <asm/sgi/seeq.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070025
26#include "sgiseeq.h"
27
Linus Torvalds1da177e2005-04-16 15:20:36 -070028static char *sgiseeqstr = "SGI Seeq8003";
29
30/*
31 * If you want speed, you do something silly, it always has worked for me. So,
32 * with that in mind, I've decided to make this driver look completely like a
33 * stupid Lance from a driver architecture perspective. Only difference is that
34 * here our "ring buffer" looks and acts like a real Lance one does but is
35 * layed out like how the HPC DMA and the Seeq want it to. You'd be surprised
36 * how a stupid idea like this can pay off in performance, not to mention
37 * making this driver 2,000 times easier to write. ;-)
38 */
39
40/* Tune these if we tend to run out often etc. */
41#define SEEQ_RX_BUFFERS 16
42#define SEEQ_TX_BUFFERS 16
43
44#define PKT_BUF_SZ 1584
45
46#define NEXT_RX(i) (((i) + 1) & (SEEQ_RX_BUFFERS - 1))
47#define NEXT_TX(i) (((i) + 1) & (SEEQ_TX_BUFFERS - 1))
48#define PREV_RX(i) (((i) - 1) & (SEEQ_RX_BUFFERS - 1))
49#define PREV_TX(i) (((i) - 1) & (SEEQ_TX_BUFFERS - 1))
50
51#define TX_BUFFS_AVAIL(sp) ((sp->tx_old <= sp->tx_new) ? \
52 sp->tx_old + (SEEQ_TX_BUFFERS - 1) - sp->tx_new : \
53 sp->tx_old - sp->tx_new - 1)
54
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +010055#define VIRT_TO_DMA(sp, v) ((sp)->srings_dma + \
56 (dma_addr_t)((unsigned long)(v) - \
57 (unsigned long)((sp)->rx_desc)))
58
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +010059/* Copy frames shorter than rx_copybreak, otherwise pass on up in
60 * a full sized sk_buff. Value of 100 stolen from tulip.c (!alpha).
61 */
62static int rx_copybreak = 100;
63
64#define PAD_SIZE (128 - sizeof(struct hpc_dma_desc) - sizeof(void *))
65
Linus Torvalds1da177e2005-04-16 15:20:36 -070066struct sgiseeq_rx_desc {
67 volatile struct hpc_dma_desc rdma;
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +010068 u8 padding[PAD_SIZE];
69 struct sk_buff *skb;
Linus Torvalds1da177e2005-04-16 15:20:36 -070070};
71
72struct sgiseeq_tx_desc {
73 volatile struct hpc_dma_desc tdma;
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +010074 u8 padding[PAD_SIZE];
75 struct sk_buff *skb;
Linus Torvalds1da177e2005-04-16 15:20:36 -070076};
77
78/*
79 * Warning: This structure is layed out in a certain way because HPC dma
80 * descriptors must be 8-byte aligned. So don't touch this without
81 * some care.
82 */
83struct sgiseeq_init_block { /* Note the name ;-) */
84 struct sgiseeq_rx_desc rxvector[SEEQ_RX_BUFFERS];
85 struct sgiseeq_tx_desc txvector[SEEQ_TX_BUFFERS];
86};
87
88struct sgiseeq_private {
89 struct sgiseeq_init_block *srings;
Ralf Baechle99cd1492007-09-04 14:41:01 +010090 dma_addr_t srings_dma;
Linus Torvalds1da177e2005-04-16 15:20:36 -070091
92 /* Ptrs to the descriptors in uncached space. */
93 struct sgiseeq_rx_desc *rx_desc;
94 struct sgiseeq_tx_desc *tx_desc;
95
96 char *name;
97 struct hpc3_ethregs *hregs;
98 struct sgiseeq_regs *sregs;
99
100 /* Ring entry counters. */
101 unsigned int rx_new, tx_new;
102 unsigned int rx_old, tx_old;
103
104 int is_edlc;
105 unsigned char control;
106 unsigned char mode;
107
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108 spinlock_t tx_lock;
109};
110
Thomas Bogendoerfer49b11bc2007-12-19 13:42:36 +0100111static inline void dma_sync_desc_cpu(struct net_device *dev, void *addr)
112{
113 dma_cache_sync(dev->dev.parent, addr, sizeof(struct sgiseeq_rx_desc),
114 DMA_FROM_DEVICE);
115}
116
117static inline void dma_sync_desc_dev(struct net_device *dev, void *addr)
118{
119 dma_cache_sync(dev->dev.parent, addr, sizeof(struct sgiseeq_rx_desc),
120 DMA_TO_DEVICE);
121}
122
Linus Torvalds1da177e2005-04-16 15:20:36 -0700123static inline void hpc3_eth_reset(struct hpc3_ethregs *hregs)
124{
Ralf Baechle302a5c4b2005-10-10 14:50:56 +0100125 hregs->reset = HPC3_ERST_CRESET | HPC3_ERST_CLRIRQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700126 udelay(20);
Ralf Baechle302a5c4b2005-10-10 14:50:56 +0100127 hregs->reset = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700128}
129
130static inline void reset_hpc3_and_seeq(struct hpc3_ethregs *hregs,
131 struct sgiseeq_regs *sregs)
132{
133 hregs->rx_ctrl = hregs->tx_ctrl = 0;
134 hpc3_eth_reset(hregs);
135}
136
137#define RSTAT_GO_BITS (SEEQ_RCMD_IGOOD | SEEQ_RCMD_IEOF | SEEQ_RCMD_ISHORT | \
138 SEEQ_RCMD_IDRIB | SEEQ_RCMD_ICRC)
139
140static inline void seeq_go(struct sgiseeq_private *sp,
141 struct hpc3_ethregs *hregs,
142 struct sgiseeq_regs *sregs)
143{
144 sregs->rstat = sp->mode | RSTAT_GO_BITS;
145 hregs->rx_ctrl = HPC3_ERXCTRL_ACTIVE;
146}
147
148static inline void __sgiseeq_set_mac_address(struct net_device *dev)
149{
150 struct sgiseeq_private *sp = netdev_priv(dev);
151 struct sgiseeq_regs *sregs = sp->sregs;
152 int i;
153
154 sregs->tstat = SEEQ_TCMD_RB0;
155 for (i = 0; i < 6; i++)
156 sregs->rw.eth_addr[i] = dev->dev_addr[i];
157}
158
159static int sgiseeq_set_mac_address(struct net_device *dev, void *addr)
160{
161 struct sgiseeq_private *sp = netdev_priv(dev);
162 struct sockaddr *sa = addr;
163
164 memcpy(dev->dev_addr, sa->sa_data, dev->addr_len);
165
166 spin_lock_irq(&sp->tx_lock);
167 __sgiseeq_set_mac_address(dev);
168 spin_unlock_irq(&sp->tx_lock);
169
170 return 0;
171}
172
173#define TCNTINFO_INIT (HPCDMA_EOX | HPCDMA_ETXD)
174#define RCNTCFG_INIT (HPCDMA_OWN | HPCDMA_EORP | HPCDMA_XIE)
175#define RCNTINFO_INIT (RCNTCFG_INIT | (PKT_BUF_SZ & HPCDMA_BCNT))
176
177static int seeq_init_ring(struct net_device *dev)
178{
179 struct sgiseeq_private *sp = netdev_priv(dev);
180 int i;
181
182 netif_stop_queue(dev);
183 sp->rx_new = sp->tx_new = 0;
184 sp->rx_old = sp->tx_old = 0;
185
186 __sgiseeq_set_mac_address(dev);
187
188 /* Setup tx ring. */
189 for(i = 0; i < SEEQ_TX_BUFFERS; i++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700190 sp->tx_desc[i].tdma.cntinfo = TCNTINFO_INIT;
Thomas Bogendoerfer49b11bc2007-12-19 13:42:36 +0100191 dma_sync_desc_dev(dev, &sp->tx_desc[i]);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700192 }
193
194 /* And now the rx ring. */
195 for (i = 0; i < SEEQ_RX_BUFFERS; i++) {
196 if (!sp->rx_desc[i].rdma.pbuf) {
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100197 dma_addr_t dma_addr;
198 struct sk_buff *skb = netdev_alloc_skb(dev, PKT_BUF_SZ);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700199
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100200 if (skb == NULL)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700201 return -ENOMEM;
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100202 skb_reserve(skb, 2);
203 dma_addr = dma_map_single(dev->dev.parent,
204 skb->data - 2,
205 PKT_BUF_SZ, DMA_FROM_DEVICE);
206 sp->rx_desc[i].skb = skb;
207 sp->rx_desc[i].rdma.pbuf = dma_addr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700208 }
209 sp->rx_desc[i].rdma.cntinfo = RCNTINFO_INIT;
Thomas Bogendoerfer49b11bc2007-12-19 13:42:36 +0100210 dma_sync_desc_dev(dev, &sp->rx_desc[i]);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700211 }
212 sp->rx_desc[i - 1].rdma.cntinfo |= HPCDMA_EOR;
Thomas Bogendoerfer49b11bc2007-12-19 13:42:36 +0100213 dma_sync_desc_dev(dev, &sp->rx_desc[i - 1]);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700214 return 0;
215}
216
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100217static void seeq_purge_ring(struct net_device *dev)
218{
219 struct sgiseeq_private *sp = netdev_priv(dev);
220 int i;
221
222 /* clear tx ring. */
223 for (i = 0; i < SEEQ_TX_BUFFERS; i++) {
224 if (sp->tx_desc[i].skb) {
225 dev_kfree_skb(sp->tx_desc[i].skb);
226 sp->tx_desc[i].skb = NULL;
227 }
228 }
229
230 /* And now the rx ring. */
231 for (i = 0; i < SEEQ_RX_BUFFERS; i++) {
232 if (sp->rx_desc[i].skb) {
233 dev_kfree_skb(sp->rx_desc[i].skb);
234 sp->rx_desc[i].skb = NULL;
235 }
236 }
237}
238
Linus Torvalds1da177e2005-04-16 15:20:36 -0700239#ifdef DEBUG
240static struct sgiseeq_private *gpriv;
241static struct net_device *gdev;
242
Ralf Baechlea4d4d512006-03-08 11:49:31 +0000243static void sgiseeq_dump_rings(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700244{
245 static int once;
246 struct sgiseeq_rx_desc *r = gpriv->rx_desc;
247 struct sgiseeq_tx_desc *t = gpriv->tx_desc;
248 struct hpc3_ethregs *hregs = gpriv->hregs;
249 int i;
250
251 if (once)
252 return;
253 once++;
254 printk("RING DUMP:\n");
255 for (i = 0; i < SEEQ_RX_BUFFERS; i++) {
256 printk("RX [%d]: @(%p) [%08x,%08x,%08x] ",
257 i, (&r[i]), r[i].rdma.pbuf, r[i].rdma.cntinfo,
258 r[i].rdma.pnext);
259 i += 1;
260 printk("-- [%d]: @(%p) [%08x,%08x,%08x]\n",
261 i, (&r[i]), r[i].rdma.pbuf, r[i].rdma.cntinfo,
262 r[i].rdma.pnext);
263 }
264 for (i = 0; i < SEEQ_TX_BUFFERS; i++) {
265 printk("TX [%d]: @(%p) [%08x,%08x,%08x] ",
266 i, (&t[i]), t[i].tdma.pbuf, t[i].tdma.cntinfo,
267 t[i].tdma.pnext);
268 i += 1;
269 printk("-- [%d]: @(%p) [%08x,%08x,%08x]\n",
270 i, (&t[i]), t[i].tdma.pbuf, t[i].tdma.cntinfo,
271 t[i].tdma.pnext);
272 }
273 printk("INFO: [rx_new = %d rx_old=%d] [tx_new = %d tx_old = %d]\n",
274 gpriv->rx_new, gpriv->rx_old, gpriv->tx_new, gpriv->tx_old);
275 printk("RREGS: rx_cbptr[%08x] rx_ndptr[%08x] rx_ctrl[%08x]\n",
276 hregs->rx_cbptr, hregs->rx_ndptr, hregs->rx_ctrl);
277 printk("TREGS: tx_cbptr[%08x] tx_ndptr[%08x] tx_ctrl[%08x]\n",
278 hregs->tx_cbptr, hregs->tx_ndptr, hregs->tx_ctrl);
279}
280#endif
281
282#define TSTAT_INIT_SEEQ (SEEQ_TCMD_IPT|SEEQ_TCMD_I16|SEEQ_TCMD_IC|SEEQ_TCMD_IUF)
283#define TSTAT_INIT_EDLC ((TSTAT_INIT_SEEQ) | SEEQ_TCMD_RB2)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700284
285static int init_seeq(struct net_device *dev, struct sgiseeq_private *sp,
286 struct sgiseeq_regs *sregs)
287{
288 struct hpc3_ethregs *hregs = sp->hregs;
289 int err;
290
291 reset_hpc3_and_seeq(hregs, sregs);
292 err = seeq_init_ring(dev);
293 if (err)
294 return err;
295
296 /* Setup to field the proper interrupt types. */
297 if (sp->is_edlc) {
298 sregs->tstat = TSTAT_INIT_EDLC;
299 sregs->rw.wregs.control = sp->control;
300 sregs->rw.wregs.frame_gap = 0;
301 } else {
302 sregs->tstat = TSTAT_INIT_SEEQ;
303 }
304
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100305 hregs->rx_ndptr = VIRT_TO_DMA(sp, sp->rx_desc);
306 hregs->tx_ndptr = VIRT_TO_DMA(sp, sp->tx_desc);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700307
308 seeq_go(sp, hregs, sregs);
309 return 0;
310}
311
Jeff Garzik09f75cd2007-10-03 17:41:50 -0700312static void record_rx_errors(struct net_device *dev, unsigned char status)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313{
314 if (status & SEEQ_RSTAT_OVERF ||
315 status & SEEQ_RSTAT_SFRAME)
Jeff Garzik09f75cd2007-10-03 17:41:50 -0700316 dev->stats.rx_over_errors++;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700317 if (status & SEEQ_RSTAT_CERROR)
Jeff Garzik09f75cd2007-10-03 17:41:50 -0700318 dev->stats.rx_crc_errors++;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700319 if (status & SEEQ_RSTAT_DERROR)
Jeff Garzik09f75cd2007-10-03 17:41:50 -0700320 dev->stats.rx_frame_errors++;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700321 if (status & SEEQ_RSTAT_REOF)
Jeff Garzik09f75cd2007-10-03 17:41:50 -0700322 dev->stats.rx_errors++;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700323}
324
325static inline void rx_maybe_restart(struct sgiseeq_private *sp,
326 struct hpc3_ethregs *hregs,
327 struct sgiseeq_regs *sregs)
328{
329 if (!(hregs->rx_ctrl & HPC3_ERXCTRL_ACTIVE)) {
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100330 hregs->rx_ndptr = VIRT_TO_DMA(sp, sp->rx_desc + sp->rx_new);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700331 seeq_go(sp, hregs, sregs);
332 }
333}
334
Linus Torvalds1da177e2005-04-16 15:20:36 -0700335static inline void sgiseeq_rx(struct net_device *dev, struct sgiseeq_private *sp,
336 struct hpc3_ethregs *hregs,
337 struct sgiseeq_regs *sregs)
338{
339 struct sgiseeq_rx_desc *rd;
Ralf Baechlea4d4d512006-03-08 11:49:31 +0000340 struct sk_buff *skb = NULL;
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100341 struct sk_buff *newskb;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700342 unsigned char pkt_status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700343 int len = 0;
344 unsigned int orig_end = PREV_RX(sp->rx_new);
345
346 /* Service every received packet. */
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100347 rd = &sp->rx_desc[sp->rx_new];
Thomas Bogendoerfer49b11bc2007-12-19 13:42:36 +0100348 dma_sync_desc_cpu(dev, rd);
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100349 while (!(rd->rdma.cntinfo & HPCDMA_OWN)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700350 len = PKT_BUF_SZ - (rd->rdma.cntinfo & HPCDMA_BCNT) - 3;
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100351 dma_unmap_single(dev->dev.parent, rd->rdma.pbuf,
352 PKT_BUF_SZ, DMA_FROM_DEVICE);
353 pkt_status = rd->skb->data[len];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700354 if (pkt_status & SEEQ_RSTAT_FIG) {
355 /* Packet is OK. */
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100356 /* We don't want to receive our own packets */
357 if (memcmp(rd->skb->data + 6, dev->dev_addr, ETH_ALEN)) {
358 if (len > rx_copybreak) {
359 skb = rd->skb;
360 newskb = netdev_alloc_skb(dev, PKT_BUF_SZ);
361 if (!newskb) {
362 newskb = skb;
363 skb = NULL;
364 goto memory_squeeze;
365 }
366 skb_reserve(newskb, 2);
367 } else {
368 skb = netdev_alloc_skb(dev, len + 2);
369 if (skb) {
370 skb_reserve(skb, 2);
371 skb_copy_to_linear_data(skb, rd->skb->data, len);
372 }
373 newskb = rd->skb;
374 }
375memory_squeeze:
376 if (skb) {
377 skb_put(skb, len);
378 skb->protocol = eth_type_trans(skb, dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700379 netif_rx(skb);
380 dev->last_rx = jiffies;
Jeff Garzik09f75cd2007-10-03 17:41:50 -0700381 dev->stats.rx_packets++;
382 dev->stats.rx_bytes += len;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700383 } else {
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100384 printk(KERN_NOTICE "%s: Memory squeeze, deferring packet.\n",
385 dev->name);
386 dev->stats.rx_dropped++;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700387 }
388 } else {
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100389 /* Silently drop my own packets */
390 newskb = rd->skb;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700391 }
392 } else {
Jeff Garzik09f75cd2007-10-03 17:41:50 -0700393 record_rx_errors(dev, pkt_status);
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100394 newskb = rd->skb;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700395 }
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100396 rd->skb = newskb;
397 rd->rdma.pbuf = dma_map_single(dev->dev.parent,
398 newskb->data - 2,
399 PKT_BUF_SZ, DMA_FROM_DEVICE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700400
401 /* Return the entry to the ring pool. */
402 rd->rdma.cntinfo = RCNTINFO_INIT;
403 sp->rx_new = NEXT_RX(sp->rx_new);
Thomas Bogendoerfer49b11bc2007-12-19 13:42:36 +0100404 dma_sync_desc_dev(dev, rd);
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100405 rd = &sp->rx_desc[sp->rx_new];
Thomas Bogendoerfer49b11bc2007-12-19 13:42:36 +0100406 dma_sync_desc_cpu(dev, rd);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700407 }
Thomas Bogendoerfer49b11bc2007-12-19 13:42:36 +0100408 dma_sync_desc_cpu(dev, &sp->rx_desc[orig_end]);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700409 sp->rx_desc[orig_end].rdma.cntinfo &= ~(HPCDMA_EOR);
Thomas Bogendoerfer49b11bc2007-12-19 13:42:36 +0100410 dma_sync_desc_dev(dev, &sp->rx_desc[orig_end]);
411 dma_sync_desc_cpu(dev, &sp->rx_desc[PREV_RX(sp->rx_new)]);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700412 sp->rx_desc[PREV_RX(sp->rx_new)].rdma.cntinfo |= HPCDMA_EOR;
Thomas Bogendoerfer49b11bc2007-12-19 13:42:36 +0100413 dma_sync_desc_dev(dev, &sp->rx_desc[PREV_RX(sp->rx_new)]);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700414 rx_maybe_restart(sp, hregs, sregs);
415}
416
417static inline void tx_maybe_reset_collisions(struct sgiseeq_private *sp,
418 struct sgiseeq_regs *sregs)
419{
420 if (sp->is_edlc) {
421 sregs->rw.wregs.control = sp->control & ~(SEEQ_CTRL_XCNT);
422 sregs->rw.wregs.control = sp->control;
423 }
424}
425
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100426static inline void kick_tx(struct net_device *dev,
427 struct sgiseeq_private *sp,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700428 struct hpc3_ethregs *hregs)
429{
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100430 struct sgiseeq_tx_desc *td;
431 int i = sp->tx_old;
432
Linus Torvalds1da177e2005-04-16 15:20:36 -0700433 /* If the HPC aint doin nothin, and there are more packets
434 * with ETXD cleared and XIU set we must make very certain
435 * that we restart the HPC else we risk locking up the
436 * adapter. The following code is only safe iff the HPCDMA
437 * is not active!
438 */
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100439 td = &sp->tx_desc[i];
Thomas Bogendoerfer49b11bc2007-12-19 13:42:36 +0100440 dma_sync_desc_cpu(dev, td);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700441 while ((td->tdma.cntinfo & (HPCDMA_XIU | HPCDMA_ETXD)) ==
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100442 (HPCDMA_XIU | HPCDMA_ETXD)) {
443 i = NEXT_TX(i);
444 td = &sp->tx_desc[i];
Thomas Bogendoerfer49b11bc2007-12-19 13:42:36 +0100445 dma_sync_desc_cpu(dev, td);
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100446 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700447 if (td->tdma.cntinfo & HPCDMA_XIU) {
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100448 hregs->tx_ndptr = VIRT_TO_DMA(sp, td);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700449 hregs->tx_ctrl = HPC3_ETXCTRL_ACTIVE;
450 }
451}
452
453static inline void sgiseeq_tx(struct net_device *dev, struct sgiseeq_private *sp,
454 struct hpc3_ethregs *hregs,
455 struct sgiseeq_regs *sregs)
456{
457 struct sgiseeq_tx_desc *td;
458 unsigned long status = hregs->tx_ctrl;
459 int j;
460
461 tx_maybe_reset_collisions(sp, sregs);
462
463 if (!(status & (HPC3_ETXCTRL_ACTIVE | SEEQ_TSTAT_PTRANS))) {
464 /* Oops, HPC detected some sort of error. */
465 if (status & SEEQ_TSTAT_R16)
Jeff Garzik09f75cd2007-10-03 17:41:50 -0700466 dev->stats.tx_aborted_errors++;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700467 if (status & SEEQ_TSTAT_UFLOW)
Jeff Garzik09f75cd2007-10-03 17:41:50 -0700468 dev->stats.tx_fifo_errors++;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700469 if (status & SEEQ_TSTAT_LCLS)
Jeff Garzik09f75cd2007-10-03 17:41:50 -0700470 dev->stats.collisions++;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700471 }
472
473 /* Ack 'em... */
474 for (j = sp->tx_old; j != sp->tx_new; j = NEXT_TX(j)) {
475 td = &sp->tx_desc[j];
476
Thomas Bogendoerfer49b11bc2007-12-19 13:42:36 +0100477 dma_sync_desc_cpu(dev, td);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700478 if (!(td->tdma.cntinfo & (HPCDMA_XIU)))
479 break;
480 if (!(td->tdma.cntinfo & (HPCDMA_ETXD))) {
481 if (!(status & HPC3_ETXCTRL_ACTIVE)) {
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100482 hregs->tx_ndptr = VIRT_TO_DMA(sp, td);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700483 hregs->tx_ctrl = HPC3_ETXCTRL_ACTIVE;
484 }
485 break;
486 }
Jeff Garzik09f75cd2007-10-03 17:41:50 -0700487 dev->stats.tx_packets++;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700488 sp->tx_old = NEXT_TX(sp->tx_old);
489 td->tdma.cntinfo &= ~(HPCDMA_XIU | HPCDMA_XIE);
490 td->tdma.cntinfo |= HPCDMA_EOX;
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100491 if (td->skb) {
492 dev_kfree_skb_any(td->skb);
493 td->skb = NULL;
494 }
Thomas Bogendoerfer49b11bc2007-12-19 13:42:36 +0100495 dma_sync_desc_dev(dev, td);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700496 }
497}
498
David Howells7d12e782006-10-05 14:55:46 +0100499static irqreturn_t sgiseeq_interrupt(int irq, void *dev_id)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700500{
501 struct net_device *dev = (struct net_device *) dev_id;
502 struct sgiseeq_private *sp = netdev_priv(dev);
503 struct hpc3_ethregs *hregs = sp->hregs;
504 struct sgiseeq_regs *sregs = sp->sregs;
505
506 spin_lock(&sp->tx_lock);
507
508 /* Ack the IRQ and set software state. */
Ralf Baechle302a5c4b2005-10-10 14:50:56 +0100509 hregs->reset = HPC3_ERST_CLRIRQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700510
511 /* Always check for received packets. */
512 sgiseeq_rx(dev, sp, hregs, sregs);
513
514 /* Only check for tx acks if we have something queued. */
515 if (sp->tx_old != sp->tx_new)
516 sgiseeq_tx(dev, sp, hregs, sregs);
517
518 if ((TX_BUFFS_AVAIL(sp) > 0) && netif_queue_stopped(dev)) {
519 netif_wake_queue(dev);
520 }
521 spin_unlock(&sp->tx_lock);
522
523 return IRQ_HANDLED;
524}
525
526static int sgiseeq_open(struct net_device *dev)
527{
528 struct sgiseeq_private *sp = netdev_priv(dev);
529 struct sgiseeq_regs *sregs = sp->sregs;
530 unsigned int irq = dev->irq;
531 int err;
532
533 if (request_irq(irq, sgiseeq_interrupt, 0, sgiseeqstr, dev)) {
534 printk(KERN_ERR "Seeq8003: Can't get irq %d\n", dev->irq);
535 err = -EAGAIN;
536 }
537
538 err = init_seeq(dev, sp, sregs);
539 if (err)
540 goto out_free_irq;
541
542 netif_start_queue(dev);
543
544 return 0;
545
546out_free_irq:
547 free_irq(irq, dev);
548
549 return err;
550}
551
552static int sgiseeq_close(struct net_device *dev)
553{
554 struct sgiseeq_private *sp = netdev_priv(dev);
555 struct sgiseeq_regs *sregs = sp->sregs;
Ralf Baechle28914392005-10-10 14:50:51 +0100556 unsigned int irq = dev->irq;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700557
558 netif_stop_queue(dev);
559
560 /* Shutdown the Seeq. */
561 reset_hpc3_and_seeq(sp->hregs, sregs);
Ralf Baechle28914392005-10-10 14:50:51 +0100562 free_irq(irq, dev);
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100563 seeq_purge_ring(dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700564
565 return 0;
566}
567
568static inline int sgiseeq_reset(struct net_device *dev)
569{
570 struct sgiseeq_private *sp = netdev_priv(dev);
571 struct sgiseeq_regs *sregs = sp->sregs;
572 int err;
573
574 err = init_seeq(dev, sp, sregs);
575 if (err)
576 return err;
577
578 dev->trans_start = jiffies;
579 netif_wake_queue(dev);
580
581 return 0;
582}
583
Linus Torvalds1da177e2005-04-16 15:20:36 -0700584static int sgiseeq_start_xmit(struct sk_buff *skb, struct net_device *dev)
585{
586 struct sgiseeq_private *sp = netdev_priv(dev);
587 struct hpc3_ethregs *hregs = sp->hregs;
588 unsigned long flags;
589 struct sgiseeq_tx_desc *td;
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100590 int len, entry;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700591
592 spin_lock_irqsave(&sp->tx_lock, flags);
593
594 /* Setup... */
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100595 len = skb->len;
596 if (len < ETH_ZLEN) {
597 if (skb_padto(skb, ETH_ZLEN))
598 return 0;
599 len = ETH_ZLEN;
600 }
601
Jeff Garzik09f75cd2007-10-03 17:41:50 -0700602 dev->stats.tx_bytes += len;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700603 entry = sp->tx_new;
604 td = &sp->tx_desc[entry];
Thomas Bogendoerfer49b11bc2007-12-19 13:42:36 +0100605 dma_sync_desc_cpu(dev, td);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700606
607 /* Create entry. There are so many races with adding a new
608 * descriptor to the chain:
609 * 1) Assume that the HPC is off processing a DMA chain while
610 * we are changing all of the following.
611 * 2) Do no allow the HPC to look at a new descriptor until
612 * we have completely set up it's state. This means, do
613 * not clear HPCDMA_EOX in the current last descritptor
614 * until the one we are adding looks consistent and could
615 * be processes right now.
616 * 3) The tx interrupt code must notice when we've added a new
617 * entry and the HPC got to the end of the chain before we
618 * added this new entry and restarted it.
619 */
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100620 td->skb = skb;
621 td->tdma.pbuf = dma_map_single(dev->dev.parent, skb->data,
622 len, DMA_TO_DEVICE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700623 td->tdma.cntinfo = (len & HPCDMA_BCNT) |
624 HPCDMA_XIU | HPCDMA_EOXP | HPCDMA_XIE | HPCDMA_EOX;
Thomas Bogendoerfer49b11bc2007-12-19 13:42:36 +0100625 dma_sync_desc_dev(dev, td);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700626 if (sp->tx_old != sp->tx_new) {
627 struct sgiseeq_tx_desc *backend;
628
629 backend = &sp->tx_desc[PREV_TX(sp->tx_new)];
Thomas Bogendoerfer49b11bc2007-12-19 13:42:36 +0100630 dma_sync_desc_cpu(dev, backend);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700631 backend->tdma.cntinfo &= ~HPCDMA_EOX;
Thomas Bogendoerfer49b11bc2007-12-19 13:42:36 +0100632 dma_sync_desc_dev(dev, backend);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700633 }
634 sp->tx_new = NEXT_TX(sp->tx_new); /* Advance. */
635
636 /* Maybe kick the HPC back into motion. */
637 if (!(hregs->tx_ctrl & HPC3_ETXCTRL_ACTIVE))
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100638 kick_tx(dev, sp, hregs);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700639
640 dev->trans_start = jiffies;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700641
642 if (!TX_BUFFS_AVAIL(sp))
643 netif_stop_queue(dev);
644 spin_unlock_irqrestore(&sp->tx_lock, flags);
645
646 return 0;
647}
648
649static void timeout(struct net_device *dev)
650{
651 printk(KERN_NOTICE "%s: transmit timed out, resetting\n", dev->name);
652 sgiseeq_reset(dev);
653
654 dev->trans_start = jiffies;
655 netif_wake_queue(dev);
656}
657
Linus Torvalds1da177e2005-04-16 15:20:36 -0700658static void sgiseeq_set_multicast(struct net_device *dev)
659{
660 struct sgiseeq_private *sp = (struct sgiseeq_private *) dev->priv;
661 unsigned char oldmode = sp->mode;
662
663 if(dev->flags & IFF_PROMISC)
664 sp->mode = SEEQ_RCMD_RANY;
665 else if ((dev->flags & IFF_ALLMULTI) || dev->mc_count)
666 sp->mode = SEEQ_RCMD_RBMCAST;
667 else
668 sp->mode = SEEQ_RCMD_RBCAST;
669
670 /* XXX I know this sucks, but is there a better way to reprogram
671 * XXX the receiver? At least, this shouldn't happen too often.
672 */
673
674 if (oldmode != sp->mode)
675 sgiseeq_reset(dev);
676}
677
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100678static inline void setup_tx_ring(struct net_device *dev,
679 struct sgiseeq_tx_desc *buf,
680 int nbufs)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700681{
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100682 struct sgiseeq_private *sp = netdev_priv(dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700683 int i = 0;
684
685 while (i < (nbufs - 1)) {
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100686 buf[i].tdma.pnext = VIRT_TO_DMA(sp, buf + i + 1);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700687 buf[i].tdma.pbuf = 0;
Thomas Bogendoerfer49b11bc2007-12-19 13:42:36 +0100688 dma_sync_desc_dev(dev, &buf[i]);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700689 i++;
690 }
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100691 buf[i].tdma.pnext = VIRT_TO_DMA(sp, buf);
Thomas Bogendoerfer49b11bc2007-12-19 13:42:36 +0100692 dma_sync_desc_dev(dev, &buf[i]);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700693}
694
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100695static inline void setup_rx_ring(struct net_device *dev,
696 struct sgiseeq_rx_desc *buf,
697 int nbufs)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700698{
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100699 struct sgiseeq_private *sp = netdev_priv(dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700700 int i = 0;
701
702 while (i < (nbufs - 1)) {
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100703 buf[i].rdma.pnext = VIRT_TO_DMA(sp, buf + i + 1);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700704 buf[i].rdma.pbuf = 0;
Thomas Bogendoerfer49b11bc2007-12-19 13:42:36 +0100705 dma_sync_desc_dev(dev, &buf[i]);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700706 i++;
707 }
708 buf[i].rdma.pbuf = 0;
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100709 buf[i].rdma.pnext = VIRT_TO_DMA(sp, buf);
Thomas Bogendoerfer49b11bc2007-12-19 13:42:36 +0100710 dma_sync_desc_dev(dev, &buf[i]);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700711}
712
Ralf Baechledf9f5402007-05-11 15:48:58 +0100713static int __init sgiseeq_probe(struct platform_device *pdev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700714{
Ralf Baechledf9f5402007-05-11 15:48:58 +0100715 struct sgiseeq_platform_data *pd = pdev->dev.platform_data;
716 struct hpc3_regs *hpcregs = pd->hpc;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700717 struct sgiseeq_init_block *sr;
Ralf Baechledf9f5402007-05-11 15:48:58 +0100718 unsigned int irq = pd->irq;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700719 struct sgiseeq_private *sp;
720 struct net_device *dev;
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100721 int err;
Joe Perches0795af52007-10-03 17:59:30 -0700722 DECLARE_MAC_BUF(mac);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700723
724 dev = alloc_etherdev(sizeof (struct sgiseeq_private));
725 if (!dev) {
726 printk(KERN_ERR "Sgiseeq: Etherdev alloc failed, aborting.\n");
727 err = -ENOMEM;
728 goto err_out;
729 }
Ralf Baechledf9f5402007-05-11 15:48:58 +0100730
731 platform_set_drvdata(pdev, dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700732 sp = netdev_priv(dev);
733
734 /* Make private data page aligned */
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100735 sr = dma_alloc_noncoherent(&pdev->dev, sizeof(*sp->srings),
Ralf Baechle99cd1492007-09-04 14:41:01 +0100736 &sp->srings_dma, GFP_KERNEL);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700737 if (!sr) {
738 printk(KERN_ERR "Sgiseeq: Page alloc failed, aborting.\n");
739 err = -ENOMEM;
740 goto err_out_free_dev;
741 }
742 sp->srings = sr;
Ralf Baechle99cd1492007-09-04 14:41:01 +0100743 sp->rx_desc = sp->srings->rxvector;
744 sp->tx_desc = sp->srings->txvector;
745
746 /* A couple calculations now, saves many cycles later. */
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100747 setup_rx_ring(dev, sp->rx_desc, SEEQ_RX_BUFFERS);
748 setup_tx_ring(dev, sp->tx_desc, SEEQ_TX_BUFFERS);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700749
Ralf Baechledf9f5402007-05-11 15:48:58 +0100750 memcpy(dev->dev_addr, pd->mac, ETH_ALEN);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700751
752#ifdef DEBUG
753 gpriv = sp;
754 gdev = dev;
755#endif
Ralf Baechle302a5c4b2005-10-10 14:50:56 +0100756 sp->sregs = (struct sgiseeq_regs *) &hpcregs->eth_ext[0];
757 sp->hregs = &hpcregs->ethregs;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700758 sp->name = sgiseeqstr;
759 sp->mode = SEEQ_RCMD_RBCAST;
760
Ralf Baechle302a5c4b2005-10-10 14:50:56 +0100761 /* Setup PIO and DMA transfer timing */
762 sp->hregs->pconfig = 0x161;
763 sp->hregs->dconfig = HPC3_EDCFG_FIRQ | HPC3_EDCFG_FEOP |
764 HPC3_EDCFG_FRXDC | HPC3_EDCFG_PTO | 0x026;
765
Ladislav Michl78ee5b32007-02-28 01:18:35 +0000766 /* Setup PIO and DMA transfer timing */
767 sp->hregs->pconfig = 0x161;
768 sp->hregs->dconfig = HPC3_EDCFG_FIRQ | HPC3_EDCFG_FEOP |
769 HPC3_EDCFG_FRXDC | HPC3_EDCFG_PTO | 0x026;
770
Linus Torvalds1da177e2005-04-16 15:20:36 -0700771 /* Reset the chip. */
772 hpc3_eth_reset(sp->hregs);
773
774 sp->is_edlc = !(sp->sregs->rw.rregs.collision_tx[0] & 0xff);
775 if (sp->is_edlc)
776 sp->control = SEEQ_CTRL_XCNT | SEEQ_CTRL_ACCNT |
777 SEEQ_CTRL_SFLAG | SEEQ_CTRL_ESHORT |
778 SEEQ_CTRL_ENCARR;
779
780 dev->open = sgiseeq_open;
781 dev->stop = sgiseeq_close;
782 dev->hard_start_xmit = sgiseeq_start_xmit;
783 dev->tx_timeout = timeout;
784 dev->watchdog_timeo = (200 * HZ) / 1000;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700785 dev->set_multicast_list = sgiseeq_set_multicast;
786 dev->set_mac_address = sgiseeq_set_mac_address;
787 dev->irq = irq;
788
789 if (register_netdev(dev)) {
790 printk(KERN_ERR "Sgiseeq: Cannot register net device, "
791 "aborting.\n");
792 err = -ENODEV;
793 goto err_out_free_page;
794 }
795
Joe Perches0795af52007-10-03 17:59:30 -0700796 printk(KERN_INFO "%s: %s %s\n",
797 dev->name, sgiseeqstr, print_mac(mac, dev->dev_addr));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700798
Linus Torvalds1da177e2005-04-16 15:20:36 -0700799 return 0;
800
801err_out_free_page:
Ralf Baechle28914392005-10-10 14:50:51 +0100802 free_page((unsigned long) sp->srings);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700803err_out_free_dev:
804 kfree(dev);
805
806err_out:
807 return err;
808}
809
Ralf Baechlee3efb052007-08-22 16:03:52 +0100810static int __exit sgiseeq_remove(struct platform_device *pdev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700811{
Ralf Baechledf9f5402007-05-11 15:48:58 +0100812 struct net_device *dev = platform_get_drvdata(pdev);
813 struct sgiseeq_private *sp = netdev_priv(dev);
Ladislav Michl78ee5b32007-02-28 01:18:35 +0000814
Ralf Baechledf9f5402007-05-11 15:48:58 +0100815 unregister_netdev(dev);
Thomas Bogendoerfer43831b12007-11-24 13:29:19 +0100816 dma_free_noncoherent(&pdev->dev, sizeof(*sp->srings), sp->srings,
817 sp->srings_dma);
Ralf Baechledf9f5402007-05-11 15:48:58 +0100818 free_netdev(dev);
819 platform_set_drvdata(pdev, NULL);
Ralf Baechlee3efb052007-08-22 16:03:52 +0100820
821 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700822}
823
Ralf Baechledf9f5402007-05-11 15:48:58 +0100824static struct platform_driver sgiseeq_driver = {
825 .probe = sgiseeq_probe,
826 .remove = __devexit_p(sgiseeq_remove),
827 .driver = {
828 .name = "sgiseeq"
Linus Torvalds1da177e2005-04-16 15:20:36 -0700829 }
Ralf Baechledf9f5402007-05-11 15:48:58 +0100830};
831
832static int __init sgiseeq_module_init(void)
833{
834 if (platform_driver_register(&sgiseeq_driver)) {
835 printk(KERN_ERR "Driver registration failed\n");
836 return -ENODEV;
837 }
838
839 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700840}
841
Ralf Baechledf9f5402007-05-11 15:48:58 +0100842static void __exit sgiseeq_module_exit(void)
843{
844 platform_driver_unregister(&sgiseeq_driver);
845}
846
847module_init(sgiseeq_module_init);
848module_exit(sgiseeq_module_exit);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700849
Ralf Baechle302a5c4b2005-10-10 14:50:56 +0100850MODULE_DESCRIPTION("SGI Seeq 8003 driver");
851MODULE_AUTHOR("Linux/MIPS Mailing List <linux-mips@linux-mips.org>");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700852MODULE_LICENSE("GPL");