aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00dev.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 48f4aec1a4d9..ce1f7bbd3d7a 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -554,14 +554,36 @@ void rt2x00lib_rxdone(struct queue_entry *entry,
554{ 554{
555 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; 555 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
556 struct ieee80211_rx_status *rx_status = &rt2x00dev->rx_status; 556 struct ieee80211_rx_status *rx_status = &rt2x00dev->rx_status;
557 unsigned int header_size = ieee80211_get_hdrlen_from_skb(entry->skb);
557 struct ieee80211_supported_band *sband; 558 struct ieee80211_supported_band *sband;
558 struct ieee80211_hdr *hdr; 559 struct ieee80211_hdr *hdr;
559 const struct rt2x00_rate *rate; 560 const struct rt2x00_rate *rate;
561 unsigned int align;
560 unsigned int i; 562 unsigned int i;
561 int idx = -1; 563 int idx = -1;
562 u16 fc; 564 u16 fc;
563 565
564 /* 566 /*
567 * The data behind the ieee80211 header must be
568 * aligned on a 4 byte boundary. We already reserved
569 * 2 bytes for header_size % 4 == 2 optimization.
570 * To determine the number of bytes which the data
571 * should be moved to the left, we must add these
572 * 2 bytes to the header_size.
573 */
574 align = (header_size + 2) % 4;
575
576 if (align) {
577 skb_push(entry->skb, align);
578 /* Move entire frame in 1 command */
579 memmove(entry->skb->data, entry->skb->data + align,
580 rxdesc->size);
581 }
582
583 /* Update data pointers, trim buffer to correct size */
584 skb_trim(entry->skb, rxdesc->size);
585
586 /*
565 * Update RX statistics. 587 * Update RX statistics.
566 */ 588 */
567 sband = &rt2x00dev->bands[rt2x00dev->curr_band]; 589 sband = &rt2x00dev->bands[rt2x00dev->curr_band];