diff options
Diffstat (limited to 'drivers/net/lib8390.c')
-rw-r--r-- | drivers/net/lib8390.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/net/lib8390.c b/drivers/net/lib8390.c index 316bb70775b1..17b75e5f1b0a 100644 --- a/drivers/net/lib8390.c +++ b/drivers/net/lib8390.c | |||
@@ -35,7 +35,7 @@ | |||
35 | Alexey Kuznetsov : use the 8390's six bit hash multicast filter. | 35 | Alexey Kuznetsov : use the 8390's six bit hash multicast filter. |
36 | Paul Gortmaker : tweak ANK's above multicast changes a bit. | 36 | Paul Gortmaker : tweak ANK's above multicast changes a bit. |
37 | Paul Gortmaker : update packet statistics for v2.1.x | 37 | Paul Gortmaker : update packet statistics for v2.1.x |
38 | Alan Cox : support arbitary stupid port mappings on the | 38 | Alan Cox : support arbitrary stupid port mappings on the |
39 | 68K Macintosh. Support >16bit I/O spaces | 39 | 68K Macintosh. Support >16bit I/O spaces |
40 | Paul Gortmaker : add kmod support for auto-loading of the 8390 | 40 | Paul Gortmaker : add kmod support for auto-loading of the 8390 |
41 | module by all drivers that require it. | 41 | module by all drivers that require it. |
@@ -121,7 +121,7 @@ static void __NS8390_init(struct net_device *dev, int startp); | |||
121 | /* | 121 | /* |
122 | * SMP and the 8390 setup. | 122 | * SMP and the 8390 setup. |
123 | * | 123 | * |
124 | * The 8390 isnt exactly designed to be multithreaded on RX/TX. There is | 124 | * The 8390 isn't exactly designed to be multithreaded on RX/TX. There is |
125 | * a page register that controls bank and packet buffer access. We guard | 125 | * a page register that controls bank and packet buffer access. We guard |
126 | * this with ei_local->page_lock. Nobody should assume or set the page other | 126 | * this with ei_local->page_lock. Nobody should assume or set the page other |
127 | * than zero when the lock is not held. Lock holders must restore page 0 | 127 | * than zero when the lock is not held. Lock holders must restore page 0 |
@@ -203,7 +203,7 @@ static void __NS8390_init(struct net_device *dev, int startp); | |||
203 | static int __ei_open(struct net_device *dev) | 203 | static int __ei_open(struct net_device *dev) |
204 | { | 204 | { |
205 | unsigned long flags; | 205 | unsigned long flags; |
206 | struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev); | 206 | struct ei_device *ei_local = netdev_priv(dev); |
207 | 207 | ||
208 | if (dev->watchdog_timeo <= 0) | 208 | if (dev->watchdog_timeo <= 0) |
209 | dev->watchdog_timeo = TX_TIMEOUT; | 209 | dev->watchdog_timeo = TX_TIMEOUT; |
@@ -231,7 +231,7 @@ static int __ei_open(struct net_device *dev) | |||
231 | */ | 231 | */ |
232 | static int __ei_close(struct net_device *dev) | 232 | static int __ei_close(struct net_device *dev) |
233 | { | 233 | { |
234 | struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev); | 234 | struct ei_device *ei_local = netdev_priv(dev); |
235 | unsigned long flags; | 235 | unsigned long flags; |
236 | 236 | ||
237 | /* | 237 | /* |
@@ -256,7 +256,7 @@ static int __ei_close(struct net_device *dev) | |||
256 | static void __ei_tx_timeout(struct net_device *dev) | 256 | static void __ei_tx_timeout(struct net_device *dev) |
257 | { | 257 | { |
258 | unsigned long e8390_base = dev->base_addr; | 258 | unsigned long e8390_base = dev->base_addr; |
259 | struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev); | 259 | struct ei_device *ei_local = netdev_priv(dev); |
260 | int txsr, isr, tickssofar = jiffies - dev_trans_start(dev); | 260 | int txsr, isr, tickssofar = jiffies - dev_trans_start(dev); |
261 | unsigned long flags; | 261 | unsigned long flags; |
262 | 262 | ||
@@ -303,7 +303,7 @@ static netdev_tx_t __ei_start_xmit(struct sk_buff *skb, | |||
303 | struct net_device *dev) | 303 | struct net_device *dev) |
304 | { | 304 | { |
305 | unsigned long e8390_base = dev->base_addr; | 305 | unsigned long e8390_base = dev->base_addr; |
306 | struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev); | 306 | struct ei_device *ei_local = netdev_priv(dev); |
307 | int send_length = skb->len, output_page; | 307 | int send_length = skb->len, output_page; |
308 | unsigned long flags; | 308 | unsigned long flags; |
309 | char buf[ETH_ZLEN]; | 309 | char buf[ETH_ZLEN]; |
@@ -592,7 +592,7 @@ static void ei_tx_err(struct net_device *dev) | |||
592 | static void ei_tx_intr(struct net_device *dev) | 592 | static void ei_tx_intr(struct net_device *dev) |
593 | { | 593 | { |
594 | unsigned long e8390_base = dev->base_addr; | 594 | unsigned long e8390_base = dev->base_addr; |
595 | struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev); | 595 | struct ei_device *ei_local = netdev_priv(dev); |
596 | int status = ei_inb(e8390_base + EN0_TSR); | 596 | int status = ei_inb(e8390_base + EN0_TSR); |
597 | 597 | ||
598 | ei_outb_p(ENISR_TX, e8390_base + EN0_ISR); /* Ack intr. */ | 598 | ei_outb_p(ENISR_TX, e8390_base + EN0_ISR); /* Ack intr. */ |
@@ -675,7 +675,7 @@ static void ei_tx_intr(struct net_device *dev) | |||
675 | static void ei_receive(struct net_device *dev) | 675 | static void ei_receive(struct net_device *dev) |
676 | { | 676 | { |
677 | unsigned long e8390_base = dev->base_addr; | 677 | unsigned long e8390_base = dev->base_addr; |
678 | struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev); | 678 | struct ei_device *ei_local = netdev_priv(dev); |
679 | unsigned char rxing_page, this_frame, next_frame; | 679 | unsigned char rxing_page, this_frame, next_frame; |
680 | unsigned short current_offset; | 680 | unsigned short current_offset; |
681 | int rx_pkt_count = 0; | 681 | int rx_pkt_count = 0; |
@@ -879,7 +879,7 @@ static void ei_rx_overrun(struct net_device *dev) | |||
879 | static struct net_device_stats *__ei_get_stats(struct net_device *dev) | 879 | static struct net_device_stats *__ei_get_stats(struct net_device *dev) |
880 | { | 880 | { |
881 | unsigned long ioaddr = dev->base_addr; | 881 | unsigned long ioaddr = dev->base_addr; |
882 | struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev); | 882 | struct ei_device *ei_local = netdev_priv(dev); |
883 | unsigned long flags; | 883 | unsigned long flags; |
884 | 884 | ||
885 | /* If the card is stopped, just return the present stats. */ | 885 | /* If the card is stopped, just return the present stats. */ |
@@ -927,7 +927,7 @@ static void do_set_multicast_list(struct net_device *dev) | |||
927 | { | 927 | { |
928 | unsigned long e8390_base = dev->base_addr; | 928 | unsigned long e8390_base = dev->base_addr; |
929 | int i; | 929 | int i; |
930 | struct ei_device *ei_local = (struct ei_device*)netdev_priv(dev); | 930 | struct ei_device *ei_local = netdev_priv(dev); |
931 | 931 | ||
932 | if (!(dev->flags&(IFF_PROMISC|IFF_ALLMULTI))) | 932 | if (!(dev->flags&(IFF_PROMISC|IFF_ALLMULTI))) |
933 | { | 933 | { |
@@ -981,7 +981,7 @@ static void do_set_multicast_list(struct net_device *dev) | |||
981 | static void __ei_set_multicast_list(struct net_device *dev) | 981 | static void __ei_set_multicast_list(struct net_device *dev) |
982 | { | 982 | { |
983 | unsigned long flags; | 983 | unsigned long flags; |
984 | struct ei_device *ei_local = (struct ei_device*)netdev_priv(dev); | 984 | struct ei_device *ei_local = netdev_priv(dev); |
985 | 985 | ||
986 | spin_lock_irqsave(&ei_local->page_lock, flags); | 986 | spin_lock_irqsave(&ei_local->page_lock, flags); |
987 | do_set_multicast_list(dev); | 987 | do_set_multicast_list(dev); |
@@ -998,7 +998,7 @@ static void __ei_set_multicast_list(struct net_device *dev) | |||
998 | 998 | ||
999 | static void ethdev_setup(struct net_device *dev) | 999 | static void ethdev_setup(struct net_device *dev) |
1000 | { | 1000 | { |
1001 | struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev); | 1001 | struct ei_device *ei_local = netdev_priv(dev); |
1002 | if (ei_debug > 1) | 1002 | if (ei_debug > 1) |
1003 | printk(version); | 1003 | printk(version); |
1004 | 1004 | ||
@@ -1036,7 +1036,7 @@ static struct net_device *____alloc_ei_netdev(int size) | |||
1036 | static void __NS8390_init(struct net_device *dev, int startp) | 1036 | static void __NS8390_init(struct net_device *dev, int startp) |
1037 | { | 1037 | { |
1038 | unsigned long e8390_base = dev->base_addr; | 1038 | unsigned long e8390_base = dev->base_addr; |
1039 | struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev); | 1039 | struct ei_device *ei_local = netdev_priv(dev); |
1040 | int i; | 1040 | int i; |
1041 | int endcfg = ei_local->word16 | 1041 | int endcfg = ei_local->word16 |
1042 | ? (0x48 | ENDCFG_WTS | (ei_local->bigendian ? ENDCFG_BOS : 0)) | 1042 | ? (0x48 | ENDCFG_WTS | (ei_local->bigendian ? ENDCFG_BOS : 0)) |
@@ -1077,7 +1077,6 @@ static void __NS8390_init(struct net_device *dev, int startp) | |||
1077 | ei_outb_p(ei_local->rx_start_page, e8390_base + EN1_CURPAG); | 1077 | ei_outb_p(ei_local->rx_start_page, e8390_base + EN1_CURPAG); |
1078 | ei_outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base+E8390_CMD); | 1078 | ei_outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base+E8390_CMD); |
1079 | 1079 | ||
1080 | netif_start_queue(dev); | ||
1081 | ei_local->tx1 = ei_local->tx2 = 0; | 1080 | ei_local->tx1 = ei_local->tx2 = 0; |
1082 | ei_local->txing = 0; | 1081 | ei_local->txing = 0; |
1083 | 1082 | ||
@@ -1100,7 +1099,7 @@ static void NS8390_trigger_send(struct net_device *dev, unsigned int length, | |||
1100 | int start_page) | 1099 | int start_page) |
1101 | { | 1100 | { |
1102 | unsigned long e8390_base = dev->base_addr; | 1101 | unsigned long e8390_base = dev->base_addr; |
1103 | struct ei_device *ei_local __attribute((unused)) = (struct ei_device *) netdev_priv(dev); | 1102 | struct ei_device *ei_local __attribute((unused)) = netdev_priv(dev); |
1104 | 1103 | ||
1105 | ei_outb_p(E8390_NODMA+E8390_PAGE0, e8390_base+E8390_CMD); | 1104 | ei_outb_p(E8390_NODMA+E8390_PAGE0, e8390_base+E8390_CMD); |
1106 | 1105 | ||