diff options
author | Zong-Zhe Yang <kevin_yang@realtek.com> | 2022-08-09 18:49:51 +0800 |
---|---|---|
committer | Kalle Valo <kvalo@kernel.org> | 2022-09-02 11:29:03 +0300 |
commit | 7fc06a071cd5f5e60ed799f6ab37e8901bd91f82 (patch) | |
tree | fd02c22de6b6e947784ecfe623b36beecba9e0f8 /drivers/net/wireless/realtek/rtw89/chan.c | |
parent | 84b50f4187fcd71efb4ad8ad337d30055f1c996b (diff) | |
download | linux-7fc06a071cd5f5e60ed799f6ab37e8901bd91f82.tar.gz |
wifi: rtw89: declare support for mac80211 chanctx ops by chip
Some HW features are required if we hook chanctx ops to mac80211. With it,
mac80211 would expect the HW-supported variant ops exists on some behavior,
e.g. HW scan. But, HW features may depend on chip's FW or its development.
Besides, how many chanctx can be supported also depends on chip design.
We can neither decide whether to generally support chanctx ops nor how many
chanctx can be supported.
So, support_chanctx_num is added under chip info to deal with this by chip.
For now, all chip configure support_chanctx_num as 0. We haven't really
hook chanctx ops yet. So, chip can run without mac80211 chanctx as before.
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220809104952.61355-13-pkshih@realtek.com
Diffstat (limited to 'drivers/net/wireless/realtek/rtw89/chan.c')
-rw-r--r-- | drivers/net/wireless/realtek/rtw89/chan.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/realtek/rtw89/chan.c b/drivers/net/wireless/realtek/rtw89/chan.c index cccbd9c8c59b..a4f61c2f6512 100644 --- a/drivers/net/wireless/realtek/rtw89/chan.c +++ b/drivers/net/wireless/realtek/rtw89/chan.c @@ -185,10 +185,11 @@ int rtw89_chanctx_ops_add(struct rtw89_dev *rtwdev, { struct rtw89_hal *hal = &rtwdev->hal; struct rtw89_chanctx_cfg *cfg = (struct rtw89_chanctx_cfg *)ctx->drv_priv; + const struct rtw89_chip_info *chip = rtwdev->chip; u8 idx; idx = find_first_zero_bit(hal->entity_map, NUM_OF_RTW89_SUB_ENTITY); - if (idx > RTW89_SUB_ENTITY_0) + if (idx >= chip->support_chanctx_num) return -ENOENT; rtw89_config_entity_chandef(rtwdev, idx, &ctx->def); |