We used to set regulatory info before the registration of the device and then the regulatory info didn't get set, because the device isn't registered so there isn't a device to set the regulatory info for. So set the regulatory info after the device registration. Call reg_process_self_managed_hints() once again after the device registration because it does nothing before it.
Unified · Split
| @@ -5,7 +5,7 @@ · 4 unmodified lines | ||
| 5 | 5 | * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net> |
| 6 | 6 | * Copyright 2013-2014 Intel Mobile Communications GmbH |
| 7 | 7 | * Copyright 2015-2017 Intel Deutschland GmbH |
| 8 | − * Copyright (C) 2018-2020 Intel Corporation | |
| 8 | + * Copyright (C) 2018-2021 Intel Corporation | |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | 11 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| @@ -928,9 +928,6 @@ int wiphy_register(struct wiphy *wiphy) · 916 unmodified lines | ||
| 928 | 928 | return res; |
| 929 | 929 | } |
| 930 | 930 | |
| 931 | − /* set up regulatory info */ | |
| 932 | − wiphy_regulatory_register(wiphy); | |
| 933 | − | |
| 934 | 931 | list_add_rcu(&rdev->list, &cfg80211_rdev_list); |
| 935 | 932 | cfg80211_rdev_list_generation++; |
| 936 | 933 | |
| @@ -941,6 +938,9 @@ int wiphy_register(struct wiphy *wiphy) · 4 unmodified lines | ||
| 941 | 938 | cfg80211_debugfs_rdev_add(rdev); |
| 942 | 939 | nl80211_notify_wiphy(rdev, NL80211_CMD_NEW_WIPHY); |
| 943 | 940 | |
| 941 | + /* set up regulatory info */ | |
| 942 | + wiphy_regulatory_register(wiphy); | |
| 943 | + | |
| 944 | 944 | if (wiphy->regulatory_flags & REGULATORY_CUSTOM_REG) { |
| 945 | 945 | struct regulatory_request request; |
| 946 | 946 | |
| @@ -4051,6 +4051,7 @@ void wiphy_regulatory_register(struct wiphy *wiphy) · 4050 unmodified lines | ||
| 4051 | 4051 | |
| 4052 | 4052 | wiphy_update_regulatory(wiphy, lr->initiator); |
| 4053 | 4053 | wiphy_all_share_dfs_chan_state(wiphy); |
| 4054 | + reg_process_self_managed_hints(); | |
| 4054 | 4055 | } |
| 4055 | 4056 | |
| 4056 | 4057 | void wiphy_regulatory_deregister(struct wiphy *wiphy) |