wifi: rtw89: link rtw89_vif and chanctx stuffs
authorZong-Zhe Yang <kevin_yang@realtek.com>
Tue, 29 Nov 2022 08:31:30 +0000 (16:31 +0800)
committerKalle Valo <kvalo@kernel.org>
Thu, 1 Dec 2022 11:04:27 +0000 (13:04 +0200)
commit75ee07b03fc6ec0a7ac7407f9ea7b3e981efb28f
treee59cc0b6a0709808df30ceeed35bfe8be834e116
parentc008c4b011baa26b9545f7be10e746c97409d45b
wifi: rtw89: link rtw89_vif and chanctx stuffs

First, introduce struct rtw89_sub_entity for chanctx related stuffs.
Second, add enum rtw89_sub_entity_idx to rtw89_vif for vif operation
to access its/right chanctx stuffs after future multi-channel support.

Besides, RTW89_SUB_ENTITY_0 is the default chanctx entry throughout
driver, i.e. it's used for things which may not have a target chanctx
yet. So, we need to ensure that RTW89_SUB_ENTITY_0 is always working.
If there is at least one alive chanctx, then one of them must take
RTW89_SUB_ENTITY_0. If no alive chanctx, RTW89_SUB_ENTITY_0 will be
filled by rtw89_config_default_chandef().

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/20221129083130.45708-7-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/chan.c
drivers/net/wireless/realtek/rtw89/core.h
drivers/net/wireless/realtek/rtw89/mac80211.c