|
1 | 1 | // SPDX-License-Identifier: BSD-3-Clause-Clear |
2 | 2 | /* |
3 | 3 | * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. |
4 | | - * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. |
| 4 | + * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved. |
5 | 5 | */ |
6 | 6 | #include <linux/rtnetlink.h> |
7 | 7 |
|
@@ -55,6 +55,19 @@ ath11k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request) |
55 | 55 | ath11k_dbg(ar->ab, ATH11K_DBG_REG, |
56 | 56 | "Regulatory Notification received for %s\n", wiphy_name(wiphy)); |
57 | 57 |
|
| 58 | + if (request->initiator == NL80211_REGDOM_SET_BY_DRIVER) { |
| 59 | + ath11k_dbg(ar->ab, ATH11K_DBG_REG, |
| 60 | + "driver initiated regd update\n"); |
| 61 | + if (ar->state != ATH11K_STATE_ON) |
| 62 | + return; |
| 63 | + |
| 64 | + ret = ath11k_reg_update_chan_list(ar, true); |
| 65 | + if (ret) |
| 66 | + ath11k_warn(ar->ab, "failed to update channel list: %d\n", ret); |
| 67 | + |
| 68 | + return; |
| 69 | + } |
| 70 | + |
58 | 71 | /* Currently supporting only General User Hints. Cell base user |
59 | 72 | * hints to be handled later. |
60 | 73 | * Hints from other sources like Core, Beacons are not expected for |
@@ -293,12 +306,6 @@ int ath11k_regd_update(struct ath11k *ar) |
293 | 306 | if (ret) |
294 | 307 | goto err; |
295 | 308 |
|
296 | | - if (ar->state == ATH11K_STATE_ON) { |
297 | | - ret = ath11k_reg_update_chan_list(ar, true); |
298 | | - if (ret) |
299 | | - goto err; |
300 | | - } |
301 | | - |
302 | 309 | return 0; |
303 | 310 | err: |
304 | 311 | ath11k_warn(ab, "failed to perform regd update : %d\n", ret); |
@@ -977,6 +984,7 @@ void ath11k_regd_update_work(struct work_struct *work) |
977 | 984 | void ath11k_reg_init(struct ath11k *ar) |
978 | 985 | { |
979 | 986 | ar->hw->wiphy->regulatory_flags = REGULATORY_WIPHY_SELF_MANAGED; |
| 987 | + ar->hw->wiphy->flags |= WIPHY_FLAG_NOTIFY_REGDOM_BY_DRIVER; |
980 | 988 | ar->hw->wiphy->reg_notifier = ath11k_reg_notifier; |
981 | 989 | } |
982 | 990 |
|
|
0 commit comments