aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2013-01-28 13:54:03 -0500
committerJohn W. Linville <linville@tuxdriver.com>2013-01-28 13:54:03 -0500
commit9ebea3829fac7505e0cd2642fbd13cfa9c038831 (patch)
treeed690568a27b7231b8a507e8ba07c1ae34868e5c /net
parentc5e818ef081c4144177fdbdeed154332cd7e4d7a (diff)
parent83f0c6d1f502bd75bb4a9e31e8d64e59c6894ad1 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Conflicts: drivers/net/wireless/ath/ath9k/main.c drivers/net/wireless/iwlwifi/dvm/tx.c
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hci_core.c8
-rw-r--r--net/bluetooth/hci_event.c2
-rw-r--r--net/bluetooth/hidp/core.c2
-rw-r--r--net/bluetooth/l2cap_core.c11
-rw-r--r--net/bluetooth/sco.c2
-rw-r--r--net/mac80211/cfg.c12
-rw-r--r--net/mac80211/ieee80211_i.h6
-rw-r--r--net/mac80211/mesh_hwmp.c5
-rw-r--r--net/mac80211/offchannel.c19
-rw-r--r--net/mac80211/scan.c15
-rw-r--r--net/mac80211/tx.c9
11 files changed, 49 insertions, 42 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 596660d37c5e..0f78e34220c9 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2810,14 +2810,6 @@ static void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb)
2810 if (conn) { 2810 if (conn) {
2811 hci_conn_enter_active_mode(conn, BT_POWER_FORCE_ACTIVE_OFF); 2811 hci_conn_enter_active_mode(conn, BT_POWER_FORCE_ACTIVE_OFF);
2812 2812
2813 hci_dev_lock(hdev);
2814 if (test_bit(HCI_MGMT, &hdev->dev_flags) &&
2815 !test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags))
2816 mgmt_device_connected(hdev, &conn->dst, conn->type,
2817 conn->dst_type, 0, NULL, 0,
2818 conn->dev_class);
2819 hci_dev_unlock(hdev);
2820
2821 /* Send to upper protocol */ 2813 /* Send to upper protocol */
2822 l2cap_recv_acldata(conn, skb, flags); 2814 l2cap_recv_acldata(conn, skb, flags);
2823 return; 2815 return;
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 705078a0cc39..81b44481d0d9 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -2688,7 +2688,7 @@ static void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
2688 if (ev->opcode != HCI_OP_NOP) 2688 if (ev->opcode != HCI_OP_NOP)
2689 del_timer(&hdev->cmd_timer); 2689 del_timer(&hdev->cmd_timer);
2690 2690
2691 if (ev->ncmd) { 2691 if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags)) {
2692 atomic_set(&hdev->cmd_cnt, 1); 2692 atomic_set(&hdev->cmd_cnt, 1);
2693 if (!skb_queue_empty(&hdev->cmd_q)) 2693 if (!skb_queue_empty(&hdev->cmd_q))
2694 queue_work(hdev->workqueue, &hdev->cmd_work); 2694 queue_work(hdev->workqueue, &hdev->cmd_work);
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index b2bcbe2dc328..a7352ff3fd1e 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -931,7 +931,7 @@ static int hidp_setup_hid(struct hidp_session *session,
931 hid->version = req->version; 931 hid->version = req->version;
932 hid->country = req->country; 932 hid->country = req->country;
933 933
934 strncpy(hid->name, req->name, 128); 934 strncpy(hid->name, req->name, sizeof(req->name) - 1);
935 935
936 snprintf(hid->phys, sizeof(hid->phys), "%pMR", 936 snprintf(hid->phys, sizeof(hid->phys), "%pMR",
937 &bt_sk(session->ctrl_sock->sk)->src); 937 &bt_sk(session->ctrl_sock->sk)->src);
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 2c78208d793e..22e658322845 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -3727,6 +3727,17 @@ sendresp:
3727static int l2cap_connect_req(struct l2cap_conn *conn, 3727static int l2cap_connect_req(struct l2cap_conn *conn,
3728 struct l2cap_cmd_hdr *cmd, u8 *data) 3728 struct l2cap_cmd_hdr *cmd, u8 *data)
3729{ 3729{
3730 struct hci_dev *hdev = conn->hcon->hdev;
3731 struct hci_conn *hcon = conn->hcon;
3732
3733 hci_dev_lock(hdev);
3734 if (test_bit(HCI_MGMT, &hdev->dev_flags) &&
3735 !test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &hcon->flags))
3736 mgmt_device_connected(hdev, &hcon->dst, hcon->type,
3737 hcon->dst_type, 0, NULL, 0,
3738 hcon->dev_class);
3739 hci_dev_unlock(hdev);
3740
3730 l2cap_connect(conn, cmd, data, L2CAP_CONN_RSP, 0); 3741 l2cap_connect(conn, cmd, data, L2CAP_CONN_RSP, 0);
3731 return 0; 3742 return 0;
3732} 3743}
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 531a93d613d4..57f250c20e39 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -352,7 +352,7 @@ static void __sco_sock_close(struct sock *sk)
352 352
353 case BT_CONNECTED: 353 case BT_CONNECTED:
354 case BT_CONFIG: 354 case BT_CONFIG:
355 if (sco_pi(sk)->conn) { 355 if (sco_pi(sk)->conn->hcon) {
356 sk->sk_state = BT_DISCONN; 356 sk->sk_state = BT_DISCONN;
357 sco_sock_set_timer(sk, SCO_DISCONN_TIMEOUT); 357 sco_sock_set_timer(sk, SCO_DISCONN_TIMEOUT);
358 hci_conn_put(sco_pi(sk)->conn->hcon); 358 hci_conn_put(sco_pi(sk)->conn->hcon);
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 36aa65f495ff..661b878bd19c 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -164,7 +164,17 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,
164 sta = sta_info_get(sdata, mac_addr); 164 sta = sta_info_get(sdata, mac_addr);
165 else 165 else
166 sta = sta_info_get_bss(sdata, mac_addr); 166 sta = sta_info_get_bss(sdata, mac_addr);
167 if (!sta) { 167 /*
168 * The ASSOC test makes sure the driver is ready to
169 * receive the key. When wpa_supplicant has roamed
170 * using FT, it attempts to set the key before
171 * association has completed, this rejects that attempt
172 * so it will set the key again after assocation.
173 *
174 * TODO: accept the key if we have a station entry and
175 * add it to the device after the station.
176 */
177 if (!sta || !test_sta_flag(sta, WLAN_STA_ASSOC)) {
168 ieee80211_key_free(sdata->local, key); 178 ieee80211_key_free(sdata->local, key);
169 err = -ENOENT; 179 err = -ENOENT;
170 goto out_unlock; 180 goto out_unlock;
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 0fa44a965ad9..63f0430c131e 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1368,10 +1368,8 @@ int ieee80211_request_sched_scan_stop(struct ieee80211_sub_if_data *sdata);
1368void ieee80211_sched_scan_stopped_work(struct work_struct *work); 1368void ieee80211_sched_scan_stopped_work(struct work_struct *work);
1369 1369
1370/* off-channel helpers */ 1370/* off-channel helpers */
1371void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local, 1371void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local);
1372 bool offchannel_ps_enable); 1372void ieee80211_offchannel_return(struct ieee80211_local *local);
1373void ieee80211_offchannel_return(struct ieee80211_local *local,
1374 bool offchannel_ps_disable);
1375void ieee80211_roc_setup(struct ieee80211_local *local); 1373void ieee80211_roc_setup(struct ieee80211_local *local);
1376void ieee80211_start_next_roc(struct ieee80211_local *local); 1374void ieee80211_start_next_roc(struct ieee80211_local *local);
1377void ieee80211_roc_purge(struct ieee80211_sub_if_data *sdata); 1375void ieee80211_roc_purge(struct ieee80211_sub_if_data *sdata);
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index 9044296c8876..6b4603a90031 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -215,6 +215,7 @@ static void prepare_frame_for_deferred_tx(struct ieee80211_sub_if_data *sdata,
215 skb->priority = 7; 215 skb->priority = 7;
216 216
217 info->control.vif = &sdata->vif; 217 info->control.vif = &sdata->vif;
218 info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
218 ieee80211_set_qos_hdr(sdata, skb); 219 ieee80211_set_qos_hdr(sdata, skb);
219} 220}
220 221
@@ -248,11 +249,13 @@ int mesh_path_error_tx(u8 ttl, u8 *target, __le32 target_sn,
248 return -EAGAIN; 249 return -EAGAIN;
249 250
250 skb = dev_alloc_skb(local->tx_headroom + 251 skb = dev_alloc_skb(local->tx_headroom +
252 IEEE80211_ENCRYPT_HEADROOM +
253 IEEE80211_ENCRYPT_TAILROOM +
251 hdr_len + 254 hdr_len +
252 2 + 15 /* PERR IE */); 255 2 + 15 /* PERR IE */);
253 if (!skb) 256 if (!skb)
254 return -1; 257 return -1;
255 skb_reserve(skb, local->tx_headroom); 258 skb_reserve(skb, local->tx_headroom + IEEE80211_ENCRYPT_HEADROOM);
256 mgmt = (struct ieee80211_mgmt *) skb_put(skb, hdr_len); 259 mgmt = (struct ieee80211_mgmt *) skb_put(skb, hdr_len);
257 memset(mgmt, 0, hdr_len); 260 memset(mgmt, 0, hdr_len);
258 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | 261 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
index 1430b48600fc..82baf5b6ecf4 100644
--- a/net/mac80211/offchannel.c
+++ b/net/mac80211/offchannel.c
@@ -102,8 +102,7 @@ static void ieee80211_offchannel_ps_disable(struct ieee80211_sub_if_data *sdata)
102 ieee80211_sta_reset_conn_monitor(sdata); 102 ieee80211_sta_reset_conn_monitor(sdata);
103} 103}
104 104
105void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local, 105void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local)
106 bool offchannel_ps_enable)
107{ 106{
108 struct ieee80211_sub_if_data *sdata; 107 struct ieee80211_sub_if_data *sdata;
109 108
@@ -136,8 +135,7 @@ void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local,
136 135
137 if (sdata->vif.type != NL80211_IFTYPE_MONITOR) { 136 if (sdata->vif.type != NL80211_IFTYPE_MONITOR) {
138 netif_tx_stop_all_queues(sdata->dev); 137 netif_tx_stop_all_queues(sdata->dev);
139 if (offchannel_ps_enable && 138 if (sdata->vif.type == NL80211_IFTYPE_STATION &&
140 (sdata->vif.type == NL80211_IFTYPE_STATION) &&
141 sdata->u.mgd.associated) 139 sdata->u.mgd.associated)
142 ieee80211_offchannel_ps_enable(sdata); 140 ieee80211_offchannel_ps_enable(sdata);
143 } 141 }
@@ -145,8 +143,7 @@ void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local,
145 mutex_unlock(&local->iflist_mtx); 143 mutex_unlock(&local->iflist_mtx);
146} 144}
147 145
148void ieee80211_offchannel_return(struct ieee80211_local *local, 146void ieee80211_offchannel_return(struct ieee80211_local *local)
149 bool offchannel_ps_disable)
150{ 147{
151 struct ieee80211_sub_if_data *sdata; 148 struct ieee80211_sub_if_data *sdata;
152 149
@@ -165,11 +162,9 @@ void ieee80211_offchannel_return(struct ieee80211_local *local,
165 continue; 162 continue;
166 163
167 /* Tell AP we're back */ 164 /* Tell AP we're back */
168 if (offchannel_ps_disable && 165 if (sdata->vif.type == NL80211_IFTYPE_STATION &&
169 sdata->vif.type == NL80211_IFTYPE_STATION) { 166 sdata->u.mgd.associated)
170 if (sdata->u.mgd.associated) 167 ieee80211_offchannel_ps_disable(sdata);
171 ieee80211_offchannel_ps_disable(sdata);
172 }
173 168
174 if (sdata->vif.type != NL80211_IFTYPE_MONITOR) { 169 if (sdata->vif.type != NL80211_IFTYPE_MONITOR) {
175 /* 170 /*
@@ -388,7 +383,7 @@ void ieee80211_sw_roc_work(struct work_struct *work)
388 local->tmp_channel = NULL; 383 local->tmp_channel = NULL;
389 ieee80211_hw_config(local, 0); 384 ieee80211_hw_config(local, 0);
390 385
391 ieee80211_offchannel_return(local, true); 386 ieee80211_offchannel_return(local);
392 } 387 }
393 388
394 ieee80211_recalc_idle(local); 389 ieee80211_recalc_idle(local);
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 06cbe26892a8..607684c47d55 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -291,7 +291,7 @@ static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted,
291 if (!was_hw_scan) { 291 if (!was_hw_scan) {
292 ieee80211_configure_filter(local); 292 ieee80211_configure_filter(local);
293 drv_sw_scan_complete(local); 293 drv_sw_scan_complete(local);
294 ieee80211_offchannel_return(local, true); 294 ieee80211_offchannel_return(local);
295 } 295 }
296 296
297 ieee80211_recalc_idle(local); 297 ieee80211_recalc_idle(local);
@@ -340,7 +340,7 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local)
340 local->next_scan_state = SCAN_DECISION; 340 local->next_scan_state = SCAN_DECISION;
341 local->scan_channel_idx = 0; 341 local->scan_channel_idx = 0;
342 342
343 ieee80211_offchannel_stop_vifs(local, true); 343 ieee80211_offchannel_stop_vifs(local);
344 344
345 ieee80211_configure_filter(local); 345 ieee80211_configure_filter(local);
346 346
@@ -677,12 +677,8 @@ static void ieee80211_scan_state_suspend(struct ieee80211_local *local,
677 local->scan_channel = NULL; 677 local->scan_channel = NULL;
678 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); 678 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
679 679
680 /* 680 /* disable PS */
681 * Re-enable vifs and beaconing. Leave PS 681 ieee80211_offchannel_return(local);
682 * in off-channel state..will put that back
683 * on-channel at the end of scanning.
684 */
685 ieee80211_offchannel_return(local, false);
686 682
687 *next_delay = HZ / 5; 683 *next_delay = HZ / 5;
688 /* afterwards, resume scan & go to next channel */ 684 /* afterwards, resume scan & go to next channel */
@@ -692,8 +688,7 @@ static void ieee80211_scan_state_suspend(struct ieee80211_local *local,
692static void ieee80211_scan_state_resume(struct ieee80211_local *local, 688static void ieee80211_scan_state_resume(struct ieee80211_local *local,
693 unsigned long *next_delay) 689 unsigned long *next_delay)
694{ 690{
695 /* PS already is in off-channel mode */ 691 ieee80211_offchannel_stop_vifs(local);
696 ieee80211_offchannel_stop_vifs(local, false);
697 692
698 if (local->ops->flush) { 693 if (local->ops->flush) {
699 drv_flush(local, false); 694 drv_flush(local, false);
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 0d7381679a5c..f32d68186dbc 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1673,10 +1673,13 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
1673 chanctx_conf = 1673 chanctx_conf =
1674 rcu_dereference(tmp_sdata->vif.chanctx_conf); 1674 rcu_dereference(tmp_sdata->vif.chanctx_conf);
1675 } 1675 }
1676 if (!chanctx_conf)
1677 goto fail_rcu;
1678 1676
1679 chan = chanctx_conf->def.chan; 1677 if (chanctx_conf)
1678 chan = chanctx_conf->def.chan;
1679 else if (!local->use_chanctx)
1680 chan = local->_oper_channel;
1681 else
1682 goto fail_rcu;
1680 1683
1681 /* 1684 /*
1682 * Frame injection is not allowed if beaconing is not allowed 1685 * Frame injection is not allowed if beaconing is not allowed