From patchwork Tue Mar 29 10:53:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jouni Malinen X-Patchwork-Id: 8685741 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8C184C0553 for ; Tue, 29 Mar 2016 10:53:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B583C20253 for ; Tue, 29 Mar 2016 10:53:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BFF0D20212 for ; Tue, 29 Mar 2016 10:53:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756781AbcC2Kxv (ORCPT ); Tue, 29 Mar 2016 06:53:51 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:15427 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756678AbcC2Kxu (ORCPT ); Tue, 29 Mar 2016 06:53:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1459248830; x=1490784830; h=from:to:cc:subject:date:message-id:mime-version; bh=+QSZjSw5vQXV8U9Vrw/b8XmgGCnVzbiRtmV3Hn2e+R8=; b=BXJQXn4rg3QzpsFOio2rt0g1yF6aNkjZw6YhPKU9RTFFfmuddf+niRB8 u/kMKedlxdc1Otzw8vZG/3m2ka0ejwUzDHk9taImrr7i0m+W4TowS87fL 1Rvro4ZSZt/3YliiwsTi/ASFNzgYbmGr+X9Jy7uJ6J4yO18Mwn/82ZTeF E=; X-IronPort-AV: E=Sophos;i="5.24,410,1455004800"; d="scan'208";a="180599251" Received: from ironmsg02-l-new.qualcomm.com (HELO ironmsg02-L.qualcomm.com) ([10.53.140.109]) by wolverine01.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 29 Mar 2016 03:53:49 -0700 X-IronPort-AV: E=McAfee;i="5700,7163,8118"; a="665976407" Received: from nasanexm02e.na.qualcomm.com ([10.85.0.86]) by ironmsg02-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 29 Mar 2016 03:53:49 -0700 Received: from euamsexm01e.eu.qualcomm.com (10.251.127.42) by nasanexm02e.na.qualcomm.com (10.85.0.86) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Tue, 29 Mar 2016 03:53:48 -0700 Received: from jouni.qca.qualcomm.com (10.80.80.8) by euamsexm01e.eu.qualcomm.com (10.251.127.42) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Tue, 29 Mar 2016 12:53:43 +0200 From: Jouni Malinen To: Johannes Berg CC: Subject: [PATCH 1/2] cfg80211: Add option to specify previous BSSID for Connect command Date: Tue, 29 Mar 2016 13:53:27 +0300 Message-ID: <1459248808-16412-1-git-send-email-jouni@qca.qualcomm.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01E.na.qualcomm.com (10.85.0.31) To euamsexm01e.eu.qualcomm.com (10.251.127.42) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This extends NL80211_CMD_CONNECT to allow the NL80211_ATTR_PREV_BSSID attribute to be used similarly to way this was already allowed with NL80211_CMD_ASSOCIATE. This allows user space to request reassociation (instead of association) when already connected to an AP. This provides an option to reassociate within an ESS without having to disconnect and associate with the AP. Signed-off-by: Jouni Malinen --- include/net/cfg80211.h | 2 ++ net/wireless/nl80211.c | 4 ++++ net/wireless/trace.h | 6 ++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 0bbfbf3..5fbb14d 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -1923,6 +1923,7 @@ struct cfg80211_bss_selection { * @pbss: if set, connect to a PCP instead of AP. Valid for DMG * networks. * @bss_select: criteria to be used for BSS selection. + * @prev_bssid: previous BSSID, if not %NULL use reassociate frame */ struct cfg80211_connect_params { struct ieee80211_channel *channel; @@ -1947,6 +1948,7 @@ struct cfg80211_connect_params { struct ieee80211_vht_cap vht_capa_mask; bool pbss; struct cfg80211_bss_selection bss_select; + const u8 *prev_bssid; }; /** diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index d6c6449..a98665a 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -8024,6 +8024,10 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info) connect.mfp = NL80211_MFP_NO; } + if (info->attrs[NL80211_ATTR_PREV_BSSID]) + connect.prev_bssid = + nla_data(info->attrs[NL80211_ATTR_PREV_BSSID]); + if (info->attrs[NL80211_ATTR_WIPHY_FREQ]) { connect.channel = nl80211_get_valid_chan( wiphy, info->attrs[NL80211_ATTR_WIPHY_FREQ]); diff --git a/net/wireless/trace.h b/net/wireless/trace.h index 09b242b..8da1fae 100644 --- a/net/wireless/trace.h +++ b/net/wireless/trace.h @@ -1259,6 +1259,7 @@ TRACE_EVENT(rdev_connect, __field(bool, privacy) __field(u32, wpa_versions) __field(u32, flags) + MAC_ENTRY(prev_bssid) ), TP_fast_assign( WIPHY_ASSIGN; @@ -1270,13 +1271,14 @@ TRACE_EVENT(rdev_connect, __entry->privacy = sme->privacy; __entry->wpa_versions = sme->crypto.wpa_versions; __entry->flags = sme->flags; + MAC_ASSIGN(prev_bssid, sme->prev_bssid); ), TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", bssid: " MAC_PR_FMT ", ssid: %s, auth type: %d, privacy: %s, wpa versions: %u, " - "flags: %u", + "flags: %u, previous bssid: " MAC_PR_FMT, WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(bssid), __entry->ssid, __entry->auth_type, BOOL_TO_STR(__entry->privacy), - __entry->wpa_versions, __entry->flags) + __entry->wpa_versions, __entry->flags, MAC_PR_ARG(prev_bssid)) ); TRACE_EVENT(rdev_set_cqm_rssi_config,