Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] mac80211: simplify code in util.c
@ 2008-04-21  2:36 Harvey Harrison
  2008-04-21  5:24 ` Zhu Yi
  2008-04-21  8:19 ` Johannes Berg
  0 siblings, 2 replies; 4+ messages in thread
From: Harvey Harrison @ 2008-04-21  2:36 UTC (permalink / raw)
  To: Johannes Berg; +Cc: John Linville, linux-wireless

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
 net/mac80211/util.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index cc9f715..9960372 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -101,16 +101,13 @@ int ieee80211_get_hdrlen(u16 fc)
 	switch (fc & IEEE80211_FCTL_FTYPE) {
 	case IEEE80211_FTYPE_DATA:
 		if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS))
-			hdrlen = 30; /* Addr4 */
+			hdrlen += ETH_ALEN; /* Addr4 */
 		/*
 		 * The QoS Control field is two bytes and its presence is
-		 * indicated by the IEEE80211_STYPE_QOS_DATA bit. Add 2 to
-		 * hdrlen if that bit is set.
-		 * This works by masking out the bit and shifting it to
-		 * bit position 1 so the result has the value 0 or 2.
+		 * indicated by the IEEE80211_STYPE_QOS_DATA bit.
 		 */
-		hdrlen += (fc & IEEE80211_STYPE_QOS_DATA)
-				>> (ilog2(IEEE80211_STYPE_QOS_DATA)-1);
+		if (fc & IEEE80211_STYPE_QOS_DATA)
+			hdrlen += 2;
 		break;
 	case IEEE80211_FTYPE_CTL:
 		/*
-- 
1.5.5.144.g3e42




^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-04-21  8:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-21  2:36 [PATCH] mac80211: simplify code in util.c Harvey Harrison
2008-04-21  5:24 ` Zhu Yi
2008-04-21  5:50   ` Harvey Harrison
2008-04-21  8:19 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox