aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tulip
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/tulip')
-rw-r--r--drivers/net/tulip/de2104x.c13
-rw-r--r--drivers/net/tulip/de4x5.c87
-rw-r--r--drivers/net/tulip/dmfe.c17
-rw-r--r--drivers/net/tulip/media.c2
-rw-r--r--drivers/net/tulip/pnic.c2
-rw-r--r--drivers/net/tulip/tulip_core.c31
-rw-r--r--drivers/net/tulip/uli526x.c10
-rw-r--r--drivers/net/tulip/winbond-840.c18
-rw-r--r--drivers/net/tulip/xircom_cb.c6
9 files changed, 56 insertions, 130 deletions
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index 19cafc2b418d..c0e70006374e 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -654,7 +654,6 @@ static netdev_tx_t de_start_xmit (struct sk_buff *skb,
654 654
655 /* Trigger an immediate transmit demand. */ 655 /* Trigger an immediate transmit demand. */
656 dw32(TxPoll, NormalTxPoll); 656 dw32(TxPoll, NormalTxPoll);
657 dev->trans_start = jiffies;
658 657
659 return NETDEV_TX_OK; 658 return NETDEV_TX_OK;
660} 659}
@@ -671,15 +670,15 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
671{ 670{
672 struct de_private *de = netdev_priv(dev); 671 struct de_private *de = netdev_priv(dev);
673 u16 hash_table[32]; 672 u16 hash_table[32];
674 struct dev_mc_list *mclist; 673 struct netdev_hw_addr *ha;
675 int i; 674 int i;
676 u16 *eaddrs; 675 u16 *eaddrs;
677 676
678 memset(hash_table, 0, sizeof(hash_table)); 677 memset(hash_table, 0, sizeof(hash_table));
679 set_bit_le(255, hash_table); /* Broadcast entry */ 678 set_bit_le(255, hash_table); /* Broadcast entry */
680 /* This should work on big-endian machines as well. */ 679 /* This should work on big-endian machines as well. */
681 netdev_for_each_mc_addr(mclist, dev) { 680 netdev_for_each_mc_addr(ha, dev) {
682 int index = ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x1ff; 681 int index = ether_crc_le(ETH_ALEN, ha->addr) & 0x1ff;
683 682
684 set_bit_le(index, hash_table); 683 set_bit_le(index, hash_table);
685 } 684 }
@@ -700,13 +699,13 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
700static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev) 699static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev)
701{ 700{
702 struct de_private *de = netdev_priv(dev); 701 struct de_private *de = netdev_priv(dev);
703 struct dev_mc_list *mclist; 702 struct netdev_hw_addr *ha;
704 u16 *eaddrs; 703 u16 *eaddrs;
705 704
706 /* We have <= 14 addresses so we can use the wonderful 705 /* We have <= 14 addresses so we can use the wonderful
707 16 address perfect filtering of the Tulip. */ 706 16 address perfect filtering of the Tulip. */
708 netdev_for_each_mc_addr(mclist, dev) { 707 netdev_for_each_mc_addr(ha, dev) {
709 eaddrs = (u16 *)mclist->dmi_addr; 708 eaddrs = (u16 *) ha->addr;
710 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; 709 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++;
711 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; 710 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++;
712 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; 711 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++;
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index 09b57193a16a..75a64c88cf7a 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -1337,7 +1337,7 @@ de4x5_open(struct net_device *dev)
1337 } 1337 }
1338 1338
1339 lp->interrupt = UNMASK_INTERRUPTS; 1339 lp->interrupt = UNMASK_INTERRUPTS;
1340 dev->trans_start = jiffies; 1340 dev->trans_start = jiffies; /* prevent tx timeout */
1341 1341
1342 START_DE4X5; 1342 START_DE4X5;
1343 1343
@@ -1507,7 +1507,6 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev)
1507 outl(POLL_DEMAND, DE4X5_TPD);/* Start the TX */ 1507 outl(POLL_DEMAND, DE4X5_TPD);/* Start the TX */
1508 1508
1509 lp->tx_new = (++lp->tx_new) % lp->txRingSize; 1509 lp->tx_new = (++lp->tx_new) % lp->txRingSize;
1510 dev->trans_start = jiffies;
1511 1510
1512 if (TX_BUFFS_AVAIL) { 1511 if (TX_BUFFS_AVAIL) {
1513 netif_start_queue(dev); /* Another pkt may be queued */ 1512 netif_start_queue(dev); /* Another pkt may be queued */
@@ -1884,8 +1883,6 @@ de4x5_local_stats(struct net_device *dev, char *buf, int pkt_len)
1884 if (lp->pktStats.bins[0] == 0) { /* Reset counters */ 1883 if (lp->pktStats.bins[0] == 0) { /* Reset counters */
1885 memset((char *)&lp->pktStats, 0, sizeof(lp->pktStats)); 1884 memset((char *)&lp->pktStats, 0, sizeof(lp->pktStats));
1886 } 1885 }
1887
1888 return;
1889} 1886}
1890 1887
1891/* 1888/*
@@ -1937,7 +1934,7 @@ set_multicast_list(struct net_device *dev)
1937 1934
1938 lp->tx_new = (++lp->tx_new) % lp->txRingSize; 1935 lp->tx_new = (++lp->tx_new) % lp->txRingSize;
1939 outl(POLL_DEMAND, DE4X5_TPD); /* Start the TX */ 1936 outl(POLL_DEMAND, DE4X5_TPD); /* Start the TX */
1940 dev->trans_start = jiffies; 1937 dev->trans_start = jiffies; /* prevent tx timeout */
1941 } 1938 }
1942 } 1939 }
1943} 1940}
@@ -1951,7 +1948,7 @@ static void
1951SetMulticastFilter(struct net_device *dev) 1948SetMulticastFilter(struct net_device *dev)
1952{ 1949{
1953 struct de4x5_private *lp = netdev_priv(dev); 1950 struct de4x5_private *lp = netdev_priv(dev);
1954 struct dev_mc_list *dmi; 1951 struct netdev_hw_addr *ha;
1955 u_long iobase = dev->base_addr; 1952 u_long iobase = dev->base_addr;
1956 int i, bit, byte; 1953 int i, bit, byte;
1957 u16 hashcode; 1954 u16 hashcode;
@@ -1966,8 +1963,8 @@ SetMulticastFilter(struct net_device *dev)
1966 if ((dev->flags & IFF_ALLMULTI) || (netdev_mc_count(dev) > 14)) { 1963 if ((dev->flags & IFF_ALLMULTI) || (netdev_mc_count(dev) > 14)) {
1967 omr |= OMR_PM; /* Pass all multicasts */ 1964 omr |= OMR_PM; /* Pass all multicasts */
1968 } else if (lp->setup_f == HASH_PERF) { /* Hash Filtering */ 1965 } else if (lp->setup_f == HASH_PERF) { /* Hash Filtering */
1969 netdev_for_each_mc_addr(dmi, dev) { 1966 netdev_for_each_mc_addr(ha, dev) {
1970 addrs = dmi->dmi_addr; 1967 addrs = ha->addr;
1971 if ((*addrs & 0x01) == 1) { /* multicast address? */ 1968 if ((*addrs & 0x01) == 1) { /* multicast address? */
1972 crc = ether_crc_le(ETH_ALEN, addrs); 1969 crc = ether_crc_le(ETH_ALEN, addrs);
1973 hashcode = crc & HASH_BITS; /* hashcode is 9 LSb of CRC */ 1970 hashcode = crc & HASH_BITS; /* hashcode is 9 LSb of CRC */
@@ -1983,8 +1980,8 @@ SetMulticastFilter(struct net_device *dev)
1983 } 1980 }
1984 } 1981 }
1985 } else { /* Perfect filtering */ 1982 } else { /* Perfect filtering */
1986 netdev_for_each_mc_addr(dmi, dev) { 1983 netdev_for_each_mc_addr(ha, dev) {
1987 addrs = dmi->dmi_addr; 1984 addrs = ha->addr;
1988 for (i=0; i<ETH_ALEN; i++) { 1985 for (i=0; i<ETH_ALEN; i++) {
1989 *(pa + (i&1)) = *addrs++; 1986 *(pa + (i&1)) = *addrs++;
1990 if (i & 0x01) pa += 4; 1987 if (i & 0x01) pa += 4;
@@ -1992,8 +1989,6 @@ SetMulticastFilter(struct net_device *dev)
1992 } 1989 }
1993 } 1990 }
1994 outl(omr, DE4X5_OMR); 1991 outl(omr, DE4X5_OMR);
1995
1996 return;
1997} 1992}
1998 1993
1999#ifdef CONFIG_EISA 1994#ifdef CONFIG_EISA
@@ -2188,8 +2183,6 @@ srom_search(struct net_device *dev, struct pci_dev *pdev)
2188 return; 2183 return;
2189 } 2184 }
2190 } 2185 }
2191
2192 return;
2193} 2186}
2194 2187
2195/* 2188/*
@@ -3292,8 +3285,6 @@ de4x5_init_connection(struct net_device *dev)
3292 outl(POLL_DEMAND, DE4X5_TPD); 3285 outl(POLL_DEMAND, DE4X5_TPD);
3293 3286
3294 netif_wake_queue(dev); 3287 netif_wake_queue(dev);
3295
3296 return;
3297} 3288}
3298 3289
3299/* 3290/*
@@ -3665,8 +3656,6 @@ de4x5_free_rx_buffs(struct net_device *dev)
3665 lp->rx_ring[i].status = 0; 3656 lp->rx_ring[i].status = 0;
3666 lp->rx_skb[i] = (struct sk_buff *)1; /* Dummy entry */ 3657 lp->rx_skb[i] = (struct sk_buff *)1; /* Dummy entry */
3667 } 3658 }
3668
3669 return;
3670} 3659}
3671 3660
3672static void 3661static void
@@ -3709,8 +3698,6 @@ de4x5_save_skbs(struct net_device *dev)
3709 lp->cache.save_cnt++; 3698 lp->cache.save_cnt++;
3710 START_DE4X5; 3699 START_DE4X5;
3711 } 3700 }
3712
3713 return;
3714} 3701}
3715 3702
3716static void 3703static void
@@ -3742,8 +3729,6 @@ de4x5_rst_desc_ring(struct net_device *dev)
3742 lp->cache.save_cnt--; 3729 lp->cache.save_cnt--;
3743 START_DE4X5; 3730 START_DE4X5;
3744 } 3731 }
3745
3746 return;
3747} 3732}
3748 3733
3749static void 3734static void
@@ -3772,8 +3757,6 @@ de4x5_cache_state(struct net_device *dev, int flag)
3772 } 3757 }
3773 break; 3758 break;
3774 } 3759 }
3775
3776 return;
3777} 3760}
3778 3761
3779static void 3762static void
@@ -3846,8 +3829,6 @@ de4x5_setup_intr(struct net_device *dev)
3846 outl(sts, DE4X5_STS); 3829 outl(sts, DE4X5_STS);
3847 ENABLE_IRQs; 3830 ENABLE_IRQs;
3848 } 3831 }
3849
3850 return;
3851} 3832}
3852 3833
3853/* 3834/*
@@ -3880,8 +3861,6 @@ reset_init_sia(struct net_device *dev, s32 csr13, s32 csr14, s32 csr15)
3880 outl(csr13, DE4X5_SICR); 3861 outl(csr13, DE4X5_SICR);
3881 3862
3882 mdelay(10); 3863 mdelay(10);
3883
3884 return;
3885} 3864}
3886 3865
3887/* 3866/*
@@ -3902,8 +3881,6 @@ create_packet(struct net_device *dev, char *frame, int len)
3902 3881
3903 *buf++ = 0; /* Packet length (2 bytes) */ 3882 *buf++ = 0; /* Packet length (2 bytes) */
3904 *buf++ = 1; 3883 *buf++ = 1;
3905
3906 return;
3907} 3884}
3908 3885
3909/* 3886/*
@@ -4007,8 +3984,6 @@ DevicePresent(struct net_device *dev, u_long aprom_addr)
4007 } 3984 }
4008 de4x5_dbg_srom((struct de4x5_srom *)&lp->srom); 3985 de4x5_dbg_srom((struct de4x5_srom *)&lp->srom);
4009 } 3986 }
4010
4011 return;
4012} 3987}
4013 3988
4014/* 3989/*
@@ -4046,8 +4021,6 @@ enet_addr_rst(u_long aprom_addr)
4046 } 4021 }
4047 } 4022 }
4048 } 4023 }
4049
4050 return;
4051} 4024}
4052 4025
4053/* 4026/*
@@ -4187,8 +4160,6 @@ srom_repair(struct net_device *dev, int card)
4187 lp->useSROM = true; 4160 lp->useSROM = true;
4188 break; 4161 break;
4189 } 4162 }
4190
4191 return;
4192} 4163}
4193 4164
4194/* 4165/*
@@ -4262,8 +4233,6 @@ srom_latch(u_int command, u_long addr)
4262 sendto_srom(command, addr); 4233 sendto_srom(command, addr);
4263 sendto_srom(command | DT_CLK, addr); 4234 sendto_srom(command | DT_CLK, addr);
4264 sendto_srom(command, addr); 4235 sendto_srom(command, addr);
4265
4266 return;
4267} 4236}
4268 4237
4269static void 4238static void
@@ -4272,8 +4241,6 @@ srom_command(u_int command, u_long addr)
4272 srom_latch(command, addr); 4241 srom_latch(command, addr);
4273 srom_latch(command, addr); 4242 srom_latch(command, addr);
4274 srom_latch((command & 0x0000ff00) | DT_CS, addr); 4243 srom_latch((command & 0x0000ff00) | DT_CS, addr);
4275
4276 return;
4277} 4244}
4278 4245
4279static void 4246static void
@@ -4288,8 +4255,6 @@ srom_address(u_int command, u_long addr, u_char offset)
4288 udelay(1); 4255 udelay(1);
4289 4256
4290 i = (getfrom_srom(addr) >> 3) & 0x01; 4257 i = (getfrom_srom(addr) >> 3) & 0x01;
4291
4292 return;
4293} 4258}
4294 4259
4295static short 4260static short
@@ -4323,8 +4288,6 @@ srom_busy(u_int command, u_long addr)
4323 } 4288 }
4324 4289
4325 sendto_srom(command & 0x0000ff00, addr); 4290 sendto_srom(command & 0x0000ff00, addr);
4326
4327 return;
4328} 4291}
4329*/ 4292*/
4330 4293
@@ -4333,8 +4296,6 @@ sendto_srom(u_int command, u_long addr)
4333{ 4296{
4334 outl(command, addr); 4297 outl(command, addr);
4335 udelay(1); 4298 udelay(1);
4336
4337 return;
4338} 4299}
4339 4300
4340static int 4301static int
@@ -4433,8 +4394,6 @@ srom_init(struct net_device *dev)
4433 p += ((*p & BLOCK_LEN) + 1); 4394 p += ((*p & BLOCK_LEN) + 1);
4434 } 4395 }
4435 } 4396 }
4436
4437 return;
4438} 4397}
4439 4398
4440/* 4399/*
@@ -4463,8 +4422,6 @@ srom_exec(struct net_device *dev, u_char *p)
4463 outl(lp->cache.csr14, DE4X5_STRR); 4422 outl(lp->cache.csr14, DE4X5_STRR);
4464 outl(lp->cache.csr13, DE4X5_SICR); 4423 outl(lp->cache.csr13, DE4X5_SICR);
4465 } 4424 }
4466
4467 return;
4468} 4425}
4469 4426
4470/* 4427/*
@@ -4889,8 +4846,6 @@ mii_wr(int data, u_char phyreg, u_char phyaddr, u_long ioaddr)
4889 mii_ta(MII_STWR, ioaddr); /* Turn around time - 2 MDC */ 4846 mii_ta(MII_STWR, ioaddr); /* Turn around time - 2 MDC */
4890 data = mii_swap(data, 16); /* Swap data bit ordering */ 4847 data = mii_swap(data, 16); /* Swap data bit ordering */
4891 mii_wdata(data, 16, ioaddr); /* Write data */ 4848 mii_wdata(data, 16, ioaddr); /* Write data */
4892
4893 return;
4894} 4849}
4895 4850
4896static int 4851static int
@@ -4916,8 +4871,6 @@ mii_wdata(int data, int len, u_long ioaddr)
4916 sendto_mii(MII_MWR | MII_WR, data, ioaddr); 4871 sendto_mii(MII_MWR | MII_WR, data, ioaddr);
4917 data >>= 1; 4872 data >>= 1;
4918 } 4873 }
4919
4920 return;
4921} 4874}
4922 4875
4923static void 4876static void
@@ -4930,8 +4883,6 @@ mii_address(u_char addr, u_long ioaddr)
4930 sendto_mii(MII_MWR | MII_WR, addr, ioaddr); 4883 sendto_mii(MII_MWR | MII_WR, addr, ioaddr);
4931 addr >>= 1; 4884 addr >>= 1;
4932 } 4885 }
4933
4934 return;
4935} 4886}
4936 4887
4937static void 4888static void
@@ -4943,8 +4894,6 @@ mii_ta(u_long rw, u_long ioaddr)
4943 } else { 4894 } else {
4944 getfrom_mii(MII_MRD | MII_RD, ioaddr); /* Tri-state MDIO */ 4895 getfrom_mii(MII_MRD | MII_RD, ioaddr); /* Tri-state MDIO */
4945 } 4896 }
4946
4947 return;
4948} 4897}
4949 4898
4950static int 4899static int
@@ -4971,8 +4920,6 @@ sendto_mii(u32 command, int data, u_long ioaddr)
4971 udelay(1); 4920 udelay(1);
4972 outl(command | MII_MDC | j, ioaddr); 4921 outl(command | MII_MDC | j, ioaddr);
4973 udelay(1); 4922 udelay(1);
4974
4975 return;
4976} 4923}
4977 4924
4978static int 4925static int
@@ -5077,7 +5024,7 @@ mii_get_phy(struct net_device *dev)
5077 lp->phy[k].spd.value = GENERIC_VALUE; /* TX & T4, H/F Duplex */ 5024 lp->phy[k].spd.value = GENERIC_VALUE; /* TX & T4, H/F Duplex */
5078 lp->mii_cnt++; 5025 lp->mii_cnt++;
5079 lp->active++; 5026 lp->active++;
5080 printk("%s: Using generic MII device control. If the board doesn't operate, \nplease mail the following dump to the author:\n", dev->name); 5027 printk("%s: Using generic MII device control. If the board doesn't operate,\nplease mail the following dump to the author:\n", dev->name);
5081 j = de4x5_debug; 5028 j = de4x5_debug;
5082 de4x5_debug |= DEBUG_MII; 5029 de4x5_debug |= DEBUG_MII;
5083 de4x5_dbg_mii(dev, k); 5030 de4x5_dbg_mii(dev, k);
@@ -5186,8 +5133,6 @@ gep_wr(s32 data, struct net_device *dev)
5186 } else if ((lp->chipset & ~0x00ff) == DC2114x) { 5133 } else if ((lp->chipset & ~0x00ff) == DC2114x) {
5187 outl((data<<16) | lp->cache.csr15, DE4X5_SIGR); 5134 outl((data<<16) | lp->cache.csr15, DE4X5_SIGR);
5188 } 5135 }
5189
5190 return;
5191} 5136}
5192 5137
5193static int 5138static int
@@ -5247,8 +5192,6 @@ yawn(struct net_device *dev, int state)
5247 break; 5192 break;
5248 } 5193 }
5249 } 5194 }
5250
5251 return;
5252} 5195}
5253 5196
5254static void 5197static void
@@ -5290,8 +5233,6 @@ de4x5_parse_params(struct net_device *dev)
5290 } 5233 }
5291 *q = t; 5234 *q = t;
5292 } 5235 }
5293
5294 return;
5295} 5236}
5296 5237
5297static void 5238static void
@@ -5337,12 +5278,10 @@ de4x5_dbg_open(struct net_device *dev)
5337 } 5278 }
5338 } 5279 }
5339 printk("...0x%8.8x\n", le32_to_cpu(lp->tx_ring[i].buf)); 5280 printk("...0x%8.8x\n", le32_to_cpu(lp->tx_ring[i].buf));
5340 printk("Ring size: \nRX: %d\nTX: %d\n", 5281 printk("Ring size:\nRX: %d\nTX: %d\n",
5341 (short)lp->rxRingSize, 5282 (short)lp->rxRingSize,
5342 (short)lp->txRingSize); 5283 (short)lp->txRingSize);
5343 } 5284 }
5344
5345 return;
5346} 5285}
5347 5286
5348static void 5287static void
@@ -5369,8 +5308,6 @@ de4x5_dbg_mii(struct net_device *dev, int k)
5369 printk("MII 20: %x\n",mii_rd(0x14,lp->phy[k].addr,DE4X5_MII)); 5308 printk("MII 20: %x\n",mii_rd(0x14,lp->phy[k].addr,DE4X5_MII));
5370 } 5309 }
5371 } 5310 }
5372
5373 return;
5374} 5311}
5375 5312
5376static void 5313static void
@@ -5395,8 +5332,6 @@ de4x5_dbg_media(struct net_device *dev)
5395 } 5332 }
5396 lp->c_media = lp->media; 5333 lp->c_media = lp->media;
5397 } 5334 }
5398
5399 return;
5400} 5335}
5401 5336
5402static void 5337static void
@@ -5417,8 +5352,6 @@ de4x5_dbg_srom(struct de4x5_srom *p)
5417 printk("%3d %04x\n", i<<1, (u_short)*((u_short *)p+i)); 5352 printk("%3d %04x\n", i<<1, (u_short)*((u_short *)p+i));
5418 } 5353 }
5419 } 5354 }
5420
5421 return;
5422} 5355}
5423 5356
5424static void 5357static void
@@ -5440,8 +5373,6 @@ de4x5_dbg_rx(struct sk_buff *skb, int len)
5440 printk("\n"); 5373 printk("\n");
5441 } 5374 }
5442 } 5375 }
5443
5444 return;
5445} 5376}
5446 5377
5447/* 5378/*
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c
index 9568156dea98..29e6c63d39fd 100644
--- a/drivers/net/tulip/dmfe.c
+++ b/drivers/net/tulip/dmfe.c
@@ -1118,7 +1118,6 @@ static void dmfe_ethtool_get_wol(struct net_device *dev,
1118 1118
1119 wolinfo->supported = WAKE_PHY | WAKE_MAGIC; 1119 wolinfo->supported = WAKE_PHY | WAKE_MAGIC;
1120 wolinfo->wolopts = db->wol_mode; 1120 wolinfo->wolopts = db->wol_mode;
1121 return;
1122} 1121}
1123 1122
1124 1123
@@ -1180,11 +1179,11 @@ static void dmfe_timer(unsigned long data)
1180 1179
1181 /* TX polling kick monitor */ 1180 /* TX polling kick monitor */
1182 if ( db->tx_packet_cnt && 1181 if ( db->tx_packet_cnt &&
1183 time_after(jiffies, dev->trans_start + DMFE_TX_KICK) ) { 1182 time_after(jiffies, dev_trans_start(dev) + DMFE_TX_KICK) ) {
1184 outl(0x1, dev->base_addr + DCR1); /* Tx polling again */ 1183 outl(0x1, dev->base_addr + DCR1); /* Tx polling again */
1185 1184
1186 /* TX Timeout */ 1185 /* TX Timeout */
1187 if ( time_after(jiffies, dev->trans_start + DMFE_TX_TIMEOUT) ) { 1186 if (time_after(jiffies, dev_trans_start(dev) + DMFE_TX_TIMEOUT) ) {
1188 db->reset_TXtimeout++; 1187 db->reset_TXtimeout++;
1189 db->wait_reset = 1; 1188 db->wait_reset = 1;
1190 dev_warn(&dev->dev, "Tx timeout - resetting\n"); 1189 dev_warn(&dev->dev, "Tx timeout - resetting\n");
@@ -1453,7 +1452,7 @@ static void update_cr6(u32 cr6_data, unsigned long ioaddr)
1453 1452
1454static void dm9132_id_table(struct DEVICE *dev) 1453static void dm9132_id_table(struct DEVICE *dev)
1455{ 1454{
1456 struct dev_mc_list *mcptr; 1455 struct netdev_hw_addr *ha;
1457 u16 * addrptr; 1456 u16 * addrptr;
1458 unsigned long ioaddr = dev->base_addr+0xc0; /* ID Table */ 1457 unsigned long ioaddr = dev->base_addr+0xc0; /* ID Table */
1459 u32 hash_val; 1458 u32 hash_val;
@@ -1477,8 +1476,8 @@ static void dm9132_id_table(struct DEVICE *dev)
1477 hash_table[3] = 0x8000; 1476 hash_table[3] = 0x8000;
1478 1477
1479 /* the multicast address in Hash Table : 64 bits */ 1478 /* the multicast address in Hash Table : 64 bits */
1480 netdev_for_each_mc_addr(mcptr, dev) { 1479 netdev_for_each_mc_addr(ha, dev) {
1481 hash_val = cal_CRC((char *) mcptr->dmi_addr, 6, 0) & 0x3f; 1480 hash_val = cal_CRC((char *) ha->addr, 6, 0) & 0x3f;
1482 hash_table[hash_val / 16] |= (u16) 1 << (hash_val % 16); 1481 hash_table[hash_val / 16] |= (u16) 1 << (hash_val % 16);
1483 } 1482 }
1484 1483
@@ -1496,7 +1495,7 @@ static void dm9132_id_table(struct DEVICE *dev)
1496static void send_filter_frame(struct DEVICE *dev) 1495static void send_filter_frame(struct DEVICE *dev)
1497{ 1496{
1498 struct dmfe_board_info *db = netdev_priv(dev); 1497 struct dmfe_board_info *db = netdev_priv(dev);
1499 struct dev_mc_list *mcptr; 1498 struct netdev_hw_addr *ha;
1500 struct tx_desc *txptr; 1499 struct tx_desc *txptr;
1501 u16 * addrptr; 1500 u16 * addrptr;
1502 u32 * suptr; 1501 u32 * suptr;
@@ -1519,8 +1518,8 @@ static void send_filter_frame(struct DEVICE *dev)
1519 *suptr++ = 0xffff; 1518 *suptr++ = 0xffff;
1520 1519
1521 /* fit the multicast address */ 1520 /* fit the multicast address */
1522 netdev_for_each_mc_addr(mcptr, dev) { 1521 netdev_for_each_mc_addr(ha, dev) {
1523 addrptr = (u16 *) mcptr->dmi_addr; 1522 addrptr = (u16 *) ha->addr;
1524 *suptr++ = addrptr[0]; 1523 *suptr++ = addrptr[0];
1525 *suptr++ = addrptr[1]; 1524 *suptr++ = addrptr[1];
1526 *suptr++ = addrptr[2]; 1525 *suptr++ = addrptr[2];
diff --git a/drivers/net/tulip/media.c b/drivers/net/tulip/media.c
index 68b170ae4d15..a0c770ee4b64 100644
--- a/drivers/net/tulip/media.c
+++ b/drivers/net/tulip/media.c
@@ -396,8 +396,6 @@ void tulip_select_media(struct net_device *dev, int startup)
396 tp->csr6 = new_csr6 | (tp->csr6 & 0xfdff) | (tp->full_duplex ? 0x0200 : 0); 396 tp->csr6 = new_csr6 | (tp->csr6 & 0xfdff) | (tp->full_duplex ? 0x0200 : 0);
397 397
398 mdelay(1); 398 mdelay(1);
399
400 return;
401} 399}
402 400
403/* 401/*
diff --git a/drivers/net/tulip/pnic.c b/drivers/net/tulip/pnic.c
index 966efa1a27d7..a63e64b6863d 100644
--- a/drivers/net/tulip/pnic.c
+++ b/drivers/net/tulip/pnic.c
@@ -67,7 +67,7 @@ void pnic_lnk_change(struct net_device *dev, int csr5)
67 */ 67 */
68 if (tulip_media_cap[dev->if_port] & MediaIsMII) 68 if (tulip_media_cap[dev->if_port] & MediaIsMII)
69 return; 69 return;
70 if (! tp->nwayset || time_after(jiffies, dev->trans_start + 1*HZ)) { 70 if (! tp->nwayset || time_after(jiffies, dev_trans_start(dev) + 1*HZ)) {
71 tp->csr6 = 0x00420000 | (tp->csr6 & 0x0000fdff); 71 tp->csr6 = 0x00420000 | (tp->csr6 & 0x0000fdff);
72 iowrite32(tp->csr6, ioaddr + CSR6); 72 iowrite32(tp->csr6, ioaddr + CSR6);
73 iowrite32(0x30, ioaddr + CSR12); 73 iowrite32(0x30, ioaddr + CSR12);
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index 3810db9dc2de..254643ed945e 100644
--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -605,7 +605,7 @@ static void tulip_tx_timeout(struct net_device *dev)
605 605
606out_unlock: 606out_unlock:
607 spin_unlock_irqrestore (&tp->lock, flags); 607 spin_unlock_irqrestore (&tp->lock, flags);
608 dev->trans_start = jiffies; 608 dev->trans_start = jiffies; /* prevent tx timeout */
609 netif_wake_queue (dev); 609 netif_wake_queue (dev);
610} 610}
611 611
@@ -707,8 +707,6 @@ tulip_start_xmit(struct sk_buff *skb, struct net_device *dev)
707 707
708 spin_unlock_irqrestore(&tp->lock, flags); 708 spin_unlock_irqrestore(&tp->lock, flags);
709 709
710 dev->trans_start = jiffies;
711
712 return NETDEV_TX_OK; 710 return NETDEV_TX_OK;
713} 711}
714 712
@@ -991,15 +989,15 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
991{ 989{
992 struct tulip_private *tp = netdev_priv(dev); 990 struct tulip_private *tp = netdev_priv(dev);
993 u16 hash_table[32]; 991 u16 hash_table[32];
994 struct dev_mc_list *mclist; 992 struct netdev_hw_addr *ha;
995 int i; 993 int i;
996 u16 *eaddrs; 994 u16 *eaddrs;
997 995
998 memset(hash_table, 0, sizeof(hash_table)); 996 memset(hash_table, 0, sizeof(hash_table));
999 set_bit_le(255, hash_table); /* Broadcast entry */ 997 set_bit_le(255, hash_table); /* Broadcast entry */
1000 /* This should work on big-endian machines as well. */ 998 /* This should work on big-endian machines as well. */
1001 netdev_for_each_mc_addr(mclist, dev) { 999 netdev_for_each_mc_addr(ha, dev) {
1002 int index = ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x1ff; 1000 int index = ether_crc_le(ETH_ALEN, ha->addr) & 0x1ff;
1003 1001
1004 set_bit_le(index, hash_table); 1002 set_bit_le(index, hash_table);
1005 } 1003 }
@@ -1019,13 +1017,13 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
1019static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev) 1017static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev)
1020{ 1018{
1021 struct tulip_private *tp = netdev_priv(dev); 1019 struct tulip_private *tp = netdev_priv(dev);
1022 struct dev_mc_list *mclist; 1020 struct netdev_hw_addr *ha;
1023 u16 *eaddrs; 1021 u16 *eaddrs;
1024 1022
1025 /* We have <= 14 addresses so we can use the wonderful 1023 /* We have <= 14 addresses so we can use the wonderful
1026 16 address perfect filtering of the Tulip. */ 1024 16 address perfect filtering of the Tulip. */
1027 netdev_for_each_mc_addr(mclist, dev) { 1025 netdev_for_each_mc_addr(ha, dev) {
1028 eaddrs = (u16 *)mclist->dmi_addr; 1026 eaddrs = (u16 *) ha->addr;
1029 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; 1027 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++;
1030 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; 1028 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++;
1031 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; 1029 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++;
@@ -1062,7 +1060,7 @@ static void set_rx_mode(struct net_device *dev)
1062 } else if (tp->flags & MC_HASH_ONLY) { 1060 } else if (tp->flags & MC_HASH_ONLY) {
1063 /* Some work-alikes have only a 64-entry hash filter table. */ 1061 /* Some work-alikes have only a 64-entry hash filter table. */
1064 /* Should verify correctness on big-endian/__powerpc__ */ 1062 /* Should verify correctness on big-endian/__powerpc__ */
1065 struct dev_mc_list *mclist; 1063 struct netdev_hw_addr *ha;
1066 if (netdev_mc_count(dev) > 64) { 1064 if (netdev_mc_count(dev) > 64) {
1067 /* Arbitrary non-effective limit. */ 1065 /* Arbitrary non-effective limit. */
1068 tp->csr6 |= AcceptAllMulticast; 1066 tp->csr6 |= AcceptAllMulticast;
@@ -1070,18 +1068,21 @@ static void set_rx_mode(struct net_device *dev)
1070 } else { 1068 } else {
1071 u32 mc_filter[2] = {0, 0}; /* Multicast hash filter */ 1069 u32 mc_filter[2] = {0, 0}; /* Multicast hash filter */
1072 int filterbit; 1070 int filterbit;
1073 netdev_for_each_mc_addr(mclist, dev) { 1071 netdev_for_each_mc_addr(ha, dev) {
1074 if (tp->flags & COMET_MAC_ADDR) 1072 if (tp->flags & COMET_MAC_ADDR)
1075 filterbit = ether_crc_le(ETH_ALEN, mclist->dmi_addr); 1073 filterbit = ether_crc_le(ETH_ALEN,
1074 ha->addr);
1076 else 1075 else
1077 filterbit = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26; 1076 filterbit = ether_crc(ETH_ALEN,
1077 ha->addr) >> 26;
1078 filterbit &= 0x3f; 1078 filterbit &= 0x3f;
1079 mc_filter[filterbit >> 5] |= 1 << (filterbit & 31); 1079 mc_filter[filterbit >> 5] |= 1 << (filterbit & 31);
1080 if (tulip_debug > 2) 1080 if (tulip_debug > 2)
1081 dev_info(&dev->dev, 1081 dev_info(&dev->dev,
1082 "Added filter for %pM %08x bit %d\n", 1082 "Added filter for %pM %08x bit %d\n",
1083 mclist->dmi_addr, 1083 ha->addr,
1084 ether_crc(ETH_ALEN, mclist->dmi_addr), filterbit); 1084 ether_crc(ETH_ALEN, ha->addr),
1085 filterbit);
1085 } 1086 }
1086 if (mc_filter[0] == tp->mc_filter[0] && 1087 if (mc_filter[0] == tp->mc_filter[0] &&
1087 mc_filter[1] == tp->mc_filter[1]) 1088 mc_filter[1] == tp->mc_filter[1])
diff --git a/drivers/net/tulip/uli526x.c b/drivers/net/tulip/uli526x.c
index a589dd34891e..96de5829b940 100644
--- a/drivers/net/tulip/uli526x.c
+++ b/drivers/net/tulip/uli526x.c
@@ -1040,11 +1040,11 @@ static void uli526x_timer(unsigned long data)
1040 1040
1041 /* TX polling kick monitor */ 1041 /* TX polling kick monitor */
1042 if ( db->tx_packet_cnt && 1042 if ( db->tx_packet_cnt &&
1043 time_after(jiffies, dev->trans_start + ULI526X_TX_KICK) ) { 1043 time_after(jiffies, dev_trans_start(dev) + ULI526X_TX_KICK) ) {
1044 outl(0x1, dev->base_addr + DCR1); // Tx polling again 1044 outl(0x1, dev->base_addr + DCR1); // Tx polling again
1045 1045
1046 // TX Timeout 1046 // TX Timeout
1047 if ( time_after(jiffies, dev->trans_start + ULI526X_TX_TIMEOUT) ) { 1047 if ( time_after(jiffies, dev_trans_start(dev) + ULI526X_TX_TIMEOUT) ) {
1048 db->reset_TXtimeout++; 1048 db->reset_TXtimeout++;
1049 db->wait_reset = 1; 1049 db->wait_reset = 1;
1050 printk( "%s: Tx timeout - resetting\n", 1050 printk( "%s: Tx timeout - resetting\n",
@@ -1393,7 +1393,7 @@ static void update_cr6(u32 cr6_data, unsigned long ioaddr)
1393static void send_filter_frame(struct net_device *dev, int mc_cnt) 1393static void send_filter_frame(struct net_device *dev, int mc_cnt)
1394{ 1394{
1395 struct uli526x_board_info *db = netdev_priv(dev); 1395 struct uli526x_board_info *db = netdev_priv(dev);
1396 struct dev_mc_list *mcptr; 1396 struct netdev_hw_addr *ha;
1397 struct tx_desc *txptr; 1397 struct tx_desc *txptr;
1398 u16 * addrptr; 1398 u16 * addrptr;
1399 u32 * suptr; 1399 u32 * suptr;
@@ -1416,8 +1416,8 @@ static void send_filter_frame(struct net_device *dev, int mc_cnt)
1416 *suptr++ = 0xffff << FLT_SHIFT; 1416 *suptr++ = 0xffff << FLT_SHIFT;
1417 1417
1418 /* fit the multicast address */ 1418 /* fit the multicast address */
1419 netdev_for_each_mc_addr(mcptr, dev) { 1419 netdev_for_each_mc_addr(ha, dev) {
1420 addrptr = (u16 *) mcptr->dmi_addr; 1420 addrptr = (u16 *) ha->addr;
1421 *suptr++ = addrptr[0] << FLT_SHIFT; 1421 *suptr++ = addrptr[0] << FLT_SHIFT;
1422 *suptr++ = addrptr[1] << FLT_SHIFT; 1422 *suptr++ = addrptr[1] << FLT_SHIFT;
1423 *suptr++ = addrptr[2] << FLT_SHIFT; 1423 *suptr++ = addrptr[2] << FLT_SHIFT;
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c
index 98dbf6cc1d68..608b279b921b 100644
--- a/drivers/net/tulip/winbond-840.c
+++ b/drivers/net/tulip/winbond-840.c
@@ -626,7 +626,6 @@ static void mdio_write(struct net_device *dev, int phy_id, int location, int val
626 iowrite32(MDIO_EnbIn | MDIO_ShiftClk, mdio_addr); 626 iowrite32(MDIO_EnbIn | MDIO_ShiftClk, mdio_addr);
627 mdio_delay(mdio_addr); 627 mdio_delay(mdio_addr);
628 } 628 }
629 return;
630} 629}
631 630
632 631
@@ -969,9 +968,8 @@ static void tx_timeout(struct net_device *dev)
969 enable_irq(dev->irq); 968 enable_irq(dev->irq);
970 969
971 netif_wake_queue(dev); 970 netif_wake_queue(dev);
972 dev->trans_start = jiffies; 971 dev->trans_start = jiffies; /* prevent tx timeout */
973 np->stats.tx_errors++; 972 np->stats.tx_errors++;
974 return;
975} 973}
976 974
977/* Initialize the Rx and Tx rings, along with various 'dev' bits. */ 975/* Initialize the Rx and Tx rings, along with various 'dev' bits. */
@@ -1055,8 +1053,6 @@ static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev)
1055 } 1053 }
1056 spin_unlock_irq(&np->lock); 1054 spin_unlock_irq(&np->lock);
1057 1055
1058 dev->trans_start = jiffies;
1059
1060 if (debug > 4) { 1056 if (debug > 4) {
1061 printk(KERN_DEBUG "%s: Transmit frame #%d queued in slot %d\n", 1057 printk(KERN_DEBUG "%s: Transmit frame #%d queued in slot %d\n",
1062 dev->name, np->cur_tx, entry); 1058 dev->name, np->cur_tx, entry);
@@ -1366,13 +1362,15 @@ static u32 __set_rx_mode(struct net_device *dev)
1366 memset(mc_filter, 0xff, sizeof(mc_filter)); 1362 memset(mc_filter, 0xff, sizeof(mc_filter));
1367 rx_mode = RxAcceptBroadcast | AcceptMulticast | AcceptMyPhys; 1363 rx_mode = RxAcceptBroadcast | AcceptMulticast | AcceptMyPhys;
1368 } else { 1364 } else {
1369 struct dev_mc_list *mclist; 1365 struct netdev_hw_addr *ha;
1370 1366
1371 memset(mc_filter, 0, sizeof(mc_filter)); 1367 memset(mc_filter, 0, sizeof(mc_filter));
1372 netdev_for_each_mc_addr(mclist, dev) { 1368 netdev_for_each_mc_addr(ha, dev) {
1373 int filterbit = (ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26) ^ 0x3F; 1369 int filbit;
1374 filterbit &= 0x3f; 1370
1375 mc_filter[filterbit >> 5] |= 1 << (filterbit & 31); 1371 filbit = (ether_crc(ETH_ALEN, ha->addr) >> 26) ^ 0x3F;
1372 filbit &= 0x3f;
1373 mc_filter[filbit >> 5] |= 1 << (filbit & 31);
1376 } 1374 }
1377 rx_mode = RxAcceptBroadcast | AcceptMulticast | AcceptMyPhys; 1375 rx_mode = RxAcceptBroadcast | AcceptMulticast | AcceptMyPhys;
1378 } 1376 }
diff --git a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c
index acfeeb980562..a439e93be22d 100644
--- a/drivers/net/tulip/xircom_cb.c
+++ b/drivers/net/tulip/xircom_cb.c
@@ -350,9 +350,9 @@ static irqreturn_t xircom_interrupt(int irq, void *dev_instance)
350 350
351#ifdef DEBUG 351#ifdef DEBUG
352 print_binary(status); 352 print_binary(status);
353 printk("tx status 0x%08x 0x%08x \n", 353 printk("tx status 0x%08x 0x%08x\n",
354 card->tx_buffer[0], card->tx_buffer[4]); 354 card->tx_buffer[0], card->tx_buffer[4]);
355 printk("rx status 0x%08x 0x%08x \n", 355 printk("rx status 0x%08x 0x%08x\n",
356 card->rx_buffer[0], card->rx_buffer[4]); 356 card->rx_buffer[0], card->rx_buffer[4]);
357#endif 357#endif
358 /* Handle shared irq and hotplug */ 358 /* Handle shared irq and hotplug */
@@ -462,7 +462,7 @@ static int xircom_open(struct net_device *dev)
462 struct xircom_private *xp = netdev_priv(dev); 462 struct xircom_private *xp = netdev_priv(dev);
463 int retval; 463 int retval;
464 enter("xircom_open"); 464 enter("xircom_open");
465 pr_info("xircom cardbus adaptor found, registering as %s, using irq %i \n", 465 pr_info("xircom cardbus adaptor found, registering as %s, using irq %i\n",
466 dev->name, dev->irq); 466 dev->name, dev->irq);
467 retval = request_irq(dev->irq, xircom_interrupt, IRQF_SHARED, dev->name, dev); 467 retval = request_irq(dev->irq, xircom_interrupt, IRQF_SHARED, dev->name, dev);
468 if (retval) { 468 if (retval) {