* Re: mac80211: UAPSD - EOSP bit seems to be not set when send qos null frame
From: Janusz Dziedzic @ 2011-11-03 8:49 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
In-Reply-To: <1320308142.3950.3.camel@jlt3.sipsolutions.net>
2011/11/3 Johannes Berg <johannes@sipsolutions.net>:
> On Thu, 2011-11-03 at 09:08 +0100, Johannes Berg wrote:
>
>> > Yes, I see this is set correctly before we call ieee80211_set_qos_hdr().
>> > Next ieee80211_set_qos_hdr() fuction seems not care about EOSP bit and
>> > we have this bit cleared before ieee80211_tx() call.
>>
>> Oh, WTH. Somebody had posted a patch that fixed that, I thought that
>> went in but in my testing this didn't show up since my device always
>> sets/clears it according to what I told it.
>
> Try this please.
>
> johannes
>
> --- wireless-testing.orig/net/mac80211/wme.c 2011-11-02 11:05:29.000000000 +0100
> +++ wireless-testing/net/mac80211/wme.c 2011-11-03 09:14:30.000000000 +0100
> @@ -143,10 +143,13 @@ void ieee80211_set_qos_hdr(struct ieee80
> /* Fill in the QoS header if there is one. */
> if (ieee80211_is_data_qos(hdr->frame_control)) {
> u8 *p = ieee80211_get_qos_ctl(hdr);
> - u8 ack_policy = 0, tid;
> + u8 ack_policy, tid;
>
> tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
>
> + /* preserve EOSP bit */
> + ack_policy = *p & IEEE80211_QOS_CTL_EOSP;
> +
> if (unlikely(sdata->local->wifi_wme_noack_test))
> ack_policy |= IEEE80211_QOS_CTL_ACK_POLICY_NOACK;
> /* qos header is 2 bytes */
>
>
>
Verified. Now works correctly.
Thanks.
BR
Janusz
^ permalink raw reply
* Re: [PATCH v3 3/3] mac80211: Allow overriding some HT information.
From: Johannes Berg @ 2011-11-03 8:47 UTC (permalink / raw)
To: greearb; +Cc: linux-wireless
In-Reply-To: <1320299722-30113-3-git-send-email-greearb@candelatech.com>
On Wed, 2011-11-02 at 22:55 -0700, greearb@candelatech.com wrote:
> -void ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_supported_band *sband,
> +void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
> + struct ieee80211_sta_ht_cap *ht_cap,
> + int min_rates)
> +{
> + u8 *scaps = (u8 *)(&sdata->u.mgd.ht_capa.mcs.rx_mask);
> + u8 *smask = (u8 *)(&sdata->u.mgd.ht_capa_mask.mcs.rx_mask);
> + int i;
> +
> + /* check for HT over-rides, MCS rates first. */
> + for (i = 0; i < IEEE80211_HT_MCS_MASK_LEN; i++) {
> + int q;
> + for (q = 0; q < 8; q++) {
> + /*
> + * We always need to advert at least MCS0-7, to
> + * be a compliant HT station, for instance
> + */
> + if (((i * 8 + q) >= min_rates) &&
> + (smask[i] & (1<<q))) {
> + if (!(scaps[i] & (1<<q))) {
> + /*
> + * Can only disable rates, not force
> + * new ones
> + */
> + ht_cap->mcs.rx_mask[i] &= ~(1<<q);
> + }
> + }
> + }
> + }
> +
> + /* Force removal of HT-40 capabilities? */
> + if (sdata->u.mgd.flags & IEEE80211_STA_DISABLE_HT40) {
> + ht_cap->cap &= ~(IEEE80211_HT_CAP_SUP_WIDTH_20_40
> + | IEEE80211_HT_CAP_SGI_40);
> + }
Here's another argument for splitting the patches differently -- this
ought to be part of the disable HT40 patch.
> + /* Allow user to decrease AMPDU factor */
> + if (sdata->u.mgd.ht_capa_mask.ampdu_params_info &
> + IEEE80211_HT_AMPDU_PARM_FACTOR) {
> + u16 n = sdata->u.mgd.ht_capa.ampdu_params_info
> + & IEEE80211_HT_AMPDU_PARM_FACTOR;
> + if (n < ht_cap->ampdu_factor)
> + ht_cap->ampdu_factor = n;
> + }
> +
> + /* Set the AMPDU density. */
> + if (sdata->u.mgd.ht_capa_mask.ampdu_params_info &
> + IEEE80211_HT_AMPDU_PARM_DENSITY)
> + ht_cap->ampdu_density =
> + (sdata->u.mgd.ht_capa.ampdu_params_info &
> + IEEE80211_HT_AMPDU_PARM_DENSITY)
> + >> IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT;
> +}
The AMPDU density should only allow increasing.
I think a lot of this validation should live in cfg80211 so if another
driver wants to implement it, this kind of thing is already covered.
> + memcpy(&ht_cap, &sband->ht_cap, sizeof(ht_cap));
> + /*
> + * This is for an association attempt, and stations must
> + * support at least the first 8 MCS rates. See section 20.1.1
> + * of the 802.11n spec for details.
> + */
I think cfg80211 should probably just reject other configuration
attempts.
> + [NL80211_ATTR_HT_CAPABILITY_MASK] = {
> + .type = NLA_BINARY,
> + .len = NL80211_HT_CAPABILITY_LEN
> + },
My mistake -- remove the type, it should be just the length for proper
checking.
I think there's a lot of data in the ht_cap struct that you don't use,
is that right? If so you should reject it being configured. I'm also not
quite sure why you support both disable-HT40, and then this setting here
that has SUP_WIDTH_20_40 too.
I'm more and more coming to the conclusion that it would be clearer to
make separate configuration items for the various things. Most
capabilities you could only disable (greenfield, ...) except for maybe
40mhz-intol, so maybe that would be easier as a separate u16 attribute
"disable these HT capabilities"?
johannes
^ permalink raw reply
* Re: [PATCH v3 1/3] mac80211: Support forcing station to disable HT (802.11n).
From: Johannes Berg @ 2011-11-03 8:37 UTC (permalink / raw)
To: greearb; +Cc: linux-wireless
In-Reply-To: <1320299722-30113-1-git-send-email-greearb@candelatech.com>
On Wed, 2011-11-02 at 22:55 -0700, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
>
> This allows a user to configure a wifi station interface
> to disable the HT features, even if the AP and NIC supports it.
I like this version much better. Some nitpicks:
> +#define ASSOC_REQ_DISABLE_HT (1<<0) /* Disable HT (802.11n) */
You could use an enum to use kernel-doc notation here.
> @@ -1046,6 +1048,7 @@ struct cfg80211_auth_request {
> * @use_mfp: Use management frame protection (IEEE 802.11w) in this association
> * @crypto: crypto settings
> * @prev_bssid: previous BSSID, if not %NULL use reassociate frame
> + * @flags: See ASSOC_REQ_* flags above.
and then say "See &enum cfg80211_assoc_req_flags" or so should even
create the correct link in kernel-doc output.
> @@ -1053,6 +1056,7 @@ struct cfg80211_assoc_request {
> size_t ie_len;
> struct cfg80211_crypto_settings crypto;
> bool use_mfp;
> + u32 flags;
Seems like it might be good for use_mfp to become a flag? Anyway,
internal APIs are easy to change.
> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
I'd rather split this up into cfg80211/mac80211. In fact, maybe
splitting it into one cfg80211 and one mac80211 patch, instead of three
different patches that span both might be worthwhile?
johannes
^ permalink raw reply
* Re: [wireless-next PATCH 3/5] wifi: Allow overriding some HT information.
From: Johannes Berg @ 2011-11-03 8:32 UTC (permalink / raw)
To: Ben Greear; +Cc: linux-wireless
In-Reply-To: <4EB1860E.5080800@candelatech.com>
On Wed, 2011-11-02 at 11:03 -0700, Ben Greear wrote:
> >>>> /* add attributes here, update the policy in nl80211.c */
> >>
> >> I copied some of that code from nl80211_set_station, which appears to
> >> also forget to check the length for the NL80211_ATTR_HT_CAPABILITY
> >> object. Is there some reason why it doesn't need to check, or does
> >> that code need fixing as well?
> >
> > NL80211_ATTR_HT_CAPABILITY in particular *has* a policy entry.
>
> Ahh, I didn't realize that's what was meant by policy. Mind if
> I change that comment to something like what is below?
>
> /* add attributes here, update the nl80211_policy array in nl80211.c */
That seems reasonable, though there are multiple policies for
differently nested attributes, but I guess anyone who understands that
will get far enough anyway :-)
FWIW, I just found that the exact example you pointed out had a bug --
NLA_BINARY enforces a *max*, not *min* length. There's a patch in flight
to fix it.
johannes
^ permalink raw reply
* Re: [wireless-next PATCH 1/5] mac80211: Support forcing station to disable 11n.
From: Johannes Berg @ 2011-11-03 8:30 UTC (permalink / raw)
To: Ben Greear; +Cc: linux-wireless
In-Reply-To: <4EB22EE6.3030100@candelatech.com>
On Wed, 2011-11-02 at 23:04 -0700, Ben Greear wrote:
> I think I made at least most of the other changes you were asking
> for, but I'm still baffled about what to do about fullmac drivers.
>
> Based on the comment above, if I simply left out the mac80211 stuff
> then the new values passed in to the associate/connect logic will just
> be ignored.
>
> So, I suppose the fullmac drivers will just silently ignore the new
> variables as well. I looked, but didn't figure out where fullmac
> connects into the cfg80211 logic. If I can find it, then I could
> add explicit checks for the new variables and return failure if
> they are set..but I'm not sure that is any better than just silently
> ignoring them anyway.
So I think just ignoring it would be a bad idea, because you have no way
to know whether or not the values were used afterwards. That might be
sufficient for you right now, but typically becomes a support problem at
some point because people try it and can't figure out what part broke.
That's why I think silently ignoring something like that is not a good
idea.
Hence the typical handling of this with a wiphy flag that you set and if
it's unset but userspace is requesting this you reject the command.
johannes
^ permalink raw reply
* [PATCH] nl80211: fix HT capability attribute validation
From: Johannes Berg @ 2011-11-03 8:27 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
From: Johannes Berg <johannes.berg@intel.com>
Since the NL80211_ATTR_HT_CAPABILITY attribute is
used as a struct, it needs a minimum, not maximum
length. Enforce that properly. Not doing so could
potentially lead to reading after the buffer.
Cc: stable@vger.kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/wireless/nl80211.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/net/wireless/nl80211.c 2011-11-03 09:00:25.000000000 +0100
+++ b/net/wireless/nl80211.c 2011-11-03 09:16:21.000000000 +0100
@@ -132,8 +132,7 @@ static const struct nla_policy nl80211_p
[NL80211_ATTR_MESH_CONFIG] = { .type = NLA_NESTED },
[NL80211_ATTR_SUPPORT_MESH_AUTH] = { .type = NLA_FLAG },
- [NL80211_ATTR_HT_CAPABILITY] = { .type = NLA_BINARY,
- .len = NL80211_HT_CAPABILITY_LEN },
+ [NL80211_ATTR_HT_CAPABILITY] = { .len = NL80211_HT_CAPABILITY_LEN },
[NL80211_ATTR_MGMT_SUBTYPE] = { .type = NLA_U8 },
[NL80211_ATTR_IE] = { .type = NLA_BINARY,
^ permalink raw reply
* Re: mac80211: UAPSD - EOSP bit seems to be not set when send qos null frame
From: Johannes Berg @ 2011-11-03 8:15 UTC (permalink / raw)
To: Janusz Dziedzic; +Cc: linux-wireless
In-Reply-To: <1320307683.3950.2.camel@jlt3.sipsolutions.net>
On Thu, 2011-11-03 at 09:08 +0100, Johannes Berg wrote:
> > Yes, I see this is set correctly before we call ieee80211_set_qos_hdr().
> > Next ieee80211_set_qos_hdr() fuction seems not care about EOSP bit and
> > we have this bit cleared before ieee80211_tx() call.
>
> Oh, WTH. Somebody had posted a patch that fixed that, I thought that
> went in but in my testing this didn't show up since my device always
> sets/clears it according to what I told it.
Try this please.
johannes
--- wireless-testing.orig/net/mac80211/wme.c 2011-11-02 11:05:29.000000000 +0100
+++ wireless-testing/net/mac80211/wme.c 2011-11-03 09:14:30.000000000 +0100
@@ -143,10 +143,13 @@ void ieee80211_set_qos_hdr(struct ieee80
/* Fill in the QoS header if there is one. */
if (ieee80211_is_data_qos(hdr->frame_control)) {
u8 *p = ieee80211_get_qos_ctl(hdr);
- u8 ack_policy = 0, tid;
+ u8 ack_policy, tid;
tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
+ /* preserve EOSP bit */
+ ack_policy = *p & IEEE80211_QOS_CTL_EOSP;
+
if (unlikely(sdata->local->wifi_wme_noack_test))
ack_policy |= IEEE80211_QOS_CTL_ACK_POLICY_NOACK;
/* qos header is 2 bytes */
^ permalink raw reply
* Re: mac80211: UAPSD - EOSP bit seems to be not set when send qos null frame
From: Johannes Berg @ 2011-11-03 8:08 UTC (permalink / raw)
To: Janusz Dziedzic; +Cc: linux-wireless
In-Reply-To: <CAFED-j=sP7PSD8yv1U4RA9-NGnjJ9CE5C6qWOQxZ=rzGMdt+2w@mail.gmail.com>
On Thu, 2011-11-03 at 09:05 +0100, Janusz Dziedzic wrote:
> 2011/11/3 Johannes Berg <johannes@sipsolutions.net>:
> > On Thu, 2011-11-03 at 08:36 +0100, Janusz Dziedzic wrote:
> >> Hello,
> >>
> >> I have a question connected with UAPSD implementation.
> >> Seems, mac80211 always clear EOSP bit in ieee80211_set_qos_hdr() fuction.
> >> Is that a problem in mac80211 or this should be handled in different place/way?
> >
> > It should be set:
> >
> > if (qos) {
> > nullfunc->qos_ctrl = cpu_to_le16(tid);
> >
> > if (reason == IEEE80211_FRAME_RELEASE_UAPSD)
> > nullfunc->qos_ctrl |=
> > cpu_to_le16(IEEE80211_QOS_CTL_EOSP);
> > }
> >
>
> Yes, I see this is set correctly before we call ieee80211_set_qos_hdr().
> Next ieee80211_set_qos_hdr() fuction seems not care about EOSP bit and
> we have this bit cleared before ieee80211_tx() call.
Oh, WTH. Somebody had posted a patch that fixed that, I thought that
went in but in my testing this didn't show up since my device always
sets/clears it according to what I told it.
johannes
^ permalink raw reply
* Re: mac80211: UAPSD - EOSP bit seems to be not set when send qos null frame
From: Janusz Dziedzic @ 2011-11-03 8:05 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
In-Reply-To: <1320306440.3950.0.camel@jlt3.sipsolutions.net>
2011/11/3 Johannes Berg <johannes@sipsolutions.net>:
> On Thu, 2011-11-03 at 08:36 +0100, Janusz Dziedzic wrote:
>> Hello,
>>
>> I have a question connected with UAPSD implementation.
>> Seems, mac80211 always clear EOSP bit in ieee80211_set_qos_hdr() fuction.
>> Is that a problem in mac80211 or this should be handled in different place/way?
>
> It should be set:
>
> if (qos) {
> nullfunc->qos_ctrl = cpu_to_le16(tid);
>
> if (reason == IEEE80211_FRAME_RELEASE_UAPSD)
> nullfunc->qos_ctrl |=
> cpu_to_le16(IEEE80211_QOS_CTL_EOSP);
> }
>
Yes, I see this is set correctly before we call ieee80211_set_qos_hdr().
Next ieee80211_set_qos_hdr() fuction seems not care about EOSP bit and
we have this bit cleared before ieee80211_tx() call.
BR
Janusz
^ permalink raw reply
* Re: [PATCH] ieee80211: Define cipher suite selector for WPI-SMS4
From: Johannes Berg @ 2011-11-03 7:56 UTC (permalink / raw)
To: Dan Williams; +Cc: Jouni Malinen, John W. Linville, linux-wireless
In-Reply-To: <1320282954.20617.1.camel@dcbw.foobar.com>
On Wed, 2011-11-02 at 20:15 -0500, Dan Williams wrote:
> On Wed, 2011-11-02 at 23:34 +0200, Jouni Malinen wrote:
> > This value is used for WPI-SMS4 in ISO/IEC JTC 1 N 9880.
>
> Does that mean WAPI at some point? :)
If somebody decides they can publish a supplicant for it, we already
have it in a few drivers that have HW crypto. No SW crypto, so there
won't be generic support.
johannes
^ permalink raw reply
* Re: mac80211: UAPSD - EOSP bit seems to be not set when send qos null frame
From: Johannes Berg @ 2011-11-03 7:47 UTC (permalink / raw)
To: Janusz Dziedzic; +Cc: linux-wireless
In-Reply-To: <CAFED-jkVtVFBJfDc-18a+RogAFoTVudS9_POjZHFZ=AtBu1p0g@mail.gmail.com>
On Thu, 2011-11-03 at 08:36 +0100, Janusz Dziedzic wrote:
> Hello,
>
> I have a question connected with UAPSD implementation.
> Seems, mac80211 always clear EOSP bit in ieee80211_set_qos_hdr() fuction.
> Is that a problem in mac80211 or this should be handled in different place/way?
It should be set:
if (qos) {
nullfunc->qos_ctrl = cpu_to_le16(tid);
if (reason == IEEE80211_FRAME_RELEASE_UAPSD)
nullfunc->qos_ctrl |=
cpu_to_le16(IEEE80211_QOS_CTL_EOSP);
}
johannes
^ permalink raw reply
* mac80211: UAPSD - EOSP bit seems to be not set when send qos null frame
From: Janusz Dziedzic @ 2011-11-03 7:36 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes
Hello,
I have a question connected with UAPSD implementation.
Seems, mac80211 always clear EOSP bit in ieee80211_set_qos_hdr() fuction.
Is that a problem in mac80211 or this should be handled in different place/way?
BR
Janusz
^ permalink raw reply
* Re: wireless git trees returning to kernel.org
From: Kalle Valo @ 2011-11-03 7:29 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless
In-Reply-To: <20111102180946.GC12168@tuxdriver.com>
"John W. Linville" <linville@tuxdriver.com> writes:
> FYI...
>
> I have migrated the wireless git trees back to the kernel.org
> infrastructure. As of right now, the trees are identical between
> kernel.org and infradead.org. Further updates likely will only go
> to kernel.org, so plan accordingly.
Once you stop updating infradead.org please remove the trees from the
server. Otherwise people might be accidentally still using the old
tree and not getting the latest updates. I have quite a few clones on
my machines which follow your trees and most likely I don't remember
to update all of them.
--
Kalle Valo
^ permalink raw reply
* [PATCH 3/3] wl12xx: increase firmware upload chunk size
From: Luciano Coelho @ 2011-11-03 6:44 UTC (permalink / raw)
To: coelho; +Cc: linux-wireless
In-Reply-To: <1320302683-23403-1-git-send-email-coelho@ti.com>
The chunk size used during firmware upload was set to 512, which is
the size of a single SDIO block (or two). This is very inneficient
because we send one or two blocks only per SDIO transaction and don't
get the full benefits of sdio block transfers.
This patch increases the chunk size to 16K. This more than doubles
the transfer speed both in wl127x and wl128x chips, with greater
impact on the latter:
wl127x: 512 bytes chunk -> ~132ms
16384 bytes chunk -> ~57ms
wl128x: 512 bytes chunk -> ~216ms
16384 bytes chunk -> ~37ms
Signed-off-by: Luciano Coelho <coelho@ti.com>
---
drivers/net/wireless/wl12xx/reg.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/reg.h b/drivers/net/wireless/wl12xx/reg.h
index 3f570f3..df34d59 100644
--- a/drivers/net/wireless/wl12xx/reg.h
+++ b/drivers/net/wireless/wl12xx/reg.h
@@ -408,7 +408,7 @@
/* Firmware image load chunk size */
-#define CHUNK_SIZE 512
+#define CHUNK_SIZE 16384
/* Firmware image header size */
#define FW_HDR_SIZE 8
--
1.7.4.1
^ permalink raw reply related
* [PATCH 2/3] wl12xx: use the same SDIO block size for all different chips
From: Luciano Coelho @ 2011-11-03 6:44 UTC (permalink / raw)
To: coelho; +Cc: linux-wireless
In-Reply-To: <1320302683-23403-1-git-send-email-coelho@ti.com>
The sdio driver uses a block size of 512 bytes by default. With our
card, this doesn't work correctly because it sets the block size FBR
in the chip too early (ie. before the chip is powered on). Thus, if
we don't set it explicitly, block mode remains disabled in the chip.
If we try to send more data than fits in one block, the sdio driver
will split it into separate blocks before sending to the chip. This
causes problems because the chip is not expecting multiple blocks.
At the moment this is not a problem, because we use chunks of 512
bytes for firmware upload and the data is always sent in byte mode.
In the next patch, we will change the chunk size to a bigger value, so
this patch is a preparation for that.
Signed-off-by: Luciano Coelho <coelho@ti.com>
---
drivers/net/wireless/wl12xx/main.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index bddf289..0532630 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -1313,7 +1313,16 @@ static int wl1271_chip_wakeup(struct wl1271 *wl)
/* 0. read chip id from CHIP_ID */
wl->chip.id = wl1271_read32(wl, CHIP_ID_B);
- /* 1. check if chip id is valid */
+ /*
+ * For wl127x based devices we could use the default block
+ * size (512 bytes), but due to a bug in the sdio driver, we
+ * need to set it explicitly after the chip is powered on. To
+ * simplify the code and since the performance impact is
+ * negligible, we use the same block size for all different
+ * chip types.
+ */
+ if (!wl1271_set_block_size(wl))
+ wl->quirks |= WL12XX_QUIRK_NO_BLOCKSIZE_ALIGNMENT;
switch (wl->chip.id) {
case CHIP_ID_1271_PG10:
@@ -1343,9 +1352,6 @@ static int wl1271_chip_wakeup(struct wl1271 *wl)
ret = wl1271_setup(wl);
if (ret < 0)
goto out;
-
- if (!wl1271_set_block_size(wl))
- wl->quirks |= WL12XX_QUIRK_NO_BLOCKSIZE_ALIGNMENT;
break;
case CHIP_ID_1283_PG10:
default:
--
1.7.4.1
^ permalink raw reply related
* [PATCH 1/3] wl12xx: change blocksize alignment quirk to negative
From: Luciano Coelho @ 2011-11-03 6:44 UTC (permalink / raw)
To: coelho; +Cc: linux-wireless
In-Reply-To: <1320302683-23403-1-git-send-email-coelho@ti.com>
SDIO blocksize alignment support is now the rule, not the exception.
To simplify the code in patches to come, invert the meaning of the
quirk to be negative (ie. the quirk is set if the device does _not_
support blocksize alignment).
Signed-off-by: Luciano Coelho <coelho@ti.com>
---
drivers/net/wireless/wl12xx/init.c | 2 +-
drivers/net/wireless/wl12xx/main.c | 8 ++++++--
drivers/net/wireless/wl12xx/tx.c | 6 +++---
drivers/net/wireless/wl12xx/wl12xx.h | 4 ++--
4 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/init.c b/drivers/net/wireless/wl12xx/init.c
index c6084f8..6d06188 100644
--- a/drivers/net/wireless/wl12xx/init.c
+++ b/drivers/net/wireless/wl12xx/init.c
@@ -501,7 +501,7 @@ int wl1271_chip_specific_init(struct wl1271 *wl)
if (wl->chip.id == CHIP_ID_1283_PG20) {
u32 host_cfg_bitmap = HOST_IF_CFG_RX_FIFO_ENABLE;
- if (wl->quirks & WL12XX_QUIRK_BLOCKSIZE_ALIGNMENT)
+ if (!(wl->quirks & WL12XX_QUIRK_NO_BLOCKSIZE_ALIGNMENT))
/* Enable SDIO padding */
host_cfg_bitmap |= HOST_IF_CFG_TX_PAD_TO_SDIO_BLK;
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index f76be5a..bddf289 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -1323,7 +1323,9 @@ static int wl1271_chip_wakeup(struct wl1271 *wl)
ret = wl1271_setup(wl);
if (ret < 0)
goto out;
+ wl->quirks |= WL12XX_QUIRK_NO_BLOCKSIZE_ALIGNMENT;
break;
+
case CHIP_ID_1271_PG20:
wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1271 PG20)",
wl->chip.id);
@@ -1331,7 +1333,9 @@ static int wl1271_chip_wakeup(struct wl1271 *wl)
ret = wl1271_setup(wl);
if (ret < 0)
goto out;
+ wl->quirks |= WL12XX_QUIRK_NO_BLOCKSIZE_ALIGNMENT;
break;
+
case CHIP_ID_1283_PG20:
wl1271_debug(DEBUG_BOOT, "chip id 0x%x (1283 PG20)",
wl->chip.id);
@@ -1340,8 +1344,8 @@ static int wl1271_chip_wakeup(struct wl1271 *wl)
if (ret < 0)
goto out;
- if (wl1271_set_block_size(wl))
- wl->quirks |= WL12XX_QUIRK_BLOCKSIZE_ALIGNMENT;
+ if (!wl1271_set_block_size(wl))
+ wl->quirks |= WL12XX_QUIRK_NO_BLOCKSIZE_ALIGNMENT;
break;
case CHIP_ID_1283_PG10:
default:
diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c
index c7ad4f5..686c5e5 100644
--- a/drivers/net/wireless/wl12xx/tx.c
+++ b/drivers/net/wireless/wl12xx/tx.c
@@ -205,10 +205,10 @@ u8 wl12xx_tx_get_hlid(struct wl1271 *wl, struct wl12xx_vif *wlvif,
static unsigned int wl12xx_calc_packet_alignment(struct wl1271 *wl,
unsigned int packet_length)
{
- if (wl->quirks & WL12XX_QUIRK_BLOCKSIZE_ALIGNMENT)
- return ALIGN(packet_length, WL12XX_BUS_BLOCK_SIZE);
- else
+ if (wl->quirks & WL12XX_QUIRK_NO_BLOCKSIZE_ALIGNMENT)
return ALIGN(packet_length, WL1271_TX_ALIGN_TO);
+ else
+ return ALIGN(packet_length, WL12XX_BUS_BLOCK_SIZE);
}
static int wl1271_tx_allocate(struct wl1271 *wl, struct wl12xx_vif *wlvif,
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h
index b7036df..e58e801 100644
--- a/drivers/net/wireless/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/wl12xx/wl12xx.h
@@ -669,8 +669,8 @@ size_t wl12xx_copy_fwlog(struct wl1271 *wl, u8 *memblock, size_t maxlen);
/* Each RX/TX transaction requires an end-of-transaction transfer */
#define WL12XX_QUIRK_END_OF_TRANSACTION BIT(0)
-/* WL128X requires aggregated packets to be aligned to the SDIO block size */
-#define WL12XX_QUIRK_BLOCKSIZE_ALIGNMENT BIT(2)
+/* wl127x and SPI don't support SDIO block size alignment */
+#define WL12XX_QUIRK_NO_BLOCKSIZE_ALIGNMENT BIT(2)
/* Older firmwares did not implement the FW logger over bus feature */
#define WL12XX_QUIRK_FWLOG_NOT_IMPLEMENTED BIT(4)
--
1.7.4.1
^ permalink raw reply related
* [PATCH 0/3] wl12xx: improve firmware transfer efficiency
From: Luciano Coelho @ 2011-11-03 6:44 UTC (permalink / raw)
To: coelho; +Cc: linux-wireless
Hello,
These patches increase the FW upload efficiency by using multiple SDIO
blocks in a single write. After a lot of measurements, studies and
discussions, I came to the conclusion that 16K chunks is the optimal
size to use. This reduces the upload time by a factor of 0.43 on
wl127x and by a factor of 0.17 on wl128x. In absolute numbers this
means 75ms and 179ms respectively.
The first patch changes the semantics and name of the blocksize
alignment quirk to negative, to simplify the code in the next two
patches.
Cheers,
Luca.
Luciano Coelho (3):
wl12xx: change blocksize alignment quirk to negative
wl12xx: use the same SDIO block size for all different chips
wl12xx: increase firmware upload chunk size
drivers/net/wireless/wl12xx/init.c | 2 +-
drivers/net/wireless/wl12xx/main.c | 18 ++++++++++++++----
drivers/net/wireless/wl12xx/reg.h | 2 +-
drivers/net/wireless/wl12xx/tx.c | 6 +++---
drivers/net/wireless/wl12xx/wl12xx.h | 4 ++--
5 files changed, 21 insertions(+), 11 deletions(-)
--
1.7.4.1
^ permalink raw reply
* Re: [wireless-next PATCH 1/5] mac80211: Support forcing station to disable 11n.
From: Ben Greear @ 2011-11-03 6:04 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
In-Reply-To: <1320256263.7846.3.camel@jlt3.sipsolutions.net>
On 11/02/2011 10:51 AM, Johannes Berg wrote:
> On Wed, 2011-11-02 at 09:34 -0700, Ben Greear wrote:
>
>>> You misunderstood -- I said fullmac drivers, not differences between
>>> ath9k, iwlwifi etc. Other cfg80211 drivers, not other mac80211 drivers.
>>
>> Can you at least point me to some existing code that does a similar
>> check? I have no idea of what a fullmac driver even does. I can test
>> and eventually somewhat understand the paths for ath9k, but I have no
>> ability to test fullmac (as far as I know).
>
> Well ideally you have two patches -- one for cfg80211, and one for
> mac80211. Then you can test the cfg80211 one w/o mac80211 patches, so it
> behaves as though it didn't support it, and with the mac80211 patch it
> sets the flag to support it. Just think about drivers like ath6kl.
I think I made at least most of the other changes you were asking
for, but I'm still baffled about what to do about fullmac drivers.
Based on the comment above, if I simply left out the mac80211 stuff
then the new values passed in to the associate/connect logic will just
be ignored.
So, I suppose the fullmac drivers will just silently ignore the new
variables as well. I looked, but didn't figure out where fullmac
connects into the cfg80211 logic. If I can find it, then I could
add explicit checks for the new variables and return failure if
they are set..but I'm not sure that is any better than just silently
ignoring them anyway.
Anyway, hopefully the 3 v3 patches are closer to what you are
looking for. They seem to test out fine for me, though I never
see AMSDU go to max value. Maybe ath9k just doesn't support
that by default, as I didn't see it on the stock wireless-testing
code either...or maybe my AP or something else is weird.
I'll post the hostap patches when the kernel side is resolved.
They are a lot smaller now that everything goes through
the connect/associate logic.
Thanks,
Ben
>
> johannes
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* [PATCH v3 3/3] mac80211: Allow overriding some HT information.
From: greearb @ 2011-11-03 5:55 UTC (permalink / raw)
To: linux-wireless; +Cc: Ben Greear
In-Reply-To: <1320299722-30113-1-git-send-email-greearb@candelatech.com>
From: Ben Greear <greearb@candelatech.com>
* Allow configuring the MCS (/n) rates available.
* Allow configuration of MAX-A-MSDU
* Allow configuration of A-MPDU factor & density.
Users can only remove existing rates. The MPDU factor
can only be decreased. The MPDU density can be set to
any value, but at least ath9k will not honor settings below
1us. The MAX-AMSDU can only be disabled.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 48363c3... 25ea406... M include/linux/ieee80211.h
:100644 100644 61b45aa... 9e9ed9d... M include/linux/nl80211.h
:100644 100644 eeeef41... da5a7f9... M include/net/cfg80211.h
:100644 100644 a9ded52... 7f4389e... M net/mac80211/cfg.c
:100644 100644 f80a35c... 39c10a1... M net/mac80211/ht.c
:100644 100644 e4cfeda... aa61189... M net/mac80211/ieee80211_i.h
:100644 100644 149fb1d... dc2e124... M net/mac80211/mlme.c
:100644 100644 6c53b6d... 3f318df... M net/mac80211/work.c
:100644 100644 72e19e4... dd6feda... M net/wireless/core.h
:100644 100644 5c41411... a37e4bc... M net/wireless/mlme.c
:100644 100644 7924e28... 1c544db... M net/wireless/nl80211.c
:100644 100644 449a19f... d144e2d... M net/wireless/sme.c
include/linux/ieee80211.h | 6 ++++
include/linux/nl80211.h | 3 ++
include/net/cfg80211.h | 12 +++++++
net/mac80211/cfg.c | 2 +-
net/mac80211/ht.c | 70 +++++++++++++++++++++++++++++++++++++++++++-
net/mac80211/ieee80211_i.h | 9 +++++-
net/mac80211/mlme.c | 8 ++++-
net/mac80211/work.c | 35 +++++++++++++++------
net/wireless/core.h | 6 ++-
net/wireless/mlme.c | 13 ++++++--
net/wireless/nl80211.c | 32 +++++++++++++++++++-
net/wireless/sme.c | 3 +-
12 files changed, 177 insertions(+), 22 deletions(-)
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 48363c3..25ea406 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -906,6 +906,12 @@ struct ieee80211_mcs_info {
#define IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT 2
#define IEEE80211_HT_MCS_TX_MAX_STREAMS 4
#define IEEE80211_HT_MCS_TX_UNEQUAL_MODULATION 0x10
+/*
+ * Stations supporting 802.11n are required to support
+ * at least the first 8 MCS rates. See section 7.3.2.56.4
+ * and 20.1.1 of the 802.11n spec.
+ */
+#define IEEE80211_HT_MCS_REQ_RATES_STA 8
/*
* 802.11n D5.0 20.3.5 / 20.6 says:
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 61b45aa..9e9ed9d 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -1113,6 +1113,8 @@ enum nl80211_commands {
* this feature.
* @NL80211_ATTR_DISABLE_HT40: Disable HT-40 even if AP and hardware
* support it.
+ * @NL80211_ATTR_HT_CAPABILITY_MASK: Specify which bits of the HT_CAPs
+ * to pay attention to.
*
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -1344,6 +1346,7 @@ enum nl80211_attrs {
NL80211_ATTR_DISABLE_HT,
NL80211_ATTR_DISABLE_HT40,
+ NL80211_ATTR_HT_CAPABILITY_MASK,
/* add attributes here, update the policy in nl80211.c */
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index eeeef41..da5a7f9 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1050,6 +1050,10 @@ struct cfg80211_auth_request {
* @crypto: crypto settings
* @prev_bssid: previous BSSID, if not %NULL use reassociate frame
* @flags: See ASSOC_REQ_* flags above.
+ * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask
+ * will be used in ht_capa. Only the MCS rates, MPDU and MSDU
+ * are currently supported.
+ * @ht_capa_mask: The bits of ht_capa which are to be used.
*/
struct cfg80211_assoc_request {
struct cfg80211_bss *bss;
@@ -1058,6 +1062,8 @@ struct cfg80211_assoc_request {
struct cfg80211_crypto_settings crypto;
bool use_mfp;
u32 flags;
+ struct ieee80211_ht_cap ht_capa;
+ struct ieee80211_ht_cap ht_capa_mask;
};
/**
@@ -1157,6 +1163,10 @@ struct cfg80211_ibss_params {
* @key_len: length of WEP key for shared key authentication
* @key_idx: index of WEP key for shared key authentication
* @key: WEP key for shared key authentication
+ * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask
+ * will be used in ht_capa. Only the MCS rates, MPDU and MSDU
+ * are currently supported.
+ * @ht_capa_mask: The bits of ht_capa which are to be used.
*/
struct cfg80211_connect_params {
struct ieee80211_channel *channel;
@@ -1171,6 +1181,8 @@ struct cfg80211_connect_params {
const u8 *key;
u8 key_len, key_idx;
u32 flags;
+ struct ieee80211_ht_cap ht_capa;
+ struct ieee80211_ht_cap ht_capa_mask;
};
/**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index a9ded52..7f4389e 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -778,7 +778,7 @@ static void sta_apply_parameters(struct ieee80211_local *local,
}
if (params->ht_capa)
- ieee80211_ht_cap_ie_to_sta_ht_cap(sband,
+ ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband,
params->ht_capa,
&sta->sta.ht_cap);
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c
index f80a35c..39c10a1 100644
--- a/net/mac80211/ht.c
+++ b/net/mac80211/ht.c
@@ -18,7 +18,69 @@
#include "ieee80211_i.h"
#include "rate.h"
-void ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_supported_band *sband,
+void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
+ struct ieee80211_sta_ht_cap *ht_cap,
+ int min_rates)
+{
+ u8 *scaps = (u8 *)(&sdata->u.mgd.ht_capa.mcs.rx_mask);
+ u8 *smask = (u8 *)(&sdata->u.mgd.ht_capa_mask.mcs.rx_mask);
+ int i;
+
+ /* check for HT over-rides, MCS rates first. */
+ for (i = 0; i < IEEE80211_HT_MCS_MASK_LEN; i++) {
+ int q;
+ for (q = 0; q < 8; q++) {
+ /*
+ * We always need to advert at least MCS0-7, to
+ * be a compliant HT station, for instance
+ */
+ if (((i * 8 + q) >= min_rates) &&
+ (smask[i] & (1<<q))) {
+ if (!(scaps[i] & (1<<q))) {
+ /*
+ * Can only disable rates, not force
+ * new ones
+ */
+ ht_cap->mcs.rx_mask[i] &= ~(1<<q);
+ }
+ }
+ }
+ }
+
+ /* Force removal of HT-40 capabilities? */
+ if (sdata->u.mgd.flags & IEEE80211_STA_DISABLE_HT40) {
+ ht_cap->cap &= ~(IEEE80211_HT_CAP_SUP_WIDTH_20_40
+ | IEEE80211_HT_CAP_SGI_40);
+ }
+
+ /* Allow user to disable the max-AMSDU bit. */
+ if (sdata->u.mgd.ht_capa_mask.cap_info & IEEE80211_HT_CAP_MAX_AMSDU) {
+ if (!(sdata->u.mgd.ht_capa.cap_info
+ & IEEE80211_HT_CAP_MAX_AMSDU))
+ ht_cap->cap &= ~IEEE80211_HT_CAP_MAX_AMSDU;
+ }
+
+ /* Allow user to decrease AMPDU factor */
+ if (sdata->u.mgd.ht_capa_mask.ampdu_params_info &
+ IEEE80211_HT_AMPDU_PARM_FACTOR) {
+ u16 n = sdata->u.mgd.ht_capa.ampdu_params_info
+ & IEEE80211_HT_AMPDU_PARM_FACTOR;
+ if (n < ht_cap->ampdu_factor)
+ ht_cap->ampdu_factor = n;
+ }
+
+ /* Set the AMPDU density. */
+ if (sdata->u.mgd.ht_capa_mask.ampdu_params_info &
+ IEEE80211_HT_AMPDU_PARM_DENSITY)
+ ht_cap->ampdu_density =
+ (sdata->u.mgd.ht_capa.ampdu_params_info &
+ IEEE80211_HT_AMPDU_PARM_DENSITY)
+ >> IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT;
+}
+
+
+void ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata,
+ struct ieee80211_supported_band *sband,
struct ieee80211_ht_cap *ht_cap_ie,
struct ieee80211_sta_ht_cap *ht_cap)
{
@@ -102,6 +164,12 @@ void ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_supported_band *sband,
/* handle MCS rate 32 too */
if (sband->ht_cap.mcs.rx_mask[32/8] & ht_cap_ie->mcs.rx_mask[32/8] & 1)
ht_cap->mcs.rx_mask[32/8] |= 1;
+
+ /*
+ * If user has specified capability over-rides, take care
+ * of that here.
+ */
+ ieee80211_apply_htcap_overrides(sdata, ht_cap, 0);
}
void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta, bool tx)
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index e4cfeda..aa61189 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -444,6 +444,9 @@ struct ieee80211_if_managed {
*/
int rssi_min_thold, rssi_max_thold;
int last_ave_beacon_signal;
+ struct ieee80211_ht_cap ht_capa; /* configured ht-cap over-rides */
+ struct ieee80211_ht_cap ht_capa_mask; /* Valid parts of ht_capa */
+
};
struct ieee80211_if_ibss {
@@ -1180,7 +1183,11 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
struct net_device *dev);
/* HT */
-void ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_supported_band *sband,
+void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
+ struct ieee80211_sta_ht_cap *ht_cap,
+ int min_rates);
+void ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata,
+ struct ieee80211_supported_band *sband,
struct ieee80211_ht_cap *ht_cap_ie,
struct ieee80211_sta_ht_cap *ht_cap);
void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata,
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 149fb1d..dc2e124 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1585,7 +1585,7 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk,
sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE;
if (elems.ht_cap_elem && !(ifmgd->flags & IEEE80211_STA_DISABLE_11N))
- ieee80211_ht_cap_ie_to_sta_ht_cap(sband,
+ ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband,
elems.ht_cap_elem, &sta->sta.ht_cap);
ap_ht_cap_flags = sta->sta.ht_cap.cap;
@@ -1954,7 +1954,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
- ieee80211_ht_cap_ie_to_sta_ht_cap(sband,
+ ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband,
elems.ht_cap_elem, &sta->sta.ht_cap);
ap_ht_cap_flags = sta->sta.ht_cap.cap;
@@ -2619,6 +2619,10 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
if (req->flags & ASSOC_REQ_DISABLE_HT40)
ifmgd->flags |= IEEE80211_STA_DISABLE_HT40;
+ memcpy(&ifmgd->ht_capa, &req->ht_capa, sizeof(ifmgd->ht_capa));
+ memcpy(&ifmgd->ht_capa_mask, &req->ht_capa_mask,
+ sizeof(ifmgd->ht_capa_mask));
+
if (req->ie && req->ie_len) {
memcpy(wk->ie, req->ie, req->ie_len);
wk->ie_len = req->ie_len;
diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index 6c53b6d..3f318df 100644
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -94,7 +94,8 @@ static int ieee80211_compatible_rates(const u8 *supp_rates, int supp_rates_len,
/* frame sending functions */
-static void ieee80211_add_ht_ie(struct sk_buff *skb, const u8 *ht_info_ie,
+static void ieee80211_add_ht_ie(struct ieee80211_sub_if_data *sdata,
+ struct sk_buff *skb, const u8 *ht_info_ie,
struct ieee80211_supported_band *sband,
struct ieee80211_channel *channel,
enum ieee80211_smps_mode smps)
@@ -102,11 +103,11 @@ static void ieee80211_add_ht_ie(struct sk_buff *skb, const u8 *ht_info_ie,
struct ieee80211_ht_info *ht_info;
u8 *pos;
u32 flags = channel->flags;
- u16 cap = sband->ht_cap.cap;
+ u16 cap;
__le16 tmp;
+ struct ieee80211_sta_ht_cap ht_cap;
- if (!sband->ht_cap.ht_supported)
- return;
+ BUILD_BUG_ON(sizeof(ht_cap) != sizeof(sband->ht_cap));
if (!ht_info_ie)
return;
@@ -114,6 +115,20 @@ static void ieee80211_add_ht_ie(struct sk_buff *skb, const u8 *ht_info_ie,
if (ht_info_ie[1] < sizeof(struct ieee80211_ht_info))
return;
+ memcpy(&ht_cap, &sband->ht_cap, sizeof(ht_cap));
+ /*
+ * This is for an association attempt, and stations must
+ * support at least the first 8 MCS rates. See section 20.1.1
+ * of the 802.11n spec for details.
+ */
+ ieee80211_apply_htcap_overrides(sdata, &ht_cap,
+ IEEE80211_HT_MCS_REQ_RATES_STA);
+
+ cap = ht_cap.cap;
+
+ if (!ht_cap.ht_supported)
+ return;
+
ht_info = (struct ieee80211_ht_info *)(ht_info_ie + 2);
/* determine capability flags */
@@ -166,13 +181,13 @@ static void ieee80211_add_ht_ie(struct sk_buff *skb, const u8 *ht_info_ie,
pos += sizeof(u16);
/* AMPDU parameters */
- *pos++ = sband->ht_cap.ampdu_factor |
- (sband->ht_cap.ampdu_density <<
- IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT);
+ *pos++ = ht_cap.ampdu_factor |
+ (ht_cap.ampdu_density <<
+ IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT);
/* MCS set */
- memcpy(pos, &sband->ht_cap.mcs, sizeof(sband->ht_cap.mcs));
- pos += sizeof(sband->ht_cap.mcs);
+ memcpy(pos, &ht_cap.mcs, sizeof(ht_cap.mcs));
+ pos += sizeof(ht_cap.mcs);
/* extended capabilities */
pos += sizeof(__le16);
@@ -356,7 +371,7 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata,
if (wk->assoc.use_11n && wk->assoc.wmm_used &&
local->hw.queues >= 4)
- ieee80211_add_ht_ie(skb, wk->assoc.ht_information_ie,
+ ieee80211_add_ht_ie(sdata, skb, wk->assoc.ht_information_ie,
sband, wk->chan, wk->assoc.smps);
/* if present, add any custom non-vendor IEs that go after HT */
diff --git a/net/wireless/core.h b/net/wireless/core.h
index 72e19e4..dd6feda 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -340,14 +340,16 @@ int __cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
const u8 *ssid, int ssid_len,
const u8 *ie, int ie_len, bool use_mfp,
struct cfg80211_crypto_settings *crypt,
- u32 assoc_flags);
+ u32 assoc_flags, struct ieee80211_ht_cap *ht_capa,
+ struct ieee80211_ht_cap *ht_capa_mask);
int cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
struct net_device *dev, struct ieee80211_channel *chan,
const u8 *bssid, const u8 *prev_bssid,
const u8 *ssid, int ssid_len,
const u8 *ie, int ie_len, bool use_mfp,
struct cfg80211_crypto_settings *crypt,
- u32 assoc_flags);
+ u32 assoc_flags, struct ieee80211_ht_cap *ht_capa,
+ struct ieee80211_ht_cap *ht_capa_mask);
int __cfg80211_mlme_deauth(struct cfg80211_registered_device *rdev,
struct net_device *dev, const u8 *bssid,
const u8 *ie, int ie_len, u16 reason,
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index 5c41411..a37e4bc 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -508,7 +508,8 @@ int __cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
const u8 *ssid, int ssid_len,
const u8 *ie, int ie_len, bool use_mfp,
struct cfg80211_crypto_settings *crypt,
- u32 assoc_flags)
+ u32 assoc_flags, struct ieee80211_ht_cap *ht_capa,
+ struct ieee80211_ht_cap *ht_capa_mask)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_assoc_request req;
@@ -539,6 +540,11 @@ int __cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
req.use_mfp = use_mfp;
req.prev_bssid = prev_bssid;
req.flags = assoc_flags;
+ if (ht_capa)
+ memcpy(&req.ht_capa, ht_capa, sizeof(req.ht_capa));
+ if (ht_capa_mask)
+ memcpy(&req.ht_capa_mask, ht_capa_mask,
+ sizeof(req.ht_capa_mask));
req.bss = cfg80211_get_bss(&rdev->wiphy, chan, bssid, ssid, ssid_len,
WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
if (!req.bss) {
@@ -577,7 +583,8 @@ int cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
const u8 *ssid, int ssid_len,
const u8 *ie, int ie_len, bool use_mfp,
struct cfg80211_crypto_settings *crypt,
- u32 assoc_flags)
+ u32 assoc_flags, struct ieee80211_ht_cap *ht_capa,
+ struct ieee80211_ht_cap *ht_capa_mask)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
int err;
@@ -585,7 +592,7 @@ int cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
wdev_lock(wdev);
err = __cfg80211_mlme_assoc(rdev, dev, chan, bssid, prev_bssid,
ssid, ssid_len, ie, ie_len, use_mfp, crypt,
- assoc_flags);
+ assoc_flags, ht_capa, ht_capa_mask);
wdev_unlock(wdev);
return err;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 7924e28..1c544db 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -199,6 +199,10 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
[NL80211_ATTR_TDLS_EXTERNAL_SETUP] = { .type = NLA_FLAG },
[NL80211_ATTR_DISABLE_HT] = { .type = NLA_FLAG },
[NL80211_ATTR_DISABLE_HT40] = { .type = NLA_FLAG },
+ [NL80211_ATTR_HT_CAPABILITY_MASK] = {
+ .type = NLA_BINARY,
+ .len = NL80211_HT_CAPABILITY_LEN
+ },
};
/* policy for the key attributes */
@@ -4357,6 +4361,8 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)
int err, ssid_len, ie_len = 0;
bool use_mfp = false;
u32 flags = 0;
+ struct ieee80211_ht_cap *ht_capa = NULL;
+ struct ieee80211_ht_cap *ht_capa_mask = NULL;
if (!is_valid_ie_attr(info->attrs[NL80211_ATTR_IE]))
return -EINVAL;
@@ -4406,11 +4412,22 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)
if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_HT40]))
flags |= ASSOC_REQ_DISABLE_HT40;
+ if (info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK])
+ ht_capa_mask =
+ nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]);
+
+ if (info->attrs[NL80211_ATTR_HT_CAPABILITY]) {
+ if (!ht_capa_mask)
+ return -EINVAL;
+ ht_capa = nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]);
+ }
+
err = nl80211_crypto_settings(rdev, info, &crypto, 1);
if (!err)
err = cfg80211_mlme_assoc(rdev, dev, chan, bssid, prev_bssid,
ssid, ssid_len, ie, ie_len, use_mfp,
- &crypto, flags);
+ &crypto, flags, ht_capa,
+ ht_capa_mask);
return err;
}
@@ -4906,6 +4923,19 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_HT40]))
connect.flags |= ASSOC_REQ_DISABLE_HT40;
+ if (info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK])
+ memcpy(&connect.ht_capa_mask,
+ nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]),
+ sizeof(connect.ht_capa_mask));
+
+ if (info->attrs[NL80211_ATTR_HT_CAPABILITY]) {
+ if (!info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK])
+ return -EINVAL;
+ memcpy(&connect.ht_capa,
+ nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]),
+ sizeof(connect.ht_capa));
+ }
+
err = cfg80211_connect(rdev, dev, &connect, connkeys);
if (err)
kfree(connkeys);
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 449a19f..d144e2d 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -190,7 +190,8 @@ static int cfg80211_conn_do_work(struct wireless_dev *wdev)
params->ssid, params->ssid_len,
params->ie, params->ie_len,
false, ¶ms->crypto,
- params->flags);
+ params->flags, ¶ms->ht_capa,
+ ¶ms->ht_capa_mask);
if (err)
__cfg80211_mlme_deauth(rdev, wdev->netdev, params->bssid,
NULL, 0,
--
1.7.3.4
^ permalink raw reply related
* [PATCH v3 2/3] mac80211: Support disabling ht40.
From: greearb @ 2011-11-03 5:55 UTC (permalink / raw)
To: linux-wireless; +Cc: Ben Greear
In-Reply-To: <1320299722-30113-1-git-send-email-greearb@candelatech.com>
From: Ben Greear <greearb@candelatech.com>
Allows users to forceably disable HT40 support in station
interfaces.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 499a5a4... 61b45aa... M include/linux/nl80211.h
:100644 100644 d2168c0... eeeef41... M include/net/cfg80211.h
:100644 100644 ea10a51... e4cfeda... M net/mac80211/ieee80211_i.h
:100644 100644 d4092e8... 149fb1d... M net/mac80211/mlme.c
:100644 100644 3c4dab1... 7924e28... M net/wireless/nl80211.c
include/linux/nl80211.h | 4 ++++
include/net/cfg80211.h | 1 +
net/mac80211/ieee80211_i.h | 1 +
net/mac80211/mlme.c | 5 +++++
net/wireless/nl80211.c | 7 +++++++
5 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 499a5a4..61b45aa 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -1111,6 +1111,8 @@ enum nl80211_commands {
*
* @NL80211_ATTR_DISABLE_HT: Force HT capable interfaces to disable
* this feature.
+ * @NL80211_ATTR_DISABLE_HT40: Disable HT-40 even if AP and hardware
+ * support it.
*
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -1341,6 +1343,8 @@ enum nl80211_attrs {
NL80211_ATTR_TDLS_EXTERNAL_SETUP,
NL80211_ATTR_DISABLE_HT,
+ NL80211_ATTR_DISABLE_HT40,
+
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index d2168c0..eeeef41 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1036,6 +1036,7 @@ struct cfg80211_auth_request {
};
#define ASSOC_REQ_DISABLE_HT (1<<0) /* Disable HT (802.11n) */
+#define ASSOC_REQ_DISABLE_HT40 (1<<1) /* Disable HT40 (802.11n) */
/**
* struct cfg80211_assoc_request - (Re)Association request data
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index ea10a51..e4cfeda 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -364,6 +364,7 @@ enum ieee80211_sta_flags {
IEEE80211_STA_UAPSD_ENABLED = BIT(7),
IEEE80211_STA_NULLFUNC_ACKED = BIT(8),
IEEE80211_STA_RESET_SIGNAL_AVE = BIT(9),
+ IEEE80211_STA_DISABLE_HT40 = BIT(10),
};
struct ieee80211_if_managed {
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index d4092e8..149fb1d 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -207,6 +207,7 @@ static u32 ieee80211_enable_ht(struct ieee80211_sub_if_data *sdata,
channel_type = NL80211_CHAN_HT20;
if (!(ap_ht_cap_flags & IEEE80211_HT_CAP_40MHZ_INTOLERANT) &&
+ !(sdata->u.mgd.flags & IEEE80211_STA_DISABLE_HT40) &&
(sband->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) &&
(hti->ht_param & IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)) {
switch(hti->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) {
@@ -2601,6 +2602,7 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
ifmgd->flags &= ~IEEE80211_STA_DISABLE_11N;
ifmgd->flags &= ~IEEE80211_STA_NULLFUNC_ACKED;
+ ifmgd->flags &= ~IEEE80211_STA_DISABLE_HT40;
ifmgd->beacon_crc_valid = false;
@@ -2614,6 +2616,9 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
if (req->flags & ASSOC_REQ_DISABLE_HT)
ifmgd->flags |= IEEE80211_STA_DISABLE_11N;
+ if (req->flags & ASSOC_REQ_DISABLE_HT40)
+ ifmgd->flags |= IEEE80211_STA_DISABLE_HT40;
+
if (req->ie && req->ie_len) {
memcpy(wk->ie, req->ie, req->ie_len);
wk->ie_len = req->ie_len;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 3c4dab1..7924e28 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -198,6 +198,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
[NL80211_ATTR_TDLS_SUPPORT] = { .type = NLA_FLAG },
[NL80211_ATTR_TDLS_EXTERNAL_SETUP] = { .type = NLA_FLAG },
[NL80211_ATTR_DISABLE_HT] = { .type = NLA_FLAG },
+ [NL80211_ATTR_DISABLE_HT40] = { .type = NLA_FLAG },
};
/* policy for the key attributes */
@@ -4402,6 +4403,9 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)
if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_HT]))
flags |= ASSOC_REQ_DISABLE_HT;
+ if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_HT40]))
+ flags |= ASSOC_REQ_DISABLE_HT40;
+
err = nl80211_crypto_settings(rdev, info, &crypto, 1);
if (!err)
err = cfg80211_mlme_assoc(rdev, dev, chan, bssid, prev_bssid,
@@ -4899,6 +4903,9 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_HT]))
connect.flags |= ASSOC_REQ_DISABLE_HT;
+ if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_HT40]))
+ connect.flags |= ASSOC_REQ_DISABLE_HT40;
+
err = cfg80211_connect(rdev, dev, &connect, connkeys);
if (err)
kfree(connkeys);
--
1.7.3.4
^ permalink raw reply related
* [PATCH v3 1/3] mac80211: Support forcing station to disable HT (802.11n).
From: greearb @ 2011-11-03 5:55 UTC (permalink / raw)
To: linux-wireless; +Cc: Ben Greear
From: Ben Greear <greearb@candelatech.com>
This allows a user to configure a wifi station interface
to disable the HT features, even if the AP and NIC supports it.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 8049bf7... 499a5a4... M include/linux/nl80211.h
:100644 100644 92cf1c2... d2168c0... M include/net/cfg80211.h
:100644 100644 57fb58f... d4092e8... M net/mac80211/mlme.c
:100644 100644 b9ec306... 72e19e4... M net/wireless/core.h
:100644 100644 21fc970... 5c41411... M net/wireless/mlme.c
:100644 100644 48260c2... 3c4dab1... M net/wireless/nl80211.c
:100644 100644 6e86d5a... 449a19f... M net/wireless/sme.c
include/linux/nl80211.h | 4 ++++
include/net/cfg80211.h | 6 ++++++
net/mac80211/mlme.c | 3 +++
net/wireless/core.h | 6 ++++--
net/wireless/mlme.c | 10 +++++++---
net/wireless/nl80211.c | 10 +++++++++-
net/wireless/sme.c | 3 ++-
7 files changed, 35 insertions(+), 7 deletions(-)
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 8049bf7..499a5a4 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -1109,6 +1109,9 @@ enum nl80211_commands {
* %NL80211_CMD_TDLS_MGMT. Otherwise %NL80211_CMD_TDLS_OPER should be
* used for asking the driver to perform a TDLS operation.
*
+ * @NL80211_ATTR_DISABLE_HT: Force HT capable interfaces to disable
+ * this feature.
+ *
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
*/
@@ -1337,6 +1340,7 @@ enum nl80211_attrs {
NL80211_ATTR_TDLS_SUPPORT,
NL80211_ATTR_TDLS_EXTERNAL_SETUP,
+ NL80211_ATTR_DISABLE_HT,
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 92cf1c2..d2168c0 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1035,6 +1035,8 @@ struct cfg80211_auth_request {
bool local_state_change;
};
+#define ASSOC_REQ_DISABLE_HT (1<<0) /* Disable HT (802.11n) */
+
/**
* struct cfg80211_assoc_request - (Re)Association request data
*
@@ -1046,6 +1048,7 @@ struct cfg80211_auth_request {
* @use_mfp: Use management frame protection (IEEE 802.11w) in this association
* @crypto: crypto settings
* @prev_bssid: previous BSSID, if not %NULL use reassociate frame
+ * @flags: See ASSOC_REQ_* flags above.
*/
struct cfg80211_assoc_request {
struct cfg80211_bss *bss;
@@ -1053,6 +1056,7 @@ struct cfg80211_assoc_request {
size_t ie_len;
struct cfg80211_crypto_settings crypto;
bool use_mfp;
+ u32 flags;
};
/**
@@ -1147,6 +1151,7 @@ struct cfg80211_ibss_params {
* @ie: IEs for association request
* @ie_len: Length of assoc_ie in octets
* @privacy: indicates whether privacy-enabled APs should be used
+ * @flags: See ASSOC_REQ_* #defines above.
* @crypto: crypto settings
* @key_len: length of WEP key for shared key authentication
* @key_idx: index of WEP key for shared key authentication
@@ -1164,6 +1169,7 @@ struct cfg80211_connect_params {
struct cfg80211_crypto_settings crypto;
const u8 *key;
u8 key_len, key_idx;
+ u32 flags;
};
/**
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 57fb58f..d4092e8 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2611,6 +2611,9 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
ifmgd->flags |= IEEE80211_STA_DISABLE_11N;
+ if (req->flags & ASSOC_REQ_DISABLE_HT)
+ ifmgd->flags |= IEEE80211_STA_DISABLE_11N;
+
if (req->ie && req->ie_len) {
memcpy(wk->ie, req->ie, req->ie_len);
wk->ie_len = req->ie_len;
diff --git a/net/wireless/core.h b/net/wireless/core.h
index b9ec306..72e19e4 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -339,13 +339,15 @@ int __cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
const u8 *bssid, const u8 *prev_bssid,
const u8 *ssid, int ssid_len,
const u8 *ie, int ie_len, bool use_mfp,
- struct cfg80211_crypto_settings *crypt);
+ struct cfg80211_crypto_settings *crypt,
+ u32 assoc_flags);
int cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
struct net_device *dev, struct ieee80211_channel *chan,
const u8 *bssid, const u8 *prev_bssid,
const u8 *ssid, int ssid_len,
const u8 *ie, int ie_len, bool use_mfp,
- struct cfg80211_crypto_settings *crypt);
+ struct cfg80211_crypto_settings *crypt,
+ u32 assoc_flags);
int __cfg80211_mlme_deauth(struct cfg80211_registered_device *rdev,
struct net_device *dev, const u8 *bssid,
const u8 *ie, int ie_len, u16 reason,
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index 21fc970..5c41411 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -507,7 +507,8 @@ int __cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
const u8 *bssid, const u8 *prev_bssid,
const u8 *ssid, int ssid_len,
const u8 *ie, int ie_len, bool use_mfp,
- struct cfg80211_crypto_settings *crypt)
+ struct cfg80211_crypto_settings *crypt,
+ u32 assoc_flags)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_assoc_request req;
@@ -537,6 +538,7 @@ int __cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
memcpy(&req.crypto, crypt, sizeof(req.crypto));
req.use_mfp = use_mfp;
req.prev_bssid = prev_bssid;
+ req.flags = assoc_flags;
req.bss = cfg80211_get_bss(&rdev->wiphy, chan, bssid, ssid, ssid_len,
WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
if (!req.bss) {
@@ -574,14 +576,16 @@ int cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
const u8 *bssid, const u8 *prev_bssid,
const u8 *ssid, int ssid_len,
const u8 *ie, int ie_len, bool use_mfp,
- struct cfg80211_crypto_settings *crypt)
+ struct cfg80211_crypto_settings *crypt,
+ u32 assoc_flags)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
int err;
wdev_lock(wdev);
err = __cfg80211_mlme_assoc(rdev, dev, chan, bssid, prev_bssid,
- ssid, ssid_len, ie, ie_len, use_mfp, crypt);
+ ssid, ssid_len, ie, ie_len, use_mfp, crypt,
+ assoc_flags);
wdev_unlock(wdev);
return err;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 48260c2..3c4dab1 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -197,6 +197,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
[NL80211_ATTR_TDLS_OPERATION] = { .type = NLA_U8 },
[NL80211_ATTR_TDLS_SUPPORT] = { .type = NLA_FLAG },
[NL80211_ATTR_TDLS_EXTERNAL_SETUP] = { .type = NLA_FLAG },
+ [NL80211_ATTR_DISABLE_HT] = { .type = NLA_FLAG },
};
/* policy for the key attributes */
@@ -4354,6 +4355,7 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)
const u8 *bssid, *ssid, *ie = NULL, *prev_bssid = NULL;
int err, ssid_len, ie_len = 0;
bool use_mfp = false;
+ u32 flags = 0;
if (!is_valid_ie_attr(info->attrs[NL80211_ATTR_IE]))
return -EINVAL;
@@ -4397,11 +4399,14 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)
if (info->attrs[NL80211_ATTR_PREV_BSSID])
prev_bssid = nla_data(info->attrs[NL80211_ATTR_PREV_BSSID]);
+ if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_HT]))
+ flags |= ASSOC_REQ_DISABLE_HT;
+
err = nl80211_crypto_settings(rdev, info, &crypto, 1);
if (!err)
err = cfg80211_mlme_assoc(rdev, dev, chan, bssid, prev_bssid,
ssid, ssid_len, ie, ie_len, use_mfp,
- &crypto);
+ &crypto, flags);
return err;
}
@@ -4891,6 +4896,9 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
return PTR_ERR(connkeys);
}
+ if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_HT]))
+ connect.flags |= ASSOC_REQ_DISABLE_HT;
+
err = cfg80211_connect(rdev, dev, &connect, connkeys);
if (err)
kfree(connkeys);
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 6e86d5a..449a19f 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -189,7 +189,8 @@ static int cfg80211_conn_do_work(struct wireless_dev *wdev)
prev_bssid,
params->ssid, params->ssid_len,
params->ie, params->ie_len,
- false, ¶ms->crypto);
+ false, ¶ms->crypto,
+ params->flags);
if (err)
__cfg80211_mlme_deauth(rdev, wdev->netdev, params->bssid,
NULL, 0,
--
1.7.3.4
^ permalink raw reply related
* Re: [PATCH] ieee80211: Define cipher suite selector for WPI-SMS4
From: Dan Williams @ 2011-11-03 1:15 UTC (permalink / raw)
To: Jouni Malinen; +Cc: John W. Linville, Johannes Berg, linux-wireless
In-Reply-To: <20111102213456.GA21460@jouni.qca.qualcomm.com>
On Wed, 2011-11-02 at 23:34 +0200, Jouni Malinen wrote:
> This value is used for WPI-SMS4 in ISO/IEC JTC 1 N 9880.
Does that mean WAPI at some point? :)
> Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
> ---
> include/linux/ieee80211.h | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
> index 48363c3..80cba03 100644
> --- a/include/linux/ieee80211.h
> +++ b/include/linux/ieee80211.h
> @@ -1552,6 +1552,8 @@ enum ieee80211_sa_query_action {
> #define WLAN_CIPHER_SUITE_WEP104 0x000FAC05
> #define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06
>
> +#define WLAN_CIPHER_SUITE_SMS4 0x00147201
> +
> /* AKM suite selectors */
> #define WLAN_AKM_SUITE_8021X 0x000FAC01
> #define WLAN_AKM_SUITE_PSK 0x000FAC02
> --
> 1.7.4.1
>
>
^ permalink raw reply
* Re: wireless git trees returning to kernel.org
From: Stephen Rothwell @ 2011-11-03 1:15 UTC (permalink / raw)
To: John W. Linville
Cc: linux-wireless, David Woodhouse, David S. Miller, netdev,
linux-kernel
In-Reply-To: <20111102180946.GC12168@tuxdriver.com>
[-- Attachment #1: Type: text/plain, Size: 882 bytes --]
Hi John,
On Wed, 2 Nov 2011 14:09:46 -0400 "John W. Linville" <linville@tuxdriver.com> wrote:
>
> I have migrated the wireless git trees back to the kernel.org
> infrastructure. As of right now, the trees are identical between
> kernel.org and infradead.org. Further updates likely will only go
> to kernel.org, so plan accordingly.
>
> The "current" wireless tree is here:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless.git
>
> The "next" wireless tree is here:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git\\
I have switched to using these. I also renamed the tres in linux-next to
match your names (so "wireless-current" has become "wireless" and
"wireless" has become "wireless-next").
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* [PATCH] ath6kl: Do not hide ath6kl_wmi_addkey_cmd() error values
From: Jouni Malinen @ 2011-11-02 21:46 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless
Instead of converting any error to EIO, just return the real error
value to upper layers.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 37 ++++++++++------------------
1 files changed, 13 insertions(+), 24 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 3b9511a..04d24d4 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -908,7 +908,6 @@ static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
struct ath6kl_key *key = NULL;
u8 key_usage;
u8 key_type;
- int status = 0;
if (!ath6kl_cfg80211_ready(vif))
return -EIO;
@@ -1011,17 +1010,12 @@ static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
return 0;
}
- status = ath6kl_wmi_addkey_cmd(ar->wmi, vif->fw_vif_idx,
- vif->def_txkey_index,
- key_type, key_usage, key->key_len,
- key->seq, key->seq_len, key->key,
- KEY_OP_INIT_VAL,
- (u8 *) mac_addr, SYNC_BOTH_WMIFLAG);
-
- if (status)
- return -EIO;
-
- return 0;
+ return ath6kl_wmi_addkey_cmd(ar->wmi, vif->fw_vif_idx,
+ vif->def_txkey_index,
+ key_type, key_usage, key->key_len,
+ key->seq, key->seq_len, key->key,
+ KEY_OP_INIT_VAL,
+ (u8 *) mac_addr, SYNC_BOTH_WMIFLAG);
}
static int ath6kl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev,
@@ -1097,7 +1091,6 @@ static int ath6kl_cfg80211_set_default_key(struct wiphy *wiphy,
struct ath6kl *ar = (struct ath6kl *)ath6kl_priv(ndev);
struct ath6kl_vif *vif = netdev_priv(ndev);
struct ath6kl_key *key = NULL;
- int status = 0;
u8 key_usage;
enum crypto_type key_type = NONE_CRYPT;
@@ -1132,17 +1125,13 @@ static int ath6kl_cfg80211_set_default_key(struct wiphy *wiphy,
if (vif->next_mode == AP_NETWORK && !test_bit(CONNECTED, &vif->flags))
return 0; /* Delay until AP mode has been started */
- status = ath6kl_wmi_addkey_cmd(ar->wmi, vif->fw_vif_idx,
- vif->def_txkey_index,
- key_type, key_usage,
- key->key_len, key->seq, key->seq_len,
- key->key,
- KEY_OP_INIT_VAL, NULL,
- SYNC_BOTH_WMIFLAG);
- if (status)
- return -EIO;
-
- return 0;
+ return ath6kl_wmi_addkey_cmd(ar->wmi, vif->fw_vif_idx,
+ vif->def_txkey_index,
+ key_type, key_usage,
+ key->key_len, key->seq, key->seq_len,
+ key->key,
+ KEY_OP_INIT_VAL, NULL,
+ SYNC_BOTH_WMIFLAG);
}
void ath6kl_cfg80211_tkip_micerr_event(struct ath6kl_vif *vif, u8 keyid,
--
1.7.4.1
--
Jouni Malinen PGP id EFC895FA
^ permalink raw reply related
* [PATCH] ath6kl: Remove unused WMI crypto defines
From: Jouni Malinen @ 2011-11-02 21:44 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/wmi.h | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.h b/drivers/net/wireless/ath/ath6kl/wmi.h
index cf0462a..c626c1e 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.h
+++ b/drivers/net/wireless/ath/ath6kl/wmi.h
@@ -585,9 +585,6 @@ enum auth_mode {
WPA2_AUTH_CCKM = 0x40,
};
-#define WMI_MIN_CRYPTO_TYPE NONE_CRYPT
-#define WMI_MAX_CRYPTO_TYPE (AES_CRYPT + 1)
-
#define WMI_MIN_KEY_INDEX 0
#define WMI_MAX_KEY_INDEX 3
--
1.7.4.1
--
Jouni Malinen PGP id EFC895FA
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox