aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-03-23 12:25:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-03-23 12:25:58 -0400
commitd56ffd38a93841a07c839a375049a56b51e9567c (patch)
treeac668709aa6f973de26e993f21adcf98626bed46 /drivers/net
parent12a37b5e2c93f6550b82490c3de6d4eedc509c39 (diff)
parent61fa9dcf9329cb92c220f7b656410fbe5e72f933 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (32 commits) ucc_geth: Fix oops when using fixed-link support dm9000: locking bugfix net: update dnet.c for bus_id removal dnet: DNET should depend on HAS_IOMEM dca: add missing copyright/license headers nl80211: Check that function pointer != NULL before using it sungem: missing net_device_ops be2net: fix to restore vlan ids into BE2 during a IF DOWN->UP cycle be2net: replenish when posting to rx-queue is starved in out of mem conditions bas_gigaset: correctly allocate USB interrupt transfer buffer smsc911x: reset last known duplex and carrier on open sh_eth: Fix mistake of the address of SH7763 sh_eth: Change handling of IRQ netns: oops in ip[6]_frag_reasm incrementing stats net: kfree(napi->skb) => kfree_skb net: fix sctp breakage ipv6: fix display of local and remote sit endpoints net: Document /proc/sys/net/core/netdev_budget tulip: fix crash on iface up with shirq debug virtio_net: Make virtio_net support carrier detection ...
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/Kconfig2
-rw-r--r--drivers/net/benet/be.h1
-rw-r--r--drivers/net/benet/be_main.c60
-rw-r--r--drivers/net/bnx2.c12
-rw-r--r--drivers/net/bonding/bond_main.c25
-rw-r--r--drivers/net/dm9000.c6
-rw-r--r--drivers/net/dnet.c6
-rw-r--r--drivers/net/sh_eth.c20
-rw-r--r--drivers/net/sh_eth.h4
-rw-r--r--drivers/net/smsc911x.c4
-rw-r--r--drivers/net/sungem.c9
-rw-r--r--drivers/net/tulip/tulip_core.c45
-rw-r--r--drivers/net/ucc_geth.c34
-rw-r--r--drivers/net/ucc_geth.h3
-rw-r--r--drivers/net/virtio_net.c3
-rw-r--r--drivers/net/wireless/ath9k/ath9k.h4
-rw-r--r--drivers/net/wireless/ath9k/core.h33
-rw-r--r--drivers/net/wireless/ath9k/hw.c22
-rw-r--r--drivers/net/wireless/ath9k/main.c1
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.c8
20 files changed, 202 insertions, 100 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 435e2e3a82c8..62d732a886f1 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1042,7 +1042,7 @@ config NI65
1042 1042
1043config DNET 1043config DNET
1044 tristate "Dave ethernet support (DNET)" 1044 tristate "Dave ethernet support (DNET)"
1045 depends on NET_ETHERNET 1045 depends on NET_ETHERNET && HAS_IOMEM
1046 select PHYLIB 1046 select PHYLIB
1047 help 1047 help
1048 The Dave ethernet interface (DNET) is found on Qong Board FPGA. 1048 The Dave ethernet interface (DNET) is found on Qong Board FPGA.
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h
index 63d593d53153..f327be57ca96 100644
--- a/drivers/net/benet/be.h
+++ b/drivers/net/benet/be.h
@@ -194,6 +194,7 @@ struct be_adapter {
194 struct be_eq_obj rx_eq; 194 struct be_eq_obj rx_eq;
195 struct be_rx_obj rx_obj; 195 struct be_rx_obj rx_obj;
196 u32 big_page_size; /* Compounded page size shared by rx wrbs */ 196 u32 big_page_size; /* Compounded page size shared by rx wrbs */
197 bool rx_post_starved; /* Zero rx frags have been posted to BE */
197 198
198 struct vlan_group *vlan_grp; 199 struct vlan_group *vlan_grp;
199 u16 num_vlans; 200 u16 num_vlans;
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 897a63de5bdb..0ecaffb70e58 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -273,26 +273,6 @@ static void be_rx_eqd_update(struct be_adapter *adapter)
273 rx_eq->cur_eqd = eqd; 273 rx_eq->cur_eqd = eqd;
274} 274}
275 275
276static void be_worker(struct work_struct *work)
277{
278 struct be_adapter *adapter =
279 container_of(work, struct be_adapter, work.work);
280 int status;
281
282 /* Check link */
283 be_link_status_update(adapter);
284
285 /* Get Stats */
286 status = be_cmd_get_stats(&adapter->ctrl, &adapter->stats.cmd);
287 if (!status)
288 netdev_stats_update(adapter);
289
290 /* Set EQ delay */
291 be_rx_eqd_update(adapter);
292
293 schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000));
294}
295
296static struct net_device_stats *be_get_stats(struct net_device *dev) 276static struct net_device_stats *be_get_stats(struct net_device *dev)
297{ 277{
298 struct be_adapter *adapter = netdev_priv(dev); 278 struct be_adapter *adapter = netdev_priv(dev);
@@ -493,7 +473,7 @@ static int be_change_mtu(struct net_device *netdev, int new_mtu)
493 * program them in BE. If more than BE_NUM_VLANS_SUPPORTED are configured, 473 * program them in BE. If more than BE_NUM_VLANS_SUPPORTED are configured,
494 * set the BE in promiscuous VLAN mode. 474 * set the BE in promiscuous VLAN mode.
495 */ 475 */
496static void be_vids_config(struct net_device *netdev) 476static void be_vid_config(struct net_device *netdev)
497{ 477{
498 struct be_adapter *adapter = netdev_priv(netdev); 478 struct be_adapter *adapter = netdev_priv(netdev);
499 u16 vtag[BE_NUM_VLANS_SUPPORTED]; 479 u16 vtag[BE_NUM_VLANS_SUPPORTED];
@@ -536,7 +516,7 @@ static void be_vlan_add_vid(struct net_device *netdev, u16 vid)
536 adapter->num_vlans++; 516 adapter->num_vlans++;
537 adapter->vlan_tag[vid] = 1; 517 adapter->vlan_tag[vid] = 1;
538 518
539 be_vids_config(netdev); 519 be_vid_config(netdev);
540} 520}
541 521
542static void be_vlan_rem_vid(struct net_device *netdev, u16 vid) 522static void be_vlan_rem_vid(struct net_device *netdev, u16 vid)
@@ -547,7 +527,7 @@ static void be_vlan_rem_vid(struct net_device *netdev, u16 vid)
547 adapter->vlan_tag[vid] = 0; 527 adapter->vlan_tag[vid] = 0;
548 528
549 vlan_group_set_device(adapter->vlan_grp, vid, NULL); 529 vlan_group_set_device(adapter->vlan_grp, vid, NULL);
550 be_vids_config(netdev); 530 be_vid_config(netdev);
551} 531}
552 532
553static void be_set_multicast_filter(struct net_device *netdev) 533static void be_set_multicast_filter(struct net_device *netdev)
@@ -900,8 +880,11 @@ static void be_post_rx_frags(struct be_adapter *adapter)
900 page_info->last_page_user = true; 880 page_info->last_page_user = true;
901 881
902 if (posted) { 882 if (posted) {
903 be_rxq_notify(&adapter->ctrl, rxq->id, posted);
904 atomic_add(posted, &rxq->used); 883 atomic_add(posted, &rxq->used);
884 be_rxq_notify(&adapter->ctrl, rxq->id, posted);
885 } else if (atomic_read(&rxq->used) == 0) {
886 /* Let be_worker replenish when memory is available */
887 adapter->rx_post_starved = true;
905 } 888 }
906 889
907 return; 890 return;
@@ -1305,6 +1288,31 @@ int be_poll_tx(struct napi_struct *napi, int budget)
1305 return 1; 1288 return 1;
1306} 1289}
1307 1290
1291static void be_worker(struct work_struct *work)
1292{
1293 struct be_adapter *adapter =
1294 container_of(work, struct be_adapter, work.work);
1295 int status;
1296
1297 /* Check link */
1298 be_link_status_update(adapter);
1299
1300 /* Get Stats */
1301 status = be_cmd_get_stats(&adapter->ctrl, &adapter->stats.cmd);
1302 if (!status)
1303 netdev_stats_update(adapter);
1304
1305 /* Set EQ delay */
1306 be_rx_eqd_update(adapter);
1307
1308 if (adapter->rx_post_starved) {
1309 adapter->rx_post_starved = false;
1310 be_post_rx_frags(adapter);
1311 }
1312
1313 schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000));
1314}
1315
1308static void be_msix_enable(struct be_adapter *adapter) 1316static void be_msix_enable(struct be_adapter *adapter)
1309{ 1317{
1310 int i, status; 1318 int i, status;
@@ -1422,6 +1430,8 @@ static int be_open(struct net_device *netdev)
1422 if (status != 0) 1430 if (status != 0)
1423 goto do_none; 1431 goto do_none;
1424 1432
1433 be_vid_config(netdev);
1434
1425 status = be_cmd_set_flow_control(ctrl, true, true); 1435 status = be_cmd_set_flow_control(ctrl, true, true);
1426 if (status != 0) 1436 if (status != 0)
1427 goto if_destroy; 1437 goto if_destroy;
@@ -1856,8 +1866,6 @@ static int be_resume(struct pci_dev *pdev)
1856 pci_set_power_state(pdev, 0); 1866 pci_set_power_state(pdev, 0);
1857 pci_restore_state(pdev); 1867 pci_restore_state(pdev);
1858 1868
1859 be_vids_config(netdev);
1860
1861 if (netif_running(netdev)) { 1869 if (netif_running(netdev)) {
1862 rtnl_lock(); 1870 rtnl_lock();
1863 be_open(netdev); 1871 be_open(netdev);
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 6500b7c4739f..6b6530ffdf19 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -57,8 +57,8 @@
57 57
58#define DRV_MODULE_NAME "bnx2" 58#define DRV_MODULE_NAME "bnx2"
59#define PFX DRV_MODULE_NAME ": " 59#define PFX DRV_MODULE_NAME ": "
60#define DRV_MODULE_VERSION "1.9.2" 60#define DRV_MODULE_VERSION "1.9.3"
61#define DRV_MODULE_RELDATE "Feb 11, 2009" 61#define DRV_MODULE_RELDATE "March 17, 2009"
62 62
63#define RUN_AT(x) (jiffies + (x)) 63#define RUN_AT(x) (jiffies + (x))
64 64
@@ -5843,9 +5843,6 @@ bnx2_enable_msix(struct bnx2 *bp, int msix_vecs)
5843 for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) { 5843 for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) {
5844 msix_ent[i].entry = i; 5844 msix_ent[i].entry = i;
5845 msix_ent[i].vector = 0; 5845 msix_ent[i].vector = 0;
5846
5847 snprintf(bp->irq_tbl[i].name, len, "%s-%d", dev->name, i);
5848 bp->irq_tbl[i].handler = bnx2_msi_1shot;
5849 } 5846 }
5850 5847
5851 rc = pci_enable_msix(bp->pdev, msix_ent, BNX2_MAX_MSIX_VEC); 5848 rc = pci_enable_msix(bp->pdev, msix_ent, BNX2_MAX_MSIX_VEC);
@@ -5854,8 +5851,11 @@ bnx2_enable_msix(struct bnx2 *bp, int msix_vecs)
5854 5851
5855 bp->irq_nvecs = msix_vecs; 5852 bp->irq_nvecs = msix_vecs;
5856 bp->flags |= BNX2_FLAG_USING_MSIX | BNX2_FLAG_ONE_SHOT_MSI; 5853 bp->flags |= BNX2_FLAG_USING_MSIX | BNX2_FLAG_ONE_SHOT_MSI;
5857 for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) 5854 for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) {
5858 bp->irq_tbl[i].vector = msix_ent[i].vector; 5855 bp->irq_tbl[i].vector = msix_ent[i].vector;
5856 snprintf(bp->irq_tbl[i].name, len, "%s-%d", dev->name, i);
5857 bp->irq_tbl[i].handler = bnx2_msi_1shot;
5858 }
5859} 5859}
5860 5860
5861static void 5861static void
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index e0578fe8c0db..3d76686dceca 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3537,11 +3537,26 @@ static int bond_slave_netdev_event(unsigned long event, struct net_device *slave
3537 } 3537 }
3538 break; 3538 break;
3539 case NETDEV_CHANGE: 3539 case NETDEV_CHANGE:
3540 /* 3540 if (bond->params.mode == BOND_MODE_8023AD || bond_is_lb(bond)) {
3541 * TODO: is this what we get if somebody 3541 struct slave *slave;
3542 * sets up a hierarchical bond, then rmmod's 3542
3543 * one of the slave bonding devices? 3543 slave = bond_get_slave_by_dev(bond, slave_dev);
3544 */ 3544 if (slave) {
3545 u16 old_speed = slave->speed;
3546 u16 old_duplex = slave->duplex;
3547
3548 bond_update_speed_duplex(slave);
3549
3550 if (bond_is_lb(bond))
3551 break;
3552
3553 if (old_speed != slave->speed)
3554 bond_3ad_adapter_speed_changed(slave);
3555 if (old_duplex != slave->duplex)
3556 bond_3ad_adapter_duplex_changed(slave);
3557 }
3558 }
3559
3545 break; 3560 break;
3546 case NETDEV_DOWN: 3561 case NETDEV_DOWN:
3547 /* 3562 /*
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index bcf92917bbf3..254ec62b5f58 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -930,13 +930,15 @@ static irqreturn_t dm9000_interrupt(int irq, void *dev_id)
930 struct net_device *dev = dev_id; 930 struct net_device *dev = dev_id;
931 board_info_t *db = netdev_priv(dev); 931 board_info_t *db = netdev_priv(dev);
932 int int_status; 932 int int_status;
933 unsigned long flags;
933 u8 reg_save; 934 u8 reg_save;
934 935
935 dm9000_dbg(db, 3, "entering %s\n", __func__); 936 dm9000_dbg(db, 3, "entering %s\n", __func__);
936 937
937 /* A real interrupt coming */ 938 /* A real interrupt coming */
938 939
939 spin_lock(&db->lock); 940 /* holders of db->lock must always block IRQs */
941 spin_lock_irqsave(&db->lock, flags);
940 942
941 /* Save previous register address */ 943 /* Save previous register address */
942 reg_save = readb(db->io_addr); 944 reg_save = readb(db->io_addr);
@@ -972,7 +974,7 @@ static irqreturn_t dm9000_interrupt(int irq, void *dev_id)
972 /* Restore previous register address */ 974 /* Restore previous register address */
973 writeb(reg_save, db->io_addr); 975 writeb(reg_save, db->io_addr);
974 976
975 spin_unlock(&db->lock); 977 spin_unlock_irqrestore(&db->lock, flags);
976 978
977 return IRQ_HANDLED; 979 return IRQ_HANDLED;
978} 980}
diff --git a/drivers/net/dnet.c b/drivers/net/dnet.c
index 5c347f70cb67..1b4063222a82 100644
--- a/drivers/net/dnet.c
+++ b/drivers/net/dnet.c
@@ -280,11 +280,11 @@ static int dnet_mii_probe(struct net_device *dev)
280 280
281 /* attach the mac to the phy */ 281 /* attach the mac to the phy */
282 if (bp->capabilities & DNET_HAS_RMII) { 282 if (bp->capabilities & DNET_HAS_RMII) {
283 phydev = phy_connect(dev, phydev->dev.bus_id, 283 phydev = phy_connect(dev, dev_name(&phydev->dev),
284 &dnet_handle_link_change, 0, 284 &dnet_handle_link_change, 0,
285 PHY_INTERFACE_MODE_RMII); 285 PHY_INTERFACE_MODE_RMII);
286 } else { 286 } else {
287 phydev = phy_connect(dev, phydev->dev.bus_id, 287 phydev = phy_connect(dev, dev_name(&phydev->dev),
288 &dnet_handle_link_change, 0, 288 &dnet_handle_link_change, 0,
289 PHY_INTERFACE_MODE_MII); 289 PHY_INTERFACE_MODE_MII);
290 } 290 }
@@ -927,7 +927,7 @@ static int __devinit dnet_probe(struct platform_device *pdev)
927 phydev = bp->phy_dev; 927 phydev = bp->phy_dev;
928 dev_info(&pdev->dev, "attached PHY driver [%s] " 928 dev_info(&pdev->dev, "attached PHY driver [%s] "
929 "(mii_bus:phy_addr=%s, irq=%d)\n", 929 "(mii_bus:phy_addr=%s, irq=%d)\n",
930 phydev->drv->name, phydev->dev.bus_id, phydev->irq); 930 phydev->drv->name, dev_name(&phydev->dev), phydev->irq);
931 931
932 return 0; 932 return 0;
933 933
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index 7f8e514eb5e9..7b1882765a0c 100644
--- a/drivers/net/sh_eth.c
+++ b/drivers/net/sh_eth.c
@@ -687,6 +687,7 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev)
687{ 687{
688 struct net_device *ndev = netdev; 688 struct net_device *ndev = netdev;
689 struct sh_eth_private *mdp = netdev_priv(ndev); 689 struct sh_eth_private *mdp = netdev_priv(ndev);
690 irqreturn_t ret = IRQ_NONE;
690 u32 ioaddr, boguscnt = RX_RING_SIZE; 691 u32 ioaddr, boguscnt = RX_RING_SIZE;
691 u32 intr_status = 0; 692 u32 intr_status = 0;
692 693
@@ -696,7 +697,13 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev)
696 /* Get interrpt stat */ 697 /* Get interrpt stat */
697 intr_status = ctrl_inl(ioaddr + EESR); 698 intr_status = ctrl_inl(ioaddr + EESR);
698 /* Clear interrupt */ 699 /* Clear interrupt */
699 ctrl_outl(intr_status, ioaddr + EESR); 700 if (intr_status & (EESR_FRC | EESR_RMAF | EESR_RRF |
701 EESR_RTLF | EESR_RTSF | EESR_PRE | EESR_CERF |
702 TX_CHECK | EESR_ERR_CHECK)) {
703 ctrl_outl(intr_status, ioaddr + EESR);
704 ret = IRQ_HANDLED;
705 } else
706 goto other_irq;
700 707
701 if (intr_status & (EESR_FRC | /* Frame recv*/ 708 if (intr_status & (EESR_FRC | /* Frame recv*/
702 EESR_RMAF | /* Multi cast address recv*/ 709 EESR_RMAF | /* Multi cast address recv*/
@@ -723,9 +730,10 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev)
723 ndev->name, intr_status); 730 ndev->name, intr_status);
724 } 731 }
725 732
733other_irq:
726 spin_unlock(&mdp->lock); 734 spin_unlock(&mdp->lock);
727 735
728 return IRQ_HANDLED; 736 return ret;
729} 737}
730 738
731static void sh_eth_timer(unsigned long data) 739static void sh_eth_timer(unsigned long data)
@@ -844,7 +852,13 @@ static int sh_eth_open(struct net_device *ndev)
844 int ret = 0; 852 int ret = 0;
845 struct sh_eth_private *mdp = netdev_priv(ndev); 853 struct sh_eth_private *mdp = netdev_priv(ndev);
846 854
847 ret = request_irq(ndev->irq, &sh_eth_interrupt, 0, ndev->name, ndev); 855 ret = request_irq(ndev->irq, &sh_eth_interrupt,
856#if defined(CONFIG_CPU_SUBTYPE_SH7763) || defined(CONFIG_CPU_SUBTYPE_SH7764)
857 IRQF_SHARED,
858#else
859 0,
860#endif
861 ndev->name, ndev);
848 if (ret) { 862 if (ret) {
849 printk(KERN_ERR "Can not assign IRQ number to %s\n", CARDNAME); 863 printk(KERN_ERR "Can not assign IRQ number to %s\n", CARDNAME);
850 return ret; 864 return ret;
diff --git a/drivers/net/sh_eth.h b/drivers/net/sh_eth.h
index 73bc7181cc18..1537e13e623d 100644
--- a/drivers/net/sh_eth.h
+++ b/drivers/net/sh_eth.h
@@ -43,8 +43,8 @@
43 43
44#define SH7763_SKB_ALIGN 32 44#define SH7763_SKB_ALIGN 32
45/* Chip Base Address */ 45/* Chip Base Address */
46# define SH_TSU_ADDR 0xFFE01800 46# define SH_TSU_ADDR 0xFEE01800
47# define ARSTR 0xFFE01800 47# define ARSTR SH_TSU_ADDR
48 48
49/* Chip Registers */ 49/* Chip Registers */
50/* E-DMAC */ 50/* E-DMAC */
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index 9a78daec2fe9..d1590ac55e4b 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -1225,6 +1225,10 @@ static int smsc911x_open(struct net_device *dev)
1225 dev_info(&dev->dev, "SMSC911x/921x identified at %#08lx, IRQ: %d\n", 1225 dev_info(&dev->dev, "SMSC911x/921x identified at %#08lx, IRQ: %d\n",
1226 (unsigned long)pdata->ioaddr, dev->irq); 1226 (unsigned long)pdata->ioaddr, dev->irq);
1227 1227
1228 /* Reset the last known duplex and carrier */
1229 pdata->last_duplex = -1;
1230 pdata->last_carrier = -1;
1231
1228 /* Bring the PHY up */ 1232 /* Bring the PHY up */
1229 phy_start(pdata->phy_dev); 1233 phy_start(pdata->phy_dev);
1230 1234
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 0fcb7503363d..c9c7650826c0 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -2998,8 +2998,11 @@ static const struct net_device_ops gem_netdev_ops = {
2998 .ndo_do_ioctl = gem_ioctl, 2998 .ndo_do_ioctl = gem_ioctl,
2999 .ndo_tx_timeout = gem_tx_timeout, 2999 .ndo_tx_timeout = gem_tx_timeout,
3000 .ndo_change_mtu = gem_change_mtu, 3000 .ndo_change_mtu = gem_change_mtu,
3001 .ndo_set_mac_address = eth_mac_addr,
3002 .ndo_validate_addr = eth_validate_addr, 3001 .ndo_validate_addr = eth_validate_addr,
3002 .ndo_set_mac_address = gem_set_mac_address,
3003#ifdef CONFIG_NET_POLL_CONTROLLER
3004 .ndo_poll_controller = gem_poll_controller,
3005#endif
3003}; 3006};
3004 3007
3005static int __devinit gem_init_one(struct pci_dev *pdev, 3008static int __devinit gem_init_one(struct pci_dev *pdev,
@@ -3161,10 +3164,6 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
3161 dev->watchdog_timeo = 5 * HZ; 3164 dev->watchdog_timeo = 5 * HZ;
3162 dev->irq = pdev->irq; 3165 dev->irq = pdev->irq;
3163 dev->dma = 0; 3166 dev->dma = 0;
3164 dev->set_mac_address = gem_set_mac_address;
3165#ifdef CONFIG_NET_POLL_CONTROLLER
3166 dev->poll_controller = gem_poll_controller;
3167#endif
3168 3167
3169 /* Set that now, in case PM kicks in now */ 3168 /* Set that now, in case PM kicks in now */
3170 pci_set_drvdata(pdev, dev); 3169 pci_set_drvdata(pdev, dev);
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index bee75fa87a9c..2abb5d3becc6 100644
--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -255,6 +255,7 @@ const char tulip_media_cap[32] =
255 255
256static void tulip_tx_timeout(struct net_device *dev); 256static void tulip_tx_timeout(struct net_device *dev);
257static void tulip_init_ring(struct net_device *dev); 257static void tulip_init_ring(struct net_device *dev);
258static void tulip_free_ring(struct net_device *dev);
258static int tulip_start_xmit(struct sk_buff *skb, struct net_device *dev); 259static int tulip_start_xmit(struct sk_buff *skb, struct net_device *dev);
259static int tulip_open(struct net_device *dev); 260static int tulip_open(struct net_device *dev);
260static int tulip_close(struct net_device *dev); 261static int tulip_close(struct net_device *dev);
@@ -502,16 +503,21 @@ tulip_open(struct net_device *dev)
502{ 503{
503 int retval; 504 int retval;
504 505
505 if ((retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev)))
506 return retval;
507
508 tulip_init_ring (dev); 506 tulip_init_ring (dev);
509 507
508 retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev);
509 if (retval)
510 goto free_ring;
511
510 tulip_up (dev); 512 tulip_up (dev);
511 513
512 netif_start_queue (dev); 514 netif_start_queue (dev);
513 515
514 return 0; 516 return 0;
517
518free_ring:
519 tulip_free_ring (dev);
520 return retval;
515} 521}
516 522
517 523
@@ -768,23 +774,11 @@ static void tulip_down (struct net_device *dev)
768 tulip_set_power_state (tp, 0, 1); 774 tulip_set_power_state (tp, 0, 1);
769} 775}
770 776
771 777static void tulip_free_ring (struct net_device *dev)
772static int tulip_close (struct net_device *dev)
773{ 778{
774 struct tulip_private *tp = netdev_priv(dev); 779 struct tulip_private *tp = netdev_priv(dev);
775 void __iomem *ioaddr = tp->base_addr;
776 int i; 780 int i;
777 781
778 netif_stop_queue (dev);
779
780 tulip_down (dev);
781
782 if (tulip_debug > 1)
783 printk (KERN_DEBUG "%s: Shutting down ethercard, status was %2.2x.\n",
784 dev->name, ioread32 (ioaddr + CSR5));
785
786 free_irq (dev->irq, dev);
787
788 /* Free all the skbuffs in the Rx queue. */ 782 /* Free all the skbuffs in the Rx queue. */
789 for (i = 0; i < RX_RING_SIZE; i++) { 783 for (i = 0; i < RX_RING_SIZE; i++) {
790 struct sk_buff *skb = tp->rx_buffers[i].skb; 784 struct sk_buff *skb = tp->rx_buffers[i].skb;
@@ -803,6 +797,7 @@ static int tulip_close (struct net_device *dev)
803 dev_kfree_skb (skb); 797 dev_kfree_skb (skb);
804 } 798 }
805 } 799 }
800
806 for (i = 0; i < TX_RING_SIZE; i++) { 801 for (i = 0; i < TX_RING_SIZE; i++) {
807 struct sk_buff *skb = tp->tx_buffers[i].skb; 802 struct sk_buff *skb = tp->tx_buffers[i].skb;
808 803
@@ -814,6 +809,24 @@ static int tulip_close (struct net_device *dev)
814 tp->tx_buffers[i].skb = NULL; 809 tp->tx_buffers[i].skb = NULL;
815 tp->tx_buffers[i].mapping = 0; 810 tp->tx_buffers[i].mapping = 0;
816 } 811 }
812}
813
814static int tulip_close (struct net_device *dev)
815{
816 struct tulip_private *tp = netdev_priv(dev);
817 void __iomem *ioaddr = tp->base_addr;
818
819 netif_stop_queue (dev);
820
821 tulip_down (dev);
822
823 if (tulip_debug > 1)
824 printk (KERN_DEBUG "%s: Shutting down ethercard, status was %2.2x.\n",
825 dev->name, ioread32 (ioaddr + CSR5));
826
827 free_irq (dev->irq, dev);
828
829 tulip_free_ring (dev);
817 830
818 return 0; 831 return 0;
819} 832}
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index e87986867ba5..1f61e42c641d 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -1536,32 +1536,15 @@ static void adjust_link(struct net_device *dev)
1536static int init_phy(struct net_device *dev) 1536static int init_phy(struct net_device *dev)
1537{ 1537{
1538 struct ucc_geth_private *priv = netdev_priv(dev); 1538 struct ucc_geth_private *priv = netdev_priv(dev);
1539 struct device_node *np = priv->node; 1539 struct ucc_geth_info *ug_info = priv->ug_info;
1540 struct device_node *phy, *mdio;
1541 const phandle *ph;
1542 char bus_name[MII_BUS_ID_SIZE];
1543 const unsigned int *id;
1544 struct phy_device *phydev; 1540 struct phy_device *phydev;
1545 char phy_id[BUS_ID_SIZE];
1546 1541
1547 priv->oldlink = 0; 1542 priv->oldlink = 0;
1548 priv->oldspeed = 0; 1543 priv->oldspeed = 0;
1549 priv->oldduplex = -1; 1544 priv->oldduplex = -1;
1550 1545
1551 ph = of_get_property(np, "phy-handle", NULL); 1546 phydev = phy_connect(dev, ug_info->phy_bus_id, &adjust_link, 0,
1552 phy = of_find_node_by_phandle(*ph); 1547 priv->phy_interface);
1553 mdio = of_get_parent(phy);
1554
1555 id = of_get_property(phy, "reg", NULL);
1556
1557 of_node_put(phy);
1558 of_node_put(mdio);
1559
1560 uec_mdio_bus_name(bus_name, mdio);
1561 snprintf(phy_id, sizeof(phy_id), "%s:%02x",
1562 bus_name, *id);
1563
1564 phydev = phy_connect(dev, phy_id, &adjust_link, 0, priv->phy_interface);
1565 1548
1566 if (IS_ERR(phydev)) { 1549 if (IS_ERR(phydev)) {
1567 printk("%s: Could not attach to PHY\n", dev->name); 1550 printk("%s: Could not attach to PHY\n", dev->name);
@@ -3629,10 +3612,12 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3629 ug_info->uf_info.irq = irq_of_parse_and_map(np, 0); 3612 ug_info->uf_info.irq = irq_of_parse_and_map(np, 0);
3630 fixed_link = of_get_property(np, "fixed-link", NULL); 3613 fixed_link = of_get_property(np, "fixed-link", NULL);
3631 if (fixed_link) { 3614 if (fixed_link) {
3632 snprintf(ug_info->mdio_bus, MII_BUS_ID_SIZE, "0"); 3615 snprintf(ug_info->phy_bus_id, sizeof(ug_info->phy_bus_id),
3633 ug_info->phy_address = fixed_link[0]; 3616 PHY_ID_FMT, "0", fixed_link[0]);
3634 phy = NULL; 3617 phy = NULL;
3635 } else { 3618 } else {
3619 char bus_name[MII_BUS_ID_SIZE];
3620
3636 ph = of_get_property(np, "phy-handle", NULL); 3621 ph = of_get_property(np, "phy-handle", NULL);
3637 phy = of_find_node_by_phandle(*ph); 3622 phy = of_find_node_by_phandle(*ph);
3638 3623
@@ -3643,7 +3628,6 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3643 prop = of_get_property(phy, "reg", NULL); 3628 prop = of_get_property(phy, "reg", NULL);
3644 if (prop == NULL) 3629 if (prop == NULL)
3645 return -1; 3630 return -1;
3646 ug_info->phy_address = *prop;
3647 3631
3648 /* Set the bus id */ 3632 /* Set the bus id */
3649 mdio = of_get_parent(phy); 3633 mdio = of_get_parent(phy);
@@ -3657,7 +3641,9 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3657 if (err) 3641 if (err)
3658 return -1; 3642 return -1;
3659 3643
3660 snprintf(ug_info->mdio_bus, MII_BUS_ID_SIZE, "%x", res.start); 3644 uec_mdio_bus_name(bus_name, mdio);
3645 snprintf(ug_info->phy_bus_id, sizeof(ug_info->phy_bus_id),
3646 "%s:%02x", bus_name, *prop);
3661 } 3647 }
3662 3648
3663 /* get the phy interface type, or default to MII */ 3649 /* get the phy interface type, or default to MII */
diff --git a/drivers/net/ucc_geth.h b/drivers/net/ucc_geth.h
index 16cbe42ba43c..611bdef2402b 100644
--- a/drivers/net/ucc_geth.h
+++ b/drivers/net/ucc_geth.h
@@ -1091,8 +1091,7 @@ struct ucc_geth_info {
1091 u32 eventRegMask; 1091 u32 eventRegMask;
1092 u16 pausePeriod; 1092 u16 pausePeriod;
1093 u16 extensionField; 1093 u16 extensionField;
1094 u8 phy_address; 1094 char phy_bus_id[BUS_ID_SIZE];
1095 char mdio_bus[MII_BUS_ID_SIZE];
1096 u8 weightfactor[NUM_TX_QUEUES]; 1095 u8 weightfactor[NUM_TX_QUEUES];
1097 u8 interruptcoalescingmaxvalue[NUM_RX_QUEUES]; 1096 u8 interruptcoalescingmaxvalue[NUM_RX_QUEUES];
1098 u8 l2qt[UCC_GETH_VLAN_PRIORITY_MAX]; 1097 u8 l2qt[UCC_GETH_VLAN_PRIORITY_MAX];
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index c68808336c8c..e67d16c2e5f3 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -612,6 +612,7 @@ static struct ethtool_ops virtnet_ethtool_ops = {
612 .set_tx_csum = virtnet_set_tx_csum, 612 .set_tx_csum = virtnet_set_tx_csum,
613 .set_sg = ethtool_op_set_sg, 613 .set_sg = ethtool_op_set_sg,
614 .set_tso = ethtool_op_set_tso, 614 .set_tso = ethtool_op_set_tso,
615 .get_link = ethtool_op_get_link,
615}; 616};
616 617
617#define MIN_MTU 68 618#define MIN_MTU 68
@@ -739,6 +740,8 @@ static int virtnet_probe(struct virtio_device *vdev)
739 goto unregister; 740 goto unregister;
740 } 741 }
741 742
743 netif_carrier_on(dev);
744
742 pr_debug("virtnet: registered device %s\n", dev->name); 745 pr_debug("virtnet: registered device %s\n", dev->name);
743 return 0; 746 return 0;
744 747
diff --git a/drivers/net/wireless/ath9k/ath9k.h b/drivers/net/wireless/ath9k/ath9k.h
index d27813502953..6650f609ece4 100644
--- a/drivers/net/wireless/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath9k/ath9k.h
@@ -587,8 +587,8 @@ struct ath9k_country_entry {
587 u8 iso[3]; 587 u8 iso[3];
588}; 588};
589 589
590#define REG_WRITE(_ah, _reg, _val) iowrite32(_val, _ah->ah_sh + _reg) 590#define REG_WRITE(_ah, _reg, _val) ath9k_iowrite32((_ah), (_reg), (_val))
591#define REG_READ(_ah, _reg) ioread32(_ah->ah_sh + _reg) 591#define REG_READ(_ah, _reg) ath9k_ioread32((_ah), (_reg))
592 592
593#define SM(_v, _f) (((_v) << _f##_S) & _f) 593#define SM(_v, _f) (((_v) << _f##_S) & _f)
594#define MS(_v, _f) (((_v) & _f) >> _f##_S) 594#define MS(_v, _f) (((_v) & _f) >> _f##_S)
diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h
index 4ca2aed236e0..139566cbbf65 100644
--- a/drivers/net/wireless/ath9k/core.h
+++ b/drivers/net/wireless/ath9k/core.h
@@ -701,6 +701,7 @@ struct ath_softc {
701 struct ath_hal *sc_ah; 701 struct ath_hal *sc_ah;
702 void __iomem *mem; 702 void __iomem *mem;
703 spinlock_t sc_resetlock; 703 spinlock_t sc_resetlock;
704 spinlock_t sc_serial_rw;
704 struct mutex mutex; 705 struct mutex mutex;
705 706
706 u8 sc_curbssid[ETH_ALEN]; 707 u8 sc_curbssid[ETH_ALEN];
@@ -751,4 +752,36 @@ int ath_get_hal_qnum(u16 queue, struct ath_softc *sc);
751int ath_get_mac80211_qnum(u32 queue, struct ath_softc *sc); 752int ath_get_mac80211_qnum(u32 queue, struct ath_softc *sc);
752int ath_cabq_update(struct ath_softc *); 753int ath_cabq_update(struct ath_softc *);
753 754
755/*
756 * Read and write, they both share the same lock. We do this to serialize
757 * reads and writes on Atheros 802.11n PCI devices only. This is required
758 * as the FIFO on these devices can only accept sanely 2 requests. After
759 * that the device goes bananas. Serializing the reads/writes prevents this
760 * from happening.
761 */
762
763static inline void ath9k_iowrite32(struct ath_hal *ah, u32 reg_offset, u32 val)
764{
765 if (ah->ah_config.serialize_regmode == SER_REG_MODE_ON) {
766 unsigned long flags;
767 spin_lock_irqsave(&ah->ah_sc->sc_serial_rw, flags);
768 iowrite32(val, ah->ah_sc->mem + reg_offset);
769 spin_unlock_irqrestore(&ah->ah_sc->sc_serial_rw, flags);
770 } else
771 iowrite32(val, ah->ah_sc->mem + reg_offset);
772}
773
774static inline unsigned int ath9k_ioread32(struct ath_hal *ah, u32 reg_offset)
775{
776 u32 val;
777 if (ah->ah_config.serialize_regmode == SER_REG_MODE_ON) {
778 unsigned long flags;
779 spin_lock_irqsave(&ah->ah_sc->sc_serial_rw, flags);
780 val = ioread32(ah->ah_sc->mem + reg_offset);
781 spin_unlock_irqrestore(&ah->ah_sc->sc_serial_rw, flags);
782 } else
783 val = ioread32(ah->ah_sc->mem + reg_offset);
784 return val;
785}
786
754#endif /* CORE_H */ 787#endif /* CORE_H */
diff --git a/drivers/net/wireless/ath9k/hw.c b/drivers/net/wireless/ath9k/hw.c
index 34474edefc97..c38a00bbce64 100644
--- a/drivers/net/wireless/ath9k/hw.c
+++ b/drivers/net/wireless/ath9k/hw.c
@@ -437,6 +437,25 @@ static void ath9k_hw_set_defaults(struct ath_hal *ah)
437 } 437 }
438 438
439 ah->ah_config.intr_mitigation = 1; 439 ah->ah_config.intr_mitigation = 1;
440
441 /*
442 * We need this for PCI devices only (Cardbus, PCI, miniPCI)
443 * _and_ if on non-uniprocessor systems (Multiprocessor/HT).
444 * This means we use it for all AR5416 devices, and the few
445 * minor PCI AR9280 devices out there.
446 *
447 * Serialization is required because these devices do not handle
448 * well the case of two concurrent reads/writes due to the latency
449 * involved. During one read/write another read/write can be issued
450 * on another CPU while the previous read/write may still be working
451 * on our hardware, if we hit this case the hardware poops in a loop.
452 * We prevent this by serializing reads and writes.
453 *
454 * This issue is not present on PCI-Express devices or pre-AR5416
455 * devices (legacy, 802.11abg).
456 */
457 if (num_possible_cpus() > 1)
458 ah->ah_config.serialize_regmode = SER_REG_MODE_AUTO;
440} 459}
441 460
442static struct ath_hal_5416 *ath9k_hw_newstate(u16 devid, 461static struct ath_hal_5416 *ath9k_hw_newstate(u16 devid,
@@ -668,7 +687,8 @@ static struct ath_hal *ath9k_hw_do_attach(u16 devid, struct ath_softc *sc,
668 } 687 }
669 688
670 if (ah->ah_config.serialize_regmode == SER_REG_MODE_AUTO) { 689 if (ah->ah_config.serialize_regmode == SER_REG_MODE_AUTO) {
671 if (ah->ah_macVersion == AR_SREV_VERSION_5416_PCI) { 690 if (ah->ah_macVersion == AR_SREV_VERSION_5416_PCI ||
691 (AR_SREV_9280(ah) && !ah->ah_isPciExpress)) {
672 ah->ah_config.serialize_regmode = 692 ah->ah_config.serialize_regmode =
673 SER_REG_MODE_ON; 693 SER_REG_MODE_ON;
674 } else { 694 } else {
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index 0e80990d8e84..3c04044a60bd 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -1336,6 +1336,7 @@ static int ath_init(u16 devid, struct ath_softc *sc)
1336 printk(KERN_ERR "Unable to create debugfs files\n"); 1336 printk(KERN_ERR "Unable to create debugfs files\n");
1337 1337
1338 spin_lock_init(&sc->sc_resetlock); 1338 spin_lock_init(&sc->sc_resetlock);
1339 spin_lock_init(&sc->sc_serial_rw);
1339 mutex_init(&sc->mutex); 1340 mutex_init(&sc->mutex);
1340 tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc); 1341 tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc);
1341 tasklet_init(&sc->bcon_tasklet, ath9k_beacon_tasklet, 1342 tasklet_init(&sc->bcon_tasklet, ath9k_beacon_tasklet,
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index a611ad857983..847057d682b1 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -575,13 +575,17 @@ static int zd_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
575 575
576 r = fill_ctrlset(mac, skb); 576 r = fill_ctrlset(mac, skb);
577 if (r) 577 if (r)
578 return r; 578 goto fail;
579 579
580 info->rate_driver_data[0] = hw; 580 info->rate_driver_data[0] = hw;
581 581
582 r = zd_usb_tx(&mac->chip.usb, skb); 582 r = zd_usb_tx(&mac->chip.usb, skb);
583 if (r) 583 if (r)
584 return r; 584 goto fail;
585 return 0;
586
587fail:
588 dev_kfree_skb(skb);
585 return 0; 589 return 0;
586} 590}
587 591