aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/nl80211.h25
-rw-r--r--include/net/cfg80211.h2
-rw-r--r--net/wireless/nl80211.c10
3 files changed, 28 insertions, 9 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index f8b5595ba4af..281a2bb6a6ec 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -203,15 +203,17 @@
203 * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons, 203 * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons,
204 * partial scan results may be available 204 * partial scan results may be available
205 * 205 *
206 * @NL80211_CMD_START_SCHED_SCAN: start a scheduled scan. Like with normal 206 * @NL80211_CMD_START_SCHED_SCAN: start a scheduled scan at certain
207 * scans, if SSIDs (%NL80211_ATTR_SCAN_SSIDS) are passed, they are used 207 * intervals, as specified by %NL80211_ATTR_SCHED_SCAN_INTERVAL.
208 * in the probe requests. For broadcast, a broadcast SSID must be 208 * Like with normal scans, if SSIDs (%NL80211_ATTR_SCAN_SSIDS)
209 * passed (ie. an empty string). If no SSID is passed, no probe 209 * are passed, they are used in the probe requests. For
210 * requests are sent and a passive scan is performed. 210 * broadcast, a broadcast SSID must be passed (ie. an empty
211 * %NL80211_ATTR_SCAN_FREQUENCIES, if passed, define which channels 211 * string). If no SSID is passed, no probe requests are sent and
212 * should be scanned; if not passed, all channels allowed for the 212 * a passive scan is performed. %NL80211_ATTR_SCAN_FREQUENCIES,
213 * current regulatory domain are used. Extra IEs can also be passed 213 * if passed, define which channels should be scanned; if not
214 * from the userspace by using the %NL80211_ATTR_IE attribute. 214 * passed, all channels allowed for the current regulatory domain
215 * are used. Extra IEs can also be passed from the userspace by
216 * using the %NL80211_ATTR_IE attribute.
215 * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan 217 * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan
216 * @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan 218 * @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan
217 * results available. 219 * results available.
@@ -948,6 +950,9 @@ enum nl80211_commands {
948 * indicate which WoW triggers should be enabled. This is also 950 * indicate which WoW triggers should be enabled. This is also
949 * used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN 951 * used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN
950 * triggers. 952 * triggers.
953
954 * @NL80211_ATTR_SCHED_SCAN_INTERVAL: Interval between scheduled scan
955 * cycles, in msecs.
951 * 956 *
952 * @NL80211_ATTR_MAX: highest attribute number currently defined 957 * @NL80211_ATTR_MAX: highest attribute number currently defined
953 * @__NL80211_ATTR_AFTER_LAST: internal use 958 * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -1142,6 +1147,8 @@ enum nl80211_attrs {
1142 NL80211_ATTR_WOWLAN_TRIGGERS, 1147 NL80211_ATTR_WOWLAN_TRIGGERS,
1143 NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, 1148 NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED,
1144 1149
1150 NL80211_ATTR_SCHED_SCAN_INTERVAL,
1151
1145 /* add attributes here, update the policy in nl80211.c */ 1152 /* add attributes here, update the policy in nl80211.c */
1146 1153
1147 __NL80211_ATTR_AFTER_LAST, 1154 __NL80211_ATTR_AFTER_LAST,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index e214c85b74d2..1f1e221b6ce3 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -829,6 +829,7 @@ struct cfg80211_scan_request {
829 * @ssids: SSIDs to scan for (passed in the probe_reqs in active scans) 829 * @ssids: SSIDs to scan for (passed in the probe_reqs in active scans)
830 * @n_ssids: number of SSIDs 830 * @n_ssids: number of SSIDs
831 * @n_channels: total number of channels to scan 831 * @n_channels: total number of channels to scan
832 * @interval: interval between each scheduled scan cycle
832 * @ie: optional information element(s) to add into Probe Request or %NULL 833 * @ie: optional information element(s) to add into Probe Request or %NULL
833 * @ie_len: length of ie in octets 834 * @ie_len: length of ie in octets
834 * @wiphy: the wiphy this was for 835 * @wiphy: the wiphy this was for
@@ -839,6 +840,7 @@ struct cfg80211_sched_scan_request {
839 struct cfg80211_ssid *ssids; 840 struct cfg80211_ssid *ssids;
840 int n_ssids; 841 int n_ssids;
841 u32 n_channels; 842 u32 n_channels;
843 u32 interval;
842 const u8 *ie; 844 const u8 *ie;
843 size_t ie_len; 845 size_t ie_len;
844 846
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 4fac370284c0..b5b050b62f2a 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -175,6 +175,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
175 [NL80211_ATTR_KEY_DEFAULT_TYPES] = { .type = NLA_NESTED }, 175 [NL80211_ATTR_KEY_DEFAULT_TYPES] = { .type = NLA_NESTED },
176 [NL80211_ATTR_WOWLAN_TRIGGERS] = { .type = NLA_NESTED }, 176 [NL80211_ATTR_WOWLAN_TRIGGERS] = { .type = NLA_NESTED },
177 [NL80211_ATTR_STA_PLINK_STATE] = { .type = NLA_U8 }, 177 [NL80211_ATTR_STA_PLINK_STATE] = { .type = NLA_U8 },
178 [NL80211_ATTR_SCHED_SCAN_INTERVAL] = { .type = NLA_U32 },
178}; 179};
179 180
180/* policy for the key attributes */ 181/* policy for the key attributes */
@@ -3370,6 +3371,7 @@ static int nl80211_start_sched_scan(struct sk_buff *skb,
3370 struct nlattr *attr; 3371 struct nlattr *attr;
3371 struct wiphy *wiphy; 3372 struct wiphy *wiphy;
3372 int err, tmp, n_ssids = 0, n_channels, i; 3373 int err, tmp, n_ssids = 0, n_channels, i;
3374 u32 interval;
3373 enum ieee80211_band band; 3375 enum ieee80211_band band;
3374 size_t ie_len; 3376 size_t ie_len;
3375 3377
@@ -3383,6 +3385,13 @@ static int nl80211_start_sched_scan(struct sk_buff *skb,
3383 if (rdev->sched_scan_req) 3385 if (rdev->sched_scan_req)
3384 return -EINPROGRESS; 3386 return -EINPROGRESS;
3385 3387
3388 if (!info->attrs[NL80211_ATTR_SCHED_SCAN_INTERVAL])
3389 return -EINVAL;
3390
3391 interval = nla_get_u32(info->attrs[NL80211_ATTR_SCHED_SCAN_INTERVAL]);
3392 if (interval == 0)
3393 return -EINVAL;
3394
3386 wiphy = &rdev->wiphy; 3395 wiphy = &rdev->wiphy;
3387 3396
3388 if (info->attrs[NL80211_ATTR_SCAN_FREQUENCIES]) { 3397 if (info->attrs[NL80211_ATTR_SCAN_FREQUENCIES]) {
@@ -3505,6 +3514,7 @@ static int nl80211_start_sched_scan(struct sk_buff *skb,
3505 3514
3506 request->dev = dev; 3515 request->dev = dev;
3507 request->wiphy = &rdev->wiphy; 3516 request->wiphy = &rdev->wiphy;
3517 request->interval = interval;
3508 3518
3509 err = rdev->ops->sched_scan_start(&rdev->wiphy, dev, request); 3519 err = rdev->ops->sched_scan_start(&rdev->wiphy, dev, request);
3510 if (!err) { 3520 if (!err) {