summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath6kl/cfg80211.c
diff options
context:
space:
mode:
authorEdward Lu <elu@qca.qualcomm.com>2011-08-30 21:58:00 +0300
committerKalle Valo <kvalo@qca.qualcomm.com>2011-08-31 10:13:01 +0300
commit1276c9ef6db2bc856579bc7f02e4cc710b089f0d (patch)
tree6dbead3c751d349ab40c6a8e9f22a8bf116fdbc4 /drivers/net/wireless/ath/ath6kl/cfg80211.c
parentb84da8c738681b96e7691d985191ebf9ee4a21e8 (diff)
ath6kl: Support channel set request for startscan command
Signed-off-by: Edward Lu <elu@qca.qualcomm.com> Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath6kl/cfg80211.c')
-rw-r--r--drivers/net/wireless/ath/ath6kl/cfg80211.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 56a60c7f53c1..78b178892ede 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -748,6 +748,8 @@ static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
struct cfg80211_scan_request *request)
{
struct ath6kl *ar = (struct ath6kl *)ath6kl_priv(ndev);
+ s8 n_channels = 0;
+ u16 *channels = NULL;
int ret = 0;
if (!ath6kl_cfg80211_ready(ar))
@@ -786,14 +788,32 @@ static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
}
}
+ if (request->n_channels > 0) {
+ u8 i;
+
+ n_channels = min(127U, request->n_channels);
+
+ channels = kzalloc(n_channels * sizeof(u16), GFP_KERNEL);
+ if (channels == NULL) {
+ ath6kl_warn("failed to set scan channels, "
+ "scan all channels");
+ n_channels = 0;
+ }
+
+ for (i = 0; i < n_channels; i++)
+ channels[i] = request->channels[i]->center_freq;
+ }
+
if (ath6kl_wmi_startscan_cmd(ar->wmi, WMI_LONG_SCAN, 0,
- false, 0, 0, 0, NULL) != 0) {
+ false, 0, 0, n_channels, channels) != 0) {
ath6kl_err("wmi_startscan_cmd failed\n");
ret = -EIO;
}
ar->scan_req = request;
+ kfree(channels);
+
return ret;
}