]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ath6kl: add aborted parameter to ath6kl_cfg80211_scan_complete_event()
authorKalle Valo <kvalo@qca.qualcomm.com>
Tue, 1 Nov 2011 06:43:56 +0000 (08:43 +0200)
committerKalle Valo <kvalo@qca.qualcomm.com>
Fri, 11 Nov 2011 10:58:59 +0000 (12:58 +0200)
Currently it takes an error code as status, but what we really want to
tell is if the scan was aborted or not.

Also fix a bug where we were comparing firmware scan status values
with kernel error codes, which is obviously wrong. This meant
that ath6kl didn't detect when firmware informed about failed scans. I
doubt that this fix doesn't make any difference in practise but it
still needs to be fixed. This is fixed by adding an enum for the success
status code and checking for that.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath6kl/cfg80211.c
drivers/net/wireless/ath/ath6kl/cfg80211.h
drivers/net/wireless/ath/ath6kl/main.c
drivers/net/wireless/ath/ath6kl/wmi.h

index 01bb9ede471b3e8a88d01cad08108e5eb5bd2be3..e7203cf17542a534b0c4675745b82907edc547b0 100644 (file)
@@ -871,23 +871,19 @@ static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
        return ret;
 }
 
-void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, int status)
+void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, bool aborted)
 {
        struct ath6kl *ar = vif->ar;
-       bool aborted;
        int i;
 
-       ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: status %d\n", __func__, status);
+       ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: status%s\n", __func__,
+                  aborted ? " aborted" : "");
 
        if (!vif->scan_req)
                return;
 
-       if ((status == -ECANCELED) || (status == -EBUSY)) {
-               aborted = true;
+       if (aborted)
                goto out;
-       }
-
-       aborted = false;
 
        if (vif->scan_req->n_ssids && vif->scan_req->ssids[0].ssid_len) {
                for (i = 0; i < vif->scan_req->n_ssids; i++) {
index d1a0216d7cf9725cdac7327435421bde567f0ff4..f323a49fdde320ea1bde2de4ce15863d68b8215a 100644 (file)
@@ -24,7 +24,7 @@ int ath6kl_register_ieee80211_hw(struct ath6kl *ar);
 struct ath6kl *ath6kl_core_alloc(struct device *dev);
 void ath6kl_deinit_ieee80211_hw(struct ath6kl *ar);
 
-void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, int status);
+void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, bool aborted);
 
 void ath6kl_cfg80211_connect_event(struct ath6kl_vif *vif, u16 channel,
                                   u8 *bssid, u16 listen_intvl,
index def0b7f29c37d6807ecaf2466f515befda538927..d2822d0854eb0d5d48f2271239271ed584ec8dfc 100644 (file)
@@ -624,7 +624,7 @@ void ath6kl_deep_sleep_enable(struct ath6kl *ar)
                printk(KERN_WARNING "ath6kl: failed to disable scan "
                       "during suspend\n");
 
-       ath6kl_cfg80211_scan_complete_event(vif, -ECANCELED);
+       ath6kl_cfg80211_scan_complete_event(vif, true);
 
        /* save the current power mode before enabling power save */
        ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode;
@@ -684,8 +684,12 @@ void ath6kl_ready_event(void *devt, u8 *datap, u32 sw_ver, u32 abi_ver)
 void ath6kl_scan_complete_evt(struct ath6kl_vif *vif, int status)
 {
        struct ath6kl *ar = vif->ar;
+       bool aborted = false;
 
-       ath6kl_cfg80211_scan_complete_event(vif, status);
+       if (status != WMI_SCAN_STATUS_SUCCESS)
+               aborted = true;
+
+       ath6kl_cfg80211_scan_complete_event(vif, aborted);
 
        if (!ar->usr_bss_filter) {
                clear_bit(CLEAR_BSSFILTER_ON_BEACON, &vif->flags);
@@ -1149,7 +1153,7 @@ static int ath6kl_close(struct net_device *dev)
 
        }
 
-       ath6kl_cfg80211_scan_complete_event(vif, -ECANCELED);
+       ath6kl_cfg80211_scan_complete_event(vif, true);
 
        /* FIXME: how to handle multi vif support? */
        ret = ath6kl_init_hw_stop(ar);
index ae514cb7159d81e1d11a17597664725d8a0446a0..cf0462a490ae00162a16f62aaa7831c8b4eece9c 100644 (file)
@@ -1472,6 +1472,10 @@ struct wmi_tkip_micerr_event {
        u8 is_mcast;
 } __packed;
 
+enum wmi_scan_status {
+       WMI_SCAN_STATUS_SUCCESS = 0,
+};
+
 /* WMI_SCAN_COMPLETE_EVENTID */
 struct wmi_scan_complete_event {
        a_sle32 status;