]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
cfg80211: Add option to specify previous BSSID for Connect command
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 29 Mar 2016 10:53:27 +0000 (13:53 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 6 Apr 2016 11:18:21 +0000 (13:18 +0200)
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 <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/cfg80211.h
net/wireless/nl80211.c
net/wireless/trace.h

index 568c10f6d564da4205f720816b073e94b8380a66..b39277eb251f755abbb77dfaaeb7414f8c84d4e7 100644 (file)
@@ -1925,6 +1925,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;
@@ -1949,6 +1950,7 @@ struct cfg80211_connect_params {
        struct ieee80211_vht_cap vht_capa_mask;
        bool pbss;
        struct cfg80211_bss_selection bss_select;
+       const u8 *prev_bssid;
 };
 
 /**
index 824569b1c5a1bb6d7b89dce13ad1600df3111463..4f89e2dbb70e0fa906cb82f70829bc7abe98c401 100644 (file)
@@ -8058,6 +8058,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]);
index 09b242b09bed841650466abcd4604a7af3c1a9e1..8da1fae23cfb5e36eb60b6dcdebc63295acb338d 100644 (file)
@@ -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,