xref: /openbmc/linux/drivers/net/wireless/intel/iwlwifi/fw/api/txq.h (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
18e99ea8dSJohannes Berg /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
28e99ea8dSJohannes Berg /*
3*d5399f11SMordechay Goodstein  * Copyright (C) 2005-2014, 2019-2021 Intel Corporation
48e99ea8dSJohannes Berg  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
58e99ea8dSJohannes Berg  * Copyright (C) 2016-2017 Intel Deutschland GmbH
68e99ea8dSJohannes Berg  */
7d172a5efSJohannes Berg #ifndef __iwl_fw_api_txq_h__
8d172a5efSJohannes Berg #define __iwl_fw_api_txq_h__
9d172a5efSJohannes Berg 
10d172a5efSJohannes Berg /*
11d172a5efSJohannes Berg  * DQA queue numbers
12d172a5efSJohannes Berg  *
13d172a5efSJohannes Berg  * @IWL_MVM_DQA_CMD_QUEUE: a queue reserved for sending HCMDs to the FW
14d172a5efSJohannes Berg  * @IWL_MVM_DQA_AUX_QUEUE: a queue reserved for aux frames
15d172a5efSJohannes Berg  * @IWL_MVM_DQA_P2P_DEVICE_QUEUE: a queue reserved for P2P device frames
16b13f43a4SEmmanuel Grumbach  * @IWL_MVM_DQA_INJECT_MONITOR_QUEUE: a queue reserved for injection using
17b13f43a4SEmmanuel Grumbach  *	monitor mode. Note this queue is the same as the queue for P2P device
18b13f43a4SEmmanuel Grumbach  *	but we can't have active monitor mode along with P2P device anyway.
19d172a5efSJohannes Berg  * @IWL_MVM_DQA_GCAST_QUEUE: a queue reserved for P2P GO/SoftAP GCAST frames
20d172a5efSJohannes Berg  * @IWL_MVM_DQA_BSS_CLIENT_QUEUE: a queue reserved for BSS activity, to ensure
21d172a5efSJohannes Berg  *	that we are never left without the possibility to connect to an AP.
22d172a5efSJohannes Berg  * @IWL_MVM_DQA_MIN_MGMT_QUEUE: first TXQ in pool for MGMT and non-QOS frames.
23d172a5efSJohannes Berg  *	Each MGMT queue is mapped to a single STA
24d172a5efSJohannes Berg  *	MGMT frames are frames that return true on ieee80211_is_mgmt()
25d172a5efSJohannes Berg  * @IWL_MVM_DQA_MAX_MGMT_QUEUE: last TXQ in pool for MGMT frames
26d172a5efSJohannes Berg  * @IWL_MVM_DQA_AP_PROBE_RESP_QUEUE: a queue reserved for P2P GO/SoftAP probe
27d172a5efSJohannes Berg  *	responses
28d172a5efSJohannes Berg  * @IWL_MVM_DQA_MIN_DATA_QUEUE: first TXQ in pool for DATA frames.
29d172a5efSJohannes Berg  *	DATA frames are intended for !ieee80211_is_mgmt() frames, but if
30d172a5efSJohannes Berg  *	the MGMT TXQ pool is exhausted, mgmt frames can be sent on DATA queues
31d172a5efSJohannes Berg  *	as well
32d172a5efSJohannes Berg  * @IWL_MVM_DQA_MAX_DATA_QUEUE: last TXQ in pool for DATA frames
33d172a5efSJohannes Berg  */
34d172a5efSJohannes Berg enum iwl_mvm_dqa_txq {
35d172a5efSJohannes Berg 	IWL_MVM_DQA_CMD_QUEUE = 0,
36d172a5efSJohannes Berg 	IWL_MVM_DQA_AUX_QUEUE = 1,
37d172a5efSJohannes Berg 	IWL_MVM_DQA_P2P_DEVICE_QUEUE = 2,
38b13f43a4SEmmanuel Grumbach 	IWL_MVM_DQA_INJECT_MONITOR_QUEUE = 2,
39d172a5efSJohannes Berg 	IWL_MVM_DQA_GCAST_QUEUE = 3,
40d172a5efSJohannes Berg 	IWL_MVM_DQA_BSS_CLIENT_QUEUE = 4,
41d172a5efSJohannes Berg 	IWL_MVM_DQA_MIN_MGMT_QUEUE = 5,
42d172a5efSJohannes Berg 	IWL_MVM_DQA_MAX_MGMT_QUEUE = 8,
43d172a5efSJohannes Berg 	IWL_MVM_DQA_AP_PROBE_RESP_QUEUE = 9,
44d172a5efSJohannes Berg 	IWL_MVM_DQA_MIN_DATA_QUEUE = 10,
45e5b72e3bSJohannes Berg 	IWL_MVM_DQA_MAX_DATA_QUEUE = 30,
46d172a5efSJohannes Berg };
47d172a5efSJohannes Berg 
48d172a5efSJohannes Berg enum iwl_mvm_tx_fifo {
49d172a5efSJohannes Berg 	IWL_MVM_TX_FIFO_BK = 0,
50d172a5efSJohannes Berg 	IWL_MVM_TX_FIFO_BE,
51d172a5efSJohannes Berg 	IWL_MVM_TX_FIFO_VI,
52d172a5efSJohannes Berg 	IWL_MVM_TX_FIFO_VO,
53d172a5efSJohannes Berg 	IWL_MVM_TX_FIFO_MCAST = 5,
54d172a5efSJohannes Berg 	IWL_MVM_TX_FIFO_CMD = 7,
55d172a5efSJohannes Berg };
56d172a5efSJohannes Berg 
57cf6c6ea3SEmmanuel Grumbach enum iwl_gen2_tx_fifo {
58cf6c6ea3SEmmanuel Grumbach 	IWL_GEN2_TX_FIFO_CMD = 0,
59cf6c6ea3SEmmanuel Grumbach 	IWL_GEN2_EDCA_TX_FIFO_BK,
60cf6c6ea3SEmmanuel Grumbach 	IWL_GEN2_EDCA_TX_FIFO_BE,
61cf6c6ea3SEmmanuel Grumbach 	IWL_GEN2_EDCA_TX_FIFO_VI,
62cf6c6ea3SEmmanuel Grumbach 	IWL_GEN2_EDCA_TX_FIFO_VO,
63cf6c6ea3SEmmanuel Grumbach 	IWL_GEN2_TRIG_TX_FIFO_BK,
64cf6c6ea3SEmmanuel Grumbach 	IWL_GEN2_TRIG_TX_FIFO_BE,
65cf6c6ea3SEmmanuel Grumbach 	IWL_GEN2_TRIG_TX_FIFO_VI,
66cf6c6ea3SEmmanuel Grumbach 	IWL_GEN2_TRIG_TX_FIFO_VO,
67cf6c6ea3SEmmanuel Grumbach };
68cf6c6ea3SEmmanuel Grumbach 
69d172a5efSJohannes Berg /**
70b37ca87fSJohannes Berg  * enum iwl_tx_queue_cfg_actions - TXQ config options
71d172a5efSJohannes Berg  * @TX_QUEUE_CFG_ENABLE_QUEUE: enable a queue
72d172a5efSJohannes Berg  * @TX_QUEUE_CFG_TFD_SHORT_FORMAT: use short TFD format
73d172a5efSJohannes Berg  */
74d172a5efSJohannes Berg enum iwl_tx_queue_cfg_actions {
75d172a5efSJohannes Berg 	TX_QUEUE_CFG_ENABLE_QUEUE		= BIT(0),
76d172a5efSJohannes Berg 	TX_QUEUE_CFG_TFD_SHORT_FORMAT		= BIT(1),
77d172a5efSJohannes Berg };
78d172a5efSJohannes Berg 
79*d5399f11SMordechay Goodstein #define IWL_DEFAULT_QUEUE_SIZE_EHT (1024 * 4)
80*d5399f11SMordechay Goodstein #define IWL_DEFAULT_QUEUE_SIZE_HE 1024
815369774cSSara Sharon #define IWL_DEFAULT_QUEUE_SIZE 256
82251985c9SSara Sharon #define IWL_MGMT_QUEUE_SIZE 16
83718a8b23SShaul Triebitz #define IWL_CMD_QUEUE_SIZE 32
84d172a5efSJohannes Berg /**
85d172a5efSJohannes Berg  * struct iwl_tx_queue_cfg_cmd - txq hw scheduler config command
86d172a5efSJohannes Berg  * @sta_id: station id
87d172a5efSJohannes Berg  * @tid: tid of the queue
88d172a5efSJohannes Berg  * @flags: see &enum iwl_tx_queue_cfg_actions
89d172a5efSJohannes Berg  * @cb_size: size of TFD cyclic buffer. Value is exponent - 3.
90d172a5efSJohannes Berg  *	Minimum value 0 (8 TFDs), maximum value 5 (256 TFDs)
91d172a5efSJohannes Berg  * @byte_cnt_addr: address of byte count table
92d172a5efSJohannes Berg  * @tfdq_addr: address of TFD circular buffer
93d172a5efSJohannes Berg  */
94d172a5efSJohannes Berg struct iwl_tx_queue_cfg_cmd {
95d172a5efSJohannes Berg 	u8 sta_id;
96d172a5efSJohannes Berg 	u8 tid;
97d172a5efSJohannes Berg 	__le16 flags;
98d172a5efSJohannes Berg 	__le32 cb_size;
99d172a5efSJohannes Berg 	__le64 byte_cnt_addr;
100d172a5efSJohannes Berg 	__le64 tfdq_addr;
101d172a5efSJohannes Berg } __packed; /* TX_QUEUE_CFG_CMD_API_S_VER_2 */
102d172a5efSJohannes Berg 
103d172a5efSJohannes Berg /**
104d172a5efSJohannes Berg  * struct iwl_tx_queue_cfg_rsp - response to txq hw scheduler config
105d172a5efSJohannes Berg  * @queue_number: queue number assigned to this RA -TID
106d172a5efSJohannes Berg  * @flags: set on failure
107d172a5efSJohannes Berg  * @write_pointer: initial value for write pointer
108b37ca87fSJohannes Berg  * @reserved: reserved
109d172a5efSJohannes Berg  */
110d172a5efSJohannes Berg struct iwl_tx_queue_cfg_rsp {
111d172a5efSJohannes Berg 	__le16 queue_number;
112d172a5efSJohannes Berg 	__le16 flags;
113d172a5efSJohannes Berg 	__le16 write_pointer;
114d172a5efSJohannes Berg 	__le16 reserved;
115d172a5efSJohannes Berg } __packed; /* TX_QUEUE_CFG_RSP_API_S_VER_2 */
116d172a5efSJohannes Berg 
117d172a5efSJohannes Berg #endif /* __iwl_fw_api_txq_h__ */
118