aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00mac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00mac.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index 3a1fb6d47e5..84b51f49175 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -348,6 +348,7 @@ int rt2x00mac_config_interface(struct ieee80211_hw *hw,
348{ 348{
349 struct rt2x00_dev *rt2x00dev = hw->priv; 349 struct rt2x00_dev *rt2x00dev = hw->priv;
350 struct rt2x00_intf *intf = vif_to_intf(vif); 350 struct rt2x00_intf *intf = vif_to_intf(vif);
351 struct sk_buff *beacon;
351 int status; 352 int status;
352 353
353 /* 354 /*
@@ -363,8 +364,11 @@ int rt2x00mac_config_interface(struct ieee80211_hw *hw,
363 * If the interface does not work in master mode, 364 * If the interface does not work in master mode,
364 * then the bssid value in the interface structure 365 * then the bssid value in the interface structure
365 * should now be set. 366 * should now be set.
367 *
368 * conf->bssid can be NULL if coming from the internal
369 * beacon update routine.
366 */ 370 */
367 if (conf->type != IEEE80211_IF_TYPE_AP) 371 if (conf->bssid && vif->type != IEEE80211_IF_TYPE_AP)
368 memcpy(&intf->bssid, conf->bssid, ETH_ALEN); 372 memcpy(&intf->bssid, conf->bssid, ETH_ALEN);
369 373
370 spin_unlock(&intf->lock); 374 spin_unlock(&intf->lock);
@@ -375,17 +379,23 @@ int rt2x00mac_config_interface(struct ieee80211_hw *hw,
375 * values as arguments we make keep access to rt2x00_intf thread safe 379 * values as arguments we make keep access to rt2x00_intf thread safe
376 * even without the lock. 380 * even without the lock.
377 */ 381 */
378 rt2x00lib_config_intf(rt2x00dev, intf, conf->type, NULL, conf->bssid); 382 rt2x00lib_config_intf(rt2x00dev, intf, vif->type, NULL, conf->bssid);
379 383
380 /* 384 /*
381 * We only need to initialize the beacon when master mode is enabled. 385 * We only need to initialize the beacon when in master/ibss mode.
382 */ 386 */
383 if (conf->type != IEEE80211_IF_TYPE_AP || !conf->beacon) 387 if ((vif->type != IEEE80211_IF_TYPE_AP &&
388 vif->type != IEEE80211_IF_TYPE_IBSS) ||
389 !(conf->changed & IEEE80211_IFCC_BEACON))
384 return 0; 390 return 0;
385 391
386 status = rt2x00dev->ops->hw->beacon_update(rt2x00dev->hw, conf->beacon); 392 beacon = ieee80211_beacon_get(rt2x00dev->hw, vif);
393 if (!beacon)
394 return -ENOMEM;
395
396 status = rt2x00dev->ops->lib->beacon_update(rt2x00dev->hw, beacon);
387 if (status) 397 if (status)
388 dev_kfree_skb(conf->beacon); 398 dev_kfree_skb(beacon);
389 399
390 return status; 400 return status;
391} 401}