Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Mar 2010 17:17:21 +0100
From:      Alexander Egorenkov <egorenar@googlemail.com>
To:        Rui Paulo <rpaulo@freebsd.org>
Cc:        freebsd-net@freebsd.org
Subject:   Re: Setting HT capabilities in net80211
Message-ID:  <2d3b7e441003130817y1210508fycb3cb22a9a7198d1@mail.gmail.com>
In-Reply-To: <6A317237-60A2-440A-9DBC-511545C34B36@FreeBSD.org>
References:  <2d3b7e441003042348h2150de3eub5a7af5248b5e947@mail.gmail.com> <4B92F057.9080508@errno.com> <2d3b7e441003070004r74646cdci268a5101056c50e2@mail.gmail.com> <FF382027-F72F-40BA-B14C-7F2F72DD684A@gmail.com> <2d3b7e441003102332l1cc9b9ddh1e62fce61129248@mail.gmail.com> <6A317237-60A2-440A-9DBC-511545C34B36@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
I have finally patched net80211 on my system and added HT extended
capabilities support.

Here are the patches.

I added a new variable to ieee80211com struct.
It seems that only the lowest 16 bit of ic_htcaps are used, an alternative
to a new variable would be to use the highest 16 bit of ic_htcaps.

Here is a code snippet from my driver which sets ic_htextcaps:

ic->ic_htextcaps = IEEE80211_HTCAP_MCSFBACK_UNSOL |
        IEEE80211_HTCAP_HTC |
        IEEE80211_HTCAP_RDR;

I also captured an association process with 802.11n AP and it seems the
capabilities were set right.

Alex.

On Thu, Mar 11, 2010 at 8:44 AM, Rui Paulo <rpaulo@freebsd.org> wrote:

>
> On 11 Mar 2010, at 16:32, Alexander Egorenkov wrote:
>
>  There are already constants defined in iee80211.h.
>> E.g. IEEE80211_HTCAP_MCSFBACK_UNSOL.
>>
>> But the problem is that e.g. IEEE80211_HTCAP_MCSFBACK_UNSOL is equal to
>> 0x0200
>> and the capabilty constant IEEE80211_HTCAP_RXSTBC_2STREAM has the same
>> value.
>> So we cannot use ic_htcap field for both capabilities because they will
>> overwrite each other.
>>
>> But  we can add a new field to ieee80211com struct like ic_htextcaps where
>> all the extended
>> HT capabilities can be set. And this new field can be checked in function
>> ieee80211_add_htcap_body.
>>
>
> I'm okay with this route.
>
>
>  Another option is to change the value of IEEE80211_HTCAP_MCSFBACK_UNSOL
>> and all other extended capability constant which conflict with normal HT
>> capability constants.
>>
>
> I think you don't want to do this because sooner or later you'll need
> ic_htextcaps.
>
> --
> Rui Paulo
>
>

[-- Attachment #2 --]
--- ieee80211_var.h.orig	2010-03-13 10:36:33.000000000 +0100
+++ ieee80211_var.h	2010-03-13 11:22:40.000000000 +0100
@@ -137,6 +137,7 @@
 	uint32_t		ic_flags_ven;	/* vendor state flags */
 	uint32_t		ic_caps;	/* capabilities */
 	uint32_t		ic_htcaps;	/* HT capabilities */
+	uint32_t		ic_htextcaps;	/* HT extended capabilities */
 	uint32_t		ic_cryptocaps;	/* crypto capabilities */
 	uint8_t			ic_modecaps[2];	/* set of mode capabilities */
 	uint8_t			ic_promisc;	/* vap's needing promisc mode */
@@ -340,6 +341,7 @@
 	uint32_t		iv_flags_ven;	/* vendor state flags */
 	uint32_t		iv_caps;	/* capabilities */
 	uint32_t		iv_htcaps;	/* HT capabilities */
+	uint32_t		iv_htextcaps;	/* HT extended capabilities */
 	enum ieee80211_opmode	iv_opmode;	/* operation mode */
 	enum ieee80211_state	iv_state;	/* state machine state */
 	enum ieee80211_state	iv_nstate;	/* pending state */

[-- Attachment #3 --]
--- ieee80211.c.orig	2010-03-13 10:38:54.000000000 +0100
+++ ieee80211.c	2010-03-13 10:39:21.000000000 +0100
@@ -405,6 +405,7 @@
 	vap->iv_flags_ven = ic->ic_flags_ven;
 	vap->iv_caps = ic->ic_caps &~ IEEE80211_C_OPMODE;
 	vap->iv_htcaps = ic->ic_htcaps;
+	vap->iv_htextcaps = ic->ic_htextcaps;
 	vap->iv_opmode = opmode;
 	vap->iv_caps |= ieee80211_opcap[opmode];
 	switch (opmode) {

[-- Attachment #4 --]
--- ieee80211_ht.c.orig	2010-03-13 10:36:42.000000000 +0100
+++ ieee80211_ht.c	2010-03-13 10:49:18.000000000 +0100
@@ -2304,7 +2304,7 @@
 	frm += 2;				\
 } while (0)
 	struct ieee80211vap *vap = ni->ni_vap;
-	uint16_t caps;
+	uint16_t caps, extcaps;
 	int rxmax, density;
 
 	/* HT capabilities */
@@ -2362,8 +2362,17 @@
 	 */
 	ieee80211_set_htrates(frm, &ieee80211_rateset_11n);
 
-	frm += sizeof(struct ieee80211_ie_htcap) -
+	frm += __offsetof(struct ieee80211_ie_htcap, hc_extcap) -
 		__offsetof(struct ieee80211_ie_htcap, hc_mcsset);
+
+	/* HT extended capabilities */
+	extcaps = vap->iv_htextcaps & 0xffff;
+
+	ADDSHORT(frm, extcaps);
+
+	frm += sizeof(struct ieee80211_ie_htcap) -
+		__offsetof(struct ieee80211_ie_htcap, hc_txbf);
+
 	return frm;
 #undef ADDSHORT
 }

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2d3b7e441003130817y1210508fycb3cb22a9a7198d1>