aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00pci.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
index a9819aad5e7d..82e80b69d0be 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -79,11 +79,8 @@ void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
79 struct data_queue *queue = rt2x00dev->rx; 79 struct data_queue *queue = rt2x00dev->rx;
80 struct queue_entry *entry; 80 struct queue_entry *entry;
81 struct queue_entry_priv_pci *entry_priv; 81 struct queue_entry_priv_pci *entry_priv;
82 struct ieee80211_hdr *hdr;
83 struct skb_frame_desc *skbdesc; 82 struct skb_frame_desc *skbdesc;
84 struct rxdone_entry_desc rxdesc; 83 struct rxdone_entry_desc rxdesc;
85 int header_size;
86 int align;
87 u32 word; 84 u32 word;
88 85
89 while (1) { 86 while (1) {
@@ -97,27 +94,15 @@ void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
97 memset(&rxdesc, 0, sizeof(rxdesc)); 94 memset(&rxdesc, 0, sizeof(rxdesc));
98 rt2x00dev->ops->lib->fill_rxdone(entry, &rxdesc); 95 rt2x00dev->ops->lib->fill_rxdone(entry, &rxdesc);
99 96
100 hdr = (struct ieee80211_hdr *)entry_priv->data;
101 header_size =
102 ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_control));
103
104 /*
105 * The data behind the ieee80211 header must be
106 * aligned on a 4 byte boundary.
107 */
108 align = header_size % 4;
109
110 /* 97 /*
111 * Allocate the sk_buffer, initialize it and copy 98 * Allocate the sk_buffer and copy all data into it.
112 * all data into it.
113 */ 99 */
114 entry->skb = dev_alloc_skb(rxdesc.size + align); 100 entry->skb = rt2x00queue_alloc_rxskb(queue);
115 if (!entry->skb) 101 if (!entry->skb)
116 return; 102 return;
117 103
118 skb_reserve(entry->skb, align); 104 memcpy(entry->skb->data, entry_priv->data, rxdesc.size);
119 memcpy(skb_put(entry->skb, rxdesc.size), 105 skb_trim(entry->skb, rxdesc.size);
120 entry_priv->data, rxdesc.size);
121 106
122 /* 107 /*
123 * Fill in skb descriptor 108 * Fill in skb descriptor