diff options
author | Iwo Mergler <iwo@call-direct.com.au> | 2008-07-19 10:17:40 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-07-29 16:55:05 -0400 |
commit | b93ce437eba7e0232683326f30d9d1167a872fad (patch) | |
tree | 5f9a501d4407be45e7f3cab6312ae2e3c725278d /drivers/net/wireless/rt2x00/rt73usb.c | |
parent | 3e0c1abe748a30bc705a55f71bca8e04a83820f1 (diff) |
rt2x00: Fix the beacon length bug
When setting up a beacon template, the length of the beacon is
calculated with the assumption that the SKB already contains
the Tx descriptor. In the case of beacons it doesn't.
This patch undoes the damage by adding the Tx descriptor length
to the beacon length. This is safe, because the shortest possible
beacon is longer than the Tx header.
Signed-off-by: Iwo Mergler <Iwo@call-direct.com.au>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt73usb.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index fc320c0409db..866504612e8a 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -1330,6 +1330,7 @@ static void rt73usb_write_beacon(struct queue_entry *entry) | |||
1330 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); | 1330 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); |
1331 | unsigned int beacon_base; | 1331 | unsigned int beacon_base; |
1332 | u32 reg; | 1332 | u32 reg; |
1333 | u32 word, len; | ||
1333 | 1334 | ||
1334 | /* | 1335 | /* |
1335 | * Add the descriptor in front of the skb. | 1336 | * Add the descriptor in front of the skb. |
@@ -1339,6 +1340,17 @@ static void rt73usb_write_beacon(struct queue_entry *entry) | |||
1339 | skbdesc->desc = entry->skb->data; | 1340 | skbdesc->desc = entry->skb->data; |
1340 | 1341 | ||
1341 | /* | 1342 | /* |
1343 | * Adjust the beacon databyte count. The current number is | ||
1344 | * calculated before this function gets called, but falsely | ||
1345 | * assumes that the descriptor was already present in the SKB. | ||
1346 | */ | ||
1347 | rt2x00_desc_read(skbdesc->desc, 0, &word); | ||
1348 | len = rt2x00_get_field32(word, TXD_W0_DATABYTE_COUNT); | ||
1349 | len += skbdesc->desc_len; | ||
1350 | rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, len); | ||
1351 | rt2x00_desc_write(skbdesc->desc, 0, word); | ||
1352 | |||
1353 | /* | ||
1342 | * Disable beaconing while we are reloading the beacon data, | 1354 | * Disable beaconing while we are reloading the beacon data, |
1343 | * otherwise we might be sending out invalid data. | 1355 | * otherwise we might be sending out invalid data. |
1344 | */ | 1356 | */ |