developer | 3e4199d | 2022-10-19 14:18:06 +0800 | [diff] [blame] | 1 | From ae8bd933a1ef1499863dbb8313a61375b7d00c11 Mon Sep 17 00:00:00 2001 |
| 2 | From: TomLiu <tomml.liu@mediatek.com> |
| 3 | Date: Wed, 19 Oct 2022 13:33:02 +0800 |
| 4 | Subject: [PATCH 900/914] mac80211: export del all station for ampdu amsdu on |
| 5 | off function |
| 6 | |
| 7 | Signed-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 | |
| 14 | diff --git a/include/net/mac80211.h b/include/net/mac80211.h |
| 15 | index 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, |
developer | 5a71084 | 2022-09-21 16:07:09 -0700 | [diff] [blame] | 19 | } |
| 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 | * |
developer | 3e4199d | 2022-10-19 14:18:06 +0800 | [diff] [blame] | 32 | @@ -5056,6 +5063,12 @@ void ieee80211_beacon_set_cntdwn(struct ieee80211_vif *vif, u8 counter); |
| 33 | */ |
developer | 5a71084 | 2022-09-21 16:07:09 -0700 | [diff] [blame] | 34 | void ieee80211_csa_finish(struct ieee80211_vif *vif); |
| 35 | |
developer | 3e4199d | 2022-10-19 14:18:06 +0800 | [diff] [blame] | 36 | +/** |
developer | 5a71084 | 2022-09-21 16:07:09 -0700 | [diff] [blame] | 37 | + * 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 | + |
developer | 3e4199d | 2022-10-19 14:18:06 +0800 | [diff] [blame] | 42 | /** |
developer | 5a71084 | 2022-09-21 16:07:09 -0700 | [diff] [blame] | 43 | * ieee80211_beacon_cntdwn_is_complete - find out if countdown reached 1 |
| 44 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
developer | 3e4199d | 2022-10-19 14:18:06 +0800 | [diff] [blame] | 45 | diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c |
| 46 | index 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, |
developer | 5a71084 | 2022-09-21 16:07:09 -0700 | [diff] [blame] | 50 | 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) |
developer | 3e4199d | 2022-10-19 14:18:06 +0800 | [diff] [blame] | 69 | diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c |
| 70 | index 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) |
developer | 5a71084 | 2022-09-21 16:07:09 -0700 | [diff] [blame] | 74 | } |
| 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); |
developer | 3e4199d | 2022-10-19 14:18:06 +0800 | [diff] [blame] | 83 | -- |
| 84 | 2.18.0 |
| 85 | |