diff options
author | Christian Lamparter <chunkeey@web.de> | 2008-08-13 17:41:48 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-08-18 11:05:14 -0400 |
commit | d47c3cebf5aae9d72b2cc18e5ac3b520fdbb0bca (patch) | |
tree | a4cb7ec92904ac278f8a9ad3e7176de7ef48e136 /drivers/net | |
parent | 69bbc7dc9f59fedb6067c7f9f9f9bc1da27407ad (diff) |
p54u: reset skb's data/tail pointer on requeue
(Only important for USB V1 Adaptors)
If an incoming frame wasn't accepted by p54_rx function
the skb will be reused for new frames...
But, we must not forget to set the skb's data pointers into
the same state in which it was initialized by p54u_init_urbs.
Otherwise we either end up with 16 bytes less on every requeue,
or if a new frame is worthy enough to be accepted, the data is
in the wrong place (urb->transfer_buffer wasn't updated!) and mac80211
has a hard time to recognize it...
Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/p54/p54usb.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c index 815c095ef797..cbaca23a9453 100644 --- a/drivers/net/wireless/p54/p54usb.c +++ b/drivers/net/wireless/p54/p54usb.c | |||
@@ -109,7 +109,17 @@ static void p54u_rx_cb(struct urb *urb) | |||
109 | urb->context = skb; | 109 | urb->context = skb; |
110 | skb_queue_tail(&priv->rx_queue, skb); | 110 | skb_queue_tail(&priv->rx_queue, skb); |
111 | } else { | 111 | } else { |
112 | if (!priv->hw_type) | ||
113 | skb_push(skb, sizeof(struct net2280_tx_hdr)); | ||
114 | |||
115 | skb_reset_tail_pointer(skb); | ||
112 | skb_trim(skb, 0); | 116 | skb_trim(skb, 0); |
117 | if (urb->transfer_buffer != skb_tail_pointer(skb)) { | ||
118 | /* this should not happen */ | ||
119 | WARN_ON(1); | ||
120 | urb->transfer_buffer = skb_tail_pointer(skb); | ||
121 | } | ||
122 | |||
113 | skb_queue_tail(&priv->rx_queue, skb); | 123 | skb_queue_tail(&priv->rx_queue, skb); |
114 | } | 124 | } |
115 | 125 | ||