mac80211: Add define for TX headroom reserved by mac80211 itself.
authorGertjan van Wingerde <gwingerde@gmail.com>
Sun, 10 Oct 2010 18:25:33 +0000 (19:25 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 9 May 2011 22:55:22 +0000 (15:55 -0700)
commit d24deb2580823ab0b8425790c6f5d18e2ff749d8 upstream.

Add a definition of the amount of TX headroom reserved by mac80211 itself
for its own purposes. Also add BUILD_BUG_ON to validate the value.
This define can then be used by drivers to request additional TX headroom
in the most efficient manner.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
[bwh: Adjust context for 2.6.32]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
include/net/mac80211.h
net/mac80211/main.c

index c39ed07929487457ae31f6d371409bde4fa430b0..a2bd2f98b63f7e5968d81739b4e88687106ff3fd 100644 (file)
@@ -1700,6 +1700,12 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb);
  */
 void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb);
 
+/*
+ * The TX headroom reserved by mac80211 for its own tx_status functions.
+ * This is enough for the radiotap header.
+ */
+#define IEEE80211_TX_STATUS_HEADROOM   13
+
 /**
  * ieee80211_tx_status - transmit status callback
  *
index 19fbd25a705b22d3d220bc8f7ea6266a20564c68..2dfe1768e2ab1cbb4fd5997e359c27626c5f8e2a 100644 (file)
@@ -859,6 +859,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.
         */
+       BUILD_BUG_ON(IEEE80211_TX_STATUS_HEADROOM !=
+                       sizeof(struct ieee80211_tx_status_rtap_hdr));
        local->tx_headroom = max_t(unsigned int , local->hw.extra_tx_headroom,
                                   sizeof(struct ieee80211_tx_status_rtap_hdr));