]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: rtw89: fw: correct chan access in assoc_cmac_tbl_g7 and update_beacon_be
authorZong-Zhe Yang <kevin_yang@realtek.com>
Sat, 27 Jul 2024 08:06:49 +0000 (16:06 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Fri, 2 Aug 2024 01:38:22 +0000 (09:38 +0800)
Originally, these H2C commands access chan with hard-code RTW89_CHANCTX_0.
They are problematic when the chip supports multiple channels. So, correct
them by accessing right chan under rtwvif.

Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20240727080650.12195-7-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/fw.c

index 1db32418e91275638675b6e776e4a6dc74079fe9..b9bf9ae3a512123ac096bf0b777b99a1a8d1e5d3 100644 (file)
@@ -2947,9 +2947,9 @@ int rtw89_fw_h2c_assoc_cmac_tbl_g7(struct rtw89_dev *rtwdev,
                                   struct ieee80211_vif *vif,
                                   struct ieee80211_sta *sta)
 {
-       const struct rtw89_chan *chan = rtw89_chan_get(rtwdev, RTW89_CHANCTX_0);
        struct rtw89_vif *rtwvif = (struct rtw89_vif *)vif->drv_priv;
        struct rtw89_sta *rtwsta = sta_to_rtwsta_safe(sta);
+       const struct rtw89_chan *chan = rtw89_chan_get(rtwdev, rtwvif->chanctx_idx);
        u8 mac_id = rtwsta ? rtwsta->mac_id : rtwvif->mac_id;
        struct rtw89_h2c_cctlinfo_ud_g7 *h2c;
        u8 pads[RTW89_PPE_BW_NUM];
@@ -3289,7 +3289,7 @@ EXPORT_SYMBOL(rtw89_fw_h2c_update_beacon);
 int rtw89_fw_h2c_update_beacon_be(struct rtw89_dev *rtwdev,
                                  struct rtw89_vif *rtwvif)
 {
-       const struct rtw89_chan *chan = rtw89_chan_get(rtwdev, RTW89_CHANCTX_0);
+       const struct rtw89_chan *chan = rtw89_chan_get(rtwdev, rtwvif->chanctx_idx);
        struct ieee80211_vif *vif = rtwvif_to_vif(rtwvif);
        struct rtw89_h2c_bcn_upd_be *h2c;
        struct sk_buff *skb_beacon;