cfg80211.c (b84da8c738681b96e7691d985191ebf9ee4a21e8) | cfg80211.c (1276c9ef6db2bc856579bc7f02e4cc710b089f0d) |
---|---|
1/* 2 * Copyright (c) 2004-2011 Atheros Communications Inc. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --- 734 unchanged lines hidden (view full) --- 743 mgmt->u.beacon.variable, 744 signal, GFP_ATOMIC); 745} 746 747static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev, 748 struct cfg80211_scan_request *request) 749{ 750 struct ath6kl *ar = (struct ath6kl *)ath6kl_priv(ndev); | 1/* 2 * Copyright (c) 2004-2011 Atheros Communications Inc. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --- 734 unchanged lines hidden (view full) --- 743 mgmt->u.beacon.variable, 744 signal, GFP_ATOMIC); 745} 746 747static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev, 748 struct cfg80211_scan_request *request) 749{ 750 struct ath6kl *ar = (struct ath6kl *)ath6kl_priv(ndev); |
751 s8 n_channels = 0; 752 u16 *channels = NULL; |
|
751 int ret = 0; 752 753 if (!ath6kl_cfg80211_ready(ar)) 754 return -EIO; 755 756 if (!ar->usr_bss_filter) { 757 if (ath6kl_wmi_bssfilter_cmd(ar->wmi, 758 (test_bit(CONNECTED, &ar->flag) ? --- 22 unchanged lines hidden (view full) --- 781 request->ie, request->ie_len); 782 if (ret) { 783 ath6kl_err("failed to set Probe Request appie for " 784 "scan"); 785 return ret; 786 } 787 } 788 | 753 int ret = 0; 754 755 if (!ath6kl_cfg80211_ready(ar)) 756 return -EIO; 757 758 if (!ar->usr_bss_filter) { 759 if (ath6kl_wmi_bssfilter_cmd(ar->wmi, 760 (test_bit(CONNECTED, &ar->flag) ? --- 22 unchanged lines hidden (view full) --- 783 request->ie, request->ie_len); 784 if (ret) { 785 ath6kl_err("failed to set Probe Request appie for " 786 "scan"); 787 return ret; 788 } 789 } 790 |
791 if (request->n_channels > 0) { 792 u8 i; 793 794 n_channels = min(127U, request->n_channels); 795 796 channels = kzalloc(n_channels * sizeof(u16), GFP_KERNEL); 797 if (channels == NULL) { 798 ath6kl_warn("failed to set scan channels, " 799 "scan all channels"); 800 n_channels = 0; 801 } 802 803 for (i = 0; i < n_channels; i++) 804 channels[i] = request->channels[i]->center_freq; 805 } 806 |
|
789 if (ath6kl_wmi_startscan_cmd(ar->wmi, WMI_LONG_SCAN, 0, | 807 if (ath6kl_wmi_startscan_cmd(ar->wmi, WMI_LONG_SCAN, 0, |
790 false, 0, 0, 0, NULL) != 0) { | 808 false, 0, 0, n_channels, channels) != 0) { |
791 ath6kl_err("wmi_startscan_cmd failed\n"); 792 ret = -EIO; 793 } 794 795 ar->scan_req = request; 796 | 809 ath6kl_err("wmi_startscan_cmd failed\n"); 810 ret = -EIO; 811 } 812 813 ar->scan_req = request; 814 |
815 kfree(channels); 816 |
|
797 return ret; 798} 799 800void ath6kl_cfg80211_scan_complete_event(struct ath6kl *ar, int status) 801{ 802 int i; 803 804 ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: status %d\n", __func__, status); --- 1013 unchanged lines hidden --- | 817 return ret; 818} 819 820void ath6kl_cfg80211_scan_complete_event(struct ath6kl *ar, int status) 821{ 822 int i; 823 824 ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: status %d\n", __func__, status); --- 1013 unchanged lines hidden --- |