wifi: ath11k: fix CAC running state during virtual interface start
authorAditya Kumar Singh <quic_adisi@quicinc.com>
Tue, 3 Oct 2023 14:26:54 +0000 (17:26 +0300)
committerKalle Valo <quic_kvalo@quicinc.com>
Thu, 5 Oct 2023 06:22:45 +0000 (09:22 +0300)
commit69fcb525905600a151997cd16367bb92c34a2b14
treedf3258757339f76ed3c4d0aff5ed9ee5fc94e2bb
parent322a487c53f84e4586f5bbed33bd373e25abfe42
wifi: ath11k: fix CAC running state during virtual interface start

Currently channel definition's primary channel's DFS CAC time
as well as primary channel's state i.e usable are used to set
the CAC_RUNNING flag for the ath11k radio structure. However,
this is wrong since certain channel definition are possbile
where primary channel may not be a DFS channel but, secondary
channel is a DFS channel. For example - channel 36 with 160 MHz
bandwidth.
In such cases, the flag will not be set which is wrong.

Fix this issue by using cfg80211_chandef_dfs_usable() function
from cfg80211 which return trues if at least one channel is in
usable state.

While at it, modify the CAC running debug log message to print
the CAC time as well in milli-seconds.

Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20230912051857.2284-3-quic_adisi@quicinc.com
drivers/net/wireless/ath/ath11k/mac.c