mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
wifi: rtw89: phy: configure control options of BB wrapper by RFSI band
The settings of control options are predefined per RFSI band (2GHz band or not 5/6GHz band) and used for fine-tuning transmit power. Calculate and set the RFSI band once creating channel context, and use it by BB wrapper configurations. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20260511070148.25257-11-pkshih@realtek.com
This commit is contained in:
parent
a395d7eed2
commit
4f2b5c8365
|
|
@ -150,6 +150,8 @@ void rtw89_chan_create(struct rtw89_chan *chan, u8 center_chan, u8 primary_chan,
|
|||
primary_freq);
|
||||
chan->pri_sb_idx = rtw89_get_primary_sb_idx(center_chan, primary_chan,
|
||||
bandwidth);
|
||||
chan->rfsi_band = band == RTW89_BAND_2G ? RFSI_CTRL_BAND_2GHZ :
|
||||
RFSI_CTRL_BAND_5_6GHZ;
|
||||
}
|
||||
|
||||
static void _rtw89_chan_update_punctured(struct rtw89_dev *rtwdev,
|
||||
|
|
|
|||
|
|
@ -1015,6 +1015,13 @@ enum rtw89_sc_offset {
|
|||
RTW89_SC_40_LOWER = 10,
|
||||
};
|
||||
|
||||
enum rtw89_rfsi_ctrl_band {
|
||||
RFSI_CTRL_BAND_5_6GHZ,
|
||||
RFSI_CTRL_BAND_2GHZ,
|
||||
|
||||
RFSI_CTRL_BAND_NUM,
|
||||
};
|
||||
|
||||
/* only mgd features can be added to the enum */
|
||||
enum rtw89_wow_flags {
|
||||
RTW89_WOW_FLAG_EN_MAGIC_PKT,
|
||||
|
|
@ -1038,6 +1045,7 @@ struct rtw89_chan {
|
|||
enum rtw89_tx_comp_band tx_comp_band;
|
||||
enum rtw89_sc_offset pri_ch_idx;
|
||||
u8 pri_sb_idx;
|
||||
enum rtw89_rfsi_ctrl_band rfsi_band;
|
||||
};
|
||||
|
||||
struct rtw89_chan_rcd {
|
||||
|
|
|
|||
|
|
@ -572,13 +572,6 @@ struct rtw89_phy_rfk_log_fmt {
|
|||
const struct rtw89_fw_element_hdr *elm[RTW89_PHY_C2H_RFK_LOG_FUNC_NUM];
|
||||
};
|
||||
|
||||
enum rtw89_rfsi_ctrl_band {
|
||||
RFSI_CTRL_BAND_5_6GHZ,
|
||||
RFSI_CTRL_BAND_2GHZ,
|
||||
|
||||
RFSI_CTRL_BAND_NUM,
|
||||
};
|
||||
|
||||
enum rtw89_mdpd_onoff {
|
||||
MDPD_ON = 0,
|
||||
MDPD_OFF = 1,
|
||||
|
|
@ -1032,6 +1025,7 @@ static inline void rtw89_phy_bb_wrap_init(struct rtw89_dev *rtwdev)
|
|||
}
|
||||
|
||||
void rtw89_phy_bb_wrap_set_rfsi_ct_opt(struct rtw89_dev *rtwdev,
|
||||
enum rtw89_rfsi_ctrl_band ctrl_band,
|
||||
enum rtw89_phy_idx phy_idx);
|
||||
void rtw89_phy_bb_wrap_set_rfsi_bandedge_ch(struct rtw89_dev *rtwdev,
|
||||
const struct rtw89_chan *chan,
|
||||
|
|
|
|||
|
|
@ -646,6 +646,7 @@ static u32 rtw89_phy_bb_wrap_be_bandedge_decision(struct rtw89_dev *rtwdev,
|
|||
}
|
||||
|
||||
void rtw89_phy_bb_wrap_set_rfsi_ct_opt(struct rtw89_dev *rtwdev,
|
||||
enum rtw89_rfsi_ctrl_band rfsi_band,
|
||||
enum rtw89_phy_idx phy_idx)
|
||||
{
|
||||
const struct rtw89_bb_wrap_data *d = rtwdev->phy_info.bb_wrap_data;
|
||||
|
|
@ -655,7 +656,7 @@ void rtw89_phy_bb_wrap_set_rfsi_ct_opt(struct rtw89_dev *rtwdev,
|
|||
if (!d || !d->common)
|
||||
return;
|
||||
|
||||
val = d->common->bands[0].rfsi_ct_opt;
|
||||
val = d->common->bands[rfsi_band].rfsi_ct_opt;
|
||||
|
||||
reg = rtw89_mac_reg_by_idx(rtwdev, R_RFSI_CT_OPT_0_BE4, phy_idx);
|
||||
rtw89_write32(rtwdev, reg, val[0]);
|
||||
|
|
@ -1004,7 +1005,7 @@ static void rtw89_phy_bb_wrap_tx_rfsi_ctrl_init(struct rtw89_dev *rtwdev,
|
|||
rtw89_phy_bb_set_mdpd_qam_comp_val(rtwdev, mac_idx);
|
||||
rtw89_phy_bb_set_cim3k_val(rtwdev, mac_idx);
|
||||
|
||||
rtw89_phy_bb_wrap_set_rfsi_ct_opt(rtwdev, phy_idx);
|
||||
rtw89_phy_bb_wrap_set_rfsi_ct_opt(rtwdev, 0, phy_idx);
|
||||
|
||||
rtw89_entity_get_conf(rtwdev, &conf);
|
||||
chan = conf.chans[phy_idx];
|
||||
|
|
|
|||
|
|
@ -2284,7 +2284,7 @@ static void rtw8922d_set_channel_bb(struct rtw89_dev *rtwdev,
|
|||
u8 pri_sb = chan->pri_sb_idx;
|
||||
u32 val;
|
||||
|
||||
rtw89_phy_bb_wrap_set_rfsi_ct_opt(rtwdev, phy_idx);
|
||||
rtw89_phy_bb_wrap_set_rfsi_ct_opt(rtwdev, chan->rfsi_band, phy_idx);
|
||||
rtw8922d_ctrl_ch(rtwdev, chan, phy_idx);
|
||||
rtw8922d_ctrl_bw(rtwdev, pri_sb, chan->band_width, phy_idx);
|
||||
rtw89_phy_bb_wrap_set_rfsi_bandedge_ch(rtwdev, chan, phy_idx);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user