Skip to content

Commit 293f7bd

Browse files
Ping-Ke ShihKalle Valo
authored andcommitted
wifi: rtw89: add DBCC H2C to notify firmware the status
To support MLO of WiFi 7, we should configure hardware as DBCC mode, and notify this status to firmware. Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://msgid.link/[email protected]
1 parent fc663fa commit 293f7bd

File tree

2 files changed

+43
-0
lines changed
  • drivers/net/wireless/realtek/rtw89

2 files changed

+43
-0
lines changed

drivers/net/wireless/realtek/rtw89/fw.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2330,6 +2330,41 @@ int rtw89_fw_h2c_join_info(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif,
23302330
return ret;
23312331
}
23322332

2333+
int rtw89_fw_h2c_notify_dbcc(struct rtw89_dev *rtwdev, bool en)
2334+
{
2335+
struct rtw89_h2c_notify_dbcc *h2c;
2336+
u32 len = sizeof(*h2c);
2337+
struct sk_buff *skb;
2338+
int ret;
2339+
2340+
skb = rtw89_fw_h2c_alloc_skb_with_hdr(rtwdev, len);
2341+
if (!skb) {
2342+
rtw89_err(rtwdev, "failed to alloc skb for h2c notify dbcc\n");
2343+
return -ENOMEM;
2344+
}
2345+
skb_put(skb, len);
2346+
h2c = (struct rtw89_h2c_notify_dbcc *)skb->data;
2347+
2348+
h2c->w0 = le32_encode_bits(en, RTW89_H2C_NOTIFY_DBCC_EN);
2349+
2350+
rtw89_h2c_pkt_set_hdr(rtwdev, skb, FWCMD_TYPE_H2C,
2351+
H2C_CAT_MAC, H2C_CL_MAC_MEDIA_RPT,
2352+
H2C_FUNC_NOTIFY_DBCC, 0, 1,
2353+
len);
2354+
2355+
ret = rtw89_h2c_tx(rtwdev, skb, false);
2356+
if (ret) {
2357+
rtw89_err(rtwdev, "failed to send h2c\n");
2358+
goto fail;
2359+
}
2360+
2361+
return 0;
2362+
fail:
2363+
dev_kfree_skb_any(skb);
2364+
2365+
return ret;
2366+
}
2367+
23332368
int rtw89_fw_h2c_macid_pause(struct rtw89_dev *rtwdev, u8 sh, u8 grp,
23342369
bool pause)
23352370
{

drivers/net/wireless/realtek/rtw89/fw.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,6 +1685,12 @@ static inline void SET_JOININFO_SELF_ROLE(void *h2c, u32 val)
16851685
le32p_replace_bits((__le32 *)h2c, val, GENMASK(31, 30));
16861686
}
16871687

1688+
struct rtw89_h2c_notify_dbcc {
1689+
__le32 w0;
1690+
} __packed;
1691+
1692+
#define RTW89_H2C_NOTIFY_DBCC_EN BIT(0)
1693+
16881694
static inline void SET_GENERAL_PKT_MACID(void *h2c, u32 val)
16891695
{
16901696
le32p_replace_bits((__le32 *)h2c, val, GENMASK(7, 0));
@@ -3650,6 +3656,7 @@ struct rtw89_fw_h2c_rf_reg_info {
36503656
#define H2C_CL_MAC_MEDIA_RPT 0x8
36513657
#define H2C_FUNC_MAC_JOININFO 0x0
36523658
#define H2C_FUNC_MAC_FWROLE_MAINTAIN 0x4
3659+
#define H2C_FUNC_NOTIFY_DBCC 0x5
36533660

36543661
/* CLASS 9 - FW offload */
36553662
#define H2C_CL_MAC_FW_OFLD 0x9
@@ -3846,6 +3853,7 @@ int rtw89_fw_h2c_role_maintain(struct rtw89_dev *rtwdev,
38463853
enum rtw89_upd_mode upd_mode);
38473854
int rtw89_fw_h2c_join_info(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif,
38483855
struct rtw89_sta *rtwsta, bool dis_conn);
3856+
int rtw89_fw_h2c_notify_dbcc(struct rtw89_dev *rtwdev, bool en);
38493857
int rtw89_fw_h2c_macid_pause(struct rtw89_dev *rtwdev, u8 sh, u8 grp,
38503858
bool pause);
38513859
int rtw89_fw_h2c_set_edca(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif,

0 commit comments

Comments
 (0)