2011-06-22 21:19:39

by Arik Nemtsov

[permalink] [raw]
Subject: [PATCH 1/2] mac80211: propagate information about STA WME support down

Add a memeber to the ieee80211_sta structure to indicate whether the STA
supports WME.

Signed-off-by: Arik Nemtsov <[email protected]>
---
This functionality actually depends on a couple of patches
submitted to the hostapd list (but not applied yet). Otherwise the
wme flag is changed only after the STA is already added. OTOH this
shouldn't hurt anything, so it should be safe to apply.

include/net/mac80211.h | 2 ++
net/mac80211/cfg.c | 5 ++++-
2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 8c7189c..c07c328 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -933,6 +933,7 @@ enum set_key_cmd {
* @aid: AID we assigned to the station if we're an AP
* @supp_rates: Bitmap of supported rates (per band)
* @ht_cap: HT capabilities of this STA; restricted to our own TX capabilities
+ * @wme: indicates whether the STA supports WME
* @drv_priv: data area for driver use, will always be aligned to
* sizeof(void *), size is determined in hw information.
*/
@@ -941,6 +942,7 @@ struct ieee80211_sta {
u8 addr[ETH_ALEN];
u16 aid;
struct ieee80211_sta_ht_cap ht_cap;
+ bool wme;

/* must be last */
u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index be70c70..e6e6b35 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -674,8 +674,11 @@ static void sta_apply_parameters(struct ieee80211_local *local,

if (mask & BIT(NL80211_STA_FLAG_WME)) {
sta->flags &= ~WLAN_STA_WME;
- if (set & BIT(NL80211_STA_FLAG_WME))
+ sta->sta.wme = false;
+ if (set & BIT(NL80211_STA_FLAG_WME)) {
sta->flags |= WLAN_STA_WME;
+ sta->sta.wme = true;
+ }
}

if (mask & BIT(NL80211_STA_FLAG_MFP)) {
--
1.7.4.1



2011-06-22 21:26:40

by Arik Nemtsov

[permalink] [raw]
Subject: Re: [PATCH 1/2] mac80211: propagate information about STA WME support down

On Thu, Jun 23, 2011 at 00:24, Johannes Berg <[email protected]> wrote:
> On Thu, 2011-06-23 at 00:19 +0300, Arik Nemtsov wrote:
>> Add a memeber to the ieee80211_sta structure to indicate whether the STA
>> supports WME.
>
>> + * @wme: indicates whether the STA supports WME
>
> You should probably update that also in other modes (when this is a
> station representing an AP) for consistency. If that's really tough you
> could document that it's only valid if the interface is in AP mode, but
> I guess I'd prefer just having it valid.

Sure I'll take a look. It'll take a couple of days though.

Arik

2011-06-22 21:24:28

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 1/2] mac80211: propagate information about STA WME support down

On Thu, 2011-06-23 at 00:19 +0300, Arik Nemtsov wrote:
> Add a memeber to the ieee80211_sta structure to indicate whether the STA
> supports WME.

> + * @wme: indicates whether the STA supports WME

You should probably update that also in other modes (when this is a
station representing an AP) for consistency. If that's really tough you
could document that it's only valid if the interface is in AP mode, but
I guess I'd prefer just having it valid.

johannes


2011-06-22 21:19:41

by Arik Nemtsov

[permalink] [raw]
Subject: [PATCH 2/2] wl12xx: AP-mode - use mac80211 indication about STA WME support

When adding a station, use the information given in the mac80211
populated ieee80211_sta structure to determine if it supports WME.
Provide this information to the FW.

This patch depends on "mac80211: propagate information about
STA WME support down".

Signed-off-by: Arik Nemtsov <[email protected]>
---
drivers/net/wireless/wl12xx/cmd.c | 9 +--------
1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c
index b3a4f58..c7f6f60 100644
--- a/drivers/net/wireless/wl12xx/cmd.c
+++ b/drivers/net/wireless/wl12xx/cmd.c
@@ -1166,14 +1166,7 @@ int wl1271_cmd_add_sta(struct wl1271 *wl, struct ieee80211_sta *sta, u8 hlid)
cmd->bss_index = WL1271_AP_BSS_INDEX;
cmd->aid = sta->aid;
cmd->hlid = hlid;
-
- /*
- * FIXME: Does STA support QOS? We need to propagate this info from
- * hostapd. Currently not that important since this is only used for
- * sending the correct flavor of null-data packet in response to a
- * trigger.
- */
- cmd->wmm = 0;
+ cmd->wmm = sta->wme ? 1 : 0;

cmd->supported_rates = cpu_to_le32(wl1271_tx_enabled_rates_get(wl,
sta->supp_rates[wl->band]));
--
1.7.4.1