Commit:     6feeb8aad7925b4c00f785eac3039c772629b42f
Parent:     24e1c13c93cbdd05e4b7ea921c0050b036555adc
Author:     Johannes Berg <[EMAIL PROTECTED]>
AuthorDate: Tue Jan 29 16:57:51 2008 +0100
Committer:  John W. Linville <[EMAIL PROTECTED]>
CommitDate: Fri Feb 1 16:12:24 2008 -0500

    mac80211: make alignment warning optional
    Driver authors should be aware of the alignment requirements, but
    not everybody cares about the warning. This patch makes it depend
    on a new Kconfig symbol MAC80211_DEBUG_PACKET_ALIGNMENT which can
    be enabled regardless of MAC80211_DEBUG and is recommended for
    driver authors (only). This also restricts the warning to data
    packets so other packets need not be realigned to not trigger the
    Signed-off-by: Johannes Berg <[EMAIL PROTECTED]>
    Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
 net/mac80211/Kconfig |   12 ++++++++++++
 net/mac80211/rx.c    |    7 +++++++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig
index 09c2550..e77592d 100644
--- a/net/mac80211/Kconfig
+++ b/net/mac80211/Kconfig
@@ -98,6 +98,18 @@ config MAC80211_DEBUGFS
          Say N unless you know you need this.
+       bool "Enable packet alignment debugging"
+       depends on MAC80211
+       help
+         This option is recommended for driver authors and strongly
+         discouraged for everybody else, it will trigger a warning
+         when a driver hands mac80211 a buffer that is aligned in
+         a way that will cause problems with the IP stack on some
+         architectures.
+         Say N unless you're writing a mac80211 based driver.
 config MAC80211_DEBUG
        bool "Enable debugging output"
        depends on MAC80211
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index d44c872..535407d 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -340,11 +340,15 @@ static u32 ieee80211_rx_load_stats(struct ieee80211_local 
        return load;
 static ieee80211_txrx_result
 ieee80211_rx_h_verify_ip_alignment(struct ieee80211_txrx_data *rx)
        int hdrlen;
+       if (!WLAN_FC_DATA_PRESENT(rx->fc))
+               return TXRX_CONTINUE;
         * Drivers are required to align the payload data in a way that
         * guarantees that the contained IP header is aligned to a four-
@@ -371,11 +375,14 @@ ieee80211_rx_h_verify_ip_alignment(struct 
ieee80211_txrx_data *rx)
        return TXRX_CONTINUE;
 ieee80211_rx_handler ieee80211_rx_pre_handlers[] =
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to