4bae8cbb59a54e4e50cc3c7094a7eda42db87538
[librecmc/librecmc.git] / package / mac80211 / patches / 420-mac80211-hw-conf-change-flags.patch
1 Subject: mac80211: introduce hw config change flags
2
3 This makes mac80211 notify the driver which configuration
4 actually changed, e.g. channel etc.
5
6 No driver changes, this is just plumbing, driver authors are
7 expected to act on this if they want to.
8
9 Also remove the HW CONFIG debug printk, it's incorrect, often
10 we configure something else.
11
12 Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
13 ---
14  drivers/net/wireless/adm8211.c              |    3 +-
15  drivers/net/wireless/at76_usb.c             |    3 +-
16  drivers/net/wireless/ath5k/base.c           |    7 ++----
17  drivers/net/wireless/ath9k/main.c           |    4 +--
18  drivers/net/wireless/b43/main.c             |    3 +-
19  drivers/net/wireless/b43legacy/main.c       |    3 +-
20  drivers/net/wireless/iwlwifi/iwl-agn.c      |    3 +-
21  drivers/net/wireless/iwlwifi/iwl3945-base.c |    7 +++---
22  drivers/net/wireless/libertas_tf/main.c     |    4 ++-
23  drivers/net/wireless/mac80211_hwsim.c       |    4 +--
24  drivers/net/wireless/p54/p54common.c        |    3 +-
25  drivers/net/wireless/rt2x00/rt2x00.h        |    2 -
26  drivers/net/wireless/rt2x00/rt2x00dev.c     |    2 -
27  drivers/net/wireless/rt2x00/rt2x00mac.c     |    3 +-
28  drivers/net/wireless/rtl8180_dev.c          |    3 +-
29  drivers/net/wireless/rtl8187_dev.c          |    3 +-
30  drivers/net/wireless/zd1211rw/zd_mac.c      |    4 ++-
31  include/net/mac80211.h                      |   30 +++++++++++++++++++++++-----
32  net/mac80211/cfg.c                          |    3 +-
33  net/mac80211/ieee80211_i.h                  |    2 -
34  net/mac80211/iface.c                        |   25 +++++++++++++++++------
35  net/mac80211/main.c                         |   29 ++++++++++++++-------------
36  net/mac80211/scan.c                         |   12 ++++++++---
37  net/mac80211/util.c                         |    3 +-
38  net/mac80211/wext.c                         |   14 ++++++-------
39  25 files changed, 118 insertions(+), 61 deletions(-)
40
41 --- a/include/net/mac80211.h
42 +++ b/include/net/mac80211.h
43 @@ -464,12 +464,32 @@ static inline int __deprecated __IEEE802
44  #define IEEE80211_CONF_SHORT_SLOT_TIME (__IEEE80211_CONF_SHORT_SLOT_TIME())
45  
46  /**
47 + * enum ieee80211_conf_changed - denotes which configuration changed
48 + *
49 + * @IEEE80211_CONF_CHANGE_RADIO_ENABLED: the value of radio_enabled changed
50 + * @IEEE80211_CONF_CHANGE_BEACON_INTERVAL: the beacon interval changed
51 + * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed
52 + * @IEEE80211_CONF_CHANGE_RADIOTAP: the radiotap flag changed
53 + * @IEEE80211_CONF_CHANGE_PS: the PS flag changed
54 + * @IEEE80211_CONF_CHANGE_POWER: the TX power changed
55 + * @IEEE80211_CONF_CHANGE_CHANNEL: the channel changed
56 + */
57 +enum ieee80211_conf_changed {
58 +       IEEE80211_CONF_CHANGE_RADIO_ENABLED     = BIT(0),
59 +       IEEE80211_CONF_CHANGE_BEACON_INTERVAL   = BIT(1),
60 +       IEEE80211_CONF_CHANGE_LISTEN_INTERVAL   = BIT(2),
61 +       IEEE80211_CONF_CHANGE_RADIOTAP          = BIT(3),
62 +       IEEE80211_CONF_CHANGE_PS                = BIT(4),
63 +       IEEE80211_CONF_CHANGE_POWER             = BIT(5),
64 +       IEEE80211_CONF_CHANGE_CHANNEL           = BIT(6),
65 +};
66 +
67 +/**
68   * struct ieee80211_conf - configuration of the device
69   *
70   * This struct indicates how the driver shall configure the hardware.
71   *
72   * @radio_enabled: when zero, driver is required to switch off the radio.
73 - *     TODO make a flag
74   * @beacon_int: beacon interval (TODO make interface config)
75   * @listen_interval: listen interval in units of beacon interval
76   * @flags: configuration flags defined above
77 @@ -479,13 +499,13 @@ static inline int __deprecated __IEEE802
78   * @channel: the channel to tune to
79   */
80  struct ieee80211_conf {
81 -       int radio_enabled;
82 -
83         int beacon_int;
84 -       u16 listen_interval;
85         u32 flags;
86         int power_level;
87  
88 +       u16 listen_interval;
89 +       bool radio_enabled;
90 +
91         struct ieee80211_channel *channel;
92  
93         struct ieee80211_sta_ht_cap ht_cap;
94 @@ -1213,7 +1233,7 @@ struct ieee80211_ops {
95                              struct ieee80211_if_init_conf *conf);
96         void (*remove_interface)(struct ieee80211_hw *hw,
97                                  struct ieee80211_if_init_conf *conf);
98 -       int (*config)(struct ieee80211_hw *hw, struct ieee80211_conf *conf);
99 +       int (*config)(struct ieee80211_hw *hw, u32 changed);
100         int (*config_interface)(struct ieee80211_hw *hw,
101                                 struct ieee80211_vif *vif,
102                                 struct ieee80211_if_conf *conf);
103 --- a/net/mac80211/cfg.c
104 +++ b/net/mac80211/cfg.c
105 @@ -394,7 +394,8 @@ static int ieee80211_config_beacon(struc
106          */
107         if (params->interval) {
108                 sdata->local->hw.conf.beacon_int = params->interval;
109 -               ieee80211_hw_config(sdata->local);
110 +               ieee80211_hw_config(sdata->local,
111 +                                   IEEE80211_CONF_CHANGE_BEACON_INTERVAL);
112                 /*
113                  * We updated some parameter so if below bails out
114                  * it's not an error.
115 --- a/net/mac80211/ieee80211_i.h
116 +++ b/net/mac80211/ieee80211_i.h
117 @@ -880,7 +880,7 @@ static inline int ieee80211_bssid_match(
118  }
119  
120  
121 -int ieee80211_hw_config(struct ieee80211_local *local);
122 +int ieee80211_hw_config(struct ieee80211_local *local, u32 changed);
123  int ieee80211_if_config(struct ieee80211_sub_if_data *sdata, u32 changed);
124  void ieee80211_tx_set_protected(struct ieee80211_tx_data *tx);
125  void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
126 --- a/net/mac80211/iface.c
127 +++ b/net/mac80211/iface.c
128 @@ -65,7 +65,7 @@ static int ieee80211_open(struct net_dev
129         struct ieee80211_if_init_conf conf;
130         u32 changed = 0;
131         int res;
132 -       bool need_hw_reconfig = 0;
133 +       u32 hw_reconf_flags = 0;
134         u8 null_addr[ETH_ALEN] = {0};
135  
136         /* fail early if user set an invalid address */
137 @@ -152,7 +152,8 @@ static int ieee80211_open(struct net_dev
138                         res = local->ops->start(local_to_hw(local));
139                 if (res)
140                         goto err_del_bss;
141 -               need_hw_reconfig = 1;
142 +               /* we're brought up, everything changes */
143 +               hw_reconf_flags = ~0;
144                 ieee80211_led_radio(local, local->hw.conf.radio_enabled);
145         }
146  
147 @@ -198,8 +199,10 @@ static int ieee80211_open(struct net_dev
148  
149                 /* must be before the call to ieee80211_configure_filter */
150                 local->monitors++;
151 -               if (local->monitors == 1)
152 +               if (local->monitors == 1) {
153                         local->hw.conf.flags |= IEEE80211_CONF_RADIOTAP;
154 +                       hw_reconf_flags |= IEEE80211_CONF_CHANGE_RADIOTAP;
155 +               }
156  
157                 if (sdata->u.mntr_flags & MONITOR_FLAG_FCSFAIL)
158                         local->fif_fcsfail++;
159 @@ -279,8 +282,8 @@ static int ieee80211_open(struct net_dev
160                 atomic_inc(&local->iff_promiscs);
161  
162         local->open_count++;
163 -       if (need_hw_reconfig) {
164 -               ieee80211_hw_config(local);
165 +       if (hw_reconf_flags) {
166 +               ieee80211_hw_config(local, hw_reconf_flags);
167                 /*
168                  * set default queue parameters so drivers don't
169                  * need to initialise the hardware if the hardware
170 @@ -322,6 +325,7 @@ static int ieee80211_stop(struct net_dev
171         struct ieee80211_local *local = sdata->local;
172         struct ieee80211_if_init_conf conf;
173         struct sta_info *sta;
174 +       u32 hw_reconf_flags = 0;
175  
176         /*
177          * Stop TX on this interface first.
178 @@ -405,8 +409,10 @@ static int ieee80211_stop(struct net_dev
179                 }
180  
181                 local->monitors--;
182 -               if (local->monitors == 0)
183 +               if (local->monitors == 0) {
184                         local->hw.conf.flags &= ~IEEE80211_CONF_RADIOTAP;
185 +                       hw_reconf_flags |= IEEE80211_CONF_CHANGE_RADIOTAP;
186 +               }
187  
188                 if (sdata->u.mntr_flags & MONITOR_FLAG_FCSFAIL)
189                         local->fif_fcsfail--;
190 @@ -504,8 +510,15 @@ static int ieee80211_stop(struct net_dev
191  
192                 tasklet_disable(&local->tx_pending_tasklet);
193                 tasklet_disable(&local->tasklet);
194 +
195 +               /* no reconfiguring after stop! */
196 +               hw_reconf_flags = 0;
197         }
198  
199 +       /* do after stop to avoid reconfiguring when we stop anyway */
200 +       if (hw_reconf_flags)
201 +               ieee80211_hw_config(local, hw_reconf_flags);
202 +
203         return 0;
204  }
205  
206 --- a/net/mac80211/main.c
207 +++ b/net/mac80211/main.c
208 @@ -197,31 +197,34 @@ int ieee80211_if_config(struct ieee80211
209                                             &sdata->vif, &conf);
210  }
211  
212 -int ieee80211_hw_config(struct ieee80211_local *local)
213 +int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
214  {
215         struct ieee80211_channel *chan;
216         int ret = 0;
217 +       int power;
218  
219         if (local->sw_scanning)
220                 chan = local->scan_channel;
221         else
222                 chan = local->oper_channel;
223  
224 -       local->hw.conf.channel = chan;
225 +       if (chan != local->hw.conf.channel) {
226 +               local->hw.conf.channel = chan;
227 +               changed |= IEEE80211_CONF_CHANGE_CHANNEL;
228 +       }
229 +
230  
231         if (!local->hw.conf.power_level)
232 -               local->hw.conf.power_level = chan->max_power;
233 +               power = chan->max_power;
234         else
235 -               local->hw.conf.power_level = min(chan->max_power,
236 -                                              local->hw.conf.power_level);
237 -
238 -#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
239 -       printk(KERN_DEBUG "%s: HW CONFIG: freq=%d\n",
240 -              wiphy_name(local->hw.wiphy), chan->center_freq);
241 -#endif
242 +               power = min(chan->max_power, local->hw.conf.power_level);
243 +       if (local->hw.conf.power_level != power) {
244 +               changed |= IEEE80211_CONF_CHANGE_POWER;
245 +               local->hw.conf.power_level = power;
246 +       }
247  
248 -       if (local->open_count) {
249 -               ret = local->ops->config(local_to_hw(local), &local->hw.conf);
250 +       if (changed && local->open_count) {
251 +               ret = local->ops->config(local_to_hw(local), changed);
252                 /*
253                  * HW reconfiguration should never fail, the driver has told
254                  * us what it can support so it should live up to that promise.
255 @@ -672,7 +675,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(
256         local->fragmentation_threshold = IEEE80211_MAX_FRAG_THRESHOLD;
257         local->short_retry_limit = 7;
258         local->long_retry_limit = 4;
259 -       local->hw.conf.radio_enabled = 1;
260 +       local->hw.conf.radio_enabled = true;
261  
262         INIT_LIST_HEAD(&local->interfaces);
263  
264 --- a/net/mac80211/scan.c
265 +++ b/net/mac80211/scan.c
266 @@ -447,12 +447,17 @@ void ieee80211_scan_completed(struct iee
267  
268         if (local->hw_scanning) {
269                 local->hw_scanning = false;
270 -               ieee80211_hw_config(local);
271 +               /*
272 +                * Somebody might have requested channel change during scan
273 +                * that we won't have acted upon, try now. ieee80211_hw_config
274 +                * will set the flag based on actual changes.
275 +                */
276 +               ieee80211_hw_config(local, 0);
277                 goto done;
278         }
279  
280         local->sw_scanning = false;
281 -       ieee80211_hw_config(local);
282 +       ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
283  
284         netif_tx_lock_bh(local->mdev);
285         netif_addr_lock(local->mdev);
286 @@ -539,7 +544,8 @@ void ieee80211_scan_work(struct work_str
287  
288                 if (!skip) {
289                         local->scan_channel = chan;
290 -                       if (ieee80211_hw_config(local))
291 +                       if (ieee80211_hw_config(local,
292 +                                               IEEE80211_CONF_CHANGE_CHANNEL))
293                                 skip = 1;
294                 }
295  
296 --- a/net/mac80211/util.c
297 +++ b/net/mac80211/util.c
298 @@ -645,7 +645,8 @@ int ieee80211_set_freq(struct ieee80211_
299                 if (local->sw_scanning || local->hw_scanning)
300                         ret = 0;
301                 else
302 -                       ret = ieee80211_hw_config(local);
303 +                       ret = ieee80211_hw_config(
304 +                               local, IEEE80211_CONF_CHANGE_CHANNEL);
305  
306                 rate_control_clear(local);
307         }
308 --- a/net/mac80211/wext.c
309 +++ b/net/mac80211/wext.c
310 @@ -656,7 +656,7 @@ static int ieee80211_ioctl_siwtxpower(st
311                                       union iwreq_data *data, char *extra)
312  {
313         struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
314 -       bool need_reconfig = 0;
315 +       u32 reconf_flags = 0;
316         int new_power_level;
317  
318         if ((data->txpower.flags & IW_TXPOW_TYPE) != IW_TXPOW_DBM)
319 @@ -680,17 +680,17 @@ static int ieee80211_ioctl_siwtxpower(st
320  
321         if (local->hw.conf.power_level != new_power_level) {
322                 local->hw.conf.power_level = new_power_level;
323 -               need_reconfig = 1;
324 +               reconf_flags |= IEEE80211_CONF_CHANGE_POWER;
325         }
326  
327         if (local->hw.conf.radio_enabled != !(data->txpower.disabled)) {
328                 local->hw.conf.radio_enabled = !(data->txpower.disabled);
329 -               need_reconfig = 1;
330 +               reconf_flags |= IEEE80211_CONF_CHANGE_RADIO_ENABLED;
331                 ieee80211_led_radio(local, local->hw.conf.radio_enabled);
332         }
333  
334 -       if (need_reconfig)
335 -               ieee80211_hw_config(local);
336 +       if (reconf_flags)
337 +               ieee80211_hw_config(local, reconf_flags);
338  
339         return 0;
340  }
341 @@ -976,7 +976,7 @@ static int ieee80211_ioctl_siwpower(stru
342  
343         if (wrq->disabled) {
344                 conf->flags &= ~IEEE80211_CONF_PS;
345 -               return ieee80211_hw_config(local);
346 +               return ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
347         }
348  
349         switch (wrq->flags & IW_POWER_MODE) {
350 @@ -989,7 +989,7 @@ static int ieee80211_ioctl_siwpower(stru
351                 return -EINVAL;
352         }
353  
354 -       return ieee80211_hw_config(local);
355 +       return ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
356  }
357  
358  static int ieee80211_ioctl_giwpower(struct net_device *dev,
359 --- a/drivers/net/wireless/adm8211.c
360 +++ b/drivers/net/wireless/adm8211.c
361 @@ -1314,9 +1314,10 @@ static int adm8211_set_ssid(struct ieee8
362         return 0;
363  }
364  
365 -static int adm8211_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf)
366 +static int adm8211_config(struct ieee80211_hw *dev, u32 changed)
367  {
368         struct adm8211_priv *priv = dev->priv;
369 +       struct ieee80211_conf *conf = &dev->conf;
370         int channel = ieee80211_frequency_to_channel(conf->channel->center_freq);
371  
372         if (channel != priv->channel) {
373 --- a/drivers/net/wireless/at76_usb.c
374 +++ b/drivers/net/wireless/at76_usb.c
375 @@ -2057,9 +2057,10 @@ exit:
376         return 0;
377  }
378  
379 -static int at76_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)
380 +static int at76_config(struct ieee80211_hw *hw, u32 changed)
381  {
382         struct at76_priv *priv = hw->priv;
383 +       struct ieee80211_conf *conf = &hw->conf;
384  
385         at76_dbg(DBG_MAC80211, "%s(): channel %d radio %d",
386                  __func__, conf->channel->hw_value, conf->radio_enabled);
387 --- a/drivers/net/wireless/ath5k/base.c
388 +++ b/drivers/net/wireless/ath5k/base.c
389 @@ -219,8 +219,7 @@ static int ath5k_add_interface(struct ie
390                 struct ieee80211_if_init_conf *conf);
391  static void ath5k_remove_interface(struct ieee80211_hw *hw,
392                 struct ieee80211_if_init_conf *conf);
393 -static int ath5k_config(struct ieee80211_hw *hw,
394 -               struct ieee80211_conf *conf);
395 +static int ath5k_config(struct ieee80211_hw *hw, u32 changed);
396  static int ath5k_config_interface(struct ieee80211_hw *hw,
397                 struct ieee80211_vif *vif,
398                 struct ieee80211_if_conf *conf);
399 @@ -2767,10 +2766,10 @@ end:
400   * TODO: Phy disable/diversity etc
401   */
402  static int
403 -ath5k_config(struct ieee80211_hw *hw,
404 -                       struct ieee80211_conf *conf)
405 +ath5k_config(struct ieee80211_hw *hw, u32 changed)
406  {
407         struct ath5k_softc *sc = hw->priv;
408 +       struct ieee80211_conf *conf = &hw->conf;
409  
410         sc->bintval = conf->beacon_int;
411         sc->power_level = conf->power_level;
412 --- a/drivers/net/wireless/ath9k/main.c
413 +++ b/drivers/net/wireless/ath9k/main.c
414 @@ -1231,11 +1231,11 @@ static void ath9k_remove_interface(struc
415                         __func__, error);
416  }
417  
418 -static int ath9k_config(struct ieee80211_hw *hw,
419 -                       struct ieee80211_conf *conf)
420 +static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
421  {
422         struct ath_softc *sc = hw->priv;
423         struct ieee80211_channel *curchan = hw->conf.channel;
424 +       struct ieee80211_conf *conf = &hw->conf;
425         int pos;
426  
427         DPRINTF(sc, ATH_DBG_CONFIG, "%s: Set channel: %d MHz\n",
428 --- a/drivers/net/wireless/b43/main.c
429 +++ b/drivers/net/wireless/b43/main.c
430 @@ -3320,11 +3320,12 @@ init_failure:
431         return err;
432  }
433  
434 -static int b43_op_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)
435 +static int b43_op_config(struct ieee80211_hw *hw, u32 changed)
436  {
437         struct b43_wl *wl = hw_to_b43_wl(hw);
438         struct b43_wldev *dev;
439         struct b43_phy *phy;
440 +       struct ieee80211_conf *conf = &hw->conf;
441         unsigned long flags;
442         int antenna;
443         int err = 0;
444 --- a/drivers/net/wireless/b43legacy/main.c
445 +++ b/drivers/net/wireless/b43legacy/main.c
446 @@ -2557,11 +2557,12 @@ init_failure:
447  }
448  
449  static int b43legacy_op_dev_config(struct ieee80211_hw *hw,
450 -                                  struct ieee80211_conf *conf)
451 +                                  u32 changed)
452  {
453         struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw);
454         struct b43legacy_wldev *dev;
455         struct b43legacy_phy *phy;
456 +       struct ieee80211_conf *conf = &hw->conf;
457         unsigned long flags;
458         unsigned int new_phymode = 0xFFFF;
459         int antenna_tx;
460 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c
461 +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
462 @@ -2760,10 +2760,11 @@ static int iwl4965_mac_add_interface(str
463   * be set inappropriately and the driver currently sets the hardware up to
464   * use it whenever needed.
465   */
466 -static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)
467 +static int iwl4965_mac_config(struct ieee80211_hw *hw, u32 changed)
468  {
469         struct iwl_priv *priv = hw->priv;
470         const struct iwl_channel_info *ch_info;
471 +       struct ieee80211_conf *conf = &hw->conf;
472         unsigned long flags;
473         int ret = 0;
474         u16 channel;
475 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
476 +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
477 @@ -6427,7 +6427,7 @@ static void iwl3945_bg_abort_scan(struct
478         mutex_unlock(&priv->mutex);
479  }
480  
481 -static int iwl3945_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf);
482 +static int iwl3945_mac_config(struct ieee80211_hw *hw, u32 changed);
483  
484  static void iwl3945_bg_scan_completed(struct work_struct *work)
485  {
486 @@ -6440,7 +6440,7 @@ static void iwl3945_bg_scan_completed(st
487                 return;
488  
489         if (test_bit(STATUS_CONF_PENDING, &priv->status))
490 -               iwl3945_mac_config(priv->hw, ieee80211_get_hw_conf(priv->hw));
491 +               iwl3945_mac_config(priv->hw, 0);
492  
493         ieee80211_scan_completed(priv->hw);
494  
495 @@ -6629,10 +6629,11 @@ static int iwl3945_mac_add_interface(str
496   * be set inappropriately and the driver currently sets the hardware up to
497   * use it whenever needed.
498   */
499 -static int iwl3945_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)
500 +static int iwl3945_mac_config(struct ieee80211_hw *hw, u32 changed)
501  {
502         struct iwl3945_priv *priv = hw->priv;
503         const struct iwl3945_channel_info *ch_info;
504 +       struct ieee80211_conf *conf = &hw->conf;
505         unsigned long flags;
506         int ret = 0;
507  
508 --- a/drivers/net/wireless/mac80211_hwsim.c
509 +++ b/drivers/net/wireless/mac80211_hwsim.c
510 @@ -361,10 +361,10 @@ static void mac80211_hwsim_beacon(unsign
511  }
512  
513  
514 -static int mac80211_hwsim_config(struct ieee80211_hw *hw,
515 -                                struct ieee80211_conf *conf)
516 +static int mac80211_hwsim_config(struct ieee80211_hw *hw, u32 changed)
517  {
518         struct mac80211_hwsim_data *data = hw->priv;
519 +       struct ieee80211_conf *conf = &hw->conf;
520  
521         printk(KERN_DEBUG "%s:%s (freq=%d radio_enabled=%d beacon_int=%d)\n",
522                wiphy_name(hw->wiphy), __func__,
523 --- a/drivers/net/wireless/p54/p54common.c
524 +++ b/drivers/net/wireless/p54/p54common.c
525 @@ -1205,10 +1205,11 @@ static void p54_remove_interface(struct 
526         p54_set_filter(dev, 0, NULL);
527  }
528  
529 -static int p54_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf)
530 +static int p54_config(struct ieee80211_hw *dev, u32 changed)
531  {
532         int ret;
533         struct p54_common *priv = dev->priv;
534 +       struct ieee80211_conf *conf = &dev->conf;
535  
536         mutex_lock(&priv->conf_mutex);
537         priv->rx_antenna = 2; /* automatic */
538 --- a/drivers/net/wireless/rt2x00/rt2x00.h
539 +++ b/drivers/net/wireless/rt2x00/rt2x00.h
540 @@ -997,7 +997,7 @@ int rt2x00mac_add_interface(struct ieee8
541                             struct ieee80211_if_init_conf *conf);
542  void rt2x00mac_remove_interface(struct ieee80211_hw *hw,
543                                 struct ieee80211_if_init_conf *conf);
544 -int rt2x00mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf);
545 +int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed);
546  int rt2x00mac_config_interface(struct ieee80211_hw *hw,
547                                struct ieee80211_vif *vif,
548                                struct ieee80211_if_conf *conf);
549 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c
550 +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
551 @@ -335,9 +335,10 @@ void rt2x00mac_remove_interface(struct i
552  }
553  EXPORT_SYMBOL_GPL(rt2x00mac_remove_interface);
554  
555 -int rt2x00mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)
556 +int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed)
557  {
558         struct rt2x00_dev *rt2x00dev = hw->priv;
559 +       struct ieee80211_conf *conf = &hw->conf;
560         int radio_on;
561         int status;
562  
563 --- a/drivers/net/wireless/rtl8180_dev.c
564 +++ b/drivers/net/wireless/rtl8180_dev.c
565 @@ -692,9 +692,10 @@ static void rtl8180_remove_interface(str
566         priv->vif = NULL;
567  }
568  
569 -static int rtl8180_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf)
570 +static int rtl8180_config(struct ieee80211_hw *dev, u32 changed)
571  {
572         struct rtl8180_priv *priv = dev->priv;
573 +       struct ieee80211_conf *conf = &dev->conf;
574  
575         priv->rf->set_chan(dev, conf);
576  
577 --- a/drivers/net/wireless/rtl8187_dev.c
578 +++ b/drivers/net/wireless/rtl8187_dev.c
579 @@ -870,9 +870,10 @@ static void rtl8187_remove_interface(str
580         mutex_unlock(&priv->conf_mutex);
581  }
582  
583 -static int rtl8187_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf)
584 +static int rtl8187_config(struct ieee80211_hw *dev, u32 changed)
585  {
586         struct rtl8187_priv *priv = dev->priv;
587 +       struct ieee80211_conf *conf = &dev->conf;
588         u32 reg;
589  
590         mutex_lock(&priv->conf_mutex);
591 --- a/drivers/net/wireless/zd1211rw/zd_mac.c
592 +++ b/drivers/net/wireless/zd1211rw/zd_mac.c
593 @@ -743,9 +743,11 @@ static void zd_op_remove_interface(struc
594         zd_write_mac_addr(&mac->chip, NULL);
595  }
596  
597 -static int zd_op_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)
598 +static int zd_op_config(struct ieee80211_hw *hw, u32 changed)
599  {
600         struct zd_mac *mac = zd_hw_mac(hw);
601 +       struct ieee80211_conf *conf = &hw->conf;
602 +
603         return zd_chip_set_channel(&mac->chip, conf->channel->hw_value);
604  }
605  
606 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c
607 +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
608 @@ -1245,7 +1245,7 @@ int rt2x00lib_resume(struct rt2x00_dev *
609         /*
610          * Reconfigure device.
611          */
612 -       retval = rt2x00mac_config(rt2x00dev->hw, &rt2x00dev->hw->conf);
613 +       retval = rt2x00mac_config(rt2x00dev->hw, ~0);
614         if (retval)
615                 goto exit;
616