aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2011-09-20 14:11:55 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-09-20 14:11:55 -0400
commit4d8b61490c14a36efdee4a8bf523e26809df05ac (patch)
treee8a37cac291bb64fa3d85ac27df45f56d493f2cb /drivers
parentc9df56b48e4ff003eaebd680ec7a45342dcd03ea (diff)
parent8c23516fbb209ccf8f8c36268311c721faff29ee (diff)
Merge branch 'master' of git://git.infradead.org/users/linville/wireless
Conflicts: drivers/net/wireless/iwlwifi/iwl-pci.c drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c drivers/net/wireless/rt2x00/rt2800usb.c drivers/net/wireless/wl12xx/main.c
Diffstat (limited to 'drivers')
-rw-r--r--drivers/bcma/main.c12
-rw-r--r--drivers/bluetooth/ath3k.c1
-rw-r--r--drivers/bluetooth/btusb.c19
-rw-r--r--drivers/bluetooth/btwilink.c16
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c23
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9002_calib.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_eeprom.c10
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_phy.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_phy.h2
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c10
-rw-r--r--drivers/net/wireless/ath/carl9170/main.c4
-rw-r--r--drivers/net/wireless/b43/dma.c20
-rw-r--r--drivers/net/wireless/b43/main.c3
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2100.c21
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2200.c39
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-3945-rs.c13
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-ucode.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c5
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-pci.c11
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2800lib.c47
-rw-r--r--drivers/net/wireless/rt2x00/rt2800usb.c24
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00usb.c31
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c1
-rw-r--r--drivers/net/wireless/rtlwifi/core.c8
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/sw.c11
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/trx.c11
-rw-r--r--drivers/net/wireless/wl1251/acx.c6
-rw-r--r--drivers/net/wireless/wl1251/cmd.c2
-rw-r--r--drivers/net/wireless/wl12xx/acx.c6
-rw-r--r--drivers/net/wireless/wl12xx/sdio.c2
-rw-r--r--drivers/net/wireless/wl12xx/testmode.c50
32 files changed, 237 insertions, 180 deletions
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 7072216a2a3f..8c09c3e547cd 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -15,6 +15,7 @@ MODULE_LICENSE("GPL");
15static int bcma_bus_match(struct device *dev, struct device_driver *drv); 15static int bcma_bus_match(struct device *dev, struct device_driver *drv);
16static int bcma_device_probe(struct device *dev); 16static int bcma_device_probe(struct device *dev);
17static int bcma_device_remove(struct device *dev); 17static int bcma_device_remove(struct device *dev);
18static int bcma_device_uevent(struct device *dev, struct kobj_uevent_env *env);
18 19
19static ssize_t manuf_show(struct device *dev, struct device_attribute *attr, char *buf) 20static ssize_t manuf_show(struct device *dev, struct device_attribute *attr, char *buf)
20{ 21{
@@ -49,6 +50,7 @@ static struct bus_type bcma_bus_type = {
49 .match = bcma_bus_match, 50 .match = bcma_bus_match,
50 .probe = bcma_device_probe, 51 .probe = bcma_device_probe,
51 .remove = bcma_device_remove, 52 .remove = bcma_device_remove,
53 .uevent = bcma_device_uevent,
52 .dev_attrs = bcma_device_attrs, 54 .dev_attrs = bcma_device_attrs,
53}; 55};
54 56
@@ -295,6 +297,16 @@ static int bcma_device_remove(struct device *dev)
295 return 0; 297 return 0;
296} 298}
297 299
300static int bcma_device_uevent(struct device *dev, struct kobj_uevent_env *env)
301{
302 struct bcma_device *core = container_of(dev, struct bcma_device, dev);
303
304 return add_uevent_var(env,
305 "MODALIAS=bcma:m%04Xid%04Xrev%02Xcl%02X",
306 core->id.manuf, core->id.id,
307 core->id.rev, core->id.class);
308}
309
298static int __init bcma_modinit(void) 310static int __init bcma_modinit(void)
299{ 311{
300 int err; 312 int err;
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index a5854735bb2e..db7cb8111fbe 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -63,6 +63,7 @@ static struct usb_device_id ath3k_table[] = {
63 /* Atheros AR3011 with sflash firmware*/ 63 /* Atheros AR3011 with sflash firmware*/
64 { USB_DEVICE(0x0CF3, 0x3002) }, 64 { USB_DEVICE(0x0CF3, 0x3002) },
65 { USB_DEVICE(0x13d3, 0x3304) }, 65 { USB_DEVICE(0x13d3, 0x3304) },
66 { USB_DEVICE(0x0930, 0x0215) },
66 67
67 /* Atheros AR9285 Malbec with sflash firmware */ 68 /* Atheros AR9285 Malbec with sflash firmware */
68 { USB_DEVICE(0x03F0, 0x311D) }, 69 { USB_DEVICE(0x03F0, 0x311D) },
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 91d13a9e8c65..9cbac6b445e1 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -72,9 +72,15 @@ static struct usb_device_id btusb_table[] = {
72 /* Apple MacBookAir3,1, MacBookAir3,2 */ 72 /* Apple MacBookAir3,1, MacBookAir3,2 */
73 { USB_DEVICE(0x05ac, 0x821b) }, 73 { USB_DEVICE(0x05ac, 0x821b) },
74 74
75 /* Apple MacBookAir4,1 */
76 { USB_DEVICE(0x05ac, 0x821f) },
77
75 /* Apple MacBookPro8,2 */ 78 /* Apple MacBookPro8,2 */
76 { USB_DEVICE(0x05ac, 0x821a) }, 79 { USB_DEVICE(0x05ac, 0x821a) },
77 80
81 /* Apple MacMini5,1 */
82 { USB_DEVICE(0x05ac, 0x8281) },
83
78 /* AVM BlueFRITZ! USB v2.0 */ 84 /* AVM BlueFRITZ! USB v2.0 */
79 { USB_DEVICE(0x057c, 0x3800) }, 85 { USB_DEVICE(0x057c, 0x3800) },
80 86
@@ -106,6 +112,7 @@ static struct usb_device_id blacklist_table[] = {
106 /* Atheros 3011 with sflash firmware */ 112 /* Atheros 3011 with sflash firmware */
107 { USB_DEVICE(0x0cf3, 0x3002), .driver_info = BTUSB_IGNORE }, 113 { USB_DEVICE(0x0cf3, 0x3002), .driver_info = BTUSB_IGNORE },
108 { USB_DEVICE(0x13d3, 0x3304), .driver_info = BTUSB_IGNORE }, 114 { USB_DEVICE(0x13d3, 0x3304), .driver_info = BTUSB_IGNORE },
115 { USB_DEVICE(0x0930, 0x0215), .driver_info = BTUSB_IGNORE },
109 116
110 /* Atheros AR9285 Malbec with sflash firmware */ 117 /* Atheros AR9285 Malbec with sflash firmware */
111 { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE }, 118 { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE },
@@ -256,7 +263,9 @@ static void btusb_intr_complete(struct urb *urb)
256 263
257 err = usb_submit_urb(urb, GFP_ATOMIC); 264 err = usb_submit_urb(urb, GFP_ATOMIC);
258 if (err < 0) { 265 if (err < 0) {
259 if (err != -EPERM) 266 /* -EPERM: urb is being killed;
267 * -ENODEV: device got disconnected */
268 if (err != -EPERM && err != -ENODEV)
260 BT_ERR("%s urb %p failed to resubmit (%d)", 269 BT_ERR("%s urb %p failed to resubmit (%d)",
261 hdev->name, urb, -err); 270 hdev->name, urb, -err);
262 usb_unanchor_urb(urb); 271 usb_unanchor_urb(urb);
@@ -341,7 +350,9 @@ static void btusb_bulk_complete(struct urb *urb)
341 350
342 err = usb_submit_urb(urb, GFP_ATOMIC); 351 err = usb_submit_urb(urb, GFP_ATOMIC);
343 if (err < 0) { 352 if (err < 0) {
344 if (err != -EPERM) 353 /* -EPERM: urb is being killed;
354 * -ENODEV: device got disconnected */
355 if (err != -EPERM && err != -ENODEV)
345 BT_ERR("%s urb %p failed to resubmit (%d)", 356 BT_ERR("%s urb %p failed to resubmit (%d)",
346 hdev->name, urb, -err); 357 hdev->name, urb, -err);
347 usb_unanchor_urb(urb); 358 usb_unanchor_urb(urb);
@@ -431,7 +442,9 @@ static void btusb_isoc_complete(struct urb *urb)
431 442
432 err = usb_submit_urb(urb, GFP_ATOMIC); 443 err = usb_submit_urb(urb, GFP_ATOMIC);
433 if (err < 0) { 444 if (err < 0) {
434 if (err != -EPERM) 445 /* -EPERM: urb is being killed;
446 * -ENODEV: device got disconnected */
447 if (err != -EPERM && err != -ENODEV)
435 BT_ERR("%s urb %p failed to resubmit (%d)", 448 BT_ERR("%s urb %p failed to resubmit (%d)",
436 hdev->name, urb, -err); 449 hdev->name, urb, -err);
437 usb_unanchor_urb(urb); 450 usb_unanchor_urb(urb);
diff --git a/drivers/bluetooth/btwilink.c b/drivers/bluetooth/btwilink.c
index 65d27aff553a..04d353f58d71 100644
--- a/drivers/bluetooth/btwilink.c
+++ b/drivers/bluetooth/btwilink.c
@@ -125,6 +125,13 @@ static long st_receive(void *priv_data, struct sk_buff *skb)
125/* protocol structure registered with shared transport */ 125/* protocol structure registered with shared transport */
126static struct st_proto_s ti_st_proto[MAX_BT_CHNL_IDS] = { 126static struct st_proto_s ti_st_proto[MAX_BT_CHNL_IDS] = {
127 { 127 {
128 .chnl_id = HCI_EVENT_PKT, /* HCI Events */
129 .hdr_len = sizeof(struct hci_event_hdr),
130 .offset_len_in_hdr = offsetof(struct hci_event_hdr, plen),
131 .len_size = 1, /* sizeof(plen) in struct hci_event_hdr */
132 .reserve = 8,
133 },
134 {
128 .chnl_id = HCI_ACLDATA_PKT, /* ACL */ 135 .chnl_id = HCI_ACLDATA_PKT, /* ACL */
129 .hdr_len = sizeof(struct hci_acl_hdr), 136 .hdr_len = sizeof(struct hci_acl_hdr),
130 .offset_len_in_hdr = offsetof(struct hci_acl_hdr, dlen), 137 .offset_len_in_hdr = offsetof(struct hci_acl_hdr, dlen),
@@ -138,13 +145,6 @@ static struct st_proto_s ti_st_proto[MAX_BT_CHNL_IDS] = {
138 .len_size = 1, /* sizeof(dlen) in struct hci_sco_hdr */ 145 .len_size = 1, /* sizeof(dlen) in struct hci_sco_hdr */
139 .reserve = 8, 146 .reserve = 8,
140 }, 147 },
141 {
142 .chnl_id = HCI_EVENT_PKT, /* HCI Events */
143 .hdr_len = sizeof(struct hci_event_hdr),
144 .offset_len_in_hdr = offsetof(struct hci_event_hdr, plen),
145 .len_size = 1, /* sizeof(plen) in struct hci_event_hdr */
146 .reserve = 8,
147 },
148}; 148};
149 149
150/* Called from HCI core to initialize the device */ 150/* Called from HCI core to initialize the device */
@@ -240,7 +240,7 @@ static int ti_st_close(struct hci_dev *hdev)
240 if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags)) 240 if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags))
241 return 0; 241 return 0;
242 242
243 for (i = 0; i < MAX_BT_CHNL_IDS; i++) { 243 for (i = MAX_BT_CHNL_IDS-1; i >= 0; i--) {
244 err = st_unregister(&ti_st_proto[i]); 244 err = st_unregister(&ti_st_proto[i]);
245 if (err) 245 if (err)
246 BT_ERR("st_unregister(%d) failed with error %d", 246 BT_ERR("st_unregister(%d) failed with error %d",
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 108d55a06965..e9ea38d0fff6 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1729,6 +1729,8 @@ ath5k_beacon_setup(struct ath5k_hw *ah, struct ath5k_buf *bf)
1729 1729
1730 if (dma_mapping_error(ah->dev, bf->skbaddr)) { 1730 if (dma_mapping_error(ah->dev, bf->skbaddr)) {
1731 ATH5K_ERR(ah, "beacon DMA mapping failed\n"); 1731 ATH5K_ERR(ah, "beacon DMA mapping failed\n");
1732 dev_kfree_skb_any(skb);
1733 bf->skb = NULL;
1732 return -EIO; 1734 return -EIO;
1733 } 1735 }
1734 1736
@@ -1813,8 +1815,6 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
1813 ath5k_txbuf_free_skb(ah, avf->bbuf); 1815 ath5k_txbuf_free_skb(ah, avf->bbuf);
1814 avf->bbuf->skb = skb; 1816 avf->bbuf->skb = skb;
1815 ret = ath5k_beacon_setup(ah, avf->bbuf); 1817 ret = ath5k_beacon_setup(ah, avf->bbuf);
1816 if (ret)
1817 avf->bbuf->skb = NULL;
1818out: 1818out:
1819 return ret; 1819 return ret;
1820} 1820}
@@ -1834,6 +1834,7 @@ ath5k_beacon_send(struct ath5k_hw *ah)
1834 struct ath5k_vif *avf; 1834 struct ath5k_vif *avf;
1835 struct ath5k_buf *bf; 1835 struct ath5k_buf *bf;
1836 struct sk_buff *skb; 1836 struct sk_buff *skb;
1837 int err;
1837 1838
1838 ATH5K_DBG_UNLIMIT(ah, ATH5K_DEBUG_BEACON, "in beacon_send\n"); 1839 ATH5K_DBG_UNLIMIT(ah, ATH5K_DEBUG_BEACON, "in beacon_send\n");
1839 1840
@@ -1882,11 +1883,6 @@ ath5k_beacon_send(struct ath5k_hw *ah)
1882 1883
1883 avf = (void *)vif->drv_priv; 1884 avf = (void *)vif->drv_priv;
1884 bf = avf->bbuf; 1885 bf = avf->bbuf;
1885 if (unlikely(bf->skb == NULL || ah->opmode == NL80211_IFTYPE_STATION ||
1886 ah->opmode == NL80211_IFTYPE_MONITOR)) {
1887 ATH5K_WARN(ah, "bf=%p bf_skb=%p\n", bf, bf ? bf->skb : NULL);
1888 return;
1889 }
1890 1886
1891 /* 1887 /*
1892 * Stop any current dma and put the new frame on the queue. 1888 * Stop any current dma and put the new frame on the queue.
@@ -1900,8 +1896,17 @@ ath5k_beacon_send(struct ath5k_hw *ah)
1900 1896
1901 /* refresh the beacon for AP or MESH mode */ 1897 /* refresh the beacon for AP or MESH mode */
1902 if (ah->opmode == NL80211_IFTYPE_AP || 1898 if (ah->opmode == NL80211_IFTYPE_AP ||
1903 ah->opmode == NL80211_IFTYPE_MESH_POINT) 1899 ah->opmode == NL80211_IFTYPE_MESH_POINT) {
1904 ath5k_beacon_update(ah->hw, vif); 1900 err = ath5k_beacon_update(ah->hw, vif);
1901 if (err)
1902 return;
1903 }
1904
1905 if (unlikely(bf->skb == NULL || ah->opmode == NL80211_IFTYPE_STATION ||
1906 ah->opmode == NL80211_IFTYPE_MONITOR)) {
1907 ATH5K_WARN(ah, "bf=%p bf_skb=%p\n", bf, bf->skb);
1908 return;
1909 }
1905 1910
1906 trace_ath5k_tx(ah, bf->skb, &ah->txqs[ah->bhalq]); 1911 trace_ath5k_tx(ah, bf->skb, &ah->txqs[ah->bhalq]);
1907 1912
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_calib.c b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
index c527af84b371..e0ab0657cc3a 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
@@ -41,7 +41,8 @@ static bool ar9002_hw_is_cal_supported(struct ath_hw *ah,
41 case ADC_DC_CAL: 41 case ADC_DC_CAL:
42 /* Run ADC Gain Cal for non-CCK & non 2GHz-HT20 only */ 42 /* Run ADC Gain Cal for non-CCK & non 2GHz-HT20 only */
43 if (!IS_CHAN_B(chan) && 43 if (!IS_CHAN_B(chan) &&
44 !(IS_CHAN_2GHZ(chan) && IS_CHAN_HT20(chan))) 44 !((IS_CHAN_2GHZ(chan) || IS_CHAN_A_FAST_CLOCK(ah, chan)) &&
45 IS_CHAN_HT20(chan)))
45 supported = true; 46 supported = true;
46 break; 47 break;
47 } 48 }
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index 98e4caef7850..51398f0063e2 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -50,7 +50,7 @@ static int ar9003_hw_power_interpolate(int32_t x,
50static const struct ar9300_eeprom ar9300_default = { 50static const struct ar9300_eeprom ar9300_default = {
51 .eepromVersion = 2, 51 .eepromVersion = 2,
52 .templateVersion = 2, 52 .templateVersion = 2,
53 .macAddr = {1, 2, 3, 4, 5, 6}, 53 .macAddr = {0, 2, 3, 4, 5, 6},
54 .custData = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54 .custData = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
55 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 55 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
56 .baseEepHeader = { 56 .baseEepHeader = {
@@ -288,7 +288,7 @@ static const struct ar9300_eeprom ar9300_default = {
288 { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, 288 { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
289 { { CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 1) } }, 289 { { CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 1) } },
290 290
291 { { CTL(60, 1), CTL(60, 0), CTL(0, 0), CTL(0, 0) } }, 291 { { CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 0) } },
292 { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, 292 { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
293 { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, 293 { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
294 294
@@ -865,7 +865,7 @@ static const struct ar9300_eeprom ar9300_x113 = {
865 { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, 865 { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
866 { { CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 1) } }, 866 { { CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 1) } },
867 867
868 { { CTL(60, 1), CTL(60, 0), CTL(0, 0), CTL(0, 0) } }, 868 { { CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 0) } },
869 { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, 869 { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
870 { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, 870 { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
871 871
@@ -2021,7 +2021,7 @@ static const struct ar9300_eeprom ar9300_x112 = {
2021 { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, 2021 { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
2022 { { CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 1) } }, 2022 { { CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 1) } },
2023 2023
2024 { { CTL(60, 1), CTL(60, 0), CTL(0, 0), CTL(0, 0) } }, 2024 { { CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 0) } },
2025 { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, 2025 { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
2026 { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, 2026 { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } },
2027 2027
@@ -3887,7 +3887,7 @@ static void ar9003_hw_internal_regulator_apply(struct ath_hw *ah)
3887 } 3887 }
3888 } else { 3888 } else {
3889 reg_pmu_set = (5 << 1) | (7 << 4) | 3889 reg_pmu_set = (5 << 1) | (7 << 4) |
3890 (1 << 8) | (2 << 14) | 3890 (2 << 8) | (2 << 14) |
3891 (6 << 17) | (1 << 20) | 3891 (6 << 17) | (1 << 20) |
3892 (3 << 24) | (1 << 28); 3892 (3 << 24) | (1 << 28);
3893 } 3893 }
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index 9874248240e8..7db6e8647a01 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -681,7 +681,7 @@ static int ar9003_hw_process_ini(struct ath_hw *ah,
681 REG_WRITE_ARRAY(&ah->iniModesAdditional, 681 REG_WRITE_ARRAY(&ah->iniModesAdditional,
682 modesIndex, regWrites); 682 modesIndex, regWrites);
683 683
684 if (AR_SREV_9300(ah)) 684 if (AR_SREV_9330(ah))
685 REG_WRITE_ARRAY(&ah->iniModesAdditional, 1, regWrites); 685 REG_WRITE_ARRAY(&ah->iniModesAdditional, 1, regWrites);
686 686
687 if (AR_SREV_9340(ah) && !ah->is_clk_25mhz) 687 if (AR_SREV_9340(ah) && !ah->is_clk_25mhz)
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.h b/drivers/net/wireless/ath/ath9k/ar9003_phy.h
index f1be87454308..6cea546a1507 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.h
@@ -898,7 +898,7 @@
898#define AR_PHY_TPC_19_B1_ALPHA_THERM 0xff 898#define AR_PHY_TPC_19_B1_ALPHA_THERM 0xff
899#define AR_PHY_TPC_19_B1_ALPHA_THERM_S 0 899#define AR_PHY_TPC_19_B1_ALPHA_THERM_S 0
900#define AR_PHY_TX_IQCAL_STATUS_B1 (AR_SM1_BASE + 0x48c) 900#define AR_PHY_TX_IQCAL_STATUS_B1 (AR_SM1_BASE + 0x48c)
901#define AR_PHY_TX_IQCAL_CORR_COEFF_B1(_i) (AR_SM_BASE + 0x450 + ((_i) << 2)) 901#define AR_PHY_TX_IQCAL_CORR_COEFF_B1(_i) (AR_SM1_BASE + 0x450 + ((_i) << 2))
902 902
903/* SM 1 AIC Registers */ 903/* SM 1 AIC Registers */
904 904
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 6dcd8def5530..ee39702da5d8 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2273,7 +2273,11 @@ static void ath9k_set_coverage_class(struct ieee80211_hw *hw, u8 coverage_class)
2273 2273
2274 mutex_lock(&sc->mutex); 2274 mutex_lock(&sc->mutex);
2275 ah->coverage_class = coverage_class; 2275 ah->coverage_class = coverage_class;
2276
2277 ath9k_ps_wakeup(sc);
2276 ath9k_hw_init_global_settings(ah); 2278 ath9k_hw_init_global_settings(ah);
2279 ath9k_ps_restore(sc);
2280
2277 mutex_unlock(&sc->mutex); 2281 mutex_unlock(&sc->mutex);
2278} 2282}
2279 2283
@@ -2289,6 +2293,12 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
2289 mutex_lock(&sc->mutex); 2293 mutex_lock(&sc->mutex);
2290 cancel_delayed_work_sync(&sc->tx_complete_work); 2294 cancel_delayed_work_sync(&sc->tx_complete_work);
2291 2295
2296 if (ah->ah_flags & AH_UNPLUGGED) {
2297 ath_dbg(common, ATH_DBG_ANY, "Device has been unplugged!\n");
2298 mutex_unlock(&sc->mutex);
2299 return;
2300 }
2301
2292 if (sc->sc_flags & SC_OP_INVALID) { 2302 if (sc->sc_flags & SC_OP_INVALID) {
2293 ath_dbg(common, ATH_DBG_ANY, "Device not present\n"); 2303 ath_dbg(common, ATH_DBG_ANY, "Device not present\n");
2294 mutex_unlock(&sc->mutex); 2304 mutex_unlock(&sc->mutex);
diff --git a/drivers/net/wireless/ath/carl9170/main.c b/drivers/net/wireless/ath/carl9170/main.c
index 782b8f3ae58f..af351ecd87c4 100644
--- a/drivers/net/wireless/ath/carl9170/main.c
+++ b/drivers/net/wireless/ath/carl9170/main.c
@@ -1115,8 +1115,10 @@ static int carl9170_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
1115 * the high througput speed in 802.11n networks. 1115 * the high througput speed in 802.11n networks.
1116 */ 1116 */
1117 1117
1118 if (!is_main_vif(ar, vif)) 1118 if (!is_main_vif(ar, vif)) {
1119 mutex_lock(&ar->mutex);
1119 goto err_softw; 1120 goto err_softw;
1121 }
1120 1122
1121 /* 1123 /*
1122 * While the hardware supports *catch-all* key, for offloading 1124 * While the hardware supports *catch-all* key, for offloading
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c
index 975d96040548..5e45604f0f5d 100644
--- a/drivers/net/wireless/b43/dma.c
+++ b/drivers/net/wireless/b43/dma.c
@@ -817,9 +817,23 @@ static u64 supported_dma_mask(struct b43_wldev *dev)
817 u32 tmp; 817 u32 tmp;
818 u16 mmio_base; 818 u16 mmio_base;
819 819
820 tmp = b43_read32(dev, SSB_TMSHIGH); 820 switch (dev->dev->bus_type) {
821 if (tmp & SSB_TMSHIGH_DMA64) 821#ifdef CONFIG_B43_BCMA
822 return DMA_BIT_MASK(64); 822 case B43_BUS_BCMA:
823 tmp = bcma_aread32(dev->dev->bdev, BCMA_IOST);
824 if (tmp & BCMA_IOST_DMA64)
825 return DMA_BIT_MASK(64);
826 break;
827#endif
828#ifdef CONFIG_B43_SSB
829 case B43_BUS_SSB:
830 tmp = ssb_read32(dev->dev->sdev, SSB_TMSHIGH);
831 if (tmp & SSB_TMSHIGH_DMA64)
832 return DMA_BIT_MASK(64);
833 break;
834#endif
835 }
836
823 mmio_base = b43_dmacontroller_base(0, 0); 837 mmio_base = b43_dmacontroller_base(0, 0);
824 b43_write32(dev, mmio_base + B43_DMA32_TXCTL, B43_DMA32_TXADDREXT_MASK); 838 b43_write32(dev, mmio_base + B43_DMA32_TXCTL, B43_DMA32_TXADDREXT_MASK);
825 tmp = b43_read32(dev, mmio_base + B43_DMA32_TXCTL); 839 tmp = b43_read32(dev, mmio_base + B43_DMA32_TXCTL);
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 24077023d484..56fa3a3648c4 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -1637,7 +1637,8 @@ static void handle_irq_beacon(struct b43_wldev *dev)
1637 u32 cmd, beacon0_valid, beacon1_valid; 1637 u32 cmd, beacon0_valid, beacon1_valid;
1638 1638
1639 if (!b43_is_mode(wl, NL80211_IFTYPE_AP) && 1639 if (!b43_is_mode(wl, NL80211_IFTYPE_AP) &&
1640 !b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT)) 1640 !b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT) &&
1641 !b43_is_mode(wl, NL80211_IFTYPE_ADHOC))
1641 return; 1642 return;
1642 1643
1643 /* This is the bottom half of the asynchronous beacon update. */ 1644 /* This is the bottom half of the asynchronous beacon update. */
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 3774dd034746..ef9ad79d1bfd 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -1903,15 +1903,17 @@ static void ipw2100_down(struct ipw2100_priv *priv)
1903static int ipw2100_net_init(struct net_device *dev) 1903static int ipw2100_net_init(struct net_device *dev)
1904{ 1904{
1905 struct ipw2100_priv *priv = libipw_priv(dev); 1905 struct ipw2100_priv *priv = libipw_priv(dev);
1906
1907 return ipw2100_up(priv, 1);
1908}
1909
1910static int ipw2100_wdev_init(struct net_device *dev)
1911{
1912 struct ipw2100_priv *priv = libipw_priv(dev);
1906 const struct libipw_geo *geo = libipw_get_geo(priv->ieee); 1913 const struct libipw_geo *geo = libipw_get_geo(priv->ieee);
1907 struct wireless_dev *wdev = &priv->ieee->wdev; 1914 struct wireless_dev *wdev = &priv->ieee->wdev;
1908 int ret;
1909 int i; 1915 int i;
1910 1916
1911 ret = ipw2100_up(priv, 1);
1912 if (ret)
1913 return ret;
1914
1915 memcpy(wdev->wiphy->perm_addr, priv->mac_addr, ETH_ALEN); 1917 memcpy(wdev->wiphy->perm_addr, priv->mac_addr, ETH_ALEN);
1916 1918
1917 /* fill-out priv->ieee->bg_band */ 1919 /* fill-out priv->ieee->bg_band */
@@ -6350,9 +6352,13 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
6350 "Error calling register_netdev.\n"); 6352 "Error calling register_netdev.\n");
6351 goto fail; 6353 goto fail;
6352 } 6354 }
6355 registered = 1;
6356
6357 err = ipw2100_wdev_init(dev);
6358 if (err)
6359 goto fail;
6353 6360
6354 mutex_lock(&priv->action_mutex); 6361 mutex_lock(&priv->action_mutex);
6355 registered = 1;
6356 6362
6357 IPW_DEBUG_INFO("%s: Bound to %s\n", dev->name, pci_name(pci_dev)); 6363 IPW_DEBUG_INFO("%s: Bound to %s\n", dev->name, pci_name(pci_dev));
6358 6364
@@ -6389,7 +6395,8 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
6389 6395
6390 fail_unlock: 6396 fail_unlock:
6391 mutex_unlock(&priv->action_mutex); 6397 mutex_unlock(&priv->action_mutex);
6392 6398 wiphy_unregister(priv->ieee->wdev.wiphy);
6399 kfree(priv->ieee->bg_band.channels);
6393 fail: 6400 fail:
6394 if (dev) { 6401 if (dev) {
6395 if (registered) 6402 if (registered)
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 4395977d5369..1d546668b2ee 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -11426,16 +11426,23 @@ static void ipw_bg_down(struct work_struct *work)
11426/* Called by register_netdev() */ 11426/* Called by register_netdev() */
11427static int ipw_net_init(struct net_device *dev) 11427static int ipw_net_init(struct net_device *dev)
11428{ 11428{
11429 int rc = 0;
11430 struct ipw_priv *priv = libipw_priv(dev);
11431
11432 mutex_lock(&priv->mutex);
11433 if (ipw_up(priv))
11434 rc = -EIO;
11435 mutex_unlock(&priv->mutex);
11436
11437 return rc;
11438}
11439
11440static int ipw_wdev_init(struct net_device *dev)
11441{
11429 int i, rc = 0; 11442 int i, rc = 0;
11430 struct ipw_priv *priv = libipw_priv(dev); 11443 struct ipw_priv *priv = libipw_priv(dev);
11431 const struct libipw_geo *geo = libipw_get_geo(priv->ieee); 11444 const struct libipw_geo *geo = libipw_get_geo(priv->ieee);
11432 struct wireless_dev *wdev = &priv->ieee->wdev; 11445 struct wireless_dev *wdev = &priv->ieee->wdev;
11433 mutex_lock(&priv->mutex);
11434
11435 if (ipw_up(priv)) {
11436 rc = -EIO;
11437 goto out;
11438 }
11439 11446
11440 memcpy(wdev->wiphy->perm_addr, priv->mac_addr, ETH_ALEN); 11447 memcpy(wdev->wiphy->perm_addr, priv->mac_addr, ETH_ALEN);
11441 11448
@@ -11520,13 +11527,9 @@ static int ipw_net_init(struct net_device *dev)
11520 set_wiphy_dev(wdev->wiphy, &priv->pci_dev->dev); 11527 set_wiphy_dev(wdev->wiphy, &priv->pci_dev->dev);
11521 11528
11522 /* With that information in place, we can now register the wiphy... */ 11529 /* With that information in place, we can now register the wiphy... */
11523 if (wiphy_register(wdev->wiphy)) { 11530 if (wiphy_register(wdev->wiphy))
11524 rc = -EIO; 11531 rc = -EIO;
11525 goto out;
11526 }
11527
11528out: 11532out:
11529 mutex_unlock(&priv->mutex);
11530 return rc; 11533 return rc;
11531} 11534}
11532 11535
@@ -11833,14 +11836,22 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev,
11833 goto out_remove_sysfs; 11836 goto out_remove_sysfs;
11834 } 11837 }
11835 11838
11839 err = ipw_wdev_init(net_dev);
11840 if (err) {
11841 IPW_ERROR("failed to register wireless device\n");
11842 goto out_unregister_netdev;
11843 }
11844
11836#ifdef CONFIG_IPW2200_PROMISCUOUS 11845#ifdef CONFIG_IPW2200_PROMISCUOUS
11837 if (rtap_iface) { 11846 if (rtap_iface) {
11838 err = ipw_prom_alloc(priv); 11847 err = ipw_prom_alloc(priv);
11839 if (err) { 11848 if (err) {
11840 IPW_ERROR("Failed to register promiscuous network " 11849 IPW_ERROR("Failed to register promiscuous network "
11841 "device (error %d).\n", err); 11850 "device (error %d).\n", err);
11842 unregister_netdev(priv->net_dev); 11851 wiphy_unregister(priv->ieee->wdev.wiphy);
11843 goto out_remove_sysfs; 11852 kfree(priv->ieee->a_band.channels);
11853 kfree(priv->ieee->bg_band.channels);
11854 goto out_unregister_netdev;
11844 } 11855 }
11845 } 11856 }
11846#endif 11857#endif
@@ -11852,6 +11863,8 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev,
11852 11863
11853 return 0; 11864 return 0;
11854 11865
11866 out_unregister_netdev:
11867 unregister_netdev(priv->net_dev);
11855 out_remove_sysfs: 11868 out_remove_sysfs:
11856 sysfs_remove_group(&pdev->dev.kobj, &ipw_attribute_group); 11869 sysfs_remove_group(&pdev->dev.kobj, &ipw_attribute_group);
11857 out_release_irq: 11870 out_release_irq:
diff --git a/drivers/net/wireless/iwlegacy/iwl-3945-rs.c b/drivers/net/wireless/iwlegacy/iwl-3945-rs.c
index 0cc5177d738d..8faeaf2dddec 100644
--- a/drivers/net/wireless/iwlegacy/iwl-3945-rs.c
+++ b/drivers/net/wireless/iwlegacy/iwl-3945-rs.c
@@ -821,12 +821,15 @@ static void iwl3945_rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
821 821
822 out: 822 out:
823 823
824 rs_sta->last_txrate_idx = index; 824 if (sband->band == IEEE80211_BAND_5GHZ) {
825 if (sband->band == IEEE80211_BAND_5GHZ) 825 if (WARN_ON_ONCE(index < IWL_FIRST_OFDM_RATE))
826 info->control.rates[0].idx = rs_sta->last_txrate_idx - 826 index = IWL_FIRST_OFDM_RATE;
827 IWL_FIRST_OFDM_RATE; 827 rs_sta->last_txrate_idx = index;
828 else 828 info->control.rates[0].idx = index - IWL_FIRST_OFDM_RATE;
829 } else {
830 rs_sta->last_txrate_idx = index;
829 info->control.rates[0].idx = rs_sta->last_txrate_idx; 831 info->control.rates[0].idx = rs_sta->last_txrate_idx;
832 }
830 833
831 IWL_DEBUG_RATE(priv, "leave: %d\n", index); 834 IWL_DEBUG_RATE(priv, "leave: %d\n", index);
832} 835}
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c b/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
index 3e40429fa5ef..634f18f6125a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
@@ -163,7 +163,7 @@ static int iwlagn_set_temperature_offset_calib(struct iwl_priv *priv)
163 163
164 memset(&cmd, 0, sizeof(cmd)); 164 memset(&cmd, 0, sizeof(cmd));
165 iwl_set_calib_hdr(&cmd.hdr, IWL_PHY_CALIBRATE_TEMP_OFFSET_CMD); 165 iwl_set_calib_hdr(&cmd.hdr, IWL_PHY_CALIBRATE_TEMP_OFFSET_CMD);
166 memcpy(&cmd.radio_sensor_offset, offset_calib, sizeof(offset_calib)); 166 memcpy(&cmd.radio_sensor_offset, offset_calib, sizeof(*offset_calib));
167 if (!(cmd.radio_sensor_offset)) 167 if (!(cmd.radio_sensor_offset))
168 cmd.radio_sensor_offset = DEFAULT_RADIO_SENSOR_OFFSET; 168 cmd.radio_sensor_offset = DEFAULT_RADIO_SENSOR_OFFSET;
169 169
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 1d53eb84acbb..6def1c272775 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1657,7 +1657,12 @@ static int iwl_mac_setup_register(struct iwl_priv *priv,
1657 IEEE80211_HW_SPECTRUM_MGMT | 1657 IEEE80211_HW_SPECTRUM_MGMT |
1658 IEEE80211_HW_REPORTS_TX_ACK_STATUS; 1658 IEEE80211_HW_REPORTS_TX_ACK_STATUS;
1659 1659
1660 /*
1661 * Including the following line will crash some AP's. This
1662 * workaround removes the stimulus which causes the crash until
1663 * the AP software can be fixed.
1660 hw->max_tx_aggregation_subframes = LINK_QUAL_AGG_FRAME_LIMIT_DEF; 1664 hw->max_tx_aggregation_subframes = LINK_QUAL_AGG_FRAME_LIMIT_DEF;
1665 */
1661 1666
1662 hw->flags |= IEEE80211_HW_SUPPORTS_PS | 1667 hw->flags |= IEEE80211_HW_SUPPORTS_PS |
1663 IEEE80211_HW_SUPPORTS_DYNAMIC_PS; 1668 IEEE80211_HW_SUPPORTS_DYNAMIC_PS;
diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c b/drivers/net/wireless/iwlwifi/iwl-pci.c
index 23b5f78207ca..1d7bb7423f94 100644
--- a/drivers/net/wireless/iwlwifi/iwl-pci.c
+++ b/drivers/net/wireless/iwlwifi/iwl-pci.c
@@ -483,15 +483,16 @@ static void __devexit iwl_pci_remove(struct pci_dev *pdev)
483{ 483{
484 struct iwl_bus *bus = pci_get_drvdata(pdev); 484 struct iwl_bus *bus = pci_get_drvdata(pdev);
485 struct iwl_pci_bus *pci_bus = IWL_BUS_GET_PCI_BUS(bus); 485 struct iwl_pci_bus *pci_bus = IWL_BUS_GET_PCI_BUS(bus);
486 struct pci_dev *pci_dev = IWL_BUS_GET_PCI_DEV(bus);
486 struct iwl_shared *shrd = bus->shrd; 487 struct iwl_shared *shrd = bus->shrd;
487 488
488 iwl_remove(shrd->priv); 489 iwl_remove(shrd->priv);
489 490
490 pci_disable_msi(pci_bus->pci_dev); 491 pci_disable_msi(pci_dev);
491 pci_iounmap(pci_bus->pci_dev, pci_bus->hw_base); 492 pci_iounmap(pci_dev, pci_bus->hw_base);
492 pci_release_regions(pci_bus->pci_dev); 493 pci_release_regions(pci_dev);
493 pci_disable_device(pci_bus->pci_dev); 494 pci_disable_device(pci_dev);
494 pci_set_drvdata(pci_bus->pci_dev, NULL); 495 pci_set_drvdata(pci_dev, NULL);
495 496
496 kfree(bus); 497 kfree(bus);
497} 498}
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c
index c8e56858fa10..031a291a13dc 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c
@@ -928,6 +928,8 @@ void iwl_tx_cmd_complete(struct iwl_trans *trans, struct iwl_rx_mem_buffer *rxb)
928 cmd = txq->cmd[cmd_index]; 928 cmd = txq->cmd[cmd_index];
929 meta = &txq->meta[cmd_index]; 929 meta = &txq->meta[cmd_index];
930 930
931 txq->time_stamp = jiffies;
932
931 iwlagn_unmap_tfd(trans, meta, &txq->tfds[index], 933 iwlagn_unmap_tfd(trans, meta, &txq->tfds[index],
932 DMA_BIDIRECTIONAL); 934 DMA_BIDIRECTIONAL);
933 935
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index a5ddb39ca4a0..31c98509f7e6 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -3769,14 +3769,15 @@ static void rt2800_efuse_read(struct rt2x00_dev *rt2x00dev, unsigned int i)
3769 rt2800_regbusy_read(rt2x00dev, EFUSE_CTRL, EFUSE_CTRL_KICK, &reg); 3769 rt2800_regbusy_read(rt2x00dev, EFUSE_CTRL, EFUSE_CTRL_KICK, &reg);
3770 3770
3771 /* Apparently the data is read from end to start */ 3771 /* Apparently the data is read from end to start */
3772 rt2800_register_read_lock(rt2x00dev, EFUSE_DATA3, 3772 rt2800_register_read_lock(rt2x00dev, EFUSE_DATA3, &reg);
3773 (u32 *)&rt2x00dev->eeprom[i]); 3773 /* The returned value is in CPU order, but eeprom is le */
3774 rt2800_register_read_lock(rt2x00dev, EFUSE_DATA2, 3774 rt2x00dev->eeprom[i] = cpu_to_le32(reg);
3775 (u32 *)&rt2x00dev->eeprom[i + 2]); 3775 rt2800_register_read_lock(rt2x00dev, EFUSE_DATA2, &reg);
3776 rt2800_register_read_lock(rt2x00dev, EFUSE_DATA1, 3776 *(u32 *)&rt2x00dev->eeprom[i + 2] = cpu_to_le32(reg);
3777 (u32 *)&rt2x00dev->eeprom[i + 4]); 3777 rt2800_register_read_lock(rt2x00dev, EFUSE_DATA1, &reg);
3778 rt2800_register_read_lock(rt2x00dev, EFUSE_DATA0, 3778 *(u32 *)&rt2x00dev->eeprom[i + 4] = cpu_to_le32(reg);
3779 (u32 *)&rt2x00dev->eeprom[i + 6]); 3779 rt2800_register_read_lock(rt2x00dev, EFUSE_DATA0, &reg);
3780 *(u32 *)&rt2x00dev->eeprom[i + 6] = cpu_to_le32(reg);
3780 3781
3781 mutex_unlock(&rt2x00dev->csr_mutex); 3782 mutex_unlock(&rt2x00dev->csr_mutex);
3782} 3783}
@@ -3942,19 +3943,23 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev)
3942 return -ENODEV; 3943 return -ENODEV;
3943 } 3944 }
3944 3945
3945 if (!rt2x00_rf(rt2x00dev, RF2820) && 3946 switch (rt2x00dev->chip.rf) {
3946 !rt2x00_rf(rt2x00dev, RF2850) && 3947 case RF2820:
3947 !rt2x00_rf(rt2x00dev, RF2720) && 3948 case RF2850:
3948 !rt2x00_rf(rt2x00dev, RF2750) && 3949 case RF2720:
3949 !rt2x00_rf(rt2x00dev, RF3020) && 3950 case RF2750:
3950 !rt2x00_rf(rt2x00dev, RF2020) && 3951 case RF3020:
3951 !rt2x00_rf(rt2x00dev, RF3021) && 3952 case RF2020:
3952 !rt2x00_rf(rt2x00dev, RF3022) && 3953 case RF3021:
3953 !rt2x00_rf(rt2x00dev, RF3052) && 3954 case RF3022:
3954 !rt2x00_rf(rt2x00dev, RF3320) && 3955 case RF3052:
3955 !rt2x00_rf(rt2x00dev, RF5370) && 3956 case RF3320:
3956 !rt2x00_rf(rt2x00dev, RF5390)) { 3957 case RF5370:
3957 ERROR(rt2x00dev, "Invalid RF chipset detected.\n"); 3958 case RF5390:
3959 break;
3960 default:
3961 ERROR(rt2x00dev, "Invalid RF chipset 0x%x detected.\n",
3962 rt2x00dev->chip.rf);
3958 return -ENODEV; 3963 return -ENODEV;
3959 } 3964 }
3960 3965
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index 4b907a53f97c..f1565792f270 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -464,6 +464,15 @@ static bool rt2800usb_txdone_entry_check(struct queue_entry *entry, u32 reg)
464 int wcid, ack, pid; 464 int wcid, ack, pid;
465 int tx_wcid, tx_ack, tx_pid; 465 int tx_wcid, tx_ack, tx_pid;
466 466
467 if (test_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags) ||
468 !test_bit(ENTRY_DATA_STATUS_PENDING, &entry->flags)) {
469 WARNING(entry->queue->rt2x00dev,
470 "Data pending for entry %u in queue %u\n",
471 entry->entry_idx, entry->queue->qid);
472 cond_resched();
473 return false;
474 }
475
467 wcid = rt2x00_get_field32(reg, TX_STA_FIFO_WCID); 476 wcid = rt2x00_get_field32(reg, TX_STA_FIFO_WCID);
468 ack = rt2x00_get_field32(reg, TX_STA_FIFO_TX_ACK_REQUIRED); 477 ack = rt2x00_get_field32(reg, TX_STA_FIFO_TX_ACK_REQUIRED);
469 pid = rt2x00_get_field32(reg, TX_STA_FIFO_PID_TYPE); 478 pid = rt2x00_get_field32(reg, TX_STA_FIFO_PID_TYPE);
@@ -529,13 +538,12 @@ static void rt2800usb_txdone(struct rt2x00_dev *rt2x00dev)
529 entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE); 538 entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE);
530 if (rt2800usb_txdone_entry_check(entry, reg)) 539 if (rt2800usb_txdone_entry_check(entry, reg))
531 break; 540 break;
541 entry = NULL;
532 } 542 }
533 543
534 if (!entry || rt2x00queue_empty(queue)) 544 if (entry)
535 break; 545 rt2800_txdone_entry(entry, reg,
536 546 rt2800usb_get_txwi(entry));
537 rt2800_txdone_entry(entry, reg,
538 rt2800usb_get_txwi(entry));
539 } 547 }
540} 548}
541 549
@@ -559,8 +567,10 @@ static void rt2800usb_work_txdone(struct work_struct *work)
559 while (!rt2x00queue_empty(queue)) { 567 while (!rt2x00queue_empty(queue)) {
560 entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE); 568 entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE);
561 569
562 if (test_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags)) 570 if (test_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags) ||
571 !test_bit(ENTRY_DATA_STATUS_PENDING, &entry->flags))
563 break; 572 break;
573
564 if (test_bit(ENTRY_DATA_IO_FAILED, &entry->flags)) 574 if (test_bit(ENTRY_DATA_IO_FAILED, &entry->flags))
565 rt2x00lib_txdone_noinfo(entry, TXDONE_FAILURE); 575 rt2x00lib_txdone_noinfo(entry, TXDONE_FAILURE);
566 else if (rt2x00queue_status_timeout(entry)) 576 else if (rt2x00queue_status_timeout(entry))
@@ -926,6 +936,8 @@ static struct usb_device_id rt2800usb_device_table[] = {
926 { USB_DEVICE(0x07d1, 0x3c16) }, 936 { USB_DEVICE(0x07d1, 0x3c16) },
927 /* Draytek */ 937 /* Draytek */
928 { USB_DEVICE(0x07fa, 0x7712) }, 938 { USB_DEVICE(0x07fa, 0x7712) },
939 /* DVICO */
940 { USB_DEVICE(0x0fe9, 0xb307) },
929 /* Edimax */ 941 /* Edimax */
930 { USB_DEVICE(0x7392, 0x7711) }, 942 { USB_DEVICE(0x7392, 0x7711) },
931 { USB_DEVICE(0x7392, 0x7717) }, 943 { USB_DEVICE(0x7392, 0x7717) },
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index b6b4542c2460..1e31050dafc9 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -262,23 +262,20 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb)
262 struct queue_entry *entry = (struct queue_entry *)urb->context; 262 struct queue_entry *entry = (struct queue_entry *)urb->context;
263 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; 263 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
264 264
265 if (!test_and_clear_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags)) 265 if (!test_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags))
266 return; 266 return;
267
268 if (rt2x00dev->ops->lib->tx_dma_done)
269 rt2x00dev->ops->lib->tx_dma_done(entry);
270
271 /*
272 * Report the frame as DMA done
273 */
274 rt2x00lib_dmadone(entry);
275
276 /* 267 /*
277 * Check if the frame was correctly uploaded 268 * Check if the frame was correctly uploaded
278 */ 269 */
279 if (urb->status) 270 if (urb->status)
280 set_bit(ENTRY_DATA_IO_FAILED, &entry->flags); 271 set_bit(ENTRY_DATA_IO_FAILED, &entry->flags);
272 /*
273 * Report the frame as DMA done
274 */
275 rt2x00lib_dmadone(entry);
281 276
277 if (rt2x00dev->ops->lib->tx_dma_done)
278 rt2x00dev->ops->lib->tx_dma_done(entry);
282 /* 279 /*
283 * Schedule the delayed work for reading the TX status 280 * Schedule the delayed work for reading the TX status
284 * from the device. 281 * from the device.
@@ -874,18 +871,8 @@ int rt2x00usb_suspend(struct usb_interface *usb_intf, pm_message_t state)
874{ 871{
875 struct ieee80211_hw *hw = usb_get_intfdata(usb_intf); 872 struct ieee80211_hw *hw = usb_get_intfdata(usb_intf);
876 struct rt2x00_dev *rt2x00dev = hw->priv; 873 struct rt2x00_dev *rt2x00dev = hw->priv;
877 int retval;
878
879 retval = rt2x00lib_suspend(rt2x00dev, state);
880 if (retval)
881 return retval;
882 874
883 /* 875 return rt2x00lib_suspend(rt2x00dev, state);
884 * Decrease usbdev refcount.
885 */
886 usb_put_dev(interface_to_usbdev(usb_intf));
887
888 return 0;
889} 876}
890EXPORT_SYMBOL_GPL(rt2x00usb_suspend); 877EXPORT_SYMBOL_GPL(rt2x00usb_suspend);
891 878
@@ -894,8 +881,6 @@ int rt2x00usb_resume(struct usb_interface *usb_intf)
894 struct ieee80211_hw *hw = usb_get_intfdata(usb_intf); 881 struct ieee80211_hw *hw = usb_get_intfdata(usb_intf);
895 struct rt2x00_dev *rt2x00dev = hw->priv; 882 struct rt2x00_dev *rt2x00dev = hw->priv;
896 883
897 usb_get_dev(interface_to_usbdev(usb_intf));
898
899 return rt2x00lib_resume(rt2x00dev); 884 return rt2x00lib_resume(rt2x00dev);
900} 885}
901EXPORT_SYMBOL_GPL(rt2x00usb_resume); 886EXPORT_SYMBOL_GPL(rt2x00usb_resume);
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 6a93939f44e8..0baeb894f093 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2420,6 +2420,7 @@ static struct usb_device_id rt73usb_device_table[] = {
2420 /* Buffalo */ 2420 /* Buffalo */
2421 { USB_DEVICE(0x0411, 0x00d8) }, 2421 { USB_DEVICE(0x0411, 0x00d8) },
2422 { USB_DEVICE(0x0411, 0x00d9) }, 2422 { USB_DEVICE(0x0411, 0x00d9) },
2423 { USB_DEVICE(0x0411, 0x00e6) },
2423 { USB_DEVICE(0x0411, 0x00f4) }, 2424 { USB_DEVICE(0x0411, 0x00f4) },
2424 { USB_DEVICE(0x0411, 0x0116) }, 2425 { USB_DEVICE(0x0411, 0x0116) },
2425 { USB_DEVICE(0x0411, 0x0119) }, 2426 { USB_DEVICE(0x0411, 0x0119) },
diff --git a/drivers/net/wireless/rtlwifi/core.c b/drivers/net/wireless/rtlwifi/core.c
index 1bdc1aa305c0..04c4e9eb6ee6 100644
--- a/drivers/net/wireless/rtlwifi/core.c
+++ b/drivers/net/wireless/rtlwifi/core.c
@@ -610,6 +610,11 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
610 610
611 mac->link_state = MAC80211_NOLINK; 611 mac->link_state = MAC80211_NOLINK;
612 memset(mac->bssid, 0, 6); 612 memset(mac->bssid, 0, 6);
613
614 /* reset sec info */
615 rtl_cam_reset_sec_info(hw);
616
617 rtl_cam_reset_all_entry(hw);
613 mac->vendor = PEER_UNKNOWN; 618 mac->vendor = PEER_UNKNOWN;
614 619
615 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_DMESG, 620 RT_TRACE(rtlpriv, COMP_MAC80211, DBG_DMESG,
@@ -1063,6 +1068,9 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
1063 *or clear all entry here. 1068 *or clear all entry here.
1064 */ 1069 */
1065 rtl_cam_delete_one_entry(hw, mac_addr, key_idx); 1070 rtl_cam_delete_one_entry(hw, mac_addr, key_idx);
1071
1072 rtl_cam_reset_sec_info(hw);
1073
1066 break; 1074 break;
1067 default: 1075 default:
1068 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1076 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
index 195666a0c854..424b8a0323e2 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
@@ -281,6 +281,8 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
281 {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817d, rtl92cu_hal_cfg)}, 281 {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817d, rtl92cu_hal_cfg)},
282 /* 8188CE-VAU USB minCard (b/g mode only) */ 282 /* 8188CE-VAU USB minCard (b/g mode only) */
283 {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817e, rtl92cu_hal_cfg)}, 283 {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817e, rtl92cu_hal_cfg)},
284 /* 8188RU in Alfa AWUS036NHR */
285 {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x817f, rtl92cu_hal_cfg)},
284 /* 8188 Combo for BC4 */ 286 /* 8188 Combo for BC4 */
285 {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8754, rtl92cu_hal_cfg)}, 287 {RTL_USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8754, rtl92cu_hal_cfg)},
286 288
@@ -303,20 +305,23 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
303 {RTL_USB_DEVICE(0x0eb0, 0x9071, rtl92cu_hal_cfg)}, /*NO Brand - Etop*/ 305 {RTL_USB_DEVICE(0x0eb0, 0x9071, rtl92cu_hal_cfg)}, /*NO Brand - Etop*/
304 /* HP - Lite-On ,8188CUS Slim Combo */ 306 /* HP - Lite-On ,8188CUS Slim Combo */
305 {RTL_USB_DEVICE(0x103c, 0x1629, rtl92cu_hal_cfg)}, 307 {RTL_USB_DEVICE(0x103c, 0x1629, rtl92cu_hal_cfg)},
308 {RTL_USB_DEVICE(0x13d3, 0x3357, rtl92cu_hal_cfg)}, /* AzureWave */
306 {RTL_USB_DEVICE(0x2001, 0x3308, rtl92cu_hal_cfg)}, /*D-Link - Alpha*/ 309 {RTL_USB_DEVICE(0x2001, 0x3308, rtl92cu_hal_cfg)}, /*D-Link - Alpha*/
307 {RTL_USB_DEVICE(0x2019, 0xab2a, rtl92cu_hal_cfg)}, /*Planex - Abocom*/ 310 {RTL_USB_DEVICE(0x2019, 0xab2a, rtl92cu_hal_cfg)}, /*Planex - Abocom*/
308 {RTL_USB_DEVICE(0x2019, 0xed17, rtl92cu_hal_cfg)}, /*PCI - Edimax*/ 311 {RTL_USB_DEVICE(0x2019, 0xed17, rtl92cu_hal_cfg)}, /*PCI - Edimax*/
309 {RTL_USB_DEVICE(0x20f4, 0x648b, rtl92cu_hal_cfg)}, /*TRENDnet - Cameo*/ 312 {RTL_USB_DEVICE(0x20f4, 0x648b, rtl92cu_hal_cfg)}, /*TRENDnet - Cameo*/
310 {RTL_USB_DEVICE(0x7392, 0x7811, rtl92cu_hal_cfg)}, /*Edimax - Edimax*/ 313 {RTL_USB_DEVICE(0x7392, 0x7811, rtl92cu_hal_cfg)}, /*Edimax - Edimax*/
311 {RTL_USB_DEVICE(0x3358, 0x13d3, rtl92cu_hal_cfg)}, /*Azwave 8188CE-VAU*/ 314 {RTL_USB_DEVICE(0x13d3, 0x3358, rtl92cu_hal_cfg)}, /*Azwave 8188CE-VAU*/
312 /* Russian customer -Azwave (8188CE-VAU b/g mode only) */ 315 /* Russian customer -Azwave (8188CE-VAU b/g mode only) */
313 {RTL_USB_DEVICE(0x3359, 0x13d3, rtl92cu_hal_cfg)}, 316 {RTL_USB_DEVICE(0x13d3, 0x3359, rtl92cu_hal_cfg)},
317 {RTL_USB_DEVICE(0x4855, 0x0090, rtl92cu_hal_cfg)}, /* Feixun */
318 {RTL_USB_DEVICE(0x4855, 0x0091, rtl92cu_hal_cfg)}, /* NetweeN-Feixun */
319 {RTL_USB_DEVICE(0x9846, 0x9041, rtl92cu_hal_cfg)}, /* Netgear Cameo */
314 320
315 /****** 8192CU ********/ 321 /****** 8192CU ********/
316 {RTL_USB_DEVICE(0x0586, 0x341f, rtl92cu_hal_cfg)}, /*Zyxel -Abocom*/ 322 {RTL_USB_DEVICE(0x0586, 0x341f, rtl92cu_hal_cfg)}, /*Zyxel -Abocom*/
317 {RTL_USB_DEVICE(0x07aa, 0x0056, rtl92cu_hal_cfg)}, /*ATKK-Gemtek*/ 323 {RTL_USB_DEVICE(0x07aa, 0x0056, rtl92cu_hal_cfg)}, /*ATKK-Gemtek*/
318 {RTL_USB_DEVICE(0x07b8, 0x8178, rtl92cu_hal_cfg)}, /*Funai -Abocom*/ 324 {RTL_USB_DEVICE(0x07b8, 0x8178, rtl92cu_hal_cfg)}, /*Funai -Abocom*/
319 {RTL_USB_DEVICE(0x07b8, 0x8178, rtl92cu_hal_cfg)}, /*Abocom -Abocom*/
320 {RTL_USB_DEVICE(0x2001, 0x3307, rtl92cu_hal_cfg)}, /*D-Link-Cameo*/ 325 {RTL_USB_DEVICE(0x2001, 0x3307, rtl92cu_hal_cfg)}, /*D-Link-Cameo*/
321 {RTL_USB_DEVICE(0x2001, 0x3309, rtl92cu_hal_cfg)}, /*D-Link-Alpha*/ 326 {RTL_USB_DEVICE(0x2001, 0x3309, rtl92cu_hal_cfg)}, /*D-Link-Alpha*/
322 {RTL_USB_DEVICE(0x2001, 0x330a, rtl92cu_hal_cfg)}, /*D-Link-Alpha*/ 327 {RTL_USB_DEVICE(0x2001, 0x330a, rtl92cu_hal_cfg)}, /*D-Link-Alpha*/
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
index c4161148e0d8..bc33b147f44f 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
@@ -548,15 +548,16 @@ void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw,
548 (tcb_desc->rts_use_shortpreamble ? 1 : 0) 548 (tcb_desc->rts_use_shortpreamble ? 1 : 0)
549 : (tcb_desc->rts_use_shortgi ? 1 : 0))); 549 : (tcb_desc->rts_use_shortgi ? 1 : 0)));
550 if (mac->bw_40) { 550 if (mac->bw_40) {
551 if (tcb_desc->packet_bw) { 551 if (rate_flag & IEEE80211_TX_RC_DUP_DATA) {
552 SET_TX_DESC_DATA_BW(txdesc, 1); 552 SET_TX_DESC_DATA_BW(txdesc, 1);
553 SET_TX_DESC_DATA_SC(txdesc, 3); 553 SET_TX_DESC_DATA_SC(txdesc, 3);
554 } else if(rate_flag & IEEE80211_TX_RC_40_MHZ_WIDTH){
555 SET_TX_DESC_DATA_BW(txdesc, 1);
556 SET_TX_DESC_DATA_SC(txdesc, mac->cur_40_prime_sc);
554 } else { 557 } else {
555 SET_TX_DESC_DATA_BW(txdesc, 0); 558 SET_TX_DESC_DATA_BW(txdesc, 0);
556 if (rate_flag & IEEE80211_TX_RC_DUP_DATA) 559 SET_TX_DESC_DATA_SC(txdesc, 0);
557 SET_TX_DESC_DATA_SC(txdesc, 560 }
558 mac->cur_40_prime_sc);
559 }
560 } else { 561 } else {
561 SET_TX_DESC_DATA_BW(txdesc, 0); 562 SET_TX_DESC_DATA_BW(txdesc, 0);
562 SET_TX_DESC_DATA_SC(txdesc, 0); 563 SET_TX_DESC_DATA_SC(txdesc, 0);
diff --git a/drivers/net/wireless/wl1251/acx.c b/drivers/net/wireless/wl1251/acx.c
index ef8370edace7..ad87a1ac6462 100644
--- a/drivers/net/wireless/wl1251/acx.c
+++ b/drivers/net/wireless/wl1251/acx.c
@@ -140,8 +140,6 @@ int wl1251_acx_sleep_auth(struct wl1251 *wl, u8 sleep_auth)
140 auth->sleep_auth = sleep_auth; 140 auth->sleep_auth = sleep_auth;
141 141
142 ret = wl1251_cmd_configure(wl, ACX_SLEEP_AUTH, auth, sizeof(*auth)); 142 ret = wl1251_cmd_configure(wl, ACX_SLEEP_AUTH, auth, sizeof(*auth));
143 if (ret < 0)
144 return ret;
145 143
146out: 144out:
147 kfree(auth); 145 kfree(auth);
@@ -681,10 +679,8 @@ int wl1251_acx_cca_threshold(struct wl1251 *wl)
681 679
682 ret = wl1251_cmd_configure(wl, ACX_CCA_THRESHOLD, 680 ret = wl1251_cmd_configure(wl, ACX_CCA_THRESHOLD,
683 detection, sizeof(*detection)); 681 detection, sizeof(*detection));
684 if (ret < 0) { 682 if (ret < 0)
685 wl1251_warning("failed to set cca threshold: %d", ret); 683 wl1251_warning("failed to set cca threshold: %d", ret);
686 return ret;
687 }
688 684
689out: 685out:
690 kfree(detection); 686 kfree(detection);
diff --git a/drivers/net/wireless/wl1251/cmd.c b/drivers/net/wireless/wl1251/cmd.c
index 81f164bc4888..d14d69d733a0 100644
--- a/drivers/net/wireless/wl1251/cmd.c
+++ b/drivers/net/wireless/wl1251/cmd.c
@@ -241,7 +241,7 @@ int wl1251_cmd_data_path(struct wl1251 *wl, u8 channel, bool enable)
241 if (ret < 0) { 241 if (ret < 0) {
242 wl1251_error("tx %s cmd for channel %d failed", 242 wl1251_error("tx %s cmd for channel %d failed",
243 enable ? "start" : "stop", channel); 243 enable ? "start" : "stop", channel);
244 return ret; 244 goto out;
245 } 245 }
246 246
247 wl1251_debug(DEBUG_BOOT, "tx %s cmd channel %d", 247 wl1251_debug(DEBUG_BOOT, "tx %s cmd channel %d",
diff --git a/drivers/net/wireless/wl12xx/acx.c b/drivers/net/wireless/wl12xx/acx.c
index 9809e41f06e2..399849eeb247 100644
--- a/drivers/net/wireless/wl12xx/acx.c
+++ b/drivers/net/wireless/wl12xx/acx.c
@@ -78,8 +78,6 @@ int wl1271_acx_sleep_auth(struct wl1271 *wl, u8 sleep_auth)
78 auth->sleep_auth = sleep_auth; 78 auth->sleep_auth = sleep_auth;
79 79
80 ret = wl1271_cmd_configure(wl, ACX_SLEEP_AUTH, auth, sizeof(*auth)); 80 ret = wl1271_cmd_configure(wl, ACX_SLEEP_AUTH, auth, sizeof(*auth));
81 if (ret < 0)
82 return ret;
83 81
84out: 82out:
85 kfree(auth); 83 kfree(auth);
@@ -576,10 +574,8 @@ int wl1271_acx_cca_threshold(struct wl1271 *wl)
576 574
577 ret = wl1271_cmd_configure(wl, ACX_CCA_THRESHOLD, 575 ret = wl1271_cmd_configure(wl, ACX_CCA_THRESHOLD,
578 detection, sizeof(*detection)); 576 detection, sizeof(*detection));
579 if (ret < 0) { 577 if (ret < 0)
580 wl1271_warning("failed to set cca threshold: %d", ret); 578 wl1271_warning("failed to set cca threshold: %d", ret);
581 return ret;
582 }
583 579
584out: 580out:
585 kfree(detection); 581 kfree(detection);
diff --git a/drivers/net/wireless/wl12xx/sdio.c b/drivers/net/wireless/wl12xx/sdio.c
index ac2e5661397c..516a8980723c 100644
--- a/drivers/net/wireless/wl12xx/sdio.c
+++ b/drivers/net/wireless/wl12xx/sdio.c
@@ -164,7 +164,7 @@ static int wl1271_sdio_power_on(struct wl1271 *wl)
164 /* If enabled, tell runtime PM not to power off the card */ 164 /* If enabled, tell runtime PM not to power off the card */
165 if (pm_runtime_enabled(&func->dev)) { 165 if (pm_runtime_enabled(&func->dev)) {
166 ret = pm_runtime_get_sync(&func->dev); 166 ret = pm_runtime_get_sync(&func->dev);
167 if (ret) 167 if (ret < 0)
168 goto out; 168 goto out;
169 } else { 169 } else {
170 /* Runtime PM is disabled: power up the card manually */ 170 /* Runtime PM is disabled: power up the card manually */
diff --git a/drivers/net/wireless/wl12xx/testmode.c b/drivers/net/wireless/wl12xx/testmode.c
index 5d5e1ef87206..4ae8effaee22 100644
--- a/drivers/net/wireless/wl12xx/testmode.c
+++ b/drivers/net/wireless/wl12xx/testmode.c
@@ -36,7 +36,6 @@ enum wl1271_tm_commands {
36 WL1271_TM_CMD_TEST, 36 WL1271_TM_CMD_TEST,
37 WL1271_TM_CMD_INTERROGATE, 37 WL1271_TM_CMD_INTERROGATE,
38 WL1271_TM_CMD_CONFIGURE, 38 WL1271_TM_CMD_CONFIGURE,
39 WL1271_TM_CMD_NVS_PUSH,
40 WL1271_TM_CMD_SET_PLT_MODE, 39 WL1271_TM_CMD_SET_PLT_MODE,
41 WL1271_TM_CMD_RECOVER, 40 WL1271_TM_CMD_RECOVER,
42 41
@@ -139,12 +138,15 @@ static int wl1271_tm_cmd_interrogate(struct wl1271 *wl, struct nlattr *tb[])
139 138
140 if (ret < 0) { 139 if (ret < 0) {
141 wl1271_warning("testmode cmd interrogate failed: %d", ret); 140 wl1271_warning("testmode cmd interrogate failed: %d", ret);
141 kfree(cmd);
142 return ret; 142 return ret;
143 } 143 }
144 144
145 skb = cfg80211_testmode_alloc_reply_skb(wl->hw->wiphy, sizeof(*cmd)); 145 skb = cfg80211_testmode_alloc_reply_skb(wl->hw->wiphy, sizeof(*cmd));
146 if (!skb) 146 if (!skb) {
147 kfree(cmd);
147 return -ENOMEM; 148 return -ENOMEM;
149 }
148 150
149 NLA_PUT(skb, WL1271_TM_ATTR_DATA, sizeof(*cmd), cmd); 151 NLA_PUT(skb, WL1271_TM_ATTR_DATA, sizeof(*cmd), cmd);
150 152
@@ -187,48 +189,6 @@ static int wl1271_tm_cmd_configure(struct wl1271 *wl, struct nlattr *tb[])
187 return 0; 189 return 0;
188} 190}
189 191
190static int wl1271_tm_cmd_nvs_push(struct wl1271 *wl, struct nlattr *tb[])
191{
192 int ret = 0;
193 size_t len;
194 void *buf;
195
196 wl1271_debug(DEBUG_TESTMODE, "testmode cmd nvs push");
197
198 if (!tb[WL1271_TM_ATTR_DATA])
199 return -EINVAL;
200
201 buf = nla_data(tb[WL1271_TM_ATTR_DATA]);
202 len = nla_len(tb[WL1271_TM_ATTR_DATA]);
203
204 mutex_lock(&wl->mutex);
205
206 kfree(wl->nvs);
207
208 if ((wl->chip.id == CHIP_ID_1283_PG20) &&
209 (len != sizeof(struct wl128x_nvs_file)))
210 return -EINVAL;
211 else if (len != sizeof(struct wl1271_nvs_file))
212 return -EINVAL;
213
214 wl->nvs = kzalloc(len, GFP_KERNEL);
215 if (!wl->nvs) {
216 wl1271_error("could not allocate memory for the nvs file");
217 ret = -ENOMEM;
218 goto out;
219 }
220
221 memcpy(wl->nvs, buf, len);
222 wl->nvs_len = len;
223
224 wl1271_debug(DEBUG_TESTMODE, "testmode pushed nvs");
225
226out:
227 mutex_unlock(&wl->mutex);
228
229 return ret;
230}
231
232static int wl1271_tm_cmd_set_plt_mode(struct wl1271 *wl, struct nlattr *tb[]) 192static int wl1271_tm_cmd_set_plt_mode(struct wl1271 *wl, struct nlattr *tb[])
233{ 193{
234 u32 val; 194 u32 val;
@@ -285,8 +245,6 @@ int wl1271_tm_cmd(struct ieee80211_hw *hw, void *data, int len)
285 return wl1271_tm_cmd_interrogate(wl, tb); 245 return wl1271_tm_cmd_interrogate(wl, tb);
286 case WL1271_TM_CMD_CONFIGURE: 246 case WL1271_TM_CMD_CONFIGURE:
287 return wl1271_tm_cmd_configure(wl, tb); 247 return wl1271_tm_cmd_configure(wl, tb);
288 case WL1271_TM_CMD_NVS_PUSH:
289 return wl1271_tm_cmd_nvs_push(wl, tb);
290 case WL1271_TM_CMD_SET_PLT_MODE: 248 case WL1271_TM_CMD_SET_PLT_MODE:
291 return wl1271_tm_cmd_set_plt_mode(wl, tb); 249 return wl1271_tm_cmd_set_plt_mode(wl, tb);
292 case WL1271_TM_CMD_RECOVER: 250 case WL1271_TM_CMD_RECOVER: