developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame^] | 1 | From d83b800e9615b4d861fd79c5f71e26cd8d0c4141 Mon Sep 17 00:00:00 2001 |
developer | bd9fa1e | 2023-10-16 11:04:00 +0800 | [diff] [blame] | 2 | From: Howard Hsu <howard-yh.hsu@mediatek.com> |
| 3 | Date: Fri, 22 Sep 2023 10:32:37 +0800 |
developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame^] | 4 | Subject: [PATCH 23/23] mtk: wifi: mt76: mt7996: add preamble puncture support |
| 5 | for mt7996 |
developer | bd9fa1e | 2023-10-16 11:04:00 +0800 | [diff] [blame] | 6 | |
| 7 | Add support configure preamble puncture feature through mcu commands. |
| 8 | |
| 9 | Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com> |
| 10 | --- |
| 11 | mt76_connac_mcu.h | 1 + |
| 12 | mt7996/mcu.c | 30 ++++++++++++++++++++++++++++++ |
| 13 | mt7996/mcu.h | 4 ++++ |
| 14 | mt7996/mt7996.h | 2 ++ |
| 15 | 4 files changed, 37 insertions(+) |
| 16 | |
| 17 | diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h |
developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame^] | 18 | index 84e77fa0..823b3626 100644 |
developer | bd9fa1e | 2023-10-16 11:04:00 +0800 | [diff] [blame] | 19 | --- a/mt76_connac_mcu.h |
| 20 | +++ b/mt76_connac_mcu.h |
developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame^] | 21 | @@ -1259,6 +1259,7 @@ enum { |
developer | bd9fa1e | 2023-10-16 11:04:00 +0800 | [diff] [blame] | 22 | MCU_UNI_CMD_CHANNEL_SWITCH = 0x34, |
| 23 | MCU_UNI_CMD_THERMAL = 0x35, |
| 24 | MCU_UNI_CMD_VOW = 0x37, |
| 25 | + MCU_UNI_CMD_PP = 0x38, |
| 26 | MCU_UNI_CMD_FIXED_RATE_TABLE = 0x40, |
| 27 | MCU_UNI_CMD_RRO = 0x57, |
| 28 | MCU_UNI_CMD_OFFCH_SCAN_CTRL = 0x58, |
| 29 | diff --git a/mt7996/mcu.c b/mt7996/mcu.c |
developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame^] | 30 | index 475a5e18..deabdb1f 100644 |
developer | bd9fa1e | 2023-10-16 11:04:00 +0800 | [diff] [blame] | 31 | --- a/mt7996/mcu.c |
| 32 | +++ b/mt7996/mcu.c |
developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame^] | 33 | @@ -4534,3 +4534,33 @@ int mt7996_mcu_set_txpower_sku(struct mt7996_phy *phy) |
| 34 | return mt76_mcu_skb_send_msg(&dev->mt76, skb, |
| 35 | MCU_WM_UNI_CMD(TXPOWER), true); |
developer | bd9fa1e | 2023-10-16 11:04:00 +0800 | [diff] [blame] | 36 | } |
| 37 | + |
| 38 | +int mt7996_mcu_set_pp_en(struct mt7996_phy *phy, bool auto_mode, |
| 39 | + u8 force_bitmap_ctrl, u16 bitmap) |
| 40 | +{ |
| 41 | + struct mt7996_dev *dev = phy->dev; |
| 42 | + struct { |
| 43 | + u8 _rsv[4]; |
| 44 | + |
| 45 | + __le16 tag; |
| 46 | + __le16 len; |
| 47 | + bool mgmt_mode; |
| 48 | + u8 band_idx; |
| 49 | + u8 force_bitmap_ctrl; |
| 50 | + bool auto_mode; |
| 51 | + __le16 bitmap; |
| 52 | + u8 _rsv2[2]; |
| 53 | + } __packed req = { |
| 54 | + .tag = cpu_to_le16(UNI_CMD_PP_EN_CTRL), |
| 55 | + .len = cpu_to_le16(sizeof(req) - 4), |
| 56 | + |
| 57 | + .mgmt_mode = !auto_mode, |
| 58 | + .band_idx = phy->mt76->band_idx, |
| 59 | + .force_bitmap_ctrl = force_bitmap_ctrl, |
| 60 | + .auto_mode = auto_mode, |
| 61 | + .bitmap = cpu_to_le16(bitmap), |
| 62 | + }; |
| 63 | + |
| 64 | + return mt76_mcu_send_msg(&dev->mt76, MCU_WM_UNI_CMD(PP), |
| 65 | + &req, sizeof(req), false); |
| 66 | +} |
| 67 | diff --git a/mt7996/mcu.h b/mt7996/mcu.h |
developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame^] | 68 | index a9ba63d1..238c4c53 100644 |
developer | bd9fa1e | 2023-10-16 11:04:00 +0800 | [diff] [blame] | 69 | --- a/mt7996/mcu.h |
| 70 | +++ b/mt7996/mcu.h |
developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame^] | 71 | @@ -923,6 +923,10 @@ enum { |
developer | bd9fa1e | 2023-10-16 11:04:00 +0800 | [diff] [blame] | 72 | MT7996_SEC_MODE_MAX, |
| 73 | }; |
| 74 | |
| 75 | +enum { |
| 76 | + UNI_CMD_PP_EN_CTRL, |
| 77 | +}; |
| 78 | + |
| 79 | #define MT7996_PATCH_SEC GENMASK(31, 24) |
| 80 | #define MT7996_PATCH_SCRAMBLE_KEY GENMASK(15, 8) |
| 81 | #define MT7996_PATCH_AES_KEY GENMASK(7, 0) |
| 82 | diff --git a/mt7996/mt7996.h b/mt7996/mt7996.h |
developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame^] | 83 | index e1610d3b..4176e51a 100644 |
developer | bd9fa1e | 2023-10-16 11:04:00 +0800 | [diff] [blame] | 84 | --- a/mt7996/mt7996.h |
| 85 | +++ b/mt7996/mt7996.h |
developer | 1a17367 | 2023-12-21 14:49:33 +0800 | [diff] [blame^] | 86 | @@ -654,6 +654,8 @@ int mt7996_mcu_bcn_prot_enable(struct mt7996_dev *dev, struct ieee80211_vif *vif |
developer | bd9fa1e | 2023-10-16 11:04:00 +0800 | [diff] [blame] | 87 | int mt7996_mcu_wtbl_update_hdr_trans(struct mt7996_dev *dev, |
| 88 | struct ieee80211_vif *vif, |
| 89 | struct ieee80211_sta *sta); |
| 90 | +int mt7996_mcu_set_pp_en(struct mt7996_phy *phy, bool auto_mode, u8 force_bitmap, |
| 91 | + u16 bitmap); |
| 92 | #ifdef CONFIG_MAC80211_DEBUGFS |
| 93 | void mt7996_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
| 94 | struct ieee80211_sta *sta, struct dentry *dir); |
| 95 | -- |
| 96 | 2.18.0 |
| 97 | |