aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r--net/mac80211/main.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 07f812755e55..c936017f6d48 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -197,31 +197,34 @@ int ieee80211_if_config(struct ieee80211_sub_if_data *sdata, u32 changed)
197 &sdata->vif, &conf); 197 &sdata->vif, &conf);
198} 198}
199 199
200int ieee80211_hw_config(struct ieee80211_local *local) 200int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
201{ 201{
202 struct ieee80211_channel *chan; 202 struct ieee80211_channel *chan;
203 int ret = 0; 203 int ret = 0;
204 int power;
204 205
205 if (local->sw_scanning) 206 if (local->sw_scanning)
206 chan = local->scan_channel; 207 chan = local->scan_channel;
207 else 208 else
208 chan = local->oper_channel; 209 chan = local->oper_channel;
209 210
210 local->hw.conf.channel = chan; 211 if (chan != local->hw.conf.channel) {
212 local->hw.conf.channel = chan;
213 changed |= IEEE80211_CONF_CHANGE_CHANNEL;
214 }
215
211 216
212 if (!local->hw.conf.power_level) 217 if (!local->hw.conf.power_level)
213 local->hw.conf.power_level = chan->max_power; 218 power = chan->max_power;
214 else 219 else
215 local->hw.conf.power_level = min(chan->max_power, 220 power = min(chan->max_power, local->hw.conf.power_level);
216 local->hw.conf.power_level); 221 if (local->hw.conf.power_level != power) {
217 222 changed |= IEEE80211_CONF_CHANGE_POWER;
218#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 223 local->hw.conf.power_level = power;
219 printk(KERN_DEBUG "%s: HW CONFIG: freq=%d\n", 224 }
220 wiphy_name(local->hw.wiphy), chan->center_freq);
221#endif
222 225
223 if (local->open_count) { 226 if (changed && local->open_count) {
224 ret = local->ops->config(local_to_hw(local), &local->hw.conf); 227 ret = local->ops->config(local_to_hw(local), changed);
225 /* 228 /*
226 * HW reconfiguration should never fail, the driver has told 229 * HW reconfiguration should never fail, the driver has told
227 * us what it can support so it should live up to that promise. 230 * us what it can support so it should live up to that promise.
@@ -672,7 +675,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
672 local->fragmentation_threshold = IEEE80211_MAX_FRAG_THRESHOLD; 675 local->fragmentation_threshold = IEEE80211_MAX_FRAG_THRESHOLD;
673 local->short_retry_limit = 7; 676 local->short_retry_limit = 7;
674 local->long_retry_limit = 4; 677 local->long_retry_limit = 4;
675 local->hw.conf.radio_enabled = 1; 678 local->hw.conf.radio_enabled = true;
676 679
677 INIT_LIST_HEAD(&local->interfaces); 680 INIT_LIST_HEAD(&local->interfaces);
678 681