* Re: [PATCH] orinoco: release BSS structures returned by cfg80211_inform_bss()
From: Johannes Berg @ 2011-10-28 10:09 UTC (permalink / raw)
To: David Kilroy; +Cc: linux-wireless, linville
In-Reply-To: <1319796003-404-1-git-send-email-kilroyd@googlemail.com>
On Fri, 2011-10-28 at 11:00 +0100, David Kilroy wrote:
> The pointer returned by cfg80211_inform_bss is a referenced
> struct. The orinoco driver does not need to keep the struct, so
> we just release it.
Thanks!
> + cbss = cfg80211_inform_bss(wiphy, channel, bss->a.bssid, timestamp,
> + capability, beacon_interval, ie_buf, ie_len,
> + signal, GFP_KERNEL);
> + if (cbss)
> + cfg80211_put_bss(cbss);
Obviously doesn't hurt, but cfg80211_put_bss(NULL) is acceptable, if
you'd prefer the code that way.
johannes
^ permalink raw reply
* [PATCH] orinoco: release BSS structures returned by cfg80211_inform_bss()
From: David Kilroy @ 2011-10-28 10:00 UTC (permalink / raw)
To: linux-wireless, linville, johannes; +Cc: David Kilroy
In-Reply-To: <1319719502.3944.5.camel@jlt3.sipsolutions.net>
The pointer returned by cfg80211_inform_bss is a referenced
struct. The orinoco driver does not need to keep the struct, so
we just release it.
Signed-off-by: David Kilroy <kilroyd@googlemail.com>
---
drivers/net/wireless/orinoco/scan.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/orinoco/scan.c b/drivers/net/wireless/orinoco/scan.c
index e99ca1c..93674d9 100644
--- a/drivers/net/wireless/orinoco/scan.c
+++ b/drivers/net/wireless/orinoco/scan.c
@@ -76,6 +76,7 @@ static void orinoco_add_hostscan_result(struct orinoco_private *priv,
{
struct wiphy *wiphy = priv_to_wiphy(priv);
struct ieee80211_channel *channel;
+ struct cfg80211_bss *cbss;
u8 *ie;
u8 ie_buf[46];
u64 timestamp;
@@ -121,9 +122,11 @@ static void orinoco_add_hostscan_result(struct orinoco_private *priv,
beacon_interval = le16_to_cpu(bss->a.beacon_interv);
signal = SIGNAL_TO_MBM(le16_to_cpu(bss->a.level));
- cfg80211_inform_bss(wiphy, channel, bss->a.bssid, timestamp,
- capability, beacon_interval, ie_buf, ie_len,
- signal, GFP_KERNEL);
+ cbss = cfg80211_inform_bss(wiphy, channel, bss->a.bssid, timestamp,
+ capability, beacon_interval, ie_buf, ie_len,
+ signal, GFP_KERNEL);
+ if (cbss)
+ cfg80211_put_bss(cbss);
}
void orinoco_add_extscan_result(struct orinoco_private *priv,
@@ -132,6 +135,7 @@ void orinoco_add_extscan_result(struct orinoco_private *priv,
{
struct wiphy *wiphy = priv_to_wiphy(priv);
struct ieee80211_channel *channel;
+ struct cfg80211_bss *cbss;
const u8 *ie;
u64 timestamp;
s32 signal;
@@ -152,9 +156,11 @@ void orinoco_add_extscan_result(struct orinoco_private *priv,
ie = bss->data;
signal = SIGNAL_TO_MBM(bss->level);
- cfg80211_inform_bss(wiphy, channel, bss->bssid, timestamp,
- capability, beacon_interval, ie, ie_len,
- signal, GFP_KERNEL);
+ cbss = cfg80211_inform_bss(wiphy, channel, bss->bssid, timestamp,
+ capability, beacon_interval, ie, ie_len,
+ signal, GFP_KERNEL);
+ if (cbss)
+ cfg80211_put_bss(cbss);
}
void orinoco_add_hostscan_results(struct orinoco_private *priv,
--
1.7.4.1
^ permalink raw reply related
* Re: [PATCH] mac80211: disable powersave for broken APs
From: Johannes Berg @ 2011-10-28 10:01 UTC (permalink / raw)
To: John Linville; +Cc: Bill C Riemers, linux-wireless
In-Reply-To: <1319795987.8931.7.camel@jlt3.sipsolutions.net>
On Fri, 2011-10-28 at 11:59 +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> Only AID values 1-2007 are valid, but some APs have been
> found to send random bogus values, in the reported case an
> AP that was sending the AID field value 0xffff, an AID of
> 0x3fff (16383).
>
> There isn't much we can do but disable powersave since
> there's no way it can work properly in this case.
>
> Cc: stable@vger.kernel.org
> Reported-by: Bill C Riemers <briemers@redhat.com>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
> Bill, please test this patch and see if you still see the
> warnings, or you can revert your iwlwifi changes and test
> then, it should work.
>
> John, please wait for Bill to test before you apply, just
> to confirm it fixes the issue.
I should also point out that this is intended to fix
https://bugzilla.redhat.com/show_bug.cgi?id=748548
johannes
^ permalink raw reply
* [PATCH] mac80211: disable powersave for broken APs
From: Johannes Berg @ 2011-10-28 9:59 UTC (permalink / raw)
To: John Linville; +Cc: Bill C Riemers, linux-wireless
From: Johannes Berg <johannes.berg@intel.com>
Only AID values 1-2007 are valid, but some APs have been
found to send random bogus values, in the reported case an
AP that was sending the AID field value 0xffff, an AID of
0x3fff (16383).
There isn't much we can do but disable powersave since
there's no way it can work properly in this case.
Cc: stable@vger.kernel.org
Reported-by: Bill C Riemers <briemers@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
Bill, please test this patch and see if you still see the
warnings, or you can revert your iwlwifi changes and test
then, it should work.
John, please wait for Bill to test before you apply, just
to confirm it fixes the issue.
net/mac80211/ieee80211_i.h | 1 +
net/mac80211/mlme.c | 18 ++++++++++++++++--
2 files changed, 17 insertions(+), 2 deletions(-)
--- a/net/mac80211/ieee80211_i.h 2011-10-28 11:03:50.000000000 +0200
+++ b/net/mac80211/ieee80211_i.h 2011-10-28 11:51:48.000000000 +0200
@@ -393,6 +393,7 @@ struct ieee80211_if_managed {
unsigned long timers_running; /* used for quiesce/restart */
bool powersave; /* powersave requested for this iface */
+ bool broken_ap; /* AP is broken -- turn off powersave */
enum ieee80211_smps_mode req_smps, /* requested smps mode */
ap_smps, /* smps mode AP thinks we're in */
driver_smps_mode; /* smps mode request */
--- a/net/mac80211/mlme.c 2011-10-12 17:11:31.000000000 +0200
+++ b/net/mac80211/mlme.c 2011-10-28 11:57:50.000000000 +0200
@@ -637,6 +637,9 @@ static bool ieee80211_powersave_allowed(
if (!mgd->powersave)
return false;
+ if (mgd->broken_ap)
+ return false;
+
if (!mgd->associated)
return false;
@@ -1489,10 +1492,21 @@ static bool ieee80211_assoc_success(stru
capab_info = le16_to_cpu(mgmt->u.assoc_resp.capab_info);
if ((aid & (BIT(15) | BIT(14))) != (BIT(15) | BIT(14)))
- printk(KERN_DEBUG "%s: invalid aid value %d; bits 15:14 not "
- "set\n", sdata->name, aid);
+ printk(KERN_DEBUG
+ "%s: invalid AID value 0x%x; bits 15:14 not set\n",
+ sdata->name, aid);
aid &= ~(BIT(15) | BIT(14));
+ ifmgd->broken_ap = false;
+
+ if (aid == 0 || aid > IEEE80211_MAX_AID) {
+ printk(KERN_DEBUG
+ "%s: invalid AID value %d (out of range), turn off PS\n",
+ sdata->name, aid);
+ aid = 0;
+ ifmgd->broken_ap = true;
+ }
+
pos = mgmt->u.assoc_resp.variable;
ieee802_11_parse_elems(pos, len - (pos - (u8 *) mgmt), &elems);
^ permalink raw reply
* Re: [RFC v2 13/12] cfg80211/mac80211: allow management TX to not wait for ACK
From: Helmut Schaa @ 2011-10-28 9:28 UTC (permalink / raw)
To: Arend Van Spriel; +Cc: Johannes Berg, linux-wireless@vger.kernel.org
In-Reply-To: <400C43189542CE41BC0A5B252FC90136BC0E37541B@SJEXCHCCR02.corp.ad.broadcom.com>
On Fri, Oct 28, 2011 at 11:10 AM, Arend Van Spriel <arend@broadcom.com> wrote:
>> > I would expect this to affect the duration field in the
>> > 802.11 header to indicate the shorter use of the medium.
>> > Going through your patch I am not sure this is done.
>>
>> Hmmm. You're right, but that's something we already need to fix in many
>> cases -- as the duration field is overwritten by most hardware these
>> days, we haven't always maintained it very well.
>
> If the station still does the ACK we should not touch the duration field
> in this case (see my reply to Helmut).
The reason is the following: if you're running a mac80211 AP with multiple
bssids, hostapd will answer to broadcast probe requests sent by STAs with
one probe response per bssid (unicast of course). And since some clients
stay only for a short amount of time on the scan-channel (a few ms) under
some circumstances the probe responses aren't sent out yet before the
scanning STA leaves the channel and thus retried till the maximum retry
limit is reached. And these retries consume quite a lot of airtime. And to
avoid this we just don't want to retry the probe responses in that case.
Helmut
^ permalink raw reply
* [RFC v3 13/12] cfg80211/mac80211: allow management TX to not wait for ACK
From: Johannes Berg @ 2011-10-28 9:18 UTC (permalink / raw)
To: linux-wireless
In-Reply-To: <1319743973.32221.4.camel@jlt3.sipsolutions.net>
From: Johannes Berg <johannes.berg@intel.com>
For probe responses it can be useful to not wait for ACK to
avoid retransmissions if the station that sent the probe is
already on the next channel, so allow userspace to request
not caring about the ACK with a new nl80211 flag.
Since mac80211 needs to be updated for the new function
prototype anyway implement it right away -- it's just a
few lines of code.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
v2: accidentally sent as v2 instead of v1
v3: update commit log (Arend) and fix bug (Eliad)
drivers/net/wireless/ath/ath6kl/cfg80211.c | 3 +-
include/linux/nl80211.h | 7 ++++
include/net/cfg80211.h | 2 -
net/mac80211/cfg.c | 11 +++++--
net/wireless/core.h | 2 -
net/wireless/mlme.c | 5 ++-
net/wireless/nl80211.c | 43 +++++++++++++++++------------
7 files changed, 48 insertions(+), 25 deletions(-)
--- a/include/linux/nl80211.h 2011-10-28 11:03:50.000000000 +0200
+++ b/include/linux/nl80211.h 2011-10-28 11:08:02.000000000 +0200
@@ -1147,6 +1147,11 @@ enum nl80211_commands {
* @NL80211_ATTR_FEATURE_FLAGS: This u32 attribute contains flags from
* &enum nl80211_feature_flags and is advertised in wiphy information.
*
+ * @NL80211_ATTR_DONT_WAIT_FOR_ACK: Used with %NL80211_CMD_FRAME, this tells
+ * the driver to not wait for an acknowledgement. Note that due to this,
+ * it will also not give a status callback nor return a cookie. This is
+ * mostly useful for probe responses to save airtime.
+ *
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
*/
@@ -1379,6 +1384,8 @@ enum nl80211_attrs {
NL80211_ATTR_FEATURE_FLAGS,
+ NL80211_ATTR_DONT_WAIT_FOR_ACK,
+
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
--- a/net/wireless/core.h 2011-10-28 11:03:50.000000000 +0200
+++ b/net/wireless/core.h 2011-10-28 11:03:51.000000000 +0200
@@ -378,7 +378,7 @@ int cfg80211_mlme_mgmt_tx(struct cfg8021
enum nl80211_channel_type channel_type,
bool channel_type_valid, unsigned int wait,
const u8 *buf, size_t len, bool no_cck,
- u64 *cookie);
+ bool dont_wait_for_ack, u64 *cookie);
/* SME */
int __cfg80211_connect(struct cfg80211_registered_device *rdev,
--- a/net/wireless/mlme.c 2011-10-28 11:03:42.000000000 +0200
+++ b/net/wireless/mlme.c 2011-10-28 11:03:51.000000000 +0200
@@ -904,7 +904,7 @@ int cfg80211_mlme_mgmt_tx(struct cfg8021
enum nl80211_channel_type channel_type,
bool channel_type_valid, unsigned int wait,
const u8 *buf, size_t len, bool no_cck,
- u64 *cookie)
+ bool dont_wait_for_ack, u64 *cookie)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
const struct ieee80211_mgmt *mgmt;
@@ -995,7 +995,8 @@ int cfg80211_mlme_mgmt_tx(struct cfg8021
/* Transmit the Action frame as requested by user space */
return rdev->ops->mgmt_tx(&rdev->wiphy, dev, chan, offchan,
channel_type, channel_type_valid,
- wait, buf, len, no_cck, cookie);
+ wait, buf, len, no_cck, dont_wait_for_ack,
+ cookie);
}
bool cfg80211_rx_mgmt(struct net_device *dev, int freq, const u8 *buf,
--- a/net/wireless/nl80211.c 2011-10-28 11:03:50.000000000 +0200
+++ b/net/wireless/nl80211.c 2011-10-28 11:03:51.000000000 +0200
@@ -197,6 +197,7 @@ static const struct nla_policy nl80211_p
[NL80211_ATTR_TDLS_OPERATION] = { .type = NLA_U8 },
[NL80211_ATTR_TDLS_SUPPORT] = { .type = NLA_FLAG },
[NL80211_ATTR_TDLS_EXTERNAL_SETUP] = { .type = NLA_FLAG },
+ [NL80211_ATTR_DONT_WAIT_FOR_ACK] = { .type = NLA_FLAG },
};
/* policy for the key attributes */
@@ -5279,10 +5280,11 @@ static int nl80211_tx_mgmt(struct sk_buf
int err;
void *hdr;
u64 cookie;
- struct sk_buff *msg;
+ struct sk_buff *msg = NULL;
unsigned int wait = 0;
- bool offchan;
- bool no_cck;
+ bool offchan, no_cck, dont_wait_for_ack;
+
+ dont_wait_for_ack = info->attrs[NL80211_ATTR_DONT_WAIT_FOR_ACK];
if (!info->attrs[NL80211_ATTR_FRAME] ||
!info->attrs[NL80211_ATTR_WIPHY_FREQ])
@@ -5326,29 +5328,36 @@ static int nl80211_tx_mgmt(struct sk_buf
if (chan == NULL)
return -EINVAL;
- msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
- if (!msg)
- return -ENOMEM;
-
- hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0,
- NL80211_CMD_FRAME);
-
- if (IS_ERR(hdr)) {
- err = PTR_ERR(hdr);
- goto free_msg;
+ if (!dont_wait_for_ack) {
+ msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
+ if (!msg)
+ return -ENOMEM;
+
+ hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0,
+ NL80211_CMD_FRAME);
+
+ if (IS_ERR(hdr)) {
+ err = PTR_ERR(hdr);
+ goto free_msg;
+ }
}
+
err = cfg80211_mlme_mgmt_tx(rdev, dev, chan, offchan, channel_type,
channel_type_valid, wait,
nla_data(info->attrs[NL80211_ATTR_FRAME]),
nla_len(info->attrs[NL80211_ATTR_FRAME]),
- no_cck, &cookie);
+ no_cck, dont_wait_for_ack, &cookie);
if (err)
goto free_msg;
- NLA_PUT_U64(msg, NL80211_ATTR_COOKIE, cookie);
+ if (msg) {
+ NLA_PUT_U64(msg, NL80211_ATTR_COOKIE, cookie);
- genlmsg_end(msg, hdr);
- return genlmsg_reply(msg, info);
+ genlmsg_end(msg, hdr);
+ return genlmsg_reply(msg, info);
+ }
+
+ return 0;
nla_put_failure:
err = -ENOBUFS;
--- a/include/net/cfg80211.h 2011-10-28 11:03:50.000000000 +0200
+++ b/include/net/cfg80211.h 2011-10-28 11:03:51.000000000 +0200
@@ -1584,7 +1584,7 @@ struct cfg80211_ops {
enum nl80211_channel_type channel_type,
bool channel_type_valid, unsigned int wait,
const u8 *buf, size_t len, bool no_cck,
- u64 *cookie);
+ bool dont_wait_for_ack, u64 *cookie);
int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy,
struct net_device *dev,
u64 cookie);
--- a/net/mac80211/cfg.c 2011-10-28 11:03:45.000000000 +0200
+++ b/net/mac80211/cfg.c 2011-10-28 11:03:51.000000000 +0200
@@ -1936,7 +1936,7 @@ static int ieee80211_mgmt_tx(struct wiph
enum nl80211_channel_type channel_type,
bool channel_type_valid, unsigned int wait,
const u8 *buf, size_t len, bool no_cck,
- u64 *cookie)
+ bool dont_wait_for_ack, u64 *cookie)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = sdata->local;
@@ -1944,10 +1944,15 @@ static int ieee80211_mgmt_tx(struct wiph
struct sta_info *sta;
struct ieee80211_work *wk;
const struct ieee80211_mgmt *mgmt = (void *)buf;
- u32 flags = IEEE80211_TX_INTFL_NL80211_FRAME_TX |
- IEEE80211_TX_CTL_REQ_TX_STATUS;
+ u32 flags;
bool is_offchan = false;
+ if (dont_wait_for_ack)
+ flags = IEEE80211_TX_CTL_NO_ACK;
+ else
+ flags = IEEE80211_TX_INTFL_NL80211_FRAME_TX |
+ IEEE80211_TX_CTL_REQ_TX_STATUS;
+
/* Check that we are on the requested channel for transmission */
if (chan != local->tmp_channel &&
chan != local->oper_channel)
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c 2011-10-28 11:02:13.000000000 +0200
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c 2011-10-28 11:03:51.000000000 +0200
@@ -1732,7 +1732,8 @@ static int ath6kl_mgmt_tx(struct wiphy *
struct ieee80211_channel *chan, bool offchan,
enum nl80211_channel_type channel_type,
bool channel_type_valid, unsigned int wait,
- const u8 *buf, size_t len, bool no_cck, u64 *cookie)
+ const u8 *buf, size_t len, bool no_cck,
+ bool dont_wait_for_ack, u64 *cookie)
{
struct ath6kl *ar = ath6kl_priv(dev);
u32 id;
^ permalink raw reply
* RE: [RFC v2 13/12] cfg80211/mac80211: allow management TX to not wait for ACK
From: Johannes Berg @ 2011-10-28 9:15 UTC (permalink / raw)
To: Arend Van Spriel; +Cc: Helmut Schaa, linux-wireless@vger.kernel.org
In-Reply-To: <400C43189542CE41BC0A5B252FC90136BC0E375417@SJEXCHCCR02.corp.ad.broadcom.com>
On Fri, 2011-10-28 at 02:07 -0700, Arend Van Spriel wrote:
> > From: Helmut Schaa [mailto:helmut.schaa@googlemail.com]
> > Sent: vrijdag 28 oktober 2011 9:52
> >
> > On Fri, Oct 28, 2011 at 9:48 AM, Arend Van Spriel <arend@broadcom.com>
> > wrote:
> > > I would expect this to affect the duration field in the
> > > 802.11 header to indicate the shorter use of the medium.
> > > Going through your patch I am not sure this is done.
> >
> > I don't think so since the frame will still be acked by the peer as it
> > is
> > a unicast management frame. But this will advise the hardware that it
> > does not need to wait for the ack to happen since we're not interested
> > in retrying it.
> I understand. However, the commit message of this patch suggests we are
> saving airtime, which does not seem the case if the duration field is
> not taken into account. If the ACK is still transmitted we should not
> touch the duration field so I guess my comment is only on the commit
> message itself.
Oh good points ...
The reason we save airtime is that often the frame will be retransmitted
a lot if the station is no longer paying attention.
johannes
^ permalink raw reply
* RE: [RFC v2 13/12] cfg80211/mac80211: allow management TX to not wait for ACK
From: Arend Van Spriel @ 2011-10-28 9:10 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <1319788880.3914.4.camel@jlt3.sipsolutions.net>
PiBGcm9tOiBKb2hhbm5lcyBCZXJnIFttYWlsdG86am9oYW5uZXNAc2lwc29sdXRpb25zLm5ldF0N
Cj4gU2VudDogdnJpamRhZyAyOCBva3RvYmVyIDIwMTEgMTA6MDENCj4gDQo+IE9uIEZyaSwgMjAx
MS0xMC0yOCBhdCAwMDo0OCAtMDcwMCwgQXJlbmQgVmFuIFNwcmllbCB3cm90ZToNCj4gPiA+IFNl
bnQ6IGRvbmRlcmRhZyAyNyBva3RvYmVyIDIwMTEgMjE6MzMNCj4gPiA+IEZyb206IEpvaGFubmVz
IEJlcmcgPGpvaGFubmVzLmJlcmdAaW50ZWwuY29tPg0KPiA+ID4NCj4gPiA+IEZvciBwcm9iZSBy
ZXNwb25zZXMgaXQgY2FuIGJlIHVzZWZ1bCB0byBub3Qgd2FpdCBmb3IgQUNLDQo+ID4gPiB0byBz
YXZlIGFpcnRpbWUsIHNvIGFsbG93IHVzZXJzcGFjZSB0byByZXF1ZXN0IG5vdCB3YWl0aW5nDQo+
ID4gPiB3aXRoIGEgbmV3IG5sODAyMTEgZmxhZy4NCj4gPiA+DQo+ID4gPiBTaW5jZSBtYWM4MDIx
MSBuZWVkcyB0byBiZSB1cGRhdGVkIGZvciB0aGUgbmV3IGZ1bmN0aW9uDQo+ID4gPiBwcm90b3R5
cGUgYW55d2F5IGltcGxlbWVudCBpdCByaWdodCBhd2F5IC0tIGl0J3MganVzdCBhDQo+ID4gPiBm
ZXcgbGluZXMgb2YgY29kZS4NCj4gDQo+ID4gSSB3b3VsZCBleHBlY3QgdGhpcyB0byBhZmZlY3Qg
dGhlIGR1cmF0aW9uIGZpZWxkIGluIHRoZQ0KPiA+IDgwMi4xMSBoZWFkZXIgdG8gaW5kaWNhdGUg
dGhlIHNob3J0ZXIgdXNlIG9mIHRoZSBtZWRpdW0uDQo+ID4gR29pbmcgdGhyb3VnaCB5b3VyIHBh
dGNoIEkgYW0gbm90IHN1cmUgdGhpcyBpcyBkb25lLg0KPiANCj4gSG1tbS4gWW91J3JlIHJpZ2h0
LCBidXQgdGhhdCdzIHNvbWV0aGluZyB3ZSBhbHJlYWR5IG5lZWQgdG8gZml4IGluIG1hbnkNCj4g
Y2FzZXMgLS0gYXMgdGhlIGR1cmF0aW9uIGZpZWxkIGlzIG92ZXJ3cml0dGVuIGJ5IG1vc3QgaGFy
ZHdhcmUgdGhlc2UNCj4gZGF5cywgd2UgaGF2ZW4ndCBhbHdheXMgbWFpbnRhaW5lZCBpdCB2ZXJ5
IHdlbGwuDQoNCklmIHRoZSBzdGF0aW9uIHN0aWxsIGRvZXMgdGhlIEFDSyB3ZSBzaG91bGQgbm90
IHRvdWNoIHRoZSBkdXJhdGlvbiBmaWVsZA0KaW4gdGhpcyBjYXNlIChzZWUgbXkgcmVwbHkgdG8g
SGVsbXV0KS4NCg0KPiBZb3VyIGRyaXZlciBzZWVtcyB0byBiZSB0aGUgZXhjZXB0aW9uIHRvIHRo
aXMgLS0gbWF5YmUgeW91IGNhbiBsb29rDQo+IGludG8NCj4gZml4aW5nIHVwIHRoZSBkdXJhdGlv
biBjYWxjdWxhdGlvbnM/IEFsc28gZm9yIDExbiB3aGljaCBpc24ndCB0YWtlbg0KPiBpbnRvDQo+
IGFjY291bnQgYXQgYWxsIHRvZGF5Lg0KPiANCj4gam9oYW5uZXMNCj4gDQoNCkkgd2lsbCBzZWUg
d2hldGhlciB3ZSBjYW4gY29udHJpYnV0ZSB0byBtYWM4MDIxMSBmb3IgdGhpcy4gQnV0IHRoZXJl
DQphcmUgb25seSB0d28gb2YgdXMgd29ya2luZyBvbiB0aGlzIGFuZCB0aGVyZSBhcmUgc29tZSBt
b3JlIGl0ZW1zIG9uDQpvdXIgdG9kbyBsaXN0LiBXaGVuIHdlIHdpbGwgYWRkcmVzcyBpdCB3ZSBz
dXJlIHdpbGwgdGFrZSAxMW4gaW50bw0KYWNjb3VudC4NCg0KR3IuIEF2Uw0K
^ permalink raw reply
* RE: [RFC v2 13/12] cfg80211/mac80211: allow management TX to not wait for ACK
From: Arend Van Spriel @ 2011-10-28 9:07 UTC (permalink / raw)
To: Helmut Schaa; +Cc: Johannes Berg, linux-wireless@vger.kernel.org
In-Reply-To: <CAGXE3d_9h-VMo3KaVThNXsXNVEAD4rVcKosMrjYVyKcfUD2=JQ@mail.gmail.com>
> From: Helmut Schaa [mailto:helmut.schaa@googlemail.com]
> Sent: vrijdag 28 oktober 2011 9:52
>
> On Fri, Oct 28, 2011 at 9:48 AM, Arend Van Spriel <arend@broadcom.com>
> wrote:
> > I would expect this to affect the duration field in the
> > 802.11 header to indicate the shorter use of the medium.
> > Going through your patch I am not sure this is done.
>
> I don't think so since the frame will still be acked by the peer as it
> is
> a unicast management frame. But this will advise the hardware that it
> does not need to wait for the ack to happen since we're not interested
> in retrying it.
>
> Helmut
Hi Helmut,
I understand. However, the commit message of this patch suggests we are
saving airtime, which does not seem the case if the duration field is
not taken into account. If the ACK is still transmitted we should not
touch the duration field so I guess my comment is only on the commit
message itself.
The whole duration field usage is another topic.
Gr. AvS
^ permalink raw reply
* Re: [wireless-next PATCH 5/5] wifi-debugfs: Fix AMSDU rate printout.
From: Johannes Berg @ 2011-10-28 8:13 UTC (permalink / raw)
To: greearb; +Cc: linux-wireless
In-Reply-To: <1319778680-11405-5-git-send-email-greearb@candelatech.com>
On Thu, 2011-10-27 at 22:11 -0700, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
>
> It was flipped. See section 7.3.2.56 of the 802.11n
> spec for details.
>
> Signed-off-by: Ben Greear <greearb@candelatech.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Thanks!
johannes
^ permalink raw reply
* Re: [wireless-next PATCH 4/5] wifi: Warn if cannot add station debugfs entries.
From: Johannes Berg @ 2011-10-28 8:13 UTC (permalink / raw)
To: greearb; +Cc: linux-wireless
In-Reply-To: <1319778680-11405-4-git-send-email-greearb@candelatech.com>
On Thu, 2011-10-27 at 22:11 -0700, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
>
> Signed-off-by: Ben Greear <greearb@candelatech.com>
> ---
> :100644 100644 c5f3417... 1ceec86... M net/mac80211/debugfs_sta.c
> net/mac80211/debugfs_sta.c | 10 ++++++++--
> 1 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
> index c5f3417..1ceec86 100644
> --- a/net/mac80211/debugfs_sta.c
> +++ b/net/mac80211/debugfs_sta.c
> @@ -337,8 +337,11 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta)
>
> sta->debugfs.add_has_run = true;
>
> - if (!stations_dir)
> + if (!stations_dir) {
> + printk(KERN_DEBUG "%s: sta_debugfs_add: stations_dir is NULL\n",
> + sta->sdata->name);
> return;
> + }
I honestly don't see any point in this.
johannes
^ permalink raw reply
* Re: [wireless-next PATCH 3/5] wifi: Allow overriding some HT information.
From: Johannes Berg @ 2011-10-28 8:12 UTC (permalink / raw)
To: greearb; +Cc: linux-wireless
In-Reply-To: <1319778680-11405-3-git-send-email-greearb@candelatech.com>
On Thu, 2011-10-27 at 22:11 -0700, greearb@candelatech.com wrote:
> 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 MSDU and MPDU
> values can be set to any value allowed by the 802.11n
> specification.
That can't work -- the device might not support it.
I also don't really like the way you pass in some binary "mask" when
it's not really a binary masking operation.
> struct vif_params {
> int use_4addr;
> int disable_11n;
> int disable_ht40;
> + struct ieee80211_ht_cap *ht_capa;
> + struct ieee80211_ht_cap *ht_capa_mask;
Same comments as before again -- this is per connection right?
> @@ -114,6 +115,19 @@ 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 we must
> + * advert at least the first 8 rates, even if we
> + * will later force the rate control to a lower rate.
> + */
> + ieee80211_apply_htcap_overrides(sdata, &ht_cap, 8);
Yuck, why, why hard-code 8, etc.
johannes
^ permalink raw reply
* Re: [wireless-next PATCH 2/5] wifi: Support disabling ht40.
From: Johannes Berg @ 2011-10-28 8:09 UTC (permalink / raw)
To: greearb; +Cc: linux-wireless
In-Reply-To: <1319778680-11405-2-git-send-email-greearb@candelatech.com>
On Thu, 2011-10-27 at 22:11 -0700, greearb@candelatech.com wrote:
> struct vif_params {
> int use_4addr;
> int disable_11n;
> + int disable_ht40;
> };
All the comments on patch 1 apply -- per connection parameter,
capability flag etc.
I do wonder if it would be worthwhile to make it a u32 "connection
flags" or so instead of defining them separately.
johannes
^ permalink raw reply
* Re: [wireless-next PATCH 1/5] mac80211: Support forcing station to disable 11n.
From: Johannes Berg @ 2011-10-28 8:08 UTC (permalink / raw)
To: greearb; +Cc: linux-wireless
In-Reply-To: <1319778680-11405-1-git-send-email-greearb@candelatech.com>
On Thu, 2011-10-27 at 22:11 -0700, greearb@candelatech.com wrote:
> The additional netlink bits is to allow this patch to work on 3.0
> and should not be included in the final patch.
What additional bit?
> + * @NL80211_ATTR_DISABLE_80211N: Force /n capable stations to instead
> + * function as /a/b/g stations.
IMHO this should be called DISABLE_HT -- "11n" will not exist for much
longer.
> +++ b/net/mac80211/cfg.c
> @@ -57,6 +57,9 @@ static int ieee80211_change_iface(struct wiphy *wiphy,
> struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
> int ret;
>
> + if (params->disable_11n != -1)
> + sdata->cfg_disable_11n = params->disable_11n;
This doesn't seem right -- why change the iface for it? It's a per
connection parameter.
> +++ b/net/mac80211/ieee80211_i.h
> @@ -595,6 +595,8 @@ struct ieee80211_sub_if_data {
> /* to detect idle changes */
> bool old_idle;
>
> + bool cfg_disable_11n; /* configured to disable 11n? */
That should be in the u.mgd part of the struct.
> +++ b/net/wireless/nl80211.c
> @@ -1641,6 +1641,13 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
> change = true;
> }
>
> + if (info->attrs[NL80211_ATTR_DISABLE_11N]) {
> + params.disable_11n = !!nla_get_u8(info->attrs[NL80211_ATTR_DISABLE_11N]);
> + change = true;
> + } else {
> + params.disable_11n = -1;
> + }
This should be a parameter to connect() and assoc(), not a generic
netdev parameter, since it applies to the connection.
Also, it would be good to have a capability check for it etc. since a
lot of fullmac drivers will likely never implement this.
johannes
^ permalink raw reply
* Re: cfg80211 events
From: Johannes Berg @ 2011-10-28 8:04 UTC (permalink / raw)
To: Dan Williams; +Cc: Daniel Wolstenholme, linux-wireless
In-Reply-To: <1319756980.4490.6.camel@dcbw.foobar.com>
On Thu, 2011-10-27 at 18:09 -0500, Dan Williams wrote:
> On Thu, 2011-10-27 at 15:27 -0700, Daniel Wolstenholme wrote:
> > Hi all,
> >
> > I'm working with the Broadcom brcmfmac driver, and I'm attempting to improve
> > event reporting, but I'm finding there's not that much documentation on
> > wireless events. One big problem I'm having is that I'm using the cfg80211
> > interface, but when I run "iw event -t -f", I don't see the events showing
> > up. Another question I have is: is there a way to send events with
> > arbitrary strings from the driver through to userspace?
>
> I'd be careful of that; we don't want a repeat of IWPRIV events, we'd
> rather have stuff standardized. Unless you're doing this for testing,
> of course.
Indeed. You can use testmode events for in-house testing, qualification,
calibration, etc. but it will be compiled out in distro kernels.
Arbitrary string events will never exist.
johannes
^ permalink raw reply
* Re: [RFC v2 13/12] cfg80211/mac80211: allow management TX to not wait for ACK
From: Johannes Berg @ 2011-10-28 8:02 UTC (permalink / raw)
To: Eliad Peller; +Cc: linux-wireless
In-Reply-To: <CAB3XZEd1Mg6sYiW4tfaeaoAL8OoRRysKg-U6RU1SucE08hdfJQ@mail.gmail.com>
On Fri, 2011-10-28 at 00:44 +0200, Eliad Peller wrote:
> On Thu, Oct 27, 2011 at 9:32 PM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > From: Johannes Berg <johannes.berg@intel.com>
> >
> > For probe responses it can be useful to not wait for ACK
> > to save airtime, so allow userspace to request not waiting
> > with a new nl80211 flag.
> >
> > Since mac80211 needs to be updated for the new function
> > prototype anyway implement it right away -- it's just a
> > few lines of code.
> >
> > Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> [RFC v2 13/12] ? :)
Too lazy to send a new patchset and it really belonged with this :-)
> > + if (!dont_wait_for_ack)
> > + flags = IEEE80211_TX_CTL_NO_ACK;
> > + else
> > + flags = IEEE80211_TX_INTFL_NL80211_FRAME_TX |
> > + IEEE80211_TX_CTL_REQ_TX_STATUS;
> > +
>
> shouldn't it be the other way around? (i.e. set NO_ACK if dont_wait_for_ack)
Doh, of course, thanks. I was editing this code a few times -- guess I
lost track.
johannes
^ permalink raw reply
* RE: [RFC v2 13/12] cfg80211/mac80211: allow management TX to not wait for ACK
From: Johannes Berg @ 2011-10-28 8:01 UTC (permalink / raw)
To: Arend Van Spriel; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <400C43189542CE41BC0A5B252FC90136BC0E3753AA@SJEXCHCCR02.corp.ad.broadcom.com>
On Fri, 2011-10-28 at 00:48 -0700, Arend Van Spriel wrote:
> > Sent: donderdag 27 oktober 2011 21:33
> > From: Johannes Berg <johannes.berg@intel.com>
> >
> > For probe responses it can be useful to not wait for ACK
> > to save airtime, so allow userspace to request not waiting
> > with a new nl80211 flag.
> >
> > Since mac80211 needs to be updated for the new function
> > prototype anyway implement it right away -- it's just a
> > few lines of code.
> I would expect this to affect the duration field in the
> 802.11 header to indicate the shorter use of the medium.
> Going through your patch I am not sure this is done.
Hmmm. You're right, but that's something we already need to fix in many
cases -- as the duration field is overwritten by most hardware these
days, we haven't always maintained it very well.
Your driver seems to be the exception to this -- maybe you can look into
fixing up the duration calculations? Also for 11n which isn't taken into
account at all today.
johannes
^ permalink raw reply
* Re: [RFC v2 13/12] cfg80211/mac80211: allow management TX to not wait for ACK
From: Helmut Schaa @ 2011-10-28 7:52 UTC (permalink / raw)
To: Arend Van Spriel; +Cc: Johannes Berg, linux-wireless@vger.kernel.org
In-Reply-To: <400C43189542CE41BC0A5B252FC90136BC0E3753AA@SJEXCHCCR02.corp.ad.broadcom.com>
On Fri, Oct 28, 2011 at 9:48 AM, Arend Van Spriel <arend@broadcom.com> wrote:
> I would expect this to affect the duration field in the
> 802.11 header to indicate the shorter use of the medium.
> Going through your patch I am not sure this is done.
I don't think so since the frame will still be acked by the peer as it is
a unicast management frame. But this will advise the hardware that it
does not need to wait for the ack to happen since we're not interested
in retrying it.
Helmut
^ permalink raw reply
* RE: [RFC v2 13/12] cfg80211/mac80211: allow management TX to not wait for ACK
From: Arend Van Spriel @ 2011-10-28 7:48 UTC (permalink / raw)
To: Johannes Berg, linux-wireless@vger.kernel.org
In-Reply-To: <1319743973.32221.4.camel@jlt3.sipsolutions.net>
PiBTZW50OiBkb25kZXJkYWcgMjcgb2t0b2JlciAyMDExIDIxOjMzDQo+IEZyb206IEpvaGFubmVz
IEJlcmcgPGpvaGFubmVzLmJlcmdAaW50ZWwuY29tPg0KPiANCj4gRm9yIHByb2JlIHJlc3BvbnNl
cyBpdCBjYW4gYmUgdXNlZnVsIHRvIG5vdCB3YWl0IGZvciBBQ0sNCj4gdG8gc2F2ZSBhaXJ0aW1l
LCBzbyBhbGxvdyB1c2Vyc3BhY2UgdG8gcmVxdWVzdCBub3Qgd2FpdGluZw0KPiB3aXRoIGEgbmV3
IG5sODAyMTEgZmxhZy4NCj4gDQo+IFNpbmNlIG1hYzgwMjExIG5lZWRzIHRvIGJlIHVwZGF0ZWQg
Zm9yIHRoZSBuZXcgZnVuY3Rpb24NCj4gcHJvdG90eXBlIGFueXdheSBpbXBsZW1lbnQgaXQgcmln
aHQgYXdheSAtLSBpdCdzIGp1c3QgYQ0KPiBmZXcgbGluZXMgb2YgY29kZS4NCj4gDQo+IFNpZ25l
ZC1vZmYtYnk6IEpvaGFubmVzIEJlcmcgPGpvaGFubmVzLmJlcmdAaW50ZWwuY29tPg0KPiAtLS0N
Cg0KSGkgSm9oYW5uZXMsDQoNCkkgd291bGQgZXhwZWN0IHRoaXMgdG8gYWZmZWN0IHRoZSBkdXJh
dGlvbiBmaWVsZCBpbiB0aGUNCjgwMi4xMSBoZWFkZXIgdG8gaW5kaWNhdGUgdGhlIHNob3J0ZXIg
dXNlIG9mIHRoZSBtZWRpdW0uDQpHb2luZyB0aHJvdWdoIHlvdXIgcGF0Y2ggSSBhbSBub3Qgc3Vy
ZSB0aGlzIGlzIGRvbmUuDQoNCkdyLiBBdlMNCg==
^ permalink raw reply
* Re: [RFC v2 13/12] cfg80211/mac80211: allow management TX to not wait for ACK
From: Johannes Berg @ 2011-10-28 7:34 UTC (permalink / raw)
To: Helmut Schaa; +Cc: linux-wireless
In-Reply-To: <CAGXE3d8QJqPR5Q95ZVt+JzWRZAH5f=Nap1DT=mTmmajsAMYcWw@mail.gmail.com>
On Fri, 2011-10-28 at 08:09 +0200, Helmut Schaa wrote:
> On Thu, Oct 27, 2011 at 9:32 PM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > From: Johannes Berg <johannes.berg@intel.com>
> >
> > For probe responses it can be useful to not wait for ACK
> > to save airtime, so allow userspace to request not waiting
> > with a new nl80211 flag.
> >
> > Since mac80211 needs to be updated for the new function
> > prototype anyway implement it right away -- it's just a
> > few lines of code.
>
> Ah, nice!
>
> I'll adjust my hostad patch to make use of this instead of the
> radiotap flag (or maybe both, need to look into this further).
If you just do the radiotap part I'll add the rest with my other
patchset.
johannes
^ permalink raw reply
* Re: [RFC v2 13/12] cfg80211/mac80211: allow management TX to not wait for ACK
From: Helmut Schaa @ 2011-10-28 6:09 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
In-Reply-To: <1319743973.32221.4.camel@jlt3.sipsolutions.net>
On Thu, Oct 27, 2011 at 9:32 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> For probe responses it can be useful to not wait for ACK
> to save airtime, so allow userspace to request not waiting
> with a new nl80211 flag.
>
> Since mac80211 needs to be updated for the new function
> prototype anyway implement it right away -- it's just a
> few lines of code.
Ah, nice!
I'll adjust my hostad patch to make use of this instead of the
radiotap flag (or maybe both, need to look into this further).
Helmut
^ permalink raw reply
* Re: [wireless-next PATCH 1/5] mac80211: Support forcing station to disable 11n.
From: Ben Greear @ 2011-10-28 5:15 UTC (permalink / raw)
To: linux-wireless
In-Reply-To: <1319778680-11405-1-git-send-email-greearb@candelatech.com>
On 10/27/2011 10:11 PM, greearb@candelatech.com wrote:
> From: Ben Greear<greearb@candelatech.com>
>
> This allows a user to configure a wifi station interface
> to disable 802.11n, even if the AP and NIC supports it.
>
> The additional netlink bits is to allow this patch to work on 3.0
> and should not be included in the final patch.
I have the wpa_supplicant patches for this series tested as well,
but I figured it best to make sure these kernel patches are acceptable
before posting the hostap patches....
Tested this on ath9k. According to the rate output seen by
iwconfig and the debug stuff in
cat /debug/ieee80211/wiphy0/netdev\:sta2/stations/00\:88\:99\:88\:99\:01/ht_capa
I think I have this working pretty well.
I have not yet tried verifying things with a sniffer...
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* [wireless-next PATCH 5/5] wifi-debugfs: Fix AMSDU rate printout.
From: greearb @ 2011-10-28 5:11 UTC (permalink / raw)
To: linux-wireless; +Cc: Ben Greear
In-Reply-To: <1319778680-11405-1-git-send-email-greearb@candelatech.com>
From: Ben Greear <greearb@candelatech.com>
It was flipped. See section 7.3.2.56 of the 802.11n
spec for details.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 1ceec86... 4310431... M net/mac80211/debugfs_sta.c
net/mac80211/debugfs_sta.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
index 1ceec86..4310431 100644
--- a/net/mac80211/debugfs_sta.c
+++ b/net/mac80211/debugfs_sta.c
@@ -274,9 +274,9 @@ static ssize_t sta_ht_capa_read(struct file *file, char __user *userbuf,
PRINT_HT_CAP((htc->cap & BIT(10)), "HT Delayed Block Ack");
- PRINT_HT_CAP((htc->cap & BIT(11)), "Max AMSDU length: "
- "3839 bytes");
PRINT_HT_CAP(!(htc->cap & BIT(11)), "Max AMSDU length: "
+ "3839 bytes");
+ PRINT_HT_CAP((htc->cap & BIT(11)), "Max AMSDU length: "
"7935 bytes");
/*
--
1.7.3.4
^ permalink raw reply related
* [wireless-next PATCH 4/5] wifi: Warn if cannot add station debugfs entries.
From: greearb @ 2011-10-28 5:11 UTC (permalink / raw)
To: linux-wireless; +Cc: Ben Greear
In-Reply-To: <1319778680-11405-1-git-send-email-greearb@candelatech.com>
From: Ben Greear <greearb@candelatech.com>
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 c5f3417... 1ceec86... M net/mac80211/debugfs_sta.c
net/mac80211/debugfs_sta.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
index c5f3417..1ceec86 100644
--- a/net/mac80211/debugfs_sta.c
+++ b/net/mac80211/debugfs_sta.c
@@ -337,8 +337,11 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta)
sta->debugfs.add_has_run = true;
- if (!stations_dir)
+ if (!stations_dir) {
+ printk(KERN_DEBUG "%s: sta_debugfs_add: stations_dir is NULL\n",
+ sta->sdata->name);
return;
+ }
snprintf(mac, sizeof(mac), "%pM", sta->sta.addr);
@@ -352,8 +355,11 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta)
* dir might still be around.
*/
sta->debugfs.dir = debugfs_create_dir(mac, stations_dir);
- if (!sta->debugfs.dir)
+ if (!sta->debugfs.dir) {
+ printk(KERN_DEBUG "%s: sta_debugfs_add: Failed to create sta->debugfs.dir\n",
+ sta->sdata->name);
return;
+ }
DEBUGFS_ADD(flags);
DEBUGFS_ADD(num_ps_buf_frames);
--
1.7.3.4
^ permalink raw reply related
* [wireless-next PATCH 3/5] wifi: Allow overriding some HT information.
From: greearb @ 2011-10-28 5:11 UTC (permalink / raw)
To: linux-wireless; +Cc: Ben Greear
In-Reply-To: <1319778680-11405-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 MSDU and MPDU
values can be set to any value allowed by the 802.11n
specification.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 ae50ade... 7f269cd... M include/linux/nl80211.h
:100644 100644 9d7a5e0... 802ff5f... M include/net/cfg80211.h
:100644 100644 c63d7f0... dde541f... M net/mac80211/cfg.c
:100644 100644 f80a35c... 0753c96... M net/mac80211/ht.c
:100644 100644 f4a7618... f279ee9... M net/mac80211/ieee80211_i.h
:100644 100644 164cdb1... 681ba4e... M net/mac80211/mlme.c
:100644 100644 94472eb... 2f546be... M net/mac80211/work.c
:100644 100644 5696621... 2cbb7c6... M net/wireless/nl80211.c
include/linux/nl80211.h | 3 ++
include/net/cfg80211.h | 4 ++
net/mac80211/cfg.c | 28 +++++++++++++++++-
net/mac80211/ht.c | 70 +++++++++++++++++++++++++++++++++++++++++++-
net/mac80211/ieee80211_i.h | 9 +++++-
net/mac80211/mlme.c | 4 +-
net/mac80211/work.c | 34 +++++++++++++++------
net/wireless/nl80211.c | 14 +++++++++
8 files changed, 151 insertions(+), 15 deletions(-)
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index ae50ade..7f269cd 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -1113,6 +1113,8 @@ enum nl80211_commands {
* function as /a/b/g stations.
* @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_11N,
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 9d7a5e0..802ff5f 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -256,11 +256,15 @@ struct ieee80211_supported_band {
* @use_4addr: use 4-address frames
* @disable_11n: Don't use 11n features (HT, etc)
* @disable_ht40: Don't use HT40, even if hardware & AP support it.
+ * @ht_capa: HT Capabilities for this interface.
+ * @ht_capa_mask: Bits of ht_capa that are to be used.
*/
struct vif_params {
int use_4addr;
int disable_11n;
int disable_ht40;
+ 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 c63d7f0..dde541f 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -105,6 +105,32 @@ static int ieee80211_change_iface(struct wiphy *wiphy,
}
}
+ if (params->ht_capa) {
+ u8 *caps = (u8 *)(params->ht_capa);
+ u8 *mask = (u8 *)(params->ht_capa_mask);
+ u8 *scaps = (u8 *)(&sdata->ht_capa);
+ u8 *smask = (u8 *)(&sdata->ht_capa_mask);
+ int i;
+
+ for (i = 0; i < sizeof(sdata->ht_capa); i++) {
+ if (mask[i]) {
+ int q;
+ smask[i] |= mask[i];
+ for (q = 0; q < 8; q++) {
+ if (mask[i] & (1<<q)) {
+ if (caps[i] & (1<<q))
+ scaps[i] |= (1<<q);
+ else
+ scaps[i] &= ~(1<<q);
+ }
+ }
+ }
+ }
+ } else if (params->ht_capa_mask) {
+ memcpy(&sdata->ht_capa_mask, params->ht_capa_mask,
+ sizeof(sdata->ht_capa_mask));
+ }
+
return 0;
}
@@ -784,7 +810,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..0753c96 100644
--- a/net/mac80211/ht.c
+++ b/net/mac80211/ht.c
@@ -18,7 +18,70 @@
#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->ht_capa.mcs.rx_mask);
+ u8 *smask = (u8 *)(&sdata->ht_capa_mask.mcs.rx_mask);
+ int i;
+
+ /* check for HT over-rides, mcs rates only at this time,
+ * and can only disable them, not force new ones to be
+ * made available.
+ */
+ 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->cfg_disable_ht40) {
+ ht_cap->cap &= ~(IEEE80211_HT_CAP_SUP_WIDTH_20_40
+ | IEEE80211_HT_CAP_SGI_40);
+ }
+
+ /* Allow user to set max AMDSU bit. */
+ if (sdata->ht_capa_mask.cap_info & IEEE80211_HT_CAP_MAX_AMSDU) {
+ if (sdata->ht_capa.cap_info & IEEE80211_HT_CAP_MAX_AMSDU)
+ ht_cap->cap |= IEEE80211_HT_CAP_MAX_AMSDU;
+ else
+ ht_cap->cap &= ~IEEE80211_HT_CAP_MAX_AMSDU;
+ }
+
+ /* Set the AMPDU factor */
+ if (sdata->ht_capa_mask.ampdu_params_info &
+ IEEE80211_HT_AMPDU_PARM_FACTOR)
+ ht_cap->ampdu_factor = sdata->ht_capa.ampdu_params_info &
+ IEEE80211_HT_AMPDU_PARM_FACTOR;
+
+ /* Set the AMPDU density */
+ if (sdata->ht_capa_mask.ampdu_params_info &
+ IEEE80211_HT_AMPDU_PARM_DENSITY)
+ ht_cap->ampdu_density =
+ (sdata->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 +165,11 @@ 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 f4a7618..f279ee9 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -598,6 +598,9 @@ struct ieee80211_sub_if_data {
bool cfg_disable_11n; /* configured to disable 11n? */
bool cfg_disable_ht40; /* configured to not use HT-40 */
+ struct ieee80211_ht_cap ht_capa; /* configured ht-cap over-rides */
+ struct ieee80211_ht_cap ht_capa_mask; /* Valid parts of ht_capa */
+
/* Fragment table for host-based reassembly */
struct ieee80211_fragment_entry fragments[IEEE80211_FRAGMENT_MAX];
unsigned int fragment_next;
@@ -1181,7 +1184,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 164cdb1..681ba4e 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1571,7 +1571,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;
@@ -1940,7 +1940,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;
diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index 94472eb..2f546be 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,19 @@ 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 we must
+ * advert at least the first 8 rates, even if we
+ * will later force the rate control to a lower rate.
+ */
+ ieee80211_apply_htcap_overrides(sdata, &ht_cap, 8);
+
+ 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 +180,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 +370,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/nl80211.c b/net/wireless/nl80211.c
index 5696621..2cbb7c6 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1655,6 +1655,20 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
params.disable_ht40 = -1;
}
+ if (info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]) {
+ params.ht_capa_mask =
+ nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]);
+ change = true;
+ }
+
+ if (info->attrs[NL80211_ATTR_HT_CAPABILITY]) {
+ if (!params.ht_capa_mask)
+ return -EINVAL;
+ params.ht_capa =
+ nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]);
+ change = true;
+ }
+
if (change)
err = cfg80211_change_iface(rdev, dev, ntype, flags, ¶ms);
else
--
1.7.3.4
^ 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