]> git.baikalelectronics.ru Git - kernel.git/commit
mwl8k: prevent corruption of QoS field on receive
authorLennert Buytenhek <buytenh@wantstofly.org>
Mon, 30 Nov 2009 17:12:08 +0000 (18:12 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 7 Dec 2009 21:51:19 +0000 (16:51 -0500)
commit437f8d6b92a7a9827f4dec6f201a71149c1219d3
treea65343d091be0ee4ba65f41bdb1fe99e4b5e0381
parent5adfc91eb2f0cdc46cf949da9c793159c4aad8a9
mwl8k: prevent corruption of QoS field on receive

Packets exchanged between the mwl8k driver and the firmware always
have a 4-address header without QoS field.  For QoS packets, the QoS
field is passed to/from the firmware via the tx/rx descriptors.

We were handling this correctly on transmit, but not on receive -- if
a QoS packet was received, we would leave garbage in the QoS field in
the packet passed up to the stack, which is Bad(tm).

Also, if the packet received on the air was a 4-address without QoS
packet, we would forget to skb_pull the 2-byte DMA length prefix off.

This patch adds an argument to the ->rxd_process() receive descriptor
operation to retrieve the QoS field from the receive descriptor, and
extends mwl8k_remove_dma_header() to insert this field back into the
packet if the packet received is a QoS packet.  It also fixes
mwl8k_remove_dma_header() to strip off the length prefix in all cases.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwl8k.c