diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/arm/ixp4xx_eth.c | 31 | ||||
-rw-r--r-- | drivers/net/benet/be.h | 14 | ||||
-rw-r--r-- | drivers/net/benet/be_main.c | 10 | ||||
-rw-r--r-- | drivers/net/bnx2.c | 6 | ||||
-rw-r--r-- | drivers/net/bonding/bond_3ad.c | 11 | ||||
-rw-r--r-- | drivers/net/bonding/bond_main.c | 8 | ||||
-rw-r--r-- | drivers/net/igb/igb_main.c | 12 | ||||
-rw-r--r-- | drivers/net/meth.c | 27 | ||||
-rw-r--r-- | drivers/net/mlx4/en_cq.c | 4 | ||||
-rw-r--r-- | drivers/net/mlx4/en_rx.c | 1 | ||||
-rw-r--r-- | drivers/net/mv643xx_eth.c | 41 | ||||
-rw-r--r-- | drivers/net/vxge/vxge-traffic.c | 2 | ||||
-rw-r--r-- | drivers/net/wan/ixp4xx_hss.c | 4 | ||||
-rw-r--r-- | drivers/net/wimax/i2400m/rx.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/airo.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/ath5k/base.c | 22 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-6000.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 21 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/rtl818x/rtl8187.h | 57 | ||||
-rw-r--r-- | drivers/net/wireless/rtl818x/rtl8187_dev.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/rtl818x/rtl8187_rtl8225.c | 8 |
23 files changed, 196 insertions, 122 deletions
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/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/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/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/wireless/airo.c b/drivers/net/wireless/airo.c index c36d3a3d655f..d73475739127 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -6501,7 +6501,10 @@ static int airo_get_encode(struct net_device *dev, | |||
6501 | 6501 | ||
6502 | /* Copy the key to the user buffer */ | 6502 | /* Copy the key to the user buffer */ |
6503 | dwrq->length = get_wep_key(local, index, &buf[0], sizeof(buf)); | 6503 | dwrq->length = get_wep_key(local, index, &buf[0], sizeof(buf)); |
6504 | memcpy(extra, buf, dwrq->length); | 6504 | if (dwrq->length != -1) |
6505 | memcpy(extra, buf, dwrq->length); | ||
6506 | else | ||
6507 | dwrq->length = 0; | ||
6505 | 6508 | ||
6506 | return 0; | 6509 | return 0; |
6507 | } | 6510 | } |
@@ -6659,7 +6662,10 @@ static int airo_get_encodeext(struct net_device *dev, | |||
6659 | 6662 | ||
6660 | /* Copy the key to the user buffer */ | 6663 | /* Copy the key to the user buffer */ |
6661 | ext->key_len = get_wep_key(local, idx, &buf[0], sizeof(buf)); | 6664 | ext->key_len = get_wep_key(local, idx, &buf[0], sizeof(buf)); |
6662 | memcpy(extra, buf, ext->key_len); | 6665 | if (ext->key_len != -1) |
6666 | memcpy(extra, buf, ext->key_len); | ||
6667 | else | ||
6668 | ext->key_len = 0; | ||
6663 | 6669 | ||
6664 | return 0; | 6670 | return 0; |
6665 | } | 6671 | } |
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/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..3bb28db4a40f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -3636,7 +3636,9 @@ static struct pci_device_id iwl_hw_card_ids[] = { | |||
3636 | {IWL_PCI_DEVICE(0x0085, 0x1112, iwl6000_2ag_cfg)}, | 3636 | {IWL_PCI_DEVICE(0x0085, 0x1112, iwl6000_2ag_cfg)}, |
3637 | {IWL_PCI_DEVICE(0x0082, 0x1122, iwl6000_2ag_cfg)}, | 3637 | {IWL_PCI_DEVICE(0x0082, 0x1122, iwl6000_2ag_cfg)}, |
3638 | {IWL_PCI_DEVICE(0x422B, PCI_ANY_ID, iwl6000_3agn_cfg)}, | 3638 | {IWL_PCI_DEVICE(0x422B, PCI_ANY_ID, iwl6000_3agn_cfg)}, |
3639 | {IWL_PCI_DEVICE(0x422C, PCI_ANY_ID, iwl6000_2agn_cfg)}, | ||
3639 | {IWL_PCI_DEVICE(0x4238, PCI_ANY_ID, iwl6000_3agn_cfg)}, | 3640 | {IWL_PCI_DEVICE(0x4238, PCI_ANY_ID, iwl6000_3agn_cfg)}, |
3641 | {IWL_PCI_DEVICE(0x4239, PCI_ANY_ID, iwl6000_2agn_cfg)}, | ||
3640 | {IWL_PCI_DEVICE(0x0082, PCI_ANY_ID, iwl6000_2agn_cfg)}, | 3642 | {IWL_PCI_DEVICE(0x0082, PCI_ANY_ID, iwl6000_2agn_cfg)}, |
3641 | {IWL_PCI_DEVICE(0x0085, PCI_ANY_ID, iwl6000_3agn_cfg)}, | 3643 | {IWL_PCI_DEVICE(0x0085, PCI_ANY_ID, iwl6000_3agn_cfg)}, |
3642 | {IWL_PCI_DEVICE(0x0086, PCI_ANY_ID, iwl6050_3agn_cfg)}, | 3644 | {IWL_PCI_DEVICE(0x0086, PCI_ANY_ID, iwl6050_3agn_cfg)}, |
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..4cce66133500 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -1744,7 +1744,6 @@ static void iwl3945_rx_queue_free(struct iwl_priv *priv, struct iwl_rx_queue *rx | |||
1744 | rxq->bd = NULL; | 1744 | rxq->bd = NULL; |
1745 | rxq->rb_stts = NULL; | 1745 | rxq->rb_stts = NULL; |
1746 | } | 1746 | } |
1747 | EXPORT_SYMBOL(iwl3945_rx_queue_free); | ||
1748 | 1747 | ||
1749 | 1748 | ||
1750 | /* Convert linear signal-to-noise ratio into dB */ | 1749 | /* Convert linear signal-to-noise ratio into dB */ |
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); |