diff options
author | David S. Miller <davem@davemloft.net> | 2013-10-17 16:05:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-10-17 16:05:50 -0400 |
commit | df709a18cae475de38ddaff63584692d50267b92 (patch) | |
tree | 94db1a56c2427baaf1d2d92364718f69f77d95c7 | |
parent | ce97fef4235378108ed3bd96e1b3eab8fd0a1fbd (diff) | |
parent | 39c253ed7817bf477189a132b114303c9aa2c2d2 (diff) |
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
John W. Linville says:
====================
Please pull this batch of fixes intended for the 3.12 stream!
For the mac80211 bits, Johannes says:
"Jouni fixes a remain-on-channel vs. scan bug, and Felix fixes client TX
probing on VLANs."
And also:
"This time I have two fixes from Emmanuel for RF-kill issues, and fixed
two issues reported by Evan Huus and Thomas Lindroth respectively."
On top of those...
Avinash Patil adds a couple of mwifiex fixes to properly inform cfg80211
about some different types of disconnects, avoiding WARNINGs.
Mark Cave-Ayland corrects a pointer arithmetic problem in rtlwifi,
avoiding incorrect automatic gain calculations.
Solomon Peachy sends a cw1200 fix for locking around calls to
cw1200_irq_handler, addressing "lost interrupt" problems.
Please let me know if there are problems!
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/wireless/cw1200/cw1200_spi.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/join.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_event.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192cu/trx.c | 3 | ||||
-rw-r--r-- | net/mac80211/cfg.c | 2 | ||||
-rw-r--r-- | net/mac80211/ieee80211_i.h | 3 | ||||
-rw-r--r-- | net/mac80211/offchannel.c | 2 | ||||
-rw-r--r-- | net/mac80211/scan.c | 19 | ||||
-rw-r--r-- | net/mac80211/status.c | 3 | ||||
-rw-r--r-- | net/mac80211/tx.c | 3 | ||||
-rw-r--r-- | net/mac80211/util.c | 4 | ||||
-rw-r--r-- | net/wireless/core.c | 2 | ||||
-rw-r--r-- | net/wireless/core.h | 3 | ||||
-rw-r--r-- | net/wireless/radiotap.c | 7 |
14 files changed, 57 insertions, 9 deletions
diff --git a/drivers/net/wireless/cw1200/cw1200_spi.c b/drivers/net/wireless/cw1200/cw1200_spi.c index 899cad34ccd3..755a0c8edfe1 100644 --- a/drivers/net/wireless/cw1200/cw1200_spi.c +++ b/drivers/net/wireless/cw1200/cw1200_spi.c | |||
@@ -237,7 +237,9 @@ static irqreturn_t cw1200_spi_irq_handler(int irq, void *dev_id) | |||
237 | struct hwbus_priv *self = dev_id; | 237 | struct hwbus_priv *self = dev_id; |
238 | 238 | ||
239 | if (self->core) { | 239 | if (self->core) { |
240 | cw1200_spi_lock(self); | ||
240 | cw1200_irq_handler(self->core); | 241 | cw1200_irq_handler(self->core); |
242 | cw1200_spi_unlock(self); | ||
241 | return IRQ_HANDLED; | 243 | return IRQ_HANDLED; |
242 | } else { | 244 | } else { |
243 | return IRQ_NONE; | 245 | return IRQ_NONE; |
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c index 9d7c0e6c4fc7..37f873bb342f 100644 --- a/drivers/net/wireless/mwifiex/join.c +++ b/drivers/net/wireless/mwifiex/join.c | |||
@@ -1422,13 +1422,19 @@ static int mwifiex_deauthenticate_infra(struct mwifiex_private *priv, u8 *mac) | |||
1422 | */ | 1422 | */ |
1423 | int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac) | 1423 | int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac) |
1424 | { | 1424 | { |
1425 | int ret = 0; | ||
1426 | |||
1425 | if (!priv->media_connected) | 1427 | if (!priv->media_connected) |
1426 | return 0; | 1428 | return 0; |
1427 | 1429 | ||
1428 | switch (priv->bss_mode) { | 1430 | switch (priv->bss_mode) { |
1429 | case NL80211_IFTYPE_STATION: | 1431 | case NL80211_IFTYPE_STATION: |
1430 | case NL80211_IFTYPE_P2P_CLIENT: | 1432 | case NL80211_IFTYPE_P2P_CLIENT: |
1431 | return mwifiex_deauthenticate_infra(priv, mac); | 1433 | ret = mwifiex_deauthenticate_infra(priv, mac); |
1434 | if (ret) | ||
1435 | cfg80211_disconnected(priv->netdev, 0, NULL, 0, | ||
1436 | GFP_KERNEL); | ||
1437 | break; | ||
1432 | case NL80211_IFTYPE_ADHOC: | 1438 | case NL80211_IFTYPE_ADHOC: |
1433 | return mwifiex_send_cmd_sync(priv, | 1439 | return mwifiex_send_cmd_sync(priv, |
1434 | HostCmd_CMD_802_11_AD_HOC_STOP, | 1440 | HostCmd_CMD_802_11_AD_HOC_STOP, |
@@ -1440,7 +1446,7 @@ int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac) | |||
1440 | break; | 1446 | break; |
1441 | } | 1447 | } |
1442 | 1448 | ||
1443 | return 0; | 1449 | return ret; |
1444 | } | 1450 | } |
1445 | EXPORT_SYMBOL_GPL(mwifiex_deauthenticate); | 1451 | EXPORT_SYMBOL_GPL(mwifiex_deauthenticate); |
1446 | 1452 | ||
diff --git a/drivers/net/wireless/mwifiex/sta_event.c b/drivers/net/wireless/mwifiex/sta_event.c index 8b057524b252..8c351f71f72f 100644 --- a/drivers/net/wireless/mwifiex/sta_event.c +++ b/drivers/net/wireless/mwifiex/sta_event.c | |||
@@ -118,7 +118,8 @@ mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason_code) | |||
118 | dev_dbg(adapter->dev, | 118 | dev_dbg(adapter->dev, |
119 | "info: successfully disconnected from %pM: reason code %d\n", | 119 | "info: successfully disconnected from %pM: reason code %d\n", |
120 | priv->cfg_bssid, reason_code); | 120 | priv->cfg_bssid, reason_code); |
121 | if (priv->bss_mode == NL80211_IFTYPE_STATION) { | 121 | if (priv->bss_mode == NL80211_IFTYPE_STATION || |
122 | priv->bss_mode == NL80211_IFTYPE_P2P_CLIENT) { | ||
122 | cfg80211_disconnected(priv->netdev, reason_code, NULL, 0, | 123 | cfg80211_disconnected(priv->netdev, reason_code, NULL, 0, |
123 | GFP_KERNEL); | 124 | GFP_KERNEL); |
124 | } | 125 | } |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c index 763cf1defab5..5a060e537fbe 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c | |||
@@ -343,7 +343,8 @@ bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw, | |||
343 | (bool)GET_RX_DESC_PAGGR(pdesc)); | 343 | (bool)GET_RX_DESC_PAGGR(pdesc)); |
344 | rx_status->mactime = GET_RX_DESC_TSFL(pdesc); | 344 | rx_status->mactime = GET_RX_DESC_TSFL(pdesc); |
345 | if (phystatus) { | 345 | if (phystatus) { |
346 | p_drvinfo = (struct rx_fwinfo_92c *)(pdesc + RTL_RX_DESC_SIZE); | 346 | p_drvinfo = (struct rx_fwinfo_92c *)(skb->data + |
347 | stats->rx_bufshift); | ||
347 | rtl92c_translate_rx_signal_stuff(hw, skb, stats, pdesc, | 348 | rtl92c_translate_rx_signal_stuff(hw, skb, stats, pdesc, |
348 | p_drvinfo); | 349 | p_drvinfo); |
349 | } | 350 | } |
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 2e7855a1b10d..629dee7ec9bf 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -3518,7 +3518,7 @@ static int ieee80211_probe_client(struct wiphy *wiphy, struct net_device *dev, | |||
3518 | return -EINVAL; | 3518 | return -EINVAL; |
3519 | } | 3519 | } |
3520 | band = chanctx_conf->def.chan->band; | 3520 | band = chanctx_conf->def.chan->band; |
3521 | sta = sta_info_get(sdata, peer); | 3521 | sta = sta_info_get_bss(sdata, peer); |
3522 | if (sta) { | 3522 | if (sta) { |
3523 | qos = test_sta_flag(sta, WLAN_STA_WME); | 3523 | qos = test_sta_flag(sta, WLAN_STA_WME); |
3524 | } else { | 3524 | } else { |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index b6186517ec56..611abfcfb5eb 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -893,6 +893,8 @@ struct tpt_led_trigger { | |||
893 | * that the scan completed. | 893 | * that the scan completed. |
894 | * @SCAN_ABORTED: Set for our scan work function when the driver reported | 894 | * @SCAN_ABORTED: Set for our scan work function when the driver reported |
895 | * a scan complete for an aborted scan. | 895 | * a scan complete for an aborted scan. |
896 | * @SCAN_HW_CANCELLED: Set for our scan work function when the scan is being | ||
897 | * cancelled. | ||
896 | */ | 898 | */ |
897 | enum { | 899 | enum { |
898 | SCAN_SW_SCANNING, | 900 | SCAN_SW_SCANNING, |
@@ -900,6 +902,7 @@ enum { | |||
900 | SCAN_ONCHANNEL_SCANNING, | 902 | SCAN_ONCHANNEL_SCANNING, |
901 | SCAN_COMPLETED, | 903 | SCAN_COMPLETED, |
902 | SCAN_ABORTED, | 904 | SCAN_ABORTED, |
905 | SCAN_HW_CANCELLED, | ||
903 | }; | 906 | }; |
904 | 907 | ||
905 | /** | 908 | /** |
diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c index acd1f71adc03..0c2a29484c07 100644 --- a/net/mac80211/offchannel.c +++ b/net/mac80211/offchannel.c | |||
@@ -394,6 +394,8 @@ void ieee80211_sw_roc_work(struct work_struct *work) | |||
394 | 394 | ||
395 | if (started) | 395 | if (started) |
396 | ieee80211_start_next_roc(local); | 396 | ieee80211_start_next_roc(local); |
397 | else if (list_empty(&local->roc_list)) | ||
398 | ieee80211_run_deferred_scan(local); | ||
397 | } | 399 | } |
398 | 400 | ||
399 | out_unlock: | 401 | out_unlock: |
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 08afe74b98f4..d2d17a449224 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -238,6 +238,9 @@ static bool ieee80211_prep_hw_scan(struct ieee80211_local *local) | |||
238 | enum ieee80211_band band; | 238 | enum ieee80211_band band; |
239 | int i, ielen, n_chans; | 239 | int i, ielen, n_chans; |
240 | 240 | ||
241 | if (test_bit(SCAN_HW_CANCELLED, &local->scanning)) | ||
242 | return false; | ||
243 | |||
241 | do { | 244 | do { |
242 | if (local->hw_scan_band == IEEE80211_NUM_BANDS) | 245 | if (local->hw_scan_band == IEEE80211_NUM_BANDS) |
243 | return false; | 246 | return false; |
@@ -940,7 +943,23 @@ void ieee80211_scan_cancel(struct ieee80211_local *local) | |||
940 | if (!local->scan_req) | 943 | if (!local->scan_req) |
941 | goto out; | 944 | goto out; |
942 | 945 | ||
946 | /* | ||
947 | * We have a scan running and the driver already reported completion, | ||
948 | * but the worker hasn't run yet or is stuck on the mutex - mark it as | ||
949 | * cancelled. | ||
950 | */ | ||
951 | if (test_bit(SCAN_HW_SCANNING, &local->scanning) && | ||
952 | test_bit(SCAN_COMPLETED, &local->scanning)) { | ||
953 | set_bit(SCAN_HW_CANCELLED, &local->scanning); | ||
954 | goto out; | ||
955 | } | ||
956 | |||
943 | if (test_bit(SCAN_HW_SCANNING, &local->scanning)) { | 957 | if (test_bit(SCAN_HW_SCANNING, &local->scanning)) { |
958 | /* | ||
959 | * Make sure that __ieee80211_scan_completed doesn't trigger a | ||
960 | * scan on another band. | ||
961 | */ | ||
962 | set_bit(SCAN_HW_CANCELLED, &local->scanning); | ||
944 | if (local->ops->cancel_hw_scan) | 963 | if (local->ops->cancel_hw_scan) |
945 | drv_cancel_hw_scan(local, | 964 | drv_cancel_hw_scan(local, |
946 | rcu_dereference_protected(local->scan_sdata, | 965 | rcu_dereference_protected(local->scan_sdata, |
diff --git a/net/mac80211/status.c b/net/mac80211/status.c index 368837fe3b80..78dc2e99027e 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c | |||
@@ -180,6 +180,9 @@ static void ieee80211_frame_acked(struct sta_info *sta, struct sk_buff *skb) | |||
180 | struct ieee80211_local *local = sta->local; | 180 | struct ieee80211_local *local = sta->local; |
181 | struct ieee80211_sub_if_data *sdata = sta->sdata; | 181 | struct ieee80211_sub_if_data *sdata = sta->sdata; |
182 | 182 | ||
183 | if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) | ||
184 | sta->last_rx = jiffies; | ||
185 | |||
183 | if (ieee80211_is_data_qos(mgmt->frame_control)) { | 186 | if (ieee80211_is_data_qos(mgmt->frame_control)) { |
184 | struct ieee80211_hdr *hdr = (void *) skb->data; | 187 | struct ieee80211_hdr *hdr = (void *) skb->data; |
185 | u8 *qc = ieee80211_get_qos_ctl(hdr); | 188 | u8 *qc = ieee80211_get_qos_ctl(hdr); |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 3456c0486b48..70b5a05c0a4e 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -1120,7 +1120,8 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata, | |||
1120 | tx->sta = rcu_dereference(sdata->u.vlan.sta); | 1120 | tx->sta = rcu_dereference(sdata->u.vlan.sta); |
1121 | if (!tx->sta && sdata->dev->ieee80211_ptr->use_4addr) | 1121 | if (!tx->sta && sdata->dev->ieee80211_ptr->use_4addr) |
1122 | return TX_DROP; | 1122 | return TX_DROP; |
1123 | } else if (info->flags & IEEE80211_TX_CTL_INJECTED || | 1123 | } else if (info->flags & (IEEE80211_TX_CTL_INJECTED | |
1124 | IEEE80211_TX_INTFL_NL80211_FRAME_TX) || | ||
1124 | tx->sdata->control_port_protocol == tx->skb->protocol) { | 1125 | tx->sdata->control_port_protocol == tx->skb->protocol) { |
1125 | tx->sta = sta_info_get_bss(sdata, hdr->addr1); | 1126 | tx->sta = sta_info_get_bss(sdata, hdr->addr1); |
1126 | } | 1127 | } |
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 9c3200bcfc02..69e4ef5348a0 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -2238,6 +2238,10 @@ u64 ieee80211_calculate_rx_timestamp(struct ieee80211_local *local, | |||
2238 | } | 2238 | } |
2239 | 2239 | ||
2240 | rate = cfg80211_calculate_bitrate(&ri); | 2240 | rate = cfg80211_calculate_bitrate(&ri); |
2241 | if (WARN_ONCE(!rate, | ||
2242 | "Invalid bitrate: flags=0x%x, idx=%d, vht_nss=%d\n", | ||
2243 | status->flag, status->rate_idx, status->vht_nss)) | ||
2244 | return 0; | ||
2241 | 2245 | ||
2242 | /* rewind from end of MPDU */ | 2246 | /* rewind from end of MPDU */ |
2243 | if (status->flag & RX_FLAG_MACTIME_END) | 2247 | if (status->flag & RX_FLAG_MACTIME_END) |
diff --git a/net/wireless/core.c b/net/wireless/core.c index fe8d4f2be49b..aff959e5a1b3 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
@@ -958,8 +958,6 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb, | |||
958 | case NETDEV_PRE_UP: | 958 | case NETDEV_PRE_UP: |
959 | if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype))) | 959 | if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype))) |
960 | return notifier_from_errno(-EOPNOTSUPP); | 960 | return notifier_from_errno(-EOPNOTSUPP); |
961 | if (rfkill_blocked(rdev->rfkill)) | ||
962 | return notifier_from_errno(-ERFKILL); | ||
963 | ret = cfg80211_can_add_interface(rdev, wdev->iftype); | 961 | ret = cfg80211_can_add_interface(rdev, wdev->iftype); |
964 | if (ret) | 962 | if (ret) |
965 | return notifier_from_errno(ret); | 963 | return notifier_from_errno(ret); |
diff --git a/net/wireless/core.h b/net/wireless/core.h index 9ad43c619c54..3159e9c284c5 100644 --- a/net/wireless/core.h +++ b/net/wireless/core.h | |||
@@ -411,6 +411,9 @@ static inline int | |||
411 | cfg80211_can_add_interface(struct cfg80211_registered_device *rdev, | 411 | cfg80211_can_add_interface(struct cfg80211_registered_device *rdev, |
412 | enum nl80211_iftype iftype) | 412 | enum nl80211_iftype iftype) |
413 | { | 413 | { |
414 | if (rfkill_blocked(rdev->rfkill)) | ||
415 | return -ERFKILL; | ||
416 | |||
414 | return cfg80211_can_change_interface(rdev, NULL, iftype); | 417 | return cfg80211_can_change_interface(rdev, NULL, iftype); |
415 | } | 418 | } |
416 | 419 | ||
diff --git a/net/wireless/radiotap.c b/net/wireless/radiotap.c index 7d604c06c3dc..a271c27fac77 100644 --- a/net/wireless/radiotap.c +++ b/net/wireless/radiotap.c | |||
@@ -97,6 +97,10 @@ int ieee80211_radiotap_iterator_init( | |||
97 | struct ieee80211_radiotap_header *radiotap_header, | 97 | struct ieee80211_radiotap_header *radiotap_header, |
98 | int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns) | 98 | int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns) |
99 | { | 99 | { |
100 | /* check the radiotap header can actually be present */ | ||
101 | if (max_length < sizeof(struct ieee80211_radiotap_header)) | ||
102 | return -EINVAL; | ||
103 | |||
100 | /* Linux only supports version 0 radiotap format */ | 104 | /* Linux only supports version 0 radiotap format */ |
101 | if (radiotap_header->it_version) | 105 | if (radiotap_header->it_version) |
102 | return -EINVAL; | 106 | return -EINVAL; |
@@ -131,7 +135,8 @@ int ieee80211_radiotap_iterator_init( | |||
131 | */ | 135 | */ |
132 | 136 | ||
133 | if ((unsigned long)iterator->_arg - | 137 | if ((unsigned long)iterator->_arg - |
134 | (unsigned long)iterator->_rtheader > | 138 | (unsigned long)iterator->_rtheader + |
139 | sizeof(uint32_t) > | ||
135 | (unsigned long)iterator->_max_length) | 140 | (unsigned long)iterator->_max_length) |
136 | return -EINVAL; | 141 | return -EINVAL; |
137 | } | 142 | } |