aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ne2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ne2.c')
-rw-r--r--drivers/net/ne2.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/drivers/net/ne2.c b/drivers/net/ne2.c
index eebf5f02b476..5fccfea66d87 100644
--- a/drivers/net/ne2.c
+++ b/drivers/net/ne2.c
@@ -28,7 +28,7 @@
28 - added support for Arco Electronics AE/2-card (experimental) 28 - added support for Arco Electronics AE/2-card (experimental)
29 29
30 Mon Sep 14 09:53:42 CET 1998 (David Weinehall) 30 Mon Sep 14 09:53:42 CET 1998 (David Weinehall)
31 - added support for Compex ENET-16MC/P (experimental) 31 - added support for Compex ENET-16MC/P (experimental)
32 32
33 Tue Sep 15 16:21:12 CET 1998 (David Weinehall, Magnus Jonsson, Tomas Ogren) 33 Tue Sep 15 16:21:12 CET 1998 (David Weinehall, Magnus Jonsson, Tomas Ogren)
34 - Miscellaneous bugfixes 34 - Miscellaneous bugfixes
@@ -44,11 +44,11 @@
44 - Version# bump 44 - Version# bump
45 45
46 Mon Nov 16 15:28:23 CET 1998 (Wim Dumon) 46 Mon Nov 16 15:28:23 CET 1998 (Wim Dumon)
47 - pass 'dev' as last parameter of request_irq in stead of 'NULL' 47 - pass 'dev' as last parameter of request_irq in stead of 'NULL'
48 48
49 Wed Feb 7 21:24:00 CET 2001 (Alfred Arnold) 49 Wed Feb 7 21:24:00 CET 2001 (Alfred Arnold)
50 - added support for the D-Link DE-320CT 50 - added support for the D-Link DE-320CT
51 51
52 * WARNING 52 * WARNING
53 ------- 53 -------
54 This is alpha-test software. It is not guaranteed to work. As a 54 This is alpha-test software. It is not guaranteed to work. As a
@@ -150,9 +150,9 @@ static void ne_block_output(struct net_device *dev, const int count,
150 150
151 151
152/* 152/*
153 * special code to read the DE-320's MAC address EEPROM. In contrast to a 153 * special code to read the DE-320's MAC address EEPROM. In contrast to a
154 * standard NE design, this is a serial EEPROM (93C46) that has to be read 154 * standard NE design, this is a serial EEPROM (93C46) that has to be read
155 * bit by bit. The EEPROM cotrol port at base + 0x1e has the following 155 * bit by bit. The EEPROM cotrol port at base + 0x1e has the following
156 * layout: 156 * layout:
157 * 157 *
158 * Bit 0 = Data out (read from EEPROM) 158 * Bit 0 = Data out (read from EEPROM)
@@ -218,7 +218,7 @@ static unsigned int __init dlink_get_eeprom(unsigned int eeaddr, unsigned int ad
218{ 218{
219 int z; 219 int z;
220 unsigned int value = 0; 220 unsigned int value = 0;
221 221
222 /* pull the CS line low for a moment. This resets the EEPROM- 222 /* pull the CS line low for a moment. This resets the EEPROM-
223 internal logic, and makes it ready for a new command. */ 223 internal logic, and makes it ready for a new command. */
224 224
@@ -253,23 +253,23 @@ static int __init do_ne2_probe(struct net_device *dev)
253 253
254 SET_MODULE_OWNER(dev); 254 SET_MODULE_OWNER(dev);
255 255
256 /* Do not check any supplied i/o locations. 256 /* Do not check any supplied i/o locations.
257 POS registers usually don't fail :) */ 257 POS registers usually don't fail :) */
258 258
259 /* MCA cards have POS registers. 259 /* MCA cards have POS registers.
260 Autodetecting MCA cards is extremely simple. 260 Autodetecting MCA cards is extremely simple.
261 Just search for the card. */ 261 Just search for the card. */
262 262
263 for(i = 0; (ne2_adapters[i].name != NULL) && !adapter_found; i++) { 263 for(i = 0; (ne2_adapters[i].name != NULL) && !adapter_found; i++) {
264 current_mca_slot = 264 current_mca_slot =
265 mca_find_unused_adapter(ne2_adapters[i].id, 0); 265 mca_find_unused_adapter(ne2_adapters[i].id, 0);
266 266
267 if((current_mca_slot != MCA_NOTFOUND) && !adapter_found) { 267 if((current_mca_slot != MCA_NOTFOUND) && !adapter_found) {
268 int res; 268 int res;
269 mca_set_adapter_name(current_mca_slot, 269 mca_set_adapter_name(current_mca_slot,
270 ne2_adapters[i].name); 270 ne2_adapters[i].name);
271 mca_mark_as_used(current_mca_slot); 271 mca_mark_as_used(current_mca_slot);
272 272
273 res = ne2_probe1(dev, current_mca_slot); 273 res = ne2_probe1(dev, current_mca_slot);
274 if (res) 274 if (res)
275 mca_mark_as_unused(current_mca_slot); 275 mca_mark_as_unused(current_mca_slot);
@@ -307,7 +307,7 @@ static int ne2_procinfo(char *buf, int slot, struct net_device *dev)
307 307
308 len += sprintf(buf+len, "The NE/2 Ethernet Adapter\n" ); 308 len += sprintf(buf+len, "The NE/2 Ethernet Adapter\n" );
309 len += sprintf(buf+len, "Driver written by Wim Dumon "); 309 len += sprintf(buf+len, "Driver written by Wim Dumon ");
310 len += sprintf(buf+len, "<wimpie@kotnet.org>\n"); 310 len += sprintf(buf+len, "<wimpie@kotnet.org>\n");
311 len += sprintf(buf+len, "Modified by "); 311 len += sprintf(buf+len, "Modified by ");
312 len += sprintf(buf+len, "David Weinehall <tao@acc.umu.se>\n"); 312 len += sprintf(buf+len, "David Weinehall <tao@acc.umu.se>\n");
313 len += sprintf(buf+len, "and by Magnus Jonsson <bigfoot@acc.umu.se>\n"); 313 len += sprintf(buf+len, "and by Magnus Jonsson <bigfoot@acc.umu.se>\n");
@@ -316,8 +316,8 @@ static int ne2_procinfo(char *buf, int slot, struct net_device *dev)
316 len += sprintf(buf+len, "IRQ : %d\n", dev->irq); 316 len += sprintf(buf+len, "IRQ : %d\n", dev->irq);
317 317
318#define HW_ADDR(i) dev->dev_addr[i] 318#define HW_ADDR(i) dev->dev_addr[i]
319 len += sprintf(buf+len, "HW addr : %x:%x:%x:%x:%x:%x\n", 319 len += sprintf(buf+len, "HW addr : %x:%x:%x:%x:%x:%x\n",
320 HW_ADDR(0), HW_ADDR(1), HW_ADDR(2), 320 HW_ADDR(0), HW_ADDR(1), HW_ADDR(2),
321 HW_ADDR(3), HW_ADDR(4), HW_ADDR(5) ); 321 HW_ADDR(3), HW_ADDR(4), HW_ADDR(5) );
322#undef HW_ADDR 322#undef HW_ADDR
323 323
@@ -370,7 +370,7 @@ static int __init ne2_probe1(struct net_device *dev, int slot)
370 370
371#ifndef CRYNWR_WAY 371#ifndef CRYNWR_WAY
372 /* Reset the card the way they do it in the Crynwr packet driver */ 372 /* Reset the card the way they do it in the Crynwr packet driver */
373 for (i=0; i<8; i++) 373 for (i=0; i<8; i++)
374 outb(0x0, base_addr + NE_RESET); 374 outb(0x0, base_addr + NE_RESET);
375 inb(base_addr + NE_RESET); 375 inb(base_addr + NE_RESET);
376 outb(0x21, base_addr + NE_CMD); 376 outb(0x21, base_addr + NE_CMD);
@@ -388,10 +388,10 @@ static int __init ne2_probe1(struct net_device *dev, int slot)
388 388
389#else /* _I_ never tested it this way .. Go ahead and try ...*/ 389#else /* _I_ never tested it this way .. Go ahead and try ...*/
390 /* Reset card. Who knows what dain-bramaged state it was left in. */ 390 /* Reset card. Who knows what dain-bramaged state it was left in. */
391 { 391 {
392 unsigned long reset_start_time = jiffies; 392 unsigned long reset_start_time = jiffies;
393 393
394 /* DON'T change these to inb_p/outb_p or reset will fail on 394 /* DON'T change these to inb_p/outb_p or reset will fail on
395 clones.. */ 395 clones.. */
396 outb(inb(base_addr + NE_RESET), base_addr + NE_RESET); 396 outb(inb(base_addr + NE_RESET), base_addr + NE_RESET);
397 397
@@ -408,16 +408,16 @@ static int __init ne2_probe1(struct net_device *dev, int slot)
408 408
409 409
410 /* Read the 16 bytes of station address PROM. 410 /* Read the 16 bytes of station address PROM.
411 We must first initialize registers, similar to 411 We must first initialize registers, similar to
412 NS8390_init(eifdev, 0). 412 NS8390_init(eifdev, 0).
413 We can't reliably read the SAPROM address without this. 413 We can't reliably read the SAPROM address without this.
414 (I learned the hard way!). */ 414 (I learned the hard way!). */
415 { 415 {
416 struct { 416 struct {
417 unsigned char value, offset; 417 unsigned char value, offset;
418 } program_seq[] = { 418 } program_seq[] = {
419 /* Select page 0 */ 419 /* Select page 0 */
420 {E8390_NODMA+E8390_PAGE0+E8390_STOP, E8390_CMD}, 420 {E8390_NODMA+E8390_PAGE0+E8390_STOP, E8390_CMD},
421 {0x49, EN0_DCFG}, /* Set WORD-wide (0x49) access. */ 421 {0x49, EN0_DCFG}, /* Set WORD-wide (0x49) access. */
422 {0x00, EN0_RCNTLO}, /* Clear the count regs. */ 422 {0x00, EN0_RCNTLO}, /* Clear the count regs. */
423 {0x00, EN0_RCNTHI}, 423 {0x00, EN0_RCNTHI},
@@ -433,7 +433,7 @@ static int __init ne2_probe1(struct net_device *dev, int slot)
433 }; 433 };
434 434
435 for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++) 435 for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++)
436 outb_p(program_seq[i].value, base_addr + 436 outb_p(program_seq[i].value, base_addr +
437 program_seq[i].offset); 437 program_seq[i].offset);
438 438
439 } 439 }
@@ -464,7 +464,7 @@ static int __init ne2_probe1(struct net_device *dev, int slot)
464 share and the board will usually be enabled. */ 464 share and the board will usually be enabled. */
465 retval = request_irq(dev->irq, ei_interrupt, 0, DRV_NAME, dev); 465 retval = request_irq(dev->irq, ei_interrupt, 0, DRV_NAME, dev);
466 if (retval) { 466 if (retval) {
467 printk (" unable to get IRQ %d (irqval=%d).\n", 467 printk (" unable to get IRQ %d (irqval=%d).\n",
468 dev->irq, retval); 468 dev->irq, retval);
469 goto out; 469 goto out;
470 } 470 }
@@ -496,9 +496,9 @@ static int __init ne2_probe1(struct net_device *dev, int slot)
496 ei_status.block_input = &ne_block_input; 496 ei_status.block_input = &ne_block_input;
497 ei_status.block_output = &ne_block_output; 497 ei_status.block_output = &ne_block_output;
498 ei_status.get_8390_hdr = &ne_get_8390_hdr; 498 ei_status.get_8390_hdr = &ne_get_8390_hdr;
499 499
500 ei_status.priv = slot; 500 ei_status.priv = slot;
501 501
502 dev->open = &ne_open; 502 dev->open = &ne_open;
503 dev->stop = &ne_close; 503 dev->stop = &ne_close;
504#ifdef CONFIG_NET_POLL_CONTROLLER 504#ifdef CONFIG_NET_POLL_CONTROLLER
@@ -538,7 +538,7 @@ static void ne_reset_8390(struct net_device *dev)
538{ 538{
539 unsigned long reset_start_time = jiffies; 539 unsigned long reset_start_time = jiffies;
540 540
541 if (ei_debug > 1) 541 if (ei_debug > 1)
542 printk("resetting the 8390 t=%ld...", jiffies); 542 printk("resetting the 8390 t=%ld...", jiffies);
543 543
544 /* DON'T change these to inb_p/outb_p or reset will fail on clones. */ 544 /* DON'T change these to inb_p/outb_p or reset will fail on clones. */
@@ -550,7 +550,7 @@ static void ne_reset_8390(struct net_device *dev)
550 /* This check _should_not_ be necessary, omit eventually. */ 550 /* This check _should_not_ be necessary, omit eventually. */
551 while ((inb_p(NE_BASE+EN0_ISR) & ENISR_RESET) == 0) 551 while ((inb_p(NE_BASE+EN0_ISR) & ENISR_RESET) == 0)
552 if (time_after(jiffies, reset_start_time + 2*HZ/100)) { 552 if (time_after(jiffies, reset_start_time + 2*HZ/100)) {
553 printk("%s: ne_reset_8390() did not complete.\n", 553 printk("%s: ne_reset_8390() did not complete.\n",
554 dev->name); 554 dev->name);
555 break; 555 break;
556 } 556 }
@@ -561,13 +561,13 @@ static void ne_reset_8390(struct net_device *dev)
561 we don't need to be concerned with ring wrap as the header will be at 561 we don't need to be concerned with ring wrap as the header will be at
562 the start of a page, so we optimize accordingly. */ 562 the start of a page, so we optimize accordingly. */
563 563
564static void ne_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, 564static void ne_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
565 int ring_page) 565 int ring_page)
566{ 566{
567 567
568 int nic_base = dev->base_addr; 568 int nic_base = dev->base_addr;
569 569
570 /* This *shouldn't* happen. 570 /* This *shouldn't* happen.
571 If it does, it's the last thing you'll see */ 571 If it does, it's the last thing you'll see */
572 if (ei_status.dmaing) { 572 if (ei_status.dmaing) {
573 printk("%s: DMAing conflict in ne_get_8390_hdr " 573 printk("%s: DMAing conflict in ne_get_8390_hdr "
@@ -585,10 +585,10 @@ static void ne_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
585 outb_p(E8390_RREAD+E8390_START, nic_base + NE_CMD); 585 outb_p(E8390_RREAD+E8390_START, nic_base + NE_CMD);
586 586
587 if (ei_status.word16) 587 if (ei_status.word16)
588 insw(NE_BASE + NE_DATAPORT, hdr, 588 insw(NE_BASE + NE_DATAPORT, hdr,
589 sizeof(struct e8390_pkt_hdr)>>1); 589 sizeof(struct e8390_pkt_hdr)>>1);
590 else 590 else
591 insb(NE_BASE + NE_DATAPORT, hdr, 591 insb(NE_BASE + NE_DATAPORT, hdr,
592 sizeof(struct e8390_pkt_hdr)); 592 sizeof(struct e8390_pkt_hdr));
593 593
594 outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */ 594 outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */
@@ -600,7 +600,7 @@ static void ne_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
600 hints. The NEx000 doesn't share the on-board packet memory -- you have 600 hints. The NEx000 doesn't share the on-board packet memory -- you have
601 to put the packet out through the "remote DMA" dataport using outb. */ 601 to put the packet out through the "remote DMA" dataport using outb. */
602 602
603static void ne_block_input(struct net_device *dev, int count, struct sk_buff *skb, 603static void ne_block_input(struct net_device *dev, int count, struct sk_buff *skb,
604 int ring_offset) 604 int ring_offset)
605{ 605{
606#ifdef NE_SANITY_CHECK 606#ifdef NE_SANITY_CHECK
@@ -609,7 +609,7 @@ static void ne_block_input(struct net_device *dev, int count, struct sk_buff *sk
609 int nic_base = dev->base_addr; 609 int nic_base = dev->base_addr;
610 char *buf = skb->data; 610 char *buf = skb->data;
611 611
612 /* This *shouldn't* happen. 612 /* This *shouldn't* happen.
613 If it does, it's the last thing you'll see */ 613 If it does, it's the last thing you'll see */
614 if (ei_status.dmaing) { 614 if (ei_status.dmaing) {
615 printk("%s: DMAing conflict in ne_block_input " 615 printk("%s: DMAing conflict in ne_block_input "
@@ -677,7 +677,7 @@ static void ne_block_output(struct net_device *dev, int count,
677 if (ei_status.word16 && (count & 0x01)) 677 if (ei_status.word16 && (count & 0x01))
678 count++; 678 count++;
679 679
680 /* This *shouldn't* happen. 680 /* This *shouldn't* happen.
681 If it does, it's the last thing you'll see */ 681 If it does, it's the last thing you'll see */
682 if (ei_status.dmaing) { 682 if (ei_status.dmaing) {
683 printk("%s: DMAing conflict in ne_block_output." 683 printk("%s: DMAing conflict in ne_block_output."