aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
authorSam Leffler <sleffler@chromium.org>2012-10-12 00:03:31 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-10-18 03:01:23 -0400
commited47377154310fd2fd59d75fcdeb3d022344fb31 (patch)
tree228eb525b26b448b13b8d74de01ba91a42dedc06 /net/wireless/nl80211.c
parentf461be3eff662f01a177ecea8c1d7b040bb6bfbe (diff)
{nl,cfg}80211: add a flags word to scan requests
Add a flags word to direct and scheduled scan requests; it will be used for control of optional behaviours such as flushing the bss cache prior to doing a scan. Signed-off-by: Sam Leffler <sleffler@chromium.org> Tested-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index ef170e982f91..dc08211c6c6b 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -356,6 +356,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
356 [NL80211_ATTR_USER_REG_HINT_TYPE] = { .type = NLA_U32 }, 356 [NL80211_ATTR_USER_REG_HINT_TYPE] = { .type = NLA_U32 },
357 [NL80211_ATTR_SAE_DATA] = { .type = NLA_BINARY, }, 357 [NL80211_ATTR_SAE_DATA] = { .type = NLA_BINARY, },
358 [NL80211_ATTR_VHT_CAPABILITY] = { .len = NL80211_VHT_CAPABILITY_LEN }, 358 [NL80211_ATTR_VHT_CAPABILITY] = { .len = NL80211_VHT_CAPABILITY_LEN },
359 [NL80211_ATTR_SCAN_FLAGS] = { .type = NLA_U32 },
359}; 360};
360 361
361/* policy for the key attributes */ 362/* policy for the key attributes */
@@ -4367,6 +4368,10 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
4367 } 4368 }
4368 } 4369 }
4369 4370
4371 if (info->attrs[NL80211_ATTR_SCAN_FLAGS])
4372 request->flags = nla_get_u32(
4373 info->attrs[NL80211_ATTR_SCAN_FLAGS]);
4374
4370 request->no_cck = 4375 request->no_cck =
4371 nla_get_flag(info->attrs[NL80211_ATTR_TX_NO_CCK_RATE]); 4376 nla_get_flag(info->attrs[NL80211_ATTR_TX_NO_CCK_RATE]);
4372 4377
@@ -4598,6 +4603,10 @@ static int nl80211_start_sched_scan(struct sk_buff *skb,
4598 request->ie_len); 4603 request->ie_len);
4599 } 4604 }
4600 4605
4606 if (info->attrs[NL80211_ATTR_SCAN_FLAGS])
4607 request->flags = nla_get_u32(
4608 info->attrs[NL80211_ATTR_SCAN_FLAGS]);
4609
4601 request->dev = dev; 4610 request->dev = dev;
4602 request->wiphy = &rdev->wiphy; 4611 request->wiphy = &rdev->wiphy;
4603 request->interval = interval; 4612 request->interval = interval;
@@ -7663,6 +7672,9 @@ static int nl80211_add_scan_req(struct sk_buff *msg,
7663 nla_put(msg, NL80211_ATTR_IE, req->ie_len, req->ie)) 7672 nla_put(msg, NL80211_ATTR_IE, req->ie_len, req->ie))
7664 goto nla_put_failure; 7673 goto nla_put_failure;
7665 7674
7675 if (req->flags)
7676 nla_put_u32(msg, NL80211_ATTR_SCAN_FLAGS, req->flags);
7677
7666 return 0; 7678 return 0;
7667 nla_put_failure: 7679 nla_put_failure:
7668 return -ENOBUFS; 7680 return -ENOBUFS;