diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00queue.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00queue.c | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index 7f442030f5ad..3b27f6aa860c 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c | |||
@@ -120,6 +120,7 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, | |||
120 | { | 120 | { |
121 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 121 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
122 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); | 122 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); |
123 | struct rt2x00_intf *intf = vif_to_intf(tx_info->control.vif); | ||
123 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)entry->skb->data; | 124 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)entry->skb->data; |
124 | struct ieee80211_rate *rate = | 125 | struct ieee80211_rate *rate = |
125 | ieee80211_get_tx_rate(rt2x00dev->hw, tx_info); | 126 | ieee80211_get_tx_rate(rt2x00dev->hw, tx_info); |
@@ -200,6 +201,31 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, | |||
200 | } | 201 | } |
201 | 202 | ||
202 | /* | 203 | /* |
204 | * Hardware should insert sequence counter. | ||
205 | * FIXME: We insert a software sequence counter first for | ||
206 | * hardware that doesn't support hardware sequence counting. | ||
207 | * | ||
208 | * This is wrong because beacons are not getting sequence | ||
209 | * numbers assigned properly. | ||
210 | * | ||
211 | * A secondary problem exists for drivers that cannot toggle | ||
212 | * sequence counting per-frame, since those will override the | ||
213 | * sequence counter given by mac80211. | ||
214 | */ | ||
215 | if (tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { | ||
216 | spin_lock(&intf->lock); | ||
217 | |||
218 | if (test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags)) | ||
219 | intf->seqno += 0x10; | ||
220 | hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); | ||
221 | hdr->seq_ctrl |= cpu_to_le16(intf->seqno); | ||
222 | |||
223 | spin_unlock(&intf->lock); | ||
224 | |||
225 | __set_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags); | ||
226 | } | ||
227 | |||
228 | /* | ||
203 | * PLCP setup | 229 | * PLCP setup |
204 | * Length calculation depends on OFDM/CCK rate. | 230 | * Length calculation depends on OFDM/CCK rate. |
205 | */ | 231 | */ |
@@ -466,9 +492,12 @@ void rt2x00queue_init_rx(struct rt2x00_dev *rt2x00dev) | |||
466 | if (!rt2x00dev->ops->lib->init_rxentry) | 492 | if (!rt2x00dev->ops->lib->init_rxentry) |
467 | return; | 493 | return; |
468 | 494 | ||
469 | for (i = 0; i < queue->limit; i++) | 495 | for (i = 0; i < queue->limit; i++) { |
496 | queue->entries[i].flags = 0; | ||
497 | |||
470 | rt2x00dev->ops->lib->init_rxentry(rt2x00dev, | 498 | rt2x00dev->ops->lib->init_rxentry(rt2x00dev, |
471 | &queue->entries[i]); | 499 | &queue->entries[i]); |
500 | } | ||
472 | } | 501 | } |
473 | 502 | ||
474 | void rt2x00queue_init_tx(struct rt2x00_dev *rt2x00dev) | 503 | void rt2x00queue_init_tx(struct rt2x00_dev *rt2x00dev) |
@@ -482,9 +511,12 @@ void rt2x00queue_init_tx(struct rt2x00_dev *rt2x00dev) | |||
482 | if (!rt2x00dev->ops->lib->init_txentry) | 511 | if (!rt2x00dev->ops->lib->init_txentry) |
483 | continue; | 512 | continue; |
484 | 513 | ||
485 | for (i = 0; i < queue->limit; i++) | 514 | for (i = 0; i < queue->limit; i++) { |
515 | queue->entries[i].flags = 0; | ||
516 | |||
486 | rt2x00dev->ops->lib->init_txentry(rt2x00dev, | 517 | rt2x00dev->ops->lib->init_txentry(rt2x00dev, |
487 | &queue->entries[i]); | 518 | &queue->entries[i]); |
519 | } | ||
488 | } | 520 | } |
489 | } | 521 | } |
490 | 522 | ||