txq.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. /******************************************************************************
  2. *
  3. * This file is provided under a dual BSD/GPLv2 license. When using or
  4. * redistributing this file, you may do so under either license.
  5. *
  6. * GPL LICENSE SUMMARY
  7. *
  8. * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved.
  9. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
  10. * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of version 2 of the GNU General Public License as
  14. * published by the Free Software Foundation.
  15. *
  16. * This program is distributed in the hope that it will be useful, but
  17. * WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  19. * General Public License for more details.
  20. *
  21. * The full GNU General Public License is included in this distribution
  22. * in the file called COPYING.
  23. *
  24. * Contact Information:
  25. * Intel Linux Wireless <linuxwifi@intel.com>
  26. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  27. *
  28. * BSD LICENSE
  29. *
  30. * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
  31. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
  32. * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
  33. * All rights reserved.
  34. *
  35. * Redistribution and use in source and binary forms, with or without
  36. * modification, are permitted provided that the following conditions
  37. * are met:
  38. *
  39. * * Redistributions of source code must retain the above copyright
  40. * notice, this list of conditions and the following disclaimer.
  41. * * Redistributions in binary form must reproduce the above copyright
  42. * notice, this list of conditions and the following disclaimer in
  43. * the documentation and/or other materials provided with the
  44. * distribution.
  45. * * Neither the name Intel Corporation nor the names of its
  46. * contributors may be used to endorse or promote products derived
  47. * from this software without specific prior written permission.
  48. *
  49. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  50. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  51. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  52. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  53. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  54. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  55. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  56. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  57. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  58. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  59. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  60. *
  61. *****************************************************************************/
  62. #ifndef __iwl_fw_api_txq_h__
  63. #define __iwl_fw_api_txq_h__
  64. /*
  65. * DQA queue numbers
  66. *
  67. * @IWL_MVM_DQA_CMD_QUEUE: a queue reserved for sending HCMDs to the FW
  68. * @IWL_MVM_DQA_AUX_QUEUE: a queue reserved for aux frames
  69. * @IWL_MVM_DQA_P2P_DEVICE_QUEUE: a queue reserved for P2P device frames
  70. * @IWL_MVM_DQA_INJECT_MONITOR_QUEUE: a queue reserved for injection using
  71. * monitor mode. Note this queue is the same as the queue for P2P device
  72. * but we can't have active monitor mode along with P2P device anyway.
  73. * @IWL_MVM_DQA_GCAST_QUEUE: a queue reserved for P2P GO/SoftAP GCAST frames
  74. * @IWL_MVM_DQA_BSS_CLIENT_QUEUE: a queue reserved for BSS activity, to ensure
  75. * that we are never left without the possibility to connect to an AP.
  76. * @IWL_MVM_DQA_MIN_MGMT_QUEUE: first TXQ in pool for MGMT and non-QOS frames.
  77. * Each MGMT queue is mapped to a single STA
  78. * MGMT frames are frames that return true on ieee80211_is_mgmt()
  79. * @IWL_MVM_DQA_MAX_MGMT_QUEUE: last TXQ in pool for MGMT frames
  80. * @IWL_MVM_DQA_AP_PROBE_RESP_QUEUE: a queue reserved for P2P GO/SoftAP probe
  81. * responses
  82. * @IWL_MVM_DQA_MIN_DATA_QUEUE: first TXQ in pool for DATA frames.
  83. * DATA frames are intended for !ieee80211_is_mgmt() frames, but if
  84. * the MGMT TXQ pool is exhausted, mgmt frames can be sent on DATA queues
  85. * as well
  86. * @IWL_MVM_DQA_MAX_DATA_QUEUE: last TXQ in pool for DATA frames
  87. */
  88. enum iwl_mvm_dqa_txq {
  89. IWL_MVM_DQA_CMD_QUEUE = 0,
  90. IWL_MVM_DQA_AUX_QUEUE = 1,
  91. IWL_MVM_DQA_P2P_DEVICE_QUEUE = 2,
  92. IWL_MVM_DQA_INJECT_MONITOR_QUEUE = 2,
  93. IWL_MVM_DQA_GCAST_QUEUE = 3,
  94. IWL_MVM_DQA_BSS_CLIENT_QUEUE = 4,
  95. IWL_MVM_DQA_MIN_MGMT_QUEUE = 5,
  96. IWL_MVM_DQA_MAX_MGMT_QUEUE = 8,
  97. IWL_MVM_DQA_AP_PROBE_RESP_QUEUE = 9,
  98. IWL_MVM_DQA_MIN_DATA_QUEUE = 10,
  99. IWL_MVM_DQA_MAX_DATA_QUEUE = 31,
  100. };
  101. enum iwl_mvm_tx_fifo {
  102. IWL_MVM_TX_FIFO_BK = 0,
  103. IWL_MVM_TX_FIFO_BE,
  104. IWL_MVM_TX_FIFO_VI,
  105. IWL_MVM_TX_FIFO_VO,
  106. IWL_MVM_TX_FIFO_MCAST = 5,
  107. IWL_MVM_TX_FIFO_CMD = 7,
  108. };
  109. enum iwl_gen2_tx_fifo {
  110. IWL_GEN2_TX_FIFO_CMD = 0,
  111. IWL_GEN2_EDCA_TX_FIFO_BK,
  112. IWL_GEN2_EDCA_TX_FIFO_BE,
  113. IWL_GEN2_EDCA_TX_FIFO_VI,
  114. IWL_GEN2_EDCA_TX_FIFO_VO,
  115. IWL_GEN2_TRIG_TX_FIFO_BK,
  116. IWL_GEN2_TRIG_TX_FIFO_BE,
  117. IWL_GEN2_TRIG_TX_FIFO_VI,
  118. IWL_GEN2_TRIG_TX_FIFO_VO,
  119. };
  120. /**
  121. * enum iwl_tx_queue_cfg_actions - TXQ config options
  122. * @TX_QUEUE_CFG_ENABLE_QUEUE: enable a queue
  123. * @TX_QUEUE_CFG_TFD_SHORT_FORMAT: use short TFD format
  124. */
  125. enum iwl_tx_queue_cfg_actions {
  126. TX_QUEUE_CFG_ENABLE_QUEUE = BIT(0),
  127. TX_QUEUE_CFG_TFD_SHORT_FORMAT = BIT(1),
  128. };
  129. #define IWL_DEFAULT_QUEUE_SIZE 256
  130. #define IWL_MGMT_QUEUE_SIZE 16
  131. /**
  132. * struct iwl_tx_queue_cfg_cmd - txq hw scheduler config command
  133. * @sta_id: station id
  134. * @tid: tid of the queue
  135. * @flags: see &enum iwl_tx_queue_cfg_actions
  136. * @cb_size: size of TFD cyclic buffer. Value is exponent - 3.
  137. * Minimum value 0 (8 TFDs), maximum value 5 (256 TFDs)
  138. * @byte_cnt_addr: address of byte count table
  139. * @tfdq_addr: address of TFD circular buffer
  140. */
  141. struct iwl_tx_queue_cfg_cmd {
  142. u8 sta_id;
  143. u8 tid;
  144. __le16 flags;
  145. __le32 cb_size;
  146. __le64 byte_cnt_addr;
  147. __le64 tfdq_addr;
  148. } __packed; /* TX_QUEUE_CFG_CMD_API_S_VER_2 */
  149. /**
  150. * struct iwl_tx_queue_cfg_rsp - response to txq hw scheduler config
  151. * @queue_number: queue number assigned to this RA -TID
  152. * @flags: set on failure
  153. * @write_pointer: initial value for write pointer
  154. * @reserved: reserved
  155. */
  156. struct iwl_tx_queue_cfg_rsp {
  157. __le16 queue_number;
  158. __le16 flags;
  159. __le16 write_pointer;
  160. __le16 reserved;
  161. } __packed; /* TX_QUEUE_CFG_RSP_API_S_VER_2 */
  162. #endif /* __iwl_fw_api_txq_h__ */