Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 179243
b: refs/heads/master
c: 7a4a77b
h: refs/heads/master
i:
  179241: 890356f
  179239: c73b6f6
v: v3
  • Loading branch information
Gertjan van Wingerde authored and John W. Linville committed Jan 5, 2010
1 parent d9d63b4 commit 02ca976
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cf0277e714a0db302a8f80e1b85fd61c32cf00b3
refs/heads/master: 7a4a77b7771164d61ce702a588067d1e1d66db7c
6 changes: 6 additions & 0 deletions trunk/drivers/net/wireless/rt2x00/rt2x00.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@
#define ALIGN_SIZE(__skb, __header) \
( ((unsigned long)((__skb)->data + (__header))) & 3 )

/*
* Constants for extra TX headroom for alignment purposes.
*/
#define RT2X00_ALIGN_SIZE 4 /* Only whole frame needs alignment */
#define RT2X00_L2PAD_SIZE 8 /* Both header & payload need alignment */

/*
* Standard timing and size defines.
* These values should follow the ieee80211 specifications.
Expand Down
12 changes: 11 additions & 1 deletion trunk/drivers/net/wireless/rt2x00/rt2x00dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,17 @@ static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev)
/*
* Initialize extra TX headroom required.
*/
rt2x00dev->hw->extra_tx_headroom = rt2x00dev->ops->extra_tx_headroom;
rt2x00dev->hw->extra_tx_headroom =
max_t(unsigned int, IEEE80211_TX_STATUS_HEADROOM,
rt2x00dev->ops->extra_tx_headroom);

/*
* Take TX headroom required for alignment into account.
*/
if (test_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags))
rt2x00dev->hw->extra_tx_headroom += RT2X00_L2PAD_SIZE;
else if (test_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags))
rt2x00dev->hw->extra_tx_headroom += RT2X00_ALIGN_SIZE;

/*
* Register HW.
Expand Down

0 comments on commit 02ca976

Please sign in to comment.