ath6kl: Fix key configuration to copy at most seq_len from seq
[deliverable/linux.git] / drivers / net / wireless / ath / ath6kl / main.c
index 3b2a7e8a24b9cea3674cb398e59695131354ad99..5e5f4ca8f3f079488391bf902897991e3ba3e03d 100644 (file)
@@ -442,7 +442,7 @@ static void ath6kl_install_static_wep_keys(struct ath6kl_vif *vif)
                                              WEP_CRYPT,
                                              keyusage,
                                              vif->wep_key_list[index].key_len,
-                                             NULL,
+                                             NULL, 0,
                                              vif->wep_key_list[index].key,
                                              KEY_OP_INIT_VAL, NULL,
                                              NO_SYNC_WMIFLAG);
@@ -477,7 +477,8 @@ void ath6kl_connect_ap_mode_bss(struct ath6kl_vif *vif, u16 channel)
                memset(key_rsc, 0, sizeof(key_rsc));
                res = ath6kl_wmi_addkey_cmd(
                        ar->wmi, vif->fw_vif_idx, ik->key_index, ik->key_type,
-                       GROUP_USAGE, ik->key_len, key_rsc, ik->key,
+                       GROUP_USAGE, ik->key_len, key_rsc, ATH6KL_KEY_SEQ_LEN,
+                       ik->key,
                        KEY_OP_INIT_VAL, NULL, SYNC_BOTH_WMIFLAG);
                if (res) {
                        ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "Delayed "
@@ -578,62 +579,6 @@ void ath6kl_disconnect(struct ath6kl_vif *vif)
        }
 }
 
-void ath6kl_deep_sleep_enable(struct ath6kl *ar)
-{
-       struct ath6kl_vif *vif;
-
-       /* FIXME: for multi vif */
-       vif = ath6kl_vif_first(ar);
-       if (!vif) {
-               /* save the current power mode before enabling power save */
-               ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode;
-
-               if (ath6kl_wmi_powermode_cmd(ar->wmi, 0, REC_POWER) != 0)
-                       ath6kl_warn("ath6kl_deep_sleep_enable: "
-                                   "wmi_powermode_cmd failed\n");
-               return;
-       }
-
-       switch (vif->sme_state) {
-       case SME_CONNECTING:
-               cfg80211_connect_result(vif->ndev, vif->bssid, NULL, 0,
-                                       NULL, 0,
-                                       WLAN_STATUS_UNSPECIFIED_FAILURE,
-                                       GFP_KERNEL);
-               break;
-       case SME_CONNECTED:
-       default:
-               /*
-                * FIXME: oddly enough smeState is in DISCONNECTED during
-                * suspend, why? Need to send disconnected event in that
-                * state.
-                */
-               cfg80211_disconnected(vif->ndev, 0, NULL, 0, GFP_KERNEL);
-               break;
-       }
-
-       if (test_bit(CONNECTED, &vif->flags) ||
-           test_bit(CONNECT_PEND, &vif->flags))
-               ath6kl_wmi_disconnect_cmd(ar->wmi, vif->fw_vif_idx);
-
-       vif->sme_state = SME_DISCONNECTED;
-
-       /* disable scanning */
-       if (ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx, 0xFFFF, 0, 0,
-                                     0, 0, 0, 0, 0, 0, 0) != 0)
-               printk(KERN_WARNING "ath6kl: failed to disable scan "
-                      "during suspend\n");
-
-       ath6kl_cfg80211_scan_complete_event(vif, -ECANCELED);
-
-       /* save the current power mode before enabling power save */
-       ar->wmi->saved_pwr_mode = ar->wmi->pwr_mode;
-
-       if (ath6kl_wmi_powermode_cmd(ar->wmi, 0, REC_POWER) != 0)
-               ath6kl_warn("ath6kl_deep_sleep_enable: "
-                       "wmi_powermode_cmd failed\n");
-}
-
 /* WMI Event handlers */
 
 static const char *get_hw_id_string(u32 id)
@@ -673,17 +618,23 @@ void ath6kl_ready_event(void *devt, u8 *datap, u32 sw_ver, u32 abi_ver)
        set_bit(WMI_READY, &ar->flag);
        wake_up(&ar->event_wq);
 
-       ath6kl_info("hw %s fw %s%s\n",
-                   get_hw_id_string(ar->wiphy->hw_version),
-                   ar->wiphy->fw_version,
-                   test_bit(TESTMODE, &ar->flag) ? " testmode" : "");
+       if (test_and_clear_bit(FIRST_BOOT, &ar->flag)) {
+               ath6kl_info("hw %s fw %s%s\n",
+                           get_hw_id_string(ar->wiphy->hw_version),
+                           ar->wiphy->fw_version,
+                           test_bit(TESTMODE, &ar->flag) ? " testmode" : "");
+       }
 }
 
 void ath6kl_scan_complete_evt(struct ath6kl_vif *vif, int status)
 {
        struct ath6kl *ar = vif->ar;
+       bool aborted = false;
+
+       if (status != WMI_SCAN_STATUS_SUCCESS)
+               aborted = true;
 
-       ath6kl_cfg80211_scan_complete_event(vif, status);
+       ath6kl_cfg80211_scan_complete_event(vif, aborted);
 
        if (!ar->usr_bss_filter) {
                clear_bit(CLEAR_BSSFILTER_ON_BEACON, &vif->flags);
@@ -1096,15 +1047,15 @@ struct ath6kl_vif *ath6kl_vif_first(struct ath6kl *ar)
 {
        struct ath6kl_vif *vif;
 
-       spin_lock(&ar->list_lock);
+       spin_lock_bh(&ar->list_lock);
        if (list_empty(&ar->vif_list)) {
-               spin_unlock(&ar->list_lock);
+               spin_unlock_bh(&ar->list_lock);
                return NULL;
        }
 
        vif = list_first_entry(&ar->vif_list, struct ath6kl_vif, list);
 
-       spin_unlock(&ar->list_lock);
+       spin_unlock_bh(&ar->list_lock);
 
        return vif;
 }
@@ -1138,10 +1089,11 @@ static int ath6kl_close(struct net_device *dev)
                                              0, 0, 0, 0, 0, 0, 0, 0, 0))
                        return -EIO;
 
-               clear_bit(WLAN_ENABLED, &vif->flags);
        }
 
-       ath6kl_cfg80211_scan_complete_event(vif, -ECANCELED);
+       ath6kl_cfg80211_scan_complete_event(vif, true);
+
+       clear_bit(WLAN_ENABLED, &vif->flags);
 
        return 0;
 }
This page took 0.028876 seconds and 5 git commands to generate.