diff options
Diffstat (limited to 'drivers/net')
33 files changed, 347 insertions, 226 deletions
diff --git a/drivers/net/Makefile b/drivers/net/Makefile index 1fc4602a6ff2..a1c25cb4669f 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile | |||
@@ -102,7 +102,7 @@ obj-$(CONFIG_HAMACHI) += hamachi.o | |||
102 | obj-$(CONFIG_NET) += Space.o loopback.o | 102 | obj-$(CONFIG_NET) += Space.o loopback.o |
103 | obj-$(CONFIG_SEEQ8005) += seeq8005.o | 103 | obj-$(CONFIG_SEEQ8005) += seeq8005.o |
104 | obj-$(CONFIG_NET_SB1000) += sb1000.o | 104 | obj-$(CONFIG_NET_SB1000) += sb1000.o |
105 | obj-$(CONFIG_MAC8390) += mac8390.o 8390.o | 105 | obj-$(CONFIG_MAC8390) += mac8390.o |
106 | obj-$(CONFIG_APNE) += apne.o 8390.o | 106 | obj-$(CONFIG_APNE) += apne.o 8390.o |
107 | obj-$(CONFIG_PCMCIA_PCNET) += 8390.o | 107 | obj-$(CONFIG_PCMCIA_PCNET) += 8390.o |
108 | obj-$(CONFIG_HP100) += hp100.o | 108 | obj-$(CONFIG_HP100) += hp100.o |
diff --git a/drivers/net/arm/ixp4xx_eth.c b/drivers/net/arm/ixp4xx_eth.c index 448487e22fa3..a740053d3af3 100644 --- a/drivers/net/arm/ixp4xx_eth.c +++ b/drivers/net/arm/ixp4xx_eth.c | |||
@@ -338,12 +338,12 @@ static int ixp4xx_mdio_register(void) | |||
338 | if (cpu_is_ixp43x()) { | 338 | if (cpu_is_ixp43x()) { |
339 | /* IXP43x lacks NPE-B and uses NPE-C for MII PHY access */ | 339 | /* IXP43x lacks NPE-B and uses NPE-C for MII PHY access */ |
340 | if (!(ixp4xx_read_feature_bits() & IXP4XX_FEATURE_NPEC_ETH)) | 340 | if (!(ixp4xx_read_feature_bits() & IXP4XX_FEATURE_NPEC_ETH)) |
341 | return -ENOSYS; | 341 | return -ENODEV; |
342 | mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthC_BASE_VIRT; | 342 | mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthC_BASE_VIRT; |
343 | } else { | 343 | } else { |
344 | /* All MII PHY accesses use NPE-B Ethernet registers */ | 344 | /* All MII PHY accesses use NPE-B Ethernet registers */ |
345 | if (!(ixp4xx_read_feature_bits() & IXP4XX_FEATURE_NPEB_ETH0)) | 345 | if (!(ixp4xx_read_feature_bits() & IXP4XX_FEATURE_NPEB_ETH0)) |
346 | return -ENOSYS; | 346 | return -ENODEV; |
347 | mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthB_BASE_VIRT; | 347 | mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthB_BASE_VIRT; |
348 | } | 348 | } |
349 | 349 | ||
@@ -1174,7 +1174,7 @@ static int __devinit eth_init_one(struct platform_device *pdev) | |||
1174 | regs_phys = IXP4XX_EthC_BASE_PHYS; | 1174 | regs_phys = IXP4XX_EthC_BASE_PHYS; |
1175 | break; | 1175 | break; |
1176 | default: | 1176 | default: |
1177 | err = -ENOSYS; | 1177 | err = -ENODEV; |
1178 | goto err_free; | 1178 | goto err_free; |
1179 | } | 1179 | } |
1180 | 1180 | ||
@@ -1189,15 +1189,10 @@ static int __devinit eth_init_one(struct platform_device *pdev) | |||
1189 | goto err_free; | 1189 | goto err_free; |
1190 | } | 1190 | } |
1191 | 1191 | ||
1192 | if (register_netdev(dev)) { | ||
1193 | err = -EIO; | ||
1194 | goto err_npe_rel; | ||
1195 | } | ||
1196 | |||
1197 | port->mem_res = request_mem_region(regs_phys, REGS_SIZE, dev->name); | 1192 | port->mem_res = request_mem_region(regs_phys, REGS_SIZE, dev->name); |
1198 | if (!port->mem_res) { | 1193 | if (!port->mem_res) { |
1199 | err = -EBUSY; | 1194 | err = -EBUSY; |
1200 | goto err_unreg; | 1195 | goto err_npe_rel; |
1201 | } | 1196 | } |
1202 | 1197 | ||
1203 | port->plat = plat; | 1198 | port->plat = plat; |
@@ -1215,20 +1210,25 @@ static int __devinit eth_init_one(struct platform_device *pdev) | |||
1215 | snprintf(phy_id, BUS_ID_SIZE, PHY_ID_FMT, "0", plat->phy); | 1210 | snprintf(phy_id, BUS_ID_SIZE, PHY_ID_FMT, "0", plat->phy); |
1216 | port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0, | 1211 | port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0, |
1217 | PHY_INTERFACE_MODE_MII); | 1212 | PHY_INTERFACE_MODE_MII); |
1218 | if (IS_ERR(port->phydev)) { | 1213 | if ((err = IS_ERR(port->phydev))) |
1219 | printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); | 1214 | goto err_free_mem; |
1220 | return PTR_ERR(port->phydev); | ||
1221 | } | ||
1222 | 1215 | ||
1223 | port->phydev->irq = PHY_POLL; | 1216 | port->phydev->irq = PHY_POLL; |
1224 | 1217 | ||
1218 | if ((err = register_netdev(dev))) | ||
1219 | goto err_phy_dis; | ||
1220 | |||
1225 | printk(KERN_INFO "%s: MII PHY %i on %s\n", dev->name, plat->phy, | 1221 | printk(KERN_INFO "%s: MII PHY %i on %s\n", dev->name, plat->phy, |
1226 | npe_name(port->npe)); | 1222 | npe_name(port->npe)); |
1227 | 1223 | ||
1228 | return 0; | 1224 | return 0; |
1229 | 1225 | ||
1230 | err_unreg: | 1226 | err_phy_dis: |
1231 | unregister_netdev(dev); | 1227 | phy_disconnect(port->phydev); |
1228 | err_free_mem: | ||
1229 | npe_port_tab[NPE_ID(port->id)] = NULL; | ||
1230 | platform_set_drvdata(pdev, NULL); | ||
1231 | release_resource(port->mem_res); | ||
1232 | err_npe_rel: | 1232 | err_npe_rel: |
1233 | npe_release(port->npe); | 1233 | npe_release(port->npe); |
1234 | err_free: | 1234 | err_free: |
@@ -1242,6 +1242,7 @@ static int __devexit eth_remove_one(struct platform_device *pdev) | |||
1242 | struct port *port = netdev_priv(dev); | 1242 | struct port *port = netdev_priv(dev); |
1243 | 1243 | ||
1244 | unregister_netdev(dev); | 1244 | unregister_netdev(dev); |
1245 | phy_disconnect(port->phydev); | ||
1245 | npe_port_tab[NPE_ID(port->id)] = NULL; | 1246 | npe_port_tab[NPE_ID(port->id)] = NULL; |
1246 | platform_set_drvdata(pdev, NULL); | 1247 | platform_set_drvdata(pdev, NULL); |
1247 | npe_release(port->npe); | 1248 | npe_release(port->npe); |
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h index c49ddd08b2aa..b4bb06fdf307 100644 --- a/drivers/net/benet/be.h +++ b/drivers/net/benet/be.h | |||
@@ -35,8 +35,22 @@ | |||
35 | #define DRV_VER "2.0.348" | 35 | #define DRV_VER "2.0.348" |
36 | #define DRV_NAME "be2net" | 36 | #define DRV_NAME "be2net" |
37 | #define BE_NAME "ServerEngines BladeEngine2 10Gbps NIC" | 37 | #define BE_NAME "ServerEngines BladeEngine2 10Gbps NIC" |
38 | #define OC_NAME "Emulex OneConnect 10Gbps NIC" | ||
38 | #define DRV_DESC BE_NAME "Driver" | 39 | #define DRV_DESC BE_NAME "Driver" |
39 | 40 | ||
41 | #define BE_VENDOR_ID 0x19a2 | ||
42 | #define BE_DEVICE_ID1 0x211 | ||
43 | #define OC_DEVICE_ID1 0x700 | ||
44 | #define OC_DEVICE_ID2 0x701 | ||
45 | |||
46 | static inline char *nic_name(struct pci_dev *pdev) | ||
47 | { | ||
48 | if (pdev->device == OC_DEVICE_ID1 || pdev->device == OC_DEVICE_ID2) | ||
49 | return OC_NAME; | ||
50 | else | ||
51 | return BE_NAME; | ||
52 | } | ||
53 | |||
40 | /* Number of bytes of an RX frame that are copied to skb->data */ | 54 | /* Number of bytes of an RX frame that are copied to skb->data */ |
41 | #define BE_HDR_LEN 64 | 55 | #define BE_HDR_LEN 64 |
42 | #define BE_MAX_JUMBO_FRAME_SIZE 9018 | 56 | #define BE_MAX_JUMBO_FRAME_SIZE 9018 |
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 30d0c81c989e..5c378b5e8e41 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -28,10 +28,10 @@ static unsigned int rx_frag_size = 2048; | |||
28 | module_param(rx_frag_size, uint, S_IRUGO); | 28 | module_param(rx_frag_size, uint, S_IRUGO); |
29 | MODULE_PARM_DESC(rx_frag_size, "Size of a fragment that holds rcvd data."); | 29 | MODULE_PARM_DESC(rx_frag_size, "Size of a fragment that holds rcvd data."); |
30 | 30 | ||
31 | #define BE_VENDOR_ID 0x19a2 | ||
32 | #define BE2_DEVICE_ID_1 0x0211 | ||
33 | static DEFINE_PCI_DEVICE_TABLE(be_dev_ids) = { | 31 | static DEFINE_PCI_DEVICE_TABLE(be_dev_ids) = { |
34 | { PCI_DEVICE(BE_VENDOR_ID, BE2_DEVICE_ID_1) }, | 32 | { PCI_DEVICE(BE_VENDOR_ID, BE_DEVICE_ID1) }, |
33 | { PCI_DEVICE(BE_VENDOR_ID, OC_DEVICE_ID1) }, | ||
34 | { PCI_DEVICE(BE_VENDOR_ID, OC_DEVICE_ID2) }, | ||
35 | { 0 } | 35 | { 0 } |
36 | }; | 36 | }; |
37 | MODULE_DEVICE_TABLE(pci, be_dev_ids); | 37 | MODULE_DEVICE_TABLE(pci, be_dev_ids); |
@@ -1859,7 +1859,7 @@ static int __devinit be_probe(struct pci_dev *pdev, | |||
1859 | if (status != 0) | 1859 | if (status != 0) |
1860 | goto stats_clean; | 1860 | goto stats_clean; |
1861 | 1861 | ||
1862 | dev_info(&pdev->dev, BE_NAME " port %d\n", adapter->port_num); | 1862 | dev_info(&pdev->dev, "%s port %d\n", nic_name(pdev), adapter->port_num); |
1863 | return 0; | 1863 | return 0; |
1864 | 1864 | ||
1865 | stats_clean: | 1865 | stats_clean: |
@@ -1873,7 +1873,7 @@ rel_reg: | |||
1873 | disable_dev: | 1873 | disable_dev: |
1874 | pci_disable_device(pdev); | 1874 | pci_disable_device(pdev); |
1875 | do_none: | 1875 | do_none: |
1876 | dev_warn(&pdev->dev, BE_NAME " initialization failed\n"); | 1876 | dev_err(&pdev->dev, "%s initialization failed\n", nic_name(pdev)); |
1877 | return status; | 1877 | return status; |
1878 | } | 1878 | } |
1879 | 1879 | ||
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index d47839184a06..b0cb29d4cc01 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -54,8 +54,8 @@ | |||
54 | 54 | ||
55 | #define DRV_MODULE_NAME "bnx2" | 55 | #define DRV_MODULE_NAME "bnx2" |
56 | #define PFX DRV_MODULE_NAME ": " | 56 | #define PFX DRV_MODULE_NAME ": " |
57 | #define DRV_MODULE_VERSION "2.0.0" | 57 | #define DRV_MODULE_VERSION "2.0.1" |
58 | #define DRV_MODULE_RELDATE "April 2, 2009" | 58 | #define DRV_MODULE_RELDATE "May 6, 2009" |
59 | #define FW_MIPS_FILE_06 "bnx2/bnx2-mips-06-4.6.16.fw" | 59 | #define FW_MIPS_FILE_06 "bnx2/bnx2-mips-06-4.6.16.fw" |
60 | #define FW_RV2P_FILE_06 "bnx2/bnx2-rv2p-06-4.6.16.fw" | 60 | #define FW_RV2P_FILE_06 "bnx2/bnx2-rv2p-06-4.6.16.fw" |
61 | #define FW_MIPS_FILE_09 "bnx2/bnx2-mips-09-4.6.17.fw" | 61 | #define FW_MIPS_FILE_09 "bnx2/bnx2-mips-09-4.6.17.fw" |
@@ -2600,6 +2600,7 @@ bnx2_get_hw_tx_cons(struct bnx2_napi *bnapi) | |||
2600 | /* Tell compiler that status block fields can change. */ | 2600 | /* Tell compiler that status block fields can change. */ |
2601 | barrier(); | 2601 | barrier(); |
2602 | cons = *bnapi->hw_tx_cons_ptr; | 2602 | cons = *bnapi->hw_tx_cons_ptr; |
2603 | barrier(); | ||
2603 | if (unlikely((cons & MAX_TX_DESC_CNT) == MAX_TX_DESC_CNT)) | 2604 | if (unlikely((cons & MAX_TX_DESC_CNT) == MAX_TX_DESC_CNT)) |
2604 | cons++; | 2605 | cons++; |
2605 | return cons; | 2606 | return cons; |
@@ -2879,6 +2880,7 @@ bnx2_get_hw_rx_cons(struct bnx2_napi *bnapi) | |||
2879 | /* Tell compiler that status block fields can change. */ | 2880 | /* Tell compiler that status block fields can change. */ |
2880 | barrier(); | 2881 | barrier(); |
2881 | cons = *bnapi->hw_rx_cons_ptr; | 2882 | cons = *bnapi->hw_rx_cons_ptr; |
2883 | barrier(); | ||
2882 | if (unlikely((cons & MAX_RX_DESC_CNT) == MAX_RX_DESC_CNT)) | 2884 | if (unlikely((cons & MAX_RX_DESC_CNT) == MAX_RX_DESC_CNT)) |
2883 | cons++; | 2885 | cons++; |
2884 | return cons; | 2886 | return cons; |
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index 8c2e5ab51f08..faf094abef7f 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c | |||
@@ -1465,6 +1465,12 @@ static struct aggregator *ad_agg_selection_test(struct aggregator *best, | |||
1465 | return best; | 1465 | return best; |
1466 | } | 1466 | } |
1467 | 1467 | ||
1468 | static int agg_device_up(const struct aggregator *agg) | ||
1469 | { | ||
1470 | return (netif_running(agg->slave->dev) && | ||
1471 | netif_carrier_ok(agg->slave->dev)); | ||
1472 | } | ||
1473 | |||
1468 | /** | 1474 | /** |
1469 | * ad_agg_selection_logic - select an aggregation group for a team | 1475 | * ad_agg_selection_logic - select an aggregation group for a team |
1470 | * @aggregator: the aggregator we're looking at | 1476 | * @aggregator: the aggregator we're looking at |
@@ -1496,14 +1502,13 @@ static void ad_agg_selection_logic(struct aggregator *agg) | |||
1496 | struct port *port; | 1502 | struct port *port; |
1497 | 1503 | ||
1498 | origin = agg; | 1504 | origin = agg; |
1499 | |||
1500 | active = __get_active_agg(agg); | 1505 | active = __get_active_agg(agg); |
1501 | best = active; | 1506 | best = (active && agg_device_up(active)) ? active : NULL; |
1502 | 1507 | ||
1503 | do { | 1508 | do { |
1504 | agg->is_active = 0; | 1509 | agg->is_active = 0; |
1505 | 1510 | ||
1506 | if (agg->num_of_ports) | 1511 | if (agg->num_of_ports && agg_device_up(agg)) |
1507 | best = ad_agg_selection_test(best, agg); | 1512 | best = ad_agg_selection_test(best, agg); |
1508 | 1513 | ||
1509 | } while ((agg = __get_next_agg(agg))); | 1514 | } while ((agg = __get_next_agg(agg))); |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 2188a96fc090..74824028f85c 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -5181,7 +5181,6 @@ static int __init bonding_init(void) | |||
5181 | { | 5181 | { |
5182 | int i; | 5182 | int i; |
5183 | int res; | 5183 | int res; |
5184 | struct bonding *bond; | ||
5185 | 5184 | ||
5186 | printk(KERN_INFO "%s", version); | 5185 | printk(KERN_INFO "%s", version); |
5187 | 5186 | ||
@@ -5212,13 +5211,6 @@ static int __init bonding_init(void) | |||
5212 | 5211 | ||
5213 | goto out; | 5212 | goto out; |
5214 | err: | 5213 | err: |
5215 | list_for_each_entry(bond, &bond_dev_list, bond_list) { | ||
5216 | bond_work_cancel_all(bond); | ||
5217 | destroy_workqueue(bond->wq); | ||
5218 | } | ||
5219 | |||
5220 | bond_destroy_sysfs(); | ||
5221 | |||
5222 | rtnl_lock(); | 5214 | rtnl_lock(); |
5223 | bond_free_all(); | 5215 | bond_free_all(); |
5224 | rtnl_unlock(); | 5216 | rtnl_unlock(); |
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index b2c49679bba7..a0519184e54e 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -1885,8 +1885,17 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit) | |||
1885 | 1885 | ||
1886 | if (unlikely(!newskb)) | 1886 | if (unlikely(!newskb)) |
1887 | newskb = skb; | 1887 | newskb = skb; |
1888 | else if (skb) | 1888 | else if (skb) { |
1889 | /* | ||
1890 | * We need to reset ->data to what it | ||
1891 | * was before gfar_new_skb() re-aligned | ||
1892 | * it to an RXBUF_ALIGNMENT boundary | ||
1893 | * before we put the skb back on the | ||
1894 | * recycle list. | ||
1895 | */ | ||
1896 | skb->data = skb->head + NET_SKB_PAD; | ||
1889 | __skb_queue_head(&priv->rx_recycle, skb); | 1897 | __skb_queue_head(&priv->rx_recycle, skb); |
1898 | } | ||
1890 | } else { | 1899 | } else { |
1891 | /* Increment the number of packets */ | 1900 | /* Increment the number of packets */ |
1892 | dev->stats.rx_packets++; | 1901 | dev->stats.rx_packets++; |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 08c801490c72..e25343588fc7 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -2006,7 +2006,7 @@ static void igb_setup_rctl(struct igb_adapter *adapter) | |||
2006 | struct e1000_hw *hw = &adapter->hw; | 2006 | struct e1000_hw *hw = &adapter->hw; |
2007 | u32 rctl; | 2007 | u32 rctl; |
2008 | u32 srrctl = 0; | 2008 | u32 srrctl = 0; |
2009 | int i, j; | 2009 | int i; |
2010 | 2010 | ||
2011 | rctl = rd32(E1000_RCTL); | 2011 | rctl = rd32(E1000_RCTL); |
2012 | 2012 | ||
@@ -2071,8 +2071,6 @@ static void igb_setup_rctl(struct igb_adapter *adapter) | |||
2071 | if (adapter->vfs_allocated_count) { | 2071 | if (adapter->vfs_allocated_count) { |
2072 | u32 vmolr; | 2072 | u32 vmolr; |
2073 | 2073 | ||
2074 | j = adapter->rx_ring[0].reg_idx; | ||
2075 | |||
2076 | /* set all queue drop enable bits */ | 2074 | /* set all queue drop enable bits */ |
2077 | wr32(E1000_QDE, ALL_QUEUES); | 2075 | wr32(E1000_QDE, ALL_QUEUES); |
2078 | srrctl |= E1000_SRRCTL_DROP_EN; | 2076 | srrctl |= E1000_SRRCTL_DROP_EN; |
@@ -2080,16 +2078,16 @@ static void igb_setup_rctl(struct igb_adapter *adapter) | |||
2080 | /* disable queue 0 to prevent tail write w/o re-config */ | 2078 | /* disable queue 0 to prevent tail write w/o re-config */ |
2081 | wr32(E1000_RXDCTL(0), 0); | 2079 | wr32(E1000_RXDCTL(0), 0); |
2082 | 2080 | ||
2083 | vmolr = rd32(E1000_VMOLR(j)); | 2081 | vmolr = rd32(E1000_VMOLR(adapter->vfs_allocated_count)); |
2084 | if (rctl & E1000_RCTL_LPE) | 2082 | if (rctl & E1000_RCTL_LPE) |
2085 | vmolr |= E1000_VMOLR_LPE; | 2083 | vmolr |= E1000_VMOLR_LPE; |
2086 | if (adapter->num_rx_queues > 0) | 2084 | if (adapter->num_rx_queues > 1) |
2087 | vmolr |= E1000_VMOLR_RSSE; | 2085 | vmolr |= E1000_VMOLR_RSSE; |
2088 | wr32(E1000_VMOLR(j), vmolr); | 2086 | wr32(E1000_VMOLR(adapter->vfs_allocated_count), vmolr); |
2089 | } | 2087 | } |
2090 | 2088 | ||
2091 | for (i = 0; i < adapter->num_rx_queues; i++) { | 2089 | for (i = 0; i < adapter->num_rx_queues; i++) { |
2092 | j = adapter->rx_ring[i].reg_idx; | 2090 | int j = adapter->rx_ring[i].reg_idx; |
2093 | wr32(E1000_SRRCTL(j), srrctl); | 2091 | wr32(E1000_SRRCTL(j), srrctl); |
2094 | } | 2092 | } |
2095 | 2093 | ||
diff --git a/drivers/net/mac8390.c b/drivers/net/mac8390.c index 8e884869a05b..f26667d5eaae 100644 --- a/drivers/net/mac8390.c +++ b/drivers/net/mac8390.c | |||
@@ -304,7 +304,7 @@ struct net_device * __init mac8390_probe(int unit) | |||
304 | if (!MACH_IS_MAC) | 304 | if (!MACH_IS_MAC) |
305 | return ERR_PTR(-ENODEV); | 305 | return ERR_PTR(-ENODEV); |
306 | 306 | ||
307 | dev = alloc_ei_netdev(); | 307 | dev = ____alloc_ei_netdev(0); |
308 | if (!dev) | 308 | if (!dev) |
309 | return ERR_PTR(-ENOMEM); | 309 | return ERR_PTR(-ENOMEM); |
310 | 310 | ||
@@ -481,10 +481,10 @@ void cleanup_module(void) | |||
481 | static const struct net_device_ops mac8390_netdev_ops = { | 481 | static const struct net_device_ops mac8390_netdev_ops = { |
482 | .ndo_open = mac8390_open, | 482 | .ndo_open = mac8390_open, |
483 | .ndo_stop = mac8390_close, | 483 | .ndo_stop = mac8390_close, |
484 | .ndo_start_xmit = ei_start_xmit, | 484 | .ndo_start_xmit = __ei_start_xmit, |
485 | .ndo_tx_timeout = ei_tx_timeout, | 485 | .ndo_tx_timeout = __ei_tx_timeout, |
486 | .ndo_get_stats = ei_get_stats, | 486 | .ndo_get_stats = __ei_get_stats, |
487 | .ndo_set_multicast_list = ei_set_multicast_list, | 487 | .ndo_set_multicast_list = __ei_set_multicast_list, |
488 | .ndo_validate_addr = eth_validate_addr, | 488 | .ndo_validate_addr = eth_validate_addr, |
489 | .ndo_set_mac_address = eth_mac_addr, | 489 | .ndo_set_mac_address = eth_mac_addr, |
490 | .ndo_change_mtu = eth_change_mtu, | 490 | .ndo_change_mtu = eth_change_mtu, |
diff --git a/drivers/net/meth.c b/drivers/net/meth.c index aa08987f6e81..dbd3436912b8 100644 --- a/drivers/net/meth.c +++ b/drivers/net/meth.c | |||
@@ -127,11 +127,11 @@ static unsigned long mdio_read(struct meth_private *priv, unsigned long phyreg) | |||
127 | static int mdio_probe(struct meth_private *priv) | 127 | static int mdio_probe(struct meth_private *priv) |
128 | { | 128 | { |
129 | int i; | 129 | int i; |
130 | unsigned long p2, p3; | 130 | unsigned long p2, p3, flags; |
131 | /* check if phy is detected already */ | 131 | /* check if phy is detected already */ |
132 | if(priv->phy_addr>=0&&priv->phy_addr<32) | 132 | if(priv->phy_addr>=0&&priv->phy_addr<32) |
133 | return 0; | 133 | return 0; |
134 | spin_lock(&priv->meth_lock); | 134 | spin_lock_irqsave(&priv->meth_lock, flags); |
135 | for (i=0;i<32;++i){ | 135 | for (i=0;i<32;++i){ |
136 | priv->phy_addr=i; | 136 | priv->phy_addr=i; |
137 | p2=mdio_read(priv,2); | 137 | p2=mdio_read(priv,2); |
@@ -157,7 +157,7 @@ static int mdio_probe(struct meth_private *priv) | |||
157 | break; | 157 | break; |
158 | } | 158 | } |
159 | } | 159 | } |
160 | spin_unlock(&priv->meth_lock); | 160 | spin_unlock_irqrestore(&priv->meth_lock, flags); |
161 | if(priv->phy_addr<32) { | 161 | if(priv->phy_addr<32) { |
162 | return 0; | 162 | return 0; |
163 | } | 163 | } |
@@ -373,14 +373,14 @@ static int meth_release(struct net_device *dev) | |||
373 | static void meth_rx(struct net_device* dev, unsigned long int_status) | 373 | static void meth_rx(struct net_device* dev, unsigned long int_status) |
374 | { | 374 | { |
375 | struct sk_buff *skb; | 375 | struct sk_buff *skb; |
376 | unsigned long status; | 376 | unsigned long status, flags; |
377 | struct meth_private *priv = netdev_priv(dev); | 377 | struct meth_private *priv = netdev_priv(dev); |
378 | unsigned long fifo_rptr = (int_status & METH_INT_RX_RPTR_MASK) >> 8; | 378 | unsigned long fifo_rptr = (int_status & METH_INT_RX_RPTR_MASK) >> 8; |
379 | 379 | ||
380 | spin_lock(&priv->meth_lock); | 380 | spin_lock_irqsave(&priv->meth_lock, flags); |
381 | priv->dma_ctrl &= ~METH_DMA_RX_INT_EN; | 381 | priv->dma_ctrl &= ~METH_DMA_RX_INT_EN; |
382 | mace->eth.dma_ctrl = priv->dma_ctrl; | 382 | mace->eth.dma_ctrl = priv->dma_ctrl; |
383 | spin_unlock(&priv->meth_lock); | 383 | spin_unlock_irqrestore(&priv->meth_lock, flags); |
384 | 384 | ||
385 | if (int_status & METH_INT_RX_UNDERFLOW) { | 385 | if (int_status & METH_INT_RX_UNDERFLOW) { |
386 | fifo_rptr = (fifo_rptr - 1) & 0x0f; | 386 | fifo_rptr = (fifo_rptr - 1) & 0x0f; |
@@ -452,12 +452,12 @@ static void meth_rx(struct net_device* dev, unsigned long int_status) | |||
452 | mace->eth.rx_fifo = priv->rx_ring_dmas[priv->rx_write]; | 452 | mace->eth.rx_fifo = priv->rx_ring_dmas[priv->rx_write]; |
453 | ADVANCE_RX_PTR(priv->rx_write); | 453 | ADVANCE_RX_PTR(priv->rx_write); |
454 | } | 454 | } |
455 | spin_lock(&priv->meth_lock); | 455 | spin_lock_irqsave(&priv->meth_lock, flags); |
456 | /* In case there was underflow, and Rx DMA was disabled */ | 456 | /* In case there was underflow, and Rx DMA was disabled */ |
457 | priv->dma_ctrl |= METH_DMA_RX_INT_EN | METH_DMA_RX_EN; | 457 | priv->dma_ctrl |= METH_DMA_RX_INT_EN | METH_DMA_RX_EN; |
458 | mace->eth.dma_ctrl = priv->dma_ctrl; | 458 | mace->eth.dma_ctrl = priv->dma_ctrl; |
459 | mace->eth.int_stat = METH_INT_RX_THRESHOLD; | 459 | mace->eth.int_stat = METH_INT_RX_THRESHOLD; |
460 | spin_unlock(&priv->meth_lock); | 460 | spin_unlock_irqrestore(&priv->meth_lock, flags); |
461 | } | 461 | } |
462 | 462 | ||
463 | static int meth_tx_full(struct net_device *dev) | 463 | static int meth_tx_full(struct net_device *dev) |
@@ -470,11 +470,11 @@ static int meth_tx_full(struct net_device *dev) | |||
470 | static void meth_tx_cleanup(struct net_device* dev, unsigned long int_status) | 470 | static void meth_tx_cleanup(struct net_device* dev, unsigned long int_status) |
471 | { | 471 | { |
472 | struct meth_private *priv = netdev_priv(dev); | 472 | struct meth_private *priv = netdev_priv(dev); |
473 | unsigned long status; | 473 | unsigned long status, flags; |
474 | struct sk_buff *skb; | 474 | struct sk_buff *skb; |
475 | unsigned long rptr = (int_status&TX_INFO_RPTR) >> 16; | 475 | unsigned long rptr = (int_status&TX_INFO_RPTR) >> 16; |
476 | 476 | ||
477 | spin_lock(&priv->meth_lock); | 477 | spin_lock_irqsave(&priv->meth_lock, flags); |
478 | 478 | ||
479 | /* Stop DMA notification */ | 479 | /* Stop DMA notification */ |
480 | priv->dma_ctrl &= ~(METH_DMA_TX_INT_EN); | 480 | priv->dma_ctrl &= ~(METH_DMA_TX_INT_EN); |
@@ -527,12 +527,13 @@ static void meth_tx_cleanup(struct net_device* dev, unsigned long int_status) | |||
527 | } | 527 | } |
528 | 528 | ||
529 | mace->eth.int_stat = METH_INT_TX_EMPTY | METH_INT_TX_PKT; | 529 | mace->eth.int_stat = METH_INT_TX_EMPTY | METH_INT_TX_PKT; |
530 | spin_unlock(&priv->meth_lock); | 530 | spin_unlock_irqrestore(&priv->meth_lock, flags); |
531 | } | 531 | } |
532 | 532 | ||
533 | static void meth_error(struct net_device* dev, unsigned status) | 533 | static void meth_error(struct net_device* dev, unsigned status) |
534 | { | 534 | { |
535 | struct meth_private *priv = netdev_priv(dev); | 535 | struct meth_private *priv = netdev_priv(dev); |
536 | unsigned long flags; | ||
536 | 537 | ||
537 | printk(KERN_WARNING "meth: error status: 0x%08x\n",status); | 538 | printk(KERN_WARNING "meth: error status: 0x%08x\n",status); |
538 | /* check for errors too... */ | 539 | /* check for errors too... */ |
@@ -547,7 +548,7 @@ static void meth_error(struct net_device* dev, unsigned status) | |||
547 | printk(KERN_WARNING "meth: Rx overflow\n"); | 548 | printk(KERN_WARNING "meth: Rx overflow\n"); |
548 | if (status & (METH_INT_RX_UNDERFLOW)) { | 549 | if (status & (METH_INT_RX_UNDERFLOW)) { |
549 | printk(KERN_WARNING "meth: Rx underflow\n"); | 550 | printk(KERN_WARNING "meth: Rx underflow\n"); |
550 | spin_lock(&priv->meth_lock); | 551 | spin_lock_irqsave(&priv->meth_lock, flags); |
551 | mace->eth.int_stat = METH_INT_RX_UNDERFLOW; | 552 | mace->eth.int_stat = METH_INT_RX_UNDERFLOW; |
552 | /* more underflow interrupts will be delivered, | 553 | /* more underflow interrupts will be delivered, |
553 | * effectively throwing us into an infinite loop. | 554 | * effectively throwing us into an infinite loop. |
@@ -555,7 +556,7 @@ static void meth_error(struct net_device* dev, unsigned status) | |||
555 | priv->dma_ctrl &= ~METH_DMA_RX_EN; | 556 | priv->dma_ctrl &= ~METH_DMA_RX_EN; |
556 | mace->eth.dma_ctrl = priv->dma_ctrl; | 557 | mace->eth.dma_ctrl = priv->dma_ctrl; |
557 | DPRINTK("Disabled meth Rx DMA temporarily\n"); | 558 | DPRINTK("Disabled meth Rx DMA temporarily\n"); |
558 | spin_unlock(&priv->meth_lock); | 559 | spin_unlock_irqrestore(&priv->meth_lock, flags); |
559 | } | 560 | } |
560 | mace->eth.int_stat = METH_INT_ERROR; | 561 | mace->eth.int_stat = METH_INT_ERROR; |
561 | } | 562 | } |
diff --git a/drivers/net/mlx4/en_cq.c b/drivers/net/mlx4/en_cq.c index 91f50de84be9..a276125b709b 100644 --- a/drivers/net/mlx4/en_cq.c +++ b/drivers/net/mlx4/en_cq.c | |||
@@ -125,8 +125,10 @@ void mlx4_en_deactivate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq) | |||
125 | 125 | ||
126 | if (cq->is_tx) | 126 | if (cq->is_tx) |
127 | del_timer(&cq->timer); | 127 | del_timer(&cq->timer); |
128 | else | 128 | else { |
129 | napi_disable(&cq->napi); | 129 | napi_disable(&cq->napi); |
130 | netif_napi_del(&cq->napi); | ||
131 | } | ||
130 | 132 | ||
131 | mlx4_cq_free(mdev->dev, &cq->mcq); | 133 | mlx4_cq_free(mdev->dev, &cq->mcq); |
132 | } | 134 | } |
diff --git a/drivers/net/mlx4/en_rx.c b/drivers/net/mlx4/en_rx.c index 7942c4d3cd88..9ee873e872b3 100644 --- a/drivers/net/mlx4/en_rx.c +++ b/drivers/net/mlx4/en_rx.c | |||
@@ -951,7 +951,6 @@ static int mlx4_en_config_rss_qp(struct mlx4_en_priv *priv, | |||
951 | if (err) { | 951 | if (err) { |
952 | mlx4_err(mdev, "Failed to allocate qp #%d\n", qpn); | 952 | mlx4_err(mdev, "Failed to allocate qp #%d\n", qpn); |
953 | goto out; | 953 | goto out; |
954 | return err; | ||
955 | } | 954 | } |
956 | qp->event = mlx4_en_sqp_event; | 955 | qp->event = mlx4_en_sqp_event; |
957 | 956 | ||
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index a400d7115f78..6bb5af35eda6 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -569,7 +569,7 @@ static int rxq_process(struct rx_queue *rxq, int budget) | |||
569 | if (rxq->rx_curr_desc == rxq->rx_ring_size) | 569 | if (rxq->rx_curr_desc == rxq->rx_ring_size) |
570 | rxq->rx_curr_desc = 0; | 570 | rxq->rx_curr_desc = 0; |
571 | 571 | ||
572 | dma_unmap_single(NULL, rx_desc->buf_ptr, | 572 | dma_unmap_single(mp->dev->dev.parent, rx_desc->buf_ptr, |
573 | rx_desc->buf_size, DMA_FROM_DEVICE); | 573 | rx_desc->buf_size, DMA_FROM_DEVICE); |
574 | rxq->rx_desc_count--; | 574 | rxq->rx_desc_count--; |
575 | rx++; | 575 | rx++; |
@@ -678,8 +678,9 @@ static int rxq_refill(struct rx_queue *rxq, int budget) | |||
678 | 678 | ||
679 | rx_desc = rxq->rx_desc_area + rx; | 679 | rx_desc = rxq->rx_desc_area + rx; |
680 | 680 | ||
681 | rx_desc->buf_ptr = dma_map_single(NULL, skb->data, | 681 | rx_desc->buf_ptr = dma_map_single(mp->dev->dev.parent, |
682 | mp->skb_size, DMA_FROM_DEVICE); | 682 | skb->data, mp->skb_size, |
683 | DMA_FROM_DEVICE); | ||
683 | rx_desc->buf_size = mp->skb_size; | 684 | rx_desc->buf_size = mp->skb_size; |
684 | rxq->rx_skb[rx] = skb; | 685 | rxq->rx_skb[rx] = skb; |
685 | wmb(); | 686 | wmb(); |
@@ -718,6 +719,7 @@ static inline unsigned int has_tiny_unaligned_frags(struct sk_buff *skb) | |||
718 | 719 | ||
719 | static void txq_submit_frag_skb(struct tx_queue *txq, struct sk_buff *skb) | 720 | static void txq_submit_frag_skb(struct tx_queue *txq, struct sk_buff *skb) |
720 | { | 721 | { |
722 | struct mv643xx_eth_private *mp = txq_to_mp(txq); | ||
721 | int nr_frags = skb_shinfo(skb)->nr_frags; | 723 | int nr_frags = skb_shinfo(skb)->nr_frags; |
722 | int frag; | 724 | int frag; |
723 | 725 | ||
@@ -746,10 +748,10 @@ static void txq_submit_frag_skb(struct tx_queue *txq, struct sk_buff *skb) | |||
746 | 748 | ||
747 | desc->l4i_chk = 0; | 749 | desc->l4i_chk = 0; |
748 | desc->byte_cnt = this_frag->size; | 750 | desc->byte_cnt = this_frag->size; |
749 | desc->buf_ptr = dma_map_page(NULL, this_frag->page, | 751 | desc->buf_ptr = dma_map_page(mp->dev->dev.parent, |
750 | this_frag->page_offset, | 752 | this_frag->page, |
751 | this_frag->size, | 753 | this_frag->page_offset, |
752 | DMA_TO_DEVICE); | 754 | this_frag->size, DMA_TO_DEVICE); |
753 | } | 755 | } |
754 | } | 756 | } |
755 | 757 | ||
@@ -826,7 +828,8 @@ no_csum: | |||
826 | 828 | ||
827 | desc->l4i_chk = l4i_chk; | 829 | desc->l4i_chk = l4i_chk; |
828 | desc->byte_cnt = length; | 830 | desc->byte_cnt = length; |
829 | desc->buf_ptr = dma_map_single(NULL, skb->data, length, DMA_TO_DEVICE); | 831 | desc->buf_ptr = dma_map_single(mp->dev->dev.parent, skb->data, |
832 | length, DMA_TO_DEVICE); | ||
830 | 833 | ||
831 | __skb_queue_tail(&txq->tx_skb, skb); | 834 | __skb_queue_tail(&txq->tx_skb, skb); |
832 | 835 | ||
@@ -956,10 +959,10 @@ static int txq_reclaim(struct tx_queue *txq, int budget, int force) | |||
956 | } | 959 | } |
957 | 960 | ||
958 | if (cmd_sts & TX_FIRST_DESC) { | 961 | if (cmd_sts & TX_FIRST_DESC) { |
959 | dma_unmap_single(NULL, desc->buf_ptr, | 962 | dma_unmap_single(mp->dev->dev.parent, desc->buf_ptr, |
960 | desc->byte_cnt, DMA_TO_DEVICE); | 963 | desc->byte_cnt, DMA_TO_DEVICE); |
961 | } else { | 964 | } else { |
962 | dma_unmap_page(NULL, desc->buf_ptr, | 965 | dma_unmap_page(mp->dev->dev.parent, desc->buf_ptr, |
963 | desc->byte_cnt, DMA_TO_DEVICE); | 966 | desc->byte_cnt, DMA_TO_DEVICE); |
964 | } | 967 | } |
965 | 968 | ||
@@ -1894,9 +1897,9 @@ static int rxq_init(struct mv643xx_eth_private *mp, int index) | |||
1894 | mp->rx_desc_sram_size); | 1897 | mp->rx_desc_sram_size); |
1895 | rxq->rx_desc_dma = mp->rx_desc_sram_addr; | 1898 | rxq->rx_desc_dma = mp->rx_desc_sram_addr; |
1896 | } else { | 1899 | } else { |
1897 | rxq->rx_desc_area = dma_alloc_coherent(NULL, size, | 1900 | rxq->rx_desc_area = dma_alloc_coherent(mp->dev->dev.parent, |
1898 | &rxq->rx_desc_dma, | 1901 | size, &rxq->rx_desc_dma, |
1899 | GFP_KERNEL); | 1902 | GFP_KERNEL); |
1900 | } | 1903 | } |
1901 | 1904 | ||
1902 | if (rxq->rx_desc_area == NULL) { | 1905 | if (rxq->rx_desc_area == NULL) { |
@@ -1947,7 +1950,7 @@ out_free: | |||
1947 | if (index == 0 && size <= mp->rx_desc_sram_size) | 1950 | if (index == 0 && size <= mp->rx_desc_sram_size) |
1948 | iounmap(rxq->rx_desc_area); | 1951 | iounmap(rxq->rx_desc_area); |
1949 | else | 1952 | else |
1950 | dma_free_coherent(NULL, size, | 1953 | dma_free_coherent(mp->dev->dev.parent, size, |
1951 | rxq->rx_desc_area, | 1954 | rxq->rx_desc_area, |
1952 | rxq->rx_desc_dma); | 1955 | rxq->rx_desc_dma); |
1953 | 1956 | ||
@@ -1979,7 +1982,7 @@ static void rxq_deinit(struct rx_queue *rxq) | |||
1979 | rxq->rx_desc_area_size <= mp->rx_desc_sram_size) | 1982 | rxq->rx_desc_area_size <= mp->rx_desc_sram_size) |
1980 | iounmap(rxq->rx_desc_area); | 1983 | iounmap(rxq->rx_desc_area); |
1981 | else | 1984 | else |
1982 | dma_free_coherent(NULL, rxq->rx_desc_area_size, | 1985 | dma_free_coherent(mp->dev->dev.parent, rxq->rx_desc_area_size, |
1983 | rxq->rx_desc_area, rxq->rx_desc_dma); | 1986 | rxq->rx_desc_area, rxq->rx_desc_dma); |
1984 | 1987 | ||
1985 | kfree(rxq->rx_skb); | 1988 | kfree(rxq->rx_skb); |
@@ -2007,9 +2010,9 @@ static int txq_init(struct mv643xx_eth_private *mp, int index) | |||
2007 | mp->tx_desc_sram_size); | 2010 | mp->tx_desc_sram_size); |
2008 | txq->tx_desc_dma = mp->tx_desc_sram_addr; | 2011 | txq->tx_desc_dma = mp->tx_desc_sram_addr; |
2009 | } else { | 2012 | } else { |
2010 | txq->tx_desc_area = dma_alloc_coherent(NULL, size, | 2013 | txq->tx_desc_area = dma_alloc_coherent(mp->dev->dev.parent, |
2011 | &txq->tx_desc_dma, | 2014 | size, &txq->tx_desc_dma, |
2012 | GFP_KERNEL); | 2015 | GFP_KERNEL); |
2013 | } | 2016 | } |
2014 | 2017 | ||
2015 | if (txq->tx_desc_area == NULL) { | 2018 | if (txq->tx_desc_area == NULL) { |
@@ -2053,7 +2056,7 @@ static void txq_deinit(struct tx_queue *txq) | |||
2053 | txq->tx_desc_area_size <= mp->tx_desc_sram_size) | 2056 | txq->tx_desc_area_size <= mp->tx_desc_sram_size) |
2054 | iounmap(txq->tx_desc_area); | 2057 | iounmap(txq->tx_desc_area); |
2055 | else | 2058 | else |
2056 | dma_free_coherent(NULL, txq->tx_desc_area_size, | 2059 | dma_free_coherent(mp->dev->dev.parent, txq->tx_desc_area_size, |
2057 | txq->tx_desc_area, txq->tx_desc_dma); | 2060 | txq->tx_desc_area, txq->tx_desc_dma); |
2058 | } | 2061 | } |
2059 | 2062 | ||
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 0b6e8c896835..8247a945a1d9 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -3554,54 +3554,64 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance) | |||
3554 | int handled = 0; | 3554 | int handled = 0; |
3555 | int status; | 3555 | int status; |
3556 | 3556 | ||
3557 | /* loop handling interrupts until we have no new ones or | ||
3558 | * we hit a invalid/hotplug case. | ||
3559 | */ | ||
3557 | status = RTL_R16(IntrStatus); | 3560 | status = RTL_R16(IntrStatus); |
3561 | while (status && status != 0xffff) { | ||
3562 | handled = 1; | ||
3558 | 3563 | ||
3559 | /* hotplug/major error/no more work/shared irq */ | 3564 | /* Handle all of the error cases first. These will reset |
3560 | if ((status == 0xffff) || !status) | 3565 | * the chip, so just exit the loop. |
3561 | goto out; | 3566 | */ |
3562 | 3567 | if (unlikely(!netif_running(dev))) { | |
3563 | handled = 1; | 3568 | rtl8169_asic_down(ioaddr); |
3569 | break; | ||
3570 | } | ||
3564 | 3571 | ||
3565 | if (unlikely(!netif_running(dev))) { | 3572 | /* Work around for rx fifo overflow */ |
3566 | rtl8169_asic_down(ioaddr); | 3573 | if (unlikely(status & RxFIFOOver) && |
3567 | goto out; | 3574 | (tp->mac_version == RTL_GIGA_MAC_VER_11)) { |
3568 | } | 3575 | netif_stop_queue(dev); |
3576 | rtl8169_tx_timeout(dev); | ||
3577 | break; | ||
3578 | } | ||
3569 | 3579 | ||
3570 | status &= tp->intr_mask; | 3580 | if (unlikely(status & SYSErr)) { |
3571 | RTL_W16(IntrStatus, | 3581 | rtl8169_pcierr_interrupt(dev); |
3572 | (status & RxFIFOOver) ? (status | RxOverflow) : status); | 3582 | break; |
3583 | } | ||
3573 | 3584 | ||
3574 | if (!(status & tp->intr_event)) | 3585 | if (status & LinkChg) |
3575 | goto out; | 3586 | rtl8169_check_link_status(dev, tp, ioaddr); |
3576 | 3587 | ||
3577 | /* Work around for rx fifo overflow */ | 3588 | /* We need to see the lastest version of tp->intr_mask to |
3578 | if (unlikely(status & RxFIFOOver) && | 3589 | * avoid ignoring an MSI interrupt and having to wait for |
3579 | (tp->mac_version == RTL_GIGA_MAC_VER_11)) { | 3590 | * another event which may never come. |
3580 | netif_stop_queue(dev); | 3591 | */ |
3581 | rtl8169_tx_timeout(dev); | 3592 | smp_rmb(); |
3582 | goto out; | 3593 | if (status & tp->intr_mask & tp->napi_event) { |
3583 | } | 3594 | RTL_W16(IntrMask, tp->intr_event & ~tp->napi_event); |
3595 | tp->intr_mask = ~tp->napi_event; | ||
3596 | |||
3597 | if (likely(napi_schedule_prep(&tp->napi))) | ||
3598 | __napi_schedule(&tp->napi); | ||
3599 | else if (netif_msg_intr(tp)) { | ||
3600 | printk(KERN_INFO "%s: interrupt %04x in poll\n", | ||
3601 | dev->name, status); | ||
3602 | } | ||
3603 | } | ||
3584 | 3604 | ||
3585 | if (unlikely(status & SYSErr)) { | 3605 | /* We only get a new MSI interrupt when all active irq |
3586 | rtl8169_pcierr_interrupt(dev); | 3606 | * sources on the chip have been acknowledged. So, ack |
3587 | goto out; | 3607 | * everything we've seen and check if new sources have become |
3608 | * active to avoid blocking all interrupts from the chip. | ||
3609 | */ | ||
3610 | RTL_W16(IntrStatus, | ||
3611 | (status & RxFIFOOver) ? (status | RxOverflow) : status); | ||
3612 | status = RTL_R16(IntrStatus); | ||
3588 | } | 3613 | } |
3589 | 3614 | ||
3590 | if (status & LinkChg) | ||
3591 | rtl8169_check_link_status(dev, tp, ioaddr); | ||
3592 | |||
3593 | if (status & tp->napi_event) { | ||
3594 | RTL_W16(IntrMask, tp->intr_event & ~tp->napi_event); | ||
3595 | tp->intr_mask = ~tp->napi_event; | ||
3596 | |||
3597 | if (likely(napi_schedule_prep(&tp->napi))) | ||
3598 | __napi_schedule(&tp->napi); | ||
3599 | else if (netif_msg_intr(tp)) { | ||
3600 | printk(KERN_INFO "%s: interrupt %04x in poll\n", | ||
3601 | dev->name, status); | ||
3602 | } | ||
3603 | } | ||
3604 | out: | ||
3605 | return IRQ_RETVAL(handled); | 3615 | return IRQ_RETVAL(handled); |
3606 | } | 3616 | } |
3607 | 3617 | ||
@@ -3617,13 +3627,15 @@ static int rtl8169_poll(struct napi_struct *napi, int budget) | |||
3617 | 3627 | ||
3618 | if (work_done < budget) { | 3628 | if (work_done < budget) { |
3619 | napi_complete(napi); | 3629 | napi_complete(napi); |
3620 | tp->intr_mask = 0xffff; | 3630 | |
3621 | /* | 3631 | /* We need for force the visibility of tp->intr_mask |
3622 | * 20040426: the barrier is not strictly required but the | 3632 | * for other CPUs, as we can loose an MSI interrupt |
3623 | * behavior of the irq handler could be less predictable | 3633 | * and potentially wait for a retransmit timeout if we don't. |
3624 | * without it. Btw, the lack of flush for the posted pci | 3634 | * The posted write to IntrMask is safe, as it will |
3625 | * write is safe - FR | 3635 | * eventually make it to the chip and we won't loose anything |
3636 | * until it does. | ||
3626 | */ | 3637 | */ |
3638 | tp->intr_mask = 0xffff; | ||
3627 | smp_wmb(); | 3639 | smp_wmb(); |
3628 | RTL_W16(IntrMask, tp->intr_event); | 3640 | RTL_W16(IntrMask, tp->intr_event); |
3629 | } | 3641 | } |
diff --git a/drivers/net/vxge/vxge-traffic.c b/drivers/net/vxge/vxge-traffic.c index 7be0ae10d69b..c2eeac4125f3 100644 --- a/drivers/net/vxge/vxge-traffic.c +++ b/drivers/net/vxge/vxge-traffic.c | |||
@@ -115,7 +115,7 @@ enum vxge_hw_status vxge_hw_vpath_intr_enable(struct __vxge_hw_vpath_handle *vp) | |||
115 | VXGE_HW_KDFCCTL_ERRORS_REG_KDFCCTL_FIFO1_POISON| | 115 | VXGE_HW_KDFCCTL_ERRORS_REG_KDFCCTL_FIFO1_POISON| |
116 | VXGE_HW_KDFCCTL_ERRORS_REG_KDFCCTL_FIFO2_POISON| | 116 | VXGE_HW_KDFCCTL_ERRORS_REG_KDFCCTL_FIFO2_POISON| |
117 | VXGE_HW_KDFCCTL_ERRORS_REG_KDFCCTL_FIFO1_DMA_ERR| | 117 | VXGE_HW_KDFCCTL_ERRORS_REG_KDFCCTL_FIFO1_DMA_ERR| |
118 | VXGE_HW_KDFCCTL_ERRORS_REG_KDFCCTL_FIFO1_DMA_ERR), 0, 32), | 118 | VXGE_HW_KDFCCTL_ERRORS_REG_KDFCCTL_FIFO2_DMA_ERR), 0, 32), |
119 | &vp_reg->kdfcctl_errors_mask); | 119 | &vp_reg->kdfcctl_errors_mask); |
120 | 120 | ||
121 | __vxge_hw_pio_mem_write32_upper(0, &vp_reg->vpath_ppif_int_mask); | 121 | __vxge_hw_pio_mem_write32_upper(0, &vp_reg->vpath_ppif_int_mask); |
diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c index 3bf7d3f447db..765a7f5d6aa4 100644 --- a/drivers/net/wan/ixp4xx_hss.c +++ b/drivers/net/wan/ixp4xx_hss.c | |||
@@ -1249,7 +1249,7 @@ static int __devinit hss_init_one(struct platform_device *pdev) | |||
1249 | return -ENOMEM; | 1249 | return -ENOMEM; |
1250 | 1250 | ||
1251 | if ((port->npe = npe_request(0)) == NULL) { | 1251 | if ((port->npe = npe_request(0)) == NULL) { |
1252 | err = -ENOSYS; | 1252 | err = -ENODEV; |
1253 | goto err_free; | 1253 | goto err_free; |
1254 | } | 1254 | } |
1255 | 1255 | ||
@@ -1311,7 +1311,7 @@ static int __init hss_init_module(void) | |||
1311 | if ((ixp4xx_read_feature_bits() & | 1311 | if ((ixp4xx_read_feature_bits() & |
1312 | (IXP4XX_FEATURE_HDLC | IXP4XX_FEATURE_HSS)) != | 1312 | (IXP4XX_FEATURE_HDLC | IXP4XX_FEATURE_HSS)) != |
1313 | (IXP4XX_FEATURE_HDLC | IXP4XX_FEATURE_HSS)) | 1313 | (IXP4XX_FEATURE_HDLC | IXP4XX_FEATURE_HSS)) |
1314 | return -ENOSYS; | 1314 | return -ENODEV; |
1315 | 1315 | ||
1316 | spin_lock_init(&npe_lock); | 1316 | spin_lock_init(&npe_lock); |
1317 | 1317 | ||
diff --git a/drivers/net/wimax/i2400m/rx.c b/drivers/net/wimax/i2400m/rx.c index 02419bfd64b5..f9fc38902322 100644 --- a/drivers/net/wimax/i2400m/rx.c +++ b/drivers/net/wimax/i2400m/rx.c | |||
@@ -819,10 +819,9 @@ void i2400m_roq_queue_update_ws(struct i2400m *i2400m, struct i2400m_roq *roq, | |||
819 | roq_data = (struct i2400m_roq_data *) &skb->cb; | 819 | roq_data = (struct i2400m_roq_data *) &skb->cb; |
820 | i2400m_net_erx(i2400m, skb, roq_data->cs); | 820 | i2400m_net_erx(i2400m, skb, roq_data->cs); |
821 | } | 821 | } |
822 | else { | 822 | else |
823 | __i2400m_roq_queue(i2400m, roq, skb, sn, nsn); | 823 | __i2400m_roq_queue(i2400m, roq, skb, sn, nsn); |
824 | __i2400m_roq_update_ws(i2400m, roq, sn + 1); | 824 | __i2400m_roq_update_ws(i2400m, roq, sn + 1); |
825 | } | ||
826 | i2400m_roq_log_add(i2400m, roq, I2400M_RO_TYPE_PACKET_WS, | 825 | i2400m_roq_log_add(i2400m, roq, I2400M_RO_TYPE_PACKET_WS, |
827 | old_ws, len, sn, nsn, roq->ws); | 826 | old_ws, len, sn, nsn, roq->ws); |
828 | } | 827 | } |
diff --git a/drivers/net/wimax/i2400m/usb.c b/drivers/net/wimax/i2400m/usb.c index ca4151a9e222..17851321b7fd 100644 --- a/drivers/net/wimax/i2400m/usb.c +++ b/drivers/net/wimax/i2400m/usb.c | |||
@@ -505,27 +505,52 @@ int i2400mu_suspend(struct usb_interface *iface, pm_message_t pm_msg) | |||
505 | #ifdef CONFIG_PM | 505 | #ifdef CONFIG_PM |
506 | struct usb_device *usb_dev = i2400mu->usb_dev; | 506 | struct usb_device *usb_dev = i2400mu->usb_dev; |
507 | #endif | 507 | #endif |
508 | unsigned is_autosuspend = 0; | ||
508 | struct i2400m *i2400m = &i2400mu->i2400m; | 509 | struct i2400m *i2400m = &i2400mu->i2400m; |
509 | 510 | ||
511 | #ifdef CONFIG_PM | ||
512 | if (usb_dev->auto_pm > 0) | ||
513 | is_autosuspend = 1; | ||
514 | #endif | ||
515 | |||
510 | d_fnstart(3, dev, "(iface %p pm_msg %u)\n", iface, pm_msg.event); | 516 | d_fnstart(3, dev, "(iface %p pm_msg %u)\n", iface, pm_msg.event); |
511 | if (i2400m->updown == 0) | 517 | if (i2400m->updown == 0) |
512 | goto no_firmware; | 518 | goto no_firmware; |
513 | d_printf(1, dev, "fw up, requesting standby\n"); | 519 | if (i2400m->state == I2400M_SS_DATA_PATH_CONNECTED && is_autosuspend) { |
520 | /* ugh -- the device is connected and this suspend | ||
521 | * request is an autosuspend one (not a system standby | ||
522 | * / hibernate). | ||
523 | * | ||
524 | * The only way the device can go to standby is if the | ||
525 | * link with the base station is in IDLE mode; that | ||
526 | * were the case, we'd be in status | ||
527 | * I2400M_SS_CONNECTED_IDLE. But we are not. | ||
528 | * | ||
529 | * If we *tell* him to go power save now, it'll reset | ||
530 | * as a precautionary measure, so if this is an | ||
531 | * autosuspend thing, say no and it'll come back | ||
532 | * later, when the link is IDLE | ||
533 | */ | ||
534 | result = -EBADF; | ||
535 | d_printf(1, dev, "fw up, link up, not-idle, autosuspend: " | ||
536 | "not entering powersave\n"); | ||
537 | goto error_not_now; | ||
538 | } | ||
539 | d_printf(1, dev, "fw up: entering powersave\n"); | ||
514 | atomic_dec(&i2400mu->do_autopm); | 540 | atomic_dec(&i2400mu->do_autopm); |
515 | result = i2400m_cmd_enter_powersave(i2400m); | 541 | result = i2400m_cmd_enter_powersave(i2400m); |
516 | atomic_inc(&i2400mu->do_autopm); | 542 | atomic_inc(&i2400mu->do_autopm); |
517 | #ifdef CONFIG_PM | 543 | if (result < 0 && !is_autosuspend) { |
518 | if (result < 0 && usb_dev->auto_pm == 0) { | ||
519 | /* System suspend, can't fail */ | 544 | /* System suspend, can't fail */ |
520 | dev_err(dev, "failed to suspend, will reset on resume\n"); | 545 | dev_err(dev, "failed to suspend, will reset on resume\n"); |
521 | result = 0; | 546 | result = 0; |
522 | } | 547 | } |
523 | #endif | ||
524 | if (result < 0) | 548 | if (result < 0) |
525 | goto error_enter_powersave; | 549 | goto error_enter_powersave; |
526 | i2400mu_notification_release(i2400mu); | 550 | i2400mu_notification_release(i2400mu); |
527 | d_printf(1, dev, "fw up, got standby\n"); | 551 | d_printf(1, dev, "powersave requested\n"); |
528 | error_enter_powersave: | 552 | error_enter_powersave: |
553 | error_not_now: | ||
529 | no_firmware: | 554 | no_firmware: |
530 | d_fnend(3, dev, "(iface %p pm_msg %u) = %d\n", | 555 | d_fnend(3, dev, "(iface %p pm_msg %u) = %d\n", |
531 | iface, pm_msg.event, result); | 556 | iface, pm_msg.event, result); |
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index c36d3a3d655f..9eabf4d1f2e7 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -6467,6 +6467,7 @@ static int airo_get_encode(struct net_device *dev, | |||
6467 | { | 6467 | { |
6468 | struct airo_info *local = dev->ml_priv; | 6468 | struct airo_info *local = dev->ml_priv; |
6469 | int index = (dwrq->flags & IW_ENCODE_INDEX) - 1; | 6469 | int index = (dwrq->flags & IW_ENCODE_INDEX) - 1; |
6470 | int wep_key_len; | ||
6470 | u8 buf[16]; | 6471 | u8 buf[16]; |
6471 | 6472 | ||
6472 | if (!local->wep_capable) | 6473 | if (!local->wep_capable) |
@@ -6500,8 +6501,13 @@ static int airo_get_encode(struct net_device *dev, | |||
6500 | dwrq->flags |= index + 1; | 6501 | dwrq->flags |= index + 1; |
6501 | 6502 | ||
6502 | /* Copy the key to the user buffer */ | 6503 | /* Copy the key to the user buffer */ |
6503 | dwrq->length = get_wep_key(local, index, &buf[0], sizeof(buf)); | 6504 | wep_key_len = get_wep_key(local, index, &buf[0], sizeof(buf)); |
6504 | memcpy(extra, buf, dwrq->length); | 6505 | if (wep_key_len < 0) { |
6506 | dwrq->length = 0; | ||
6507 | } else { | ||
6508 | dwrq->length = wep_key_len; | ||
6509 | memcpy(extra, buf, dwrq->length); | ||
6510 | } | ||
6505 | 6511 | ||
6506 | return 0; | 6512 | return 0; |
6507 | } | 6513 | } |
@@ -6614,7 +6620,7 @@ static int airo_get_encodeext(struct net_device *dev, | |||
6614 | struct airo_info *local = dev->ml_priv; | 6620 | struct airo_info *local = dev->ml_priv; |
6615 | struct iw_point *encoding = &wrqu->encoding; | 6621 | struct iw_point *encoding = &wrqu->encoding; |
6616 | struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; | 6622 | struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; |
6617 | int idx, max_key_len; | 6623 | int idx, max_key_len, wep_key_len; |
6618 | u8 buf[16]; | 6624 | u8 buf[16]; |
6619 | 6625 | ||
6620 | if (!local->wep_capable) | 6626 | if (!local->wep_capable) |
@@ -6658,8 +6664,13 @@ static int airo_get_encodeext(struct net_device *dev, | |||
6658 | memset(extra, 0, 16); | 6664 | memset(extra, 0, 16); |
6659 | 6665 | ||
6660 | /* Copy the key to the user buffer */ | 6666 | /* Copy the key to the user buffer */ |
6661 | ext->key_len = get_wep_key(local, idx, &buf[0], sizeof(buf)); | 6667 | wep_key_len = get_wep_key(local, idx, &buf[0], sizeof(buf)); |
6662 | memcpy(extra, buf, ext->key_len); | 6668 | if (wep_key_len < 0) { |
6669 | ext->key_len = 0; | ||
6670 | } else { | ||
6671 | ext->key_len = wep_key_len; | ||
6672 | memcpy(extra, buf, ext->key_len); | ||
6673 | } | ||
6663 | 6674 | ||
6664 | return 0; | 6675 | return 0; |
6665 | } | 6676 | } |
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index a08bc8a4fb69..32df27a9c7a2 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c | |||
@@ -214,7 +214,7 @@ static struct pci_driver ath5k_pci_driver = { | |||
214 | * Prototypes - MAC 802.11 stack related functions | 214 | * Prototypes - MAC 802.11 stack related functions |
215 | */ | 215 | */ |
216 | static int ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb); | 216 | static int ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb); |
217 | static int ath5k_reset(struct ath5k_softc *sc, bool stop, bool change_channel); | 217 | static int ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan); |
218 | static int ath5k_reset_wake(struct ath5k_softc *sc); | 218 | static int ath5k_reset_wake(struct ath5k_softc *sc); |
219 | static int ath5k_start(struct ieee80211_hw *hw); | 219 | static int ath5k_start(struct ieee80211_hw *hw); |
220 | static void ath5k_stop(struct ieee80211_hw *hw); | 220 | static void ath5k_stop(struct ieee80211_hw *hw); |
@@ -1038,16 +1038,13 @@ ath5k_chan_set(struct ath5k_softc *sc, struct ieee80211_channel *chan) | |||
1038 | if (chan->center_freq != sc->curchan->center_freq || | 1038 | if (chan->center_freq != sc->curchan->center_freq || |
1039 | chan->hw_value != sc->curchan->hw_value) { | 1039 | chan->hw_value != sc->curchan->hw_value) { |
1040 | 1040 | ||
1041 | sc->curchan = chan; | ||
1042 | sc->curband = &sc->sbands[chan->band]; | ||
1043 | |||
1044 | /* | 1041 | /* |
1045 | * To switch channels clear any pending DMA operations; | 1042 | * To switch channels clear any pending DMA operations; |
1046 | * wait long enough for the RX fifo to drain, reset the | 1043 | * wait long enough for the RX fifo to drain, reset the |
1047 | * hardware at the new frequency, and then re-enable | 1044 | * hardware at the new frequency, and then re-enable |
1048 | * the relevant bits of the h/w. | 1045 | * the relevant bits of the h/w. |
1049 | */ | 1046 | */ |
1050 | return ath5k_reset(sc, true, true); | 1047 | return ath5k_reset(sc, chan); |
1051 | } | 1048 | } |
1052 | 1049 | ||
1053 | return 0; | 1050 | return 0; |
@@ -2314,7 +2311,7 @@ ath5k_init(struct ath5k_softc *sc) | |||
2314 | sc->imask = AR5K_INT_RXOK | AR5K_INT_RXERR | AR5K_INT_RXEOL | | 2311 | sc->imask = AR5K_INT_RXOK | AR5K_INT_RXERR | AR5K_INT_RXEOL | |
2315 | AR5K_INT_RXORN | AR5K_INT_TXDESC | AR5K_INT_TXEOL | | 2312 | AR5K_INT_RXORN | AR5K_INT_TXDESC | AR5K_INT_TXEOL | |
2316 | AR5K_INT_FATAL | AR5K_INT_GLOBAL; | 2313 | AR5K_INT_FATAL | AR5K_INT_GLOBAL; |
2317 | ret = ath5k_reset(sc, false, false); | 2314 | ret = ath5k_reset(sc, NULL); |
2318 | if (ret) | 2315 | if (ret) |
2319 | goto done; | 2316 | goto done; |
2320 | 2317 | ||
@@ -2599,18 +2596,25 @@ drop_packet: | |||
2599 | return NETDEV_TX_OK; | 2596 | return NETDEV_TX_OK; |
2600 | } | 2597 | } |
2601 | 2598 | ||
2599 | /* | ||
2600 | * Reset the hardware. If chan is not NULL, then also pause rx/tx | ||
2601 | * and change to the given channel. | ||
2602 | */ | ||
2602 | static int | 2603 | static int |
2603 | ath5k_reset(struct ath5k_softc *sc, bool stop, bool change_channel) | 2604 | ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan) |
2604 | { | 2605 | { |
2605 | struct ath5k_hw *ah = sc->ah; | 2606 | struct ath5k_hw *ah = sc->ah; |
2606 | int ret; | 2607 | int ret; |
2607 | 2608 | ||
2608 | ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "resetting\n"); | 2609 | ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "resetting\n"); |
2609 | 2610 | ||
2610 | if (stop) { | 2611 | if (chan) { |
2611 | ath5k_hw_set_imr(ah, 0); | 2612 | ath5k_hw_set_imr(ah, 0); |
2612 | ath5k_txq_cleanup(sc); | 2613 | ath5k_txq_cleanup(sc); |
2613 | ath5k_rx_stop(sc); | 2614 | ath5k_rx_stop(sc); |
2615 | |||
2616 | sc->curchan = chan; | ||
2617 | sc->curband = &sc->sbands[chan->band]; | ||
2614 | } | 2618 | } |
2615 | ret = ath5k_hw_reset(ah, sc->opmode, sc->curchan, true); | 2619 | ret = ath5k_hw_reset(ah, sc->opmode, sc->curchan, true); |
2616 | if (ret) { | 2620 | if (ret) { |
@@ -2648,7 +2652,7 @@ ath5k_reset_wake(struct ath5k_softc *sc) | |||
2648 | { | 2652 | { |
2649 | int ret; | 2653 | int ret; |
2650 | 2654 | ||
2651 | ret = ath5k_reset(sc, true, true); | 2655 | ret = ath5k_reset(sc, sc->curchan); |
2652 | if (!ret) | 2656 | if (!ret) |
2653 | ieee80211_wake_queues(sc->hw); | 2657 | ieee80211_wake_queues(sc->hw); |
2654 | 2658 | ||
diff --git a/drivers/net/wireless/ath5k/phy.c b/drivers/net/wireless/ath5k/phy.c index 9e2faae5ae94..b48b29dca3d2 100644 --- a/drivers/net/wireless/ath5k/phy.c +++ b/drivers/net/wireless/ath5k/phy.c | |||
@@ -1487,28 +1487,35 @@ ath5k_get_linear_pcdac_min(const u8 *stepL, const u8 *stepR, | |||
1487 | { | 1487 | { |
1488 | s8 tmp; | 1488 | s8 tmp; |
1489 | s16 min_pwrL, min_pwrR; | 1489 | s16 min_pwrL, min_pwrR; |
1490 | s16 pwr_i = pwrL[0]; | 1490 | s16 pwr_i; |
1491 | 1491 | ||
1492 | do { | 1492 | if (pwrL[0] == pwrL[1]) |
1493 | pwr_i--; | 1493 | min_pwrL = pwrL[0]; |
1494 | tmp = (s8) ath5k_get_interpolated_value(pwr_i, | 1494 | else { |
1495 | pwrL[0], pwrL[1], | 1495 | pwr_i = pwrL[0]; |
1496 | stepL[0], stepL[1]); | 1496 | do { |
1497 | 1497 | pwr_i--; | |
1498 | } while (tmp > 1); | 1498 | tmp = (s8) ath5k_get_interpolated_value(pwr_i, |
1499 | 1499 | pwrL[0], pwrL[1], | |
1500 | min_pwrL = pwr_i; | 1500 | stepL[0], stepL[1]); |
1501 | 1501 | } while (tmp > 1); | |
1502 | pwr_i = pwrR[0]; | 1502 | |
1503 | do { | 1503 | min_pwrL = pwr_i; |
1504 | pwr_i--; | 1504 | } |
1505 | tmp = (s8) ath5k_get_interpolated_value(pwr_i, | ||
1506 | pwrR[0], pwrR[1], | ||
1507 | stepR[0], stepR[1]); | ||
1508 | |||
1509 | } while (tmp > 1); | ||
1510 | 1505 | ||
1511 | min_pwrR = pwr_i; | 1506 | if (pwrR[0] == pwrR[1]) |
1507 | min_pwrR = pwrR[0]; | ||
1508 | else { | ||
1509 | pwr_i = pwrR[0]; | ||
1510 | do { | ||
1511 | pwr_i--; | ||
1512 | tmp = (s8) ath5k_get_interpolated_value(pwr_i, | ||
1513 | pwrR[0], pwrR[1], | ||
1514 | stepR[0], stepR[1]); | ||
1515 | } while (tmp > 1); | ||
1516 | |||
1517 | min_pwrR = pwr_i; | ||
1518 | } | ||
1512 | 1519 | ||
1513 | /* Keep the right boundary so that it works for both curves */ | 1520 | /* Keep the right boundary so that it works for both curves */ |
1514 | return max(min_pwrL, min_pwrR); | 1521 | return max(min_pwrL, min_pwrR); |
diff --git a/drivers/net/wireless/ath5k/reset.c b/drivers/net/wireless/ath5k/reset.c index 7a17d31b2fd9..5f72c111c2e8 100644 --- a/drivers/net/wireless/ath5k/reset.c +++ b/drivers/net/wireless/ath5k/reset.c | |||
@@ -26,7 +26,7 @@ | |||
26 | \*****************************/ | 26 | \*****************************/ |
27 | 27 | ||
28 | #include <linux/pci.h> /* To determine if a card is pci-e */ | 28 | #include <linux/pci.h> /* To determine if a card is pci-e */ |
29 | #include <linux/bitops.h> /* For get_bitmask_order */ | 29 | #include <linux/log2.h> |
30 | #include "ath5k.h" | 30 | #include "ath5k.h" |
31 | #include "reg.h" | 31 | #include "reg.h" |
32 | #include "base.h" | 32 | #include "base.h" |
@@ -69,10 +69,10 @@ static inline int ath5k_hw_write_ofdm_timings(struct ath5k_hw *ah, | |||
69 | 69 | ||
70 | /* Get exponent | 70 | /* Get exponent |
71 | * ALGO: coef_exp = 14 - highest set bit position */ | 71 | * ALGO: coef_exp = 14 - highest set bit position */ |
72 | coef_exp = get_bitmask_order(coef_scaled); | 72 | coef_exp = ilog2(coef_scaled); |
73 | 73 | ||
74 | /* Doesn't make sense if it's zero*/ | 74 | /* Doesn't make sense if it's zero*/ |
75 | if (!coef_exp) | 75 | if (!coef_scaled || !coef_exp) |
76 | return -EINVAL; | 76 | return -EINVAL; |
77 | 77 | ||
78 | /* Note: we've shifted coef_scaled by 24 */ | 78 | /* Note: we've shifted coef_scaled by 24 */ |
@@ -359,7 +359,7 @@ int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial) | |||
359 | mode |= AR5K_PHY_MODE_FREQ_5GHZ; | 359 | mode |= AR5K_PHY_MODE_FREQ_5GHZ; |
360 | 360 | ||
361 | if (ah->ah_radio == AR5K_RF5413) | 361 | if (ah->ah_radio == AR5K_RF5413) |
362 | clock |= AR5K_PHY_PLL_40MHZ_5413; | 362 | clock = AR5K_PHY_PLL_40MHZ_5413; |
363 | else | 363 | else |
364 | clock |= AR5K_PHY_PLL_40MHZ; | 364 | clock |= AR5K_PHY_PLL_40MHZ; |
365 | 365 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index e5ca2511a81a..9452461ce864 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -46,7 +46,7 @@ | |||
46 | #include "iwl-6000-hw.h" | 46 | #include "iwl-6000-hw.h" |
47 | 47 | ||
48 | /* Highest firmware API version supported */ | 48 | /* Highest firmware API version supported */ |
49 | #define IWL5000_UCODE_API_MAX 1 | 49 | #define IWL5000_UCODE_API_MAX 2 |
50 | #define IWL5150_UCODE_API_MAX 2 | 50 | #define IWL5150_UCODE_API_MAX 2 |
51 | 51 | ||
52 | /* Lowest firmware API version supported */ | 52 | /* Lowest firmware API version supported */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c index edfa5e149f71..bd438d8acf55 100644 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c | |||
@@ -101,8 +101,8 @@ struct iwl_cfg iwl6000_2agn_cfg = { | |||
101 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, | 101 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, |
102 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, | 102 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, |
103 | .mod_params = &iwl50_mod_params, | 103 | .mod_params = &iwl50_mod_params, |
104 | .valid_tx_ant = ANT_BC, | 104 | .valid_tx_ant = ANT_AB, |
105 | .valid_rx_ant = ANT_BC, | 105 | .valid_rx_ant = ANT_AB, |
106 | .need_pll_cfg = false, | 106 | .need_pll_cfg = false, |
107 | }; | 107 | }; |
108 | 108 | ||
@@ -117,8 +117,8 @@ struct iwl_cfg iwl6050_2agn_cfg = { | |||
117 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, | 117 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, |
118 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, | 118 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, |
119 | .mod_params = &iwl50_mod_params, | 119 | .mod_params = &iwl50_mod_params, |
120 | .valid_tx_ant = ANT_BC, | 120 | .valid_tx_ant = ANT_AB, |
121 | .valid_rx_ant = ANT_BC, | 121 | .valid_rx_ant = ANT_AB, |
122 | .need_pll_cfg = false, | 122 | .need_pll_cfg = false, |
123 | }; | 123 | }; |
124 | 124 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 1ef4192207a5..f46ba2475776 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -669,13 +669,6 @@ static int iwl_set_mode(struct iwl_priv *priv, int mode) | |||
669 | if (!iwl_is_ready_rf(priv)) | 669 | if (!iwl_is_ready_rf(priv)) |
670 | return -EAGAIN; | 670 | return -EAGAIN; |
671 | 671 | ||
672 | cancel_delayed_work(&priv->scan_check); | ||
673 | if (iwl_scan_cancel_timeout(priv, 100)) { | ||
674 | IWL_WARN(priv, "Aborted scan still in progress after 100ms\n"); | ||
675 | IWL_DEBUG_MAC80211(priv, "leaving - scan abort failed.\n"); | ||
676 | return -EAGAIN; | ||
677 | } | ||
678 | |||
679 | iwl_commit_rxon(priv); | 672 | iwl_commit_rxon(priv); |
680 | 673 | ||
681 | return 0; | 674 | return 0; |
@@ -3636,7 +3629,9 @@ static struct pci_device_id iwl_hw_card_ids[] = { | |||
3636 | {IWL_PCI_DEVICE(0x0085, 0x1112, iwl6000_2ag_cfg)}, | 3629 | {IWL_PCI_DEVICE(0x0085, 0x1112, iwl6000_2ag_cfg)}, |
3637 | {IWL_PCI_DEVICE(0x0082, 0x1122, iwl6000_2ag_cfg)}, | 3630 | {IWL_PCI_DEVICE(0x0082, 0x1122, iwl6000_2ag_cfg)}, |
3638 | {IWL_PCI_DEVICE(0x422B, PCI_ANY_ID, iwl6000_3agn_cfg)}, | 3631 | {IWL_PCI_DEVICE(0x422B, PCI_ANY_ID, iwl6000_3agn_cfg)}, |
3632 | {IWL_PCI_DEVICE(0x422C, PCI_ANY_ID, iwl6000_2agn_cfg)}, | ||
3639 | {IWL_PCI_DEVICE(0x4238, PCI_ANY_ID, iwl6000_3agn_cfg)}, | 3633 | {IWL_PCI_DEVICE(0x4238, PCI_ANY_ID, iwl6000_3agn_cfg)}, |
3634 | {IWL_PCI_DEVICE(0x4239, PCI_ANY_ID, iwl6000_2agn_cfg)}, | ||
3640 | {IWL_PCI_DEVICE(0x0082, PCI_ANY_ID, iwl6000_2agn_cfg)}, | 3635 | {IWL_PCI_DEVICE(0x0082, PCI_ANY_ID, iwl6000_2agn_cfg)}, |
3641 | {IWL_PCI_DEVICE(0x0085, PCI_ANY_ID, iwl6000_3agn_cfg)}, | 3636 | {IWL_PCI_DEVICE(0x0085, PCI_ANY_ID, iwl6000_3agn_cfg)}, |
3642 | {IWL_PCI_DEVICE(0x0086, PCI_ANY_ID, iwl6050_3agn_cfg)}, | 3637 | {IWL_PCI_DEVICE(0x0086, PCI_ANY_ID, iwl6050_3agn_cfg)}, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c index e7c65c4f741b..6330b91e37ce 100644 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c | |||
@@ -227,9 +227,6 @@ static void iwl_rx_scan_complete_notif(struct iwl_priv *priv, | |||
227 | /* The HW is no longer scanning */ | 227 | /* The HW is no longer scanning */ |
228 | clear_bit(STATUS_SCAN_HW, &priv->status); | 228 | clear_bit(STATUS_SCAN_HW, &priv->status); |
229 | 229 | ||
230 | /* The scan completion notification came in, so kill that timer... */ | ||
231 | cancel_delayed_work(&priv->scan_check); | ||
232 | |||
233 | IWL_DEBUG_INFO(priv, "Scan pass on %sGHz took %dms\n", | 230 | IWL_DEBUG_INFO(priv, "Scan pass on %sGHz took %dms\n", |
234 | (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) ? | 231 | (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) ? |
235 | "2.4" : "5.2", | 232 | "2.4" : "5.2", |
@@ -712,6 +709,8 @@ static void iwl_bg_request_scan(struct work_struct *data) | |||
712 | 709 | ||
713 | mutex_lock(&priv->mutex); | 710 | mutex_lock(&priv->mutex); |
714 | 711 | ||
712 | cancel_delayed_work(&priv->scan_check); | ||
713 | |||
715 | if (!iwl_is_ready(priv)) { | 714 | if (!iwl_is_ready(priv)) { |
716 | IWL_WARN(priv, "request scan called when driver not ready.\n"); | 715 | IWL_WARN(priv, "request scan called when driver not ready.\n"); |
717 | goto done; | 716 | goto done; |
@@ -925,6 +924,8 @@ void iwl_bg_scan_completed(struct work_struct *work) | |||
925 | 924 | ||
926 | IWL_DEBUG_SCAN(priv, "SCAN complete scan\n"); | 925 | IWL_DEBUG_SCAN(priv, "SCAN complete scan\n"); |
927 | 926 | ||
927 | cancel_delayed_work(&priv->scan_check); | ||
928 | |||
928 | ieee80211_scan_completed(priv->hw, false); | 929 | ieee80211_scan_completed(priv->hw, false); |
929 | 930 | ||
930 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | 931 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index 5798fe49c771..44ab03a12e40 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c | |||
@@ -719,6 +719,14 @@ static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv, | |||
719 | { | 719 | { |
720 | unsigned long flags; | 720 | unsigned long flags; |
721 | int ret = 0; | 721 | int ret = 0; |
722 | __le16 key_flags = 0; | ||
723 | |||
724 | key_flags |= (STA_KEY_FLG_TKIP | STA_KEY_FLG_MAP_KEY_MSK); | ||
725 | key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); | ||
726 | key_flags &= ~STA_KEY_FLG_INVALID; | ||
727 | |||
728 | if (sta_id == priv->hw_params.bcast_sta_id) | ||
729 | key_flags |= STA_KEY_MULTICAST_MSK; | ||
722 | 730 | ||
723 | keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; | 731 | keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; |
724 | keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; | 732 | keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; |
@@ -738,6 +746,9 @@ static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv, | |||
738 | WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET, | 746 | WARN(priv->stations[sta_id].sta.key.key_offset == WEP_INVALID_OFFSET, |
739 | "no space for a new key"); | 747 | "no space for a new key"); |
740 | 748 | ||
749 | priv->stations[sta_id].sta.key.key_flags = key_flags; | ||
750 | |||
751 | |||
741 | /* This copy is acutally not needed: we get the key with each TX */ | 752 | /* This copy is acutally not needed: we get the key with each TX */ |
742 | memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key, 16); | 753 | memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key, 16); |
743 | 754 | ||
@@ -754,9 +765,7 @@ void iwl_update_tkip_key(struct iwl_priv *priv, | |||
754 | { | 765 | { |
755 | u8 sta_id = IWL_INVALID_STATION; | 766 | u8 sta_id = IWL_INVALID_STATION; |
756 | unsigned long flags; | 767 | unsigned long flags; |
757 | __le16 key_flags = 0; | ||
758 | int i; | 768 | int i; |
759 | DECLARE_MAC_BUF(mac); | ||
760 | 769 | ||
761 | sta_id = iwl_find_station(priv, addr); | 770 | sta_id = iwl_find_station(priv, addr); |
762 | if (sta_id == IWL_INVALID_STATION) { | 771 | if (sta_id == IWL_INVALID_STATION) { |
@@ -771,16 +780,8 @@ void iwl_update_tkip_key(struct iwl_priv *priv, | |||
771 | return; | 780 | return; |
772 | } | 781 | } |
773 | 782 | ||
774 | key_flags |= (STA_KEY_FLG_TKIP | STA_KEY_FLG_MAP_KEY_MSK); | ||
775 | key_flags |= cpu_to_le16(keyconf->keyidx << STA_KEY_FLG_KEYID_POS); | ||
776 | key_flags &= ~STA_KEY_FLG_INVALID; | ||
777 | |||
778 | if (sta_id == priv->hw_params.bcast_sta_id) | ||
779 | key_flags |= STA_KEY_MULTICAST_MSK; | ||
780 | |||
781 | spin_lock_irqsave(&priv->sta_lock, flags); | 783 | spin_lock_irqsave(&priv->sta_lock, flags); |
782 | 784 | ||
783 | priv->stations[sta_id].sta.key.key_flags = key_flags; | ||
784 | priv->stations[sta_id].sta.key.tkip_rx_tsc_byte2 = (u8) iv32; | 785 | priv->stations[sta_id].sta.key.tkip_rx_tsc_byte2 = (u8) iv32; |
785 | 786 | ||
786 | for (i = 0; i < 5; i++) | 787 | for (i = 0; i < 5; i++) |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 70a00c8ee42e..ff4d0e41d7c4 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -782,13 +782,6 @@ static int iwl3945_set_mode(struct iwl_priv *priv, int mode) | |||
782 | if (!iwl_is_ready_rf(priv)) | 782 | if (!iwl_is_ready_rf(priv)) |
783 | return -EAGAIN; | 783 | return -EAGAIN; |
784 | 784 | ||
785 | cancel_delayed_work(&priv->scan_check); | ||
786 | if (iwl_scan_cancel_timeout(priv, 100)) { | ||
787 | IWL_WARN(priv, "Aborted scan still in progress after 100ms\n"); | ||
788 | IWL_DEBUG_MAC80211(priv, "leaving - scan abort failed.\n"); | ||
789 | return -EAGAIN; | ||
790 | } | ||
791 | |||
792 | iwl3945_commit_rxon(priv); | 785 | iwl3945_commit_rxon(priv); |
793 | 786 | ||
794 | return 0; | 787 | return 0; |
@@ -1744,7 +1737,6 @@ static void iwl3945_rx_queue_free(struct iwl_priv *priv, struct iwl_rx_queue *rx | |||
1744 | rxq->bd = NULL; | 1737 | rxq->bd = NULL; |
1745 | rxq->rb_stts = NULL; | 1738 | rxq->rb_stts = NULL; |
1746 | } | 1739 | } |
1747 | EXPORT_SYMBOL(iwl3945_rx_queue_free); | ||
1748 | 1740 | ||
1749 | 1741 | ||
1750 | /* Convert linear signal-to-noise ratio into dB */ | 1742 | /* Convert linear signal-to-noise ratio into dB */ |
@@ -3299,6 +3291,8 @@ static void iwl3945_bg_request_scan(struct work_struct *data) | |||
3299 | 3291 | ||
3300 | mutex_lock(&priv->mutex); | 3292 | mutex_lock(&priv->mutex); |
3301 | 3293 | ||
3294 | cancel_delayed_work(&priv->scan_check); | ||
3295 | |||
3302 | if (!iwl_is_ready(priv)) { | 3296 | if (!iwl_is_ready(priv)) { |
3303 | IWL_WARN(priv, "request scan called when driver not ready.\n"); | 3297 | IWL_WARN(priv, "request scan called when driver not ready.\n"); |
3304 | goto done; | 3298 | goto done; |
diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c index 07d378ef0b46..7b3ee8c2eaef 100644 --- a/drivers/net/wireless/rt2x00/rt2x00debug.c +++ b/drivers/net/wireless/rt2x00/rt2x00debug.c | |||
@@ -138,7 +138,7 @@ void rt2x00debug_update_crypto(struct rt2x00_dev *rt2x00dev, | |||
138 | 138 | ||
139 | if (cipher == CIPHER_TKIP_NO_MIC) | 139 | if (cipher == CIPHER_TKIP_NO_MIC) |
140 | cipher = CIPHER_TKIP; | 140 | cipher = CIPHER_TKIP; |
141 | if (cipher == CIPHER_NONE || cipher > CIPHER_MAX) | 141 | if (cipher == CIPHER_NONE || cipher >= CIPHER_MAX) |
142 | return; | 142 | return; |
143 | 143 | ||
144 | /* Remove CIPHER_NONE index */ | 144 | /* Remove CIPHER_NONE index */ |
diff --git a/drivers/net/wireless/rtl818x/rtl8187.h b/drivers/net/wireless/rtl818x/rtl8187.h index 9718f61809cf..edeff82a4d06 100644 --- a/drivers/net/wireless/rtl818x/rtl8187.h +++ b/drivers/net/wireless/rtl818x/rtl8187.h | |||
@@ -120,6 +120,12 @@ struct rtl8187_priv { | |||
120 | __le64 buf; | 120 | __le64 buf; |
121 | struct sk_buff_head queue; | 121 | struct sk_buff_head queue; |
122 | } b_tx_status; /* This queue is used by both -b and non-b devices */ | 122 | } b_tx_status; /* This queue is used by both -b and non-b devices */ |
123 | struct mutex io_mutex; | ||
124 | union { | ||
125 | u8 bits8; | ||
126 | __le16 bits16; | ||
127 | __le32 bits32; | ||
128 | } *io_dmabuf; | ||
123 | }; | 129 | }; |
124 | 130 | ||
125 | void rtl8187_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data); | 131 | void rtl8187_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data); |
@@ -129,10 +135,14 @@ static inline u8 rtl818x_ioread8_idx(struct rtl8187_priv *priv, | |||
129 | { | 135 | { |
130 | u8 val; | 136 | u8 val; |
131 | 137 | ||
138 | mutex_lock(&priv->io_mutex); | ||
132 | usb_control_msg(priv->udev, usb_rcvctrlpipe(priv->udev, 0), | 139 | usb_control_msg(priv->udev, usb_rcvctrlpipe(priv->udev, 0), |
133 | RTL8187_REQ_GET_REG, RTL8187_REQT_READ, | 140 | RTL8187_REQ_GET_REG, RTL8187_REQT_READ, |
134 | (unsigned long)addr, idx & 0x03, &val, | 141 | (unsigned long)addr, idx & 0x03, |
135 | sizeof(val), HZ / 2); | 142 | &priv->io_dmabuf->bits8, sizeof(val), HZ / 2); |
143 | |||
144 | val = priv->io_dmabuf->bits8; | ||
145 | mutex_unlock(&priv->io_mutex); | ||
136 | 146 | ||
137 | return val; | 147 | return val; |
138 | } | 148 | } |
@@ -147,10 +157,14 @@ static inline u16 rtl818x_ioread16_idx(struct rtl8187_priv *priv, | |||
147 | { | 157 | { |
148 | __le16 val; | 158 | __le16 val; |
149 | 159 | ||
160 | mutex_lock(&priv->io_mutex); | ||
150 | usb_control_msg(priv->udev, usb_rcvctrlpipe(priv->udev, 0), | 161 | usb_control_msg(priv->udev, usb_rcvctrlpipe(priv->udev, 0), |
151 | RTL8187_REQ_GET_REG, RTL8187_REQT_READ, | 162 | RTL8187_REQ_GET_REG, RTL8187_REQT_READ, |
152 | (unsigned long)addr, idx & 0x03, &val, | 163 | (unsigned long)addr, idx & 0x03, |
153 | sizeof(val), HZ / 2); | 164 | &priv->io_dmabuf->bits16, sizeof(val), HZ / 2); |
165 | |||
166 | val = priv->io_dmabuf->bits16; | ||
167 | mutex_unlock(&priv->io_mutex); | ||
154 | 168 | ||
155 | return le16_to_cpu(val); | 169 | return le16_to_cpu(val); |
156 | } | 170 | } |
@@ -165,10 +179,14 @@ static inline u32 rtl818x_ioread32_idx(struct rtl8187_priv *priv, | |||
165 | { | 179 | { |
166 | __le32 val; | 180 | __le32 val; |
167 | 181 | ||
182 | mutex_lock(&priv->io_mutex); | ||
168 | usb_control_msg(priv->udev, usb_rcvctrlpipe(priv->udev, 0), | 183 | usb_control_msg(priv->udev, usb_rcvctrlpipe(priv->udev, 0), |
169 | RTL8187_REQ_GET_REG, RTL8187_REQT_READ, | 184 | RTL8187_REQ_GET_REG, RTL8187_REQT_READ, |
170 | (unsigned long)addr, idx & 0x03, &val, | 185 | (unsigned long)addr, idx & 0x03, |
171 | sizeof(val), HZ / 2); | 186 | &priv->io_dmabuf->bits32, sizeof(val), HZ / 2); |
187 | |||
188 | val = priv->io_dmabuf->bits32; | ||
189 | mutex_unlock(&priv->io_mutex); | ||
172 | 190 | ||
173 | return le32_to_cpu(val); | 191 | return le32_to_cpu(val); |
174 | } | 192 | } |
@@ -181,10 +199,15 @@ static inline u32 rtl818x_ioread32(struct rtl8187_priv *priv, __le32 *addr) | |||
181 | static inline void rtl818x_iowrite8_idx(struct rtl8187_priv *priv, | 199 | static inline void rtl818x_iowrite8_idx(struct rtl8187_priv *priv, |
182 | u8 *addr, u8 val, u8 idx) | 200 | u8 *addr, u8 val, u8 idx) |
183 | { | 201 | { |
202 | mutex_lock(&priv->io_mutex); | ||
203 | |||
204 | priv->io_dmabuf->bits8 = val; | ||
184 | usb_control_msg(priv->udev, usb_sndctrlpipe(priv->udev, 0), | 205 | usb_control_msg(priv->udev, usb_sndctrlpipe(priv->udev, 0), |
185 | RTL8187_REQ_SET_REG, RTL8187_REQT_WRITE, | 206 | RTL8187_REQ_SET_REG, RTL8187_REQT_WRITE, |
186 | (unsigned long)addr, idx & 0x03, &val, | 207 | (unsigned long)addr, idx & 0x03, |
187 | sizeof(val), HZ / 2); | 208 | &priv->io_dmabuf->bits8, sizeof(val), HZ / 2); |
209 | |||
210 | mutex_unlock(&priv->io_mutex); | ||
188 | } | 211 | } |
189 | 212 | ||
190 | static inline void rtl818x_iowrite8(struct rtl8187_priv *priv, u8 *addr, u8 val) | 213 | static inline void rtl818x_iowrite8(struct rtl8187_priv *priv, u8 *addr, u8 val) |
@@ -195,12 +218,15 @@ static inline void rtl818x_iowrite8(struct rtl8187_priv *priv, u8 *addr, u8 val) | |||
195 | static inline void rtl818x_iowrite16_idx(struct rtl8187_priv *priv, | 218 | static inline void rtl818x_iowrite16_idx(struct rtl8187_priv *priv, |
196 | __le16 *addr, u16 val, u8 idx) | 219 | __le16 *addr, u16 val, u8 idx) |
197 | { | 220 | { |
198 | __le16 buf = cpu_to_le16(val); | 221 | mutex_lock(&priv->io_mutex); |
199 | 222 | ||
223 | priv->io_dmabuf->bits16 = cpu_to_le16(val); | ||
200 | usb_control_msg(priv->udev, usb_sndctrlpipe(priv->udev, 0), | 224 | usb_control_msg(priv->udev, usb_sndctrlpipe(priv->udev, 0), |
201 | RTL8187_REQ_SET_REG, RTL8187_REQT_WRITE, | 225 | RTL8187_REQ_SET_REG, RTL8187_REQT_WRITE, |
202 | (unsigned long)addr, idx & 0x03, &buf, sizeof(buf), | 226 | (unsigned long)addr, idx & 0x03, |
203 | HZ / 2); | 227 | &priv->io_dmabuf->bits16, sizeof(val), HZ / 2); |
228 | |||
229 | mutex_unlock(&priv->io_mutex); | ||
204 | } | 230 | } |
205 | 231 | ||
206 | static inline void rtl818x_iowrite16(struct rtl8187_priv *priv, __le16 *addr, | 232 | static inline void rtl818x_iowrite16(struct rtl8187_priv *priv, __le16 *addr, |
@@ -212,12 +238,15 @@ static inline void rtl818x_iowrite16(struct rtl8187_priv *priv, __le16 *addr, | |||
212 | static inline void rtl818x_iowrite32_idx(struct rtl8187_priv *priv, | 238 | static inline void rtl818x_iowrite32_idx(struct rtl8187_priv *priv, |
213 | __le32 *addr, u32 val, u8 idx) | 239 | __le32 *addr, u32 val, u8 idx) |
214 | { | 240 | { |
215 | __le32 buf = cpu_to_le32(val); | 241 | mutex_lock(&priv->io_mutex); |
216 | 242 | ||
243 | priv->io_dmabuf->bits32 = cpu_to_le32(val); | ||
217 | usb_control_msg(priv->udev, usb_sndctrlpipe(priv->udev, 0), | 244 | usb_control_msg(priv->udev, usb_sndctrlpipe(priv->udev, 0), |
218 | RTL8187_REQ_SET_REG, RTL8187_REQT_WRITE, | 245 | RTL8187_REQ_SET_REG, RTL8187_REQT_WRITE, |
219 | (unsigned long)addr, idx & 0x03, &buf, sizeof(buf), | 246 | (unsigned long)addr, idx & 0x03, |
220 | HZ / 2); | 247 | &priv->io_dmabuf->bits32, sizeof(val), HZ / 2); |
248 | |||
249 | mutex_unlock(&priv->io_mutex); | ||
221 | } | 250 | } |
222 | 251 | ||
223 | static inline void rtl818x_iowrite32(struct rtl8187_priv *priv, __le32 *addr, | 252 | static inline void rtl818x_iowrite32(struct rtl8187_priv *priv, __le32 *addr, |
diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c index fd81884b9c7d..bac6cfba6abd 100644 --- a/drivers/net/wireless/rtl818x/rtl8187_dev.c +++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c | |||
@@ -1329,6 +1329,14 @@ static int __devinit rtl8187_probe(struct usb_interface *intf, | |||
1329 | priv = dev->priv; | 1329 | priv = dev->priv; |
1330 | priv->is_rtl8187b = (id->driver_info == DEVICE_RTL8187B); | 1330 | priv->is_rtl8187b = (id->driver_info == DEVICE_RTL8187B); |
1331 | 1331 | ||
1332 | /* allocate "DMA aware" buffer for register accesses */ | ||
1333 | priv->io_dmabuf = kmalloc(sizeof(*priv->io_dmabuf), GFP_KERNEL); | ||
1334 | if (!priv->io_dmabuf) { | ||
1335 | err = -ENOMEM; | ||
1336 | goto err_free_dev; | ||
1337 | } | ||
1338 | mutex_init(&priv->io_mutex); | ||
1339 | |||
1332 | SET_IEEE80211_DEV(dev, &intf->dev); | 1340 | SET_IEEE80211_DEV(dev, &intf->dev); |
1333 | usb_set_intfdata(intf, dev); | 1341 | usb_set_intfdata(intf, dev); |
1334 | priv->udev = udev; | 1342 | priv->udev = udev; |
@@ -1495,7 +1503,7 @@ static int __devinit rtl8187_probe(struct usb_interface *intf, | |||
1495 | err = ieee80211_register_hw(dev); | 1503 | err = ieee80211_register_hw(dev); |
1496 | if (err) { | 1504 | if (err) { |
1497 | printk(KERN_ERR "rtl8187: Cannot register device\n"); | 1505 | printk(KERN_ERR "rtl8187: Cannot register device\n"); |
1498 | goto err_free_dev; | 1506 | goto err_free_dmabuf; |
1499 | } | 1507 | } |
1500 | mutex_init(&priv->conf_mutex); | 1508 | mutex_init(&priv->conf_mutex); |
1501 | skb_queue_head_init(&priv->b_tx_status.queue); | 1509 | skb_queue_head_init(&priv->b_tx_status.queue); |
@@ -1506,6 +1514,8 @@ static int __devinit rtl8187_probe(struct usb_interface *intf, | |||
1506 | 1514 | ||
1507 | return 0; | 1515 | return 0; |
1508 | 1516 | ||
1517 | err_free_dmabuf: | ||
1518 | kfree(priv->io_dmabuf); | ||
1509 | err_free_dev: | 1519 | err_free_dev: |
1510 | ieee80211_free_hw(dev); | 1520 | ieee80211_free_hw(dev); |
1511 | usb_set_intfdata(intf, NULL); | 1521 | usb_set_intfdata(intf, NULL); |
@@ -1526,6 +1536,7 @@ static void __devexit rtl8187_disconnect(struct usb_interface *intf) | |||
1526 | priv = dev->priv; | 1536 | priv = dev->priv; |
1527 | usb_reset_device(priv->udev); | 1537 | usb_reset_device(priv->udev); |
1528 | usb_put_dev(interface_to_usbdev(intf)); | 1538 | usb_put_dev(interface_to_usbdev(intf)); |
1539 | kfree(priv->io_dmabuf); | ||
1529 | ieee80211_free_hw(dev); | 1540 | ieee80211_free_hw(dev); |
1530 | } | 1541 | } |
1531 | 1542 | ||
diff --git a/drivers/net/wireless/rtl818x/rtl8187_rtl8225.c b/drivers/net/wireless/rtl818x/rtl8187_rtl8225.c index 78df281b297a..a09819386a1e 100644 --- a/drivers/net/wireless/rtl818x/rtl8187_rtl8225.c +++ b/drivers/net/wireless/rtl818x/rtl8187_rtl8225.c | |||
@@ -88,9 +88,15 @@ static void rtl8225_write_8051(struct ieee80211_hw *dev, u8 addr, __le16 data) | |||
88 | rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, reg80); | 88 | rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, reg80); |
89 | udelay(10); | 89 | udelay(10); |
90 | 90 | ||
91 | mutex_lock(&priv->io_mutex); | ||
92 | |||
93 | priv->io_dmabuf->bits16 = data; | ||
91 | usb_control_msg(priv->udev, usb_sndctrlpipe(priv->udev, 0), | 94 | usb_control_msg(priv->udev, usb_sndctrlpipe(priv->udev, 0), |
92 | RTL8187_REQ_SET_REG, RTL8187_REQT_WRITE, | 95 | RTL8187_REQ_SET_REG, RTL8187_REQT_WRITE, |
93 | addr, 0x8225, &data, sizeof(data), HZ / 2); | 96 | addr, 0x8225, &priv->io_dmabuf->bits16, sizeof(data), |
97 | HZ / 2); | ||
98 | |||
99 | mutex_unlock(&priv->io_mutex); | ||
94 | 100 | ||
95 | rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, reg80 | (1 << 2)); | 101 | rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, reg80 | (1 << 2)); |
96 | udelay(10); | 102 | udelay(10); |