developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 1 | From 4b29092cc31d34967152a3062966d987fc5352eb Mon Sep 17 00:00:00 2001 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 2 | From: Peter Chiu <chui-hao.chiu@mediatek.com> |
| 3 | Date: Thu, 18 Jul 2024 10:29:22 +0800 |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 4 | Subject: [PATCH 172/223] mtk: mt76: mt7996: leave ps when 4 address is |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 5 | established |
| 6 | |
| 7 | Because the 4 address non-amsdu packet does not have bssid field, the |
| 8 | hardware cannot get the bssid. Without bssid, the station's are not able |
| 9 | leave PS mode due to HW design. Wake up non-setup link when receiving |
| 10 | 4 address null data to prevent this issue. |
| 11 | |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 12 | Change-Id: I94308432b73e647363fd0e2db281c54becdf1ec8 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 13 | Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com> |
| 14 | --- |
| 15 | mt76_connac_mcu.h | 1 + |
| 16 | mt7996/main.c | 3 +++ |
| 17 | mt7996/mcu.c | 18 ++++++++++++++++++ |
| 18 | mt7996/mcu.h | 6 ++++++ |
| 19 | mt7996/mt7996.h | 2 ++ |
| 20 | 5 files changed, 30 insertions(+) |
| 21 | |
| 22 | diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 23 | index 18758ff2..69c8389f 100644 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 24 | --- a/mt76_connac_mcu.h |
| 25 | +++ b/mt76_connac_mcu.h |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 26 | @@ -843,6 +843,7 @@ enum { |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 27 | STA_REC_EML_OP = 0x29, |
| 28 | STA_REC_HDR_TRANS = 0x2B, |
| 29 | STA_REC_TX_CAP = 0x2f, |
| 30 | + STA_REC_PS_LEAVE = 0x45, |
| 31 | STA_REC_MAX_NUM |
| 32 | }; |
| 33 | |
| 34 | diff --git a/mt7996/main.c b/mt7996/main.c |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 35 | index c6cb5104..21d65f78 100644 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 36 | --- a/mt7996/main.c |
| 37 | +++ b/mt7996/main.c |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 38 | @@ -2081,6 +2081,9 @@ static void mt7996_sta_set_4addr(struct ieee80211_hw *hw, |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 39 | clear_bit(MT_WCID_FLAG_4ADDR, &mlink->wcid.flags); |
| 40 | |
| 41 | mt7996_mcu_wtbl_update_hdr_trans(dev, vif, mconf, mlink); |
| 42 | + |
| 43 | + if (msta->pri_link != link_id && is_mt7996(&dev->mt76)) |
| 44 | + mt7996_mcu_ps_leave(dev, mconf, mlink); |
| 45 | } |
| 46 | mutex_unlock(&dev->mt76.mutex); |
| 47 | } |
| 48 | diff --git a/mt7996/mcu.c b/mt7996/mcu.c |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 49 | index 0e8e2c06..b47aa7d6 100644 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 50 | --- a/mt7996/mcu.c |
| 51 | +++ b/mt7996/mcu.c |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 52 | @@ -6257,6 +6257,24 @@ int mt7996_mcu_wtbl_update_hdr_trans(struct mt7996_dev *dev, |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 53 | MCU_WMWA_UNI_CMD(STA_REC_UPDATE), true); |
| 54 | } |
| 55 | |
| 56 | +int mt7996_mcu_ps_leave(struct mt7996_dev *dev, struct mt7996_bss_conf *mconf, |
| 57 | + struct mt7996_link_sta *mlink) |
| 58 | +{ |
| 59 | + struct sk_buff *skb; |
| 60 | + |
| 61 | + skb = __mt76_connac_mcu_alloc_sta_req(&dev->mt76, &mconf->mt76, |
| 62 | + &mlink->wcid, |
| 63 | + MT7996_STA_UPDATE_MAX_SIZE); |
| 64 | + if (IS_ERR(skb)) |
| 65 | + return PTR_ERR(skb); |
| 66 | + |
| 67 | + mt76_connac_mcu_add_tlv(skb, STA_REC_PS_LEAVE, |
| 68 | + sizeof(struct sta_rec_ps_leave)); |
| 69 | + |
| 70 | + return mt76_mcu_skb_send_msg(&dev->mt76, skb, |
| 71 | + MCU_WMWA_UNI_CMD(STA_REC_UPDATE), true); |
| 72 | +} |
| 73 | + |
| 74 | int mt7996_mcu_set_fixed_rate_table(struct mt7996_phy *phy, u8 table_idx, |
| 75 | u16 rate_idx, bool beacon) |
| 76 | { |
| 77 | diff --git a/mt7996/mcu.h b/mt7996/mcu.h |
| 78 | index 0f2695eb..ffa574b8 100644 |
| 79 | --- a/mt7996/mcu.h |
| 80 | +++ b/mt7996/mcu.h |
| 81 | @@ -775,6 +775,12 @@ struct sta_rec_hdr_trans { |
| 82 | u8 mesh; |
| 83 | } __packed; |
| 84 | |
| 85 | +struct sta_rec_ps_leave { |
| 86 | + __le16 tag; |
| 87 | + __le16 len; |
| 88 | + u8 __rsv[4]; |
| 89 | +} __packed; |
| 90 | + |
| 91 | struct sta_rec_mld_setup { |
| 92 | __le16 tag; |
| 93 | __le16 len; |
| 94 | diff --git a/mt7996/mt7996.h b/mt7996/mt7996.h |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 95 | index 15c4e557..21019bc2 100644 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 96 | --- a/mt7996/mt7996.h |
| 97 | +++ b/mt7996/mt7996.h |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 98 | @@ -1281,6 +1281,8 @@ int mt7996_mcu_wtbl_update_hdr_trans(struct mt7996_dev *dev, |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 99 | struct ieee80211_vif *vif, |
| 100 | struct mt7996_bss_conf *mconf, |
| 101 | struct mt7996_link_sta *mlink); |
| 102 | +int mt7996_mcu_ps_leave(struct mt7996_dev *dev, struct mt7996_bss_conf *mconf, |
| 103 | + struct mt7996_link_sta *mlink); |
| 104 | int mt7996_mcu_cp_support(struct mt7996_dev *dev, u8 mode); |
| 105 | int mt7996_mcu_set_pp_en(struct mt7996_phy *phy, u8 mode, u16 bitmap); |
| 106 | int mt7996_mcu_set_pp_sta_dscb(struct mt7996_phy *phy, struct cfg80211_chan_def *chandef, |
| 107 | -- |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 108 | 2.45.2 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 109 | |