Skip to content

Commit 344c066

Browse files
Ping-Ke ShihKalle Valo
authored andcommitted
wifi: rtw89: fw: add version field to BB MCU firmware element
8922AE has more than one hardware version, and they use different BB MCU firmware, so occupy a byte from element priv[] to annotate version. Since there are more than one firmware and only matched version is adopted, return 1 to ignore not matched firmware. +===========================================+ | elm ID | elm size | version | | +----------+----------+----------+----------+ | | element_priv[] | +-------------------------------------------+ change to | v +===========================================+ | elm ID | elm size | version | | +----------+----------+----------+----------+ | | cv | element_rsvd[] | +-------------------------------------------+ Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://msgid.link/[email protected]
1 parent d60e73e commit 344c066

File tree

2 files changed

+12
-1
lines changed
  • drivers/net/wireless/realtek/rtw89

2 files changed

+12
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,10 +401,14 @@ int __rtw89_fw_recognize_from_elm(struct rtw89_dev *rtwdev,
401401
const union rtw89_fw_element_arg arg)
402402
{
403403
enum rtw89_fw_type type = arg.fw_type;
404+
struct rtw89_hal *hal = &rtwdev->hal;
404405
struct rtw89_fw_suit *fw_suit;
405406

407+
if (hal->cv != elm->u.bbmcu.cv)
408+
return 1; /* ignore this element */
409+
406410
fw_suit = rtw89_fw_suit_get(rtwdev, type);
407-
fw_suit->data = elm->u.common.contents;
411+
fw_suit->data = elm->u.bbmcu.contents;
408412
fw_suit->size = le32_to_cpu(elm->size);
409413

410414
return rtw89_fw_update_ver(rtwdev, type, fw_suit);
@@ -820,6 +824,8 @@ int rtw89_fw_recognize_elements(struct rtw89_dev *rtwdev)
820824
goto next;
821825

822826
ret = handler->fn(rtwdev, hdr, handler->arg);
827+
if (ret == 1) /* ignore this element */
828+
goto next;
823829
if (ret)
824830
return ret;
825831

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3532,6 +3532,11 @@ struct rtw89_fw_element_hdr {
35323532
__le32 data;
35333533
} __packed regs[];
35343534
} __packed reg2;
3535+
struct {
3536+
u8 cv;
3537+
u8 priv[7];
3538+
u8 contents[];
3539+
} __packed bbmcu;
35353540
struct {
35363541
__le32 bitmap; /* bitmap of enum rtw89_fw_txpwr_trk_type */
35373542
__le32 rsvd;

0 commit comments

Comments
 (0)