mirror of
https://github.com/torvalds/linux.git
synced 2026-06-05 04:56:13 +02:00
wifi: rtw89: ps: update H2C command with more info for PS
Adding beacon BW offset, OP1dB table and rfe_type to lps_ml_cmn_info. These information will help FW to configure RX more accurately. Signed-off-by: Eric Huang <echuang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20250203072911.47313-3-pkshih@realtek.com
This commit is contained in:
parent
d078f5857a
commit
5dde1a569c
|
|
@ -2192,8 +2192,11 @@ static void rtw89_vif_rx_stats_iter(void *data, u8 *mac,
|
|||
}
|
||||
pkt_stat->beacon_nr++;
|
||||
|
||||
if (phy_ppdu)
|
||||
if (phy_ppdu) {
|
||||
ewma_rssi_add(&rtwdev->phystat.bcn_rssi, phy_ppdu->rssi_avg);
|
||||
if (!test_bit(RTW89_FLAG_LOW_POWER_MODE, rtwdev->flags))
|
||||
rtwvif_link->bcn_bw_idx = phy_ppdu->bw_idx;
|
||||
}
|
||||
|
||||
pkt_stat->beacon_rate = desc_info->data_rate;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3501,6 +3501,7 @@ struct rtw89_vif_link {
|
|||
u8 self_role;
|
||||
u8 wmm;
|
||||
u8 bcn_hit_cond;
|
||||
u8 bcn_bw_idx;
|
||||
u8 hit_rule;
|
||||
u8 last_noa_nr;
|
||||
u64 sync_bcn_tsf;
|
||||
|
|
|
|||
|
|
@ -2795,7 +2795,9 @@ int rtw89_fw_h2c_lps_ml_cmn_info(struct rtw89_dev *rtwdev,
|
|||
{
|
||||
const struct rtw89_phy_bb_gain_info_be *gain = &rtwdev->bb_gain.be;
|
||||
struct rtw89_pkt_stat *pkt_stat = &rtwdev->phystat.cur_pkt_stat;
|
||||
static const u8 bcn_bw_ofst[] = {0, 0, 0, 3, 6, 9, 0, 12};
|
||||
const struct rtw89_chip_info *chip = rtwdev->chip;
|
||||
struct rtw89_efuse *efuse = &rtwdev->efuse;
|
||||
struct rtw89_h2c_lps_ml_cmn_info *h2c;
|
||||
struct rtw89_vif_link *rtwvif_link;
|
||||
const struct rtw89_chan *chan;
|
||||
|
|
@ -2803,6 +2805,7 @@ int rtw89_fw_h2c_lps_ml_cmn_info(struct rtw89_dev *rtwdev,
|
|||
u32 len = sizeof(*h2c);
|
||||
unsigned int link_id;
|
||||
struct sk_buff *skb;
|
||||
u8 beacon_bw_ofst;
|
||||
u8 gain_band;
|
||||
u32 done;
|
||||
u8 path;
|
||||
|
|
@ -2820,9 +2823,10 @@ int rtw89_fw_h2c_lps_ml_cmn_info(struct rtw89_dev *rtwdev,
|
|||
skb_put(skb, len);
|
||||
h2c = (struct rtw89_h2c_lps_ml_cmn_info *)skb->data;
|
||||
|
||||
h2c->fmt_id = 0x1;
|
||||
h2c->fmt_id = 0x3;
|
||||
|
||||
h2c->mlo_dbcc_mode = cpu_to_le32(rtwdev->mlo_dbcc_mode);
|
||||
h2c->rfe_type = efuse->rfe_type;
|
||||
|
||||
rtw89_vif_for_each_link(rtwvif, rtwvif_link, link_id) {
|
||||
path = rtwvif_link->phy_idx == RTW89_PHY_1 ? RF_PATH_B : RF_PATH_A;
|
||||
|
|
@ -2843,9 +2847,21 @@ int rtw89_fw_h2c_lps_ml_cmn_info(struct rtw89_dev *rtwdev,
|
|||
h2c->tia_gain[rtwvif_link->phy_idx][i] =
|
||||
cpu_to_le16(gain->tia_gain[gain_band][bw_idx][path][i]);
|
||||
}
|
||||
|
||||
if (rtwvif_link->bcn_bw_idx < ARRAY_SIZE(bcn_bw_ofst)) {
|
||||
beacon_bw_ofst = bcn_bw_ofst[rtwvif_link->bcn_bw_idx];
|
||||
h2c->dup_bcn_ofst[rtwvif_link->phy_idx] = beacon_bw_ofst;
|
||||
}
|
||||
|
||||
memcpy(h2c->lna_gain[rtwvif_link->phy_idx],
|
||||
gain->lna_gain[gain_band][bw_idx][path],
|
||||
LNA_GAIN_NUM);
|
||||
memcpy(h2c->tia_lna_op1db[rtwvif_link->phy_idx],
|
||||
gain->tia_lna_op1db[gain_band][bw_idx][path],
|
||||
LNA_GAIN_NUM + 1);
|
||||
memcpy(h2c->lna_op1db[rtwvif_link->phy_idx],
|
||||
gain->lna_op1db[gain_band][bw_idx][path],
|
||||
LNA_GAIN_NUM);
|
||||
}
|
||||
|
||||
rtw89_h2c_pkt_set_hdr(rtwdev, skb, FWCMD_TYPE_H2C,
|
||||
|
|
|
|||
|
|
@ -1801,7 +1801,8 @@ struct rtw89_h2c_lps_ch_info {
|
|||
|
||||
struct rtw89_h2c_lps_ml_cmn_info {
|
||||
u8 fmt_id;
|
||||
u8 rsvd0[3];
|
||||
u8 rfe_type;
|
||||
u8 rsvd0[2];
|
||||
__le32 mlo_dbcc_mode;
|
||||
u8 central_ch[RTW89_PHY_NUM];
|
||||
u8 pri_ch[RTW89_PHY_NUM];
|
||||
|
|
@ -1812,6 +1813,9 @@ struct rtw89_h2c_lps_ml_cmn_info {
|
|||
__le16 tia_gain[RTW89_PHY_NUM][TIA_GAIN_NUM];
|
||||
u8 lna_gain[RTW89_PHY_NUM][LNA_GAIN_NUM];
|
||||
u8 rsvd2[2];
|
||||
u8 tia_lna_op1db[RTW89_PHY_NUM][LNA_GAIN_NUM + 1];
|
||||
u8 lna_op1db[RTW89_PHY_NUM][LNA_GAIN_NUM];
|
||||
u8 dup_bcn_ofst[RTW89_PHY_NUM];
|
||||
} __packed;
|
||||
|
||||
static inline void RTW89_SET_FWCMD_CPU_EXCEPTION_TYPE(void *cmd, u32 val)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user