diff options
Diffstat (limited to 'drivers/net/eexpress.c')
-rw-r--r-- | drivers/net/eexpress.c | 101 |
1 files changed, 50 insertions, 51 deletions
diff --git a/drivers/net/eexpress.c b/drivers/net/eexpress.c index a74b20715755..9cb05d99ee1b 100644 --- a/drivers/net/eexpress.c +++ b/drivers/net/eexpress.c | |||
@@ -77,7 +77,7 @@ | |||
77 | * CU before submitting a packet for transmission, and then restarts it as soon | 77 | * CU before submitting a packet for transmission, and then restarts it as soon |
78 | * as the process of handing the packet is complete. This is definitely an | 78 | * as the process of handing the packet is complete. This is definitely an |
79 | * unnecessary slowdown if the card is running in 16-bit mode; therefore one | 79 | * unnecessary slowdown if the card is running in 16-bit mode; therefore one |
80 | * should detect 16-bit vs 8-bit mode from the EEPROM settings and act | 80 | * should detect 16-bit vs 8-bit mode from the EEPROM settings and act |
81 | * accordingly. In 8-bit mode with this bugfix I'm getting about 150 K/s for | 81 | * accordingly. In 8-bit mode with this bugfix I'm getting about 150 K/s for |
82 | * ftp's, which is significantly better than I get in DOS, so the overhead of | 82 | * ftp's, which is significantly better than I get in DOS, so the overhead of |
83 | * stopping and restarting the CU with each transmit is not prohibitive in | 83 | * stopping and restarting the CU with each transmit is not prohibitive in |
@@ -96,8 +96,7 @@ | |||
96 | #ifndef LOCKUP16 | 96 | #ifndef LOCKUP16 |
97 | #define LOCKUP16 0 | 97 | #define LOCKUP16 0 |
98 | #endif | 98 | #endif |
99 | 99 | ||
100 | #include <linux/config.h> | ||
101 | #include <linux/module.h> | 100 | #include <linux/module.h> |
102 | #include <linux/kernel.h> | 101 | #include <linux/kernel.h> |
103 | #include <linux/types.h> | 102 | #include <linux/types.h> |
@@ -178,7 +177,7 @@ static unsigned short start_code[] = { | |||
178 | 177 | ||
179 | /* 0x20 -- start of 82586 CU program */ | 178 | /* 0x20 -- start of 82586 CU program */ |
180 | #define CONF_LINK 0x20 | 179 | #define CONF_LINK 0x20 |
181 | 0x0000,Cmd_Config, | 180 | 0x0000,Cmd_Config, |
182 | 0x0032, /* link to next command */ | 181 | 0x0032, /* link to next command */ |
183 | 0x080c, /* 12 bytes follow : fifo threshold=8 */ | 182 | 0x080c, /* 12 bytes follow : fifo threshold=8 */ |
184 | 0x2e40, /* don't rx bad frames | 183 | 0x2e40, /* don't rx bad frames |
@@ -188,10 +187,10 @@ static unsigned short start_code[] = { | |||
188 | */ | 187 | */ |
189 | 0x6000, /* default backoff method & priority | 188 | 0x6000, /* default backoff method & priority |
190 | * interframe spacing = 0x60 */ | 189 | * interframe spacing = 0x60 */ |
191 | 0xf200, /* slot time=0x200 | 190 | 0xf200, /* slot time=0x200 |
192 | * max collision retry = 0xf */ | 191 | * max collision retry = 0xf */ |
193 | #define CONF_PROMISC 0x2e | 192 | #define CONF_PROMISC 0x2e |
194 | 0x0000, /* no HDLC : normal CRC : enable broadcast | 193 | 0x0000, /* no HDLC : normal CRC : enable broadcast |
195 | * disable promiscuous/multicast modes */ | 194 | * disable promiscuous/multicast modes */ |
196 | 0x003c, /* minimum frame length = 60 octets) */ | 195 | 0x003c, /* minimum frame length = 60 octets) */ |
197 | 196 | ||
@@ -238,7 +237,7 @@ static unsigned short mca_iomap[] = { | |||
238 | }; | 237 | }; |
239 | /* bits 5-7 of the second POS register */ | 238 | /* bits 5-7 of the second POS register */ |
240 | static char mca_irqmap[] = { 12, 9, 3, 4, 5, 10, 11, 15 }; | 239 | static char mca_irqmap[] = { 12, 9, 3, 4, 5, 10, 11, 15 }; |
241 | #endif | 240 | #endif |
242 | 241 | ||
243 | /* | 242 | /* |
244 | * Prototypes for Linux interface | 243 | * Prototypes for Linux interface |
@@ -357,7 +356,7 @@ static int __init do_express_probe(struct net_device *dev) | |||
357 | */ | 356 | */ |
358 | while (slot != MCA_NOTFOUND) { | 357 | while (slot != MCA_NOTFOUND) { |
359 | int pos0, pos1; | 358 | int pos0, pos1; |
360 | 359 | ||
361 | slot = mca_find_unused_adapter(0x628B, slot); | 360 | slot = mca_find_unused_adapter(0x628B, slot); |
362 | if (slot == MCA_NOTFOUND) | 361 | if (slot == MCA_NOTFOUND) |
363 | break; | 362 | break; |
@@ -367,10 +366,10 @@ static int __init do_express_probe(struct net_device *dev) | |||
367 | ioaddr = mca_iomap[pos1&0xf]; | 366 | ioaddr = mca_iomap[pos1&0xf]; |
368 | 367 | ||
369 | dev->irq = mca_irqmap[(pos1>>4)&0x7]; | 368 | dev->irq = mca_irqmap[(pos1>>4)&0x7]; |
370 | 369 | ||
371 | /* | 370 | /* |
372 | * XXX: Transciever selection is done | 371 | * XXX: Transciever selection is done |
373 | * differently on the MCA version. | 372 | * differently on the MCA version. |
374 | * How to get it to select something | 373 | * How to get it to select something |
375 | * other than external/AUI is currently | 374 | * other than external/AUI is currently |
376 | * unknown. This code is just for looks. -- ASF | 375 | * unknown. This code is just for looks. -- ASF |
@@ -483,7 +482,7 @@ static int eexp_open(struct net_device *dev) | |||
483 | , ioaddr+0xc000); | 482 | , ioaddr+0xc000); |
484 | goto err_out4; | 483 | goto err_out4; |
485 | } | 484 | } |
486 | 485 | ||
487 | if (lp->width) { | 486 | if (lp->width) { |
488 | printk("%s: forcing ASIC to 8-bit mode\n", dev->name); | 487 | printk("%s: forcing ASIC to 8-bit mode\n", dev->name); |
489 | outb(inb(dev->base_addr+Config)&~4, dev->base_addr+Config); | 488 | outb(inb(dev->base_addr+Config)&~4, dev->base_addr+Config); |
@@ -519,7 +518,7 @@ static int eexp_close(struct net_device *dev) | |||
519 | int irq = dev->irq; | 518 | int irq = dev->irq; |
520 | 519 | ||
521 | netif_stop_queue(dev); | 520 | netif_stop_queue(dev); |
522 | 521 | ||
523 | outb(SIRQ_dis|irqrmap[irq],ioaddr+SET_IRQ); | 522 | outb(SIRQ_dis|irqrmap[irq],ioaddr+SET_IRQ); |
524 | lp->started = 0; | 523 | lp->started = 0; |
525 | scb_command(dev, SCB_CUsuspend|SCB_RUsuspend); | 524 | scb_command(dev, SCB_CUsuspend|SCB_RUsuspend); |
@@ -631,14 +630,14 @@ static void eexp_timeout(struct net_device *dev) | |||
631 | unsigned long flags; | 630 | unsigned long flags; |
632 | #endif | 631 | #endif |
633 | int status; | 632 | int status; |
634 | 633 | ||
635 | disable_irq(dev->irq); | 634 | disable_irq(dev->irq); |
636 | 635 | ||
637 | /* | 636 | /* |
638 | * Best would be to use synchronize_irq(); spin_lock() here | 637 | * Best would be to use synchronize_irq(); spin_lock() here |
639 | * lets make it work first.. | 638 | * lets make it work first.. |
640 | */ | 639 | */ |
641 | 640 | ||
642 | #ifdef CONFIG_SMP | 641 | #ifdef CONFIG_SMP |
643 | spin_lock_irqsave(&lp->lock, flags); | 642 | spin_lock_irqsave(&lp->lock, flags); |
644 | #endif | 643 | #endif |
@@ -654,7 +653,7 @@ static void eexp_timeout(struct net_device *dev) | |||
654 | scb_command(dev, SCB_CUabort); | 653 | scb_command(dev, SCB_CUabort); |
655 | outb(0,dev->base_addr+SIGNAL_CA); | 654 | outb(0,dev->base_addr+SIGNAL_CA); |
656 | } | 655 | } |
657 | netif_wake_queue(dev); | 656 | netif_wake_queue(dev); |
658 | #ifdef CONFIG_SMP | 657 | #ifdef CONFIG_SMP |
659 | spin_unlock_irqrestore(&lp->lock, flags); | 658 | spin_unlock_irqrestore(&lp->lock, flags); |
660 | #endif | 659 | #endif |
@@ -688,11 +687,11 @@ static int eexp_xmit(struct sk_buff *buf, struct net_device *dev) | |||
688 | * Best would be to use synchronize_irq(); spin_lock() here | 687 | * Best would be to use synchronize_irq(); spin_lock() here |
689 | * lets make it work first.. | 688 | * lets make it work first.. |
690 | */ | 689 | */ |
691 | 690 | ||
692 | #ifdef CONFIG_SMP | 691 | #ifdef CONFIG_SMP |
693 | spin_lock_irqsave(&lp->lock, flags); | 692 | spin_lock_irqsave(&lp->lock, flags); |
694 | #endif | 693 | #endif |
695 | 694 | ||
696 | { | 695 | { |
697 | unsigned short *data = (unsigned short *)buf->data; | 696 | unsigned short *data = (unsigned short *)buf->data; |
698 | 697 | ||
@@ -740,7 +739,7 @@ static unsigned short eexp_start_irq(struct net_device *dev, | |||
740 | outw(CONF_DIAG_RESULT & ~31, ioaddr + SM_PTR); | 739 | outw(CONF_DIAG_RESULT & ~31, ioaddr + SM_PTR); |
741 | diag_status = inw(ioaddr + SHADOW(CONF_DIAG_RESULT)); | 740 | diag_status = inw(ioaddr + SHADOW(CONF_DIAG_RESULT)); |
742 | if (diag_status & 1<<11) { | 741 | if (diag_status & 1<<11) { |
743 | printk(KERN_WARNING "%s: 82586 failed self-test\n", | 742 | printk(KERN_WARNING "%s: 82586 failed self-test\n", |
744 | dev->name); | 743 | dev->name); |
745 | } else if (!(diag_status & 1<<13)) { | 744 | } else if (!(diag_status & 1<<13)) { |
746 | printk(KERN_WARNING "%s: 82586 self-test failed to complete\n", dev->name); | 745 | printk(KERN_WARNING "%s: 82586 self-test failed to complete\n", dev->name); |
@@ -750,7 +749,7 @@ static unsigned short eexp_start_irq(struct net_device *dev, | |||
750 | tdr_status = inw(ioaddr + SHADOW(CONF_TDR_RESULT)); | 749 | tdr_status = inw(ioaddr + SHADOW(CONF_TDR_RESULT)); |
751 | if (tdr_status & (TDR_SHORT|TDR_OPEN)) { | 750 | if (tdr_status & (TDR_SHORT|TDR_OPEN)) { |
752 | printk(KERN_WARNING "%s: TDR reports cable %s at %d tick%s\n", dev->name, (tdr_status & TDR_SHORT)?"short":"broken", tdr_status & TDR_TIME, ((tdr_status & TDR_TIME) != 1) ? "s" : ""); | 751 | printk(KERN_WARNING "%s: TDR reports cable %s at %d tick%s\n", dev->name, (tdr_status & TDR_SHORT)?"short":"broken", tdr_status & TDR_TIME, ((tdr_status & TDR_TIME) != 1) ? "s" : ""); |
753 | } | 752 | } |
754 | else if (tdr_status & TDR_XCVRPROBLEM) { | 753 | else if (tdr_status & TDR_XCVRPROBLEM) { |
755 | printk(KERN_WARNING "%s: TDR reports transceiver problem\n", dev->name); | 754 | printk(KERN_WARNING "%s: TDR reports transceiver problem\n", dev->name); |
756 | } | 755 | } |
@@ -762,7 +761,7 @@ static unsigned short eexp_start_irq(struct net_device *dev, | |||
762 | printk("%s: TDR is ga-ga (status %04x)\n", dev->name, | 761 | printk("%s: TDR is ga-ga (status %04x)\n", dev->name, |
763 | tdr_status); | 762 | tdr_status); |
764 | } | 763 | } |
765 | 764 | ||
766 | lp->started |= STARTED_CU; | 765 | lp->started |= STARTED_CU; |
767 | scb_wrcbl(dev, lp->tx_link); | 766 | scb_wrcbl(dev, lp->tx_link); |
768 | /* if the RU isn't running, start it now */ | 767 | /* if the RU isn't running, start it now */ |
@@ -775,7 +774,7 @@ static unsigned short eexp_start_irq(struct net_device *dev, | |||
775 | ack_cmd |= SCB_CUstart | 0x2000; | 774 | ack_cmd |= SCB_CUstart | 0x2000; |
776 | } | 775 | } |
777 | 776 | ||
778 | if ((dev->flags & IFF_UP) && !(lp->started & STARTED_RU) && SCB_RUstat(status)==4) | 777 | if ((dev->flags & IFF_UP) && !(lp->started & STARTED_RU) && SCB_RUstat(status)==4) |
779 | lp->started|=STARTED_RU; | 778 | lp->started|=STARTED_RU; |
780 | 779 | ||
781 | return ack_cmd; | 780 | return ack_cmd; |
@@ -789,7 +788,7 @@ static void eexp_cmd_clear(struct net_device *dev) | |||
789 | printk("%s: command didn't clear\n", dev->name); | 788 | printk("%s: command didn't clear\n", dev->name); |
790 | } | 789 | } |
791 | } | 790 | } |
792 | 791 | ||
793 | static irqreturn_t eexp_irq(int irq, void *dev_info, struct pt_regs *regs) | 792 | static irqreturn_t eexp_irq(int irq, void *dev_info, struct pt_regs *regs) |
794 | { | 793 | { |
795 | struct net_device *dev = dev_info; | 794 | struct net_device *dev = dev_info; |
@@ -814,7 +813,7 @@ static irqreturn_t eexp_irq(int irq, void *dev_info, struct pt_regs *regs) | |||
814 | 813 | ||
815 | outb(SIRQ_dis|irqrmap[irq],ioaddr+SET_IRQ); | 814 | outb(SIRQ_dis|irqrmap[irq],ioaddr+SET_IRQ); |
816 | 815 | ||
817 | 816 | ||
818 | status = scb_status(dev); | 817 | status = scb_status(dev); |
819 | 818 | ||
820 | #if NET_DEBUG > 4 | 819 | #if NET_DEBUG > 4 |
@@ -837,14 +836,14 @@ static irqreturn_t eexp_irq(int irq, void *dev_info, struct pt_regs *regs) | |||
837 | printk("%s: tx interrupt but no status\n", dev->name); | 836 | printk("%s: tx interrupt but no status\n", dev->name); |
838 | } | 837 | } |
839 | } | 838 | } |
840 | 839 | ||
841 | if (SCB_rxdframe(status)) | 840 | if (SCB_rxdframe(status)) |
842 | eexp_hw_rx_pio(dev); | 841 | eexp_hw_rx_pio(dev); |
843 | 842 | ||
844 | status = scb_status(dev); | 843 | status = scb_status(dev); |
845 | } while (status & 0xc000); | 844 | } while (status & 0xc000); |
846 | 845 | ||
847 | if (SCB_RUdead(status)) | 846 | if (SCB_RUdead(status)) |
848 | { | 847 | { |
849 | printk(KERN_WARNING "%s: RU stopped: status %04x\n", | 848 | printk(KERN_WARNING "%s: RU stopped: status %04x\n", |
850 | dev->name,status); | 849 | dev->name,status); |
@@ -868,9 +867,9 @@ static irqreturn_t eexp_irq(int irq, void *dev_info, struct pt_regs *regs) | |||
868 | scb_wrrfa(dev, lp->rx_buf_start); | 867 | scb_wrrfa(dev, lp->rx_buf_start); |
869 | scb_command(dev, SCB_RUstart); | 868 | scb_command(dev, SCB_RUstart); |
870 | outb(0,ioaddr+SIGNAL_CA); | 869 | outb(0,ioaddr+SIGNAL_CA); |
871 | } | 870 | } |
872 | } else { | 871 | } else { |
873 | if (status & 0x8000) | 872 | if (status & 0x8000) |
874 | ack_cmd = eexp_start_irq(dev, status); | 873 | ack_cmd = eexp_start_irq(dev, status); |
875 | else | 874 | else |
876 | ack_cmd = SCB_ack(status); | 875 | ack_cmd = SCB_ack(status); |
@@ -880,14 +879,14 @@ static irqreturn_t eexp_irq(int irq, void *dev_info, struct pt_regs *regs) | |||
880 | 879 | ||
881 | eexp_cmd_clear(dev); | 880 | eexp_cmd_clear(dev); |
882 | 881 | ||
883 | outb(SIRQ_en|irqrmap[irq],ioaddr+SET_IRQ); | 882 | outb(SIRQ_en|irqrmap[irq],ioaddr+SET_IRQ); |
884 | 883 | ||
885 | #if NET_DEBUG > 6 | 884 | #if NET_DEBUG > 6 |
886 | printk("%s: leaving eexp_irq()\n", dev->name); | 885 | printk("%s: leaving eexp_irq()\n", dev->name); |
887 | #endif | 886 | #endif |
888 | outw(old_read_ptr, ioaddr+READ_PTR); | 887 | outw(old_read_ptr, ioaddr+READ_PTR); |
889 | outw(old_write_ptr, ioaddr+WRITE_PTR); | 888 | outw(old_write_ptr, ioaddr+WRITE_PTR); |
890 | 889 | ||
891 | spin_unlock(&lp->lock); | 890 | spin_unlock(&lp->lock); |
892 | return IRQ_HANDLED; | 891 | return IRQ_HANDLED; |
893 | } | 892 | } |
@@ -935,7 +934,7 @@ static void eexp_hw_rx_pio(struct net_device *dev) | |||
935 | 934 | ||
936 | do { | 935 | do { |
937 | unsigned short rfd_cmd, rx_next, pbuf, pkt_len; | 936 | unsigned short rfd_cmd, rx_next, pbuf, pkt_len; |
938 | 937 | ||
939 | outw(rx_block, ioaddr + READ_PTR); | 938 | outw(rx_block, ioaddr + READ_PTR); |
940 | status = inw(ioaddr + DATAPORT); | 939 | status = inw(ioaddr + DATAPORT); |
941 | 940 | ||
@@ -944,7 +943,7 @@ static void eexp_hw_rx_pio(struct net_device *dev) | |||
944 | rfd_cmd = inw(ioaddr + DATAPORT); | 943 | rfd_cmd = inw(ioaddr + DATAPORT); |
945 | rx_next = inw(ioaddr + DATAPORT); | 944 | rx_next = inw(ioaddr + DATAPORT); |
946 | pbuf = inw(ioaddr + DATAPORT); | 945 | pbuf = inw(ioaddr + DATAPORT); |
947 | 946 | ||
948 | outw(pbuf, ioaddr + READ_PTR); | 947 | outw(pbuf, ioaddr + READ_PTR); |
949 | pkt_len = inw(ioaddr + DATAPORT); | 948 | pkt_len = inw(ioaddr + DATAPORT); |
950 | 949 | ||
@@ -956,17 +955,17 @@ static void eexp_hw_rx_pio(struct net_device *dev) | |||
956 | } | 955 | } |
957 | else if (pbuf!=rx_block+0x16) | 956 | else if (pbuf!=rx_block+0x16) |
958 | { | 957 | { |
959 | printk(KERN_WARNING "%s: rfd and rbd out of sync 0x%04x 0x%04x\n", | 958 | printk(KERN_WARNING "%s: rfd and rbd out of sync 0x%04x 0x%04x\n", |
960 | dev->name, rx_block+0x16, pbuf); | 959 | dev->name, rx_block+0x16, pbuf); |
961 | continue; | 960 | continue; |
962 | } | 961 | } |
963 | else if ((pkt_len & 0xc000)!=0xc000) | 962 | else if ((pkt_len & 0xc000)!=0xc000) |
964 | { | 963 | { |
965 | printk(KERN_WARNING "%s: EOF or F not set on received buffer (%04x)\n", | 964 | printk(KERN_WARNING "%s: EOF or F not set on received buffer (%04x)\n", |
966 | dev->name, pkt_len & 0xc000); | 965 | dev->name, pkt_len & 0xc000); |
967 | continue; | 966 | continue; |
968 | } | 967 | } |
969 | else if (!FD_OK(status)) | 968 | else if (!FD_OK(status)) |
970 | { | 969 | { |
971 | lp->stats.rx_errors++; | 970 | lp->stats.rx_errors++; |
972 | if (FD_CRC(status)) | 971 | if (FD_CRC(status)) |
@@ -1026,9 +1025,9 @@ static void eexp_hw_tx_pio(struct net_device *dev, unsigned short *buf, | |||
1026 | if (LOCKUP16 || lp->width) { | 1025 | if (LOCKUP16 || lp->width) { |
1027 | /* Stop the CU so that there is no chance that it | 1026 | /* Stop the CU so that there is no chance that it |
1028 | jumps off to a bogus address while we are writing the | 1027 | jumps off to a bogus address while we are writing the |
1029 | pointer to the next transmit packet in 8-bit mode -- | 1028 | pointer to the next transmit packet in 8-bit mode -- |
1030 | this eliminates the "CU wedged" errors in 8-bit mode. | 1029 | this eliminates the "CU wedged" errors in 8-bit mode. |
1031 | (Zoltan Szilagyi 10-12-96) */ | 1030 | (Zoltan Szilagyi 10-12-96) */ |
1032 | scb_command(dev, SCB_CUsuspend); | 1031 | scb_command(dev, SCB_CUsuspend); |
1033 | outw(0xFFFF, ioaddr+SIGNAL_CA); | 1032 | outw(0xFFFF, ioaddr+SIGNAL_CA); |
1034 | } | 1033 | } |
@@ -1062,7 +1061,7 @@ static void eexp_hw_tx_pio(struct net_device *dev, unsigned short *buf, | |||
1062 | lp->tx_head += TX_BUF_SIZE; | 1061 | lp->tx_head += TX_BUF_SIZE; |
1063 | if (lp->tx_head != lp->tx_reap) | 1062 | if (lp->tx_head != lp->tx_reap) |
1064 | netif_wake_queue(dev); | 1063 | netif_wake_queue(dev); |
1065 | 1064 | ||
1066 | if (LOCKUP16 || lp->width) { | 1065 | if (LOCKUP16 || lp->width) { |
1067 | /* Restart the CU so that the packet can actually | 1066 | /* Restart the CU so that the packet can actually |
1068 | be transmitted. (Zoltan Szilagyi 10-12-96) */ | 1067 | be transmitted. (Zoltan Szilagyi 10-12-96) */ |
@@ -1103,7 +1102,7 @@ static int __init eexp_hw_probe(struct net_device *dev, unsigned short ioaddr) | |||
1103 | 1102 | ||
1104 | /* Standard Address or Compaq LTE Address */ | 1103 | /* Standard Address or Compaq LTE Address */ |
1105 | if (!((hw_addr[2]==0x00aa && ((hw_addr[1] & 0xff00)==0x0000)) || | 1104 | if (!((hw_addr[2]==0x00aa && ((hw_addr[1] & 0xff00)==0x0000)) || |
1106 | (hw_addr[2]==0x0080 && ((hw_addr[1] & 0xff00)==0x5F00)))) | 1105 | (hw_addr[2]==0x0080 && ((hw_addr[1] & 0xff00)==0x5F00)))) |
1107 | { | 1106 | { |
1108 | printk(" rejected: invalid address %04x%04x%04x\n", | 1107 | printk(" rejected: invalid address %04x%04x%04x\n", |
1109 | hw_addr[2],hw_addr[1],hw_addr[0]); | 1108 | hw_addr[2],hw_addr[1],hw_addr[0]); |
@@ -1141,16 +1140,16 @@ static int __init eexp_hw_probe(struct net_device *dev, unsigned short ioaddr) | |||
1141 | memset(lp, 0, sizeof(struct net_local)); | 1140 | memset(lp, 0, sizeof(struct net_local)); |
1142 | spin_lock_init(&lp->lock); | 1141 | spin_lock_init(&lp->lock); |
1143 | 1142 | ||
1144 | printk("(IRQ %d, %s connector, %d-bit bus", dev->irq, | 1143 | printk("(IRQ %d, %s connector, %d-bit bus", dev->irq, |
1145 | eexp_ifmap[dev->if_port], buswidth?8:16); | 1144 | eexp_ifmap[dev->if_port], buswidth?8:16); |
1146 | 1145 | ||
1147 | if (!request_region(dev->base_addr + 0x300e, 1, "EtherExpress")) | 1146 | if (!request_region(dev->base_addr + 0x300e, 1, "EtherExpress")) |
1148 | return -EBUSY; | 1147 | return -EBUSY; |
1149 | 1148 | ||
1150 | eexp_hw_set_interface(dev); | 1149 | eexp_hw_set_interface(dev); |
1151 | 1150 | ||
1152 | release_region(dev->base_addr + 0x300e, 1); | 1151 | release_region(dev->base_addr + 0x300e, 1); |
1153 | 1152 | ||
1154 | /* Find out how much RAM we have on the card */ | 1153 | /* Find out how much RAM we have on the card */ |
1155 | outw(0, dev->base_addr + WRITE_PTR); | 1154 | outw(0, dev->base_addr + WRITE_PTR); |
1156 | for (i = 0; i < 32768; i++) | 1155 | for (i = 0; i < 32768; i++) |
@@ -1285,7 +1284,7 @@ static unsigned short eexp_hw_lasttxstat(struct net_device *dev) | |||
1285 | { | 1284 | { |
1286 | char *whatsup = NULL; | 1285 | char *whatsup = NULL; |
1287 | lp->stats.tx_errors++; | 1286 | lp->stats.tx_errors++; |
1288 | if (Stat_Abort(status)) | 1287 | if (Stat_Abort(status)) |
1289 | lp->stats.tx_aborted_errors++; | 1288 | lp->stats.tx_aborted_errors++; |
1290 | if (Stat_TNoCar(status)) { | 1289 | if (Stat_TNoCar(status)) { |
1291 | whatsup = "aborted, no carrier"; | 1290 | whatsup = "aborted, no carrier"; |
@@ -1461,11 +1460,11 @@ static void eexp_hw_rxinit(struct net_device *dev) | |||
1461 | /* Close Rx frame descriptor ring */ | 1460 | /* Close Rx frame descriptor ring */ |
1462 | outw(lp->rx_last + 4, ioaddr+WRITE_PTR); | 1461 | outw(lp->rx_last + 4, ioaddr+WRITE_PTR); |
1463 | outw(lp->rx_first, ioaddr+DATAPORT); | 1462 | outw(lp->rx_first, ioaddr+DATAPORT); |
1464 | 1463 | ||
1465 | /* Close Rx buffer descriptor ring */ | 1464 | /* Close Rx buffer descriptor ring */ |
1466 | outw(lp->rx_last + 0x16 + 2, ioaddr+WRITE_PTR); | 1465 | outw(lp->rx_last + 0x16 + 2, ioaddr+WRITE_PTR); |
1467 | outw(lp->rx_first + 0x16, ioaddr+DATAPORT); | 1466 | outw(lp->rx_first + 0x16, ioaddr+DATAPORT); |
1468 | 1467 | ||
1469 | } | 1468 | } |
1470 | 1469 | ||
1471 | /* | 1470 | /* |
@@ -1513,7 +1512,7 @@ static void eexp_hw_init586(struct net_device *dev) | |||
1513 | /* Do we want promiscuous mode or multicast? */ | 1512 | /* Do we want promiscuous mode or multicast? */ |
1514 | outw(CONF_PROMISC & ~31, ioaddr+SM_PTR); | 1513 | outw(CONF_PROMISC & ~31, ioaddr+SM_PTR); |
1515 | i = inw(ioaddr+SHADOW(CONF_PROMISC)); | 1514 | i = inw(ioaddr+SHADOW(CONF_PROMISC)); |
1516 | outw((dev->flags & IFF_PROMISC)?(i|1):(i & ~1), | 1515 | outw((dev->flags & IFF_PROMISC)?(i|1):(i & ~1), |
1517 | ioaddr+SHADOW(CONF_PROMISC)); | 1516 | ioaddr+SHADOW(CONF_PROMISC)); |
1518 | lp->was_promisc = dev->flags & IFF_PROMISC; | 1517 | lp->was_promisc = dev->flags & IFF_PROMISC; |
1519 | #if 0 | 1518 | #if 0 |
@@ -1523,7 +1522,7 @@ static void eexp_hw_init586(struct net_device *dev) | |||
1523 | /* Write our hardware address */ | 1522 | /* Write our hardware address */ |
1524 | outw(CONF_HWADDR & ~31, ioaddr+SM_PTR); | 1523 | outw(CONF_HWADDR & ~31, ioaddr+SM_PTR); |
1525 | outw(((unsigned short *)dev->dev_addr)[0], ioaddr+SHADOW(CONF_HWADDR)); | 1524 | outw(((unsigned short *)dev->dev_addr)[0], ioaddr+SHADOW(CONF_HWADDR)); |
1526 | outw(((unsigned short *)dev->dev_addr)[1], | 1525 | outw(((unsigned short *)dev->dev_addr)[1], |
1527 | ioaddr+SHADOW(CONF_HWADDR+2)); | 1526 | ioaddr+SHADOW(CONF_HWADDR+2)); |
1528 | outw(((unsigned short *)dev->dev_addr)[2], | 1527 | outw(((unsigned short *)dev->dev_addr)[2], |
1529 | ioaddr+SHADOW(CONF_HWADDR+4)); | 1528 | ioaddr+SHADOW(CONF_HWADDR+4)); |
@@ -1609,7 +1608,7 @@ static void eexp_setup_filter(struct net_device *dev) | |||
1609 | dev->name, count); | 1608 | dev->name, count); |
1610 | count = 8; | 1609 | count = 8; |
1611 | } | 1610 | } |
1612 | 1611 | ||
1613 | outw(CONF_NR_MULTICAST & ~31, ioaddr+SM_PTR); | 1612 | outw(CONF_NR_MULTICAST & ~31, ioaddr+SM_PTR); |
1614 | outw(count, ioaddr+SHADOW(CONF_NR_MULTICAST)); | 1613 | outw(count, ioaddr+SHADOW(CONF_NR_MULTICAST)); |
1615 | for (i = 0; i < count; i++) { | 1614 | for (i = 0; i < count; i++) { |
@@ -1699,7 +1698,7 @@ MODULE_LICENSE("GPL"); | |||
1699 | * are specified, we verify and then use them. If no parameters are given, we | 1698 | * are specified, we verify and then use them. If no parameters are given, we |
1700 | * autoprobe for one card only. | 1699 | * autoprobe for one card only. |
1701 | */ | 1700 | */ |
1702 | int init_module(void) | 1701 | int __init init_module(void) |
1703 | { | 1702 | { |
1704 | struct net_device *dev; | 1703 | struct net_device *dev; |
1705 | int this_dev, found = 0; | 1704 | int this_dev, found = 0; |