blob: 388d9cbedd2cc9a5bdfc89d740234c8fb97555c7 [file] [log] [blame]
developer3e4199d2022-10-19 14:18:06 +08001From ae8bd933a1ef1499863dbb8313a61375b7d00c11 Mon Sep 17 00:00:00 2001
2From: TomLiu <tomml.liu@mediatek.com>
3Date: Wed, 19 Oct 2022 13:33:02 +0800
4Subject: [PATCH 900/914] mac80211: export del all station for ampdu amsdu on
5 off function
6
7Signed-off-by: TomLiu <tomml.liu@mediatek.com>
8---
9 include/net/mac80211.h | 13 +++++++++++++
10 net/mac80211/cfg.c | 13 +++++++++++++
11 net/mac80211/sta_info.c | 3 ++-
12 3 files changed, 28 insertions(+), 1 deletion(-)
13
14diff --git a/include/net/mac80211.h b/include/net/mac80211.h
15index c85050f..edcad3b 100644
16--- a/include/net/mac80211.h
17+++ b/include/net/mac80211.h
18@@ -2662,6 +2662,13 @@ static inline void _ieee80211_hw_set(struct ieee80211_hw *hw,
developer5a710842022-09-21 16:07:09 -070019 }
20 #define ieee80211_hw_set(hw, flg) _ieee80211_hw_set(hw, IEEE80211_HW_##flg)
21
22+static inline void _ieee80211_hw_clear(struct ieee80211_hw *hw,
23+ enum ieee80211_hw_flags flg)
24+{
25+ return __clear_bit(flg, hw->flags);
26+}
27+#define ieee80211_hw_clear(hw, flg) _ieee80211_hw_clear(hw, IEEE80211_HW_##flg)
28+
29 /**
30 * struct ieee80211_scan_request - hw scan request
31 *
developer3e4199d2022-10-19 14:18:06 +080032@@ -5056,6 +5063,12 @@ void ieee80211_beacon_set_cntdwn(struct ieee80211_vif *vif, u8 counter);
33 */
developer5a710842022-09-21 16:07:09 -070034 void ieee80211_csa_finish(struct ieee80211_vif *vif);
35
developer3e4199d2022-10-19 14:18:06 +080036+/**
developer5a710842022-09-21 16:07:09 -070037+ * ieee80211_del_all_station - request mac80211 to delete all stations
38+ * @hw: pointer obtained from ieee80211_alloc_hw().
39+ */
40+void ieee80211_del_all_station(struct ieee80211_hw *hw);
41+
developer3e4199d2022-10-19 14:18:06 +080042 /**
developer5a710842022-09-21 16:07:09 -070043 * ieee80211_beacon_cntdwn_is_complete - find out if countdown reached 1
44 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
developer3e4199d2022-10-19 14:18:06 +080045diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
46index abe7318..b582730 100644
47--- a/net/mac80211/cfg.c
48+++ b/net/mac80211/cfg.c
49@@ -1822,6 +1822,19 @@ static int ieee80211_del_station(struct wiphy *wiphy, struct net_device *dev,
developer5a710842022-09-21 16:07:09 -070050 return 0;
51 }
52
53+void ieee80211_del_all_station(struct ieee80211_hw *hw)
54+{
55+ struct ieee80211_local *local = hw_to_local(hw);
56+ struct sta_info *sta, *tmp;
57+
58+ mutex_lock(&local->sta_mtx);
59+ list_for_each_entry_safe(sta, tmp, &local->sta_list, list) {
60+ WARN_ON(__sta_info_destroy(sta));
61+ }
62+ mutex_unlock(&local->sta_mtx);
63+}
64+EXPORT_SYMBOL(ieee80211_del_all_station);
65+
66 static int ieee80211_change_station(struct wiphy *wiphy,
67 struct net_device *dev, const u8 *mac,
68 struct station_parameters *params)
developer3e4199d2022-10-19 14:18:06 +080069diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
70index 541c769..a703e83 100644
71--- a/net/mac80211/sta_info.c
72+++ b/net/mac80211/sta_info.c
73@@ -683,7 +683,8 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU)
developer5a710842022-09-21 16:07:09 -070074 }
75
76 /* accept BA sessions now */
77- clear_sta_flag(sta, WLAN_STA_BLOCK_BA);
78+ if (ieee80211_hw_check(&local->hw, AMPDU_AGGREGATION))
79+ clear_sta_flag(sta, WLAN_STA_BLOCK_BA);
80
81 ieee80211_sta_debugfs_add(sta);
82 rate_control_add_sta_debugfs(sta);
developer3e4199d2022-10-19 14:18:06 +080083--
842.18.0
85