Commit 1c97c73c authored by Miri Korenblit's avatar Miri Korenblit
Browse files

wifi: iwlwifi: use normal versioning convention for iwl_tx_cmd



We have iwl_tx_cmd for devices older than 22000, iwl_tx_cmd_gen2 for
22000 devices, and iwl_tx_cmd_gen3 ax210 and up.

But the convention for all other APIs is to have the latest version
without any prefix and the older ones - with a _vX prefix,
where X is the highest version that this struct support.

The  term 'gen' was introduced as the name of the (back then) new
transport, and should not be used as a device name (for that we have the
actual names: 22000, ax210, etc.)

Now as a new transport, called 'gen3', is going to be written and it can
be confused with this API.

Move iwl_tx_cmd to use the regular versioning convention.

Reviewed-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250511195137.806e40c8f767.Ibc0e95e43a6fa6d47f72823bf804314d5db84618@changeid
parent 579724de
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
/*
 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
 * Copyright (C) 2016-2017 Intel Deutschland GmbH
 * Copyright (C) 2018-2022, 2024 Intel Corporation
 * Copyright (C) 2018-2022, 2024-2025 Intel Corporation
 */
#ifndef __iwl_fw_api_commands_h__
#define __iwl_fw_api_commands_h__
@@ -145,8 +145,8 @@ enum iwl_legacy_cmds {
	REMOVE_STA = 0x19,

	/**
	 * @TX_CMD: uses &struct iwl_tx_cmd or &struct iwl_tx_cmd_gen2 or
	 *	&struct iwl_tx_cmd_gen3,
	 * @TX_CMD: uses &struct iwl_tx_cmd_v6 or &struct iwl_tx_cmd_v9 or
	 *	&struct iwl_tx_cmd,
	 *	response in &struct iwl_tx_resp or
	 *	&struct iwl_tx_resp_v3
	 */
+3 −3
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
 * Copyright (C) 2012-2014, 2018, 2024 Intel Corporation
 * Copyright (C) 2012-2014, 2018, 2024-2025 Intel Corporation
 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
 * Copyright (C) 2016-2017 Intel Deutschland GmbH
 */
@@ -50,7 +50,7 @@ struct iwl_tdls_channel_switch_timing {
 */
struct iwl_tdls_channel_switch_frame {
	__le32 switch_time_offset;
	struct iwl_tx_cmd tx_cmd;
	struct iwl_tx_cmd_v6 tx_cmd;
	u8 data[IWL_TDLS_CH_SW_FRAME_MAX_SIZE];
} __packed; /* TDLS_STA_CHANNEL_SWITCH_FRAME_API_S_VER_1 */

@@ -131,7 +131,7 @@ struct iwl_tdls_config_cmd {
	struct iwl_tdls_sta_info sta_info[IWL_TDLS_STA_COUNT];

	__le32 pti_req_data_offset;
	struct iwl_tx_cmd pti_req_tx_cmd;
	struct iwl_tx_cmd_v6 pti_req_tx_cmd;
	u8 pti_req_template[];
} __packed; /* TDLS_CONFIG_CMD_API_S_VER_1 */

+9 −9
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ enum iwl_tx_cmd_sec_ctrl {
#define IWL_LOW_RETRY_LIMIT			7

/**
 * enum iwl_tx_offload_assist_flags_pos -  set %iwl_tx_cmd offload_assist values
 * enum iwl_tx_offload_assist_flags_pos -  set %iwl_tx_cmd_v6 offload_assist values
 * @TX_CMD_OFFLD_IP_HDR: offset to start of IP header (in words)
 *	from mac header end. For normal case it is 4 words for SNAP.
 *	note: tx_cmd, mac header and pad are not counted in the offset.
@@ -181,7 +181,7 @@ enum iwl_tx_offload_assist_flags_pos {

/* TODO: complete documentation for try_cnt and btkill_cnt */
/**
 * struct iwl_tx_cmd - TX command struct to FW
 * struct iwl_tx_cmd_v6 - TX command struct to FW
 * ( TX_CMD = 0x1c )
 * @len: in bytes of the payload, see below for details
 * @offload_assist: TX offload configuration
@@ -221,7 +221,7 @@ enum iwl_tx_offload_assist_flags_pos {
 * After the struct fields the MAC header is placed, plus any padding,
 * and then the actial payload.
 */
struct iwl_tx_cmd {
struct iwl_tx_cmd_v6 {
	__le16 len;
	__le16 offload_assist;
	__le32 tx_flags;
@@ -258,7 +258,7 @@ struct iwl_dram_sec_info {
} __packed; /* DRAM_SEC_INFO_API_S_VER_1 */

/**
 * struct iwl_tx_cmd_gen2 - TX command struct to FW for 22000 devices
 * struct iwl_tx_cmd_v9 - TX command struct to FW for 22000 devices
 * ( TX_CMD = 0x1c )
 * @len: in bytes of the payload, see below for details
 * @offload_assist: TX offload configuration
@@ -268,7 +268,7 @@ struct iwl_dram_sec_info {
 *	cleared. Combination of RATE_MCS_*
 * @hdr: 802.11 header
 */
struct iwl_tx_cmd_gen2 {
struct iwl_tx_cmd_v9 {
	__le16 len;
	__le16 offload_assist;
	__le32 flags;
@@ -279,7 +279,7 @@ struct iwl_tx_cmd_gen2 {
	       TX_CMD_API_S_VER_9 */

/**
 * struct iwl_tx_cmd_gen3 - TX command struct to FW for AX210+ devices
 * struct iwl_tx_cmd - TX command struct to FW for AX210+ devices
 * ( TX_CMD = 0x1c )
 * @len: in bytes of the payload, see below for details
 * @flags: combination of &enum iwl_tx_cmd_flags
@@ -290,7 +290,7 @@ struct iwl_tx_cmd_gen2 {
 * @reserved: reserved
 * @hdr: 802.11 header
 */
struct iwl_tx_cmd_gen3 {
struct iwl_tx_cmd {
	__le16 len;
	__le16 flags;
	__le32 offload_assist;
@@ -748,7 +748,7 @@ struct iwl_compressed_ba_notif {
 * @frame: the template of the beacon frame
 */
struct iwl_mac_beacon_cmd_v6 {
	struct iwl_tx_cmd tx;
	struct iwl_tx_cmd_v6 tx;
	__le32 template_id;
	__le32 tim_idx;
	__le32 tim_size;
@@ -767,7 +767,7 @@ struct iwl_mac_beacon_cmd_v6 {
 * @frame: the template of the beacon frame
 */
struct iwl_mac_beacon_cmd_v7 {
	struct iwl_tx_cmd tx;
	struct iwl_tx_cmd_v6 tx;
	__le32 template_id;
	__le32 tim_idx;
	__le32 tim_size;
+3 −3
Original line number Diff line number Diff line
@@ -287,13 +287,13 @@ int iwl_trans_init(struct iwl_trans *trans)
		return -EINVAL;

	if (!trans->mac_cfg->gen2) {
		txcmd_size = sizeof(struct iwl_tx_cmd);
		txcmd_size = sizeof(struct iwl_tx_cmd_v6);
		txcmd_align = sizeof(void *);
	} else if (trans->mac_cfg->device_family < IWL_DEVICE_FAMILY_AX210) {
		txcmd_size = sizeof(struct iwl_tx_cmd_gen2);
		txcmd_size = sizeof(struct iwl_tx_cmd_v9);
		txcmd_align = 64;
	} else {
		txcmd_size = sizeof(struct iwl_tx_cmd_gen3);
		txcmd_size = sizeof(struct iwl_tx_cmd);
		txcmd_align = 128;
	}

+2 −2
Original line number Diff line number Diff line
@@ -488,7 +488,7 @@ static __le32 iwl_mld_get_tx_rate_n_flags(struct iwl_mld *mld,
}

static void
iwl_mld_fill_tx_cmd_hdr(struct iwl_tx_cmd_gen3 *tx_cmd,
iwl_mld_fill_tx_cmd_hdr(struct iwl_tx_cmd *tx_cmd,
			struct sk_buff *skb, bool amsdu)
{
	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
@@ -534,7 +534,7 @@ iwl_mld_fill_tx_cmd(struct iwl_mld *mld, struct sk_buff *skb,
	struct ieee80211_hdr *hdr = (void *)skb->data;
	struct iwl_mld_sta *mld_sta = sta ? iwl_mld_sta_from_mac80211(sta) :
					    NULL;
	struct iwl_tx_cmd_gen3 *tx_cmd;
	struct iwl_tx_cmd *tx_cmd;
	bool amsdu = ieee80211_is_data_qos(hdr->frame_control) &&
		     (*ieee80211_get_qos_ctl(hdr) &
		      IEEE80211_QOS_CTL_A_MSDU_PRESENT);
Loading