* [PATCH v2 1/3] nl80211/cfg80211: add WIPHY_FLAG_AP_UAPSD flag
@ 2011-08-25 11:24 Eliad Peller
2011-08-25 11:24 ` [PATCH v2 2/3] nl80211/cfg80211: add STA WME parameters Eliad Peller
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Eliad Peller @ 2011-08-25 11:24 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
add WIPHY_FLAG_AP_UAPSD flag to indicate uapsd support on
AP mode.
Advertise it to userspace by including a new
NL80211_ATTR_SUPPORT_AP_UAPSD attribute.
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
include/linux/nl80211.h | 5 +++++
include/net/cfg80211.h | 2 ++
net/wireless/nl80211.c | 2 ++
3 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 3769303..075497e 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_SUPPORT_AP_UAPSD: the device supports uapsd when working
+ * as AP.
+ *
* @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_SUPPORT_AP_UAPSD,
+
/* 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 a37f264..707f95d 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1617,6 +1617,7 @@ struct cfg80211_ops {
* @WIPHY_FLAG_MESH_AUTH: The device supports mesh authentication by routing
* auth frames to userspace. See @NL80211_MESH_SETUP_USERSPACE_AUTH.
* @WIPHY_FLAG_SUPPORTS_SCHED_SCAN: The device supports scheduled scans.
+ * @WIPHY_FLAG_AP_UAPSD: The device supports uapsd on AP.
*/
enum wiphy_flags {
WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0),
@@ -1631,6 +1632,7 @@ enum wiphy_flags {
WIPHY_FLAG_MESH_AUTH = BIT(10),
WIPHY_FLAG_SUPPORTS_SCHED_SCAN = BIT(11),
WIPHY_FLAG_ENFORCE_COMBINATIONS = BIT(12),
+ WIPHY_FLAG_AP_UAPSD = BIT(13),
};
/**
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 57ecfa4..a1854ec 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -719,6 +719,8 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags,
NLA_PUT_FLAG(msg, NL80211_ATTR_SUPPORT_IBSS_RSN);
if (dev->wiphy.flags & WIPHY_FLAG_MESH_AUTH)
NLA_PUT_FLAG(msg, NL80211_ATTR_SUPPORT_MESH_AUTH);
+ if (dev->wiphy.flags & WIPHY_FLAG_AP_UAPSD)
+ NLA_PUT_FLAG(msg, NL80211_ATTR_SUPPORT_AP_UAPSD);
NLA_PUT(msg, NL80211_ATTR_CIPHER_SUITES,
sizeof(u32) * dev->wiphy.n_cipher_suites,
--
1.7.6.401.g6a319
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/3] nl80211/cfg80211: add STA WME parameters
2011-08-25 11:24 [PATCH v2 1/3] nl80211/cfg80211: add WIPHY_FLAG_AP_UAPSD flag Eliad Peller
@ 2011-08-25 11:24 ` Eliad Peller
2011-08-25 11:24 ` [PATCH v2 3/3] mac80211: add uapsd_queues and max_sp params fields Eliad Peller
2011-08-29 13:25 ` [PATCH v2 1/3] nl80211/cfg80211: add WIPHY_FLAG_AP_UAPSD flag Johannes Berg
2 siblings, 0 replies; 6+ messages in thread
From: Eliad Peller @ 2011-08-25 11:24 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>
---
v2: consider WIPHY_FLAG_AP_UAPSD before parsing wme params.
include/linux/nl80211.h | 21 +++++++++++++++++++++
include/net/cfg80211.h | 2 ++
net/wireless/nl80211.c | 28 ++++++++++++++++++++++++++++
3 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 075497e..6e2ff33 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -1044,6 +1044,8 @@ enum nl80211_commands {
*
* @NL80211_ATTR_SUPPORT_AP_UAPSD: the device supports uapsd when working
* as AP.
+ * @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
@@ -1256,6 +1258,7 @@ enum nl80211_attrs {
NL80211_ATTR_IE_ASSOC_RESP,
NL80211_ATTR_SUPPORT_AP_UAPSD,
+ NL80211_ATTR_STA_WME,
/* add attributes here, update the policy in nl80211.c */
@@ -2487,4 +2490,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 707f95d..9818a84 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 a1854ec..6ea9ffe 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2547,6 +2547,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];
@@ -2592,6 +2598,28 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
if (parse_station_flags(info, ¶ms))
return -EINVAL;
+ /* parse WME attributes if sta is WME capable */
+ if ((rdev->wiphy.flags & WIPHY_FLAG_AP_UAPSD) &&
+ (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] 6+ messages in thread
* [PATCH v2 3/3] mac80211: add uapsd_queues and max_sp params fields
2011-08-25 11:24 [PATCH v2 1/3] nl80211/cfg80211: add WIPHY_FLAG_AP_UAPSD flag Eliad Peller
2011-08-25 11:24 ` [PATCH v2 2/3] nl80211/cfg80211: add STA WME parameters Eliad Peller
@ 2011-08-25 11:24 ` Eliad Peller
2011-08-29 13:25 ` [PATCH v2 1/3] nl80211/cfg80211: add WIPHY_FLAG_AP_UAPSD flag Johannes Berg
2 siblings, 0 replies; 6+ messages in thread
From: Eliad Peller @ 2011-08-25 11:24 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 7d17a91..c764268 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] 6+ messages in thread
* Re: [PATCH v2 1/3] nl80211/cfg80211: add WIPHY_FLAG_AP_UAPSD flag
2011-08-25 11:24 [PATCH v2 1/3] nl80211/cfg80211: add WIPHY_FLAG_AP_UAPSD flag Eliad Peller
2011-08-25 11:24 ` [PATCH v2 2/3] nl80211/cfg80211: add STA WME parameters Eliad Peller
2011-08-25 11:24 ` [PATCH v2 3/3] mac80211: add uapsd_queues and max_sp params fields Eliad Peller
@ 2011-08-29 13:25 ` Johannes Berg
2011-08-29 19:10 ` John W. Linville
2 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2011-08-29 13:25 UTC (permalink / raw)
To: Eliad Peller; +Cc: linux-wireless
On Thu, 2011-08-25 at 14:24 +0300, Eliad Peller wrote:
> add WIPHY_FLAG_AP_UAPSD flag to indicate uapsd support on
> AP mode.
>
> Advertise it to userspace by including a new
> NL80211_ATTR_SUPPORT_AP_UAPSD attribute.
I guess it'll help me support this for mac80211 (drivers that don't do
it all in firmware) -- I had a patch that was equivalent to the first
two :)
johannes
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/3] nl80211/cfg80211: add WIPHY_FLAG_AP_UAPSD flag
2011-08-29 13:25 ` [PATCH v2 1/3] nl80211/cfg80211: add WIPHY_FLAG_AP_UAPSD flag Johannes Berg
@ 2011-08-29 19:10 ` John W. Linville
2011-08-30 18:37 ` Eliad Peller
0 siblings, 1 reply; 6+ messages in thread
From: John W. Linville @ 2011-08-29 19:10 UTC (permalink / raw)
To: Johannes Berg; +Cc: Eliad Peller, linux-wireless
On Mon, Aug 29, 2011 at 03:25:02PM +0200, Johannes Berg wrote:
> On Thu, 2011-08-25 at 14:24 +0300, Eliad Peller wrote:
> > add WIPHY_FLAG_AP_UAPSD flag to indicate uapsd support on
> > AP mode.
> >
> > Advertise it to userspace by including a new
> > NL80211_ATTR_SUPPORT_AP_UAPSD attribute.
>
> I guess it'll help me support this for mac80211 (drivers that don't do
> it all in firmware) -- I had a patch that was equivalent to the first
> two :)
Apparently I misinterpreted the discussion of the first version of
this series. Apparently as Eliad was posting the 2nd version, I was
merging the first.
Could you post a version that takes what is already in wireless-next
and transforms it into this?
Thanks!
John
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/3] nl80211/cfg80211: add WIPHY_FLAG_AP_UAPSD flag
2011-08-29 19:10 ` John W. Linville
@ 2011-08-30 18:37 ` Eliad Peller
0 siblings, 0 replies; 6+ messages in thread
From: Eliad Peller @ 2011-08-30 18:37 UTC (permalink / raw)
To: John W. Linville; +Cc: Johannes Berg, linux-wireless
On Mon, Aug 29, 2011 at 10:10 PM, John W. Linville
<linville@tuxdriver.com> wrote:
> On Mon, Aug 29, 2011 at 03:25:02PM +0200, Johannes Berg wrote:
>> On Thu, 2011-08-25 at 14:24 +0300, Eliad Peller wrote:
>> > add WIPHY_FLAG_AP_UAPSD flag to indicate uapsd support on
>> > AP mode.
>> >
>> > Advertise it to userspace by including a new
>> > NL80211_ATTR_SUPPORT_AP_UAPSD attribute.
>>
>> I guess it'll help me support this for mac80211 (drivers that don't do
>> it all in firmware) -- I had a patch that was equivalent to the first
>> two :)
>
> Apparently I misinterpreted the discussion of the first version of
> this series. Apparently as Eliad was posting the 2nd version, I was
> merging the first.
>
> Could you post a version that takes what is already in wireless-next
> and transforms it into this?
>
sure (probably tomorrow).
Eliad.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-08-30 18:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-25 11:24 [PATCH v2 1/3] nl80211/cfg80211: add WIPHY_FLAG_AP_UAPSD flag Eliad Peller
2011-08-25 11:24 ` [PATCH v2 2/3] nl80211/cfg80211: add STA WME parameters Eliad Peller
2011-08-25 11:24 ` [PATCH v2 3/3] mac80211: add uapsd_queues and max_sp params fields Eliad Peller
2011-08-29 13:25 ` [PATCH v2 1/3] nl80211/cfg80211: add WIPHY_FLAG_AP_UAPSD flag Johannes Berg
2011-08-29 19:10 ` John W. Linville
2011-08-30 18:37 ` Eliad Peller
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.