All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] cfg80211: advertise extended capabilities to userspace
@ 2013-02-12 14:01 Johannes Berg
  2013-02-12 14:01 ` [PATCH 2/2] mac80211: advertise operating mode notification capability Johannes Berg
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Johannes Berg @ 2013-02-12 14:01 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

In many cases, userspace may need to know which of the
802.11 extended capabilities ("Extended Capabilities
element") are implemented in the driver or device, to
include them e.g. in beacons, assoc request/response
or other frames. Add a new nl80211 attribute to hold
the extended capabilities bitmap for this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 include/net/cfg80211.h       | 11 +++++++++++
 include/uapi/linux/nl80211.h |  9 +++++++++
 net/wireless/nl80211.c       |  9 +++++++++
 3 files changed, 29 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index bc670b2..a8e30f5 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2463,6 +2463,14 @@ struct wiphy_wowlan_support {
  *
  * @max_acl_mac_addrs: Maximum number of MAC addresses that the device
  *	supports for ACL.
+ *
+ * @extended_capabilities: extended capabilities supported by the driver,
+ *	additional capabilities might be supported by userspace; these are
+ *	the 802.11 extended capabilities ("Extended Capabilities element")
+ *	and are in the same format as in the information element. See
+ *	802.11-2012 8.4.2.29 for the defined fields.
+ * @extended_capabilities_mask: mask of the valid values
+ * @extended_capabilities_len: length of the extended capabilities
  */
 struct wiphy {
 	/* assign these fields before you register the wiphy */
@@ -2529,6 +2537,9 @@ struct wiphy {
 	 */
 	u32 probe_resp_offload;
 
+	const u8 *extended_capabilities, *extended_capabilities_mask;
+	u8 extended_capabilities_len;
+
 	/* If multiple wiphys are registered and you're handed e.g.
 	 * a regular netdev with assigned ieee80211_ptr, you won't
 	 * know whether it points to a wiphy your driver has registered
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 641984f..91b1e89 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1342,6 +1342,12 @@ enum nl80211_commands {
  *	number of MAC addresses that a device can support for MAC
  *	ACL.
  *
+ * @NL80211_ATTR_EXT_CAPA: 802.11 extended capabilities that the kernel driver
+ *	has and handles. The format is the same as the IE contents. See
+ *	802.11-2012 8.4.2.29 for more information.
+ * @NL80211_ATTR_EXT_CAPA_MASK: Extended capabilities that the kernel driver
+ *	has set in the %NL80211_ATTR_EXT_CAPA value, for multibit fields.
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -1620,6 +1626,9 @@ enum nl80211_attrs {
 
 	NL80211_ATTR_MAC_ACL_MAX,
 
+	NL80211_ATTR_EXT_CAPA,
+	NL80211_ATTR_EXT_CAPA_MASK,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index b19c822..1908b70 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1354,6 +1354,15 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 portid, u32 seq, int flag
 			dev->wiphy.max_acl_mac_addrs))
 		goto nla_put_failure;
 
+	if (dev->wiphy.extended_capabilities &&
+	    (nla_put(msg, NL80211_ATTR_EXT_CAPA,
+		     dev->wiphy.extended_capabilities_len,
+		     dev->wiphy.extended_capabilities) ||
+	     nla_put(msg, NL80211_ATTR_EXT_CAPA_MASK,
+		     dev->wiphy.extended_capabilities_len,
+		     dev->wiphy.extended_capabilities_mask)))
+		goto nla_put_failure;
+
 	return genlmsg_end(msg, hdr);
 
  nla_put_failure:
-- 
1.8.0


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

* [PATCH 2/2] mac80211: advertise operating mode notification capability
  2013-02-12 14:01 [PATCH 1/2] cfg80211: advertise extended capabilities to userspace Johannes Berg
@ 2013-02-12 14:01 ` Johannes Berg
  2013-02-14 20:02 ` [PATCH 1/2] cfg80211: advertise extended capabilities to userspace Johannes Berg
  2013-02-27 12:30 ` Piotr Haber
  2 siblings, 0 replies; 7+ messages in thread
From: Johannes Berg @ 2013-02-12 14:01 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Use the new extended capabilities advertising to advertise
the fact that operating mode notification is supported.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 include/linux/ieee80211.h | 2 ++
 net/mac80211/main.c       | 9 +++++++++
 2 files changed, 11 insertions(+)

diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 4aed928..9164c45 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1788,6 +1788,8 @@ enum ieee80211_tdls_actioncode {
 #define WLAN_EXT_CAPA5_TDLS_ENABLED	BIT(5)
 #define WLAN_EXT_CAPA5_TDLS_PROHIBITED	BIT(6)
 
+#define WLAN_EXT_CAPA8_OPMODE_NOTIF	BIT(6)
+
 /* TDLS specific payload type in the LLC/SNAP header */
 #define WLAN_TDLS_SNAP_RFTYPE	0x2
 
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 38b3468..26531a3 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -501,6 +501,11 @@ static const struct ieee80211_ht_cap mac80211_ht_capa_mod_mask = {
 	},
 };
 
+static const u8 extended_capabilities[] = {
+	0, 0, 0, 0, 0, 0, 0,
+	WLAN_EXT_CAPA8_OPMODE_NOTIF,
+};
+
 struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
 					const struct ieee80211_ops *ops)
 {
@@ -557,6 +562,10 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
 			WIPHY_FLAG_REPORTS_OBSS |
 			WIPHY_FLAG_OFFCHAN_TX;
 
+	wiphy->extended_capabilities = extended_capabilities;
+	wiphy->extended_capabilities_mask = extended_capabilities;
+	wiphy->extended_capabilities_len = ARRAY_SIZE(extended_capabilities);
+
 	if (ops->remain_on_channel)
 		wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
 
-- 
1.8.0


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

* Re: [PATCH 1/2] cfg80211: advertise extended capabilities to userspace
  2013-02-12 14:01 [PATCH 1/2] cfg80211: advertise extended capabilities to userspace Johannes Berg
  2013-02-12 14:01 ` [PATCH 2/2] mac80211: advertise operating mode notification capability Johannes Berg
@ 2013-02-14 20:02 ` Johannes Berg
  2013-02-27 12:30 ` Piotr Haber
  2 siblings, 0 replies; 7+ messages in thread
From: Johannes Berg @ 2013-02-14 20:02 UTC (permalink / raw)
  To: linux-wireless

On Tue, 2013-02-12 at 15:01 +0100, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> In many cases, userspace may need to know which of the
> 802.11 extended capabilities ("Extended Capabilities
> element") are implemented in the driver or device, to
> include them e.g. in beacons, assoc request/response
> or other frames. Add a new nl80211 attribute to hold
> the extended capabilities bitmap for this.

Applied both.

johannes


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

* Re: [PATCH 1/2] cfg80211: advertise extended capabilities to userspace
  2013-02-12 14:01 [PATCH 1/2] cfg80211: advertise extended capabilities to userspace Johannes Berg
  2013-02-12 14:01 ` [PATCH 2/2] mac80211: advertise operating mode notification capability Johannes Berg
  2013-02-14 20:02 ` [PATCH 1/2] cfg80211: advertise extended capabilities to userspace Johannes Berg
@ 2013-02-27 12:30 ` Piotr Haber
  2013-02-27 12:32   ` Johannes Berg
  2 siblings, 1 reply; 7+ messages in thread
From: Piotr Haber @ 2013-02-27 12:30 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Johannes Berg

On 02/12/13 15:01, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> In many cases, userspace may need to know which of the
> 802.11 extended capabilities ("Extended Capabilities
> element") are implemented in the driver or device, to
> include them e.g. in beacons, assoc request/response
> or other frames. Add a new nl80211 attribute to hold
> the extended capabilities bitmap for this.
> 
Hi,

seems like this patch pushed wiphy info length over the limit
for dual band devices.
So userspace cannot get any info about phy capabilities.

I know there is a patch for nl80211 and iw to allow splitting of this info,
but it is not in 3.8
Should we not revert it for stable then?

Kind regards
Piotr


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

* Re: [PATCH 1/2] cfg80211: advertise extended capabilities to userspace
  2013-02-27 12:30 ` Piotr Haber
@ 2013-02-27 12:32   ` Johannes Berg
  2013-02-27 12:48     ` Piotr Haber
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2013-02-27 12:32 UTC (permalink / raw)
  To: Piotr Haber; +Cc: linux-wireless

On Wed, 2013-02-27 at 13:30 +0100, Piotr Haber wrote:

> seems like this patch pushed wiphy info length over the limit
> for dual band devices.
> So userspace cannot get any info about phy capabilities.

Yeah ... was it this patch? I did revert some others, but I guess it
depends.

> I know there is a patch for nl80211 and iw to allow splitting of this info,
> but it is not in 3.8
> Should we not revert it for stable then?

Yeah we can revert this too, a la the patches already in to remove TCP
wakeup and radar info. What kernel are you testing?

johannes


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

* Re: [PATCH 1/2] cfg80211: advertise extended capabilities to userspace
  2013-02-27 12:32   ` Johannes Berg
@ 2013-02-27 12:48     ` Piotr Haber
  0 siblings, 0 replies; 7+ messages in thread
From: Piotr Haber @ 2013-02-27 12:48 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

On 02/27/13 13:32, Johannes Berg wrote:
> On Wed, 2013-02-27 at 13:30 +0100, Piotr Haber wrote:
> 
>> seems like this patch pushed wiphy info length over the limit
>> for dual band devices.
>> So userspace cannot get any info about phy capabilities.
> 
> Yeah ... was it this patch? I did revert some others, but I guess it
> depends.
did not bisect, but that was the last big thing added there

>> I know there is a patch for nl80211 and iw to allow splitting of this info,
>> but it is not in 3.8
>> Should we not revert it for stable then?
> 
> Yeah we can revert this too, a la the patches already in to remove TCP
> wakeup and radar info. What kernel are you testing?
> 
i have one built from wireless-testing master-2013-02-19


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

* [PATCH 1/2] cfg80211: advertise extended capabilities to userspace
@ 2013-02-11 15:25 Johannes Berg
  0 siblings, 0 replies; 7+ messages in thread
From: Johannes Berg @ 2013-02-11 15:25 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

In many cases, userspace may need to know which of the
extended capabilities are implemented in the driver or
device, to include them e.g. in beacons, association
request/response or other frames. Add a new nl80211
attribute that holds the extended capabilities bitmap
supported by the driver/device for this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 include/net/cfg80211.h       | 8 ++++++++
 include/uapi/linux/nl80211.h | 8 ++++++++
 net/wireless/nl80211.c       | 9 +++++++++
 3 files changed, 25 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index bc670b2..d84e7fd 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2463,6 +2463,11 @@ struct wiphy_wowlan_support {
  *
  * @max_acl_mac_addrs: Maximum number of MAC addresses that the device
  *	supports for ACL.
+ *
+ * @extended_capabilities: extended capabilities supported by the driver,
+ *	additional capabilities might be supported by userspace
+ * @extended_capabilities_mask: mask of the valid values
+ * @extended_capabilities_len: length of the extended capabilities
  */
 struct wiphy {
 	/* assign these fields before you register the wiphy */
@@ -2529,6 +2534,9 @@ struct wiphy {
 	 */
 	u32 probe_resp_offload;
 
+	const u8 *extended_capabilities, *extended_capabilities_mask;
+	u8 extended_capabilities_len;
+
 	/* If multiple wiphys are registered and you're handed e.g.
 	 * a regular netdev with assigned ieee80211_ptr, you won't
 	 * know whether it points to a wiphy your driver has registered
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 1ed7e1c..69d50fe 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1342,6 +1342,11 @@ enum nl80211_commands {
  *	number of MAC addresses that a device can support for MAC
  *	ACL.
  *
+ * @NL80211_ATTR_EXT_CAPA: Extended capabilities that the kernel driver
+ *	has and handles. The format is the same as the IE contents.
+ * @NL80211_ATTR_EXT_CAPA_MASK: Extended capabilities that the kernel driver
+ *	has set in the %NL80211_ATTR_EXT_CAPA value, for multibit fields.
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -1620,6 +1625,9 @@ enum nl80211_attrs {
 
 	NL80211_ATTR_MAC_ACL_MAX,
 
+	NL80211_ATTR_EXT_CAPA,
+	NL80211_ATTR_EXT_CAPA_MASK,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index b19c822..1908b70 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1354,6 +1354,15 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 portid, u32 seq, int flag
 			dev->wiphy.max_acl_mac_addrs))
 		goto nla_put_failure;
 
+	if (dev->wiphy.extended_capabilities &&
+	    (nla_put(msg, NL80211_ATTR_EXT_CAPA,
+		     dev->wiphy.extended_capabilities_len,
+		     dev->wiphy.extended_capabilities) ||
+	     nla_put(msg, NL80211_ATTR_EXT_CAPA_MASK,
+		     dev->wiphy.extended_capabilities_len,
+		     dev->wiphy.extended_capabilities_mask)))
+		goto nla_put_failure;
+
 	return genlmsg_end(msg, hdr);
 
  nla_put_failure:
-- 
1.8.0


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

end of thread, other threads:[~2013-02-27 12:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-12 14:01 [PATCH 1/2] cfg80211: advertise extended capabilities to userspace Johannes Berg
2013-02-12 14:01 ` [PATCH 2/2] mac80211: advertise operating mode notification capability Johannes Berg
2013-02-14 20:02 ` [PATCH 1/2] cfg80211: advertise extended capabilities to userspace Johannes Berg
2013-02-27 12:30 ` Piotr Haber
2013-02-27 12:32   ` Johannes Berg
2013-02-27 12:48     ` Piotr Haber
  -- strict thread matches above, loose matches on Subject: below --
2013-02-11 15:25 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.