developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 1 | From d5a9af18ab8f2c8c6a46c10ef99f2a50e08ae9c3 Mon Sep 17 00:00:00 2001 |
developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame] | 2 | From: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 3 | Date: Thu, 16 Nov 2023 14:41:54 +0800 |
developer | a20cdc2 | 2024-05-31 18:57:31 +0800 | [diff] [blame] | 4 | Subject: [PATCH 07/21] wifi: mt76: mt7915: add post channel switch for DFS |
developer | 753619c | 2024-02-22 13:42:45 +0800 | [diff] [blame] | 5 | channel switching |
developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame] | 6 | |
| 7 | Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 8 | --- |
| 9 | mt7915/main.c | 22 ++++++++++++++++++++++ |
| 10 | 1 file changed, 22 insertions(+) |
| 11 | |
| 12 | diff --git a/mt7915/main.c b/mt7915/main.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 13 | index ec2360c3..0d24e74c 100644 |
developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame] | 14 | --- a/mt7915/main.c |
| 15 | +++ b/mt7915/main.c |
| 16 | @@ -736,6 +736,27 @@ mt7915_channel_switch_beacon(struct ieee80211_hw *hw, |
| 17 | mutex_unlock(&dev->mt76.mutex); |
| 18 | } |
| 19 | |
| 20 | +static int |
| 21 | +mt7915_post_channel_switch(struct ieee80211_hw *hw, struct ieee80211_vif *vif) |
| 22 | +{ |
| 23 | + struct mt7915_phy *phy = mt7915_hw_phy(hw); |
| 24 | + struct cfg80211_chan_def *chandef = &phy->mt76->chandef; |
| 25 | + int ret; |
| 26 | + |
| 27 | + ret = cfg80211_chandef_dfs_required(hw->wiphy, chandef, NL80211_IFTYPE_AP); |
| 28 | + if (ret <= 0) |
| 29 | + goto out; |
| 30 | + |
| 31 | + ieee80211_stop_queues(hw); |
| 32 | + ret = mt7915_set_channel(phy); |
| 33 | + if (ret) |
| 34 | + goto out; |
| 35 | + ieee80211_wake_queues(hw); |
| 36 | + |
| 37 | +out: |
| 38 | + return ret; |
| 39 | +} |
| 40 | + |
| 41 | int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif, |
| 42 | struct ieee80211_sta *sta) |
| 43 | { |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 44 | @@ -1705,6 +1726,7 @@ const struct ieee80211_ops mt7915_ops = { |
developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame] | 45 | .get_txpower = mt76_get_txpower, |
| 46 | .set_sar_specs = mt7915_set_sar_specs, |
| 47 | .channel_switch_beacon = mt7915_channel_switch_beacon, |
| 48 | + .post_channel_switch = mt7915_post_channel_switch, |
| 49 | .get_stats = mt7915_get_stats, |
| 50 | .get_et_sset_count = mt7915_get_et_sset_count, |
| 51 | .get_et_stats = mt7915_get_et_stats, |
| 52 | -- |
| 53 | 2.18.0 |
| 54 | |