aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLuciano Coelho <coelho@ti.com>2011-05-11 10:09:37 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-05-11 15:12:27 -0400
commitbbe6ad6dcb1eb26bd12ec85320f402721c3383ae (patch)
tree08e7e3491caa30e22c9c38d9d3a8728a02adc0c5 /net
parent79f460ca49d8d5700756ab7071c951311c7f29cc (diff)
cfg80211/nl80211: add interval attribute for scheduled scans
Introduce NL80211_ATTR_SCHED_SCAN_INTERVAL as a required attribute for NL80211_CMD_START_SCHED_SCAN. This value informs the driver at which intervals the scheduled scan cycles should be executed. Signed-off-by: Luciano Coelho <coelho@ti.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/wireless/nl80211.c10
1 files changed, 10 insertions, 0 deletions
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) {