diff options
author | John W. Linville <linville@tuxdriver.com> | 2011-07-11 14:46:59 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-07-11 14:46:59 -0400 |
commit | d8598981146241064993e371cea8333f59553cb6 (patch) | |
tree | bb92a46fb9fe75ee9c4fdbbe0a5b6eafc6818ef3 /net/wireless/nl80211.c | |
parent | 8ae2e12f1534e647d4a816755e5a09c2de6f9fca (diff) | |
parent | 34459512ffa7236c849466e3bd604801389734e1 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
Conflicts:
drivers/net/wireless/ath/ath5k/sysfs.c
net/bluetooth/l2cap_core.c
net/mac80211/wpa.c
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 491b0ba40c43..6a82c898f831 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -3470,9 +3470,6 @@ static int nl80211_start_sched_scan(struct sk_buff *skb, | |||
3470 | if (!is_valid_ie_attr(info->attrs[NL80211_ATTR_IE])) | 3470 | if (!is_valid_ie_attr(info->attrs[NL80211_ATTR_IE])) |
3471 | return -EINVAL; | 3471 | return -EINVAL; |
3472 | 3472 | ||
3473 | if (rdev->sched_scan_req) | ||
3474 | return -EINPROGRESS; | ||
3475 | |||
3476 | if (!info->attrs[NL80211_ATTR_SCHED_SCAN_INTERVAL]) | 3473 | if (!info->attrs[NL80211_ATTR_SCHED_SCAN_INTERVAL]) |
3477 | return -EINVAL; | 3474 | return -EINVAL; |
3478 | 3475 | ||
@@ -3511,12 +3508,21 @@ static int nl80211_start_sched_scan(struct sk_buff *skb, | |||
3511 | if (ie_len > wiphy->max_scan_ie_len) | 3508 | if (ie_len > wiphy->max_scan_ie_len) |
3512 | return -EINVAL; | 3509 | return -EINVAL; |
3513 | 3510 | ||
3511 | mutex_lock(&rdev->sched_scan_mtx); | ||
3512 | |||
3513 | if (rdev->sched_scan_req) { | ||
3514 | err = -EINPROGRESS; | ||
3515 | goto out; | ||
3516 | } | ||
3517 | |||
3514 | request = kzalloc(sizeof(*request) | 3518 | request = kzalloc(sizeof(*request) |
3515 | + sizeof(*request->ssids) * n_ssids | 3519 | + sizeof(*request->ssids) * n_ssids |
3516 | + sizeof(*request->channels) * n_channels | 3520 | + sizeof(*request->channels) * n_channels |
3517 | + ie_len, GFP_KERNEL); | 3521 | + ie_len, GFP_KERNEL); |
3518 | if (!request) | 3522 | if (!request) { |
3519 | return -ENOMEM; | 3523 | err = -ENOMEM; |
3524 | goto out; | ||
3525 | } | ||
3520 | 3526 | ||
3521 | if (n_ssids) | 3527 | if (n_ssids) |
3522 | request->ssids = (void *)&request->channels[n_channels]; | 3528 | request->ssids = (void *)&request->channels[n_channels]; |
@@ -3614,6 +3620,7 @@ static int nl80211_start_sched_scan(struct sk_buff *skb, | |||
3614 | out_free: | 3620 | out_free: |
3615 | kfree(request); | 3621 | kfree(request); |
3616 | out: | 3622 | out: |
3623 | mutex_unlock(&rdev->sched_scan_mtx); | ||
3617 | return err; | 3624 | return err; |
3618 | } | 3625 | } |
3619 | 3626 | ||
@@ -3621,12 +3628,17 @@ static int nl80211_stop_sched_scan(struct sk_buff *skb, | |||
3621 | struct genl_info *info) | 3628 | struct genl_info *info) |
3622 | { | 3629 | { |
3623 | struct cfg80211_registered_device *rdev = info->user_ptr[0]; | 3630 | struct cfg80211_registered_device *rdev = info->user_ptr[0]; |
3631 | int err; | ||
3624 | 3632 | ||
3625 | if (!(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_SCHED_SCAN) || | 3633 | if (!(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_SCHED_SCAN) || |
3626 | !rdev->ops->sched_scan_stop) | 3634 | !rdev->ops->sched_scan_stop) |
3627 | return -EOPNOTSUPP; | 3635 | return -EOPNOTSUPP; |
3628 | 3636 | ||
3629 | return __cfg80211_stop_sched_scan(rdev, false); | 3637 | mutex_lock(&rdev->sched_scan_mtx); |
3638 | err = __cfg80211_stop_sched_scan(rdev, false); | ||
3639 | mutex_unlock(&rdev->sched_scan_mtx); | ||
3640 | |||
3641 | return err; | ||
3630 | } | 3642 | } |
3631 | 3643 | ||
3632 | static int nl80211_send_bss(struct sk_buff *msg, struct netlink_callback *cb, | 3644 | static int nl80211_send_bss(struct sk_buff *msg, struct netlink_callback *cb, |