Search Linux Wireless

[PATCH] cfg80211: Allow drivers to advertise supported AKM suites

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There was no such capability advertisement from the driver and thus the
current user space has to assume the driver to support all the AKMs. While
that may be the case with some drivers (e.g., mac80211-based ones), there
are cfg80211-based drivers that have constraints on which AKMs can be used.
Allow such drivers to advertise the exact set of supported AKMs so that
user space tools can determine what network profile options should be
allowed to be configured.

Signed-off-by: Veerendranath Jakkam <vjakkam@xxxxxxxxxxxxxx>
---
 include/net/cfg80211.h       | 5 +++++
 include/uapi/linux/nl80211.h | 4 ++++
 net/wireless/nl80211.c       | 6 ++++++
 3 files changed, 15 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index ede7fcd..7cff5ab 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4110,6 +4110,8 @@ struct cfg80211_pmsr_capabilities {
  * @signal_type: signal type reported in &struct cfg80211_bss.
  * @cipher_suites: supported cipher suites
  * @n_cipher_suites: number of supported cipher suites
+ * @akm_suites: supported AKM suites
+ * @n_akm_suites: number of supported AKM suites
  * @retry_short: Retry limit for short frames (dot11ShortRetryLimit)
  * @retry_long: Retry limit for long frames (dot11LongRetryLimit)
  * @frag_threshold: Fragmentation threshold (dot11FragmentationThreshold);
@@ -4308,6 +4310,9 @@ struct wiphy {
 	int n_cipher_suites;
 	const u32 *cipher_suites;
 
+	int n_akm_suites;
+	const u32 *akm_suites;
+
 	u8 retry_short;
 	u8 retry_long;
 	u32 frag_threshold;
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 51bd85b..c21c238 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1558,6 +1558,10 @@ enum nl80211_commands {
  *	(a u32 with flags from &enum nl80211_wpa_versions).
  * @NL80211_ATTR_AKM_SUITES: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
  *	indicate which key management algorithm(s) to use (an array of u32).
+ *	This attribute is also sent in response to @NL80211_CMD_GET_WIPHY,
+ *	indicating the supported AKM suites. If there is no such notification
+ *	from the driver, user space should assume the driver supports all the
+ *	AKM suites.
  *
  * @NL80211_ATTR_REQ_IE: (Re)association request information elements as
  *	sent out by the card, for ROAM and successful CONNECT events.
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index e20329b..3974752c 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2269,6 +2269,12 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
 		if (nl80211_send_pmsr_capa(rdev, msg))
 			goto nla_put_failure;
 
+		if (rdev->wiphy.akm_suites)
+			if (nla_put(msg, NL80211_ATTR_AKM_SUITES,
+				    sizeof(u32) * rdev->wiphy.n_akm_suites,
+				    rdev->wiphy.akm_suites))
+				goto nla_put_failure;
+
 		/* done */
 		state->split_start = 0;
 		break;
-- 
1.9.1




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux