Skip to content

Commit

Permalink
cfg80211: set custom regdomain after wiphy registration
Browse files Browse the repository at this point in the history
commit 1b7b3ac upstream.

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.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210618133832.c96eadcffe80.I86799c2c866b5610b4cf91115c21d8ceb525c5aa@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Miri Korenblit authored and gregkh committed Jun 6, 2022
1 parent 8fbd54a commit b96b4aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/wireless/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
* Copyright 2013-2014 Intel Mobile Communications GmbH
* Copyright 2015-2017 Intel Deutschland GmbH
* Copyright (C) 2018-2020 Intel Corporation
* Copyright (C) 2018-2021 Intel Corporation
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Expand Down Expand Up @@ -918,9 +918,6 @@ int wiphy_register(struct wiphy *wiphy)
return res;
}

/* set up regulatory info */
wiphy_regulatory_register(wiphy);

list_add_rcu(&rdev->list, &cfg80211_rdev_list);
cfg80211_rdev_list_generation++;

Expand All @@ -931,6 +928,9 @@ int wiphy_register(struct wiphy *wiphy)
cfg80211_debugfs_rdev_add(rdev);
nl80211_notify_wiphy(rdev, NL80211_CMD_NEW_WIPHY);

/* set up regulatory info */
wiphy_regulatory_register(wiphy);

if (wiphy->regulatory_flags & REGULATORY_CUSTOM_REG) {
struct regulatory_request request;

Expand Down
1 change: 1 addition & 0 deletions net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -4001,6 +4001,7 @@ void wiphy_regulatory_register(struct wiphy *wiphy)

wiphy_update_regulatory(wiphy, lr->initiator);
wiphy_all_share_dfs_chan_state(wiphy);
reg_process_self_managed_hints();
}

void wiphy_regulatory_deregister(struct wiphy *wiphy)
Expand Down

0 comments on commit b96b4aa

Please sign in to comment.