developer | de9ecce | 2023-05-22 11:17:16 +0800 | [diff] [blame] | 1 | From 1a55033a534847f9c10ffd52e277378c1ba3e45a Mon Sep 17 00:00:00 2001 |
developer | 483388c | 2023-03-08 13:52:15 +0800 | [diff] [blame] | 2 | From: Shayne Chen <shayne.chen@mediatek.com> |
| 3 | Date: Thu, 16 Feb 2023 00:39:01 +0800 |
developer | de9ecce | 2023-05-22 11:17:16 +0800 | [diff] [blame] | 4 | Subject: [PATCH 02/22] wifi: mt76: mt7996: reduce repeated bss_info and |
developer | 483388c | 2023-03-08 13:52:15 +0800 | [diff] [blame] | 5 | sta_rec commands |
| 6 | |
| 7 | Refine the flow of setting bss_info and sta_rec commands to prevent from |
| 8 | sending duplicated commands, especially for station mode. |
| 9 | |
| 10 | Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> |
| 11 | Change-Id: Iffd2c81f9ec98284793e75f4b7d39e9618977024 |
| 12 | --- |
| 13 | mt7996/main.c | 21 ++++++--------------- |
| 14 | 1 file changed, 6 insertions(+), 15 deletions(-) |
| 15 | |
| 16 | diff --git a/mt7996/main.c b/mt7996/main.c |
developer | de9ecce | 2023-05-22 11:17:16 +0800 | [diff] [blame] | 17 | index f306e9c5..136a0c28 100644 |
developer | 483388c | 2023-03-08 13:52:15 +0800 | [diff] [blame] | 18 | --- a/mt7996/main.c |
| 19 | +++ b/mt7996/main.c |
developer | de9ecce | 2023-05-22 11:17:16 +0800 | [diff] [blame] | 20 | @@ -246,8 +246,8 @@ static void mt7996_remove_interface(struct ieee80211_hw *hw, |
developer | 483388c | 2023-03-08 13:52:15 +0800 | [diff] [blame] | 21 | struct mt7996_phy *phy = mt7996_hw_phy(hw); |
| 22 | int idx = msta->wcid.idx; |
| 23 | |
| 24 | - mt7996_mcu_add_bss_info(phy, vif, false); |
| 25 | mt7996_mcu_add_sta(dev, vif, NULL, false); |
| 26 | + mt7996_mcu_add_bss_info(phy, vif, false); |
| 27 | |
| 28 | if (vif == phy->monitor_vif) |
| 29 | phy->monitor_vif = NULL; |
developer | de9ecce | 2023-05-22 11:17:16 +0800 | [diff] [blame] | 30 | @@ -544,17 +544,13 @@ static void mt7996_bss_info_changed(struct ieee80211_hw *hw, |
developer | 483388c | 2023-03-08 13:52:15 +0800 | [diff] [blame] | 31 | /* station mode uses BSSID to map the wlan entry to a peer, |
| 32 | * and then peer references bss_info_rfch to set bandwidth cap. |
| 33 | */ |
| 34 | - if (changed & BSS_CHANGED_BSSID && |
| 35 | - vif->type == NL80211_IFTYPE_STATION) { |
| 36 | - bool join = !is_zero_ether_addr(info->bssid); |
| 37 | - |
| 38 | - mt7996_mcu_add_bss_info(phy, vif, join); |
| 39 | - mt7996_mcu_add_sta(dev, vif, NULL, join); |
| 40 | + if ((changed & BSS_CHANGED_BSSID && !is_zero_ether_addr(info->bssid)) || |
| 41 | + (changed & BSS_CHANGED_ASSOC && vif->cfg.assoc) || |
| 42 | + (changed & BSS_CHANGED_BEACON_ENABLED && info->enable_beacon)) { |
| 43 | + mt7996_mcu_add_bss_info(phy, vif, true); |
| 44 | + mt7996_mcu_add_sta(dev, vif, NULL, true); |
| 45 | } |
| 46 | |
| 47 | - if (changed & BSS_CHANGED_ASSOC) |
| 48 | - mt7996_mcu_add_bss_info(phy, vif, vif->cfg.assoc); |
| 49 | - |
| 50 | if (changed & BSS_CHANGED_ERP_CTS_PROT) |
| 51 | mt7996_mac_enable_rtscts(dev, vif, info->use_cts_prot); |
| 52 | |
developer | de9ecce | 2023-05-22 11:17:16 +0800 | [diff] [blame] | 53 | @@ -575,11 +571,6 @@ static void mt7996_bss_info_changed(struct ieee80211_hw *hw, |
| 54 | mvif->basic_rates_idx = |
| 55 | mt7996_get_rates_table(hw, vif, false, false); |
developer | 483388c | 2023-03-08 13:52:15 +0800 | [diff] [blame] | 56 | |
| 57 | - if (changed & BSS_CHANGED_BEACON_ENABLED && info->enable_beacon) { |
| 58 | - mt7996_mcu_add_bss_info(phy, vif, true); |
| 59 | - mt7996_mcu_add_sta(dev, vif, NULL, true); |
| 60 | - } |
| 61 | - |
| 62 | /* ensure that enable txcmd_mode after bss_info */ |
| 63 | if (changed & (BSS_CHANGED_QOS | BSS_CHANGED_BEACON_ENABLED)) |
| 64 | mt7996_mcu_set_tx(dev, vif); |
| 65 | -- |
developer | de9ecce | 2023-05-22 11:17:16 +0800 | [diff] [blame] | 66 | 2.39.2 |
developer | 483388c | 2023-03-08 13:52:15 +0800 | [diff] [blame] | 67 | |