rt2x00: use correct headroom for transmission

Use rt2x00dev->ops->extra_tx_headroom, not rt2x00dev->hw->extra_tx_headroom
in the tx code, as the later may include other headroom not to be used in
the chipset driver.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Pavel Roskin 2009-12-30 11:36:29 +01:00 committed by John W. Linville
parent e12822e1d3
commit b59a52f12e

View File

@ -104,7 +104,7 @@ void rt2x00queue_map_txskb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb)
* is also mapped to the DMA so it can be used for transfering * is also mapped to the DMA so it can be used for transfering
* additional descriptor information to the hardware. * additional descriptor information to the hardware.
*/ */
skb_push(skb, rt2x00dev->hw->extra_tx_headroom); skb_push(skb, rt2x00dev->ops->extra_tx_headroom);
skbdesc->skb_dma = skbdesc->skb_dma =
dma_map_single(rt2x00dev->dev, skb->data, skb->len, DMA_TO_DEVICE); dma_map_single(rt2x00dev->dev, skb->data, skb->len, DMA_TO_DEVICE);
@ -112,7 +112,7 @@ void rt2x00queue_map_txskb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb)
/* /*
* Restore data pointer to original location again. * Restore data pointer to original location again.
*/ */
skb_pull(skb, rt2x00dev->hw->extra_tx_headroom); skb_pull(skb, rt2x00dev->ops->extra_tx_headroom);
skbdesc->flags |= SKBDESC_DMA_MAPPED_TX; skbdesc->flags |= SKBDESC_DMA_MAPPED_TX;
} }
@ -134,7 +134,7 @@ void rt2x00queue_unmap_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb)
* by the driver, but it was actually mapped to DMA. * by the driver, but it was actually mapped to DMA.
*/ */
dma_unmap_single(rt2x00dev->dev, skbdesc->skb_dma, dma_unmap_single(rt2x00dev->dev, skbdesc->skb_dma,
skb->len + rt2x00dev->hw->extra_tx_headroom, skb->len + rt2x00dev->ops->extra_tx_headroom,
DMA_TO_DEVICE); DMA_TO_DEVICE);
skbdesc->flags &= ~SKBDESC_DMA_MAPPED_TX; skbdesc->flags &= ~SKBDESC_DMA_MAPPED_TX;
} }