~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to debian/patches/bugfix/all/rt2x00-Properly-request-tx-headroom-for-alignment-op.patch

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From: Gertjan van Wingerde <gwingerde@gmail.com>
2
 
Date: Wed, 30 Dec 2009 11:36:30 +0100
3
 
Subject: [PATCH 3/3] rt2x00: Properly request tx headroom for alignment operations.
4
 
 
5
 
commit 7a4a77b7771164d61ce702a588067d1e1d66db7c upstream.
6
 
 
7
 
Current rt2x00 drivers may result in a "ieee80211_tx_status: headroom too
8
 
small" error message when a frame needs to be properly aligned before
9
 
transmitting it.
10
 
This is because the space needed to ensure proper alignment isn't
11
 
requested from mac80211.
12
 
Fix this by adding sufficient amount of alignment space to the amount
13
 
of headroom requested for TX frames.
14
 
 
15
 
Reported-by: David Ellingsworth <david@identd.dyndns.org>
16
 
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
17
 
Acked-by: Ivo van Doorn <ivdoorn@gmail.com>
18
 
Signed-off-by: John W. Linville <linville@tuxdriver.com>
19
 
---
20
 
 drivers/net/wireless/rt2x00/rt2x00.h    |    6 ++++++
21
 
 drivers/net/wireless/rt2x00/rt2x00dev.c |   12 +++++++++++-
22
 
 2 files changed, 17 insertions(+), 1 deletions(-)
23
 
 
24
 
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
25
 
index 4d841c0..dcfc8c2 100644
26
 
--- a/drivers/net/wireless/rt2x00/rt2x00.h
27
 
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
28
 
@@ -113,6 +113,12 @@
29
 
        (  ((unsigned long)((__skb)->data + (__header))) & 3 )
30
 
 
31
 
 /*
32
 
+ * Constants for extra TX headroom for alignment purposes.
33
 
+ */
34
 
+#define RT2X00_ALIGN_SIZE      4 /* Only whole frame needs alignment */
35
 
+#define RT2X00_L2PAD_SIZE      8 /* Both header & payload need alignment */
36
 
+
37
 
+/*
38
 
  * Standard timing and size defines.
39
 
  * These values should follow the ieee80211 specifications.
40
 
  */
41
 
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
42
 
index 06c43ca..265e66d 100644
43
 
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
44
 
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
45
 
@@ -686,7 +686,17 @@ static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev)
46
 
        /*
47
 
         * Initialize extra TX headroom required.
48
 
         */
49
 
-       rt2x00dev->hw->extra_tx_headroom = rt2x00dev->ops->extra_tx_headroom;
50
 
+       rt2x00dev->hw->extra_tx_headroom =
51
 
+               max_t(unsigned int, IEEE80211_TX_STATUS_HEADROOM,
52
 
+                     rt2x00dev->ops->extra_tx_headroom);
53
 
+
54
 
+       /*
55
 
+        * Take TX headroom required for alignment into account.
56
 
+        */
57
 
+       if (test_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags))
58
 
+               rt2x00dev->hw->extra_tx_headroom += RT2X00_L2PAD_SIZE;
59
 
+       else if (test_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags))
60
 
+               rt2x00dev->hw->extra_tx_headroom += RT2X00_ALIGN_SIZE;
61
 
 
62
 
        /*
63
 
         * Register HW.
64
 
1.7.1
65