developer | 7e2761e | 2023-10-12 08:11:13 +0800 | [diff] [blame] | 1 | From 2d7f3506aa6759fa1a7667d53bf88eb543035c33 Mon Sep 17 00:00:00 2001 |
developer | c2cfe0f | 2023-09-22 04:11:09 +0800 | [diff] [blame] | 2 | From: Peter Chiu <chui-hao.chiu@mediatek.com> |
| 3 | Date: Mon, 24 Jul 2023 16:32:03 +0800 |
developer | 7e2761e | 2023-10-12 08:11:13 +0800 | [diff] [blame] | 4 | Subject: [PATCH 12/98] wifi: mt76: mt7996: add IEEE80211_RC_SMPS_CHANGED |
developer | c2cfe0f | 2023-09-22 04:11:09 +0800 | [diff] [blame] | 5 | handler |
| 6 | |
| 7 | Send mcu command to firmware to handle smps mode. |
| 8 | |
| 9 | Signed-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 | |
| 16 | diff --git a/mt7996/mac.c b/mt7996/mac.c |
developer | 7e2761e | 2023-10-12 08:11:13 +0800 | [diff] [blame] | 17 | index 2c6bee4..ccb7b22 100644 |
developer | c2cfe0f | 2023-09-22 04:11:09 +0800 | [diff] [blame] | 18 | --- a/mt7996/mac.c |
| 19 | +++ b/mt7996/mac.c |
developer | 7e2761e | 2023-10-12 08:11:13 +0800 | [diff] [blame] | 20 | @@ -2222,7 +2222,9 @@ void mt7996_mac_sta_rc_work(struct work_struct *work) |
developer | c2cfe0f | 2023-09-22 04:11:09 +0800 | [diff] [blame] | 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 | } |
| 31 | diff --git a/mt7996/mcu.c b/mt7996/mcu.c |
developer | 7e2761e | 2023-10-12 08:11:13 +0800 | [diff] [blame] | 32 | index dbb3ceb..18c3f34 100644 |
developer | c2cfe0f | 2023-09-22 04:11:09 +0800 | [diff] [blame] | 33 | --- a/mt7996/mcu.c |
| 34 | +++ b/mt7996/mcu.c |
developer | 7e2761e | 2023-10-12 08:11:13 +0800 | [diff] [blame] | 35 | @@ -1679,9 +1679,8 @@ int mt7996_mcu_set_fixed_rate_ctrl(struct mt7996_dev *dev, |
developer | c2cfe0f | 2023-09-22 04:11:09 +0800 | [diff] [blame] | 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; |
developer | 7e2761e | 2023-10-12 08:11:13 +0800 | [diff] [blame] | 47 | @@ -1709,6 +1708,9 @@ mt7996_mcu_set_fixed_field(struct mt7996_dev *dev, struct ieee80211_vif *vif, |
developer | c2cfe0f | 2023-09-22 04:11:09 +0800 | [diff] [blame] | 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 | } |
| 57 | diff --git a/mt7996/mt7996.h b/mt7996/mt7996.h |
developer | 7e2761e | 2023-10-12 08:11:13 +0800 | [diff] [blame] | 58 | index 21ad51d..c8e7a33 100644 |
developer | c2cfe0f | 2023-09-22 04:11:09 +0800 | [diff] [blame] | 59 | --- a/mt7996/mt7996.h |
| 60 | +++ b/mt7996/mt7996.h |
developer | 7e2761e | 2023-10-12 08:11:13 +0800 | [diff] [blame] | 61 | @@ -451,6 +451,8 @@ int mt7996_mcu_add_obss_spr(struct mt7996_phy *phy, struct ieee80211_vif *vif, |
developer | c2cfe0f | 2023-09-22 04:11:09 +0800 | [diff] [blame] | 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 | -- |
developer | 7e2761e | 2023-10-12 08:11:13 +0800 | [diff] [blame] | 71 | 2.18.0 |
developer | c2cfe0f | 2023-09-22 04:11:09 +0800 | [diff] [blame] | 72 | |