developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 1 | From 1d18008ab9d67f318932ed993103bd46d9f0215d Mon Sep 17 00:00:00 2001 |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 2 | From: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 3 | Date: Thu, 21 Mar 2024 16:52:34 +0800 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 4 | Subject: [PATCH 1051/1052] wifi: mt76: mt7915: set channel after sta is |
developer | dc9eeae | 2024-04-08 14:36:46 +0800 | [diff] [blame] | 5 | associated to adjust switch reason |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 6 | |
| 7 | when sta is associated to AP operating in DFS channel, a channel |
| 8 | setting operation is required to change the channel switch reason |
| 9 | from CH_SWTICH_DFS to CH_SWITCH_NORMAL. |
| 10 | Note that the switch reason for DFS channel during authentication is |
| 11 | CH_SWITCH_DFS since the DFS state is still USABLE at that point |
| 12 | |
| 13 | Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 14 | --- |
| 15 | mt7915/main.c | 26 ++++++++++++++++++++++++++ |
| 16 | 1 file changed, 26 insertions(+) |
| 17 | |
| 18 | diff --git a/mt7915/main.c b/mt7915/main.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 19 | index 04301300..eab45737 100644 |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 20 | --- a/mt7915/main.c |
| 21 | +++ b/mt7915/main.c |
developer | a20cdc2 | 2024-05-31 18:57:31 +0800 | [diff] [blame] | 22 | @@ -794,6 +794,31 @@ out: |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 23 | return ret; |
| 24 | } |
| 25 | |
| 26 | +static void |
| 27 | +mt7915_event_callback(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
| 28 | + const struct ieee80211_event *event) |
| 29 | +{ |
| 30 | + struct mt7915_phy *phy = mt7915_hw_phy(hw); |
| 31 | + int ret; |
| 32 | + |
| 33 | + switch (event->type) { |
| 34 | + case MLME_EVENT: |
| 35 | + if (event->u.mlme.data == ASSOC_EVENT && |
| 36 | + event->u.mlme.status == MLME_SUCCESS) { |
| 37 | + ieee80211_stop_queues(hw); |
| 38 | + ret = mt7915_set_channel(phy); |
| 39 | + if (ret) |
| 40 | + return; |
| 41 | + ieee80211_wake_queues(hw); |
| 42 | + } |
| 43 | + break; |
| 44 | + default: |
| 45 | + break; |
| 46 | + } |
| 47 | + |
| 48 | + return; |
| 49 | +} |
| 50 | + |
| 51 | int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif, |
| 52 | struct ieee80211_sta *sta) |
| 53 | { |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 54 | @@ -1835,6 +1860,7 @@ const struct ieee80211_ops mt7915_ops = { |
developer | a46f613 | 2024-03-26 14:09:54 +0800 | [diff] [blame] | 55 | .set_sar_specs = mt7915_set_sar_specs, |
| 56 | .channel_switch_beacon = mt7915_channel_switch_beacon, |
| 57 | .post_channel_switch = mt7915_post_channel_switch, |
| 58 | + .event_callback = mt7915_event_callback, |
| 59 | .get_stats = mt7915_get_stats, |
| 60 | .get_et_sset_count = mt7915_get_et_sset_count, |
| 61 | .get_et_stats = mt7915_get_et_stats, |
| 62 | -- |
| 63 | 2.18.0 |
| 64 | |