All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] nl80211/cfg80211: add STA WME parameters
@ 2011-08-23 11:37 Eliad Peller
  2011-08-23 11:37 ` [PATCH 2/2] mac80211: add uapsd_queues and max_sp params fields Eliad Peller
  0 siblings, 1 reply; 7+ messages in thread
From: Eliad Peller @ 2011-08-23 11:37 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

Add new NL80211_ATTR_STA_WME nested attribute that contains
wme params needed by the low-level driver (uapsd_queues and
max_sp).

Add these params to the station_parameters struct as well.

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 include/linux/nl80211.h |   23 +++++++++++++++++++++++
 include/net/cfg80211.h  |    2 ++
 net/wireless/nl80211.c  |   27 +++++++++++++++++++++++++++
 3 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 89dec16..aa85eab 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -1042,6 +1042,9 @@ enum nl80211_commands {
  *	(Re)Association Response frames when the driver (or firmware) replies to
  *	(Re)Association Request frames.
  *
+ * @NL80211_ATTR_STA_WME: Nested attribute containing the wme configuration
+ *	of the station, see &enum nl80211_sta_wme_attr.
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -1252,6 +1255,8 @@ enum nl80211_attrs {
 	NL80211_ATTR_IE_PROBE_RESP,
 	NL80211_ATTR_IE_ASSOC_RESP,
 
+	NL80211_ATTR_STA_WME,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
@@ -2473,4 +2478,22 @@ enum nl80211_hidden_ssid {
 	NL80211_HIDDEN_SSID_ZERO_CONTENTS
 };
 
+/**
+ * enum nl80211_sta_wme_attr - station WME attributes
+ * @__NL80211_STA_WME_INVALID: invalid number for nested attribute
+ * @NL80211_STA_WME_QUEUES: bitmap of uapsd queues.
+ * @NL80211_STA_WME_MAX_SP: max service period.
+ * @__NL80211_STA_WME_AFTER_LAST: internal
+ * @NL80211_STA_WME_MAX: highest station WME attribute
+ */
+enum nl80211_sta_wme_attr {
+	__NL80211_STA_WME_INVALID,
+	NL80211_STA_WME_UAPSD_QUEUES,
+	NL80211_STA_WME_MAX_SP,
+
+	/* keep last */
+	__NL80211_STA_WME_AFTER_LAST,
+	NL80211_STA_WME_MAX = __NL80211_STA_WME_AFTER_LAST - 1
+};
+
 #endif /* __LINUX_NL80211_H */
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index d86a15d..d32c05f 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -452,6 +452,8 @@ struct station_parameters {
 	u8 plink_action;
 	u8 plink_state;
 	struct ieee80211_ht_cap *ht_capa;
+	u8 uapsd_queues;
+	u8 max_sp;
 };
 
 /**
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 2aa6a21..5e7c290 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2545,6 +2545,12 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
 	return err;
 }
 
+static struct nla_policy
+nl80211_sta_wme_policy[NL80211_STA_WME_MAX + 1] __read_mostly = {
+	[NL80211_STA_WME_UAPSD_QUEUES] = { .type = NLA_U8 },
+	[NL80211_STA_WME_MAX_SP] = { .type = NLA_U8 },
+};
+
 static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
 {
 	struct cfg80211_registered_device *rdev = info->user_ptr[0];
@@ -2590,6 +2596,27 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
 	if (parse_station_flags(info, &params))
 		return -EINVAL;
 
+	/* parse WME attributes if sta is WME capable */
+	if ((params.sta_flags_set & NL80211_STA_FLAG_WME) &&
+	    info->attrs[NL80211_ATTR_STA_WME]) {
+		struct nlattr *tb[NL80211_STA_WME_MAX + 1];
+		struct nlattr *nla;
+
+		nla = info->attrs[NL80211_ATTR_STA_WME];
+		err = nla_parse_nested(tb, NL80211_STA_WME_MAX, nla,
+				       nl80211_sta_wme_policy);
+		if (err)
+			return err;
+
+		if (tb[NL80211_STA_WME_UAPSD_QUEUES])
+			params.uapsd_queues =
+			     nla_get_u8(tb[NL80211_STA_WME_UAPSD_QUEUES]);
+
+		if (tb[NL80211_STA_WME_MAX_SP])
+			params.max_sp =
+			     nla_get_u8(tb[NL80211_STA_WME_MAX_SP]);
+	}
+
 	if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP &&
 	    dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP_VLAN &&
 	    dev->ieee80211_ptr->iftype != NL80211_IFTYPE_MESH_POINT &&
-- 
1.7.6.401.g6a319


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

* [PATCH 2/2] mac80211: add uapsd_queues and max_sp params fields
  2011-08-23 11:37 [PATCH 1/2] nl80211/cfg80211: add STA WME parameters Eliad Peller
@ 2011-08-23 11:37 ` Eliad Peller
  2011-08-23 15:39   ` Johannes Berg
  0 siblings, 1 reply; 7+ messages in thread
From: Eliad Peller @ 2011-08-23 11:37 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

Add uapsd_queues and max_sp fields to ieee80211_sta.
These fields might be needed by low-level drivers in
order to configure the AP.

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 include/net/mac80211.h |    2 ++
 net/mac80211/cfg.c     |    3 +++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 2f01d84..2e752df 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -954,6 +954,8 @@ struct ieee80211_sta {
 	u16 aid;
 	struct ieee80211_sta_ht_cap ht_cap;
 	bool wme;
+	u8 uapsd_queues;
+	u8 max_sp;
 
 	/* must be last */
 	u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index c1fa577..4bb6a92 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -697,6 +697,9 @@ static void sta_apply_parameters(struct ieee80211_local *local,
 	}
 	spin_unlock_irqrestore(&sta->flaglock, flags);
 
+	sta->sta.uapsd_queues = params->uapsd_queues;
+	sta->sta.max_sp = params->max_sp;
+
 	/*
 	 * cfg80211 validates this (1-2007) and allows setting the AID
 	 * only when creating a new station entry
-- 
1.7.6.401.g6a319


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

* Re: [PATCH 2/2] mac80211: add uapsd_queues and max_sp params fields
  2011-08-23 11:37 ` [PATCH 2/2] mac80211: add uapsd_queues and max_sp params fields Eliad Peller
