mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 04:23:35 +02:00
wifi: rtw89: fw: add CMAC H2C command for TX AMPDU for RTL8922D
CMAC H2C command is to configure CMAC such as TX retry and padding. Add to update CMAC function block while AMPDU is established. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20260106030911.15528-7-pkshih@realtek.com
This commit is contained in:
parent
96f5ceb448
commit
dfe3dea6b9
|
|
@ -4071,6 +4071,72 @@ int rtw89_fw_h2c_ampdu_cmac_tbl_g7(struct rtw89_dev *rtwdev,
|
|||
}
|
||||
EXPORT_SYMBOL(rtw89_fw_h2c_ampdu_cmac_tbl_g7);
|
||||
|
||||
int rtw89_fw_h2c_ampdu_cmac_tbl_be(struct rtw89_dev *rtwdev,
|
||||
struct rtw89_vif_link *rtwvif_link,
|
||||
struct rtw89_sta_link *rtwsta_link)
|
||||
{
|
||||
struct rtw89_sta *rtwsta = rtwsta_link->rtwsta;
|
||||
struct rtw89_h2c_cctlinfo_ud_be *h2c;
|
||||
u32 len = sizeof(*h2c);
|
||||
struct sk_buff *skb;
|
||||
u16 agg_num = 0;
|
||||
u8 ba_bmap = 0;
|
||||
int ret;
|
||||
u8 tid;
|
||||
|
||||
skb = rtw89_fw_h2c_alloc_skb_with_hdr(rtwdev, len);
|
||||
if (!skb) {
|
||||
rtw89_err(rtwdev, "failed to alloc skb for ampdu cmac be\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
skb_put(skb, len);
|
||||
h2c = (struct rtw89_h2c_cctlinfo_ud_be *)skb->data;
|
||||
|
||||
for_each_set_bit(tid, rtwsta->ampdu_map, IEEE80211_NUM_TIDS) {
|
||||
if (agg_num == 0)
|
||||
agg_num = rtwsta->ampdu_params[tid].agg_num;
|
||||
else
|
||||
agg_num = min(agg_num, rtwsta->ampdu_params[tid].agg_num);
|
||||
}
|
||||
|
||||
if (agg_num <= 0x20)
|
||||
ba_bmap = 3;
|
||||
else if (agg_num > 0x20 && agg_num <= 0x40)
|
||||
ba_bmap = 0;
|
||||
else if (agg_num > 0x40 && agg_num <= 0x80)
|
||||
ba_bmap = 1;
|
||||
else if (agg_num > 0x80 && agg_num <= 0x100)
|
||||
ba_bmap = 2;
|
||||
else if (agg_num > 0x100 && agg_num <= 0x200)
|
||||
ba_bmap = 4;
|
||||
else if (agg_num > 0x200 && agg_num <= 0x400)
|
||||
ba_bmap = 5;
|
||||
|
||||
h2c->c0 = le32_encode_bits(rtwsta_link->mac_id, BE_CCTL_INFO_C0_V1_MACID) |
|
||||
le32_encode_bits(1, BE_CCTL_INFO_C0_V1_OP);
|
||||
|
||||
h2c->w3 = le32_encode_bits(ba_bmap, BE_CCTL_INFO_W3_BA_BMAP);
|
||||
h2c->m3 = cpu_to_le32(BE_CCTL_INFO_W3_BA_BMAP);
|
||||
|
||||
rtw89_h2c_pkt_set_hdr(rtwdev, skb, FWCMD_TYPE_H2C,
|
||||
H2C_CAT_MAC, H2C_CL_MAC_FR_EXCHG,
|
||||
H2C_FUNC_MAC_CCTLINFO_UD_G7, 0, 0,
|
||||
len);
|
||||
|
||||
ret = rtw89_h2c_tx(rtwdev, skb, false);
|
||||
if (ret) {
|
||||
rtw89_err(rtwdev, "failed to send h2c\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
return 0;
|
||||
fail:
|
||||
dev_kfree_skb_any(skb);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(rtw89_fw_h2c_ampdu_cmac_tbl_be);
|
||||
|
||||
int rtw89_fw_h2c_txtime_cmac_tbl(struct rtw89_dev *rtwdev,
|
||||
struct rtw89_sta_link *rtwsta_link)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5043,6 +5043,9 @@ int rtw89_fw_h2c_assoc_cmac_tbl_be(struct rtw89_dev *rtwdev,
|
|||
int rtw89_fw_h2c_ampdu_cmac_tbl_g7(struct rtw89_dev *rtwdev,
|
||||
struct rtw89_vif_link *rtwvif_link,
|
||||
struct rtw89_sta_link *rtwsta_link);
|
||||
int rtw89_fw_h2c_ampdu_cmac_tbl_be(struct rtw89_dev *rtwdev,
|
||||
struct rtw89_vif_link *rtwvif_link,
|
||||
struct rtw89_sta_link *rtwsta_link);
|
||||
int rtw89_fw_h2c_txtime_cmac_tbl(struct rtw89_dev *rtwdev,
|
||||
struct rtw89_sta_link *rtwsta_link);
|
||||
int rtw89_fw_h2c_txtime_cmac_tbl_g7(struct rtw89_dev *rtwdev,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user