Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B568FC43441 for ; Fri, 16 Nov 2018 11:43:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 76B972087A for ; Fri, 16 Nov 2018 11:43:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="lVi6ckvk"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="lVi6ckvk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 76B972087A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728189AbeKPVzM (ORCPT ); Fri, 16 Nov 2018 16:55:12 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:34442 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727775AbeKPVzM (ORCPT ); Fri, 16 Nov 2018 16:55:12 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 75BD1606E1; Fri, 16 Nov 2018 11:43:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1542368591; bh=JsnXG3LeWLE9k3XUCEtezIgA+pxzBjZLXhX/MCL5JCQ=; h=From:To:Cc:Subject:Date:From; b=lVi6ckvkMgwbKIKlYdI7Sp/pxXgC45cY5n8YQsZGpiuhAGVqhfn0HcjcTw73YQ0DV ycN+bOlqyYrFa06y98vuFtGa8iXgHJEsjbA6f/p9C4c1jY8HXl+6rc9fyKHEvZlFJA IAUCyyLB9UErw/0Pp0cDpBxKPpJTxvAQsAx+yF+I= Received: from vjakkam-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: vjakkam@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id F125B60591; Fri, 16 Nov 2018 11:43:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1542368591; bh=JsnXG3LeWLE9k3XUCEtezIgA+pxzBjZLXhX/MCL5JCQ=; h=From:To:Cc:Subject:Date:From; b=lVi6ckvkMgwbKIKlYdI7Sp/pxXgC45cY5n8YQsZGpiuhAGVqhfn0HcjcTw73YQ0DV ycN+bOlqyYrFa06y98vuFtGa8iXgHJEsjbA6f/p9C4c1jY8HXl+6rc9fyKHEvZlFJA IAUCyyLB9UErw/0Pp0cDpBxKPpJTxvAQsAx+yF+I= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org F125B60591 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=vjakkam@codeaurora.org From: Veerendranath Jakkam To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org Subject: [PATCH] cfg80211: Allow drivers to advertise supported AKM suites Date: Fri, 16 Nov 2018 17:13:02 +0530 Message-Id: <1542368582-3153-1-git-send-email-vjakkam@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- 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