diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-01-29 10:57:51 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-02-01 16:12:24 -0500 |
commit | 6feeb8aad7925b4c00f785eac3039c772629b42f (patch) | |
tree | d61348505908cfcddd1ff8af18f5bab613bbb6de /net/mac80211/rx.c | |
parent | 24e1c13c93cbdd05e4b7ea921c0050b036555adc (diff) |
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
warning.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r-- | net/mac80211/rx.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index d44c87269bcb..535407d07fa4 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -340,11 +340,15 @@ static u32 ieee80211_rx_load_stats(struct ieee80211_local *local, | |||
340 | return load; | 340 | return load; |
341 | } | 341 | } |
342 | 342 | ||
343 | #ifdef CONFIG_MAC80211_DEBUG_PACKET_ALIGNMENT | ||
343 | static ieee80211_txrx_result | 344 | static ieee80211_txrx_result |
344 | ieee80211_rx_h_verify_ip_alignment(struct ieee80211_txrx_data *rx) | 345 | ieee80211_rx_h_verify_ip_alignment(struct ieee80211_txrx_data *rx) |
345 | { | 346 | { |
346 | int hdrlen; | 347 | int hdrlen; |
347 | 348 | ||
349 | if (!WLAN_FC_DATA_PRESENT(rx->fc)) | ||
350 | return TXRX_CONTINUE; | ||
351 | |||
348 | /* | 352 | /* |
349 | * Drivers are required to align the payload data in a way that | 353 | * Drivers are required to align the payload data in a way that |
350 | * guarantees that the contained IP header is aligned to a four- | 354 | * 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) | |||
371 | 375 | ||
372 | return TXRX_CONTINUE; | 376 | return TXRX_CONTINUE; |
373 | } | 377 | } |
378 | #endif | ||
374 | 379 | ||
375 | ieee80211_rx_handler ieee80211_rx_pre_handlers[] = | 380 | ieee80211_rx_handler ieee80211_rx_pre_handlers[] = |
376 | { | 381 | { |
377 | ieee80211_rx_h_parse_qos, | 382 | ieee80211_rx_h_parse_qos, |
383 | #ifdef CONFIG_MAC80211_DEBUG_PACKET_ALIGNMENT | ||
378 | ieee80211_rx_h_verify_ip_alignment, | 384 | ieee80211_rx_h_verify_ip_alignment, |
385 | #endif | ||
379 | NULL | 386 | NULL |
380 | }; | 387 | }; |
381 | 388 | ||