wifi: rtw89: fw: recognize firmware type B by AID

Select a firmware suit including normal and WoWLAN firmware by chip AID
from multiple firmware, because coming RTL8922D has variant hardware with
different chip AID.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260213061552.29997-3-pkshih@realtek.com
This commit is contained in:
Ping-Ke Shih 2026-02-13 14:15:42 +08:00
parent abaa59fb24
commit fdb626b794
8 changed files with 21 additions and 2 deletions

View File

@ -4155,6 +4155,7 @@ struct rtw89_reg_imr {
struct rtw89_fw_def {
const char *fw_basename;
u8 fw_format_max;
u16 fw_b_aid;
};
struct rtw89_phy_table {
@ -4729,6 +4730,8 @@ enum rtw89_fw_type {
RTW89_FW_NORMAL = 1,
RTW89_FW_WOWLAN = 3,
RTW89_FW_NORMAL_CE = 5,
RTW89_FW_NORMAL_B = 14,
RTW89_FW_WOWLAN_B = 15,
RTW89_FW_BBMCU0 = 64,
RTW89_FW_BBMCU1 = 65,
RTW89_FW_LOGFMT = 255,
@ -7562,6 +7565,7 @@ static inline struct rtw89_fw_suit *rtw89_fw_suit_get(struct rtw89_dev *rtwdev,
switch (type) {
case RTW89_FW_WOWLAN:
case RTW89_FW_WOWLAN_B:
return &fw_info->wowlan;
case RTW89_FW_LOGFMT:
return &fw_info->log.suit;

View File

@ -1027,16 +1027,25 @@ static int rtw89_fw_validate_ver_required(struct rtw89_dev *rtwdev)
int rtw89_fw_recognize(struct rtw89_dev *rtwdev)
{
const struct rtw89_fw_def *fw_def = rtw89_chip_get_fw_def(rtwdev);
const struct rtw89_chip_info *chip = rtwdev->chip;
const struct rtw89_hal *hal = &rtwdev->hal;
enum rtw89_fw_type normal_fw_type = RTW89_FW_NORMAL;
enum rtw89_fw_type wowlan_fw_type = RTW89_FW_WOWLAN;
int ret;
if (fw_def->fw_b_aid && fw_def->fw_b_aid == hal->aid) {
normal_fw_type = RTW89_FW_NORMAL_B;
wowlan_fw_type = RTW89_FW_WOWLAN_B;
}
if (chip->try_ce_fw) {
ret = __rtw89_fw_recognize(rtwdev, RTW89_FW_NORMAL_CE, true);
if (!ret)
goto normal_done;
}
ret = __rtw89_fw_recognize(rtwdev, RTW89_FW_NORMAL, false);
ret = __rtw89_fw_recognize(rtwdev, normal_fw_type, false);
if (ret)
return ret;
@ -1046,7 +1055,7 @@ int rtw89_fw_recognize(struct rtw89_dev *rtwdev)
return ret;
/* It still works if wowlan firmware isn't existing. */
__rtw89_fw_recognize(rtwdev, RTW89_FW_WOWLAN, false);
__rtw89_fw_recognize(rtwdev, wowlan_fw_type, false);
/* It still works if log format file isn't existing. */
__rtw89_fw_recognize(rtwdev, RTW89_FW_LOGFMT, true);

View File

@ -2583,6 +2583,7 @@ const struct rtw89_chip_info rtw8851b_chip_info = {
.fw_def = {
.fw_basename = RTW8851B_FW_BASENAME,
.fw_format_max = RTW8851B_FW_FORMAT_MAX,
.fw_b_aid = 0,
},
.try_ce_fw = true,
.bbmcu_nr = 0,

View File

@ -2268,6 +2268,7 @@ const struct rtw89_chip_info rtw8852a_chip_info = {
.fw_def = {
.fw_basename = RTW8852A_FW_BASENAME,
.fw_format_max = RTW8852A_FW_FORMAT_MAX,
.fw_b_aid = 0,
},
.try_ce_fw = false,
.bbmcu_nr = 0,

View File

@ -914,6 +914,7 @@ const struct rtw89_chip_info rtw8852b_chip_info = {
.fw_def = {
.fw_basename = RTW8852B_FW_BASENAME,
.fw_format_max = RTW8852B_FW_FORMAT_MAX,
.fw_b_aid = 0,
},
.try_ce_fw = true,
.bbmcu_nr = 0,

View File

@ -760,6 +760,7 @@ const struct rtw89_chip_info rtw8852bt_chip_info = {
.fw_def = {
.fw_basename = RTW8852BT_FW_BASENAME,
.fw_format_max = RTW8852BT_FW_FORMAT_MAX,
.fw_b_aid = 0,
},
.try_ce_fw = true,
.bbmcu_nr = 0,

View File

@ -3109,6 +3109,7 @@ const struct rtw89_chip_info rtw8852c_chip_info = {
.fw_def = {
.fw_basename = RTW8852C_FW_BASENAME,
.fw_format_max = RTW8852C_FW_FORMAT_MAX,
.fw_b_aid = 0,
},
.try_ce_fw = false,
.bbmcu_nr = 0,

View File

@ -2919,6 +2919,7 @@ const struct rtw89_chip_info rtw8922a_chip_info = {
.fw_def = {
.fw_basename = RTW8922A_FW_BASENAME,
.fw_format_max = RTW8922A_FW_FORMAT_MAX,
.fw_b_aid = 0,
},
.try_ce_fw = false,
.bbmcu_nr = 1,