aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2012-04-16 12:28:03 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2012-04-18 06:12:26 -0400
commit3b8ffc6a22ba05d5ce12f375b060c9e62ed8f016 (patch)
tree9f19406d6273ac711bf8cf01841803894bf9e335 /drivers
parenta432e7cc4f3e59f2fd75bb2fd66580f16e8a7447 (diff)
ath6kl: Configure probed SSID list consistently
Set max_scan_ssids and max_sched_scan_ssids to same value. These use the same probed SSID list, so there is no point in using different maximum number of SSIDs. Clear probed SSID entries that are not used. This was already done for sched_scan, but not for scan. Be consistent and clear the table for both cases to avoid leaving bogus entries. In addition, share the same function for setting the probed SSIDs for scan and sched_scan paths. This fixes setting of wildcard SSID flag (ANY_SSID_FLAG) and changes the scan path to use probed SSID index consistently (i.e., start with 0 similarly to sched_scan; firmware will handle the needed internal mapping). Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath6kl/cfg80211.c63
1 files changed, 35 insertions, 28 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index d8fb820f1c9a..a8a7570e22a0 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -882,6 +882,32 @@ void ath6kl_cfg80211_disconnect_event(struct ath6kl_vif *vif, u8 reason,
882 vif->sme_state = SME_DISCONNECTED; 882 vif->sme_state = SME_DISCONNECTED;
883} 883}
884 884
885static int ath6kl_set_probed_ssids(struct ath6kl *ar,
886 struct ath6kl_vif *vif,
887 struct cfg80211_ssid *ssids, int n_ssids)
888{
889 u8 i;
890
891 if (n_ssids > MAX_PROBED_SSID_INDEX)
892 return -EINVAL;
893
894 for (i = 0; i < n_ssids; i++) {
895 ath6kl_wmi_probedssid_cmd(ar->wmi, vif->fw_vif_idx, i,
896 ssids[i].ssid_len ?
897 SPECIFIC_SSID_FLAG : ANY_SSID_FLAG,
898 ssids[i].ssid_len,
899 ssids[i].ssid);
900 }
901
902 /* Make sure no old entries are left behind */
903 for (i = n_ssids; i < MAX_PROBED_SSID_INDEX; i++) {
904 ath6kl_wmi_probedssid_cmd(ar->wmi, vif->fw_vif_idx, i,
905 DISABLE_SSID_FLAG, 0, NULL);
906 }
907
908 return 0;
909}
910
885static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev, 911static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
886 struct cfg80211_scan_request *request) 912 struct cfg80211_scan_request *request)
887{ 913{
@@ -909,18 +935,10 @@ static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
909 } 935 }
910 } 936 }
911 937
912 if (request->n_ssids && request->ssids[0].ssid_len) { 938 ret = ath6kl_set_probed_ssids(ar, vif, request->ssids,
913 u8 i; 939 request->n_ssids);
914 940 if (ret < 0)
915 if (request->n_ssids > (MAX_PROBED_SSID_INDEX - 1)) 941 return ret;
916 request->n_ssids = MAX_PROBED_SSID_INDEX - 1;
917
918 for (i = 0; i < request->n_ssids; i++)
919 ath6kl_wmi_probedssid_cmd(ar->wmi, vif->fw_vif_idx,
920 i + 1, SPECIFIC_SSID_FLAG,
921 request->ssids[i].ssid_len,
922 request->ssids[i].ssid);
923 }
924 942
925 /* this also clears IE in fw if it's not set */ 943 /* this also clears IE in fw if it's not set */
926 ret = ath6kl_wmi_set_appie_cmd(ar->wmi, vif->fw_vif_idx, 944 ret = ath6kl_wmi_set_appie_cmd(ar->wmi, vif->fw_vif_idx,
@@ -3100,7 +3118,6 @@ static int ath6kl_cfg80211_sscan_start(struct wiphy *wiphy,
3100 struct ath6kl_vif *vif = netdev_priv(dev); 3118 struct ath6kl_vif *vif = netdev_priv(dev);
3101 u16 interval; 3119 u16 interval;
3102 int ret; 3120 int ret;
3103 u8 i;
3104 3121
3105 if (ar->state != ATH6KL_STATE_ON) 3122 if (ar->state != ATH6KL_STATE_ON)
3106 return -EIO; 3123 return -EIO;
@@ -3110,11 +3127,10 @@ static int ath6kl_cfg80211_sscan_start(struct wiphy *wiphy,
3110 3127
3111 ath6kl_cfg80211_scan_complete_event(vif, true); 3128 ath6kl_cfg80211_scan_complete_event(vif, true);
3112 3129
3113 for (i = 0; i < ar->wiphy->max_sched_scan_ssids; i++) { 3130 ret = ath6kl_set_probed_ssids(ar, vif, request->ssids,
3114 ath6kl_wmi_probedssid_cmd(ar->wmi, vif->fw_vif_idx, 3131 request->n_ssids);
3115 i, DISABLE_SSID_FLAG, 3132 if (ret < 0)
3116 0, NULL); 3133 return ret;
3117 }
3118 3134
3119 /* fw uses seconds, also make sure that it's >0 */ 3135 /* fw uses seconds, also make sure that it's >0 */
3120 interval = max_t(u16, 1, request->interval / 1000); 3136 interval = max_t(u16, 1, request->interval / 1000);
@@ -3123,15 +3139,6 @@ static int ath6kl_cfg80211_sscan_start(struct wiphy *wiphy,
3123 interval, interval, 3139 interval, interval,
3124 vif->bg_scan_period, 0, 0, 0, 3, 0, 0, 0); 3140 vif->bg_scan_period, 0, 0, 0, 3, 0, 0, 0);
3125 3141
3126 if (request->n_ssids && request->ssids[0].ssid_len) {
3127 for (i = 0; i < request->n_ssids; i++) {
3128 ath6kl_wmi_probedssid_cmd(ar->wmi, vif->fw_vif_idx,
3129 i, SPECIFIC_SSID_FLAG,
3130 request->ssids[i].ssid_len,
3131 request->ssids[i].ssid);
3132 }
3133 }
3134
3135 ret = ath6kl_wmi_set_wow_mode_cmd(ar->wmi, vif->fw_vif_idx, 3142 ret = ath6kl_wmi_set_wow_mode_cmd(ar->wmi, vif->fw_vif_idx,
3136 ATH6KL_WOW_MODE_ENABLE, 3143 ATH6KL_WOW_MODE_ENABLE,
3137 WOW_FILTER_SSID, 3144 WOW_FILTER_SSID,
@@ -3449,7 +3456,7 @@ int ath6kl_cfg80211_init(struct ath6kl *ar)
3449 wiphy->wowlan.pattern_min_len = 1; 3456 wiphy->wowlan.pattern_min_len = 1;
3450 wiphy->wowlan.pattern_max_len = WOW_PATTERN_SIZE; 3457 wiphy->wowlan.pattern_max_len = WOW_PATTERN_SIZE;
3451 3458
3452 wiphy->max_sched_scan_ssids = 10; 3459 wiphy->max_sched_scan_ssids = MAX_PROBED_SSID_INDEX;
3453 3460
3454 ar->wiphy->flags |= WIPHY_FLAG_SUPPORTS_FW_ROAM | 3461 ar->wiphy->flags |= WIPHY_FLAG_SUPPORTS_FW_ROAM |
3455 WIPHY_FLAG_HAVE_AP_SME | 3462 WIPHY_FLAG_HAVE_AP_SME |