blob: 310479fc614e34611520f4aba7b8d057426183e9 [file] [log] [blame]
developerc2cfe0f2023-09-22 04:11:09 +08001From c308bd889a207eff9382126f697da59243b593e4 Mon Sep 17 00:00:00 2001
2From: Peter Chiu <chui-hao.chiu@mediatek.com>
3Date: Mon, 24 Jul 2023 16:32:03 +0800
4Subject: [PATCH 11/22] wifi: mt76: mt7996: add IEEE80211_RC_SMPS_CHANGED
5 handler
6
7Send mcu command to firmware to handle smps mode.
8
9Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
10---
11 mt7996/mac.c | 4 +++-
12 mt7996/mcu.c | 8 +++++---
13 mt7996/mt7996.h | 2 ++
14 3 files changed, 10 insertions(+), 4 deletions(-)
15
16diff --git a/mt7996/mac.c b/mt7996/mac.c
17index 38822402b..fd1edf140 100644
18--- a/mt7996/mac.c
19+++ b/mt7996/mac.c
20@@ -2162,7 +2162,9 @@ void mt7996_mac_sta_rc_work(struct work_struct *work)
21 IEEE80211_RC_BW_CHANGED))
22 mt7996_mcu_add_rate_ctrl(dev, vif, sta, true);
23
24- /* TODO: smps change */
25+ if (changed & IEEE80211_RC_SMPS_CHANGED)
26+ mt7996_mcu_set_fixed_field(dev, vif, sta, NULL,
27+ RATE_PARAM_MMPS_UPDATE);
28
29 spin_lock_bh(&dev->mt76.sta_poll_lock);
30 }
31diff --git a/mt7996/mcu.c b/mt7996/mcu.c
32index 653c1d2b7..a5cfd40f9 100644
33--- a/mt7996/mcu.c
34+++ b/mt7996/mcu.c
35@@ -1680,9 +1680,8 @@ int mt7996_mcu_set_fixed_rate_ctrl(struct mt7996_dev *dev,
36 MCU_WM_UNI_CMD(RA), true);
37 }
38
39-static int
40-mt7996_mcu_set_fixed_field(struct mt7996_dev *dev, struct ieee80211_vif *vif,
41- struct ieee80211_sta *sta, void *data, u32 field)
42+int mt7996_mcu_set_fixed_field(struct mt7996_dev *dev, struct ieee80211_vif *vif,
43+ struct ieee80211_sta *sta, void *data, u32 field)
44 {
45 struct mt7996_vif *mvif = (struct mt7996_vif *)vif->drv_priv;
46 struct mt7996_sta *msta = (struct mt7996_sta *)sta->drv_priv;
47@@ -1710,6 +1709,9 @@ mt7996_mcu_set_fixed_field(struct mt7996_dev *dev, struct ieee80211_vif *vif,
48 if (phy)
49 ra->phy = *phy;
50 break;
51+ case RATE_PARAM_MMPS_UPDATE:
52+ ra->mmps_mode = mt7996_mcu_get_mmps_mode(sta->deflink.smps_mode);
53+ break;
54 default:
55 break;
56 }
57diff --git a/mt7996/mt7996.h b/mt7996/mt7996.h
58index 56e2cef1a..890f522d9 100644
59--- a/mt7996/mt7996.h
60+++ b/mt7996/mt7996.h
61@@ -397,6 +397,8 @@ int mt7996_mcu_add_obss_spr(struct mt7996_phy *phy, struct ieee80211_vif *vif,
62 int mt7996_mcu_add_rate_ctrl(struct mt7996_dev *dev, struct ieee80211_vif *vif,
63 struct ieee80211_sta *sta, bool changed);
64 int mt7996_set_channel(struct mt7996_phy *phy);
65+int mt7996_mcu_set_fixed_field(struct mt7996_dev *dev, struct ieee80211_vif *vif,
66+ struct ieee80211_sta *sta, void *data, u32 field);
67 int mt7996_mcu_set_chan_info(struct mt7996_phy *phy, u16 tag);
68 int mt7996_mcu_set_tx(struct mt7996_dev *dev, struct ieee80211_vif *vif);
69 int mt7996_mcu_set_fixed_rate_ctrl(struct mt7996_dev *dev,
70--
712.39.2
72