aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2014-03-13 14:21:43 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-03-13 14:21:43 -0400
commit42775a34d23027b19e984956a539448f5e7ff075 (patch)
treee344340c7f0aed4c8faf7534fabbc64607a8e784 /net/mac80211
parent433131ba03c511a84e1fda5669c70cf8b44702e1 (diff)
parent4e3b3bcd81776527fa6f11624d68849de8c8802e (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Conflicts: drivers/net/wireless/ath/ath9k/recv.c
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/cfg.c7
-rw-r--r--net/mac80211/debugfs_netdev.c13
-rw-r--r--net/mac80211/driver-ops.h12
-rw-r--r--net/mac80211/ht.c2
-rw-r--r--net/mac80211/ibss.c5
-rw-r--r--net/mac80211/ieee80211_i.h2
-rw-r--r--net/mac80211/iface.c11
-rw-r--r--net/mac80211/main.c12
-rw-r--r--net/mac80211/mlme.c72
-rw-r--r--net/mac80211/rx.c5
-rw-r--r--net/mac80211/scan.c9
11 files changed, 116 insertions, 34 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 363d19b5d5c8..1acb29109b45 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1347,9 +1347,6 @@ static int sta_apply_parameters(struct ieee80211_local *local,
1347 params->vht_capa, sta); 1347 params->vht_capa, sta);
1348 1348
1349 if (params->opmode_notif_used) { 1349 if (params->opmode_notif_used) {
1350 enum ieee80211_band band =
1351 ieee80211_get_sdata_band(sdata);
1352
1353 /* returned value is only needed for rc update, but the 1350 /* returned value is only needed for rc update, but the
1354 * rc isn't initialized here yet, so ignore it 1351 * rc isn't initialized here yet, so ignore it
1355 */ 1352 */
@@ -3647,8 +3644,8 @@ ieee80211_prep_tdls_direct(struct wiphy *wiphy, struct net_device *dev,
3647 3644
3648static int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev, 3645static int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
3649 u8 *peer, u8 action_code, u8 dialog_token, 3646 u8 *peer, u8 action_code, u8 dialog_token,
3650 u16 status_code, const u8 *extra_ies, 3647 u16 status_code, u32 peer_capability,
3651 size_t extra_ies_len) 3648 const u8 *extra_ies, size_t extra_ies_len)
3652{ 3649{
3653 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 3650 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
3654 struct ieee80211_local *local = sdata->local; 3651 struct ieee80211_local *local = sdata->local;
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
index ebf80f3abd83..40a648938985 100644
--- a/net/mac80211/debugfs_netdev.c
+++ b/net/mac80211/debugfs_netdev.c
@@ -358,6 +358,18 @@ static ssize_t ieee80211_if_parse_tkip_mic_test(
358} 358}
359IEEE80211_IF_FILE_W(tkip_mic_test); 359IEEE80211_IF_FILE_W(tkip_mic_test);
360 360
361static ssize_t ieee80211_if_parse_beacon_loss(
362 struct ieee80211_sub_if_data *sdata, const char *buf, int buflen)
363{
364 if (!ieee80211_sdata_running(sdata) || !sdata->vif.bss_conf.assoc)
365 return -ENOTCONN;
366
367 ieee80211_beacon_loss(&sdata->vif);
368
369 return buflen;
370}
371IEEE80211_IF_FILE_W(beacon_loss);
372
361static ssize_t ieee80211_if_fmt_uapsd_queues( 373static ssize_t ieee80211_if_fmt_uapsd_queues(
362 const struct ieee80211_sub_if_data *sdata, char *buf, int buflen) 374 const struct ieee80211_sub_if_data *sdata, char *buf, int buflen)
363{ 375{
@@ -569,6 +581,7 @@ static void add_sta_files(struct ieee80211_sub_if_data *sdata)
569 DEBUGFS_ADD(beacon_timeout); 581 DEBUGFS_ADD(beacon_timeout);
570 DEBUGFS_ADD_MODE(smps, 0600); 582 DEBUGFS_ADD_MODE(smps, 0600);
571 DEBUGFS_ADD_MODE(tkip_mic_test, 0200); 583 DEBUGFS_ADD_MODE(tkip_mic_test, 0200);
584 DEBUGFS_ADD_MODE(beacon_loss, 0200);
572 DEBUGFS_ADD_MODE(uapsd_queues, 0600); 585 DEBUGFS_ADD_MODE(uapsd_queues, 0600);
573 DEBUGFS_ADD_MODE(uapsd_max_sp_len, 0600); 586 DEBUGFS_ADD_MODE(uapsd_max_sp_len, 0600);
574} 587}
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index ef8b385eff04..fc689f5d971e 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -354,16 +354,20 @@ drv_sched_scan_start(struct ieee80211_local *local,
354 return ret; 354 return ret;
355} 355}
356 356
357static inline void drv_sched_scan_stop(struct ieee80211_local *local, 357static inline int drv_sched_scan_stop(struct ieee80211_local *local,
358 struct ieee80211_sub_if_data *sdata) 358 struct ieee80211_sub_if_data *sdata)
359{ 359{
360 int ret;
361
360 might_sleep(); 362 might_sleep();
361 363
362 check_sdata_in_driver(sdata); 364 check_sdata_in_driver(sdata);
363 365
364 trace_drv_sched_scan_stop(local, sdata); 366 trace_drv_sched_scan_stop(local, sdata);
365 local->ops->sched_scan_stop(&local->hw, &sdata->vif); 367 ret = local->ops->sched_scan_stop(&local->hw, &sdata->vif);
366 trace_drv_return_void(local); 368 trace_drv_return_int(local, ret);
369
370 return ret;
367} 371}
368 372
369static inline void drv_sw_scan_start(struct ieee80211_local *local) 373static inline void drv_sw_scan_start(struct ieee80211_local *local)
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c
index afbe2b203c3e..c150b68436d7 100644
--- a/net/mac80211/ht.c
+++ b/net/mac80211/ht.c
@@ -482,8 +482,6 @@ void ieee80211_request_smps(struct ieee80211_vif *vif,
482 return; 482 return;
483 483
484 if (vif->type == NL80211_IFTYPE_STATION) { 484 if (vif->type == NL80211_IFTYPE_STATION) {
485 if (WARN_ON(smps_mode == IEEE80211_SMPS_OFF))
486 smps_mode = IEEE80211_SMPS_AUTOMATIC;
487 if (sdata->u.mgd.driver_smps_mode == smps_mode) 485 if (sdata->u.mgd.driver_smps_mode == smps_mode)
488 return; 486 return;
489 sdata->u.mgd.driver_smps_mode = smps_mode; 487 sdata->u.mgd.driver_smps_mode = smps_mode;
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 4453e2725e40..e458ca0dffec 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -283,6 +283,11 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
283 283
284 err = cfg80211_chandef_dfs_required(sdata->local->hw.wiphy, 284 err = cfg80211_chandef_dfs_required(sdata->local->hw.wiphy,
285 &chandef); 285 &chandef);
286 if (err < 0) {
287 sdata_info(sdata,
288 "Failed to join IBSS, invalid chandef\n");
289 return;
290 }
286 if (err > 0) { 291 if (err > 0) {
287 if (!ifibss->userspace_handles_dfs) { 292 if (!ifibss->userspace_handles_dfs) {
288 sdata_info(sdata, 293 sdata_info(sdata,
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 906e211b1dd1..0d1a0f801b94 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1242,6 +1242,8 @@ struct ieee80211_local {
1242 1242
1243 struct ieee80211_sub_if_data __rcu *p2p_sdata; 1243 struct ieee80211_sub_if_data __rcu *p2p_sdata;
1244 1244
1245 struct napi_struct *napi;
1246
1245 /* virtual monitor interface */ 1247 /* virtual monitor interface */
1246 struct ieee80211_sub_if_data __rcu *monitor_sdata; 1248 struct ieee80211_sub_if_data __rcu *monitor_sdata;
1247 struct cfg80211_chan_def monitor_chandef; 1249 struct cfg80211_chan_def monitor_chandef;
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 088111af6c7c..b8d331e7d883 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -101,9 +101,8 @@ static u32 __ieee80211_idle_on(struct ieee80211_local *local)
101static u32 __ieee80211_recalc_idle(struct ieee80211_local *local, 101static u32 __ieee80211_recalc_idle(struct ieee80211_local *local,
102 bool force_active) 102 bool force_active)
103{ 103{
104 bool working = false, scanning, active; 104 bool working, scanning, active;
105 unsigned int led_trig_start = 0, led_trig_stop = 0; 105 unsigned int led_trig_start = 0, led_trig_stop = 0;
106 struct ieee80211_roc_work *roc;
107 106
108 lockdep_assert_held(&local->mtx); 107 lockdep_assert_held(&local->mtx);
109 108
@@ -111,12 +110,8 @@ static u32 __ieee80211_recalc_idle(struct ieee80211_local *local,
111 !list_empty(&local->chanctx_list) || 110 !list_empty(&local->chanctx_list) ||
112 local->monitors; 111 local->monitors;
113 112
114 if (!local->ops->remain_on_channel) { 113 working = !local->ops->remain_on_channel &&
115 list_for_each_entry(roc, &local->roc_list, list) { 114 !list_empty(&local->roc_list);
116 working = true;
117 break;
118 }
119 }
120 115
121 scanning = test_bit(SCAN_SW_SCANNING, &local->scanning) || 116 scanning = test_bit(SCAN_SW_SCANNING, &local->scanning) ||
122 test_bit(SCAN_ONCHANNEL_SCANNING, &local->scanning); 117 test_bit(SCAN_ONCHANNEL_SCANNING, &local->scanning);
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 1f7d8422d62d..b055f6a55c68 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -1076,6 +1076,18 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
1076} 1076}
1077EXPORT_SYMBOL(ieee80211_register_hw); 1077EXPORT_SYMBOL(ieee80211_register_hw);
1078 1078
1079void ieee80211_napi_add(struct ieee80211_hw *hw, struct napi_struct *napi,
1080 struct net_device *napi_dev,
1081 int (*poll)(struct napi_struct *, int),
1082 int weight)
1083{
1084 struct ieee80211_local *local = hw_to_local(hw);
1085
1086 netif_napi_add(napi_dev, napi, poll, weight);
1087 local->napi = napi;
1088}
1089EXPORT_SYMBOL_GPL(ieee80211_napi_add);
1090
1079void ieee80211_unregister_hw(struct ieee80211_hw *hw) 1091void ieee80211_unregister_hw(struct ieee80211_hw *hw)
1080{ 1092{
1081 struct ieee80211_local *local = hw_to_local(hw); 1093 struct ieee80211_local *local = hw_to_local(hw);
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 4bc227550f25..94f0af29b742 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -131,13 +131,13 @@ void ieee80211_sta_reset_conn_monitor(struct ieee80211_sub_if_data *sdata)
131 if (unlikely(!sdata->u.mgd.associated)) 131 if (unlikely(!sdata->u.mgd.associated))
132 return; 132 return;
133 133
134 ifmgd->probe_send_count = 0;
135
134 if (sdata->local->hw.flags & IEEE80211_HW_CONNECTION_MONITOR) 136 if (sdata->local->hw.flags & IEEE80211_HW_CONNECTION_MONITOR)
135 return; 137 return;
136 138
137 mod_timer(&sdata->u.mgd.conn_mon_timer, 139 mod_timer(&sdata->u.mgd.conn_mon_timer,
138 round_jiffies_up(jiffies + IEEE80211_CONNECTION_IDLE_TIME)); 140 round_jiffies_up(jiffies + IEEE80211_CONNECTION_IDLE_TIME));
139
140 ifmgd->probe_send_count = 0;
141} 141}
142 142
143static int ecw2cw(int ecw) 143static int ecw2cw(int ecw)
@@ -2272,6 +2272,62 @@ static void ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata,
2272 /* ignore frame -- wait for timeout */ 2272 /* ignore frame -- wait for timeout */
2273} 2273}
2274 2274
2275#define case_WLAN(type) \
2276 case WLAN_REASON_##type: return #type
2277
2278static const char *ieee80211_get_reason_code_string(u16 reason_code)
2279{
2280 switch (reason_code) {
2281 case_WLAN(UNSPECIFIED);
2282 case_WLAN(PREV_AUTH_NOT_VALID);
2283 case_WLAN(DEAUTH_LEAVING);
2284 case_WLAN(DISASSOC_DUE_TO_INACTIVITY);
2285 case_WLAN(DISASSOC_AP_BUSY);
2286 case_WLAN(CLASS2_FRAME_FROM_NONAUTH_STA);
2287 case_WLAN(CLASS3_FRAME_FROM_NONASSOC_STA);
2288 case_WLAN(DISASSOC_STA_HAS_LEFT);
2289 case_WLAN(STA_REQ_ASSOC_WITHOUT_AUTH);
2290 case_WLAN(DISASSOC_BAD_POWER);
2291 case_WLAN(DISASSOC_BAD_SUPP_CHAN);
2292 case_WLAN(INVALID_IE);
2293 case_WLAN(MIC_FAILURE);
2294 case_WLAN(4WAY_HANDSHAKE_TIMEOUT);
2295 case_WLAN(GROUP_KEY_HANDSHAKE_TIMEOUT);
2296 case_WLAN(IE_DIFFERENT);
2297 case_WLAN(INVALID_GROUP_CIPHER);
2298 case_WLAN(INVALID_PAIRWISE_CIPHER);
2299 case_WLAN(INVALID_AKMP);
2300 case_WLAN(UNSUPP_RSN_VERSION);
2301 case_WLAN(INVALID_RSN_IE_CAP);
2302 case_WLAN(IEEE8021X_FAILED);
2303 case_WLAN(CIPHER_SUITE_REJECTED);
2304 case_WLAN(DISASSOC_UNSPECIFIED_QOS);
2305 case_WLAN(DISASSOC_QAP_NO_BANDWIDTH);
2306 case_WLAN(DISASSOC_LOW_ACK);
2307 case_WLAN(DISASSOC_QAP_EXCEED_TXOP);
2308 case_WLAN(QSTA_LEAVE_QBSS);
2309 case_WLAN(QSTA_NOT_USE);
2310 case_WLAN(QSTA_REQUIRE_SETUP);
2311 case_WLAN(QSTA_TIMEOUT);
2312 case_WLAN(QSTA_CIPHER_NOT_SUPP);
2313 case_WLAN(MESH_PEER_CANCELED);
2314 case_WLAN(MESH_MAX_PEERS);
2315 case_WLAN(MESH_CONFIG);
2316 case_WLAN(MESH_CLOSE);
2317 case_WLAN(MESH_MAX_RETRIES);
2318 case_WLAN(MESH_CONFIRM_TIMEOUT);
2319 case_WLAN(MESH_INVALID_GTK);
2320 case_WLAN(MESH_INCONSISTENT_PARAM);
2321 case_WLAN(MESH_INVALID_SECURITY);
2322 case_WLAN(MESH_PATH_ERROR);
2323 case_WLAN(MESH_PATH_NOFORWARD);
2324 case_WLAN(MESH_PATH_DEST_UNREACHABLE);
2325 case_WLAN(MAC_EXISTS_IN_MBSS);
2326 case_WLAN(MESH_CHAN_REGULATORY);
2327 case_WLAN(MESH_CHAN);
2328 default: return "<unknown>";
2329 }
2330}
2275 2331
2276static void ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata, 2332static void ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata,
2277 struct ieee80211_mgmt *mgmt, size_t len) 2333 struct ieee80211_mgmt *mgmt, size_t len)
@@ -2293,8 +2349,8 @@ static void ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata,
2293 2349
2294 reason_code = le16_to_cpu(mgmt->u.deauth.reason_code); 2350 reason_code = le16_to_cpu(mgmt->u.deauth.reason_code);
2295 2351
2296 sdata_info(sdata, "deauthenticated from %pM (Reason: %u)\n", 2352 sdata_info(sdata, "deauthenticated from %pM (Reason: %u=%s)\n",
2297 bssid, reason_code); 2353 bssid, reason_code, ieee80211_get_reason_code_string(reason_code));
2298 2354
2299 ieee80211_set_disassoc(sdata, 0, 0, false, NULL); 2355 ieee80211_set_disassoc(sdata, 0, 0, false, NULL);
2300 2356
@@ -4364,8 +4420,8 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
4364 bool report_frame = false; 4420 bool report_frame = false;
4365 4421
4366 sdata_info(sdata, 4422 sdata_info(sdata,
4367 "deauthenticating from %pM by local choice (reason=%d)\n", 4423 "deauthenticating from %pM by local choice (Reason: %u=%s)\n",
4368 req->bssid, req->reason_code); 4424 req->bssid, req->reason_code, ieee80211_get_reason_code_string(req->reason_code));
4369 4425
4370 if (ifmgd->auth_data) { 4426 if (ifmgd->auth_data) {
4371 drv_mgd_prepare_tx(sdata->local, sdata); 4427 drv_mgd_prepare_tx(sdata->local, sdata);
@@ -4411,8 +4467,8 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
4411 return -ENOLINK; 4467 return -ENOLINK;
4412 4468
4413 sdata_info(sdata, 4469 sdata_info(sdata,
4414 "disassociating from %pM by local choice (reason=%d)\n", 4470 "disassociating from %pM by local choice (Reason: %u=%s)\n",
4415 req->bss->bssid, req->reason_code); 4471 req->bss->bssid, req->reason_code, ieee80211_get_reason_code_string(req->reason_code));
4416 4472
4417 memcpy(bssid, req->bss->bssid, ETH_ALEN); 4473 memcpy(bssid, req->bss->bssid, ETH_ALEN);
4418 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DISASSOC, 4474 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DISASSOC,
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 282440216a87..5b617660b0ba 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1961,7 +1961,10 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
1961 /* deliver to local stack */ 1961 /* deliver to local stack */
1962 skb->protocol = eth_type_trans(skb, dev); 1962 skb->protocol = eth_type_trans(skb, dev);
1963 memset(skb->cb, 0, sizeof(skb->cb)); 1963 memset(skb->cb, 0, sizeof(skb->cb));
1964 netif_receive_skb(skb); 1964 if (rx->local->napi)
1965 napi_gro_receive(rx->local->napi, skb);
1966 else
1967 netif_receive_skb(skb);
1965 } 1968 }
1966 1969
1967 if (xmit_skb) { 1970 if (xmit_skb) {
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 88c81616f8f7..836f500dfbf3 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -472,9 +472,7 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
472 if (local->ops->hw_scan) { 472 if (local->ops->hw_scan) {
473 u8 *ies; 473 u8 *ies;
474 474
475 local->hw_scan_ies_bufsize = 2 + IEEE80211_MAX_SSID_LEN + 475 local->hw_scan_ies_bufsize = local->scan_ies_len + req->ie_len;
476 local->scan_ies_len +
477 req->ie_len;
478 local->hw_scan_req = kmalloc( 476 local->hw_scan_req = kmalloc(
479 sizeof(*local->hw_scan_req) + 477 sizeof(*local->hw_scan_req) +
480 req->n_channels * sizeof(req->channels[0]) + 478 req->n_channels * sizeof(req->channels[0]) +
@@ -979,8 +977,7 @@ int __ieee80211_request_sched_scan_start(struct ieee80211_sub_if_data *sdata,
979 struct cfg80211_chan_def chandef; 977 struct cfg80211_chan_def chandef;
980 int ret, i, iebufsz; 978 int ret, i, iebufsz;
981 979
982 iebufsz = 2 + IEEE80211_MAX_SSID_LEN + 980 iebufsz = local->scan_ies_len + req->ie_len;
983 local->scan_ies_len + req->ie_len;
984 981
985 lockdep_assert_held(&local->mtx); 982 lockdep_assert_held(&local->mtx);
986 983
@@ -1059,7 +1056,7 @@ int ieee80211_request_sched_scan_stop(struct ieee80211_sub_if_data *sdata)
1059 local->sched_scan_req = NULL; 1056 local->sched_scan_req = NULL;
1060 1057
1061 if (rcu_access_pointer(local->sched_scan_sdata)) 1058 if (rcu_access_pointer(local->sched_scan_sdata))
1062 drv_sched_scan_stop(local, sdata); 1059 ret = drv_sched_scan_stop(local, sdata);
1063 1060
1064out: 1061out:
1065 mutex_unlock(&local->mtx); 1062 mutex_unlock(&local->mtx);