wifi: rtw89: rewrite decision on channel by entity state
authorZong-Zhe Yang <kevin_yang@realtek.com>
Tue, 9 Aug 2022 10:49:40 +0000 (18:49 +0800)
committerKalle Valo <kvalo@kernel.org>
Fri, 2 Sep 2022 08:29:00 +0000 (11:29 +0300)
commit967439c7a2a60923f9b4c8ac925d368af16fb165
tree0cc14902e14bb9ddc9a53870d761d68e6b6a26fd
parent8d40a13bc35da6c68f3beb44d7d4b21ea247366d
wifi: rtw89: rewrite decision on channel by entity state

We need to invoke the callback of the changed band at the first
set_channel() after every power-off. Originally, we forced the
channel to be 0 when doing power-off, and then determined things
by comparing channel with 0.

However, deciding on such things by channel might be confusing.
It's also confusing to use this kind of decision when we consider
multiple channels in the follow-up patches. So, another flag,
entity_active, is added ahead to HAL to deal with this.

Besides, we also need to check if entity is active when we set
TX power.

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-2-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/chan.h [new file with mode: 0644]
drivers/net/wireless/realtek/rtw89/core.c
drivers/net/wireless/realtek/rtw89/core.h
drivers/net/wireless/realtek/rtw89/mac.c
drivers/net/wireless/realtek/rtw89/regd.c
drivers/net/wireless/realtek/rtw89/sar.c