aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/lib8390.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/net/lib8390.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'drivers/net/lib8390.c')
-rw-r--r--drivers/net/lib8390.c29
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);
203static int __ei_open(struct net_device *dev) 203static 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 */
232static int __ei_close(struct net_device *dev) 232static 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)
256static void __ei_tx_timeout(struct net_device *dev) 256static 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)
592static void ei_tx_intr(struct net_device *dev) 592static 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)
675static void ei_receive(struct net_device *dev) 675static 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)
879static struct net_device_stats *__ei_get_stats(struct net_device *dev) 879static 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)
981static void __ei_set_multicast_list(struct net_device *dev) 981static 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
999static void ethdev_setup(struct net_device *dev) 999static 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)
1036static void __NS8390_init(struct net_device *dev, int startp) 1036static 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