| From ee2e6d4d137cadf56c1c102d73761f76fd97a6ea Mon Sep 17 00:00:00 2001 |
| From: Howard Hsu <howard-yh.hsu@mediatek.com> |
| Date: Fri, 22 Sep 2023 10:32:37 +0800 |
| Subject: [PATCH 29/98] wifi: mt76: mt7996: add preamble puncture support for |
| mt7996 |
| |
| Add support configure preamble puncture feature through mcu commands. |
| |
| Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com> |
| --- |
| mt76_connac_mcu.h | 1 + |
| mt7996/mcu.c | 30 ++++++++++++++++++++++++++++++ |
| mt7996/mcu.h | 4 ++++ |
| mt7996/mt7996.h | 2 ++ |
| 4 files changed, 37 insertions(+) |
| |
| diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h |
| index 8562ca4..6fac67b 100644 |
| --- a/mt76_connac_mcu.h |
| +++ b/mt76_connac_mcu.h |
| @@ -1241,6 +1241,7 @@ enum { |
| MCU_UNI_CMD_CHANNEL_SWITCH = 0x34, |
| MCU_UNI_CMD_THERMAL = 0x35, |
| MCU_UNI_CMD_VOW = 0x37, |
| + MCU_UNI_CMD_PP = 0x38, |
| MCU_UNI_CMD_FIXED_RATE_TABLE = 0x40, |
| MCU_UNI_CMD_RRO = 0x57, |
| MCU_UNI_CMD_OFFCH_SCAN_CTRL = 0x58, |
| diff --git a/mt7996/mcu.c b/mt7996/mcu.c |
| index 39f76a0..60af1d4 100644 |
| --- a/mt7996/mcu.c |
| +++ b/mt7996/mcu.c |
| @@ -4308,3 +4308,33 @@ int mt7996_mcu_get_all_sta_info(struct mt7996_phy *phy, u16 tag) |
| return mt76_mcu_send_msg(&dev->mt76, MCU_WM_UNI_CMD(ALL_STA_INFO), |
| &req, sizeof(req), false); |
| } |
| + |
| +int mt7996_mcu_set_pp_en(struct mt7996_phy *phy, bool auto_mode, |
| + u8 force_bitmap_ctrl, u16 bitmap) |
| +{ |
| + struct mt7996_dev *dev = phy->dev; |
| + struct { |
| + u8 _rsv[4]; |
| + |
| + __le16 tag; |
| + __le16 len; |
| + bool mgmt_mode; |
| + u8 band_idx; |
| + u8 force_bitmap_ctrl; |
| + bool auto_mode; |
| + __le16 bitmap; |
| + u8 _rsv2[2]; |
| + } __packed req = { |
| + .tag = cpu_to_le16(UNI_CMD_PP_EN_CTRL), |
| + .len = cpu_to_le16(sizeof(req) - 4), |
| + |
| + .mgmt_mode = !auto_mode, |
| + .band_idx = phy->mt76->band_idx, |
| + .force_bitmap_ctrl = force_bitmap_ctrl, |
| + .auto_mode = auto_mode, |
| + .bitmap = cpu_to_le16(bitmap), |
| + }; |
| + |
| + return mt76_mcu_send_msg(&dev->mt76, MCU_WM_UNI_CMD(PP), |
| + &req, sizeof(req), false); |
| +} |
| diff --git a/mt7996/mcu.h b/mt7996/mcu.h |
| index 376931e..296acbd 100644 |
| --- a/mt7996/mcu.h |
| +++ b/mt7996/mcu.h |
| @@ -845,6 +845,10 @@ enum { |
| MT7996_SEC_MODE_MAX, |
| }; |
| |
| +enum { |
| + UNI_CMD_PP_EN_CTRL, |
| +}; |
| + |
| #define MT7996_PATCH_SEC GENMASK(31, 24) |
| #define MT7996_PATCH_SCRAMBLE_KEY GENMASK(15, 8) |
| #define MT7996_PATCH_AES_KEY GENMASK(7, 0) |
| diff --git a/mt7996/mt7996.h b/mt7996/mt7996.h |
| index 31fa2b5..c4d74a0 100644 |
| --- a/mt7996/mt7996.h |
| +++ b/mt7996/mt7996.h |
| @@ -598,6 +598,8 @@ int mt7996_mcu_add_key(struct mt76_dev *dev, struct ieee80211_vif *vif, |
| int mt7996_mcu_wtbl_update_hdr_trans(struct mt7996_dev *dev, |
| struct ieee80211_vif *vif, |
| struct ieee80211_sta *sta); |
| +int mt7996_mcu_set_pp_en(struct mt7996_phy *phy, bool auto_mode, u8 force_bitmap, |
| + u16 bitmap); |
| #ifdef CONFIG_MAC80211_DEBUGFS |
| void mt7996_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
| struct ieee80211_sta *sta, struct dentry *dir); |
| -- |
| 2.18.0 |
| |