aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath/ath6kl/cfg80211.c22
-rw-r--r--drivers/net/wireless/ath/ath6kl/wmi.c6
2 files changed, 24 insertions, 4 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,
748 struct cfg80211_scan_request *request) 748 struct cfg80211_scan_request *request)
749{ 749{
750 struct ath6kl *ar = (struct ath6kl *)ath6kl_priv(ndev); 750 struct ath6kl *ar = (struct ath6kl *)ath6kl_priv(ndev);
751 s8 n_channels = 0;
752 u16 *channels = NULL;
751 int ret = 0; 753 int ret = 0;
752 754
753 if (!ath6kl_cfg80211_ready(ar)) 755 if (!ath6kl_cfg80211_ready(ar))
@@ -786,14 +788,32 @@ static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
786 } 788 }
787 } 789 }
788 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"); 809 ath6kl_err("wmi_startscan_cmd failed\n");
792 ret = -EIO; 810 ret = -EIO;
793 } 811 }
794 812
795 ar->scan_req = request; 813 ar->scan_req = request;
796 814
815 kfree(channels);
816
797 return ret; 817 return ret;
798} 818}
799 819
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index 2d80bdb2d912..bbe3e8d214c8 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -1709,7 +1709,7 @@ int ath6kl_wmi_startscan_cmd(struct wmi *wmi, enum wmi_scan_type scan_type,
1709 struct sk_buff *skb; 1709 struct sk_buff *skb;
1710 struct wmi_start_scan_cmd *sc; 1710 struct wmi_start_scan_cmd *sc;
1711 s8 size; 1711 s8 size;
1712 int ret; 1712 int i, ret;
1713 1713
1714 size = sizeof(struct wmi_start_scan_cmd); 1714 size = sizeof(struct wmi_start_scan_cmd);
1715 1715
@@ -1734,8 +1734,8 @@ int ath6kl_wmi_startscan_cmd(struct wmi *wmi, enum wmi_scan_type scan_type,
1734 sc->force_scan_intvl = cpu_to_le32(force_scan_interval); 1734 sc->force_scan_intvl = cpu_to_le32(force_scan_interval);
1735 sc->num_ch = num_chan; 1735 sc->num_ch = num_chan;
1736 1736
1737 if (num_chan) 1737 for (i = 0; i < num_chan; i++)
1738 memcpy(sc->ch_list, ch_list, num_chan * sizeof(u16)); 1738 sc->ch_list[i] = cpu_to_le16(ch_list[i]);
1739 1739
1740 ret = ath6kl_wmi_cmd_send(wmi, skb, WMI_START_SCAN_CMDID, 1740 ret = ath6kl_wmi_cmd_send(wmi, skb, WMI_START_SCAN_CMDID,
1741 NO_SYNC_WMIFLAG); 1741 NO_SYNC_WMIFLAG);