wifi: rtw89: use passed channel in set_tx_shape_dfir()
Ping-Ke Shih
maintainerPATCH 1/1 wifi: rtw89: use passed channel in set_tx_shape_dfir()
From: Zong-Zhe Yang <[email protected]>
In path of setting channel and setting TX power, the rtw89_chan instance to be used is controlled by top and passed down. The set_tx_shape_dfir() is in path of setting TX power, so it should use the passed rtw89_chan instead of querying it itself. Otherwise, it might encounter mismatch between parameters if multi-channel.
For example,rtw89_8852ce 0000:04:00.0: set tx shape dfir by unknown ch: 155 on 2GHz
--- drivers/net/wireless/realtek/rtw89/rtw8852b.c | 4 ++-- drivers/net/wireless/realtek/rtw89/rtw8852c.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/realtek/rtw89/rtw8852b.c +2 -2
@@ -1618,6 +1618,7 @@ static void rtw8852b_set_txpwr_ref(struct rtw89_dev *rtwdev, }static void rtw8852b_bb_set_tx_shape_dfir (struct rtw89_dev *rtwdev, +const struct rtw89_chan *chan,u8 tx_shape_idx,enum rtw89_phy_idx phy_idx) {
@@ -1637,7 +1638,6 @@ static void rtw8852b_bb_set_tx_shape_dfir(struct rtw89_dev *rtwdev,__DECL_DFIR_PARAM (sharp_14,0x023B13FF ,0x001C42DE ,0x00FDB0AD ,0x00F60F6E ,0x00FD8F92 ,0x0602D011 ,0x0001C02C ,0x00FFF00A ); -const struct rtw89_chan *chan =rtw89_chan_get (rtwdev,RTW89_SUB_ENTITY_0 );u8 ch = chan->channel;const u32 *param;u32 addr;
@@ -1678,7 +1678,7 @@ static void rtw8852b_set_tx_shape(struct rtw89_dev *rtwdev,u8 tx_shape_ofdm = rtw89_8852b_tx_shape[band][RTW89_RS_OFDM ][regd];if (band ==RTW89_BAND_2G ) -rtw8852b_bb_set_tx_shape_dfir (rtwdev, tx_shape_cck, phy_idx); +rtw8852b_bb_set_tx_shape_dfir (rtwdev, chan, tx_shape_cck, phy_idx);rtw89_phy_write32_mask (rtwdev,R_DCFO_OPT ,B_TXSHAPE_TRIANGULAR_CFG , tx_shape_ofdm);
drivers/net/wireless/realtek/rtw89/rtw8852c.c +2 -2
@@ -1968,6 +1968,7 @@ static void rtw8852c_set_txpwr_ref(struct rtw89_dev *rtwdev, }static void rtw8852c_bb_set_tx_shape_dfir (struct rtw89_dev *rtwdev, +const struct rtw89_chan *chan,u8 tx_shape_idx,enum rtw89_phy_idx phy_idx) {
@@ -1991,7 +1992,6 @@ static void rtw8852c_bb_set_tx_shape_dfir(struct rtw89_dev *rtwdev,__DECL_DFIR_ADDR (filter,0x45BC ,0x45CC ,0x45D0 ,0x45D4 ,0x45D8 ,0x45C0 ,0x45C4 ,0x45C8 ); -const struct rtw89_chan *chan =rtw89_chan_get (rtwdev,RTW89_SUB_ENTITY_0 );u8 ch = chan->channel;const u32 *param;int i;
@@ -2032,7 +2032,7 @@ static void rtw8852c_set_tx_shape(struct rtw89_dev *rtwdev,u8 tx_shape_ofdm = rtw89_8852c_tx_shape[band][RTW89_RS_OFDM ][regd];if (band ==RTW89_BAND_2G ) -rtw8852c_bb_set_tx_shape_dfir (rtwdev, tx_shape_cck, phy_idx); +rtw8852c_bb_set_tx_shape_dfir (rtwdev, chan, tx_shape_cck, phy_idx); rtw89_phy_tssi_ctrl_set_bandedge_cfg(rtwdev, (enum rtw89_mac_idx)phy_idx,
Signature · 1 line
2.25.1
Quoted 8 lines · Ping-Ke Shih
From: Zong-Zhe Yang <[email protected]>
In path of setting channel and setting TX power, the
rtw89_chaninstance to be used is controlled by top and passed down. Theset_tx_shape_dfir()is in path of setting TX power, so it should use the passedrtw89_chaninstead of querying it itself. Otherwise, it might encounter mismatch between parameters if multi-channel.
Quoted 5 lines
For example,
rtw89_8852ce0000:04:00.0: set tx shape dfir by unknown ch: 155 on 2GHzSigned-off-by Zong-Zhe Yang <[email protected]>Signed-off-by Ping-Ke Shih <[email protected]>
Patch applied to wireless-next.git, thanks.
764f07f4565d wifi: rtw89: use passed channel in set_tx_shape_dfir()
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches