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.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index ff853c430bdf..16b72d9ca1c3 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -348,8 +348,8 @@ 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 update_bssid = 0;
352 int status; 352 int status = 0;
353 353
354 /* 354 /*
355 * Mac80211 might be calling this function while we are trying 355 * Mac80211 might be calling this function while we are trying
@@ -361,15 +361,13 @@ int rt2x00mac_config_interface(struct ieee80211_hw *hw,
361 spin_lock(&intf->lock); 361 spin_lock(&intf->lock);
362 362
363 /* 363 /*
364 * If the interface does not work in master mode,
365 * then the bssid value in the interface structure
366 * should now be set.
367 *
368 * conf->bssid can be NULL if coming from the internal 364 * conf->bssid can be NULL if coming from the internal
369 * beacon update routine. 365 * beacon update routine.
370 */ 366 */
371 if (conf->bssid && vif->type != IEEE80211_IF_TYPE_AP) 367 if (conf->changed & IEEE80211_IFCC_BSSID && conf->bssid) {
368 update_bssid = 1;
372 memcpy(&intf->bssid, conf->bssid, ETH_ALEN); 369 memcpy(&intf->bssid, conf->bssid, ETH_ALEN);
370 }
373 371
374 spin_unlock(&intf->lock); 372 spin_unlock(&intf->lock);
375 373
@@ -379,23 +377,14 @@ int rt2x00mac_config_interface(struct ieee80211_hw *hw,
379 * values as arguments we make keep access to rt2x00_intf thread safe 377 * values as arguments we make keep access to rt2x00_intf thread safe
380 * even without the lock. 378 * even without the lock.
381 */ 379 */
382 rt2x00lib_config_intf(rt2x00dev, intf, vif->type, NULL, conf->bssid); 380 rt2x00lib_config_intf(rt2x00dev, intf, vif->type, NULL,
381 update_bssid ? conf->bssid : NULL);
383 382
384 /* 383 /*
385 * We only need to initialize the beacon when in master/ibss mode. 384 * Update the beacon.
386 */ 385 */
387 if ((vif->type != IEEE80211_IF_TYPE_AP && 386 if (conf->changed & IEEE80211_IFCC_BEACON)
388 vif->type != IEEE80211_IF_TYPE_IBSS) || 387 status = rt2x00queue_update_beacon(rt2x00dev, vif);
389 !(conf->changed & IEEE80211_IFCC_BEACON))
390 return 0;
391
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);
397 if (status)
398 dev_kfree_skb(beacon);
399 388
400 return status; 389 return status;
401} 390}