From b423db5b356749e3e39faad607d387cd4c1a9d30 Mon Sep 17 00:00:00 2001 From: Helmut Schaa Date: Mon, 19 Dec 2011 11:39:54 +0100 Subject: mac80211: Remove superfluous ieee80211_rx_h_remove_qos_control This seems to not serve any purpose anymore, at least all frame processing afterwards seems to be able to deal with QoS frames. So, let's save the expensive memmove and just leave the QoS header in the 802.11 frame for further processing. Signed-off-by: Helmut Schaa Signed-off-by: John W. Linville --- net/mac80211/rx.c | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'net/mac80211') diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 59f124c5833..f407427c642 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -1576,25 +1576,6 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx) return RX_CONTINUE; } -static ieee80211_rx_result debug_noinline -ieee80211_rx_h_remove_qos_control(struct ieee80211_rx_data *rx) -{ - u8 *data = rx->skb->data; - struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)data; - - if (!ieee80211_is_data_qos(hdr->frame_control)) - return RX_CONTINUE; - - /* remove the qos control field, update frame type and meta-data */ - memmove(data + IEEE80211_QOS_CTL_LEN, data, - ieee80211_hdrlen(hdr->frame_control) - IEEE80211_QOS_CTL_LEN); - hdr = (struct ieee80211_hdr *)skb_pull(rx->skb, IEEE80211_QOS_CTL_LEN); - /* change frame type to non QOS */ - hdr->frame_control &= ~cpu_to_le16(IEEE80211_STYPE_QOS_DATA); - - return RX_CONTINUE; -} - static int ieee80211_802_1x_port_control(struct ieee80211_rx_data *rx) { @@ -2718,7 +2699,6 @@ static void ieee80211_rx_handlers(struct ieee80211_rx_data *rx) if (ieee80211_vif_is_mesh(&rx->sdata->vif)) CALL_RXH(ieee80211_rx_h_mesh_fwding); #endif - CALL_RXH(ieee80211_rx_h_remove_qos_control) CALL_RXH(ieee80211_rx_h_amsdu) CALL_RXH(ieee80211_rx_h_data) CALL_RXH(ieee80211_rx_h_ctrl); -- cgit v1.2.3 From f6e8cb72ad4b0381d79df4575ec1f5c5df2e73b9 Mon Sep 17 00:00:00 2001 From: Eliad Peller Date: Fri, 23 Dec 2011 01:48:06 +0200 Subject: mac80211: always clear SDATA_STATE_OFFCHANNEL flag If the vif is stopped while it is offchannel (e.g. right after p2p negotiation) the SDATA_STATE_OFFCHANNEL flag is never get cleared, resulting in various bad effects (e.g. GO can't start beaconing). Fix it by clearing the SDATA_STATE_OFFCHANNEL flag even if the vif is stopped. Signed-off-by: Eliad Peller Signed-off-by: John W. Linville --- net/mac80211/offchannel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'net/mac80211') diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c index e4330d84357..2948f8e2e67 100644 --- a/net/mac80211/offchannel.c +++ b/net/mac80211/offchannel.c @@ -162,6 +162,9 @@ void ieee80211_offchannel_return(struct ieee80211_local *local, mutex_lock(&local->iflist_mtx); list_for_each_entry(sdata, &local->interfaces, list) { + if (sdata->vif.type != NL80211_IFTYPE_MONITOR) + clear_bit(SDATA_STATE_OFFCHANNEL, &sdata->state); + if (!ieee80211_sdata_running(sdata)) continue; @@ -173,7 +176,6 @@ void ieee80211_offchannel_return(struct ieee80211_local *local, } if (sdata->vif.type != NL80211_IFTYPE_MONITOR) { - clear_bit(SDATA_STATE_OFFCHANNEL, &sdata->state); /* * This may wake up queues even though the driver * currently has them stopped. This is not very -- cgit v1.2.3 From de2ee84db6a0201278e35590821cd014cb71830a Mon Sep 17 00:00:00 2001 From: Mohammed Shafi Shajakhan Date: Sat, 24 Dec 2011 18:43:28 +0530 Subject: mac80211: fix scan state machine when we run high bandwidth UDP traffic and we trigger a scan, the scan state machine seems to be looping in SUSPEND->RESUME->DECISION->SUSPEND and SET_CHANNEL seems to be never called as 'tx_empty' is never true while running UDP traffic. fix this by settting SET_CHANNEL state when we get into RESUME state. Cc: Leela Kella Signed-off-by: Mohammed Shafi Shajakhan Signed-off-by: John W. Linville --- net/mac80211/scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/mac80211') diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 2c5041cc71f..2908e56eaa9 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c @@ -625,7 +625,7 @@ static void ieee80211_scan_state_resume(struct ieee80211_local *local, local->leave_oper_channel_time = jiffies; /* advance to the next channel to be scanned */ - local->next_scan_state = SCAN_DECISION; + local->next_scan_state = SCAN_SET_CHANNEL; } void ieee80211_scan_work(struct work_struct *work) -- cgit v1.2.3 From e46a2cf9e1dea9267e8a3f5284aea908e5aac5c6 Mon Sep 17 00:00:00 2001 From: Mohammed Shafi Shajakhan Date: Mon, 26 Dec 2011 10:43:29 +0530 Subject: mac80211: fix kernel panic in IBSS due to a regression kernel panic occurs when we create an IBSS mode and leave it for sometime without any joiner and this is introduced by the commit ec2b774e7c91094d8c00de579646f1162b87b01e where we don't put proper braces for 'list_for_each_entry_safe' and we pass an invalid 'sta' pointer to __sta_info_destroy EIP is at __list_add+0xe/0xa0 EAX: f3b63db4 EBX: 00000000 ECX: eab88c1c EDX: 00000000 ESI: 00000000 EDI: 00000246 EBP: f3b63d80 ESP: f3b63d58 DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 Process kworker/u:2 (pid: 198, ti=f3b62000 task=f3afbea0 task.ti=f3b62000) Stack: 00000000 00000000 f9ef9821 00000000 00000000 eab88c30 f3b63d80 c017f623 eab88bf0 eab88bf0 f3b63dd0 c066f925 00000000 00000002 00000000 f9ef9821 f3b63da0 c0180a2b eab88c1c eab88c30 00000002 f3afbea0 eab88bf4 f3b63db4 Call Trace: [] ? __ieee80211_stop_tx_ba_session+0x31/0x60 [mac80211] [] ? debug_mutex_add_waiter+0x23/0x60 [] __mutex_lock_common+0xd5/0x390 [] ? __ieee80211_stop_tx_ba_session+0x31/0x60 [mac80211] [] ? trace_hardirqs_off+0xb/0x10 [] mutex_lock_nested+0x47/0x60 [] ? __ieee80211_stop_tx_ba_session+0x31/0x60 [mac80211] [] __ieee80211_stop_tx_ba_session+0x31/0x60 [mac80211] [] ieee80211_sta_tear_down_BA_sessions+0x39/0x60 [mac80211] [] __sta_info_destroy+0x57/0x780 [mac80211] [] ieee80211_sta_expire+0x93/0xb0 [mac80211] [] ieee80211_ibss_work+0x2d6/0x530 [mac80211] Cc: Marek Lindner Signed-off-by: Mohammed Shafi Shajakhan Signed-off-by: John W. Linville --- net/mac80211/sta_info.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'net/mac80211') diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index f0d3b483dab..b197136aea2 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -945,7 +945,8 @@ void ieee80211_sta_expire(struct ieee80211_sub_if_data *sdata, struct sta_info *sta, *tmp; mutex_lock(&local->sta_mtx); - list_for_each_entry_safe(sta, tmp, &local->sta_list, list) + + list_for_each_entry_safe(sta, tmp, &local->sta_list, list) { if (sdata != sta->sdata) continue; @@ -956,6 +957,8 @@ void ieee80211_sta_expire(struct ieee80211_sub_if_data *sdata, #endif WARN_ON(__sta_info_destroy(sta)); } + } + mutex_unlock(&local->sta_mtx); } -- cgit v1.2.3 From 30fa904724b9c7737264e2eada7f16afc8deee79 Mon Sep 17 00:00:00 2001 From: Mohammed Shafi Shajakhan Date: Tue, 27 Dec 2011 18:54:07 +0530 Subject: mac80211: use RCU read locks for sta_info_get this is being recently introduced by the commit a85e1d55974646a442d95911e3f7d7a891ea9ac5 Cc: Paul Stewart Signed-off-by: Mohammed Shafi Shajakhan Signed-off-by: John W. Linville --- net/mac80211/mlme.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'net/mac80211') diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 57989a046fc..ecb4c84c1bb 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -1385,9 +1385,11 @@ void ieee80211_beacon_connection_loss_work(struct work_struct *work) struct sta_info *sta; if (ifmgd->associated) { + rcu_read_lock(); sta = sta_info_get(sdata, ifmgd->bssid); if (sta) sta->beacon_loss_count++; + rcu_read_unlock(); } if (sdata->local->hw.flags & IEEE80211_HW_CONNECTION_MONITOR) -- cgit v1.2.3 From 7f28197560116f08c4c27342974f9e64cab2cbb1 Mon Sep 17 00:00:00 2001 From: Yogesh Ashok Powar Date: Fri, 30 Dec 2011 16:34:25 +0530 Subject: mac80211: Call driver commands after drv_start in mac80211 restart code Ideally, hardware/firmware initialization is complete after the drv_start routine. In mac80211 restart code (ieee80211_reconfig), defer calling the driver commands i.e. setup fragmentation threshold, rts threshold and coverage class till drv_start routine is called. Signed-off-by: Nishant Sarmukadam Signed-off-by: Yogesh Ashok Powar v2: Removed extra blank line added. Signed-off-by: John W. Linville --- net/mac80211/util.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'net/mac80211') diff --git a/net/mac80211/util.c b/net/mac80211/util.c index eb1a5f737a9..9919892575f 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -1142,16 +1142,6 @@ int ieee80211_reconfig(struct ieee80211_local *local) */ } #endif - - /* setup fragmentation threshold */ - drv_set_frag_threshold(local, hw->wiphy->frag_threshold); - - /* setup RTS threshold */ - drv_set_rts_threshold(local, hw->wiphy->rts_threshold); - - /* reset coverage class */ - drv_set_coverage_class(local, hw->wiphy->coverage_class); - /* everything else happens only if HW was up & running */ if (!local->open_count) goto wake_up; @@ -1170,6 +1160,15 @@ int ieee80211_reconfig(struct ieee80211_local *local) return res; } + /* setup fragmentation threshold */ + drv_set_frag_threshold(local, hw->wiphy->frag_threshold); + + /* setup RTS threshold */ + drv_set_rts_threshold(local, hw->wiphy->rts_threshold); + + /* reset coverage class */ + drv_set_coverage_class(local, hw->wiphy->coverage_class); + ieee80211_led_radio(local, true); ieee80211_mod_tpt_led_trig(local, IEEE80211_TPT_LEDTRIG_FL_RADIO, 0); -- cgit v1.2.3 From 67f61261b6df33a9aee8a6e014b4aef661f1a532 Mon Sep 17 00:00:00 2001 From: Mohammed Shafi Shajakhan Date: Fri, 30 Dec 2011 16:49:01 +0530 Subject: mac80211: remove dead code ieee80211_offchannel_enable_all_ps function is no longer used and looks like its logic is extensively handled in ieee80211_offchannel_stop_vifs Signed-off-by: Mohammed Shafi Shajakhan Signed-off-by: John W. Linville --- net/mac80211/ieee80211_i.h | 2 -- net/mac80211/offchannel.c | 17 ----------------- 2 files changed, 19 deletions(-) (limited to 'net/mac80211') diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index c3f3e431a57..2f0642d9e15 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -1221,8 +1221,6 @@ int ieee80211_request_sched_scan_stop(struct ieee80211_sub_if_data *sdata); void ieee80211_sched_scan_stopped_work(struct work_struct *work); /* off-channel helpers */ -void ieee80211_offchannel_enable_all_ps(struct ieee80211_local *local, - bool tell_ap); void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local, bool offchannel_ps_enable); void ieee80211_offchannel_return(struct ieee80211_local *local, diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c index 2948f8e2e67..f054e94901a 100644 --- a/net/mac80211/offchannel.c +++ b/net/mac80211/offchannel.c @@ -138,23 +138,6 @@ void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local, mutex_unlock(&local->iflist_mtx); } -void ieee80211_offchannel_enable_all_ps(struct ieee80211_local *local, - bool tell_ap) -{ - struct ieee80211_sub_if_data *sdata; - - mutex_lock(&local->iflist_mtx); - list_for_each_entry(sdata, &local->interfaces, list) { - if (!ieee80211_sdata_running(sdata)) - continue; - - if (sdata->vif.type == NL80211_IFTYPE_STATION && - sdata->u.mgd.associated) - ieee80211_offchannel_ps_enable(sdata, tell_ap); - } - mutex_unlock(&local->iflist_mtx); -} - void ieee80211_offchannel_return(struct ieee80211_local *local, bool offchannel_ps_disable) { -- cgit v1.2.3