wifi: rtw89: introduce chip support link number and driver MLO capability
Configure supported link number by chip. And, introduce driver capability flag for MLO. Driver should depend on runtime FW features and chip info to determine whether to set the MLO capability flag or not. Once the MLO flag is set, driver will consider/register/initialize things for MLO usages. However, we just add the driver MLO capability flag ahead and don't really set it. Then, we can start to tweak driver architecture for MLO. Some code should depend on this flag. And after tweaking driver architecture is done, we will set it based on runtime conditions as mentioned above. Besides, MLD number supported by HW should be chip supported mac_id number / chip supported link number Without driver MLO capability flag, we allocate stations based on supported mac_id number. With driver MLO capability flag, we allocate stations based on supported MLD number. Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/20240819091724.33730-9-pkshih@realtek.com
This commit is contained in:
parent
d03b3d7493
commit
fef6315094
@ -4263,9 +4263,14 @@ void rtw89_core_stop(struct rtw89_dev *rtwdev)
|
||||
u8 rtw89_acquire_mac_id(struct rtw89_dev *rtwdev)
|
||||
{
|
||||
const struct rtw89_chip_info *chip = rtwdev->chip;
|
||||
u8 mac_id_num = chip->support_macid_num;
|
||||
u8 mac_id_num;
|
||||
u8 mac_id;
|
||||
|
||||
if (rtwdev->support_mlo)
|
||||
mac_id_num = chip->support_macid_num / chip->support_link_num;
|
||||
else
|
||||
mac_id_num = chip->support_macid_num;
|
||||
|
||||
mac_id = find_first_zero_bit(rtwdev->mac_id_map, mac_id_num);
|
||||
if (mac_id == mac_id_num)
|
||||
return RTW89_MAX_MAC_ID_NUM;
|
||||
@ -4681,6 +4686,9 @@ static int rtw89_core_register_hw(struct rtw89_dev *rtwdev)
|
||||
if (chip->chip_gen == RTW89_CHIP_BE)
|
||||
hw->wiphy->flags |= WIPHY_FLAG_DISABLE_WEXT;
|
||||
|
||||
if (rtwdev->support_mlo)
|
||||
hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_MLO;
|
||||
|
||||
hw->wiphy->features |= NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR;
|
||||
|
||||
hw->wiphy->max_scan_ssids = RTW89_SCANOFLD_MAX_SSID;
|
||||
@ -4783,6 +4791,7 @@ struct rtw89_dev *rtw89_alloc_ieee80211_hw(struct device *device,
|
||||
struct ieee80211_ops *ops;
|
||||
u32 driver_data_size;
|
||||
int fw_format = -1;
|
||||
bool support_mlo;
|
||||
bool no_chanctx;
|
||||
|
||||
firmware = rtw89_early_fw_feature_recognize(device, chip, &early_fw, &fw_format);
|
||||
@ -4811,6 +4820,14 @@ struct rtw89_dev *rtw89_alloc_ieee80211_hw(struct device *device,
|
||||
if (!hw)
|
||||
goto err;
|
||||
|
||||
/* TODO: When driver MLO arch. is done, determine whether to support MLO
|
||||
* according to the following conditions.
|
||||
* 1. run with chanctx_ops
|
||||
* 2. chip->support_link_num != 0
|
||||
* 3. FW feature supports AP_LINK_PS
|
||||
*/
|
||||
support_mlo = false;
|
||||
|
||||
hw->wiphy->iface_combinations = rtw89_iface_combs;
|
||||
|
||||
if (no_chanctx || chip->support_chanctx_num == 1)
|
||||
@ -4825,9 +4842,12 @@ struct rtw89_dev *rtw89_alloc_ieee80211_hw(struct device *device,
|
||||
rtwdev->chip = chip;
|
||||
rtwdev->fw.req.firmware = firmware;
|
||||
rtwdev->fw.fw_format = fw_format;
|
||||
rtwdev->support_mlo = support_mlo;
|
||||
|
||||
rtw89_debug(rtwdev, RTW89_DBG_FW, "probe driver %s chanctx\n",
|
||||
rtw89_debug(rtwdev, RTW89_DBG_CHAN, "probe driver %s chanctx\n",
|
||||
no_chanctx ? "without" : "with");
|
||||
rtw89_debug(rtwdev, RTW89_DBG_CHAN, "probe driver %s MLO cap\n",
|
||||
support_mlo ? "with" : "without");
|
||||
|
||||
return rtwdev;
|
||||
|
||||
|
@ -4232,6 +4232,7 @@ struct rtw89_chip_info {
|
||||
u8 wde_qempty_mgq_grpsel;
|
||||
u32 rf_base_addr[2];
|
||||
u8 support_macid_num;
|
||||
u8 support_link_num;
|
||||
u8 support_chanctx_num;
|
||||
u8 support_bands;
|
||||
u16 support_bandwidths;
|
||||
@ -5475,6 +5476,7 @@ struct rtw89_dev {
|
||||
const struct ieee80211_ops *ops;
|
||||
|
||||
bool dbcc_en;
|
||||
bool support_mlo;
|
||||
enum rtw89_mlo_dbcc_mode mlo_dbcc_mode;
|
||||
struct rtw89_hw_scan_info scan_info;
|
||||
const struct rtw89_chip_info *chip;
|
||||
|
@ -2465,6 +2465,7 @@ const struct rtw89_chip_info rtw8851b_chip_info = {
|
||||
.dig_regs = &rtw8851b_dig_regs,
|
||||
.tssi_dbw_table = NULL,
|
||||
.support_macid_num = RTW89_MAX_MAC_ID_NUM,
|
||||
.support_link_num = 0,
|
||||
.support_chanctx_num = 0,
|
||||
.support_rnr = false,
|
||||
.support_bands = BIT(NL80211_BAND_2GHZ) |
|
||||
|
@ -2183,6 +2183,7 @@ const struct rtw89_chip_info rtw8852a_chip_info = {
|
||||
.dig_regs = &rtw8852a_dig_regs,
|
||||
.tssi_dbw_table = NULL,
|
||||
.support_macid_num = RTW89_MAX_MAC_ID_NUM,
|
||||
.support_link_num = 0,
|
||||
.support_chanctx_num = 1,
|
||||
.support_rnr = false,
|
||||
.support_bands = BIT(NL80211_BAND_2GHZ) |
|
||||
|
@ -820,6 +820,7 @@ const struct rtw89_chip_info rtw8852b_chip_info = {
|
||||
.dig_regs = &rtw8852b_dig_regs,
|
||||
.tssi_dbw_table = NULL,
|
||||
.support_macid_num = RTW89_MAX_MAC_ID_NUM,
|
||||
.support_link_num = 0,
|
||||
.support_chanctx_num = 0,
|
||||
.support_rnr = false,
|
||||
.support_bands = BIT(NL80211_BAND_2GHZ) |
|
||||
|
@ -753,6 +753,7 @@ const struct rtw89_chip_info rtw8852bt_chip_info = {
|
||||
.dig_regs = &rtw8852bt_dig_regs,
|
||||
.tssi_dbw_table = NULL,
|
||||
.support_macid_num = RTW89_MAX_MAC_ID_NUM,
|
||||
.support_link_num = 0,
|
||||
.support_chanctx_num = 1,
|
||||
.support_rnr = false,
|
||||
.support_bands = BIT(NL80211_BAND_2GHZ) |
|
||||
|
@ -2961,6 +2961,7 @@ const struct rtw89_chip_info rtw8852c_chip_info = {
|
||||
.dig_regs = &rtw8852c_dig_regs,
|
||||
.tssi_dbw_table = &rtw89_8852c_tssi_dbw_table,
|
||||
.support_macid_num = RTW89_MAX_MAC_ID_NUM,
|
||||
.support_link_num = 0,
|
||||
.support_chanctx_num = 2,
|
||||
.support_rnr = false,
|
||||
.support_bands = BIT(NL80211_BAND_2GHZ) |
|
||||
|
@ -2621,6 +2621,7 @@ const struct rtw89_chip_info rtw8922a_chip_info = {
|
||||
.dig_regs = &rtw8922a_dig_regs,
|
||||
.tssi_dbw_table = NULL,
|
||||
.support_macid_num = 32,
|
||||
.support_link_num = 2,
|
||||
.support_chanctx_num = 2,
|
||||
.support_rnr = true,
|
||||
.support_bands = BIT(NL80211_BAND_2GHZ) |
|
||||
|
Loading…
Reference in New Issue
Block a user