linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gertjan van Wingerde <gwingerde@gmail.com>
To: users@rt2x00.serialmonkey.com, linux-wireless@vger.kernel.org
Cc: Ivo van Doorn <ivdoorn@gmail.com>,
	Gertjan van Wingerde <gwingerde@gmail.com>,
	Johannes Berg <johannes@sipsolutions.net>
Subject: [PATCH 6/6] mac80211: Allow extra TX headroom to be consumed by drivers.
Date: Mon, 23 Nov 2009 08:16:05 +0100	[thread overview]
Message-ID: <1258960565-26736-7-git-send-email-gwingerde@gmail.com> (raw)
In-Reply-To: <1258960565-26736-6-git-send-email-gwingerde@gmail.com>

Allow drivers to consume the extra TX headroom they are requesting instead
of assuming they will give it back. This specifically is the case for
the rt2x00 driver, as a large part of the requested extra TX headroom is
used to properly align the frame for DMA usage, and the frame is never
moved back to the original location.
Fix this by reserving TX headroom accounting for both the driver requested
amount and the special monitor interface header that needs to be added,
instead of just the maximum of the two.

See http://marc.info/?l=linux-kernel&m=125892467801662&w=2 for details.

Reported-by: David Ellingsworth <david@identd.dyndns.org>
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Tested-by: David Ellingsworth <david@identd.dyndns.org>
Cc: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index dd8ec8d..e666b66 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -515,8 +515,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 	 * and we need some headroom for passing the frame to monitor
 	 * interfaces, but never both at the same time.
 	 */
-	local->tx_headroom = max_t(unsigned int , local->hw.extra_tx_headroom,
-				   sizeof(struct ieee80211_tx_status_rtap_hdr));
+	local->tx_headroom = local->hw.extra_tx_headroom +
+				   sizeof(struct ieee80211_tx_status_rtap_hdr);
 
 	debugfs_hw_add(local);
 
-- 
1.6.5.3


  reply	other threads:[~2009-11-23  7:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-23  7:15 [PATCH 0/6] Assorted fixes and cleanups for rt2x00 and mac80211 Gertjan van Wingerde
2009-11-23  7:16 ` [PATCH 1/6] rt2x00: Only initialize HT on rt2800 devices that support it Gertjan van Wingerde
2009-11-23  7:16   ` [PATCH 2/6] rt2x00: Remove unused variable frame_control from rt2x00mac_tx Gertjan van Wingerde
2009-11-23  7:16     ` [PATCH 3/6] rt2x00: Clean up use of rt2x00_intf_is_pci Gertjan van Wingerde
2009-11-23  7:16       ` [PATCH 4/6] rt2x00: Fix typo (lengt --> length) in rt2x00queue.c Gertjan van Wingerde
2009-11-23  7:16         ` [PATCH 5/6] rt2x00: Properly request tx headroom for alignment operations Gertjan van Wingerde
2009-11-23  7:16           ` Gertjan van Wingerde [this message]
2009-11-23 10:41             ` [PATCH 6/6] mac80211: Allow extra TX headroom to be consumed by drivers Johannes Berg
2009-11-23 19:26               ` Gertjan van Wingerde
2009-11-23  7:35           ` [PATCH 5/6] rt2x00: Properly request tx headroom for alignment operations Julian Calaby
2009-11-23 19:18             ` Gertjan van Wingerde
2009-11-23 10:38           ` Johannes Berg
2009-11-23 19:25             ` Gertjan van Wingerde
2009-11-23 18:33           ` Ivo van Doorn
2009-11-23 20:51             ` Gertjan van Wingerde
2009-11-23 18:29         ` [PATCH 4/6] rt2x00: Fix typo (lengt --> length) in rt2x00queue.c Ivo van Doorn
2009-11-23 18:13       ` [PATCH 3/6] rt2x00: Clean up use of rt2x00_intf_is_pci Ivo van Doorn
2009-11-23 18:12     ` [PATCH 2/6] rt2x00: Remove unused variable frame_control from rt2x00mac_tx Ivo van Doorn
2009-11-23  9:58   ` [PATCH 1/6] rt2x00: Only initialize HT on rt2800 devices that support it Simon Raffeiner
2009-11-23 19:20     ` Gertjan van Wingerde
2009-11-23 18:12   ` Ivo van Doorn
2009-11-23 19:30     ` Gertjan van Wingerde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1258960565-26736-7-git-send-email-gwingerde@gmail.com \
    --to=gwingerde@gmail.com \
    --cc=ivdoorn@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=users@rt2x00.serialmonkey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).