aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-21 00:04:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-21 00:04:44 -0400
commitf8965467f366fd18f01feafb5db10512d7b4422c (patch)
tree3706a9cd779859271ca61b85c63a1bc3f82d626e /drivers/net/pcmcia
parenta26272e5200765691e67d6780e52b32498fdb659 (diff)
parent2ec8c6bb5d8f3a62a79f463525054bae1e3d4487 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1674 commits) qlcnic: adding co maintainer ixgbe: add support for active DA cables ixgbe: dcb, do not tag tc_prio_control frames ixgbe: fix ixgbe_tx_is_paused logic ixgbe: always enable vlan strip/insert when DCB is enabled ixgbe: remove some redundant code in setting FCoE FIP filter ixgbe: fix wrong offset to fc_frame_header in ixgbe_fcoe_ddp ixgbe: fix header len when unsplit packet overflows to data buffer ipv6: Never schedule DAD timer on dead address ipv6: Use POSTDAD state ipv6: Use state_lock to protect ifa state ipv6: Replace inet6_ifaddr->dead with state cxgb4: notify upper drivers if the device is already up when they load cxgb4: keep interrupts available when the ports are brought down cxgb4: fix initial addition of MAC address cnic: Return SPQ credit to bnx2x after ring setup and shutdown. cnic: Convert cnic_local_flags to atomic ops. can: Fix SJA1000 command register writes on SMP systems bridge: fix build for CONFIG_SYSFS disabled ARCNET: Limit com20020 PCI ID matches for SOHARD cards ... Fix up various conflicts with pcmcia tree drivers/net/ {pcmcia/3c589_cs.c, wireless/orinoco/orinoco_cs.c and wireless/orinoco/spectrum_cs.c} and feature removal (Documentation/feature-removal-schedule.txt). Also fix a non-content conflict due to pm_qos_requirement getting renamed in the PM tree (now pm_qos_request) in net/mac80211/scan.c
Diffstat (limited to 'drivers/net/pcmcia')
-rw-r--r--drivers/net/pcmcia/3c574_cs.c6
-rw-r--r--drivers/net/pcmcia/3c589_cs.c287
-rw-r--r--drivers/net/pcmcia/axnet_cs.c10
-rw-r--r--drivers/net/pcmcia/fmvj18x_cs.c9
-rw-r--r--drivers/net/pcmcia/ibmtr_cs.c2
-rw-r--r--drivers/net/pcmcia/nmclan_cs.c12
-rw-r--r--drivers/net/pcmcia/smc91c92_cs.c14
-rw-r--r--drivers/net/pcmcia/xirc2ps_cs.c9
8 files changed, 167 insertions, 182 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 30b7cf70fbe6..10ee106a1617 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -613,8 +613,6 @@ static void mdio_write(unsigned int ioaddr, int phy_id, int location, int value)
613 outw(MDIO_ENB_IN, mdio_addr); 613 outw(MDIO_ENB_IN, mdio_addr);
614 outw(MDIO_ENB_IN | MDIO_SHIFT_CLK, mdio_addr); 614 outw(MDIO_ENB_IN | MDIO_SHIFT_CLK, mdio_addr);
615 } 615 }
616
617 return;
618} 616}
619 617
620/* Reset and restore all of the 3c574 registers. */ 618/* Reset and restore all of the 3c574 registers. */
@@ -730,7 +728,7 @@ static void el3_tx_timeout(struct net_device *dev)
730 printk(KERN_NOTICE "%s: Transmit timed out!\n", dev->name); 728 printk(KERN_NOTICE "%s: Transmit timed out!\n", dev->name);
731 dump_status(dev); 729 dump_status(dev);
732 dev->stats.tx_errors++; 730 dev->stats.tx_errors++;
733 dev->trans_start = jiffies; 731 dev->trans_start = jiffies; /* prevent tx timeout */
734 /* Issue TX_RESET and TX_START commands. */ 732 /* Issue TX_RESET and TX_START commands. */
735 tc574_wait_for_completion(dev, TxReset); 733 tc574_wait_for_completion(dev, TxReset);
736 outw(TxEnable, ioaddr + EL3_CMD); 734 outw(TxEnable, ioaddr + EL3_CMD);
@@ -781,8 +779,6 @@ static netdev_tx_t el3_start_xmit(struct sk_buff *skb,
781 /* ... and the packet rounded to a doubleword. */ 779 /* ... and the packet rounded to a doubleword. */
782 outsl(ioaddr + TX_FIFO, skb->data, (skb->len+3)>>2); 780 outsl(ioaddr + TX_FIFO, skb->data, (skb->len+3)>>2);
783 781
784 dev->trans_start = jiffies;
785
786 /* TxFree appears only in Window 1, not offset 0x1c. */ 782 /* TxFree appears only in Window 1, not offset 0x1c. */
787 if (inw(ioaddr + TxFree) <= 1536) { 783 if (inw(ioaddr + TxFree) <= 1536) {
788 netif_stop_queue(dev); 784 netif_stop_queue(dev);
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index 5ab589d3b385..ce63c3773b4c 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -1,20 +1,20 @@
1/*====================================================================== 1/*======================================================================
2 2
3 A PCMCIA ethernet driver for the 3com 3c589 card. 3 A PCMCIA ethernet driver for the 3com 3c589 card.
4 4
5 Copyright (C) 1999 David A. Hinds -- dahinds@users.sourceforge.net 5 Copyright (C) 1999 David A. Hinds -- dahinds@users.sourceforge.net
6 6
7 3c589_cs.c 1.162 2001/10/13 00:08:50 7 3c589_cs.c 1.162 2001/10/13 00:08:50
8 8
9 The network driver code is based on Donald Becker's 3c589 code: 9 The network driver code is based on Donald Becker's 3c589 code:
10 10
11 Written 1994 by Donald Becker. 11 Written 1994 by Donald Becker.
12 Copyright 1993 United States Government as represented by the 12 Copyright 1993 United States Government as represented by the
13 Director, National Security Agency. This software may be used and 13 Director, National Security Agency. This software may be used and
14 distributed according to the terms of the GNU General Public License, 14 distributed according to the terms of the GNU General Public License,
15 incorporated herein by reference. 15 incorporated herein by reference.
16 Donald Becker may be reached at becker@scyld.com 16 Donald Becker may be reached at becker@scyld.com
17 17
18 Updated for 2.5.x by Alan Cox <alan@lxorguk.ukuu.org.uk> 18 Updated for 2.5.x by Alan Cox <alan@lxorguk.ukuu.org.uk>
19 19
20======================================================================*/ 20======================================================================*/
@@ -69,31 +69,54 @@
69/* The top five bits written to EL3_CMD are a command, the lower 69/* The top five bits written to EL3_CMD are a command, the lower
70 11 bits are the parameter, if applicable. */ 70 11 bits are the parameter, if applicable. */
71enum c509cmd { 71enum c509cmd {
72 TotalReset = 0<<11, SelectWindow = 1<<11, StartCoax = 2<<11, 72 TotalReset = 0<<11,
73 RxDisable = 3<<11, RxEnable = 4<<11, RxReset = 5<<11, RxDiscard = 8<<11, 73 SelectWindow = 1<<11,
74 TxEnable = 9<<11, TxDisable = 10<<11, TxReset = 11<<11, 74 StartCoax = 2<<11,
75 FakeIntr = 12<<11, AckIntr = 13<<11, SetIntrEnb = 14<<11, 75 RxDisable = 3<<11,
76 SetStatusEnb = 15<<11, SetRxFilter = 16<<11, SetRxThreshold = 17<<11, 76 RxEnable = 4<<11,
77 SetTxThreshold = 18<<11, SetTxStart = 19<<11, StatsEnable = 21<<11, 77 RxReset = 5<<11,
78 StatsDisable = 22<<11, StopCoax = 23<<11, 78 RxDiscard = 8<<11,
79 TxEnable = 9<<11,
80 TxDisable = 10<<11,
81 TxReset = 11<<11,
82 FakeIntr = 12<<11,
83 AckIntr = 13<<11,
84 SetIntrEnb = 14<<11,
85 SetStatusEnb = 15<<11,
86 SetRxFilter = 16<<11,
87 SetRxThreshold = 17<<11,
88 SetTxThreshold = 18<<11,
89 SetTxStart = 19<<11,
90 StatsEnable = 21<<11,
91 StatsDisable = 22<<11,
92 StopCoax = 23<<11
79}; 93};
80 94
81enum c509status { 95enum c509status {
82 IntLatch = 0x0001, AdapterFailure = 0x0002, TxComplete = 0x0004, 96 IntLatch = 0x0001,
83 TxAvailable = 0x0008, RxComplete = 0x0010, RxEarly = 0x0020, 97 AdapterFailure = 0x0002,
84 IntReq = 0x0040, StatsFull = 0x0080, CmdBusy = 0x1000 98 TxComplete = 0x0004,
99 TxAvailable = 0x0008,
100 RxComplete = 0x0010,
101 RxEarly = 0x0020,
102 IntReq = 0x0040,
103 StatsFull = 0x0080,
104 CmdBusy = 0x1000
85}; 105};
86 106
87/* The SetRxFilter command accepts the following classes: */ 107/* The SetRxFilter command accepts the following classes: */
88enum RxFilter { 108enum RxFilter {
89 RxStation = 1, RxMulticast = 2, RxBroadcast = 4, RxProm = 8 109 RxStation = 1,
110 RxMulticast = 2,
111 RxBroadcast = 4,
112 RxProm = 8
90}; 113};
91 114
92/* Register window 1 offsets, the window used in normal operation. */ 115/* Register window 1 offsets, the window used in normal operation. */
93#define TX_FIFO 0x00 116#define TX_FIFO 0x00
94#define RX_FIFO 0x00 117#define RX_FIFO 0x00
95#define RX_STATUS 0x08 118#define RX_STATUS 0x08
96#define TX_STATUS 0x0B 119#define TX_STATUS 0x0B
97#define TX_FREE 0x0C /* Remaining free bytes in Tx buffer. */ 120#define TX_FREE 0x0C /* Remaining free bytes in Tx buffer. */
98 121
99#define WN0_IRQ 0x08 /* Window 0: Set IRQ line in bits 12-15. */ 122#define WN0_IRQ 0x08 /* Window 0: Set IRQ line in bits 12-15. */
@@ -106,12 +129,12 @@ enum RxFilter {
106 129
107struct el3_private { 130struct el3_private {
108 struct pcmcia_device *p_dev; 131 struct pcmcia_device *p_dev;
109 /* For transceiver monitoring */ 132 /* For transceiver monitoring */
110 struct timer_list media; 133 struct timer_list media;
111 u16 media_status; 134 u16 media_status;
112 u16 fast_poll; 135 u16 fast_poll;
113 unsigned long last_irq; 136 unsigned long last_irq;
114 spinlock_t lock; 137 spinlock_t lock;
115}; 138};
116 139
117static const char *if_names[] = { "auto", "10baseT", "10base2", "AUI" }; 140static const char *if_names[] = { "auto", "10baseT", "10base2", "AUI" };
@@ -163,15 +186,15 @@ static void tc589_detach(struct pcmcia_device *p_dev);
163======================================================================*/ 186======================================================================*/
164 187
165static const struct net_device_ops el3_netdev_ops = { 188static const struct net_device_ops el3_netdev_ops = {
166 .ndo_open = el3_open, 189 .ndo_open = el3_open,
167 .ndo_stop = el3_close, 190 .ndo_stop = el3_close,
168 .ndo_start_xmit = el3_start_xmit, 191 .ndo_start_xmit = el3_start_xmit,
169 .ndo_tx_timeout = el3_tx_timeout, 192 .ndo_tx_timeout = el3_tx_timeout,
170 .ndo_set_config = el3_config, 193 .ndo_set_config = el3_config,
171 .ndo_get_stats = el3_get_stats, 194 .ndo_get_stats = el3_get_stats,
172 .ndo_set_multicast_list = set_multicast_list, 195 .ndo_set_multicast_list = set_multicast_list,
173 .ndo_change_mtu = eth_change_mtu, 196 .ndo_change_mtu = eth_change_mtu,
174 .ndo_set_mac_address = eth_mac_addr, 197 .ndo_set_mac_address = eth_mac_addr,
175 .ndo_validate_addr = eth_validate_addr, 198 .ndo_validate_addr = eth_validate_addr,
176}; 199};
177 200
@@ -233,7 +256,7 @@ static void tc589_detach(struct pcmcia_device *link)
233 tc589_config() is scheduled to run after a CARD_INSERTION event 256 tc589_config() is scheduled to run after a CARD_INSERTION event
234 is received, to configure the PCMCIA socket, and to make the 257 is received, to configure the PCMCIA socket, and to make the
235 ethernet device available to the system. 258 ethernet device available to the system.
236 259
237======================================================================*/ 260======================================================================*/
238 261
239static int tc589_config(struct pcmcia_device *link) 262static int tc589_config(struct pcmcia_device *link)
@@ -245,7 +268,7 @@ static int tc589_config(struct pcmcia_device *link)
245 char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"}; 268 char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"};
246 u8 *buf; 269 u8 *buf;
247 size_t len; 270 size_t len;
248 271
249 dev_dbg(&link->dev, "3c589_config\n"); 272 dev_dbg(&link->dev, "3c589_config\n");
250 273
251 phys_addr = (__be16 *)dev->dev_addr; 274 phys_addr = (__be16 *)dev->dev_addr;
@@ -274,7 +297,7 @@ static int tc589_config(struct pcmcia_device *link)
274 ret = pcmcia_request_configuration(link, &link->conf); 297 ret = pcmcia_request_configuration(link, &link->conf);
275 if (ret) 298 if (ret)
276 goto failed; 299 goto failed;
277 300
278 dev->irq = link->irq; 301 dev->irq = link->irq;
279 dev->base_addr = link->io.BasePort1; 302 dev->base_addr = link->io.BasePort1;
280 ioaddr = dev->base_addr; 303 ioaddr = dev->base_addr;
@@ -308,7 +331,7 @@ static int tc589_config(struct pcmcia_device *link)
308 dev->if_port = if_port; 331 dev->if_port = if_port;
309 else 332 else
310 printk(KERN_ERR "3c589_cs: invalid if_port requested\n"); 333 printk(KERN_ERR "3c589_cs: invalid if_port requested\n");
311 334
312 SET_NETDEV_DEV(dev, &link->dev); 335 SET_NETDEV_DEV(dev, &link->dev);
313 336
314 if (register_netdev(dev) != 0) { 337 if (register_netdev(dev) != 0) {
@@ -316,13 +339,12 @@ static int tc589_config(struct pcmcia_device *link)
316 goto failed; 339 goto failed;
317 } 340 }
318 341
319 printk(KERN_INFO "%s: 3Com 3c%s, io %#3lx, irq %d, " 342 netdev_info(dev, "3Com 3c%s, io %#3lx, irq %d, hw_addr %pM\n",
320 "hw_addr %pM\n", 343 (multi ? "562" : "589"), dev->base_addr, dev->irq,
321 dev->name, (multi ? "562" : "589"), dev->base_addr, dev->irq, 344 dev->dev_addr);
322 dev->dev_addr); 345 netdev_info(dev, " %dK FIFO split %s Rx:Tx, %s xcvr\n",
323 printk(KERN_INFO " %dK FIFO split %s Rx:Tx, %s xcvr\n", 346 (fifo & 7) ? 32 : 8, ram_split[(fifo >> 16) & 3],
324 (fifo & 7) ? 32 : 8, ram_split[(fifo >> 16) & 3], 347 if_names[dev->if_port]);
325 if_names[dev->if_port]);
326 return 0; 348 return 0;
327 349
328failed: 350failed:
@@ -335,7 +357,7 @@ failed:
335 After a card is removed, tc589_release() will unregister the net 357 After a card is removed, tc589_release() will unregister the net
336 device, and release the PCMCIA configuration. If the device is 358 device, and release the PCMCIA configuration. If the device is
337 still open, this will be postponed until it is closed. 359 still open, this will be postponed until it is closed.
338 360
339======================================================================*/ 361======================================================================*/
340 362
341static void tc589_release(struct pcmcia_device *link) 363static void tc589_release(struct pcmcia_device *link)
@@ -357,7 +379,7 @@ static int tc589_resume(struct pcmcia_device *link)
357{ 379{
358 struct net_device *dev = link->priv; 380 struct net_device *dev = link->priv;
359 381
360 if (link->open) { 382 if (link->open) {
361 tc589_reset(dev); 383 tc589_reset(dev);
362 netif_device_attach(dev); 384 netif_device_attach(dev);
363 } 385 }
@@ -377,8 +399,7 @@ static void tc589_wait_for_completion(struct net_device *dev, int cmd)
377 while (--i > 0) 399 while (--i > 0)
378 if (!(inw(dev->base_addr + EL3_STATUS) & 0x1000)) break; 400 if (!(inw(dev->base_addr + EL3_STATUS) & 0x1000)) break;
379 if (i == 0) 401 if (i == 0)
380 printk(KERN_WARNING "%s: command 0x%04x did not complete!\n", 402 netdev_warn(dev, "command 0x%04x did not complete!\n", cmd);
381 dev->name, cmd);
382} 403}
383 404
384/* 405/*
@@ -404,7 +425,7 @@ static void tc589_set_xcvr(struct net_device *dev, int if_port)
404{ 425{
405 struct el3_private *lp = netdev_priv(dev); 426 struct el3_private *lp = netdev_priv(dev);
406 unsigned int ioaddr = dev->base_addr; 427 unsigned int ioaddr = dev->base_addr;
407 428
408 EL3WINDOW(0); 429 EL3WINDOW(0);
409 switch (if_port) { 430 switch (if_port) {
410 case 0: case 1: outw(0, ioaddr + 6); break; 431 case 0: case 1: outw(0, ioaddr + 6); break;
@@ -427,14 +448,13 @@ static void dump_status(struct net_device *dev)
427{ 448{
428 unsigned int ioaddr = dev->base_addr; 449 unsigned int ioaddr = dev->base_addr;
429 EL3WINDOW(1); 450 EL3WINDOW(1);
430 printk(KERN_INFO " irq status %04x, rx status %04x, tx status " 451 netdev_info(dev, " irq status %04x, rx status %04x, tx status %02x tx free %04x\n",
431 "%02x tx free %04x\n", inw(ioaddr+EL3_STATUS), 452 inw(ioaddr+EL3_STATUS), inw(ioaddr+RX_STATUS),
432 inw(ioaddr+RX_STATUS), inb(ioaddr+TX_STATUS), 453 inb(ioaddr+TX_STATUS), inw(ioaddr+TX_FREE));
433 inw(ioaddr+TX_FREE));
434 EL3WINDOW(4); 454 EL3WINDOW(4);
435 printk(KERN_INFO " diagnostics: fifo %04x net %04x ethernet %04x" 455 netdev_info(dev, " diagnostics: fifo %04x net %04x ethernet %04x media %04x\n",
436 " media %04x\n", inw(ioaddr+0x04), inw(ioaddr+0x06), 456 inw(ioaddr+0x04), inw(ioaddr+0x06), inw(ioaddr+0x08),
437 inw(ioaddr+0x08), inw(ioaddr+0x0a)); 457 inw(ioaddr+0x0a));
438 EL3WINDOW(1); 458 EL3WINDOW(1);
439} 459}
440 460
@@ -443,18 +463,18 @@ static void tc589_reset(struct net_device *dev)
443{ 463{
444 unsigned int ioaddr = dev->base_addr; 464 unsigned int ioaddr = dev->base_addr;
445 int i; 465 int i;
446 466
447 EL3WINDOW(0); 467 EL3WINDOW(0);
448 outw(0x0001, ioaddr + 4); /* Activate board. */ 468 outw(0x0001, ioaddr + 4); /* Activate board. */
449 outw(0x3f00, ioaddr + 8); /* Set the IRQ line. */ 469 outw(0x3f00, ioaddr + 8); /* Set the IRQ line. */
450 470
451 /* Set the station address in window 2. */ 471 /* Set the station address in window 2. */
452 EL3WINDOW(2); 472 EL3WINDOW(2);
453 for (i = 0; i < 6; i++) 473 for (i = 0; i < 6; i++)
454 outb(dev->dev_addr[i], ioaddr + i); 474 outb(dev->dev_addr[i], ioaddr + i);
455 475
456 tc589_set_xcvr(dev, dev->if_port); 476 tc589_set_xcvr(dev, dev->if_port);
457 477
458 /* Switch to the stats window, and clear all stats by reading. */ 478 /* Switch to the stats window, and clear all stats by reading. */
459 outw(StatsDisable, ioaddr + EL3_CMD); 479 outw(StatsDisable, ioaddr + EL3_CMD);
460 EL3WINDOW(6); 480 EL3WINDOW(6);
@@ -462,7 +482,7 @@ static void tc589_reset(struct net_device *dev)
462 inb(ioaddr+i); 482 inb(ioaddr+i);
463 inw(ioaddr + 10); 483 inw(ioaddr + 10);
464 inw(ioaddr + 12); 484 inw(ioaddr + 12);
465 485
466 /* Switch to register set 1 for normal use. */ 486 /* Switch to register set 1 for normal use. */
467 EL3WINDOW(1); 487 EL3WINDOW(1);
468 488
@@ -496,8 +516,7 @@ static int el3_config(struct net_device *dev, struct ifmap *map)
496 if ((map->port != (u_char)(-1)) && (map->port != dev->if_port)) { 516 if ((map->port != (u_char)(-1)) && (map->port != dev->if_port)) {
497 if (map->port <= 3) { 517 if (map->port <= 3) {
498 dev->if_port = map->port; 518 dev->if_port = map->port;
499 printk(KERN_INFO "%s: switched to %s port\n", 519 netdev_info(dev, "switched to %s port\n", if_names[dev->if_port]);
500 dev->name, if_names[dev->if_port]);
501 tc589_set_xcvr(dev, dev->if_port); 520 tc589_set_xcvr(dev, dev->if_port);
502 } else 521 } else
503 return -EINVAL; 522 return -EINVAL;
@@ -509,13 +528,13 @@ static int el3_open(struct net_device *dev)
509{ 528{
510 struct el3_private *lp = netdev_priv(dev); 529 struct el3_private *lp = netdev_priv(dev);
511 struct pcmcia_device *link = lp->p_dev; 530 struct pcmcia_device *link = lp->p_dev;
512 531
513 if (!pcmcia_dev_present(link)) 532 if (!pcmcia_dev_present(link))
514 return -ENODEV; 533 return -ENODEV;
515 534
516 link->open++; 535 link->open++;
517 netif_start_queue(dev); 536 netif_start_queue(dev);
518 537
519 tc589_reset(dev); 538 tc589_reset(dev);
520 init_timer(&lp->media); 539 init_timer(&lp->media);
521 lp->media.function = &media_check; 540 lp->media.function = &media_check;
@@ -525,18 +544,18 @@ static int el3_open(struct net_device *dev)
525 544
526 dev_dbg(&link->dev, "%s: opened, status %4.4x.\n", 545 dev_dbg(&link->dev, "%s: opened, status %4.4x.\n",
527 dev->name, inw(dev->base_addr + EL3_STATUS)); 546 dev->name, inw(dev->base_addr + EL3_STATUS));
528 547
529 return 0; 548 return 0;
530} 549}
531 550
532static void el3_tx_timeout(struct net_device *dev) 551static void el3_tx_timeout(struct net_device *dev)
533{ 552{
534 unsigned int ioaddr = dev->base_addr; 553 unsigned int ioaddr = dev->base_addr;
535 554
536 printk(KERN_WARNING "%s: Transmit timed out!\n", dev->name); 555 netdev_warn(dev, "Transmit timed out!\n");
537 dump_status(dev); 556 dump_status(dev);
538 dev->stats.tx_errors++; 557 dev->stats.tx_errors++;
539 dev->trans_start = jiffies; 558 dev->trans_start = jiffies; /* prevent tx timeout */
540 /* Issue TX_RESET and TX_START commands. */ 559 /* Issue TX_RESET and TX_START commands. */
541 tc589_wait_for_completion(dev, TxReset); 560 tc589_wait_for_completion(dev, TxReset);
542 outw(TxEnable, ioaddr + EL3_CMD); 561 outw(TxEnable, ioaddr + EL3_CMD);
@@ -547,19 +566,18 @@ static void pop_tx_status(struct net_device *dev)
547{ 566{
548 unsigned int ioaddr = dev->base_addr; 567 unsigned int ioaddr = dev->base_addr;
549 int i; 568 int i;
550 569
551 /* Clear the Tx status stack. */ 570 /* Clear the Tx status stack. */
552 for (i = 32; i > 0; i--) { 571 for (i = 32; i > 0; i--) {
553 u_char tx_status = inb(ioaddr + TX_STATUS); 572 u_char tx_status = inb(ioaddr + TX_STATUS);
554 if (!(tx_status & 0x84)) break; 573 if (!(tx_status & 0x84)) break;
555 /* reset transmitter on jabber error or underrun */ 574 /* reset transmitter on jabber error or underrun */
556 if (tx_status & 0x30) 575 if (tx_status & 0x30)
557 tc589_wait_for_completion(dev, TxReset); 576 tc589_wait_for_completion(dev, TxReset);
558 if (tx_status & 0x38) { 577 if (tx_status & 0x38) {
559 pr_debug("%s: transmit error: status 0x%02x\n", 578 netdev_dbg(dev, "transmit error: status 0x%02x\n", tx_status);
560 dev->name, tx_status); 579 outw(TxEnable, ioaddr + EL3_CMD);
561 outw(TxEnable, ioaddr + EL3_CMD); 580 dev->stats.tx_aborted_errors++;
562 dev->stats.tx_aborted_errors++;
563 } 581 }
564 outb(0x00, ioaddr + TX_STATUS); /* Pop the status stack. */ 582 outb(0x00, ioaddr + TX_STATUS); /* Pop the status stack. */
565 } 583 }
@@ -572,11 +590,10 @@ static netdev_tx_t el3_start_xmit(struct sk_buff *skb,
572 struct el3_private *priv = netdev_priv(dev); 590 struct el3_private *priv = netdev_priv(dev);
573 unsigned long flags; 591 unsigned long flags;
574 592
575 pr_debug("%s: el3_start_xmit(length = %ld) called, " 593 netdev_dbg(dev, "el3_start_xmit(length = %ld) called, status %4.4x.\n",
576 "status %4.4x.\n", dev->name, (long)skb->len, 594 (long)skb->len, inw(ioaddr + EL3_STATUS));
577 inw(ioaddr + EL3_STATUS));
578 595
579 spin_lock_irqsave(&priv->lock, flags); 596 spin_lock_irqsave(&priv->lock, flags);
580 597
581 dev->stats.tx_bytes += skb->len; 598 dev->stats.tx_bytes += skb->len;
582 599
@@ -586,7 +603,6 @@ static netdev_tx_t el3_start_xmit(struct sk_buff *skb,
586 /* ... and the packet rounded to a doubleword. */ 603 /* ... and the packet rounded to a doubleword. */
587 outsl(ioaddr + TX_FIFO, skb->data, (skb->len + 3) >> 2); 604 outsl(ioaddr + TX_FIFO, skb->data, (skb->len + 3) >> 2);
588 605
589 dev->trans_start = jiffies;
590 if (inw(ioaddr + TX_FREE) <= 1536) { 606 if (inw(ioaddr + TX_FREE) <= 1536) {
591 netif_stop_queue(dev); 607 netif_stop_queue(dev);
592 /* Interrupt us when the FIFO has room for max-sized packet. */ 608 /* Interrupt us when the FIFO has room for max-sized packet. */
@@ -594,9 +610,9 @@ static netdev_tx_t el3_start_xmit(struct sk_buff *skb,
594 } 610 }
595 611
596 pop_tx_status(dev); 612 pop_tx_status(dev);
597 spin_unlock_irqrestore(&priv->lock, flags); 613 spin_unlock_irqrestore(&priv->lock, flags);
598 dev_kfree_skb(skb); 614 dev_kfree_skb(skb);
599 615
600 return NETDEV_TX_OK; 616 return NETDEV_TX_OK;
601} 617}
602 618
@@ -608,37 +624,32 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id)
608 unsigned int ioaddr; 624 unsigned int ioaddr;
609 __u16 status; 625 __u16 status;
610 int i = 0, handled = 1; 626 int i = 0, handled = 1;
611 627
612 if (!netif_device_present(dev)) 628 if (!netif_device_present(dev))
613 return IRQ_NONE; 629 return IRQ_NONE;
614 630
615 ioaddr = dev->base_addr; 631 ioaddr = dev->base_addr;
616 632
617 pr_debug("%s: interrupt, status %4.4x.\n", 633 netdev_dbg(dev, "interrupt, status %4.4x.\n", inw(ioaddr + EL3_STATUS));
618 dev->name, inw(ioaddr + EL3_STATUS));
619 634
620 spin_lock(&lp->lock); 635 spin_lock(&lp->lock);
621 while ((status = inw(ioaddr + EL3_STATUS)) & 636 while ((status = inw(ioaddr + EL3_STATUS)) &
622 (IntLatch | RxComplete | StatsFull)) { 637 (IntLatch | RxComplete | StatsFull)) {
623 if ((status & 0xe000) != 0x2000) { 638 if ((status & 0xe000) != 0x2000) {
624 pr_debug("%s: interrupt from dead card\n", dev->name); 639 netdev_dbg(dev, "interrupt from dead card\n");
625 handled = 0; 640 handled = 0;
626 break; 641 break;
627 } 642 }
628
629 if (status & RxComplete) 643 if (status & RxComplete)
630 el3_rx(dev); 644 el3_rx(dev);
631
632 if (status & TxAvailable) { 645 if (status & TxAvailable) {
633 pr_debug(" TX room bit was handled.\n"); 646 netdev_dbg(dev, " TX room bit was handled.\n");
634 /* There's room in the FIFO for a full-sized packet. */ 647 /* There's room in the FIFO for a full-sized packet. */
635 outw(AckIntr | TxAvailable, ioaddr + EL3_CMD); 648 outw(AckIntr | TxAvailable, ioaddr + EL3_CMD);
636 netif_wake_queue(dev); 649 netif_wake_queue(dev);
637 } 650 }
638
639 if (status & TxComplete) 651 if (status & TxComplete)
640 pop_tx_status(dev); 652 pop_tx_status(dev);
641
642 if (status & (AdapterFailure | RxEarly | StatsFull)) { 653 if (status & (AdapterFailure | RxEarly | StatsFull)) {
643 /* Handle all uncommon interrupts. */ 654 /* Handle all uncommon interrupts. */
644 if (status & StatsFull) /* Empty statistics. */ 655 if (status & StatsFull) /* Empty statistics. */
@@ -652,8 +663,8 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id)
652 EL3WINDOW(4); 663 EL3WINDOW(4);
653 fifo_diag = inw(ioaddr + 4); 664 fifo_diag = inw(ioaddr + 4);
654 EL3WINDOW(1); 665 EL3WINDOW(1);
655 printk(KERN_WARNING "%s: adapter failure, FIFO diagnostic" 666 netdev_warn(dev, "adapter failure, FIFO diagnostic register %04x.\n",
656 " register %04x.\n", dev->name, fifo_diag); 667 fifo_diag);
657 if (fifo_diag & 0x0400) { 668 if (fifo_diag & 0x0400) {
658 /* Tx overrun */ 669 /* Tx overrun */
659 tc589_wait_for_completion(dev, TxReset); 670 tc589_wait_for_completion(dev, TxReset);
@@ -668,22 +679,20 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id)
668 outw(AckIntr | AdapterFailure, ioaddr + EL3_CMD); 679 outw(AckIntr | AdapterFailure, ioaddr + EL3_CMD);
669 } 680 }
670 } 681 }
671
672 if (++i > 10) { 682 if (++i > 10) {
673 printk(KERN_ERR "%s: infinite loop in interrupt, " 683 netdev_err(dev, "infinite loop in interrupt, status %4.4x.\n",
674 "status %4.4x.\n", dev->name, status); 684 status);
675 /* Clear all interrupts */ 685 /* Clear all interrupts */
676 outw(AckIntr | 0xFF, ioaddr + EL3_CMD); 686 outw(AckIntr | 0xFF, ioaddr + EL3_CMD);
677 break; 687 break;
678 } 688 }
679 /* Acknowledge the IRQ. */ 689 /* Acknowledge the IRQ. */
680 outw(AckIntr | IntReq | IntLatch, ioaddr + EL3_CMD); 690 outw(AckIntr | IntReq | IntLatch, ioaddr + EL3_CMD);
681 } 691 }
682
683 lp->last_irq = jiffies; 692 lp->last_irq = jiffies;
684 spin_unlock(&lp->lock); 693 spin_unlock(&lp->lock);
685 pr_debug("%s: exiting interrupt, status %4.4x.\n", 694 netdev_dbg(dev, "exiting interrupt, status %4.4x.\n",
686 dev->name, inw(ioaddr + EL3_STATUS)); 695 inw(ioaddr + EL3_STATUS));
687 return IRQ_RETVAL(handled); 696 return IRQ_RETVAL(handled);
688} 697}
689 698
@@ -702,7 +711,7 @@ static void media_check(unsigned long arg)
702 if ((inw(ioaddr + EL3_STATUS) & IntLatch) && 711 if ((inw(ioaddr + EL3_STATUS) & IntLatch) &&
703 (inb(ioaddr + EL3_TIMER) == 0xff)) { 712 (inb(ioaddr + EL3_TIMER) == 0xff)) {
704 if (!lp->fast_poll) 713 if (!lp->fast_poll)
705 printk(KERN_WARNING "%s: interrupt(s) dropped!\n", dev->name); 714 netdev_warn(dev, "interrupt(s) dropped!\n");
706 715
707 local_irq_save(flags); 716 local_irq_save(flags);
708 el3_interrupt(dev->irq, dev); 717 el3_interrupt(dev->irq, dev);
@@ -719,7 +728,7 @@ static void media_check(unsigned long arg)
719 728
720 /* lp->lock guards the EL3 window. Window should always be 1 except 729 /* lp->lock guards the EL3 window. Window should always be 1 except
721 when the lock is held */ 730 when the lock is held */
722 spin_lock_irqsave(&lp->lock, flags); 731 spin_lock_irqsave(&lp->lock, flags);
723 EL3WINDOW(4); 732 EL3WINDOW(4);
724 media = inw(ioaddr+WN4_MEDIA) & 0xc810; 733 media = inw(ioaddr+WN4_MEDIA) & 0xc810;
725 734
@@ -739,32 +748,30 @@ static void media_check(unsigned long arg)
739 if (media != lp->media_status) { 748 if (media != lp->media_status) {
740 if ((media & lp->media_status & 0x8000) && 749 if ((media & lp->media_status & 0x8000) &&
741 ((lp->media_status ^ media) & 0x0800)) 750 ((lp->media_status ^ media) & 0x0800))
742 printk(KERN_INFO "%s: %s link beat\n", dev->name, 751 netdev_info(dev, "%s link beat\n",
743 (lp->media_status & 0x0800 ? "lost" : "found")); 752 (lp->media_status & 0x0800 ? "lost" : "found"));
744 else if ((media & lp->media_status & 0x4000) && 753 else if ((media & lp->media_status & 0x4000) &&
745 ((lp->media_status ^ media) & 0x0010)) 754 ((lp->media_status ^ media) & 0x0010))
746 printk(KERN_INFO "%s: coax cable %s\n", dev->name, 755 netdev_info(dev, "coax cable %s\n",
747 (lp->media_status & 0x0010 ? "ok" : "problem")); 756 (lp->media_status & 0x0010 ? "ok" : "problem"));
748 if (dev->if_port == 0) { 757 if (dev->if_port == 0) {
749 if (media & 0x8000) { 758 if (media & 0x8000) {
750 if (media & 0x0800) 759 if (media & 0x0800)
751 printk(KERN_INFO "%s: flipped to 10baseT\n", 760 netdev_info(dev, "flipped to 10baseT\n");
752 dev->name);
753 else 761 else
754 tc589_set_xcvr(dev, 2); 762 tc589_set_xcvr(dev, 2);
755 } else if (media & 0x4000) { 763 } else if (media & 0x4000) {
756 if (media & 0x0010) 764 if (media & 0x0010)
757 tc589_set_xcvr(dev, 1); 765 tc589_set_xcvr(dev, 1);
758 else 766 else
759 printk(KERN_INFO "%s: flipped to 10base2\n", 767 netdev_info(dev, "flipped to 10base2\n");
760 dev->name);
761 } 768 }
762 } 769 }
763 lp->media_status = media; 770 lp->media_status = media;
764 } 771 }
765 772
766 EL3WINDOW(1); 773 EL3WINDOW(1);
767 spin_unlock_irqrestore(&lp->lock, flags); 774 spin_unlock_irqrestore(&lp->lock, flags);
768 775
769reschedule: 776reschedule:
770 lp->media.expires = jiffies + HZ; 777 lp->media.expires = jiffies + HZ;
@@ -778,7 +785,7 @@ static struct net_device_stats *el3_get_stats(struct net_device *dev)
778 struct pcmcia_device *link = lp->p_dev; 785 struct pcmcia_device *link = lp->p_dev;
779 786
780 if (pcmcia_dev_present(link)) { 787 if (pcmcia_dev_present(link)) {
781 spin_lock_irqsave(&lp->lock, flags); 788 spin_lock_irqsave(&lp->lock, flags);
782 update_stats(dev); 789 update_stats(dev);
783 spin_unlock_irqrestore(&lp->lock, flags); 790 spin_unlock_irqrestore(&lp->lock, flags);
784 } 791 }
@@ -790,21 +797,21 @@ static struct net_device_stats *el3_get_stats(struct net_device *dev)
790 single-threaded if the device is active. This is expected to be a rare 797 single-threaded if the device is active. This is expected to be a rare
791 operation, and it's simpler for the rest of the driver to assume that 798 operation, and it's simpler for the rest of the driver to assume that
792 window 1 is always valid rather than use a special window-state variable. 799 window 1 is always valid rather than use a special window-state variable.
793 800
794 Caller must hold the lock for this 801 Caller must hold the lock for this
795*/ 802*/
796static void update_stats(struct net_device *dev) 803static void update_stats(struct net_device *dev)
797{ 804{
798 unsigned int ioaddr = dev->base_addr; 805 unsigned int ioaddr = dev->base_addr;
799 806
800 pr_debug("%s: updating the statistics.\n", dev->name); 807 netdev_dbg(dev, "updating the statistics.\n");
801 /* Turn off statistics updates while reading. */ 808 /* Turn off statistics updates while reading. */
802 outw(StatsDisable, ioaddr + EL3_CMD); 809 outw(StatsDisable, ioaddr + EL3_CMD);
803 /* Switch to the stats window, and read everything. */ 810 /* Switch to the stats window, and read everything. */
804 EL3WINDOW(6); 811 EL3WINDOW(6);
805 dev->stats.tx_carrier_errors += inb(ioaddr + 0); 812 dev->stats.tx_carrier_errors += inb(ioaddr + 0);
806 dev->stats.tx_heartbeat_errors += inb(ioaddr + 1); 813 dev->stats.tx_heartbeat_errors += inb(ioaddr + 1);
807 /* Multiple collisions. */ inb(ioaddr + 2); 814 /* Multiple collisions. */ inb(ioaddr + 2);
808 dev->stats.collisions += inb(ioaddr + 3); 815 dev->stats.collisions += inb(ioaddr + 3);
809 dev->stats.tx_window_errors += inb(ioaddr + 4); 816 dev->stats.tx_window_errors += inb(ioaddr + 4);
810 dev->stats.rx_fifo_errors += inb(ioaddr + 5); 817 dev->stats.rx_fifo_errors += inb(ioaddr + 5);
@@ -813,7 +820,7 @@ static void update_stats(struct net_device *dev)
813 /* Tx deferrals */ inb(ioaddr + 8); 820 /* Tx deferrals */ inb(ioaddr + 8);
814 /* Rx octets */ inw(ioaddr + 10); 821 /* Rx octets */ inw(ioaddr + 10);
815 /* Tx octets */ inw(ioaddr + 12); 822 /* Tx octets */ inw(ioaddr + 12);
816 823
817 /* Back to window 1, and turn statistics back on. */ 824 /* Back to window 1, and turn statistics back on. */
818 EL3WINDOW(1); 825 EL3WINDOW(1);
819 outw(StatsEnable, ioaddr + EL3_CMD); 826 outw(StatsEnable, ioaddr + EL3_CMD);
@@ -824,9 +831,9 @@ static int el3_rx(struct net_device *dev)
824 unsigned int ioaddr = dev->base_addr; 831 unsigned int ioaddr = dev->base_addr;
825 int worklimit = 32; 832 int worklimit = 32;
826 short rx_status; 833 short rx_status;
827 834
828 pr_debug("%s: in rx_packet(), status %4.4x, rx_status %4.4x.\n", 835 netdev_dbg(dev, "in rx_packet(), status %4.4x, rx_status %4.4x.\n",
829 dev->name, inw(ioaddr+EL3_STATUS), inw(ioaddr+RX_STATUS)); 836 inw(ioaddr+EL3_STATUS), inw(ioaddr+RX_STATUS));
830 while (!((rx_status = inw(ioaddr + RX_STATUS)) & 0x8000) && 837 while (!((rx_status = inw(ioaddr + RX_STATUS)) & 0x8000) &&
831 worklimit > 0) { 838 worklimit > 0) {
832 worklimit--; 839 worklimit--;
@@ -844,11 +851,11 @@ static int el3_rx(struct net_device *dev)
844 } else { 851 } else {
845 short pkt_len = rx_status & 0x7ff; 852 short pkt_len = rx_status & 0x7ff;
846 struct sk_buff *skb; 853 struct sk_buff *skb;
847 854
848 skb = dev_alloc_skb(pkt_len+5); 855 skb = dev_alloc_skb(pkt_len+5);
849 856
850 pr_debug(" Receiving packet size %d status %4.4x.\n", 857 netdev_dbg(dev, " Receiving packet size %d status %4.4x.\n",
851 pkt_len, rx_status); 858 pkt_len, rx_status);
852 if (skb != NULL) { 859 if (skb != NULL) {
853 skb_reserve(skb, 2); 860 skb_reserve(skb, 2);
854 insl(ioaddr+RX_FIFO, skb_put(skb, pkt_len), 861 insl(ioaddr+RX_FIFO, skb_put(skb, pkt_len),
@@ -858,8 +865,8 @@ static int el3_rx(struct net_device *dev)
858 dev->stats.rx_packets++; 865 dev->stats.rx_packets++;
859 dev->stats.rx_bytes += pkt_len; 866 dev->stats.rx_bytes += pkt_len;
860 } else { 867 } else {
861 pr_debug("%s: couldn't allocate a sk_buff of" 868 netdev_dbg(dev, "couldn't allocate a sk_buff of size %d.\n",
862 " size %d.\n", dev->name, pkt_len); 869 pkt_len);
863 dev->stats.rx_dropped++; 870 dev->stats.rx_dropped++;
864 } 871 }
865 } 872 }
@@ -867,7 +874,7 @@ static int el3_rx(struct net_device *dev)
867 tc589_wait_for_completion(dev, RxDiscard); 874 tc589_wait_for_completion(dev, RxDiscard);
868 } 875 }
869 if (worklimit == 0) 876 if (worklimit == 0)
870 printk(KERN_WARNING "%s: too much work in el3_rx!\n", dev->name); 877 netdev_warn(dev, "too much work in el3_rx!\n");
871 return 0; 878 return 0;
872} 879}
873 880
@@ -898,17 +905,17 @@ static int el3_close(struct net_device *dev)
898 struct el3_private *lp = netdev_priv(dev); 905 struct el3_private *lp = netdev_priv(dev);
899 struct pcmcia_device *link = lp->p_dev; 906 struct pcmcia_device *link = lp->p_dev;
900 unsigned int ioaddr = dev->base_addr; 907 unsigned int ioaddr = dev->base_addr;
901 908
902 dev_dbg(&link->dev, "%s: shutting down ethercard.\n", dev->name); 909 dev_dbg(&link->dev, "%s: shutting down ethercard.\n", dev->name);
903 910
904 if (pcmcia_dev_present(link)) { 911 if (pcmcia_dev_present(link)) {
905 /* Turn off statistics ASAP. We update dev->stats below. */ 912 /* Turn off statistics ASAP. We update dev->stats below. */
906 outw(StatsDisable, ioaddr + EL3_CMD); 913 outw(StatsDisable, ioaddr + EL3_CMD);
907 914
908 /* Disable the receiver and transmitter. */ 915 /* Disable the receiver and transmitter. */
909 outw(RxDisable, ioaddr + EL3_CMD); 916 outw(RxDisable, ioaddr + EL3_CMD);
910 outw(TxDisable, ioaddr + EL3_CMD); 917 outw(TxDisable, ioaddr + EL3_CMD);
911 918
912 if (dev->if_port == 2) 919 if (dev->if_port == 2)
913 /* Turn off thinnet power. Green! */ 920 /* Turn off thinnet power. Green! */
914 outw(StopCoax, ioaddr + EL3_CMD); 921 outw(StopCoax, ioaddr + EL3_CMD);
@@ -917,12 +924,12 @@ static int el3_close(struct net_device *dev)
917 EL3WINDOW(4); 924 EL3WINDOW(4);
918 outw(0, ioaddr + WN4_MEDIA); 925 outw(0, ioaddr + WN4_MEDIA);
919 } 926 }
920 927
921 /* Switching back to window 0 disables the IRQ. */ 928 /* Switching back to window 0 disables the IRQ. */
922 EL3WINDOW(0); 929 EL3WINDOW(0);
923 /* But we explicitly zero the IRQ line select anyway. */ 930 /* But we explicitly zero the IRQ line select anyway. */
924 outw(0x0f00, ioaddr + WN0_IRQ); 931 outw(0x0f00, ioaddr + WN0_IRQ);
925 932
926 /* Check if the card still exists */ 933 /* Check if the card still exists */
927 if ((inw(ioaddr+EL3_STATUS) & 0xe000) == 0x2000) 934 if ((inw(ioaddr+EL3_STATUS) & 0xe000) == 0x2000)
928 update_stats(dev); 935 update_stats(dev);
@@ -931,7 +938,7 @@ static int el3_close(struct net_device *dev)
931 link->open--; 938 link->open--;
932 netif_stop_queue(dev); 939 netif_stop_queue(dev);
933 del_timer_sync(&lp->media); 940 del_timer_sync(&lp->media);
934 941
935 return 0; 942 return 0;
936} 943}
937 944
@@ -953,7 +960,7 @@ static struct pcmcia_driver tc589_driver = {
953 }, 960 },
954 .probe = tc589_probe, 961 .probe = tc589_probe,
955 .remove = tc589_detach, 962 .remove = tc589_detach,
956 .id_table = tc589_ids, 963 .id_table = tc589_ids,
957 .suspend = tc589_suspend, 964 .suspend = tc589_suspend,
958 .resume = tc589_resume, 965 .resume = tc589_resume,
959}; 966};
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index 59f6fa3c9ddc..5b3dfb4ab279 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -994,7 +994,7 @@ static void axnet_tx_timeout(struct net_device *dev)
994{ 994{
995 long e8390_base = dev->base_addr; 995 long e8390_base = dev->base_addr;
996 struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev); 996 struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
997 int txsr, isr, tickssofar = jiffies - dev->trans_start; 997 int txsr, isr, tickssofar = jiffies - dev_trans_start(dev);
998 unsigned long flags; 998 unsigned long flags;
999 999
1000 dev->stats.tx_errors++; 1000 dev->stats.tx_errors++;
@@ -1499,8 +1499,6 @@ static void ei_receive(struct net_device *dev)
1499 ei_local->current_page = next_frame; 1499 ei_local->current_page = next_frame;
1500 outb_p(next_frame-1, e8390_base+EN0_BOUNDARY); 1500 outb_p(next_frame-1, e8390_base+EN0_BOUNDARY);
1501 } 1501 }
1502
1503 return;
1504} 1502}
1505 1503
1506/** 1504/**
@@ -1611,11 +1609,11 @@ static struct net_device_stats *get_stats(struct net_device *dev)
1611 1609
1612static inline void make_mc_bits(u8 *bits, struct net_device *dev) 1610static inline void make_mc_bits(u8 *bits, struct net_device *dev)
1613{ 1611{
1614 struct dev_mc_list *dmi; 1612 struct netdev_hw_addr *ha;
1615 u32 crc; 1613 u32 crc;
1616 1614
1617 netdev_for_each_mc_addr(dmi, dev) { 1615 netdev_for_each_mc_addr(ha, dev) {
1618 crc = ether_crc(ETH_ALEN, dmi->dmi_addr); 1616 crc = ether_crc(ETH_ALEN, ha->addr);
1619 /* 1617 /*
1620 * The 8390 uses the 6 most significant bits of the 1618 * The 8390 uses the 6 most significant bits of the
1621 * CRC to index the multicast table. 1619 * CRC to index the multicast table.
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
index 6580d78397d1..7c27c50211a5 100644
--- a/drivers/net/pcmcia/fmvj18x_cs.c
+++ b/drivers/net/pcmcia/fmvj18x_cs.c
@@ -878,7 +878,6 @@ static netdev_tx_t fjn_start_xmit(struct sk_buff *skb,
878 lp->sent = lp->tx_queue ; 878 lp->sent = lp->tx_queue ;
879 lp->tx_queue = 0; 879 lp->tx_queue = 0;
880 lp->tx_queue_len = 0; 880 lp->tx_queue_len = 0;
881 dev->trans_start = jiffies;
882 lp->tx_started = 1; 881 lp->tx_started = 1;
883 netif_start_queue(dev); 882 netif_start_queue(dev);
884 } else { 883 } else {
@@ -1070,8 +1069,6 @@ static void fjn_rx(struct net_device *dev)
1070 "%d ticks.\n", dev->name, inb(ioaddr + RX_MODE), i); 1069 "%d ticks.\n", dev->name, inb(ioaddr + RX_MODE), i);
1071 } 1070 }
1072*/ 1071*/
1073
1074 return;
1075} /* fjn_rx */ 1072} /* fjn_rx */
1076 1073
1077/*====================================================================*/ 1074/*====================================================================*/
@@ -1184,11 +1181,11 @@ static void set_rx_mode(struct net_device *dev)
1184 memset(mc_filter, 0x00, sizeof(mc_filter)); 1181 memset(mc_filter, 0x00, sizeof(mc_filter));
1185 outb(1, ioaddr + RX_MODE); /* Ignore almost all multicasts. */ 1182 outb(1, ioaddr + RX_MODE); /* Ignore almost all multicasts. */
1186 } else { 1183 } else {
1187 struct dev_mc_list *mclist; 1184 struct netdev_hw_addr *ha;
1188 1185
1189 memset(mc_filter, 0, sizeof(mc_filter)); 1186 memset(mc_filter, 0, sizeof(mc_filter));
1190 netdev_for_each_mc_addr(mclist, dev) { 1187 netdev_for_each_mc_addr(ha, dev) {
1191 unsigned int bit = ether_crc_le(ETH_ALEN, mclist->dmi_addr) >> 26; 1188 unsigned int bit = ether_crc_le(ETH_ALEN, ha->addr) >> 26;
1192 mc_filter[bit >> 3] |= (1 << (bit & 7)); 1189 mc_filter[bit >> 3] |= (1 << (bit & 7));
1193 } 1190 }
1194 outb(2, ioaddr + RX_MODE); /* Use normal mode. */ 1191 outb(2, ioaddr + RX_MODE); /* Use normal mode. */
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c
index 2e42d80f8cae..67ee9851a8ed 100644
--- a/drivers/net/pcmcia/ibmtr_cs.c
+++ b/drivers/net/pcmcia/ibmtr_cs.c
@@ -394,8 +394,6 @@ static void ibmtr_hw_setup(struct net_device *dev, u_int mmiobase)
394 394
395 /* 0x40 will release the card for use */ 395 /* 0x40 will release the card for use */
396 outb(0x40, dev->base_addr); 396 outb(0x40, dev->base_addr);
397
398 return;
399} 397}
400 398
401static struct pcmcia_device_id ibmtr_ids[] = { 399static struct pcmcia_device_id ibmtr_ids[] = {
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index d8a3b3cf246e..9b63dec549cb 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -895,7 +895,7 @@ static void mace_tx_timeout(struct net_device *dev)
895#else /* #if RESET_ON_TIMEOUT */ 895#else /* #if RESET_ON_TIMEOUT */
896 printk("NOT resetting card\n"); 896 printk("NOT resetting card\n");
897#endif /* #if RESET_ON_TIMEOUT */ 897#endif /* #if RESET_ON_TIMEOUT */
898 dev->trans_start = jiffies; 898 dev->trans_start = jiffies; /* prevent tx timeout */
899 netif_wake_queue(dev); 899 netif_wake_queue(dev);
900} 900}
901 901
@@ -937,8 +937,6 @@ static netdev_tx_t mace_start_xmit(struct sk_buff *skb,
937 outb(skb->data[skb->len-1], ioaddr + AM2150_XMT); 937 outb(skb->data[skb->len-1], ioaddr + AM2150_XMT);
938 } 938 }
939 939
940 dev->trans_start = jiffies;
941
942#if MULTI_TX 940#if MULTI_TX
943 if (lp->tx_free_frames > 0) 941 if (lp->tx_free_frames > 0)
944 netif_start_queue(dev); 942 netif_start_queue(dev);
@@ -1307,8 +1305,6 @@ static void update_stats(unsigned int ioaddr, struct net_device *dev)
1307 lp->linux_stats.tx_fifo_errors = lp->mace_stats.uflo; 1305 lp->linux_stats.tx_fifo_errors = lp->mace_stats.uflo;
1308 lp->linux_stats.tx_heartbeat_errors = lp->mace_stats.cerr; 1306 lp->linux_stats.tx_heartbeat_errors = lp->mace_stats.cerr;
1309 /* lp->linux_stats.tx_window_errors; */ 1307 /* lp->linux_stats.tx_window_errors; */
1310
1311 return;
1312} /* update_stats */ 1308} /* update_stats */
1313 1309
1314/* ---------------------------------------------------------------------------- 1310/* ----------------------------------------------------------------------------
@@ -1467,7 +1463,7 @@ static void set_multicast_list(struct net_device *dev)
1467{ 1463{
1468 mace_private *lp = netdev_priv(dev); 1464 mace_private *lp = netdev_priv(dev);
1469 int adr[ETHER_ADDR_LEN] = {0}; /* Ethernet address */ 1465 int adr[ETHER_ADDR_LEN] = {0}; /* Ethernet address */
1470 struct dev_mc_list *dmi; 1466 struct netdev_hw_addr *ha;
1471 1467
1472#ifdef PCMCIA_DEBUG 1468#ifdef PCMCIA_DEBUG
1473 { 1469 {
@@ -1487,8 +1483,8 @@ static void set_multicast_list(struct net_device *dev)
1487 if (num_addrs > 0) { 1483 if (num_addrs > 0) {
1488 /* Calculate multicast logical address filter */ 1484 /* Calculate multicast logical address filter */
1489 memset(lp->multicast_ladrf, 0, MACE_LADRF_LEN); 1485 memset(lp->multicast_ladrf, 0, MACE_LADRF_LEN);
1490 netdev_for_each_mc_addr(dmi, dev) { 1486 netdev_for_each_mc_addr(ha, dev) {
1491 memcpy(adr, dmi->dmi_addr, ETHER_ADDR_LEN); 1487 memcpy(adr, ha->addr, ETHER_ADDR_LEN);
1492 BuildLAF(lp->multicast_ladrf, adr); 1488 BuildLAF(lp->multicast_ladrf, adr);
1493 } 1489 }
1494 } 1490 }
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index 59796e7d09c4..7b6fe89f9db0 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -1228,7 +1228,6 @@ static void smc_hardware_send_packet(struct net_device * dev)
1228 dev_kfree_skb_irq(skb); 1228 dev_kfree_skb_irq(skb);
1229 dev->trans_start = jiffies; 1229 dev->trans_start = jiffies;
1230 netif_start_queue(dev); 1230 netif_start_queue(dev);
1231 return;
1232} 1231}
1233 1232
1234/*====================================================================*/ 1233/*====================================================================*/
@@ -1243,7 +1242,7 @@ static void smc_tx_timeout(struct net_device *dev)
1243 dev->name, inw(ioaddr)&0xff, inw(ioaddr + 2)); 1242 dev->name, inw(ioaddr)&0xff, inw(ioaddr + 2));
1244 dev->stats.tx_errors++; 1243 dev->stats.tx_errors++;
1245 smc_reset(dev); 1244 smc_reset(dev);
1246 dev->trans_start = jiffies; 1245 dev->trans_start = jiffies; /* prevent tx timeout */
1247 smc->saved_skb = NULL; 1246 smc->saved_skb = NULL;
1248 netif_wake_queue(dev); 1247 netif_wake_queue(dev);
1249} 1248}
@@ -1358,7 +1357,6 @@ static void smc_tx_err(struct net_device * dev)
1358 smc->packets_waiting--; 1357 smc->packets_waiting--;
1359 1358
1360 outw(saved_packet, ioaddr + PNR_ARR); 1359 outw(saved_packet, ioaddr + PNR_ARR);
1361 return;
1362} 1360}
1363 1361
1364/*====================================================================*/ 1362/*====================================================================*/
@@ -1578,8 +1576,6 @@ static void smc_rx(struct net_device *dev)
1578 } 1576 }
1579 /* Let the MMU free the memory of this packet. */ 1577 /* Let the MMU free the memory of this packet. */
1580 outw(MC_RELEASE, ioaddr + MMU_CMD); 1578 outw(MC_RELEASE, ioaddr + MMU_CMD);
1581
1582 return;
1583} 1579}
1584 1580
1585/*====================================================================== 1581/*======================================================================
@@ -1610,10 +1606,10 @@ static void set_rx_mode(struct net_device *dev)
1610 rx_cfg_setting = RxStripCRC | RxEnable | RxAllMulti; 1606 rx_cfg_setting = RxStripCRC | RxEnable | RxAllMulti;
1611 else { 1607 else {
1612 if (!netdev_mc_empty(dev)) { 1608 if (!netdev_mc_empty(dev)) {
1613 struct dev_mc_list *mc_addr; 1609 struct netdev_hw_addr *ha;
1614 1610
1615 netdev_for_each_mc_addr(mc_addr, dev) { 1611 netdev_for_each_mc_addr(ha, dev) {
1616 u_int position = ether_crc(6, mc_addr->dmi_addr); 1612 u_int position = ether_crc(6, ha->addr);
1617 multicast_table[position >> 29] |= 1 << ((position >> 26) & 7); 1613 multicast_table[position >> 29] |= 1 << ((position >> 26) & 7);
1618 } 1614 }
1619 } 1615 }
@@ -1629,8 +1625,6 @@ static void set_rx_mode(struct net_device *dev)
1629 outw(rx_cfg_setting, ioaddr + RCR); 1625 outw(rx_cfg_setting, ioaddr + RCR);
1630 SMC_SELECT_BANK(2); 1626 SMC_SELECT_BANK(2);
1631 spin_unlock_irqrestore(&smc->lock, flags); 1627 spin_unlock_irqrestore(&smc->lock, flags);
1632
1633 return;
1634} 1628}
1635 1629
1636/*====================================================================== 1630/*======================================================================
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index 5e6b62ba8887..b6c3644888cd 100644
--- a/drivers/net/pcmcia/xirc2ps_cs.c
+++ b/drivers/net/pcmcia/xirc2ps_cs.c
@@ -1265,7 +1265,7 @@ xirc2ps_tx_timeout_task(struct work_struct *work)
1265 struct net_device *dev = local->dev; 1265 struct net_device *dev = local->dev;
1266 /* reset the card */ 1266 /* reset the card */
1267 do_reset(dev,1); 1267 do_reset(dev,1);
1268 dev->trans_start = jiffies; 1268 dev->trans_start = jiffies; /* prevent tx timeout */
1269 netif_wake_queue(dev); 1269 netif_wake_queue(dev);
1270} 1270}
1271 1271
@@ -1328,7 +1328,6 @@ do_start_xmit(struct sk_buff *skb, struct net_device *dev)
1328 PutByte(XIRCREG_CR, TransmitPacket|EnableIntr); 1328 PutByte(XIRCREG_CR, TransmitPacket|EnableIntr);
1329 1329
1330 dev_kfree_skb (skb); 1330 dev_kfree_skb (skb);
1331 dev->trans_start = jiffies;
1332 dev->stats.tx_bytes += pktlen; 1331 dev->stats.tx_bytes += pktlen;
1333 netif_start_queue(dev); 1332 netif_start_queue(dev);
1334 return NETDEV_TX_OK; 1333 return NETDEV_TX_OK;
@@ -1368,7 +1367,7 @@ static void set_addresses(struct net_device *dev)
1368{ 1367{
1369 unsigned int ioaddr = dev->base_addr; 1368 unsigned int ioaddr = dev->base_addr;
1370 local_info_t *lp = netdev_priv(dev); 1369 local_info_t *lp = netdev_priv(dev);
1371 struct dev_mc_list *dmi; 1370 struct netdev_hw_addr *ha;
1372 struct set_address_info sa_info; 1371 struct set_address_info sa_info;
1373 int i; 1372 int i;
1374 1373
@@ -1383,10 +1382,10 @@ static void set_addresses(struct net_device *dev)
1383 1382
1384 set_address(&sa_info, dev->dev_addr); 1383 set_address(&sa_info, dev->dev_addr);
1385 i = 0; 1384 i = 0;
1386 netdev_for_each_mc_addr(dmi, dev) { 1385 netdev_for_each_mc_addr(ha, dev) {
1387 if (i++ == 9) 1386 if (i++ == 9)
1388 break; 1387 break;
1389 set_address(&sa_info, dmi->dmi_addr); 1388 set_address(&sa_info, ha->addr);
1390 } 1389 }
1391 while (i++ < 9) 1390 while (i++ < 9)
1392 set_address(&sa_info, dev->dev_addr); 1391 set_address(&sa_info, dev->dev_addr);