binding.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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) 2012 - 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) 2012 - 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_binding_h__
  63. #define __iwl_fw_api_binding_h__
  64. #define MAX_MACS_IN_BINDING (3)
  65. #define MAX_BINDINGS (4)
  66. /**
  67. * struct iwl_binding_cmd_v1 - configuring bindings
  68. * ( BINDING_CONTEXT_CMD = 0x2b )
  69. * @id_and_color: ID and color of the relevant Binding,
  70. * &enum iwl_ctxt_id_and_color
  71. * @action: action to perform, one of FW_CTXT_ACTION_*
  72. * @macs: array of MAC id and colors which belong to the binding,
  73. * &enum iwl_ctxt_id_and_color
  74. * @phy: PHY id and color which belongs to the binding,
  75. * &enum iwl_ctxt_id_and_color
  76. */
  77. struct iwl_binding_cmd_v1 {
  78. /* COMMON_INDEX_HDR_API_S_VER_1 */
  79. __le32 id_and_color;
  80. __le32 action;
  81. /* BINDING_DATA_API_S_VER_1 */
  82. __le32 macs[MAX_MACS_IN_BINDING];
  83. __le32 phy;
  84. } __packed; /* BINDING_CMD_API_S_VER_1 */
  85. /**
  86. * struct iwl_binding_cmd - configuring bindings
  87. * ( BINDING_CONTEXT_CMD = 0x2b )
  88. * @id_and_color: ID and color of the relevant Binding,
  89. * &enum iwl_ctxt_id_and_color
  90. * @action: action to perform, one of FW_CTXT_ACTION_*
  91. * @macs: array of MAC id and colors which belong to the binding
  92. * &enum iwl_ctxt_id_and_color
  93. * @phy: PHY id and color which belongs to the binding
  94. * &enum iwl_ctxt_id_and_color
  95. * @lmac_id: the lmac id the binding belongs to
  96. */
  97. struct iwl_binding_cmd {
  98. /* COMMON_INDEX_HDR_API_S_VER_1 */
  99. __le32 id_and_color;
  100. __le32 action;
  101. /* BINDING_DATA_API_S_VER_1 */
  102. __le32 macs[MAX_MACS_IN_BINDING];
  103. __le32 phy;
  104. __le32 lmac_id;
  105. } __packed; /* BINDING_CMD_API_S_VER_2 */
  106. #define IWL_BINDING_CMD_SIZE_V1 sizeof(struct iwl_binding_cmd_v1)
  107. #define IWL_LMAC_24G_INDEX 0
  108. #define IWL_LMAC_5G_INDEX 1
  109. /* The maximal number of fragments in the FW's schedule session */
  110. #define IWL_MVM_MAX_QUOTA 128
  111. /**
  112. * struct iwl_time_quota_data_v1 - configuration of time quota per binding
  113. * @id_and_color: ID and color of the relevant Binding,
  114. * &enum iwl_ctxt_id_and_color
  115. * @quota: absolute time quota in TU. The scheduler will try to divide the
  116. * remainig quota (after Time Events) according to this quota.
  117. * @max_duration: max uninterrupted context duration in TU
  118. */
  119. struct iwl_time_quota_data_v1 {
  120. __le32 id_and_color;
  121. __le32 quota;
  122. __le32 max_duration;
  123. } __packed; /* TIME_QUOTA_DATA_API_S_VER_1 */
  124. /**
  125. * struct iwl_time_quota_cmd - configuration of time quota between bindings
  126. * ( TIME_QUOTA_CMD = 0x2c )
  127. * @quotas: allocations per binding
  128. * Note: on non-CDB the fourth one is the auxilary mac and is
  129. * essentially zero.
  130. * On CDB the fourth one is a regular binding.
  131. */
  132. struct iwl_time_quota_cmd_v1 {
  133. struct iwl_time_quota_data_v1 quotas[MAX_BINDINGS];
  134. } __packed; /* TIME_QUOTA_ALLOCATION_CMD_API_S_VER_1 */
  135. enum iwl_quota_low_latency {
  136. IWL_QUOTA_LOW_LATENCY_NONE = 0,
  137. IWL_QUOTA_LOW_LATENCY_TX = BIT(0),
  138. IWL_QUOTA_LOW_LATENCY_RX = BIT(1),
  139. IWL_QUOTA_LOW_LATENCY_TX_RX =
  140. IWL_QUOTA_LOW_LATENCY_TX | IWL_QUOTA_LOW_LATENCY_RX,
  141. };
  142. /**
  143. * struct iwl_time_quota_data - configuration of time quota per binding
  144. * @id_and_color: ID and color of the relevant Binding.
  145. * @quota: absolute time quota in TU. The scheduler will try to divide the
  146. * remainig quota (after Time Events) according to this quota.
  147. * @max_duration: max uninterrupted context duration in TU
  148. * @low_latency: low latency status, &enum iwl_quota_low_latency
  149. */
  150. struct iwl_time_quota_data {
  151. __le32 id_and_color;
  152. __le32 quota;
  153. __le32 max_duration;
  154. __le32 low_latency;
  155. } __packed; /* TIME_QUOTA_DATA_API_S_VER_2 */
  156. /**
  157. * struct iwl_time_quota_cmd - configuration of time quota between bindings
  158. * ( TIME_QUOTA_CMD = 0x2c )
  159. * Note: on non-CDB the fourth one is the auxilary mac and is essentially zero.
  160. * On CDB the fourth one is a regular binding.
  161. *
  162. * @quotas: allocations per binding
  163. */
  164. struct iwl_time_quota_cmd {
  165. struct iwl_time_quota_data quotas[MAX_BINDINGS];
  166. } __packed; /* TIME_QUOTA_ALLOCATION_CMD_API_S_VER_2 */
  167. #endif /* __iwl_fw_api_binding_h__ */