config.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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_config_h__
  63. #define __iwl_fw_api_config_h__
  64. /*
  65. * struct iwl_dqa_enable_cmd
  66. * @cmd_queue: the TXQ number of the command queue
  67. */
  68. struct iwl_dqa_enable_cmd {
  69. __le32 cmd_queue;
  70. } __packed; /* DQA_CONTROL_CMD_API_S_VER_1 */
  71. /*
  72. * struct iwl_tx_ant_cfg_cmd
  73. * @valid: valid antenna configuration
  74. */
  75. struct iwl_tx_ant_cfg_cmd {
  76. __le32 valid;
  77. } __packed;
  78. /**
  79. * struct iwl_calib_ctrl - Calibration control struct.
  80. * Sent as part of the phy configuration command.
  81. * @flow_trigger: bitmap for which calibrations to perform according to
  82. * flow triggers, using &enum iwl_calib_cfg
  83. * @event_trigger: bitmap for which calibrations to perform according to
  84. * event triggers, using &enum iwl_calib_cfg
  85. */
  86. struct iwl_calib_ctrl {
  87. __le32 flow_trigger;
  88. __le32 event_trigger;
  89. } __packed;
  90. /* This enum defines the bitmap of various calibrations to enable in both
  91. * init ucode and runtime ucode through CALIBRATION_CFG_CMD.
  92. */
  93. enum iwl_calib_cfg {
  94. IWL_CALIB_CFG_XTAL_IDX = BIT(0),
  95. IWL_CALIB_CFG_TEMPERATURE_IDX = BIT(1),
  96. IWL_CALIB_CFG_VOLTAGE_READ_IDX = BIT(2),
  97. IWL_CALIB_CFG_PAPD_IDX = BIT(3),
  98. IWL_CALIB_CFG_TX_PWR_IDX = BIT(4),
  99. IWL_CALIB_CFG_DC_IDX = BIT(5),
  100. IWL_CALIB_CFG_BB_FILTER_IDX = BIT(6),
  101. IWL_CALIB_CFG_LO_LEAKAGE_IDX = BIT(7),
  102. IWL_CALIB_CFG_TX_IQ_IDX = BIT(8),
  103. IWL_CALIB_CFG_TX_IQ_SKEW_IDX = BIT(9),
  104. IWL_CALIB_CFG_RX_IQ_IDX = BIT(10),
  105. IWL_CALIB_CFG_RX_IQ_SKEW_IDX = BIT(11),
  106. IWL_CALIB_CFG_SENSITIVITY_IDX = BIT(12),
  107. IWL_CALIB_CFG_CHAIN_NOISE_IDX = BIT(13),
  108. IWL_CALIB_CFG_DISCONNECTED_ANT_IDX = BIT(14),
  109. IWL_CALIB_CFG_ANT_COUPLING_IDX = BIT(15),
  110. IWL_CALIB_CFG_DAC_IDX = BIT(16),
  111. IWL_CALIB_CFG_ABS_IDX = BIT(17),
  112. IWL_CALIB_CFG_AGC_IDX = BIT(18),
  113. };
  114. /**
  115. * struct iwl_phy_cfg_cmd - Phy configuration command
  116. * @phy_cfg: PHY configuration value, uses &enum iwl_fw_phy_cfg
  117. * @calib_control: calibration control data
  118. */
  119. struct iwl_phy_cfg_cmd {
  120. __le32 phy_cfg;
  121. struct iwl_calib_ctrl calib_control;
  122. } __packed;
  123. #define PHY_CFG_RADIO_TYPE (BIT(0) | BIT(1))
  124. #define PHY_CFG_RADIO_STEP (BIT(2) | BIT(3))
  125. #define PHY_CFG_RADIO_DASH (BIT(4) | BIT(5))
  126. #define PHY_CFG_PRODUCT_NUMBER (BIT(6) | BIT(7))
  127. #define PHY_CFG_TX_CHAIN_A BIT(8)
  128. #define PHY_CFG_TX_CHAIN_B BIT(9)
  129. #define PHY_CFG_TX_CHAIN_C BIT(10)
  130. #define PHY_CFG_RX_CHAIN_A BIT(12)
  131. #define PHY_CFG_RX_CHAIN_B BIT(13)
  132. #define PHY_CFG_RX_CHAIN_C BIT(14)
  133. /*
  134. * enum iwl_dc2dc_config_id - flag ids
  135. *
  136. * Ids of dc2dc configuration flags
  137. */
  138. enum iwl_dc2dc_config_id {
  139. DCDC_LOW_POWER_MODE_MSK_SET = 0x1, /* not used */
  140. DCDC_FREQ_TUNE_SET = 0x2,
  141. }; /* MARKER_ID_API_E_VER_1 */
  142. /**
  143. * struct iwl_dc2dc_config_cmd - configure dc2dc values
  144. *
  145. * (DC2DC_CONFIG_CMD = 0x83)
  146. *
  147. * Set/Get & configure dc2dc values.
  148. * The command always returns the current dc2dc values.
  149. *
  150. * @flags: set/get dc2dc
  151. * @enable_low_power_mode: not used.
  152. * @dc2dc_freq_tune0: frequency divider - digital domain
  153. * @dc2dc_freq_tune1: frequency divider - analog domain
  154. */
  155. struct iwl_dc2dc_config_cmd {
  156. __le32 flags;
  157. __le32 enable_low_power_mode; /* not used */
  158. __le32 dc2dc_freq_tune0;
  159. __le32 dc2dc_freq_tune1;
  160. } __packed; /* DC2DC_CONFIG_CMD_API_S_VER_1 */
  161. /**
  162. * struct iwl_dc2dc_config_resp - response for iwl_dc2dc_config_cmd
  163. *
  164. * Current dc2dc values returned by the FW.
  165. *
  166. * @dc2dc_freq_tune0: frequency divider - digital domain
  167. * @dc2dc_freq_tune1: frequency divider - analog domain
  168. */
  169. struct iwl_dc2dc_config_resp {
  170. __le32 dc2dc_freq_tune0;
  171. __le32 dc2dc_freq_tune1;
  172. } __packed; /* DC2DC_CONFIG_RESP_API_S_VER_1 */
  173. #endif /* __iwl_fw_api_config_h__ */