aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2014-02-24 15:03:32 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-02-24 15:03:32 -0500
commitc77986c78aa941af8266272841567e78b72d54cc (patch)
treecb30e1bd7d5799bfce5a3837bcfddee059a81733 /net/mac80211
parent9e4b4269ecee426f1647425a24186dd1566db554 (diff)
parent6658ab80fd4ef940fc2366ddb66690a15ea69c18 (diff)
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
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 0014b5396ce5..8603dfb52b3a 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 96518ad200c4..be198f42f1f7 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 61604834b914..46b62bb3677c 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)
@@ -2249,6 +2249,62 @@ static void ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata,
2249 /* ignore frame -- wait for timeout */ 2249 /* ignore frame -- wait for timeout */
2250} 2250}
2251 2251
2252#define case_WLAN(type) \
2253 case WLAN_REASON_##type: return #type
2254
2255static const char *ieee80211_get_reason_code_string(u16 reason_code)
2256{
2257 switch (reason_code) {
2258 case_WLAN(UNSPECIFIED);
2259 case_WLAN(PREV_AUTH_NOT_VALID);
2260 case_WLAN(DEAUTH_LEAVING);
2261 case_WLAN(DISASSOC_DUE_TO_INACTIVITY);
2262 case_WLAN(DISASSOC_AP_BUSY);
2263 case_WLAN(CLASS2_FRAME_FROM_NONAUTH_STA);
2264 case_WLAN(CLASS3_FRAME_FROM_NONASSOC_STA);
2265 case_WLAN(DISASSOC_STA_HAS_LEFT);
2266 case_WLAN(STA_REQ_ASSOC_WITHOUT_AUTH);
2267 case_WLAN(DISASSOC_BAD_POWER);
2268 case_WLAN(DISASSOC_BAD_SUPP_CHAN);
2269 case_WLAN(INVALID_IE);
2270 case_WLAN(MIC_FAILURE);
2271 case_WLAN(4WAY_HANDSHAKE_TIMEOUT);
2272 case_WLAN(GROUP_KEY_HANDSHAKE_TIMEOUT);
2273 case_WLAN(IE_DIFFERENT);
2274 case_WLAN(INVALID_GROUP_CIPHER);
2275 case_WLAN(INVALID_PAIRWISE_CIPHER);
2276 case_WLAN(INVALID_AKMP);
2277 case_WLAN(UNSUPP_RSN_VERSION);
2278 case_WLAN(INVALID_RSN_IE_CAP);
2279 case_WLAN(IEEE8021X_FAILED);
2280 case_WLAN(CIPHER_SUITE_REJECTED);
2281 case_WLAN(DISASSOC_UNSPECIFIED_QOS);
2282 case_WLAN(DISASSOC_QAP_NO_BANDWIDTH);
2283 case_WLAN(DISASSOC_LOW_ACK);
2284 case_WLAN(DISASSOC_QAP_EXCEED_TXOP);
2285 case_WLAN(QSTA_LEAVE_QBSS);
2286 case_WLAN(QSTA_NOT_USE);
2287 case_WLAN(QSTA_REQUIRE_SETUP);
2288 case_WLAN(QSTA_TIMEOUT);
2289 case_WLAN(QSTA_CIPHER_NOT_SUPP);
2290 case_WLAN(MESH_PEER_CANCELED);
2291 case_WLAN(MESH_MAX_PEERS);
2292 case_WLAN(MESH_CONFIG);
2293 case_WLAN(MESH_CLOSE);
2294 case_WLAN(MESH_MAX_RETRIES);
2295 case_WLAN(MESH_CONFIRM_TIMEOUT);
2296 case_WLAN(MESH_INVALID_GTK);
2297 case_WLAN(MESH_INCONSISTENT_PARAM);
2298 case_WLAN(MESH_INVALID_SECURITY);
2299 case_WLAN(MESH_PATH_ERROR);
2300 case_WLAN(MESH_PATH_NOFORWARD);
2301 case_WLAN(MESH_PATH_DEST_UNREACHABLE);
2302 case_WLAN(MAC_EXISTS_IN_MBSS);
2303 case_WLAN(MESH_CHAN_REGULATORY);
2304 case_WLAN(MESH_CHAN);
2305 default: return "<unknown>";
2306 }
2307}
2252 2308
2253static void ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata, 2309static void ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata,
2254 struct ieee80211_mgmt *mgmt, size_t len) 2310 struct ieee80211_mgmt *mgmt, size_t len)
@@ -2270,8 +2326,8 @@ static void ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata,
2270 2326
2271 reason_code = le16_to_cpu(mgmt->u.deauth.reason_code); 2327 reason_code = le16_to_cpu(mgmt->u.deauth.reason_code);
2272 2328
2273 sdata_info(sdata, "deauthenticated from %pM (Reason: %u)\n", 2329 sdata_info(sdata, "deauthenticated from %pM (Reason: %u=%s)\n",
2274 bssid, reason_code); 2330 bssid, reason_code, ieee80211_get_reason_code_string(reason_code));
2275 2331
2276 ieee80211_set_disassoc(sdata, 0, 0, false, NULL); 2332 ieee80211_set_disassoc(sdata, 0, 0, false, NULL);
2277 2333
@@ -4340,8 +4396,8 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
4340 bool report_frame = false; 4396 bool report_frame = false;
4341 4397
4342 sdata_info(sdata, 4398 sdata_info(sdata,
4343 "deauthenticating from %pM by local choice (reason=%d)\n", 4399 "deauthenticating from %pM by local choice (Reason: %u=%s)\n",
4344 req->bssid, req->reason_code); 4400 req->bssid, req->reason_code, ieee80211_get_reason_code_string(req->reason_code));
4345 4401
4346 if (ifmgd->auth_data) { 4402 if (ifmgd->auth_data) {
4347 drv_mgd_prepare_tx(sdata->local, sdata); 4403 drv_mgd_prepare_tx(sdata->local, sdata);
@@ -4387,8 +4443,8 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
4387 return -ENOLINK; 4443 return -ENOLINK;
4388 4444
4389 sdata_info(sdata, 4445 sdata_info(sdata,
4390 "disassociating from %pM by local choice (reason=%d)\n", 4446 "disassociating from %pM by local choice (Reason: %u=%s)\n",
4391 req->bss->bssid, req->reason_code); 4447 req->bss->bssid, req->reason_code, ieee80211_get_reason_code_string(req->reason_code));
4392 4448
4393 memcpy(bssid, req->bss->bssid, ETH_ALEN); 4449 memcpy(bssid, req->bss->bssid, ETH_ALEN);
4394 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DISASSOC, 4450 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DISASSOC,
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 593062109c50..58e4b7052d17 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1954,7 +1954,10 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
1954 /* deliver to local stack */ 1954 /* deliver to local stack */
1955 skb->protocol = eth_type_trans(skb, dev); 1955 skb->protocol = eth_type_trans(skb, dev);
1956 memset(skb->cb, 0, sizeof(skb->cb)); 1956 memset(skb->cb, 0, sizeof(skb->cb));
1957 netif_receive_skb(skb); 1957 if (rx->local->napi)
1958 napi_gro_receive(rx->local->napi, skb);
1959 else
1960 netif_receive_skb(skb);
1958 } 1961 }
1959 1962
1960 if (xmit_skb) { 1963 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);