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.c40
1 files changed, 26 insertions, 14 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index 3a1fb6d47e5d..77af1df5d899 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -96,6 +96,7 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
96 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); 96 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
97 struct ieee80211_hdr *ieee80211hdr = (struct ieee80211_hdr *)skb->data; 97 struct ieee80211_hdr *ieee80211hdr = (struct ieee80211_hdr *)skb->data;
98 enum data_queue_qid qid = skb_get_queue_mapping(skb); 98 enum data_queue_qid qid = skb_get_queue_mapping(skb);
99 struct rt2x00_intf *intf = vif_to_intf(tx_info->control.vif);
99 struct data_queue *queue; 100 struct data_queue *queue;
100 u16 frame_control; 101 u16 frame_control;
101 102
@@ -151,6 +152,18 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
151 } 152 }
152 } 153 }
153 154
155 /*
156 * XXX: This is as wrong as the old mac80211 code was,
157 * due to beacons not getting sequence numbers assigned
158 * properly.
159 */
160 if (tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
161 if (tx_info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
162 intf->seqno += 0x10;
163 ieee80211hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
164 ieee80211hdr->seq_ctrl |= cpu_to_le16(intf->seqno);
165 }
166
154 if (rt2x00queue_write_tx_frame(queue, skb)) { 167 if (rt2x00queue_write_tx_frame(queue, skb)) {
155 ieee80211_stop_queue(rt2x00dev->hw, qid); 168 ieee80211_stop_queue(rt2x00dev->hw, qid);
156 return NETDEV_TX_BUSY; 169 return NETDEV_TX_BUSY;
@@ -348,7 +361,8 @@ int rt2x00mac_config_interface(struct ieee80211_hw *hw,
348{ 361{
349 struct rt2x00_dev *rt2x00dev = hw->priv; 362 struct rt2x00_dev *rt2x00dev = hw->priv;
350 struct rt2x00_intf *intf = vif_to_intf(vif); 363 struct rt2x00_intf *intf = vif_to_intf(vif);
351 int status; 364 int update_bssid = 0;
365 int status = 0;
352 366
353 /* 367 /*
354 * Mac80211 might be calling this function while we are trying 368 * Mac80211 might be calling this function while we are trying
@@ -360,12 +374,13 @@ int rt2x00mac_config_interface(struct ieee80211_hw *hw,
360 spin_lock(&intf->lock); 374 spin_lock(&intf->lock);
361 375
362 /* 376 /*
363 * If the interface does not work in master mode, 377 * conf->bssid can be NULL if coming from the internal
364 * then the bssid value in the interface structure 378 * beacon update routine.
365 * should now be set.
366 */ 379 */
367 if (conf->type != IEEE80211_IF_TYPE_AP) 380 if (conf->changed & IEEE80211_IFCC_BSSID && conf->bssid) {
381 update_bssid = 1;
368 memcpy(&intf->bssid, conf->bssid, ETH_ALEN); 382 memcpy(&intf->bssid, conf->bssid, ETH_ALEN);
383 }
369 384
370 spin_unlock(&intf->lock); 385 spin_unlock(&intf->lock);
371 386
@@ -375,17 +390,14 @@ int rt2x00mac_config_interface(struct ieee80211_hw *hw,
375 * values as arguments we make keep access to rt2x00_intf thread safe 390 * values as arguments we make keep access to rt2x00_intf thread safe
376 * even without the lock. 391 * even without the lock.
377 */ 392 */
378 rt2x00lib_config_intf(rt2x00dev, intf, conf->type, NULL, conf->bssid); 393 rt2x00lib_config_intf(rt2x00dev, intf, vif->type, NULL,
394 update_bssid ? conf->bssid : NULL);
379 395
380 /* 396 /*
381 * We only need to initialize the beacon when master mode is enabled. 397 * Update the beacon.
382 */ 398 */
383 if (conf->type != IEEE80211_IF_TYPE_AP || !conf->beacon) 399 if (conf->changed & IEEE80211_IFCC_BEACON)
384 return 0; 400 status = rt2x00queue_update_beacon(rt2x00dev, vif);
385
386 status = rt2x00dev->ops->hw->beacon_update(rt2x00dev->hw, conf->beacon);
387 if (status)
388 dev_kfree_skb(conf->beacon);
389 401
390 return status; 402 return status;
391} 403}
@@ -501,7 +513,7 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
501 * When the erp information has changed, we should perform 513 * When the erp information has changed, we should perform
502 * additional configuration steps. For all other changes we are done. 514 * additional configuration steps. For all other changes we are done.
503 */ 515 */
504 if (changes & BSS_CHANGED_ERP_PREAMBLE) { 516 if (changes & (BSS_CHANGED_ERP_PREAMBLE | BSS_CHANGED_ERP_CTS_PROT)) {
505 if (!test_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags)) 517 if (!test_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags))
506 rt2x00lib_config_erp(rt2x00dev, intf, bss_conf); 518 rt2x00lib_config_erp(rt2x00dev, intf, bss_conf);
507 else 519 else