Whenever ath11k is bootup with a user country already set, cfg80211
notifies this country info to ath11k soon after registration, where the
notification is sent to the firmware for fetching the rules of this user
country input.
Multiple race conditions could be seen in this scenario where a new
request is either lost as pointed in [1] or a new regd overwrites the
default regd provided by the firmware during bootup. Note that, the
default regd is used for intersection purpose and hence it should not be
overwritten.
The main reason as pointed by [1] is the usage of ATH11K_FLAG_REGISTERED
flag which is updated after completion of core registration, whereas the
reg notification from cfg80211 and wmi events for the corresponding
request can happen much before that. Since the ATH11K_FLAG_REGISTERED is
currently used to determine if the event containing reg rules belong to
default regd or for user request, there is a possibility of the default
regd getting overwritten.
Since the default reg rules will be received only once per pdev on
firmware load, the above flag based check can be replaced with a check
to see if default_regd is already set, so that we can now always update
the new_regd. Also if the new_regd is set, this will be always used to
update the reg rules for the registered phy.
[1] https://patchwork.kernel.org/project/linux-wireless/patch/1829665.1PRlr7bOQj@ripper/
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01460-QCAHKSWPL_SILICONZ-1
Fixes: d5c65159f2
("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Signed-off-by: Sriram R <srirrama@codeaurora.org>
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210721212029.142388-4-jouni@codeaurora.org
36 lines
915 B
C
36 lines
915 B
C
/* SPDX-License-Identifier: BSD-3-Clause-Clear */
|
|
/*
|
|
* Copyright (c) 2019 The Linux Foundation. All rights reserved.
|
|
*/
|
|
|
|
#ifndef ATH11K_REG_H
|
|
#define ATH11K_REG_H
|
|
|
|
#include <linux/kernel.h>
|
|
#include <net/regulatory.h>
|
|
|
|
struct ath11k_base;
|
|
struct ath11k;
|
|
|
|
/* DFS regdomains supported by Firmware */
|
|
enum ath11k_dfs_region {
|
|
ATH11K_DFS_REG_UNSET,
|
|
ATH11K_DFS_REG_FCC,
|
|
ATH11K_DFS_REG_ETSI,
|
|
ATH11K_DFS_REG_MKK,
|
|
ATH11K_DFS_REG_CN,
|
|
ATH11K_DFS_REG_KR,
|
|
ATH11K_DFS_REG_MKK_N,
|
|
ATH11K_DFS_REG_UNDEF,
|
|
};
|
|
|
|
/* ATH11K Regulatory API's */
|
|
void ath11k_reg_init(struct ath11k *ar);
|
|
void ath11k_reg_free(struct ath11k_base *ab);
|
|
void ath11k_regd_update_work(struct work_struct *work);
|
|
struct ieee80211_regdomain *
|
|
ath11k_reg_build_regd(struct ath11k_base *ab,
|
|
struct cur_regulatory_info *reg_info, bool intersect);
|
|
int ath11k_regd_update(struct ath11k *ar);
|
|
int ath11k_reg_update_chan_list(struct ath11k *ar);
|
|
#endif
|