]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: iwlwifi: mld: drop TLC config cmd v4/v5 compat code
authorShahar Tzarfati <shahar.tzarfati@intel.com>
Sun, 31 May 2026 10:53:06 +0000 (13:53 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 3 Jun 2026 14:02:55 +0000 (17:02 +0300)
FW core102 bumped TLC_MNG_CONFIG_CMD_API_S from version 5 to
version 6. The v4 and v5 compatibility paths in
iwl_mld_send_tlc_cmd() are no longer reachable on any supported
firmware.

Signed-off-by: Shahar Tzarfati <shahar.tzarfati@intel.com>
Link: https://patch.msgid.link/20260531135036.c0e2dbfd0569.I44f8eb4d985bb9590b65b77e9a3dd157e4bd5e79@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h
drivers/net/wireless/intel/iwlwifi/fw/api/rs.h
drivers/net/wireless/intel/iwlwifi/mld/tlc.c

index e494e5b18d2258e98fd5c0f92e80ade40278db63..c8eb016e1a7ee7a1d5b5d61a97cf1c5c7117bd51 100644 (file)
@@ -57,7 +57,7 @@ enum iwl_data_path_subcmd_ids {
 
        /**
         * @TLC_MNG_CONFIG_CMD: &struct iwl_tlc_config_cmd_v4 or
-        *      &struct iwl_tlc_config_cmd_v5 or &struct iwl_tlc_config_cmd.
+        *      &struct iwl_tlc_config_cmd.
         */
        TLC_MNG_CONFIG_CMD = 0xF,
 
index f90e743caa7e097b16f827256038d65569793e2a..f1254546cc9d3033f21c728cd8e5b100001a38ac 100644 (file)
@@ -206,37 +206,6 @@ struct iwl_tlc_config_cmd_v4 {
        __le16 max_tx_op;
 } __packed; /* TLC_MNG_CONFIG_CMD_API_S_VER_4 */
 
-/**
- * struct iwl_tlc_config_cmd_v5 - TLC configuration
- * @sta_id: station id
- * @reserved1: reserved
- * @max_ch_width: max supported channel width from &enum iwl_tlc_mng_cfg_cw
- * @mode: &enum iwl_tlc_mng_cfg_mode
- * @chains: bitmask of &enum iwl_tlc_mng_cfg_chains
- * @sgi_ch_width_supp: bitmap of SGI support per channel width
- *                    use BIT(&enum iwl_tlc_mng_cfg_cw)
- * @flags: bitmask of &enum iwl_tlc_mng_cfg_flags
- * @non_ht_rates: bitmap of supported legacy rates
- * @ht_rates: bitmap of &enum iwl_tlc_mng_ht_rates, per <nss, channel-width>
- *           pair (0 - 80mhz width and below, 1 - 160mhz, 2 - 320mhz).
- * @max_mpdu_len: max MPDU length, in bytes
- * @max_tx_op: max TXOP in uSecs for all AC (BK, BE, VO, VI),
- *            set zero for no limit.
- */
-struct iwl_tlc_config_cmd_v5 {
-       u8 sta_id;
-       u8 reserved1[3];
-       u8 max_ch_width;
-       u8 mode;
-       u8 chains;
-       u8 sgi_ch_width_supp;
-       __le16 flags;
-       __le16 non_ht_rates;
-       __le32 ht_rates[IWL_TLC_NSS_MAX][IWL_TLC_MCS_PER_BW_NUM_V4];
-       __le16 max_mpdu_len;
-       __le16 max_tx_op;
-} __packed; /* TLC_MNG_CONFIG_CMD_API_S_VER_5 */
-
 /**
  * struct iwl_tlc_config_cmd - TLC configuration
  * @sta_mask: station mask (in NAN we can have multiple logical stations of
index edf9c735dd67276a291c5e308d6b1961ba7ddb8a..b6c2fa3664cbc929b53ec157dd4b740a79f633f0 100644 (file)
@@ -467,65 +467,6 @@ iwl_mld_fill_supp_rates(struct iwl_mld *mld,
        }
 }
 
-static int iwl_mld_convert_tlc_cmd_to_v5(struct iwl_tlc_config_cmd *cmd,
-                                        struct iwl_tlc_config_cmd_v5 *cmd_v5)
-{
-       if (WARN_ON_ONCE(hweight32(le32_to_cpu(cmd->sta_mask)) != 1))
-               return -EINVAL;
-
-       /* Convert sta_mask to sta_id */
-       cmd_v5->sta_id = __ffs(le32_to_cpu(cmd->sta_mask));
-
-       /* Copy all the rest */
-       cmd_v5->max_ch_width = cmd->max_ch_width;
-       cmd_v5->mode = cmd->mode;
-       cmd_v5->chains = cmd->chains;
-       cmd_v5->sgi_ch_width_supp = cmd->sgi_ch_width_supp;
-       cmd_v5->flags = cmd->flags;
-       cmd_v5->non_ht_rates = cmd->non_ht_rates;
-
-       BUILD_BUG_ON(sizeof(cmd_v5->ht_rates) != sizeof(cmd->ht_rates));
-       memcpy(cmd_v5->ht_rates, cmd->ht_rates, sizeof(cmd->ht_rates));
-
-       cmd_v5->max_mpdu_len = cmd->max_mpdu_len;
-       cmd_v5->max_tx_op = cmd->max_tx_op;
-
-       return 0;
-}
-
-static int iwl_mld_convert_tlc_cmd_to_v4(struct iwl_tlc_config_cmd *cmd,
-                                        struct iwl_tlc_config_cmd_v4 *cmd_v4)
-{
-       if (WARN_ON_ONCE(hweight32(le32_to_cpu(cmd->sta_mask)) != 1))
-               return -EINVAL;
-
-       /* Convert sta_mask to sta_id */
-       cmd_v4->sta_id = __ffs(le32_to_cpu(cmd->sta_mask));
-
-       /* Copy everything until ht_rates */
-       cmd_v4->max_ch_width = cmd->max_ch_width;
-       cmd_v4->mode = cmd->mode;
-       cmd_v4->chains = cmd->chains;
-       cmd_v4->sgi_ch_width_supp = cmd->sgi_ch_width_supp;
-       cmd_v4->flags = cmd->flags;
-       cmd_v4->non_ht_rates = cmd->non_ht_rates;
-
-       /* Convert ht_rates from __le32 to __le16 */
-       BUILD_BUG_ON(ARRAY_SIZE(cmd_v4->ht_rates) != ARRAY_SIZE(cmd->ht_rates));
-       BUILD_BUG_ON(ARRAY_SIZE(cmd_v4->ht_rates[0]) != ARRAY_SIZE(cmd->ht_rates[0]));
-
-       for (int nss = 0; nss < ARRAY_SIZE(cmd->ht_rates); nss++)
-               for (int bw = 0; bw < ARRAY_SIZE(cmd->ht_rates[nss]); bw++)
-                       cmd_v4->ht_rates[nss][bw] =
-                               cpu_to_le16(le32_to_cpu(cmd->ht_rates[nss][bw]));
-
-       /* Copy the rest */
-       cmd_v4->max_mpdu_len = cmd->max_mpdu_len;
-       cmd_v4->max_tx_op = cmd->max_tx_op;
-
-       return 0;
-}
-
 static void iwl_mld_send_tlc_cmd(struct iwl_mld *mld,
                                 struct ieee80211_vif *vif,
                                 struct iwl_mld_sta *mld_sta,
@@ -544,8 +485,6 @@ static void iwl_mld_send_tlc_cmd(struct iwl_mld *mld,
        };
        u32 cmd_id = WIDE_ID(DATA_PATH_GROUP, TLC_MNG_CONFIG_CMD);
        u8 cmd_ver = iwl_fw_lookup_cmd_ver(mld->fw, cmd_id, 0);
-       struct iwl_tlc_config_cmd_v5 cmd_v5 = {};
-       struct iwl_tlc_config_cmd_v4 cmd_v4 = {};
        void *cmd_ptr;
        u8 cmd_size;
        int ret;
@@ -558,19 +497,6 @@ static void iwl_mld_send_tlc_cmd(struct iwl_mld *mld,
        if (cmd_ver == 6) {
                cmd_ptr = &cmd;
                cmd_size = sizeof(cmd);
-       } else if (cmd_ver == 5) {
-               /* TODO: remove support once FW moves to version 6 */
-               ret = iwl_mld_convert_tlc_cmd_to_v5(&cmd, &cmd_v5);
-               if (ret)
-                       return;
-               cmd_ptr = &cmd_v5;
-               cmd_size = sizeof(cmd_v5);
-       } else if (cmd_ver == 4) {
-               ret = iwl_mld_convert_tlc_cmd_to_v4(&cmd, &cmd_v4);
-               if (ret)
-                       return;
-               cmd_ptr = &cmd_v4;
-               cmd_size = sizeof(cmd_v4);
        } else {
                IWL_ERR(mld, "Unsupported TLC config cmd version %d\n",
                        cmd_ver);