diff options
author | Jeff Garzik <jeff@garzik.org> | 2008-01-12 17:44:35 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-01-12 17:44:35 -0500 |
commit | 9ea7d6cb9c223e8b0887b8b0355470acb947a1c9 (patch) | |
tree | b8c4be1dbdf4bb2167dd9a3f2cea73e0c9c3121b /drivers/net | |
parent | 94d433630a1e63d383d592d488f60581e0d98190 (diff) | |
parent | c5d0dc5f0dd66770232d7d360c770d2344b76d52 (diff) |
Merge branch 'fixes-jgarzik' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 into upstream-fixes
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500usb.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00pci.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00usb.c | 17 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 12 |
4 files changed, 44 insertions, 7 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index 50775f9234cc..18b1f9145389 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -257,7 +257,7 @@ static const struct rt2x00debug rt2500usb_rt2x00debug = { | |||
257 | static void rt2500usb_config_mac_addr(struct rt2x00_dev *rt2x00dev, | 257 | static void rt2500usb_config_mac_addr(struct rt2x00_dev *rt2x00dev, |
258 | __le32 *mac) | 258 | __le32 *mac) |
259 | { | 259 | { |
260 | rt2500usb_register_multiwrite(rt2x00dev, MAC_CSR2, &mac, | 260 | rt2500usb_register_multiwrite(rt2x00dev, MAC_CSR2, mac, |
261 | (3 * sizeof(__le16))); | 261 | (3 * sizeof(__le16))); |
262 | } | 262 | } |
263 | 263 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c index 2780df00623c..6d5d9aba0b73 100644 --- a/drivers/net/wireless/rt2x00/rt2x00pci.c +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c | |||
@@ -124,7 +124,10 @@ void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev) | |||
124 | struct data_entry *entry; | 124 | struct data_entry *entry; |
125 | struct data_desc *rxd; | 125 | struct data_desc *rxd; |
126 | struct sk_buff *skb; | 126 | struct sk_buff *skb; |
127 | struct ieee80211_hdr *hdr; | ||
127 | struct rxdata_entry_desc desc; | 128 | struct rxdata_entry_desc desc; |
129 | int header_size; | ||
130 | int align; | ||
128 | u32 word; | 131 | u32 word; |
129 | 132 | ||
130 | while (1) { | 133 | while (1) { |
@@ -138,17 +141,26 @@ void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev) | |||
138 | memset(&desc, 0x00, sizeof(desc)); | 141 | memset(&desc, 0x00, sizeof(desc)); |
139 | rt2x00dev->ops->lib->fill_rxdone(entry, &desc); | 142 | rt2x00dev->ops->lib->fill_rxdone(entry, &desc); |
140 | 143 | ||
144 | hdr = (struct ieee80211_hdr *)entry->data_addr; | ||
145 | header_size = | ||
146 | ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_control)); | ||
147 | |||
148 | /* | ||
149 | * The data behind the ieee80211 header must be | ||
150 | * aligned on a 4 byte boundary. | ||
151 | */ | ||
152 | align = NET_IP_ALIGN + (2 * (header_size % 4 == 0)); | ||
153 | |||
141 | /* | 154 | /* |
142 | * Allocate the sk_buffer, initialize it and copy | 155 | * Allocate the sk_buffer, initialize it and copy |
143 | * all data into it. | 156 | * all data into it. |
144 | */ | 157 | */ |
145 | skb = dev_alloc_skb(desc.size + NET_IP_ALIGN); | 158 | skb = dev_alloc_skb(desc.size + align); |
146 | if (!skb) | 159 | if (!skb) |
147 | return; | 160 | return; |
148 | 161 | ||
149 | skb_reserve(skb, NET_IP_ALIGN); | 162 | skb_reserve(skb, align); |
150 | skb_put(skb, desc.size); | 163 | memcpy(skb_put(skb, desc.size), entry->data_addr, desc.size); |
151 | memcpy(skb->data, entry->data_addr, desc.size); | ||
152 | 164 | ||
153 | /* | 165 | /* |
154 | * Send the frame to rt2x00lib for further processing. | 166 | * Send the frame to rt2x00lib for further processing. |
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index 1f5675dd329f..ab4797ed94c9 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c | |||
@@ -221,7 +221,9 @@ static void rt2x00usb_interrupt_rxdone(struct urb *urb) | |||
221 | struct data_ring *ring = entry->ring; | 221 | struct data_ring *ring = entry->ring; |
222 | struct rt2x00_dev *rt2x00dev = ring->rt2x00dev; | 222 | struct rt2x00_dev *rt2x00dev = ring->rt2x00dev; |
223 | struct sk_buff *skb; | 223 | struct sk_buff *skb; |
224 | struct ieee80211_hdr *hdr; | ||
224 | struct rxdata_entry_desc desc; | 225 | struct rxdata_entry_desc desc; |
226 | int header_size; | ||
225 | int frame_size; | 227 | int frame_size; |
226 | 228 | ||
227 | if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags) || | 229 | if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags) || |
@@ -253,9 +255,20 @@ static void rt2x00usb_interrupt_rxdone(struct urb *urb) | |||
253 | skb_put(skb, frame_size); | 255 | skb_put(skb, frame_size); |
254 | 256 | ||
255 | /* | 257 | /* |
256 | * Trim the skb_buffer to only contain the valid | 258 | * The data behind the ieee80211 header must be |
257 | * frame data (so ignore the device's descriptor). | 259 | * aligned on a 4 byte boundary. |
260 | * After that trim the entire buffer down to only | ||
261 | * contain the valid frame data excluding the device | ||
262 | * descriptor. | ||
258 | */ | 263 | */ |
264 | hdr = (struct ieee80211_hdr *)entry->skb->data; | ||
265 | header_size = | ||
266 | ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_control)); | ||
267 | |||
268 | if (header_size % 4 == 0) { | ||
269 | skb_push(entry->skb, 2); | ||
270 | memmove(entry->skb->data, entry->skb->data + 2, skb->len - 2); | ||
271 | } | ||
259 | skb_trim(entry->skb, desc.size); | 272 | skb_trim(entry->skb, desc.size); |
260 | 273 | ||
261 | /* | 274 | /* |
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index 01dbef19d651..ecae968ce091 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -1738,6 +1738,7 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev) | |||
1738 | { | 1738 | { |
1739 | struct data_ring *ring; | 1739 | struct data_ring *ring; |
1740 | struct data_entry *entry; | 1740 | struct data_entry *entry; |
1741 | struct data_entry *entry_done; | ||
1741 | struct data_desc *txd; | 1742 | struct data_desc *txd; |
1742 | u32 word; | 1743 | u32 word; |
1743 | u32 reg; | 1744 | u32 reg; |
@@ -1791,6 +1792,17 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev) | |||
1791 | !rt2x00_get_field32(word, TXD_W0_VALID)) | 1792 | !rt2x00_get_field32(word, TXD_W0_VALID)) |
1792 | return; | 1793 | return; |
1793 | 1794 | ||
1795 | entry_done = rt2x00_get_data_entry_done(ring); | ||
1796 | while (entry != entry_done) { | ||
1797 | /* Catch up. Just report any entries we missed as | ||
1798 | * failed. */ | ||
1799 | WARNING(rt2x00dev, | ||
1800 | "TX status report missed for entry %p\n", | ||
1801 | entry_done); | ||
1802 | rt2x00lib_txdone(entry_done, TX_FAIL_OTHER, 0); | ||
1803 | entry_done = rt2x00_get_data_entry_done(ring); | ||
1804 | } | ||
1805 | |||
1794 | /* | 1806 | /* |
1795 | * Obtain the status about this packet. | 1807 | * Obtain the status about this packet. |
1796 | */ | 1808 | */ |