phy.h 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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_phy_h__
  63. #define __iwl_fw_api_phy_h__
  64. /**
  65. * enum iwl_phy_ops_subcmd_ids - PHY group commands
  66. */
  67. enum iwl_phy_ops_subcmd_ids {
  68. /**
  69. * @CMD_DTS_MEASUREMENT_TRIGGER_WIDE:
  70. * Uses either &struct iwl_dts_measurement_cmd or
  71. * &struct iwl_ext_dts_measurement_cmd
  72. */
  73. CMD_DTS_MEASUREMENT_TRIGGER_WIDE = 0x0,
  74. /**
  75. * @CTDP_CONFIG_CMD: &struct iwl_mvm_ctdp_cmd
  76. */
  77. CTDP_CONFIG_CMD = 0x03,
  78. /**
  79. * @TEMP_REPORTING_THRESHOLDS_CMD: &struct temp_report_ths_cmd
  80. */
  81. TEMP_REPORTING_THRESHOLDS_CMD = 0x04,
  82. /**
  83. * @GEO_TX_POWER_LIMIT: &struct iwl_geo_tx_power_profiles_cmd
  84. */
  85. GEO_TX_POWER_LIMIT = 0x05,
  86. /**
  87. * @CT_KILL_NOTIFICATION: &struct ct_kill_notif
  88. */
  89. CT_KILL_NOTIFICATION = 0xFE,
  90. /**
  91. * @DTS_MEASUREMENT_NOTIF_WIDE:
  92. * &struct iwl_dts_measurement_notif_v1 or
  93. * &struct iwl_dts_measurement_notif_v2
  94. */
  95. DTS_MEASUREMENT_NOTIF_WIDE = 0xFF,
  96. };
  97. /* DTS measurements */
  98. enum iwl_dts_measurement_flags {
  99. DTS_TRIGGER_CMD_FLAGS_TEMP = BIT(0),
  100. DTS_TRIGGER_CMD_FLAGS_VOLT = BIT(1),
  101. };
  102. /**
  103. * struct iwl_dts_measurement_cmd - request DTS temp and/or voltage measurements
  104. *
  105. * @flags: indicates which measurements we want as specified in
  106. * &enum iwl_dts_measurement_flags
  107. */
  108. struct iwl_dts_measurement_cmd {
  109. __le32 flags;
  110. } __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_CMD_S */
  111. /**
  112. * enum iwl_dts_control_measurement_mode - DTS measurement type
  113. * @DTS_AUTOMATIC: Automatic mode (full SW control). Provide temperature read
  114. * back (latest value. Not waiting for new value). Use automatic
  115. * SW DTS configuration.
  116. * @DTS_REQUEST_READ: Request DTS read. Configure DTS with manual settings,
  117. * trigger DTS reading and provide read back temperature read
  118. * when available.
  119. * @DTS_OVER_WRITE: over-write the DTS temperatures in the SW until next read
  120. * @DTS_DIRECT_WITHOUT_MEASURE: DTS returns its latest temperature result,
  121. * without measurement trigger.
  122. */
  123. enum iwl_dts_control_measurement_mode {
  124. DTS_AUTOMATIC = 0,
  125. DTS_REQUEST_READ = 1,
  126. DTS_OVER_WRITE = 2,
  127. DTS_DIRECT_WITHOUT_MEASURE = 3,
  128. };
  129. /**
  130. * enum iwl_dts_used - DTS to use or used for measurement in the DTS request
  131. * @DTS_USE_TOP: Top
  132. * @DTS_USE_CHAIN_A: chain A
  133. * @DTS_USE_CHAIN_B: chain B
  134. * @DTS_USE_CHAIN_C: chain C
  135. * @XTAL_TEMPERATURE: read temperature from xtal
  136. */
  137. enum iwl_dts_used {
  138. DTS_USE_TOP = 0,
  139. DTS_USE_CHAIN_A = 1,
  140. DTS_USE_CHAIN_B = 2,
  141. DTS_USE_CHAIN_C = 3,
  142. XTAL_TEMPERATURE = 4,
  143. };
  144. /**
  145. * enum iwl_dts_bit_mode - bit-mode to use in DTS request read mode
  146. * @DTS_BIT6_MODE: bit 6 mode
  147. * @DTS_BIT8_MODE: bit 8 mode
  148. */
  149. enum iwl_dts_bit_mode {
  150. DTS_BIT6_MODE = 0,
  151. DTS_BIT8_MODE = 1,
  152. };
  153. /**
  154. * struct iwl_ext_dts_measurement_cmd - request extended DTS temp measurements
  155. * @control_mode: see &enum iwl_dts_control_measurement_mode
  156. * @temperature: used when over write DTS mode is selected
  157. * @sensor: set temperature sensor to use. See &enum iwl_dts_used
  158. * @avg_factor: average factor to DTS in request DTS read mode
  159. * @bit_mode: value defines the DTS bit mode to use. See &enum iwl_dts_bit_mode
  160. * @step_duration: step duration for the DTS
  161. */
  162. struct iwl_ext_dts_measurement_cmd {
  163. __le32 control_mode;
  164. __le32 temperature;
  165. __le32 sensor;
  166. __le32 avg_factor;
  167. __le32 bit_mode;
  168. __le32 step_duration;
  169. } __packed; /* XVT_FW_DTS_CONTROL_MEASUREMENT_REQUEST_API_S */
  170. /**
  171. * struct iwl_dts_measurement_notif_v1 - measurements notification
  172. *
  173. * @temp: the measured temperature
  174. * @voltage: the measured voltage
  175. */
  176. struct iwl_dts_measurement_notif_v1 {
  177. __le32 temp;
  178. __le32 voltage;
  179. } __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_1*/
  180. /**
  181. * struct iwl_dts_measurement_notif_v2 - measurements notification
  182. *
  183. * @temp: the measured temperature
  184. * @voltage: the measured voltage
  185. * @threshold_idx: the trip index that was crossed
  186. */
  187. struct iwl_dts_measurement_notif_v2 {
  188. __le32 temp;
  189. __le32 voltage;
  190. __le32 threshold_idx;
  191. } __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_2 */
  192. /**
  193. * struct ct_kill_notif - CT-kill entry notification
  194. *
  195. * @temperature: the current temperature in celsius
  196. * @reserved: reserved
  197. */
  198. struct ct_kill_notif {
  199. __le16 temperature;
  200. __le16 reserved;
  201. } __packed; /* GRP_PHY_CT_KILL_NTF */
  202. /**
  203. * enum ctdp_cmd_operation - CTDP command operations
  204. * @CTDP_CMD_OPERATION_START: update the current budget
  205. * @CTDP_CMD_OPERATION_STOP: stop ctdp
  206. * @CTDP_CMD_OPERATION_REPORT: get the average budget
  207. */
  208. enum iwl_mvm_ctdp_cmd_operation {
  209. CTDP_CMD_OPERATION_START = 0x1,
  210. CTDP_CMD_OPERATION_STOP = 0x2,
  211. CTDP_CMD_OPERATION_REPORT = 0x4,
  212. };/* CTDP_CMD_OPERATION_TYPE_E */
  213. /**
  214. * struct iwl_mvm_ctdp_cmd - track and manage the FW power consumption budget
  215. *
  216. * @operation: see &enum iwl_mvm_ctdp_cmd_operation
  217. * @budget: the budget in milliwatt
  218. * @window_size: defined in API but not used
  219. */
  220. struct iwl_mvm_ctdp_cmd {
  221. __le32 operation;
  222. __le32 budget;
  223. __le32 window_size;
  224. } __packed;
  225. #define IWL_MAX_DTS_TRIPS 8
  226. /**
  227. * struct temp_report_ths_cmd - set temperature thresholds
  228. *
  229. * @num_temps: number of temperature thresholds passed
  230. * @thresholds: array with the thresholds to be configured
  231. */
  232. struct temp_report_ths_cmd {
  233. __le32 num_temps;
  234. __le16 thresholds[IWL_MAX_DTS_TRIPS];
  235. } __packed; /* GRP_PHY_TEMP_REPORTING_THRESHOLDS_CMD */
  236. #endif /* __iwl_fw_api_phy_h__ */