linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: Account HT Control field in Data frame hdrlen according to 802.11n-2009
@ 2010-01-20 10:17 Andriy Tkachuk
  0 siblings, 0 replies; 4+ messages in thread
From: Andriy Tkachuk @ 2010-01-20 10:17 UTC (permalink / raw)
  To: linux-wireless; +Cc: John W. Linville

ieee80211_hdrlen() should account account new HT Control field in 802.11
data frame header introduced by IEEE 802.11n standard.

According to 802.11n-2009 HT Control field is present in data frames
when both of following are met:

   1. It is QoS data frame.
   2. Order bit is set in Frame Control field.

The change might be totally compatible with legacy non-11n aware frames,
because 802.11-2007 standard states that "all QoS STAs set this subfield
to 0".

Signed-off-by: Andriy V. Tkachuk <andrit@ukr.net>
Acked-by : Benoit Papillault <benoit.papillault@free.fr>

---
 include/linux/ieee80211.h |    2 ++
 net/wireless/util.c       |    5 ++++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 8427019..1998495 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -138,6 +138,8 @@
 #define IEEE80211_WMM_IE_STA_QOSINFO_SP_MASK   0x03
 #define IEEE80211_WMM_IE_STA_QOSINFO_SP_SHIFT  5

+#define IEEE80211_HT_CTL_LEN           4
+
 struct ieee80211_hdr {
        __le16 frame_control;
        __le16 duration_id;
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 23557c1..be2ab8c 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -227,8 +227,11 @@ unsigned int ieee80211_hdrlen(__le16 fc)
        if (ieee80211_is_data(fc)) {
                if (ieee80211_has_a4(fc))
                        hdrlen = 30;
-               if (ieee80211_is_data_qos(fc))
+               if (ieee80211_is_data_qos(fc)) {
                        hdrlen += IEEE80211_QOS_CTL_LEN;
+                       if (ieee80211_has_order(fc))
+                               hdrlen += IEEE80211_HT_CTL_LEN;
+               }
                goto out;
        }





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

* [PATCH] mac80211: Account HT Control field in Data frame hdrlen according to 802.11n-2009
@ 2010-01-20 11:55 Andriy Tkachuk
  2010-01-20 18:08 ` Luis R. Rodriguez
  0 siblings, 1 reply; 4+ messages in thread
From: Andriy Tkachuk @ 2010-01-20 11:55 UTC (permalink / raw)
  To: linux-wireless; +Cc: John W. Linville

ieee80211_hdrlen() should account account new HT Control field in 802.11
data frame header introduced by IEEE 802.11n standard.

According to 802.11n-2009 HT Control field is present in data frames
when both of following are met:

   1. It is QoS data frame.
   2. Order bit is set in Frame Control field.

The change might be totally compatible with legacy non-11n aware frames,
because 802.11-2007 standard states that "all QoS STAs set this subfield
to 0".

Signed-off-by: Andriy V. Tkachuk <andrit@ukr.net>
Acked-by : Benoit Papillault <benoit.papillault@free.fr>

---
 include/linux/ieee80211.h |    2 ++
 net/wireless/util.c       |    5 ++++-
 2 files changed, 6 insertions(+), 1 deletions(-)

Prev. patch may be ignored since its format was invalid - it extended
tabs to spaces (copy/paste from PuTTY issue). Hope this one will be
better. Sorry for inconvenience.

diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 8427019..1998495 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -138,6 +138,8 @@
 #define IEEE80211_WMM_IE_STA_QOSINFO_SP_MASK	0x03
 #define IEEE80211_WMM_IE_STA_QOSINFO_SP_SHIFT	5

+#define IEEE80211_HT_CTL_LEN		4
+
 struct ieee80211_hdr {
 	__le16 frame_control;
 	__le16 duration_id;
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 23557c1..be2ab8c 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -227,8 +227,11 @@ unsigned int ieee80211_hdrlen(__le16 fc)
 	if (ieee80211_is_data(fc)) {
 		if (ieee80211_has_a4(fc))
 			hdrlen = 30;
-		if (ieee80211_is_data_qos(fc))
+		if (ieee80211_is_data_qos(fc)) {
 			hdrlen += IEEE80211_QOS_CTL_LEN;
+			if (ieee80211_has_order(fc))
+				hdrlen += IEEE80211_HT_CTL_LEN;
+		}
 		goto out;
 	}


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

* Re: [PATCH] mac80211: Account HT Control field in Data frame hdrlen according to 802.11n-2009
  2010-01-20 11:55 [PATCH] mac80211: Account HT Control field in Data frame hdrlen according to 802.11n-2009 Andriy Tkachuk
@ 2010-01-20 18:08 ` Luis R. Rodriguez
  2010-01-21 10:07   ` Andriy Tkachuk
  0 siblings, 1 reply; 4+ messages in thread
From: Luis R. Rodriguez @ 2010-01-20 18:08 UTC (permalink / raw)
  To: Andriy Tkachuk; +Cc: linux-wireless, John W. Linville

On Wed, Jan 20, 2010 at 3:55 AM, Andriy Tkachuk <andrit@ukr.net> wrote:
> ieee80211_hdrlen() should account account new HT Control field in 802.11
> data frame header introduced by IEEE 802.11n standard.
>
> According to 802.11n-2009 HT Control field is present in data frames
> when both of following are met:
>
>   1. It is QoS data frame.
>   2. Order bit is set in Frame Control field.
>
> The change might be totally compatible with legacy non-11n aware frames,
> because 802.11-2007 standard states that "all QoS STAs set this subfield
> to 0".
>
> Signed-off-by: Andriy V. Tkachuk <andrit@ukr.net>
> Acked-by : Benoit Papillault <benoit.papillault@free.fr>

Very nice, thanks for the fuller commit log. Hm, the question I also
wanted to address was whether or not this is a stable fix to go for
2.6.32 and 2.6.33, I suppose we'd have to look at all callers of
ieee80211_hdrlen() but this seems like a stable fix to me.

  Luis

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

* Re: [PATCH] mac80211: Account HT Control field in Data frame hdrlen according to 802.11n-2009
  2010-01-20 18:08 ` Luis R. Rodriguez
@ 2010-01-21 10:07   ` Andriy Tkachuk
  0 siblings, 0 replies; 4+ messages in thread
From: Andriy Tkachuk @ 2010-01-21 10:07 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless, John W. Linville

On 2010-01-20 20:08, Luis R. Rodriguez wrote:
> Very nice, thanks for the fuller commit log. Hm, the question I also
> wanted to address was whether or not this is a stable fix to go for
> 2.6.32 and 2.6.33, I suppose we'd have to look at all callers of
> ieee80211_hdrlen() but this seems like a stable fix to me.

As I already said, I would rather classify this change as a feature then
a fix, so I would advise to give the code more time for breaking-in
starting from the current branch and not put the stable at an odd risk
(which seem to be the minor one, though).

Regards,
    Andriy

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

end of thread, other threads:[~2010-01-21 10:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-20 11:55 [PATCH] mac80211: Account HT Control field in Data frame hdrlen according to 802.11n-2009 Andriy Tkachuk
2010-01-20 18:08 ` Luis R. Rodriguez
2010-01-21 10:07   ` Andriy Tkachuk
  -- strict thread matches above, loose matches on Subject: below --
2010-01-20 10:17 Andriy Tkachuk

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).