mt76: mt7921: fix command timeout in AP stop period
Subsystems (2)
PATCH 1/1 mt76: mt7921: fix command timeout in AP stop period
From: Deren Wu <[email protected]>
commit 9d958b60ebc2434f2b7eae83d77849e22d1059eb upstream.
Due to AP stop improperly, mt7921 driver would face random command timeout by chip fw problem. Migrate AP start/stop process to .start_ap/.stop_ap and congiure BSS network settings in both hooks.
The new flow is shown below.
* AP start
.start_ap()
configure BSS network resource
set BSS to connected state
.bss_info_changed()
enable fw beacon offload
* AP stop
.bss_info_changed()
disable fw beacon offload (skip this command)
.stop_ap()
set BSS to disconnected state (beacon offload disabled automatically) destroy BSS network resource
--- .../wireless/mediatek/mt76/mt76_connac_mcu.c | 2 + .../net/wireless/mediatek/mt76/mt7921/main.c | 47 +++++++++++++++---- .../net/wireless/mediatek/mt76/mt7921/mcu.c | 5 +- .../wireless/mediatek/mt76/mt7921/mt7921.h | 2 + 4 files changed, 43 insertions(+), 13 deletions(-)
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +2 -0
@@ -1403,6 +1403,8 @@ int mt76_connac_mcu_uni_add_bss(struct mt76_phy *phy,else conn_type =CONNECTION_INFRA_AP ; basic_req.basic.conn_type =cpu_to_le32 (conn_type); +/* Fully active/deactivate BSS network in AP mode only */ + basic_req.basic.active = enable;break ;case NL80211_IFTYPE_STATION :if (vif->p2p)
drivers/net/wireless/mediatek/mt76/mt7921/main.c +38 -9
65 lines not on this page · raw message
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c +1 -4
@@ -1020,7 +1020,7 @@ mt7921_mcu_uni_bss_bcnft(struct mt7921_dev *dev, struct ieee80211_vif *vif, &bcnft_req, sizeof(bcnft_req), true); } -static int +int mt7921_mcu_set_bss_pm (struct mt7921_dev *dev,struct ieee80211_vif *vif,bool enable) {
@@ -1049,9 +1049,6 @@ mt7921_mcu_set_bss_pm(struct mt7921_dev *dev, struct ieee80211_vif *vif, };int err; -if (vif->type !=NL80211_IFTYPE_STATION ) -return 0 ; - err =mt76_mcu_send_msg (&dev->mt76,MCU_CE_CMD (SET_BSS_ABORT ), &req_hdr,sizeof (req_hdr), false);if (err <0 || !enable)
drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h +2 -0
@@ -280,6 +280,8 @@ int mt7921_wpdma_reset(struct mt7921_dev *dev, bool force);int mt7921_wpdma_reinit_cond (struct mt7921_dev *dev);void mt7921_dma_cleanup (struct mt7921_dev *dev);int mt7921_run_firmware (struct mt7921_dev *dev); +int mt7921_mcu_set_bss_pm (struct mt7921_dev *dev,struct ieee80211_vif *vif, +bool enable);int mt7921_mcu_sta_update (struct mt7921_dev *dev,struct ieee80211_sta *sta,struct ieee80211_vif *vif,bool enable,enum mt76_sta_info_state state);
Signature · 1 line
2.25.1
Greg KH
maintainerQuoted 27 lines · On Thu, Aug 25, 2022 at 11:27:22AM +0800, [email protected] wrote:
From: Deren Wu <[email protected]>
commit
9d958b60ebc2434f2b7eae83d77849e22d1059ebupstream.Due to AP stop improperly, mt7921 driver would face random command timeout by chip fw problem. Migrate AP start/stop process to .start_ap/.stop_ap and congiure BSS network settings in both hooks.
The new flow is shown below.
* AP start
.start_ap()
configure BSS network resource
set BSS to connected state
.bss_info_changed()
enable fw beacon offload* AP stop
.bss_info_changed()
disable fw beacon offload (skip this command)
.stop_ap()
set BSS to disconnected state (beacon offload disabled automatically) destroy BSS network resourceFixes 116c69603b01 ("mt76: mt7921: Add AP mode support")Signed-off-by Sean Wang <[email protected]>Signed-off-by Deren Wu <[email protected]>Signed-off-by Felix Fietkau <[email protected]>
Quoted 6 lines
--- .../wireless/mediatek/mt76/mt76_connac_mcu.c | 2 + .../net/wireless/mediatek/mt76/mt7921/main.c | 47 +++++++++++++++---- .../net/wireless/mediatek/mt76/mt7921/mcu.c | 5 +- .../wireless/mediatek/mt76/mt7921/mt7921.h | 2 + 4 files changed, 43 insertions(+), 13 deletions(-)
Now queued up, thanks,
greg k-h