@ 2011-08-23 15:39   ` Johannes Berg
  2011-08-23 15:50     ` Eliad Peller
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2011-08-23 15:39 UTC (permalink / raw)
  To: Eliad Peller; +Cc: linux-wireless

On Tue, 23 Aug 2011 14:37:47 +0300, Eliad Peller wrote:
> Add uapsd_queues and max_sp fields to ieee80211_sta.
> These fields might be needed by low-level drivers in
> order to configure the AP.

So your device has uapsd built-in? What if a device doesn't -- do we 
need feature advertisement for this?

johannes

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

* Re: [PATCH 2/2] mac80211: add uapsd_queues and max_sp params fields
  2011-08-23 15:39   ` Johannes Berg
@ 2011-08-23 15:50     ` Eliad Peller
  2011-08-23 15:55       ` Johannes Berg
  0 siblings, 1 reply; 7+ messages in thread
From: Eliad Peller @ 2011-08-23 15:50 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

On Tue, Aug 23, 2011 at 6:39 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Tue, 23 Aug 2011 14:37:47 +0300, Eliad Peller wrote:
>>
>> Add uapsd_queues and max_sp fields to ieee80211_sta.
>> These fields might be needed by low-level drivers in
>> order to configure the AP.
>
> So your device has uapsd built-in? What if a device doesn't -- do we need
> feature advertisement for this?
>
basically these params come from the supplicant on sta addition.
if the ap wasn't configured with uapsd, there won't be
NL80211_ATTR_STA_WME attribute, and these fields will be 0.

devices with no uapsd support will ignore these fields.
am i missing something?

(i'll send the supplicant patches later)

Eliad.

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

* Re: [PATCH 2/2] mac80211: add uapsd_queues and max_sp params fields
  2011-08-23 15:50     ` Eliad Peller
@ 2011-08-23 15:55       ` Johannes Berg
  2011-08-24  6:58         ` Eliad Peller
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2011-08-23 15:55 UTC (permalink / raw)
  To: Eliad Peller; +Cc: linux-wireless

On Tue, 23 Aug 2011 18:50:44 +0300, Eliad Peller wrote:
> basically these params come from the supplicant on sta addition.
> if the ap wasn't configured with uapsd, there won't be
> NL80211_ATTR_STA_WME attribute, and these fields will be 0.
>
> devices with no uapsd support will ignore these fields.
> am i missing something?

Well, so, how will the user know whether the device supports uAPSD? Or, 
if the user asks hostapd to enable uAPSD, how will hostapd know if the 
device supports it or not?

johannes

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

* Re: [PATCH 2/2] mac80211: add uapsd_queues and max_sp params fields
  2011-08-23 15:55       ` Johannes Berg
@ 2011-08-24  6:58         ` Eliad Peller
  2011-08-25  5:09           ` Johannes Berg
  0 siblings, 1 reply; 7+ messages in thread
From: Eliad Peller @ 2011-08-24  6:58 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

On Tue, Aug 23, 2011 at 6:55 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Tue, 23 Aug 2011 18:50:44 +0300, Eliad Peller wrote:
>>
>> basically these params come from the supplicant on sta addition.
>> if the ap wasn't configured with uapsd, there won't be
>> NL80211_ATTR_STA_WME attribute, and these fields will be 0.
>>
>> devices with no uapsd support will ignore these fields.
>> am i missing something?
>
> Well, so, how will the user know whether the device supports uAPSD? Or, if
> the user asks hostapd to enable uAPSD, how will hostapd know if the device
> supports it or not?
>
Currently, hostapd just looks for the uapsd_advertisement_enabled config param.
i guess we can add and require ap_uapsd capability (on a different
patch?). but won't it break environments that use new supplicant with
old drivers?

Eliad.

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

* Re: [PATCH 2/2] mac80211: add uapsd_queues and max_sp params fields
  2011-08-24  6:58         ` Eliad Peller
@ 2011-08-25  5:09           ` Johannes Berg
  0 siblings, 0 replies; 7+ messages in thread
From: Johannes Berg @ 2011-08-25  5:09 UTC (permalink / raw)
  To: Eliad Peller; +Cc: linux-wireless

On Wed, 2011-08-24 at 09:58 +0300, Eliad Peller wrote:

> Currently, hostapd just looks for the uapsd_advertisement_enabled config param.
> i guess we can add and require ap_uapsd capability (on a different
> patch?). but won't it break environments that use new supplicant with
> old drivers?

Don't think so, since no old drivers support uAPSD.

johannes


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

end of thread, other threads:[~2011-08-25  5:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-23 11:37 [PATCH 1/2] nl80211/cfg80211: add STA WME parameters Eliad Peller
2011-08-23 11:37 ` [PATCH 2/2] mac80211: add uapsd_queues and max_sp params fields Eliad Peller
2011-08-23 15:39   ` Johannes Berg
2011-08-23 15:50     ` Eliad Peller
2011-08-23 15:55       ` Johannes Berg
2011-08-24  6:58         ` Eliad Peller
2011-08-25  5:09           ` Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.