]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
iwlwifi: store cipher scheme independent of mac80211
[karo-tx-linux.git] / drivers / net / wireless / intel / iwlwifi / mvm / mac80211.c
index e44c337e604e2272f534665f24d9d681bc8b3fd2..73e49d3a88144b10a8bcec670f448d5b6aee2ac9 100644 (file)
@@ -494,10 +494,23 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
 
        /* currently FW API supports only one optional cipher scheme */
        if (mvm->fw->cs[0].cipher) {
+               const struct iwl_fw_cipher_scheme *fwcs = &mvm->fw->cs[0];
+               struct ieee80211_cipher_scheme *cs = &mvm->cs[0];
+
                mvm->hw->n_cipher_schemes = 1;
-               mvm->hw->cipher_schemes = &mvm->fw->cs[0];
-               mvm->ciphers[hw->wiphy->n_cipher_suites] =
-                       mvm->fw->cs[0].cipher;
+
+               cs->cipher = le32_to_cpu(fwcs->cipher);
+               cs->iftype = BIT(NL80211_IFTYPE_STATION);
+               cs->hdr_len = fwcs->hdr_len;
+               cs->pn_len = fwcs->pn_len;
+               cs->pn_off = fwcs->pn_off;
+               cs->key_idx_off = fwcs->key_idx_off;
+               cs->key_idx_mask = fwcs->key_idx_mask;
+               cs->key_idx_shift = fwcs->key_idx_shift;
+               cs->mic_len = fwcs->mic_len;
+
+               mvm->hw->cipher_schemes = mvm->cs;
+               mvm->ciphers[hw->wiphy->n_cipher_suites] = cs->cipher;
                hw->wiphy->n_cipher_suites++;
        }