diff options
Diffstat (limited to 'drivers/net/wireless')
20 files changed, 145 insertions, 138 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_calib.c b/drivers/net/wireless/ath/ath9k/ar9002_calib.c index 2d4c0910295b..2d394af82171 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 a73e50d80cbb..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, | |||
50 | static const struct ar9300_eeprom ar9300_default = { | 50 | static 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 = { |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c index 95147948794d..4956d09cb589 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c | |||
@@ -678,7 +678,7 @@ static int ar9003_hw_process_ini(struct ath_hw *ah, | |||
678 | REG_WRITE_ARRAY(&ah->iniModesAdditional, | 678 | REG_WRITE_ARRAY(&ah->iniModesAdditional, |
679 | modesIndex, regWrites); | 679 | modesIndex, regWrites); |
680 | 680 | ||
681 | if (AR_SREV_9300(ah)) | 681 | if (AR_SREV_9330(ah)) |
682 | REG_WRITE_ARRAY(&ah->iniModesAdditional, 1, regWrites); | 682 | REG_WRITE_ARRAY(&ah->iniModesAdditional, 1, regWrites); |
683 | 683 | ||
684 | if (AR_SREV_9340(ah) && !ah->is_clk_25mhz) | 684 | if (AR_SREV_9340(ah) && !ah->is_clk_25mhz) |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 7910165cf0e6..a16f53994a7e 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -2272,7 +2272,11 @@ static void ath9k_set_coverage_class(struct ieee80211_hw *hw, u8 coverage_class) | |||
2272 | 2272 | ||
2273 | mutex_lock(&sc->mutex); | 2273 | mutex_lock(&sc->mutex); |
2274 | ah->coverage_class = coverage_class; | 2274 | ah->coverage_class = coverage_class; |
2275 | |||
2276 | ath9k_ps_wakeup(sc); | ||
2275 | ath9k_hw_init_global_settings(ah); | 2277 | ath9k_hw_init_global_settings(ah); |
2278 | ath9k_ps_restore(sc); | ||
2279 | |||
2276 | mutex_unlock(&sc->mutex); | 2280 | mutex_unlock(&sc->mutex); |
2277 | } | 2281 | } |
2278 | 2282 | ||
@@ -2288,6 +2292,12 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop) | |||
2288 | mutex_lock(&sc->mutex); | 2292 | mutex_lock(&sc->mutex); |
2289 | cancel_delayed_work_sync(&sc->tx_complete_work); | 2293 | cancel_delayed_work_sync(&sc->tx_complete_work); |
2290 | 2294 | ||
2295 | if (ah->ah_flags & AH_UNPLUGGED) { | ||
2296 | ath_dbg(common, ATH_DBG_ANY, "Device has been unplugged!\n"); | ||
2297 | mutex_unlock(&sc->mutex); | ||
2298 | return; | ||
2299 | } | ||
2300 | |||
2291 | if (sc->sc_flags & SC_OP_INVALID) { | 2301 | if (sc->sc_flags & SC_OP_INVALID) { |
2292 | ath_dbg(common, ATH_DBG_ANY, "Device not present\n"); | 2302 | ath_dbg(common, ATH_DBG_ANY, "Device not present\n"); |
2293 | mutex_unlock(&sc->mutex); | 2303 | 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/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) | |||
1903 | static int ipw2100_net_init(struct net_device *dev) | 1903 | static 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 | |||
1910 | static 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 f303df43ed3f..99a710dfe771 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() */ |
11427 | static int ipw_net_init(struct net_device *dev) | 11427 | static 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 | |||
11440 | static 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 | |||
11528 | out: | 11532 | out: |
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 ea31d7674df3..a7b891453869 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c | |||
@@ -168,7 +168,7 @@ static int iwlagn_set_temperature_offset_calib(struct iwl_priv *priv) | |||
168 | 168 | ||
169 | memset(&cmd, 0, sizeof(cmd)); | 169 | memset(&cmd, 0, sizeof(cmd)); |
170 | iwl_set_calib_hdr(&cmd.hdr, IWL_PHY_CALIBRATE_TEMP_OFFSET_CMD); | 170 | iwl_set_calib_hdr(&cmd.hdr, IWL_PHY_CALIBRATE_TEMP_OFFSET_CMD); |
171 | memcpy(&cmd.radio_sensor_offset, offset_calib, sizeof(offset_calib)); | 171 | memcpy(&cmd.radio_sensor_offset, offset_calib, sizeof(*offset_calib)); |
172 | if (!(cmd.radio_sensor_offset)) | 172 | if (!(cmd.radio_sensor_offset)) |
173 | cmd.radio_sensor_offset = DEFAULT_RADIO_SENSOR_OFFSET; | 173 | cmd.radio_sensor_offset = DEFAULT_RADIO_SENSOR_OFFSET; |
174 | 174 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 7f6c58ebbc44..6057e18f688c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -1780,7 +1780,12 @@ static int iwl_mac_setup_register(struct iwl_priv *priv, | |||
1780 | IEEE80211_HW_SPECTRUM_MGMT | | 1780 | IEEE80211_HW_SPECTRUM_MGMT | |
1781 | IEEE80211_HW_REPORTS_TX_ACK_STATUS; | 1781 | IEEE80211_HW_REPORTS_TX_ACK_STATUS; |
1782 | 1782 | ||
1783 | /* | ||
1784 | * Including the following line will crash some AP's. This | ||
1785 | * workaround removes the stimulus which causes the crash until | ||
1786 | * the AP software can be fixed. | ||
1783 | hw->max_tx_aggregation_subframes = LINK_QUAL_AGG_FRAME_LIMIT_DEF; | 1787 | hw->max_tx_aggregation_subframes = LINK_QUAL_AGG_FRAME_LIMIT_DEF; |
1788 | */ | ||
1784 | 1789 | ||
1785 | hw->flags |= IEEE80211_HW_SUPPORTS_PS | | 1790 | hw->flags |= IEEE80211_HW_SUPPORTS_PS | |
1786 | IEEE80211_HW_SUPPORTS_DYNAMIC_PS; | 1791 | IEEE80211_HW_SUPPORTS_DYNAMIC_PS; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c index ca686dbf5893..f6d823f012db 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c | |||
@@ -925,6 +925,8 @@ void iwl_tx_cmd_complete(struct iwl_trans *trans, struct iwl_rx_mem_buffer *rxb) | |||
925 | cmd = txq->cmd[cmd_index]; | 925 | cmd = txq->cmd[cmd_index]; |
926 | meta = &txq->meta[cmd_index]; | 926 | meta = &txq->meta[cmd_index]; |
927 | 927 | ||
928 | txq->time_stamp = jiffies; | ||
929 | |||
928 | iwlagn_unmap_tfd(trans, meta, &txq->tfds[index], | 930 | iwlagn_unmap_tfd(trans, meta, &txq->tfds[index], |
929 | DMA_BIDIRECTIONAL); | 931 | DMA_BIDIRECTIONAL); |
930 | 932 | ||
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, ®); | 3769 | rt2800_regbusy_read(rt2x00dev, EFUSE_CTRL, EFUSE_CTRL_KICK, ®); |
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, ®); |
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, ®); |
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, ®); |
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, ®); |
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 677b5ababbdd..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)) |
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 | } |
890 | EXPORT_SYMBOL_GPL(rt2x00usb_suspend); | 877 | EXPORT_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 | } |
901 | EXPORT_SYMBOL_GPL(rt2x00usb_resume); | 886 | EXPORT_SYMBOL_GPL(rt2x00usb_resume); |
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/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/wl12xx/acx.c b/drivers/net/wireless/wl12xx/acx.c index e047594794aa..f2838ae07da5 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 | ||
84 | out: | 82 | out: |
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 | ||
584 | out: | 580 | out: |
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 | ||
190 | static 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 | |||
226 | out: | ||
227 | mutex_unlock(&wl->mutex); | ||
228 | |||
229 | return ret; | ||
230 | } | ||
231 | |||
232 | static int wl1271_tm_cmd_set_plt_mode(struct wl1271 *wl, struct nlattr *tb[]) | 192 | static 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: |