aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/spectmgmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/spectmgmt.c')
-rw-r--r--net/mac80211/spectmgmt.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/net/mac80211/spectmgmt.c b/net/mac80211/spectmgmt.c
index 8396b5a77e8d..8d4ec2968f8f 100644
--- a/net/mac80211/spectmgmt.c
+++ b/net/mac80211/spectmgmt.c
@@ -161,3 +161,24 @@ void ieee80211_process_chanswitch(struct ieee80211_sub_if_data *sdata,
161 jiffies + msecs_to_jiffies(sw_elem->count * bss->beacon_int)); 161 jiffies + msecs_to_jiffies(sw_elem->count * bss->beacon_int));
162 } 162 }
163} 163}
164
165void ieee80211_handle_pwr_constr(struct ieee80211_sub_if_data *sdata,
166 u16 capab_info, u8 *pwr_constr_elem,
167 u8 pwr_constr_elem_len)
168{
169 struct ieee80211_conf *conf = &sdata->local->hw.conf;
170
171 if (!(capab_info & WLAN_CAPABILITY_SPECTRUM_MGMT))
172 return;
173
174 /* Power constraint IE length should be 1 octet */
175 if (pwr_constr_elem_len != 1)
176 return;
177
178 if ((*pwr_constr_elem <= conf->channel->max_power) &&
179 (*pwr_constr_elem != sdata->local->power_constr_level)) {
180 sdata->local->power_constr_level = *pwr_constr_elem;
181 ieee80211_hw_config(sdata->local, 0);
182 }
183}
184