diff options
| author | Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com> | 2025-11-10 14:10:29 +0200 |
|---|---|---|
| committer | Johannes Berg <johannes.berg@intel.com> | 2025-11-11 11:05:00 +0100 |
| commit | e18efacc9c2f17b12c6e019cabad70a2989bd3a9 (patch) | |
| tree | 8bacd2ba189806eae1ea428fb8db785f5f3e54f3 /include/net | |
| parent | 706edca67984faa3d83e397334fa5ec4190f63ba (diff) | |
| download | tip-e18efacc9c2f17b12c6e019cabad70a2989bd3a9.tar.gz | |
wifi: cfg80211/mac80211: clean up duplicate ap_power handling
Move duplicated ap_power type handling code to an inline
function in cfg80211.
Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20251110140806.959948da1cb5.I893b5168329fb3232f249c182a35c99804112da6@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/cfg80211.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index d87c18e1b1334f..1b257eaf8de571 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -10135,6 +10135,30 @@ static inline int cfg80211_color_change_notify(struct net_device *dev, } /** + * cfg80211_6ghz_power_type - determine AP regulatory power type + * @control: control flags + * + * Return: regulatory power type from &enum ieee80211_ap_reg_power + */ +static inline enum ieee80211_ap_reg_power +cfg80211_6ghz_power_type(u8 control) +{ + switch (u8_get_bits(control, IEEE80211_HE_6GHZ_OPER_CTRL_REG_INFO)) { + case IEEE80211_6GHZ_CTRL_REG_LPI_AP: + case IEEE80211_6GHZ_CTRL_REG_INDOOR_LPI_AP: + return IEEE80211_REG_LPI_AP; + case IEEE80211_6GHZ_CTRL_REG_SP_AP: + case IEEE80211_6GHZ_CTRL_REG_INDOOR_SP_AP: + case IEEE80211_6GHZ_CTRL_REG_INDOOR_SP_AP_OLD: + return IEEE80211_REG_SP_AP; + case IEEE80211_6GHZ_CTRL_REG_VLP_AP: + return IEEE80211_REG_VLP_AP; + default: + return IEEE80211_REG_UNSET_AP; + } +} + +/** * cfg80211_links_removed - Notify about removed STA MLD setup links. * @dev: network device. * @link_mask: BIT mask of removed STA MLD setup link IDs. |
