iwlwifi: mvm: remove cipher scheme support
authorJohannes Berg <johannes.berg@intel.com>
Fri, 4 Mar 2022 11:21:20 +0000 (13:21 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Thu, 10 Mar 2022 07:23:27 +0000 (09:23 +0200)
There are no shipping firmware versions with this, and there
will also not be in the future, so remove the support.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20220304131517.8b3c8b4adf41.Ib3ddb6b250ea2dd72b4ecc88bdd5cffb86af1dcc@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/file.h
drivers/net/wireless/intel/iwlwifi/fw/img.h
drivers/net/wireless/intel/iwlwifi/iwl-drv.c
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h

index fa2a73ae418320fb96fc471225a31cae240a3e54..35e4adb7006f515ff51eb0b10f8acf16e3efabc7 100644 (file)
@@ -518,34 +518,6 @@ enum iwl_fw_phy_cfg {
        FW_PHY_CFG_SHARED_CLK = BIT(31),
 };
 
-#define IWL_UCODE_MAX_CS               1
-
-/**
- * struct iwl_fw_cipher_scheme - a cipher scheme supported by FW.
- * @cipher: a cipher suite selector
- * @flags: cipher scheme flags (currently reserved for a future use)
- * @hdr_len: a size of MPDU security header
- * @pn_len: a size of PN
- * @pn_off: an offset of pn from the beginning of the security header
- * @key_idx_off: an offset of key index byte in the security header
- * @key_idx_mask: a bit mask of key_idx bits
- * @key_idx_shift: bit shift needed to get key_idx
- * @mic_len: mic length in bytes
- * @hw_cipher: a HW cipher index used in host commands
- */
-struct iwl_fw_cipher_scheme {
-       __le32 cipher;
-       u8 flags;
-       u8 hdr_len;
-       u8 pn_len;
-       u8 pn_off;
-       u8 key_idx_off;
-       u8 key_idx_mask;
-       u8 key_idx_shift;
-       u8 mic_len;
-       u8 hw_cipher;
-} __packed;
-
 enum iwl_fw_dbg_reg_operator {
        CSR_ASSIGN,
        CSR_SETBIT,
index 89869edb23e8b8936a4bd33efab03be348809f31..f878ac508801778d39c4582bd843369274dc51c3 100644 (file)
@@ -133,16 +133,6 @@ struct iwl_fw_paging {
        u32 fw_offs;
 };
 
-/**
- * struct iwl_fw_cscheme_list - a cipher scheme list
- * @size: a number of entries
- * @cs: cipher scheme entries
- */
-struct iwl_fw_cscheme_list {
-       u8 size;
-       struct iwl_fw_cipher_scheme cs[];
-} __packed;
-
 /**
  * enum iwl_fw_type - iwlwifi firmware type
  * @IWL_FW_DVM: DVM firmware
@@ -197,7 +187,6 @@ struct iwl_dump_exclude {
  * @inst_evtlog_size: event log size for runtime ucode.
  * @inst_errlog_ptr: error log offfset for runtime ucode.
  * @type: firmware type (&enum iwl_fw_type)
- * @cipher_scheme: optional external cipher scheme.
  * @human_readable: human readable version
  *     we get the ALIVE from the uCode
  * @phy_integration_ver: PHY integration version string
@@ -228,7 +217,6 @@ struct iwl_fw {
 
        enum iwl_fw_type type;
 
-       struct iwl_fw_cipher_scheme cs[IWL_UCODE_MAX_CS];
        u8 human_readable[FW_VER_HUMAN_READABLE_SZ];
 
        struct iwl_fw_dbg dbg;
index f92bcab5fdf6da7dfdbb4ce33d16b5957f146e39..8bb4f54d9b38735a9454e61fa3646890ebd1b1c1 100644 (file)
@@ -324,30 +324,6 @@ static void set_sec_offset(struct iwl_firmware_pieces *pieces,
        pieces->img[type].sec[sec].offset = offset;
 }
 
-static int iwl_store_cscheme(struct iwl_fw *fw, const u8 *data, const u32 len)
-{
-       int i, j;
-       const struct iwl_fw_cscheme_list *l =
-               (const struct iwl_fw_cscheme_list *)data;
-       const struct iwl_fw_cipher_scheme *fwcs;
-
-       if (len < sizeof(*l) ||
-           len < sizeof(l->size) + l->size * sizeof(l->cs[0]))
-               return -EINVAL;
-
-       for (i = 0, j = 0; i < IWL_UCODE_MAX_CS && i < l->size; i++) {
-               fwcs = &l->cs[j];
-
-               /* we skip schemes with zero cipher suite selector */
-               if (!fwcs->cipher)
-                       continue;
-
-               fw->cs[j++] = *fwcs;
-       }
-
-       return 0;
-}
-
 /*
  * Gets uCode section from tlv.
  */
@@ -926,10 +902,6 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,
                                return -EINVAL;
                        }
                        break;
-               case IWL_UCODE_TLV_CSCHEME:
-                       if (iwl_store_cscheme(&drv->fw, tlv_data, tlv_len))
-                               goto invalid_tlv_len;
-                       break;
                case IWL_UCODE_TLV_N_SCAN_CHANNELS:
                        if (tlv_len != sizeof(u32))
                                goto invalid_tlv_len;
index 2ce09e58e74cfe9b7537d26f6de85dde09ee4764..81d02a17dfe40e8fe6ff7980c0f45a57119d7661 100644 (file)
@@ -448,28 +448,6 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
                hw->wiphy->n_cipher_suites++;
        }
 
-       /* 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;
-
-               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++;
-       }
-
        if (fw_has_capa(&mvm->fw->ucode_capa,
                        IWL_UCODE_TLV_CAPA_FTM_CALIBRATED)) {
                wiphy_ext_feature_set(hw->wiphy,
@@ -3744,12 +3722,7 @@ static int __iwl_mvm_mac_set_key(struct ieee80211_hw *hw,
                /* support HW crypto on TX */
                return 0;
        default:
-               /* currently FW supports only one optional cipher scheme */
-               if (hw->n_cipher_schemes &&
-                   hw->cipher_schemes->cipher == key->cipher)
-                       key->flags |= IEEE80211_KEY_FLAG_PUT_IV_SPACE;
-               else
-                       return -EOPNOTSUPP;
+               return -EOPNOTSUPP;
        }
 
        switch (cmd) {
index ecfe322ebef2bdba42d8fa5c126a914427875c5c..7c6802f92ef729bf59bb410270c87e3d949430ae 100644 (file)
@@ -1075,7 +1075,6 @@ struct iwl_mvm {
 
 
        u32 ciphers[IWL_MVM_NUM_CIPHERS];
-       struct ieee80211_cipher_scheme cs[IWL_UCODE_MAX_CS];
 
        struct cfg80211_ftm_responder_stats ftm_resp_stats;
        struct {