diff options
Diffstat (limited to 'net/mac80211/ieee80211_ioctl.c')
-rw-r--r-- | net/mac80211/ieee80211_ioctl.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c index d0e1ab5589db..e7904db55325 100644 --- a/net/mac80211/ieee80211_ioctl.c +++ b/net/mac80211/ieee80211_ioctl.c | |||
@@ -697,17 +697,24 @@ static int ieee80211_ioctl_siwscan(struct net_device *dev, | |||
697 | if (!netif_running(dev)) | 697 | if (!netif_running(dev)) |
698 | return -ENETDOWN; | 698 | return -ENETDOWN; |
699 | 699 | ||
700 | if (local->scan_flags & IEEE80211_SCAN_MATCH_SSID) { | 700 | switch (sdata->type) { |
701 | if (sdata->type == IEEE80211_IF_TYPE_STA || | 701 | case IEEE80211_IF_TYPE_STA: |
702 | sdata->type == IEEE80211_IF_TYPE_IBSS) { | 702 | case IEEE80211_IF_TYPE_IBSS: |
703 | if (local->scan_flags & IEEE80211_SCAN_MATCH_SSID) { | ||
703 | ssid = sdata->u.sta.ssid; | 704 | ssid = sdata->u.sta.ssid; |
704 | ssid_len = sdata->u.sta.ssid_len; | 705 | ssid_len = sdata->u.sta.ssid_len; |
705 | } else if (sdata->type == IEEE80211_IF_TYPE_AP) { | 706 | } |
707 | break; | ||
708 | case IEEE80211_IF_TYPE_AP: | ||
709 | if (local->scan_flags & IEEE80211_SCAN_MATCH_SSID) { | ||
706 | ssid = sdata->u.ap.ssid; | 710 | ssid = sdata->u.ap.ssid; |
707 | ssid_len = sdata->u.ap.ssid_len; | 711 | ssid_len = sdata->u.ap.ssid_len; |
708 | } else | 712 | } |
709 | return -EINVAL; | 713 | break; |
714 | default: | ||
715 | return -EOPNOTSUPP; | ||
710 | } | 716 | } |
717 | |||
711 | return ieee80211_sta_req_scan(dev, ssid, ssid_len); | 718 | return ieee80211_sta_req_scan(dev, ssid, ssid_len); |
712 | } | 719 | } |
713 | 720 | ||