aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/amd8111e.c9
-rw-r--r--drivers/net/arm/at91_ether.c6
-rw-r--r--drivers/net/atlx/atl1.c7
-rw-r--r--drivers/net/atlx/atl1.h2
-rw-r--r--drivers/net/bonding/bond_alb.c13
-rw-r--r--drivers/net/bonding/bond_main.c52
-rw-r--r--drivers/net/gianfar.c16
-rw-r--r--drivers/net/gianfar_mii.c21
-rw-r--r--drivers/net/gianfar_mii.h3
-rw-r--r--drivers/net/myri10ge/myri10ge.c4
-rw-r--r--drivers/net/smc91x.c2
11 files changed, 99 insertions, 36 deletions
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c
index ba1be0b3a8c8..07a6697e3635 100644
--- a/drivers/net/amd8111e.c
+++ b/drivers/net/amd8111e.c
@@ -644,10 +644,6 @@ This function frees the transmiter and receiver descriptor rings.
644*/ 644*/
645static void amd8111e_free_ring(struct amd8111e_priv* lp) 645static void amd8111e_free_ring(struct amd8111e_priv* lp)
646{ 646{
647
648 /* Free transmit and receive skbs */
649 amd8111e_free_skbs(lp->amd8111e_net_dev);
650
651 /* Free transmit and receive descriptor rings */ 647 /* Free transmit and receive descriptor rings */
652 if(lp->rx_ring){ 648 if(lp->rx_ring){
653 pci_free_consistent(lp->pci_dev, 649 pci_free_consistent(lp->pci_dev,
@@ -1233,7 +1229,9 @@ static int amd8111e_close(struct net_device * dev)
1233 1229
1234 amd8111e_disable_interrupt(lp); 1230 amd8111e_disable_interrupt(lp);
1235 amd8111e_stop_chip(lp); 1231 amd8111e_stop_chip(lp);
1236 amd8111e_free_ring(lp); 1232
1233 /* Free transmit and receive skbs */
1234 amd8111e_free_skbs(lp->amd8111e_net_dev);
1237 1235
1238 netif_carrier_off(lp->amd8111e_net_dev); 1236 netif_carrier_off(lp->amd8111e_net_dev);
1239 1237
@@ -1243,6 +1241,7 @@ static int amd8111e_close(struct net_device * dev)
1243 1241
1244 spin_unlock_irq(&lp->lock); 1242 spin_unlock_irq(&lp->lock);
1245 free_irq(dev->irq, dev); 1243 free_irq(dev->irq, dev);
1244 amd8111e_free_ring(lp);
1246 1245
1247 /* Update the statistics before closing */ 1246 /* Update the statistics before closing */
1248 amd8111e_get_stats(dev); 1247 amd8111e_get_stats(dev);
diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c
index 0fa53464efb2..6f431a887e7e 100644
--- a/drivers/net/arm/at91_ether.c
+++ b/drivers/net/arm/at91_ether.c
@@ -1080,7 +1080,8 @@ static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_add
1080 init_timer(&lp->check_timer); 1080 init_timer(&lp->check_timer);
1081 lp->check_timer.data = (unsigned long)dev; 1081 lp->check_timer.data = (unsigned long)dev;
1082 lp->check_timer.function = at91ether_check_link; 1082 lp->check_timer.function = at91ether_check_link;
1083 } 1083 } else if (lp->board_data.phy_irq_pin >= 32)
1084 gpio_request(lp->board_data.phy_irq_pin, "ethernet_phy");
1084 1085
1085 /* Display ethernet banner */ 1086 /* Display ethernet banner */
1086 printk(KERN_INFO "%s: AT91 ethernet at 0x%08x int=%d %s%s (%s)\n", 1087 printk(KERN_INFO "%s: AT91 ethernet at 0x%08x int=%d %s%s (%s)\n",
@@ -1167,6 +1168,9 @@ static int __devexit at91ether_remove(struct platform_device *pdev)
1167 struct net_device *dev = platform_get_drvdata(pdev); 1168 struct net_device *dev = platform_get_drvdata(pdev);
1168 struct at91_private *lp = netdev_priv(dev); 1169 struct at91_private *lp = netdev_priv(dev);
1169 1170
1171 if (lp->board_data.phy_irq_pin >= 32)
1172 gpio_free(lp->board_data.phy_irq_pin);
1173
1170 unregister_netdev(dev); 1174 unregister_netdev(dev);
1171 free_irq(dev->irq, dev); 1175 free_irq(dev->irq, dev);
1172 dma_free_coherent(NULL, sizeof(struct recv_desc_bufs), lp->dlist, (dma_addr_t)lp->dlist_phys); 1176 dma_free_coherent(NULL, sizeof(struct recv_desc_bufs), lp->dlist, (dma_addr_t)lp->dlist_phys);
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 3cf59a7f5a1c..246d92b42636 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -2310,7 +2310,8 @@ static void atl1_tx_queue(struct atl1_adapter *adapter, u16 count,
2310 if (tpd != ptpd) 2310 if (tpd != ptpd)
2311 memcpy(tpd, ptpd, sizeof(struct tx_packet_desc)); 2311 memcpy(tpd, ptpd, sizeof(struct tx_packet_desc));
2312 tpd->buffer_addr = cpu_to_le64(buffer_info->dma); 2312 tpd->buffer_addr = cpu_to_le64(buffer_info->dma);
2313 tpd->word2 = (cpu_to_le16(buffer_info->length) & 2313 tpd->word2 &= ~(TPD_BUFLEN_MASK << TPD_BUFLEN_SHIFT);
2314 tpd->word2 |= (cpu_to_le16(buffer_info->length) &
2314 TPD_BUFLEN_MASK) << TPD_BUFLEN_SHIFT; 2315 TPD_BUFLEN_MASK) << TPD_BUFLEN_SHIFT;
2315 2316
2316 /* 2317 /*
@@ -2409,8 +2410,8 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
2409 vlan_tag = (vlan_tag << 4) | (vlan_tag >> 13) | 2410 vlan_tag = (vlan_tag << 4) | (vlan_tag >> 13) |
2410 ((vlan_tag >> 9) & 0x8); 2411 ((vlan_tag >> 9) & 0x8);
2411 ptpd->word3 |= 1 << TPD_INS_VL_TAG_SHIFT; 2412 ptpd->word3 |= 1 << TPD_INS_VL_TAG_SHIFT;
2412 ptpd->word3 |= (vlan_tag & TPD_VL_TAGGED_MASK) << 2413 ptpd->word2 |= (vlan_tag & TPD_VLANTAG_MASK) <<
2413 TPD_VL_TAGGED_SHIFT; 2414 TPD_VLANTAG_SHIFT;
2414 } 2415 }
2415 2416
2416 tso = atl1_tso(adapter, skb, ptpd); 2417 tso = atl1_tso(adapter, skb, ptpd);
diff --git a/drivers/net/atlx/atl1.h b/drivers/net/atlx/atl1.h
index a5015b14a429..ffa73fc8d95e 100644
--- a/drivers/net/atlx/atl1.h
+++ b/drivers/net/atlx/atl1.h
@@ -504,7 +504,7 @@ struct rx_free_desc {
504#define TPD_PKTNT_MASK 0x0001 504#define TPD_PKTNT_MASK 0x0001
505#define TPD_PKTINT_SHIFT 15 505#define TPD_PKTINT_SHIFT 15
506#define TPD_VLANTAG_MASK 0xFFFF 506#define TPD_VLANTAG_MASK 0xFFFF
507#define TPD_VLAN_SHIFT 16 507#define TPD_VLANTAG_SHIFT 16
508 508
509/* tpd word 3 bits 0:13 */ 509/* tpd word 3 bits 0:13 */
510#define TPD_EOP_MASK 0x0001 510#define TPD_EOP_MASK 0x0001
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index ade5f3f6693b..87437c788476 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -169,11 +169,14 @@ static void tlb_clear_slave(struct bonding *bond, struct slave *slave, int save_
169 /* clear slave from tx_hashtbl */ 169 /* clear slave from tx_hashtbl */
170 tx_hash_table = BOND_ALB_INFO(bond).tx_hashtbl; 170 tx_hash_table = BOND_ALB_INFO(bond).tx_hashtbl;
171 171
172 index = SLAVE_TLB_INFO(slave).head; 172 /* skip this if we've already freed the tx hash table */
173 while (index != TLB_NULL_INDEX) { 173 if (tx_hash_table) {
174 u32 next_index = tx_hash_table[index].next; 174 index = SLAVE_TLB_INFO(slave).head;
175 tlb_init_table_entry(&tx_hash_table[index], save_load); 175 while (index != TLB_NULL_INDEX) {
176 index = next_index; 176 u32 next_index = tx_hash_table[index].next;
177 tlb_init_table_entry(&tx_hash_table[index], save_load);
178 index = next_index;
179 }
177 } 180 }
178 181
179 tlb_init_slave(slave); 182 tlb_init_slave(slave);
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 832739f38db4..a3efba59eee9 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1979,6 +1979,20 @@ void bond_destroy(struct bonding *bond)
1979 unregister_netdevice(bond->dev); 1979 unregister_netdevice(bond->dev);
1980} 1980}
1981 1981
1982static void bond_destructor(struct net_device *bond_dev)
1983{
1984 struct bonding *bond = bond_dev->priv;
1985
1986 if (bond->wq)
1987 destroy_workqueue(bond->wq);
1988
1989 netif_addr_lock_bh(bond_dev);
1990 bond_mc_list_destroy(bond);
1991 netif_addr_unlock_bh(bond_dev);
1992
1993 free_netdev(bond_dev);
1994}
1995
1982/* 1996/*
1983* First release a slave and than destroy the bond if no more slaves iare left. 1997* First release a slave and than destroy the bond if no more slaves iare left.
1984* Must be under rtnl_lock when this function is called. 1998* Must be under rtnl_lock when this function is called.
@@ -2376,6 +2390,9 @@ static void bond_miimon_commit(struct bonding *bond)
2376 continue; 2390 continue;
2377 2391
2378 case BOND_LINK_DOWN: 2392 case BOND_LINK_DOWN:
2393 if (slave->link_failure_count < UINT_MAX)
2394 slave->link_failure_count++;
2395
2379 slave->link = BOND_LINK_DOWN; 2396 slave->link = BOND_LINK_DOWN;
2380 2397
2381 if (bond->params.mode == BOND_MODE_ACTIVEBACKUP || 2398 if (bond->params.mode == BOND_MODE_ACTIVEBACKUP ||
@@ -4550,7 +4567,7 @@ static int bond_init(struct net_device *bond_dev, struct bond_params *params)
4550 4567
4551 bond_set_mode_ops(bond, bond->params.mode); 4568 bond_set_mode_ops(bond, bond->params.mode);
4552 4569
4553 bond_dev->destructor = free_netdev; 4570 bond_dev->destructor = bond_destructor;
4554 4571
4555 /* Initialize the device options */ 4572 /* Initialize the device options */
4556 bond_dev->tx_queue_len = 0; 4573 bond_dev->tx_queue_len = 0;
@@ -4589,20 +4606,6 @@ static int bond_init(struct net_device *bond_dev, struct bond_params *params)
4589 return 0; 4606 return 0;
4590} 4607}
4591 4608
4592/* De-initialize device specific data.
4593 * Caller must hold rtnl_lock.
4594 */
4595static void bond_deinit(struct net_device *bond_dev)
4596{
4597 struct bonding *bond = bond_dev->priv;
4598
4599 list_del(&bond->bond_list);
4600
4601#ifdef CONFIG_PROC_FS
4602 bond_remove_proc_entry(bond);
4603#endif
4604}
4605
4606static void bond_work_cancel_all(struct bonding *bond) 4609static void bond_work_cancel_all(struct bonding *bond)
4607{ 4610{
4608 write_lock_bh(&bond->lock); 4611 write_lock_bh(&bond->lock);
@@ -4624,6 +4627,22 @@ static void bond_work_cancel_all(struct bonding *bond)
4624 cancel_delayed_work(&bond->ad_work); 4627 cancel_delayed_work(&bond->ad_work);
4625} 4628}
4626 4629
4630/* De-initialize device specific data.
4631 * Caller must hold rtnl_lock.
4632 */
4633static void bond_deinit(struct net_device *bond_dev)
4634{
4635 struct bonding *bond = bond_dev->priv;
4636
4637 list_del(&bond->bond_list);
4638
4639 bond_work_cancel_all(bond);
4640
4641#ifdef CONFIG_PROC_FS
4642 bond_remove_proc_entry(bond);
4643#endif
4644}
4645
4627/* Unregister and free all bond devices. 4646/* Unregister and free all bond devices.
4628 * Caller must hold rtnl_lock. 4647 * Caller must hold rtnl_lock.
4629 */ 4648 */
@@ -4635,9 +4654,6 @@ static void bond_free_all(void)
4635 struct net_device *bond_dev = bond->dev; 4654 struct net_device *bond_dev = bond->dev;
4636 4655
4637 bond_work_cancel_all(bond); 4656 bond_work_cancel_all(bond);
4638 netif_addr_lock_bh(bond_dev);
4639 bond_mc_list_destroy(bond);
4640 netif_addr_unlock_bh(bond_dev);
4641 /* Release the bonded slaves */ 4657 /* Release the bonded slaves */
4642 bond_release_all(bond_dev); 4658 bond_release_all(bond_dev);
4643 bond_destroy(bond); 4659 bond_destroy(bond);
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 64b201134fdb..83a5cb6aa23b 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -586,6 +586,18 @@ static void gfar_configure_serdes(struct net_device *dev)
586 struct gfar_mii __iomem *regs = 586 struct gfar_mii __iomem *regs =
587 (void __iomem *)&priv->regs->gfar_mii_regs; 587 (void __iomem *)&priv->regs->gfar_mii_regs;
588 int tbipa = gfar_read(&priv->regs->tbipa); 588 int tbipa = gfar_read(&priv->regs->tbipa);
589 struct mii_bus *bus = gfar_get_miibus(priv);
590
591 if (bus)
592 mutex_lock(&bus->mdio_lock);
593
594 /* If the link is already up, we must already be ok, and don't need to
595 * configure and reset the TBI<->SerDes link. Maybe U-Boot configured
596 * everything for us? Resetting it takes the link down and requires
597 * several seconds for it to come back.
598 */
599 if (gfar_local_mdio_read(regs, tbipa, MII_BMSR) & BMSR_LSTATUS)
600 goto done;
589 601
590 /* Single clk mode, mii mode off(for serdes communication) */ 602 /* Single clk mode, mii mode off(for serdes communication) */
591 gfar_local_mdio_write(regs, tbipa, MII_TBICON, TBICON_CLK_SELECT); 603 gfar_local_mdio_write(regs, tbipa, MII_TBICON, TBICON_CLK_SELECT);
@@ -596,6 +608,10 @@ static void gfar_configure_serdes(struct net_device *dev)
596 608
597 gfar_local_mdio_write(regs, tbipa, MII_BMCR, BMCR_ANENABLE | 609 gfar_local_mdio_write(regs, tbipa, MII_BMCR, BMCR_ANENABLE |
598 BMCR_ANRESTART | BMCR_FULLDPLX | BMCR_SPEED1000); 610 BMCR_ANRESTART | BMCR_FULLDPLX | BMCR_SPEED1000);
611
612 done:
613 if (bus)
614 mutex_unlock(&bus->mdio_lock);
599} 615}
600 616
601static void init_registers(struct net_device *dev) 617static void init_registers(struct net_device *dev)
diff --git a/drivers/net/gianfar_mii.c b/drivers/net/gianfar_mii.c
index bf73eea98010..0e2595d24933 100644
--- a/drivers/net/gianfar_mii.c
+++ b/drivers/net/gianfar_mii.c
@@ -269,6 +269,27 @@ static struct device_driver gianfar_mdio_driver = {
269 .remove = gfar_mdio_remove, 269 .remove = gfar_mdio_remove,
270}; 270};
271 271
272static int match_mdio_bus(struct device *dev, void *data)
273{
274 const struct gfar_private *priv = data;
275 const struct platform_device *pdev = to_platform_device(dev);
276
277 return !strcmp(pdev->name, gianfar_mdio_driver.name) &&
278 pdev->id == priv->einfo->mdio_bus;
279}
280
281/* Given a gfar_priv structure, find the mii_bus controlled by this device (not
282 * necessarily the same as the bus the gfar's PHY is on), if one exists.
283 * Normally only the first gianfar controls a mii_bus. */
284struct mii_bus *gfar_get_miibus(const struct gfar_private *priv)
285{
286 /*const*/ struct device *d;
287
288 d = bus_find_device(gianfar_mdio_driver.bus, NULL, (void *)priv,
289 match_mdio_bus);
290 return d ? dev_get_drvdata(d) : NULL;
291}
292
272int __init gfar_mdio_init(void) 293int __init gfar_mdio_init(void)
273{ 294{
274 return driver_register(&gianfar_mdio_driver); 295 return driver_register(&gianfar_mdio_driver);
diff --git a/drivers/net/gianfar_mii.h b/drivers/net/gianfar_mii.h
index 2af28b16a0e2..02dc970ca1ff 100644
--- a/drivers/net/gianfar_mii.h
+++ b/drivers/net/gianfar_mii.h
@@ -18,6 +18,8 @@
18#ifndef __GIANFAR_MII_H 18#ifndef __GIANFAR_MII_H
19#define __GIANFAR_MII_H 19#define __GIANFAR_MII_H
20 20
21struct gfar_private; /* forward ref */
22
21#define MIIMIND_BUSY 0x00000001 23#define MIIMIND_BUSY 0x00000001
22#define MIIMIND_NOTVALID 0x00000004 24#define MIIMIND_NOTVALID 0x00000004
23 25
@@ -44,6 +46,7 @@ int gfar_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value);
44int gfar_local_mdio_write(struct gfar_mii __iomem *regs, int mii_id, 46int gfar_local_mdio_write(struct gfar_mii __iomem *regs, int mii_id,
45 int regnum, u16 value); 47 int regnum, u16 value);
46int gfar_local_mdio_read(struct gfar_mii __iomem *regs, int mii_id, int regnum); 48int gfar_local_mdio_read(struct gfar_mii __iomem *regs, int mii_id, int regnum);
49struct mii_bus *gfar_get_miibus(const struct gfar_private *priv);
47int __init gfar_mdio_init(void); 50int __init gfar_mdio_init(void);
48void gfar_mdio_exit(void); 51void gfar_mdio_exit(void);
49#endif /* GIANFAR_PHY_H */ 52#endif /* GIANFAR_PHY_H */
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index b1556b2e404c..a5f428bcc0eb 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -75,7 +75,7 @@
75#include "myri10ge_mcp.h" 75#include "myri10ge_mcp.h"
76#include "myri10ge_mcp_gen_header.h" 76#include "myri10ge_mcp_gen_header.h"
77 77
78#define MYRI10GE_VERSION_STR "1.4.3-1.371" 78#define MYRI10GE_VERSION_STR "1.4.3-1.375"
79 79
80MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); 80MODULE_DESCRIPTION("Myricom 10G driver (10GbE)");
81MODULE_AUTHOR("Maintainer: help@myri.com"); 81MODULE_AUTHOR("Maintainer: help@myri.com");
@@ -1393,6 +1393,7 @@ myri10ge_tx_done(struct myri10ge_slice_state *ss, int mcp_index)
1393 if (tx->req == tx->done) { 1393 if (tx->req == tx->done) {
1394 tx->queue_active = 0; 1394 tx->queue_active = 0;
1395 put_be32(htonl(1), tx->send_stop); 1395 put_be32(htonl(1), tx->send_stop);
1396 mmiowb();
1396 } 1397 }
1397 __netif_tx_unlock(dev_queue); 1398 __netif_tx_unlock(dev_queue);
1398 } 1399 }
@@ -2864,6 +2865,7 @@ again:
2864 if ((mgp->dev->real_num_tx_queues > 1) && tx->queue_active == 0) { 2865 if ((mgp->dev->real_num_tx_queues > 1) && tx->queue_active == 0) {
2865 tx->queue_active = 1; 2866 tx->queue_active = 1;
2866 put_be32(htonl(1), tx->send_go); 2867 put_be32(htonl(1), tx->send_go);
2868 mmiowb();
2867 } 2869 }
2868 tx->pkt_start++; 2870 tx->pkt_start++;
2869 if ((avail - count) < MXGEFW_MAX_SEND_DESC) { 2871 if ((avail - count) < MXGEFW_MAX_SEND_DESC) {
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
index c70870e0fd61..6f9895d4e5bd 100644
--- a/drivers/net/smc91x.c
+++ b/drivers/net/smc91x.c
@@ -2060,7 +2060,6 @@ static int smc_request_attrib(struct platform_device *pdev,
2060 struct net_device *ndev) 2060 struct net_device *ndev)
2061{ 2061{
2062 struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib"); 2062 struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib");
2063 struct smc_local *lp = netdev_priv(ndev);
2064 2063
2065 if (!res) 2064 if (!res)
2066 return 0; 2065 return 0;
@@ -2075,7 +2074,6 @@ static void smc_release_attrib(struct platform_device *pdev,
2075 struct net_device *ndev) 2074 struct net_device *ndev)
2076{ 2075{
2077 struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib"); 2076 struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib");
2078 struct smc_local *lp = netdev_priv(ndev);
2079 2077
2080 if (res) 2078 if (res)
2081 release_mem_region(res->start, ATTRIB_SIZE); 2079 release_mem_region(res->start, ATTRIB_SIZE);