fw-api.h 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800
  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. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of version 2 of the GNU General Public License as
  13. * published by the Free Software Foundation.
  14. *
  15. * This program is distributed in the hope that it will be useful, but
  16. * WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
  23. * USA
  24. *
  25. * The full GNU General Public License is included in this distribution
  26. * in the file called COPYING.
  27. *
  28. * Contact Information:
  29. * Intel Linux Wireless <linuxwifi@intel.com>
  30. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  31. *
  32. * BSD LICENSE
  33. *
  34. * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  35. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
  36. * All rights reserved.
  37. *
  38. * Redistribution and use in source and binary forms, with or without
  39. * modification, are permitted provided that the following conditions
  40. * are met:
  41. *
  42. * * Redistributions of source code must retain the above copyright
  43. * notice, this list of conditions and the following disclaimer.
  44. * * Redistributions in binary form must reproduce the above copyright
  45. * notice, this list of conditions and the following disclaimer in
  46. * the documentation and/or other materials provided with the
  47. * distribution.
  48. * * Neither the name Intel Corporation nor the names of its
  49. * contributors may be used to endorse or promote products derived
  50. * from this software without specific prior written permission.
  51. *
  52. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  53. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  54. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  55. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  56. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  57. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  58. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  59. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  60. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  61. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  62. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  63. *
  64. *****************************************************************************/
  65. #ifndef __fw_api_h__
  66. #define __fw_api_h__
  67. #include "fw-api-rs.h"
  68. #include "fw-api-rx.h"
  69. #include "fw-api-tx.h"
  70. #include "fw-api-sta.h"
  71. #include "fw-api-mac.h"
  72. #include "fw-api-power.h"
  73. #include "fw-api-d3.h"
  74. #include "fw-api-coex.h"
  75. #include "fw-api-scan.h"
  76. #include "fw-api-stats.h"
  77. #include "fw-api-tof.h"
  78. /* Tx queue numbers */
  79. enum {
  80. IWL_MVM_OFFCHANNEL_QUEUE = 8,
  81. IWL_MVM_CMD_QUEUE = 9,
  82. };
  83. enum iwl_mvm_tx_fifo {
  84. IWL_MVM_TX_FIFO_BK = 0,
  85. IWL_MVM_TX_FIFO_BE,
  86. IWL_MVM_TX_FIFO_VI,
  87. IWL_MVM_TX_FIFO_VO,
  88. IWL_MVM_TX_FIFO_MCAST = 5,
  89. IWL_MVM_TX_FIFO_CMD = 7,
  90. };
  91. #define IWL_MVM_STATION_COUNT 16
  92. #define IWL_MVM_TDLS_STA_COUNT 4
  93. /* commands */
  94. enum {
  95. MVM_ALIVE = 0x1,
  96. REPLY_ERROR = 0x2,
  97. ECHO_CMD = 0x3,
  98. INIT_COMPLETE_NOTIF = 0x4,
  99. /* PHY context commands */
  100. PHY_CONTEXT_CMD = 0x8,
  101. DBG_CFG = 0x9,
  102. ANTENNA_COUPLING_NOTIFICATION = 0xa,
  103. /* UMAC scan commands */
  104. SCAN_ITERATION_COMPLETE_UMAC = 0xb5,
  105. SCAN_CFG_CMD = 0xc,
  106. SCAN_REQ_UMAC = 0xd,
  107. SCAN_ABORT_UMAC = 0xe,
  108. SCAN_COMPLETE_UMAC = 0xf,
  109. /* station table */
  110. ADD_STA_KEY = 0x17,
  111. ADD_STA = 0x18,
  112. REMOVE_STA = 0x19,
  113. /* paging get item */
  114. FW_GET_ITEM_CMD = 0x1a,
  115. /* TX */
  116. TX_CMD = 0x1c,
  117. TXPATH_FLUSH = 0x1e,
  118. MGMT_MCAST_KEY = 0x1f,
  119. /* scheduler config */
  120. SCD_QUEUE_CFG = 0x1d,
  121. /* global key */
  122. WEP_KEY = 0x20,
  123. /* Memory */
  124. SHARED_MEM_CFG = 0x25,
  125. /* TDLS */
  126. TDLS_CHANNEL_SWITCH_CMD = 0x27,
  127. TDLS_CHANNEL_SWITCH_NOTIFICATION = 0xaa,
  128. TDLS_CONFIG_CMD = 0xa7,
  129. /* MAC and Binding commands */
  130. MAC_CONTEXT_CMD = 0x28,
  131. TIME_EVENT_CMD = 0x29, /* both CMD and response */
  132. TIME_EVENT_NOTIFICATION = 0x2a,
  133. BINDING_CONTEXT_CMD = 0x2b,
  134. TIME_QUOTA_CMD = 0x2c,
  135. NON_QOS_TX_COUNTER_CMD = 0x2d,
  136. LQ_CMD = 0x4e,
  137. /* paging block to FW cpu2 */
  138. FW_PAGING_BLOCK_CMD = 0x4f,
  139. /* Scan offload */
  140. SCAN_OFFLOAD_REQUEST_CMD = 0x51,
  141. SCAN_OFFLOAD_ABORT_CMD = 0x52,
  142. HOT_SPOT_CMD = 0x53,
  143. SCAN_OFFLOAD_COMPLETE = 0x6D,
  144. SCAN_OFFLOAD_UPDATE_PROFILES_CMD = 0x6E,
  145. SCAN_OFFLOAD_CONFIG_CMD = 0x6f,
  146. MATCH_FOUND_NOTIFICATION = 0xd9,
  147. SCAN_ITERATION_COMPLETE = 0xe7,
  148. /* Phy */
  149. PHY_CONFIGURATION_CMD = 0x6a,
  150. CALIB_RES_NOTIF_PHY_DB = 0x6b,
  151. /* PHY_DB_CMD = 0x6c, */
  152. /* ToF - 802.11mc FTM */
  153. TOF_CMD = 0x10,
  154. TOF_NOTIFICATION = 0x11,
  155. /* Power - legacy power table command */
  156. POWER_TABLE_CMD = 0x77,
  157. PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION = 0x78,
  158. LTR_CONFIG = 0xee,
  159. /* Thermal Throttling*/
  160. REPLY_THERMAL_MNG_BACKOFF = 0x7e,
  161. /* Set/Get DC2DC frequency tune */
  162. DC2DC_CONFIG_CMD = 0x83,
  163. /* NVM */
  164. NVM_ACCESS_CMD = 0x88,
  165. SET_CALIB_DEFAULT_CMD = 0x8e,
  166. BEACON_NOTIFICATION = 0x90,
  167. BEACON_TEMPLATE_CMD = 0x91,
  168. TX_ANT_CONFIGURATION_CMD = 0x98,
  169. STATISTICS_CMD = 0x9c,
  170. STATISTICS_NOTIFICATION = 0x9d,
  171. EOSP_NOTIFICATION = 0x9e,
  172. REDUCE_TX_POWER_CMD = 0x9f,
  173. /* RF-KILL commands and notifications */
  174. CARD_STATE_CMD = 0xa0,
  175. CARD_STATE_NOTIFICATION = 0xa1,
  176. MISSED_BEACONS_NOTIFICATION = 0xa2,
  177. /* Power - new power table command */
  178. MAC_PM_POWER_TABLE = 0xa9,
  179. MFUART_LOAD_NOTIFICATION = 0xb1,
  180. REPLY_RX_PHY_CMD = 0xc0,
  181. REPLY_RX_MPDU_CMD = 0xc1,
  182. FRAME_RELEASE = 0xc3,
  183. BA_NOTIF = 0xc5,
  184. /* Location Aware Regulatory */
  185. MCC_UPDATE_CMD = 0xc8,
  186. MCC_CHUB_UPDATE_CMD = 0xc9,
  187. MARKER_CMD = 0xcb,
  188. /* BT Coex */
  189. BT_COEX_PRIO_TABLE = 0xcc,
  190. BT_COEX_PROT_ENV = 0xcd,
  191. BT_PROFILE_NOTIFICATION = 0xce,
  192. BT_CONFIG = 0x9b,
  193. BT_COEX_UPDATE_SW_BOOST = 0x5a,
  194. BT_COEX_UPDATE_CORUN_LUT = 0x5b,
  195. BT_COEX_UPDATE_REDUCED_TXP = 0x5c,
  196. BT_COEX_CI = 0x5d,
  197. REPLY_SF_CFG_CMD = 0xd1,
  198. REPLY_BEACON_FILTERING_CMD = 0xd2,
  199. /* DTS measurements */
  200. CMD_DTS_MEASUREMENT_TRIGGER = 0xdc,
  201. DTS_MEASUREMENT_NOTIFICATION = 0xdd,
  202. REPLY_DEBUG_CMD = 0xf0,
  203. LDBG_CONFIG_CMD = 0xf6,
  204. DEBUG_LOG_MSG = 0xf7,
  205. BCAST_FILTER_CMD = 0xcf,
  206. MCAST_FILTER_CMD = 0xd0,
  207. /* D3 commands/notifications */
  208. D3_CONFIG_CMD = 0xd3,
  209. PROT_OFFLOAD_CONFIG_CMD = 0xd4,
  210. OFFLOADS_QUERY_CMD = 0xd5,
  211. REMOTE_WAKE_CONFIG_CMD = 0xd6,
  212. D0I3_END_CMD = 0xed,
  213. /* for WoWLAN in particular */
  214. WOWLAN_PATTERNS = 0xe0,
  215. WOWLAN_CONFIGURATION = 0xe1,
  216. WOWLAN_TSC_RSC_PARAM = 0xe2,
  217. WOWLAN_TKIP_PARAM = 0xe3,
  218. WOWLAN_KEK_KCK_MATERIAL = 0xe4,
  219. WOWLAN_GET_STATUSES = 0xe5,
  220. WOWLAN_TX_POWER_PER_DB = 0xe6,
  221. /* and for NetDetect */
  222. SCAN_OFFLOAD_PROFILES_QUERY_CMD = 0x56,
  223. SCAN_OFFLOAD_HOTSPOTS_CONFIG_CMD = 0x58,
  224. SCAN_OFFLOAD_HOTSPOTS_QUERY_CMD = 0x59,
  225. REPLY_MAX = 0xff,
  226. };
  227. /* Please keep this enum *SORTED* by hex value.
  228. * Needed for binary search, otherwise a warning will be triggered.
  229. */
  230. enum iwl_phy_ops_subcmd_ids {
  231. CMD_DTS_MEASUREMENT_TRIGGER_WIDE = 0x0,
  232. DTS_MEASUREMENT_NOTIF_WIDE = 0xFF,
  233. };
  234. /* command groups */
  235. enum {
  236. LEGACY_GROUP = 0x0,
  237. LONG_GROUP = 0x1,
  238. PHY_OPS_GROUP = 0x4,
  239. };
  240. /**
  241. * struct iwl_cmd_response - generic response struct for most commands
  242. * @status: status of the command asked, changes for each one
  243. */
  244. struct iwl_cmd_response {
  245. __le32 status;
  246. };
  247. /*
  248. * struct iwl_tx_ant_cfg_cmd
  249. * @valid: valid antenna configuration
  250. */
  251. struct iwl_tx_ant_cfg_cmd {
  252. __le32 valid;
  253. } __packed;
  254. /*
  255. * Calibration control struct.
  256. * Sent as part of the phy configuration command.
  257. * @flow_trigger: bitmap for which calibrations to perform according to
  258. * flow triggers.
  259. * @event_trigger: bitmap for which calibrations to perform according to
  260. * event triggers.
  261. */
  262. struct iwl_calib_ctrl {
  263. __le32 flow_trigger;
  264. __le32 event_trigger;
  265. } __packed;
  266. /* This enum defines the bitmap of various calibrations to enable in both
  267. * init ucode and runtime ucode through CALIBRATION_CFG_CMD.
  268. */
  269. enum iwl_calib_cfg {
  270. IWL_CALIB_CFG_XTAL_IDX = BIT(0),
  271. IWL_CALIB_CFG_TEMPERATURE_IDX = BIT(1),
  272. IWL_CALIB_CFG_VOLTAGE_READ_IDX = BIT(2),
  273. IWL_CALIB_CFG_PAPD_IDX = BIT(3),
  274. IWL_CALIB_CFG_TX_PWR_IDX = BIT(4),
  275. IWL_CALIB_CFG_DC_IDX = BIT(5),
  276. IWL_CALIB_CFG_BB_FILTER_IDX = BIT(6),
  277. IWL_CALIB_CFG_LO_LEAKAGE_IDX = BIT(7),
  278. IWL_CALIB_CFG_TX_IQ_IDX = BIT(8),
  279. IWL_CALIB_CFG_TX_IQ_SKEW_IDX = BIT(9),
  280. IWL_CALIB_CFG_RX_IQ_IDX = BIT(10),
  281. IWL_CALIB_CFG_RX_IQ_SKEW_IDX = BIT(11),
  282. IWL_CALIB_CFG_SENSITIVITY_IDX = BIT(12),
  283. IWL_CALIB_CFG_CHAIN_NOISE_IDX = BIT(13),
  284. IWL_CALIB_CFG_DISCONNECTED_ANT_IDX = BIT(14),
  285. IWL_CALIB_CFG_ANT_COUPLING_IDX = BIT(15),
  286. IWL_CALIB_CFG_DAC_IDX = BIT(16),
  287. IWL_CALIB_CFG_ABS_IDX = BIT(17),
  288. IWL_CALIB_CFG_AGC_IDX = BIT(18),
  289. };
  290. /*
  291. * Phy configuration command.
  292. */
  293. struct iwl_phy_cfg_cmd {
  294. __le32 phy_cfg;
  295. struct iwl_calib_ctrl calib_control;
  296. } __packed;
  297. #define PHY_CFG_RADIO_TYPE (BIT(0) | BIT(1))
  298. #define PHY_CFG_RADIO_STEP (BIT(2) | BIT(3))
  299. #define PHY_CFG_RADIO_DASH (BIT(4) | BIT(5))
  300. #define PHY_CFG_PRODUCT_NUMBER (BIT(6) | BIT(7))
  301. #define PHY_CFG_TX_CHAIN_A BIT(8)
  302. #define PHY_CFG_TX_CHAIN_B BIT(9)
  303. #define PHY_CFG_TX_CHAIN_C BIT(10)
  304. #define PHY_CFG_RX_CHAIN_A BIT(12)
  305. #define PHY_CFG_RX_CHAIN_B BIT(13)
  306. #define PHY_CFG_RX_CHAIN_C BIT(14)
  307. /* Target of the NVM_ACCESS_CMD */
  308. enum {
  309. NVM_ACCESS_TARGET_CACHE = 0,
  310. NVM_ACCESS_TARGET_OTP = 1,
  311. NVM_ACCESS_TARGET_EEPROM = 2,
  312. };
  313. /* Section types for NVM_ACCESS_CMD */
  314. enum {
  315. NVM_SECTION_TYPE_SW = 1,
  316. NVM_SECTION_TYPE_REGULATORY = 3,
  317. NVM_SECTION_TYPE_CALIBRATION = 4,
  318. NVM_SECTION_TYPE_PRODUCTION = 5,
  319. NVM_SECTION_TYPE_MAC_OVERRIDE = 11,
  320. NVM_SECTION_TYPE_PHY_SKU = 12,
  321. NVM_MAX_NUM_SECTIONS = 13,
  322. };
  323. /**
  324. * struct iwl_nvm_access_cmd_ver2 - Request the device to send an NVM section
  325. * @op_code: 0 - read, 1 - write
  326. * @target: NVM_ACCESS_TARGET_*
  327. * @type: NVM_SECTION_TYPE_*
  328. * @offset: offset in bytes into the section
  329. * @length: in bytes, to read/write
  330. * @data: if write operation, the data to write. On read its empty
  331. */
  332. struct iwl_nvm_access_cmd {
  333. u8 op_code;
  334. u8 target;
  335. __le16 type;
  336. __le16 offset;
  337. __le16 length;
  338. u8 data[];
  339. } __packed; /* NVM_ACCESS_CMD_API_S_VER_2 */
  340. #define NUM_OF_FW_PAGING_BLOCKS 33 /* 32 for data and 1 block for CSS */
  341. /*
  342. * struct iwl_fw_paging_cmd - paging layout
  343. *
  344. * (FW_PAGING_BLOCK_CMD = 0x4f)
  345. *
  346. * Send to FW the paging layout in the driver.
  347. *
  348. * @flags: various flags for the command
  349. * @block_size: the block size in powers of 2
  350. * @block_num: number of blocks specified in the command.
  351. * @device_phy_addr: virtual addresses from device side
  352. */
  353. struct iwl_fw_paging_cmd {
  354. __le32 flags;
  355. __le32 block_size;
  356. __le32 block_num;
  357. __le32 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
  358. } __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_1 */
  359. /*
  360. * Fw items ID's
  361. *
  362. * @IWL_FW_ITEM_ID_PAGING: Address of the pages that the FW will upload
  363. * download
  364. */
  365. enum iwl_fw_item_id {
  366. IWL_FW_ITEM_ID_PAGING = 3,
  367. };
  368. /*
  369. * struct iwl_fw_get_item_cmd - get an item from the fw
  370. */
  371. struct iwl_fw_get_item_cmd {
  372. __le32 item_id;
  373. } __packed; /* FW_GET_ITEM_CMD_API_S_VER_1 */
  374. #define CONT_REC_COMMAND_SIZE 80
  375. #define ENABLE_CONT_RECORDING 0x15
  376. #define DISABLE_CONT_RECORDING 0x16
  377. /*
  378. * struct iwl_continuous_record_mode - recording mode
  379. */
  380. struct iwl_continuous_record_mode {
  381. __le16 enable_recording;
  382. } __packed;
  383. /*
  384. * struct iwl_continuous_record_cmd - enable/disable continuous recording
  385. */
  386. struct iwl_continuous_record_cmd {
  387. struct iwl_continuous_record_mode record_mode;
  388. u8 pad[CONT_REC_COMMAND_SIZE -
  389. sizeof(struct iwl_continuous_record_mode)];
  390. } __packed;
  391. struct iwl_fw_get_item_resp {
  392. __le32 item_id;
  393. __le32 item_byte_cnt;
  394. __le32 item_val;
  395. } __packed; /* FW_GET_ITEM_RSP_S_VER_1 */
  396. /**
  397. * struct iwl_nvm_access_resp_ver2 - response to NVM_ACCESS_CMD
  398. * @offset: offset in bytes into the section
  399. * @length: in bytes, either how much was written or read
  400. * @type: NVM_SECTION_TYPE_*
  401. * @status: 0 for success, fail otherwise
  402. * @data: if read operation, the data returned. Empty on write.
  403. */
  404. struct iwl_nvm_access_resp {
  405. __le16 offset;
  406. __le16 length;
  407. __le16 type;
  408. __le16 status;
  409. u8 data[];
  410. } __packed; /* NVM_ACCESS_CMD_RESP_API_S_VER_2 */
  411. /* MVM_ALIVE 0x1 */
  412. /* alive response is_valid values */
  413. #define ALIVE_RESP_UCODE_OK BIT(0)
  414. #define ALIVE_RESP_RFKILL BIT(1)
  415. /* alive response ver_type values */
  416. enum {
  417. FW_TYPE_HW = 0,
  418. FW_TYPE_PROT = 1,
  419. FW_TYPE_AP = 2,
  420. FW_TYPE_WOWLAN = 3,
  421. FW_TYPE_TIMING = 4,
  422. FW_TYPE_WIPAN = 5
  423. };
  424. /* alive response ver_subtype values */
  425. enum {
  426. FW_SUBTYPE_FULL_FEATURE = 0,
  427. FW_SUBTYPE_BOOTSRAP = 1, /* Not valid */
  428. FW_SUBTYPE_REDUCED = 2,
  429. FW_SUBTYPE_ALIVE_ONLY = 3,
  430. FW_SUBTYPE_WOWLAN = 4,
  431. FW_SUBTYPE_AP_SUBTYPE = 5,
  432. FW_SUBTYPE_WIPAN = 6,
  433. FW_SUBTYPE_INITIALIZE = 9
  434. };
  435. #define IWL_ALIVE_STATUS_ERR 0xDEAD
  436. #define IWL_ALIVE_STATUS_OK 0xCAFE
  437. #define IWL_ALIVE_FLG_RFKILL BIT(0)
  438. struct mvm_alive_resp_ver1 {
  439. __le16 status;
  440. __le16 flags;
  441. u8 ucode_minor;
  442. u8 ucode_major;
  443. __le16 id;
  444. u8 api_minor;
  445. u8 api_major;
  446. u8 ver_subtype;
  447. u8 ver_type;
  448. u8 mac;
  449. u8 opt;
  450. __le16 reserved2;
  451. __le32 timestamp;
  452. __le32 error_event_table_ptr; /* SRAM address for error log */
  453. __le32 log_event_table_ptr; /* SRAM address for event log */
  454. __le32 cpu_register_ptr;
  455. __le32 dbgm_config_ptr;
  456. __le32 alive_counter_ptr;
  457. __le32 scd_base_ptr; /* SRAM address for SCD */
  458. } __packed; /* ALIVE_RES_API_S_VER_1 */
  459. struct mvm_alive_resp_ver2 {
  460. __le16 status;
  461. __le16 flags;
  462. u8 ucode_minor;
  463. u8 ucode_major;
  464. __le16 id;
  465. u8 api_minor;
  466. u8 api_major;
  467. u8 ver_subtype;
  468. u8 ver_type;
  469. u8 mac;
  470. u8 opt;
  471. __le16 reserved2;
  472. __le32 timestamp;
  473. __le32 error_event_table_ptr; /* SRAM address for error log */
  474. __le32 log_event_table_ptr; /* SRAM address for LMAC event log */
  475. __le32 cpu_register_ptr;
  476. __le32 dbgm_config_ptr;
  477. __le32 alive_counter_ptr;
  478. __le32 scd_base_ptr; /* SRAM address for SCD */
  479. __le32 st_fwrd_addr; /* pointer to Store and forward */
  480. __le32 st_fwrd_size;
  481. u8 umac_minor; /* UMAC version: minor */
  482. u8 umac_major; /* UMAC version: major */
  483. __le16 umac_id; /* UMAC version: id */
  484. __le32 error_info_addr; /* SRAM address for UMAC error log */
  485. __le32 dbg_print_buff_addr;
  486. } __packed; /* ALIVE_RES_API_S_VER_2 */
  487. struct mvm_alive_resp {
  488. __le16 status;
  489. __le16 flags;
  490. __le32 ucode_minor;
  491. __le32 ucode_major;
  492. u8 ver_subtype;
  493. u8 ver_type;
  494. u8 mac;
  495. u8 opt;
  496. __le32 timestamp;
  497. __le32 error_event_table_ptr; /* SRAM address for error log */
  498. __le32 log_event_table_ptr; /* SRAM address for LMAC event log */
  499. __le32 cpu_register_ptr;
  500. __le32 dbgm_config_ptr;
  501. __le32 alive_counter_ptr;
  502. __le32 scd_base_ptr; /* SRAM address for SCD */
  503. __le32 st_fwrd_addr; /* pointer to Store and forward */
  504. __le32 st_fwrd_size;
  505. __le32 umac_minor; /* UMAC version: minor */
  506. __le32 umac_major; /* UMAC version: major */
  507. __le32 error_info_addr; /* SRAM address for UMAC error log */
  508. __le32 dbg_print_buff_addr;
  509. } __packed; /* ALIVE_RES_API_S_VER_3 */
  510. /* Error response/notification */
  511. enum {
  512. FW_ERR_UNKNOWN_CMD = 0x0,
  513. FW_ERR_INVALID_CMD_PARAM = 0x1,
  514. FW_ERR_SERVICE = 0x2,
  515. FW_ERR_ARC_MEMORY = 0x3,
  516. FW_ERR_ARC_CODE = 0x4,
  517. FW_ERR_WATCH_DOG = 0x5,
  518. FW_ERR_WEP_GRP_KEY_INDX = 0x10,
  519. FW_ERR_WEP_KEY_SIZE = 0x11,
  520. FW_ERR_OBSOLETE_FUNC = 0x12,
  521. FW_ERR_UNEXPECTED = 0xFE,
  522. FW_ERR_FATAL = 0xFF
  523. };
  524. /**
  525. * struct iwl_error_resp - FW error indication
  526. * ( REPLY_ERROR = 0x2 )
  527. * @error_type: one of FW_ERR_*
  528. * @cmd_id: the command ID for which the error occured
  529. * @bad_cmd_seq_num: sequence number of the erroneous command
  530. * @error_service: which service created the error, applicable only if
  531. * error_type = 2, otherwise 0
  532. * @timestamp: TSF in usecs.
  533. */
  534. struct iwl_error_resp {
  535. __le32 error_type;
  536. u8 cmd_id;
  537. u8 reserved1;
  538. __le16 bad_cmd_seq_num;
  539. __le32 error_service;
  540. __le64 timestamp;
  541. } __packed;
  542. /* Common PHY, MAC and Bindings definitions */
  543. #define MAX_MACS_IN_BINDING (3)
  544. #define MAX_BINDINGS (4)
  545. #define AUX_BINDING_INDEX (3)
  546. #define MAX_PHYS (4)
  547. /* Used to extract ID and color from the context dword */
  548. #define FW_CTXT_ID_POS (0)
  549. #define FW_CTXT_ID_MSK (0xff << FW_CTXT_ID_POS)
  550. #define FW_CTXT_COLOR_POS (8)
  551. #define FW_CTXT_COLOR_MSK (0xff << FW_CTXT_COLOR_POS)
  552. #define FW_CTXT_INVALID (0xffffffff)
  553. #define FW_CMD_ID_AND_COLOR(_id, _color) ((_id << FW_CTXT_ID_POS) |\
  554. (_color << FW_CTXT_COLOR_POS))
  555. /* Possible actions on PHYs, MACs and Bindings */
  556. enum {
  557. FW_CTXT_ACTION_STUB = 0,
  558. FW_CTXT_ACTION_ADD,
  559. FW_CTXT_ACTION_MODIFY,
  560. FW_CTXT_ACTION_REMOVE,
  561. FW_CTXT_ACTION_NUM
  562. }; /* COMMON_CONTEXT_ACTION_API_E_VER_1 */
  563. /* Time Events */
  564. /* Time Event types, according to MAC type */
  565. enum iwl_time_event_type {
  566. /* BSS Station Events */
  567. TE_BSS_STA_AGGRESSIVE_ASSOC,
  568. TE_BSS_STA_ASSOC,
  569. TE_BSS_EAP_DHCP_PROT,
  570. TE_BSS_QUIET_PERIOD,
  571. /* P2P Device Events */
  572. TE_P2P_DEVICE_DISCOVERABLE,
  573. TE_P2P_DEVICE_LISTEN,
  574. TE_P2P_DEVICE_ACTION_SCAN,
  575. TE_P2P_DEVICE_FULL_SCAN,
  576. /* P2P Client Events */
  577. TE_P2P_CLIENT_AGGRESSIVE_ASSOC,
  578. TE_P2P_CLIENT_ASSOC,
  579. TE_P2P_CLIENT_QUIET_PERIOD,
  580. /* P2P GO Events */
  581. TE_P2P_GO_ASSOC_PROT,
  582. TE_P2P_GO_REPETITIVE_NOA,
  583. TE_P2P_GO_CT_WINDOW,
  584. /* WiDi Sync Events */
  585. TE_WIDI_TX_SYNC,
  586. /* Channel Switch NoA */
  587. TE_CHANNEL_SWITCH_PERIOD,
  588. TE_MAX
  589. }; /* MAC_EVENT_TYPE_API_E_VER_1 */
  590. /* Time event - defines for command API v1 */
  591. /*
  592. * @TE_V1_FRAG_NONE: fragmentation of the time event is NOT allowed.
  593. * @TE_V1_FRAG_SINGLE: fragmentation of the time event is allowed, but only
  594. * the first fragment is scheduled.
  595. * @TE_V1_FRAG_DUAL: fragmentation of the time event is allowed, but only
  596. * the first 2 fragments are scheduled.
  597. * @TE_V1_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
  598. * number of fragments are valid.
  599. *
  600. * Other than the constant defined above, specifying a fragmentation value 'x'
  601. * means that the event can be fragmented but only the first 'x' will be
  602. * scheduled.
  603. */
  604. enum {
  605. TE_V1_FRAG_NONE = 0,
  606. TE_V1_FRAG_SINGLE = 1,
  607. TE_V1_FRAG_DUAL = 2,
  608. TE_V1_FRAG_ENDLESS = 0xffffffff
  609. };
  610. /* If a Time Event can be fragmented, this is the max number of fragments */
  611. #define TE_V1_FRAG_MAX_MSK 0x0fffffff
  612. /* Repeat the time event endlessly (until removed) */
  613. #define TE_V1_REPEAT_ENDLESS 0xffffffff
  614. /* If a Time Event has bounded repetitions, this is the maximal value */
  615. #define TE_V1_REPEAT_MAX_MSK_V1 0x0fffffff
  616. /* Time Event dependencies: none, on another TE, or in a specific time */
  617. enum {
  618. TE_V1_INDEPENDENT = 0,
  619. TE_V1_DEP_OTHER = BIT(0),
  620. TE_V1_DEP_TSF = BIT(1),
  621. TE_V1_EVENT_SOCIOPATHIC = BIT(2),
  622. }; /* MAC_EVENT_DEPENDENCY_POLICY_API_E_VER_2 */
  623. /*
  624. * @TE_V1_NOTIF_NONE: no notifications
  625. * @TE_V1_NOTIF_HOST_EVENT_START: request/receive notification on event start
  626. * @TE_V1_NOTIF_HOST_EVENT_END:request/receive notification on event end
  627. * @TE_V1_NOTIF_INTERNAL_EVENT_START: internal FW use
  628. * @TE_V1_NOTIF_INTERNAL_EVENT_END: internal FW use.
  629. * @TE_V1_NOTIF_HOST_FRAG_START: request/receive notification on frag start
  630. * @TE_V1_NOTIF_HOST_FRAG_END:request/receive notification on frag end
  631. * @TE_V1_NOTIF_INTERNAL_FRAG_START: internal FW use.
  632. * @TE_V1_NOTIF_INTERNAL_FRAG_END: internal FW use.
  633. *
  634. * Supported Time event notifications configuration.
  635. * A notification (both event and fragment) includes a status indicating weather
  636. * the FW was able to schedule the event or not. For fragment start/end
  637. * notification the status is always success. There is no start/end fragment
  638. * notification for monolithic events.
  639. */
  640. enum {
  641. TE_V1_NOTIF_NONE = 0,
  642. TE_V1_NOTIF_HOST_EVENT_START = BIT(0),
  643. TE_V1_NOTIF_HOST_EVENT_END = BIT(1),
  644. TE_V1_NOTIF_INTERNAL_EVENT_START = BIT(2),
  645. TE_V1_NOTIF_INTERNAL_EVENT_END = BIT(3),
  646. TE_V1_NOTIF_HOST_FRAG_START = BIT(4),
  647. TE_V1_NOTIF_HOST_FRAG_END = BIT(5),
  648. TE_V1_NOTIF_INTERNAL_FRAG_START = BIT(6),
  649. TE_V1_NOTIF_INTERNAL_FRAG_END = BIT(7),
  650. }; /* MAC_EVENT_ACTION_API_E_VER_2 */
  651. /* Time event - defines for command API */
  652. /*
  653. * @TE_V2_FRAG_NONE: fragmentation of the time event is NOT allowed.
  654. * @TE_V2_FRAG_SINGLE: fragmentation of the time event is allowed, but only
  655. * the first fragment is scheduled.
  656. * @TE_V2_FRAG_DUAL: fragmentation of the time event is allowed, but only
  657. * the first 2 fragments are scheduled.
  658. * @TE_V2_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
  659. * number of fragments are valid.
  660. *
  661. * Other than the constant defined above, specifying a fragmentation value 'x'
  662. * means that the event can be fragmented but only the first 'x' will be
  663. * scheduled.
  664. */
  665. enum {
  666. TE_V2_FRAG_NONE = 0,
  667. TE_V2_FRAG_SINGLE = 1,
  668. TE_V2_FRAG_DUAL = 2,
  669. TE_V2_FRAG_MAX = 0xfe,
  670. TE_V2_FRAG_ENDLESS = 0xff
  671. };
  672. /* Repeat the time event endlessly (until removed) */
  673. #define TE_V2_REPEAT_ENDLESS 0xff
  674. /* If a Time Event has bounded repetitions, this is the maximal value */
  675. #define TE_V2_REPEAT_MAX 0xfe
  676. #define TE_V2_PLACEMENT_POS 12
  677. #define TE_V2_ABSENCE_POS 15
  678. /* Time event policy values
  679. * A notification (both event and fragment) includes a status indicating weather
  680. * the FW was able to schedule the event or not. For fragment start/end
  681. * notification the status is always success. There is no start/end fragment
  682. * notification for monolithic events.
  683. *
  684. * @TE_V2_DEFAULT_POLICY: independent, social, present, unoticable
  685. * @TE_V2_NOTIF_HOST_EVENT_START: request/receive notification on event start
  686. * @TE_V2_NOTIF_HOST_EVENT_END:request/receive notification on event end
  687. * @TE_V2_NOTIF_INTERNAL_EVENT_START: internal FW use
  688. * @TE_V2_NOTIF_INTERNAL_EVENT_END: internal FW use.
  689. * @TE_V2_NOTIF_HOST_FRAG_START: request/receive notification on frag start
  690. * @TE_V2_NOTIF_HOST_FRAG_END:request/receive notification on frag end
  691. * @TE_V2_NOTIF_INTERNAL_FRAG_START: internal FW use.
  692. * @TE_V2_NOTIF_INTERNAL_FRAG_END: internal FW use.
  693. * @TE_V2_DEP_OTHER: depends on another time event
  694. * @TE_V2_DEP_TSF: depends on a specific time
  695. * @TE_V2_EVENT_SOCIOPATHIC: can't co-exist with other events of tha same MAC
  696. * @TE_V2_ABSENCE: are we present or absent during the Time Event.
  697. */
  698. enum {
  699. TE_V2_DEFAULT_POLICY = 0x0,
  700. /* notifications (event start/stop, fragment start/stop) */
  701. TE_V2_NOTIF_HOST_EVENT_START = BIT(0),
  702. TE_V2_NOTIF_HOST_EVENT_END = BIT(1),
  703. TE_V2_NOTIF_INTERNAL_EVENT_START = BIT(2),
  704. TE_V2_NOTIF_INTERNAL_EVENT_END = BIT(3),
  705. TE_V2_NOTIF_HOST_FRAG_START = BIT(4),
  706. TE_V2_NOTIF_HOST_FRAG_END = BIT(5),
  707. TE_V2_NOTIF_INTERNAL_FRAG_START = BIT(6),
  708. TE_V2_NOTIF_INTERNAL_FRAG_END = BIT(7),
  709. T2_V2_START_IMMEDIATELY = BIT(11),
  710. TE_V2_NOTIF_MSK = 0xff,
  711. /* placement characteristics */
  712. TE_V2_DEP_OTHER = BIT(TE_V2_PLACEMENT_POS),
  713. TE_V2_DEP_TSF = BIT(TE_V2_PLACEMENT_POS + 1),
  714. TE_V2_EVENT_SOCIOPATHIC = BIT(TE_V2_PLACEMENT_POS + 2),
  715. /* are we present or absent during the Time Event. */
  716. TE_V2_ABSENCE = BIT(TE_V2_ABSENCE_POS),
  717. };
  718. /**
  719. * struct iwl_time_event_cmd_api - configuring Time Events
  720. * with struct MAC_TIME_EVENT_DATA_API_S_VER_2 (see also
  721. * with version 1. determined by IWL_UCODE_TLV_FLAGS)
  722. * ( TIME_EVENT_CMD = 0x29 )
  723. * @id_and_color: ID and color of the relevant MAC
  724. * @action: action to perform, one of FW_CTXT_ACTION_*
  725. * @id: this field has two meanings, depending on the action:
  726. * If the action is ADD, then it means the type of event to add.
  727. * For all other actions it is the unique event ID assigned when the
  728. * event was added by the FW.
  729. * @apply_time: When to start the Time Event (in GP2)
  730. * @max_delay: maximum delay to event's start (apply time), in TU
  731. * @depends_on: the unique ID of the event we depend on (if any)
  732. * @interval: interval between repetitions, in TU
  733. * @duration: duration of event in TU
  734. * @repeat: how many repetitions to do, can be TE_REPEAT_ENDLESS
  735. * @max_frags: maximal number of fragments the Time Event can be divided to
  736. * @policy: defines whether uCode shall notify the host or other uCode modules
  737. * on event and/or fragment start and/or end
  738. * using one of TE_INDEPENDENT, TE_DEP_OTHER, TE_DEP_TSF
  739. * TE_EVENT_SOCIOPATHIC
  740. * using TE_ABSENCE and using TE_NOTIF_*
  741. */
  742. struct iwl_time_event_cmd {
  743. /* COMMON_INDEX_HDR_API_S_VER_1 */
  744. __le32 id_and_color;
  745. __le32 action;
  746. __le32 id;
  747. /* MAC_TIME_EVENT_DATA_API_S_VER_2 */
  748. __le32 apply_time;
  749. __le32 max_delay;
  750. __le32 depends_on;
  751. __le32 interval;
  752. __le32 duration;
  753. u8 repeat;
  754. u8 max_frags;
  755. __le16 policy;
  756. } __packed; /* MAC_TIME_EVENT_CMD_API_S_VER_2 */
  757. /**
  758. * struct iwl_time_event_resp - response structure to iwl_time_event_cmd
  759. * @status: bit 0 indicates success, all others specify errors
  760. * @id: the Time Event type
  761. * @unique_id: the unique ID assigned (in ADD) or given (others) to the TE
  762. * @id_and_color: ID and color of the relevant MAC
  763. */
  764. struct iwl_time_event_resp {
  765. __le32 status;
  766. __le32 id;
  767. __le32 unique_id;
  768. __le32 id_and_color;
  769. } __packed; /* MAC_TIME_EVENT_RSP_API_S_VER_1 */
  770. /**
  771. * struct iwl_time_event_notif - notifications of time event start/stop
  772. * ( TIME_EVENT_NOTIFICATION = 0x2a )
  773. * @timestamp: action timestamp in GP2
  774. * @session_id: session's unique id
  775. * @unique_id: unique id of the Time Event itself
  776. * @id_and_color: ID and color of the relevant MAC
  777. * @action: one of TE_NOTIF_START or TE_NOTIF_END
  778. * @status: true if scheduled, false otherwise (not executed)
  779. */
  780. struct iwl_time_event_notif {
  781. __le32 timestamp;
  782. __le32 session_id;
  783. __le32 unique_id;
  784. __le32 id_and_color;
  785. __le32 action;
  786. __le32 status;
  787. } __packed; /* MAC_TIME_EVENT_NTFY_API_S_VER_1 */
  788. /* Bindings and Time Quota */
  789. /**
  790. * struct iwl_binding_cmd - configuring bindings
  791. * ( BINDING_CONTEXT_CMD = 0x2b )
  792. * @id_and_color: ID and color of the relevant Binding
  793. * @action: action to perform, one of FW_CTXT_ACTION_*
  794. * @macs: array of MAC id and colors which belong to the binding
  795. * @phy: PHY id and color which belongs to the binding
  796. */
  797. struct iwl_binding_cmd {
  798. /* COMMON_INDEX_HDR_API_S_VER_1 */
  799. __le32 id_and_color;
  800. __le32 action;
  801. /* BINDING_DATA_API_S_VER_1 */
  802. __le32 macs[MAX_MACS_IN_BINDING];
  803. __le32 phy;
  804. } __packed; /* BINDING_CMD_API_S_VER_1 */
  805. /* The maximal number of fragments in the FW's schedule session */
  806. #define IWL_MVM_MAX_QUOTA 128
  807. /**
  808. * struct iwl_time_quota_data - configuration of time quota per binding
  809. * @id_and_color: ID and color of the relevant Binding
  810. * @quota: absolute time quota in TU. The scheduler will try to divide the
  811. * remainig quota (after Time Events) according to this quota.
  812. * @max_duration: max uninterrupted context duration in TU
  813. */
  814. struct iwl_time_quota_data {
  815. __le32 id_and_color;
  816. __le32 quota;
  817. __le32 max_duration;
  818. } __packed; /* TIME_QUOTA_DATA_API_S_VER_1 */
  819. /**
  820. * struct iwl_time_quota_cmd - configuration of time quota between bindings
  821. * ( TIME_QUOTA_CMD = 0x2c )
  822. * @quotas: allocations per binding
  823. */
  824. struct iwl_time_quota_cmd {
  825. struct iwl_time_quota_data quotas[MAX_BINDINGS];
  826. } __packed; /* TIME_QUOTA_ALLOCATION_CMD_API_S_VER_1 */
  827. /* PHY context */
  828. /* Supported bands */
  829. #define PHY_BAND_5 (0)
  830. #define PHY_BAND_24 (1)
  831. /* Supported channel width, vary if there is VHT support */
  832. #define PHY_VHT_CHANNEL_MODE20 (0x0)
  833. #define PHY_VHT_CHANNEL_MODE40 (0x1)
  834. #define PHY_VHT_CHANNEL_MODE80 (0x2)
  835. #define PHY_VHT_CHANNEL_MODE160 (0x3)
  836. /*
  837. * Control channel position:
  838. * For legacy set bit means upper channel, otherwise lower.
  839. * For VHT - bit-2 marks if the control is lower/upper relative to center-freq
  840. * bits-1:0 mark the distance from the center freq. for 20Mhz, offset is 0.
  841. * center_freq
  842. * |
  843. * 40Mhz |_______|_______|
  844. * 80Mhz |_______|_______|_______|_______|
  845. * 160Mhz |_______|_______|_______|_______|_______|_______|_______|_______|
  846. * code 011 010 001 000 | 100 101 110 111
  847. */
  848. #define PHY_VHT_CTRL_POS_1_BELOW (0x0)
  849. #define PHY_VHT_CTRL_POS_2_BELOW (0x1)
  850. #define PHY_VHT_CTRL_POS_3_BELOW (0x2)
  851. #define PHY_VHT_CTRL_POS_4_BELOW (0x3)
  852. #define PHY_VHT_CTRL_POS_1_ABOVE (0x4)
  853. #define PHY_VHT_CTRL_POS_2_ABOVE (0x5)
  854. #define PHY_VHT_CTRL_POS_3_ABOVE (0x6)
  855. #define PHY_VHT_CTRL_POS_4_ABOVE (0x7)
  856. /*
  857. * @band: PHY_BAND_*
  858. * @channel: channel number
  859. * @width: PHY_[VHT|LEGACY]_CHANNEL_*
  860. * @ctrl channel: PHY_[VHT|LEGACY]_CTRL_*
  861. */
  862. struct iwl_fw_channel_info {
  863. u8 band;
  864. u8 channel;
  865. u8 width;
  866. u8 ctrl_pos;
  867. } __packed;
  868. #define PHY_RX_CHAIN_DRIVER_FORCE_POS (0)
  869. #define PHY_RX_CHAIN_DRIVER_FORCE_MSK \
  870. (0x1 << PHY_RX_CHAIN_DRIVER_FORCE_POS)
  871. #define PHY_RX_CHAIN_VALID_POS (1)
  872. #define PHY_RX_CHAIN_VALID_MSK \
  873. (0x7 << PHY_RX_CHAIN_VALID_POS)
  874. #define PHY_RX_CHAIN_FORCE_SEL_POS (4)
  875. #define PHY_RX_CHAIN_FORCE_SEL_MSK \
  876. (0x7 << PHY_RX_CHAIN_FORCE_SEL_POS)
  877. #define PHY_RX_CHAIN_FORCE_MIMO_SEL_POS (7)
  878. #define PHY_RX_CHAIN_FORCE_MIMO_SEL_MSK \
  879. (0x7 << PHY_RX_CHAIN_FORCE_MIMO_SEL_POS)
  880. #define PHY_RX_CHAIN_CNT_POS (10)
  881. #define PHY_RX_CHAIN_CNT_MSK \
  882. (0x3 << PHY_RX_CHAIN_CNT_POS)
  883. #define PHY_RX_CHAIN_MIMO_CNT_POS (12)
  884. #define PHY_RX_CHAIN_MIMO_CNT_MSK \
  885. (0x3 << PHY_RX_CHAIN_MIMO_CNT_POS)
  886. #define PHY_RX_CHAIN_MIMO_FORCE_POS (14)
  887. #define PHY_RX_CHAIN_MIMO_FORCE_MSK \
  888. (0x1 << PHY_RX_CHAIN_MIMO_FORCE_POS)
  889. /* TODO: fix the value, make it depend on firmware at runtime? */
  890. #define NUM_PHY_CTX 3
  891. /* TODO: complete missing documentation */
  892. /**
  893. * struct iwl_phy_context_cmd - config of the PHY context
  894. * ( PHY_CONTEXT_CMD = 0x8 )
  895. * @id_and_color: ID and color of the relevant Binding
  896. * @action: action to perform, one of FW_CTXT_ACTION_*
  897. * @apply_time: 0 means immediate apply and context switch.
  898. * other value means apply new params after X usecs
  899. * @tx_param_color: ???
  900. * @channel_info:
  901. * @txchain_info: ???
  902. * @rxchain_info: ???
  903. * @acquisition_data: ???
  904. * @dsp_cfg_flags: set to 0
  905. */
  906. struct iwl_phy_context_cmd {
  907. /* COMMON_INDEX_HDR_API_S_VER_1 */
  908. __le32 id_and_color;
  909. __le32 action;
  910. /* PHY_CONTEXT_DATA_API_S_VER_1 */
  911. __le32 apply_time;
  912. __le32 tx_param_color;
  913. struct iwl_fw_channel_info ci;
  914. __le32 txchain_info;
  915. __le32 rxchain_info;
  916. __le32 acquisition_data;
  917. __le32 dsp_cfg_flags;
  918. } __packed; /* PHY_CONTEXT_CMD_API_VER_1 */
  919. /*
  920. * Aux ROC command
  921. *
  922. * Command requests the firmware to create a time event for a certain duration
  923. * and remain on the given channel. This is done by using the Aux framework in
  924. * the FW.
  925. * The command was first used for Hot Spot issues - but can be used regardless
  926. * to Hot Spot.
  927. *
  928. * ( HOT_SPOT_CMD 0x53 )
  929. *
  930. * @id_and_color: ID and color of the MAC
  931. * @action: action to perform, one of FW_CTXT_ACTION_*
  932. * @event_unique_id: If the action FW_CTXT_ACTION_REMOVE then the
  933. * event_unique_id should be the id of the time event assigned by ucode.
  934. * Otherwise ignore the event_unique_id.
  935. * @sta_id_and_color: station id and color, resumed during "Remain On Channel"
  936. * activity.
  937. * @channel_info: channel info
  938. * @node_addr: Our MAC Address
  939. * @reserved: reserved for alignment
  940. * @apply_time: GP2 value to start (should always be the current GP2 value)
  941. * @apply_time_max_delay: Maximum apply time delay value in TU. Defines max
  942. * time by which start of the event is allowed to be postponed.
  943. * @duration: event duration in TU To calculate event duration:
  944. * timeEventDuration = min(duration, remainingQuota)
  945. */
  946. struct iwl_hs20_roc_req {
  947. /* COMMON_INDEX_HDR_API_S_VER_1 hdr */
  948. __le32 id_and_color;
  949. __le32 action;
  950. __le32 event_unique_id;
  951. __le32 sta_id_and_color;
  952. struct iwl_fw_channel_info channel_info;
  953. u8 node_addr[ETH_ALEN];
  954. __le16 reserved;
  955. __le32 apply_time;
  956. __le32 apply_time_max_delay;
  957. __le32 duration;
  958. } __packed; /* HOT_SPOT_CMD_API_S_VER_1 */
  959. /*
  960. * values for AUX ROC result values
  961. */
  962. enum iwl_mvm_hot_spot {
  963. HOT_SPOT_RSP_STATUS_OK,
  964. HOT_SPOT_RSP_STATUS_TOO_MANY_EVENTS,
  965. HOT_SPOT_MAX_NUM_OF_SESSIONS,
  966. };
  967. /*
  968. * Aux ROC command response
  969. *
  970. * In response to iwl_hs20_roc_req the FW sends this command to notify the
  971. * driver the uid of the timevent.
  972. *
  973. * ( HOT_SPOT_CMD 0x53 )
  974. *
  975. * @event_unique_id: Unique ID of time event assigned by ucode
  976. * @status: Return status 0 is success, all the rest used for specific errors
  977. */
  978. struct iwl_hs20_roc_res {
  979. __le32 event_unique_id;
  980. __le32 status;
  981. } __packed; /* HOT_SPOT_RSP_API_S_VER_1 */
  982. /**
  983. * struct iwl_radio_version_notif - information on the radio version
  984. * ( RADIO_VERSION_NOTIFICATION = 0x68 )
  985. * @radio_flavor:
  986. * @radio_step:
  987. * @radio_dash:
  988. */
  989. struct iwl_radio_version_notif {
  990. __le32 radio_flavor;
  991. __le32 radio_step;
  992. __le32 radio_dash;
  993. } __packed; /* RADIO_VERSION_NOTOFICATION_S_VER_1 */
  994. enum iwl_card_state_flags {
  995. CARD_ENABLED = 0x00,
  996. HW_CARD_DISABLED = 0x01,
  997. SW_CARD_DISABLED = 0x02,
  998. CT_KILL_CARD_DISABLED = 0x04,
  999. HALT_CARD_DISABLED = 0x08,
  1000. CARD_DISABLED_MSK = 0x0f,
  1001. CARD_IS_RX_ON = 0x10,
  1002. };
  1003. /**
  1004. * struct iwl_radio_version_notif - information on the radio version
  1005. * ( CARD_STATE_NOTIFICATION = 0xa1 )
  1006. * @flags: %iwl_card_state_flags
  1007. */
  1008. struct iwl_card_state_notif {
  1009. __le32 flags;
  1010. } __packed; /* CARD_STATE_NTFY_API_S_VER_1 */
  1011. /**
  1012. * struct iwl_missed_beacons_notif - information on missed beacons
  1013. * ( MISSED_BEACONS_NOTIFICATION = 0xa2 )
  1014. * @mac_id: interface ID
  1015. * @consec_missed_beacons_since_last_rx: number of consecutive missed
  1016. * beacons since last RX.
  1017. * @consec_missed_beacons: number of consecutive missed beacons
  1018. * @num_expected_beacons:
  1019. * @num_recvd_beacons:
  1020. */
  1021. struct iwl_missed_beacons_notif {
  1022. __le32 mac_id;
  1023. __le32 consec_missed_beacons_since_last_rx;
  1024. __le32 consec_missed_beacons;
  1025. __le32 num_expected_beacons;
  1026. __le32 num_recvd_beacons;
  1027. } __packed; /* MISSED_BEACON_NTFY_API_S_VER_3 */
  1028. /**
  1029. * struct iwl_mfuart_load_notif - mfuart image version & status
  1030. * ( MFUART_LOAD_NOTIFICATION = 0xb1 )
  1031. * @installed_ver: installed image version
  1032. * @external_ver: external image version
  1033. * @status: MFUART loading status
  1034. * @duration: MFUART loading time
  1035. */
  1036. struct iwl_mfuart_load_notif {
  1037. __le32 installed_ver;
  1038. __le32 external_ver;
  1039. __le32 status;
  1040. __le32 duration;
  1041. } __packed; /*MFU_LOADER_NTFY_API_S_VER_1*/
  1042. /**
  1043. * struct iwl_set_calib_default_cmd - set default value for calibration.
  1044. * ( SET_CALIB_DEFAULT_CMD = 0x8e )
  1045. * @calib_index: the calibration to set value for
  1046. * @length: of data
  1047. * @data: the value to set for the calibration result
  1048. */
  1049. struct iwl_set_calib_default_cmd {
  1050. __le16 calib_index;
  1051. __le16 length;
  1052. u8 data[0];
  1053. } __packed; /* PHY_CALIB_OVERRIDE_VALUES_S */
  1054. #define MAX_PORT_ID_NUM 2
  1055. #define MAX_MCAST_FILTERING_ADDRESSES 256
  1056. /**
  1057. * struct iwl_mcast_filter_cmd - configure multicast filter.
  1058. * @filter_own: Set 1 to filter out multicast packets sent by station itself
  1059. * @port_id: Multicast MAC addresses array specifier. This is a strange way
  1060. * to identify network interface adopted in host-device IF.
  1061. * It is used by FW as index in array of addresses. This array has
  1062. * MAX_PORT_ID_NUM members.
  1063. * @count: Number of MAC addresses in the array
  1064. * @pass_all: Set 1 to pass all multicast packets.
  1065. * @bssid: current association BSSID.
  1066. * @addr_list: Place holder for array of MAC addresses.
  1067. * IMPORTANT: add padding if necessary to ensure DWORD alignment.
  1068. */
  1069. struct iwl_mcast_filter_cmd {
  1070. u8 filter_own;
  1071. u8 port_id;
  1072. u8 count;
  1073. u8 pass_all;
  1074. u8 bssid[6];
  1075. u8 reserved[2];
  1076. u8 addr_list[0];
  1077. } __packed; /* MCAST_FILTERING_CMD_API_S_VER_1 */
  1078. #define MAX_BCAST_FILTERS 8
  1079. #define MAX_BCAST_FILTER_ATTRS 2
  1080. /**
  1081. * enum iwl_mvm_bcast_filter_attr_offset - written by fw for each Rx packet
  1082. * @BCAST_FILTER_OFFSET_PAYLOAD_START: offset is from payload start.
  1083. * @BCAST_FILTER_OFFSET_IP_END: offset is from ip header end (i.e.
  1084. * start of ip payload).
  1085. */
  1086. enum iwl_mvm_bcast_filter_attr_offset {
  1087. BCAST_FILTER_OFFSET_PAYLOAD_START = 0,
  1088. BCAST_FILTER_OFFSET_IP_END = 1,
  1089. };
  1090. /**
  1091. * struct iwl_fw_bcast_filter_attr - broadcast filter attribute
  1092. * @offset_type: &enum iwl_mvm_bcast_filter_attr_offset.
  1093. * @offset: starting offset of this pattern.
  1094. * @val: value to match - big endian (MSB is the first
  1095. * byte to match from offset pos).
  1096. * @mask: mask to match (big endian).
  1097. */
  1098. struct iwl_fw_bcast_filter_attr {
  1099. u8 offset_type;
  1100. u8 offset;
  1101. __le16 reserved1;
  1102. __be32 val;
  1103. __be32 mask;
  1104. } __packed; /* BCAST_FILTER_ATT_S_VER_1 */
  1105. /**
  1106. * enum iwl_mvm_bcast_filter_frame_type - filter frame type
  1107. * @BCAST_FILTER_FRAME_TYPE_ALL: consider all frames.
  1108. * @BCAST_FILTER_FRAME_TYPE_IPV4: consider only ipv4 frames
  1109. */
  1110. enum iwl_mvm_bcast_filter_frame_type {
  1111. BCAST_FILTER_FRAME_TYPE_ALL = 0,
  1112. BCAST_FILTER_FRAME_TYPE_IPV4 = 1,
  1113. };
  1114. /**
  1115. * struct iwl_fw_bcast_filter - broadcast filter
  1116. * @discard: discard frame (1) or let it pass (0).
  1117. * @frame_type: &enum iwl_mvm_bcast_filter_frame_type.
  1118. * @num_attrs: number of valid attributes in this filter.
  1119. * @attrs: attributes of this filter. a filter is considered matched
  1120. * only when all its attributes are matched (i.e. AND relationship)
  1121. */
  1122. struct iwl_fw_bcast_filter {
  1123. u8 discard;
  1124. u8 frame_type;
  1125. u8 num_attrs;
  1126. u8 reserved1;
  1127. struct iwl_fw_bcast_filter_attr attrs[MAX_BCAST_FILTER_ATTRS];
  1128. } __packed; /* BCAST_FILTER_S_VER_1 */
  1129. /**
  1130. * struct iwl_fw_bcast_mac - per-mac broadcast filtering configuration.
  1131. * @default_discard: default action for this mac (discard (1) / pass (0)).
  1132. * @attached_filters: bitmap of relevant filters for this mac.
  1133. */
  1134. struct iwl_fw_bcast_mac {
  1135. u8 default_discard;
  1136. u8 reserved1;
  1137. __le16 attached_filters;
  1138. } __packed; /* BCAST_MAC_CONTEXT_S_VER_1 */
  1139. /**
  1140. * struct iwl_bcast_filter_cmd - broadcast filtering configuration
  1141. * @disable: enable (0) / disable (1)
  1142. * @max_bcast_filters: max number of filters (MAX_BCAST_FILTERS)
  1143. * @max_macs: max number of macs (NUM_MAC_INDEX_DRIVER)
  1144. * @filters: broadcast filters
  1145. * @macs: broadcast filtering configuration per-mac
  1146. */
  1147. struct iwl_bcast_filter_cmd {
  1148. u8 disable;
  1149. u8 max_bcast_filters;
  1150. u8 max_macs;
  1151. u8 reserved1;
  1152. struct iwl_fw_bcast_filter filters[MAX_BCAST_FILTERS];
  1153. struct iwl_fw_bcast_mac macs[NUM_MAC_INDEX_DRIVER];
  1154. } __packed; /* BCAST_FILTERING_HCMD_API_S_VER_1 */
  1155. /*
  1156. * enum iwl_mvm_marker_id - maker ids
  1157. *
  1158. * The ids for different type of markers to insert into the usniffer logs
  1159. */
  1160. enum iwl_mvm_marker_id {
  1161. MARKER_ID_TX_FRAME_LATENCY = 1,
  1162. }; /* MARKER_ID_API_E_VER_1 */
  1163. /**
  1164. * struct iwl_mvm_marker - mark info into the usniffer logs
  1165. *
  1166. * (MARKER_CMD = 0xcb)
  1167. *
  1168. * Mark the UTC time stamp into the usniffer logs together with additional
  1169. * metadata, so the usniffer output can be parsed.
  1170. * In the command response the ucode will return the GP2 time.
  1171. *
  1172. * @dw_len: The amount of dwords following this byte including this byte.
  1173. * @marker_id: A unique marker id (iwl_mvm_marker_id).
  1174. * @reserved: reserved.
  1175. * @timestamp: in milliseconds since 1970-01-01 00:00:00 UTC
  1176. * @metadata: additional meta data that will be written to the unsiffer log
  1177. */
  1178. struct iwl_mvm_marker {
  1179. u8 dwLen;
  1180. u8 markerId;
  1181. __le16 reserved;
  1182. __le64 timestamp;
  1183. __le32 metadata[0];
  1184. } __packed; /* MARKER_API_S_VER_1 */
  1185. /*
  1186. * enum iwl_dc2dc_config_id - flag ids
  1187. *
  1188. * Ids of dc2dc configuration flags
  1189. */
  1190. enum iwl_dc2dc_config_id {
  1191. DCDC_LOW_POWER_MODE_MSK_SET = 0x1, /* not used */
  1192. DCDC_FREQ_TUNE_SET = 0x2,
  1193. }; /* MARKER_ID_API_E_VER_1 */
  1194. /**
  1195. * struct iwl_dc2dc_config_cmd - configure dc2dc values
  1196. *
  1197. * (DC2DC_CONFIG_CMD = 0x83)
  1198. *
  1199. * Set/Get & configure dc2dc values.
  1200. * The command always returns the current dc2dc values.
  1201. *
  1202. * @flags: set/get dc2dc
  1203. * @enable_low_power_mode: not used.
  1204. * @dc2dc_freq_tune0: frequency divider - digital domain
  1205. * @dc2dc_freq_tune1: frequency divider - analog domain
  1206. */
  1207. struct iwl_dc2dc_config_cmd {
  1208. __le32 flags;
  1209. __le32 enable_low_power_mode; /* not used */
  1210. __le32 dc2dc_freq_tune0;
  1211. __le32 dc2dc_freq_tune1;
  1212. } __packed; /* DC2DC_CONFIG_CMD_API_S_VER_1 */
  1213. /**
  1214. * struct iwl_dc2dc_config_resp - response for iwl_dc2dc_config_cmd
  1215. *
  1216. * Current dc2dc values returned by the FW.
  1217. *
  1218. * @dc2dc_freq_tune0: frequency divider - digital domain
  1219. * @dc2dc_freq_tune1: frequency divider - analog domain
  1220. */
  1221. struct iwl_dc2dc_config_resp {
  1222. __le32 dc2dc_freq_tune0;
  1223. __le32 dc2dc_freq_tune1;
  1224. } __packed; /* DC2DC_CONFIG_RESP_API_S_VER_1 */
  1225. /***********************************
  1226. * Smart Fifo API
  1227. ***********************************/
  1228. /* Smart Fifo state */
  1229. enum iwl_sf_state {
  1230. SF_LONG_DELAY_ON = 0, /* should never be called by driver */
  1231. SF_FULL_ON,
  1232. SF_UNINIT,
  1233. SF_INIT_OFF,
  1234. SF_HW_NUM_STATES
  1235. };
  1236. /* Smart Fifo possible scenario */
  1237. enum iwl_sf_scenario {
  1238. SF_SCENARIO_SINGLE_UNICAST,
  1239. SF_SCENARIO_AGG_UNICAST,
  1240. SF_SCENARIO_MULTICAST,
  1241. SF_SCENARIO_BA_RESP,
  1242. SF_SCENARIO_TX_RESP,
  1243. SF_NUM_SCENARIO
  1244. };
  1245. #define SF_TRANSIENT_STATES_NUMBER 2 /* SF_LONG_DELAY_ON and SF_FULL_ON */
  1246. #define SF_NUM_TIMEOUT_TYPES 2 /* Aging timer and Idle timer */
  1247. /* smart FIFO default values */
  1248. #define SF_W_MARK_SISO 6144
  1249. #define SF_W_MARK_MIMO2 8192
  1250. #define SF_W_MARK_MIMO3 6144
  1251. #define SF_W_MARK_LEGACY 4096
  1252. #define SF_W_MARK_SCAN 4096
  1253. /* SF Scenarios timers for default configuration (aligned to 32 uSec) */
  1254. #define SF_SINGLE_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
  1255. #define SF_SINGLE_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
  1256. #define SF_AGG_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
  1257. #define SF_AGG_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
  1258. #define SF_MCAST_IDLE_TIMER_DEF 160 /* 150 mSec */
  1259. #define SF_MCAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
  1260. #define SF_BA_IDLE_TIMER_DEF 160 /* 150 uSec */
  1261. #define SF_BA_AGING_TIMER_DEF 400 /* 0.4 mSec */
  1262. #define SF_TX_RE_IDLE_TIMER_DEF 160 /* 150 uSec */
  1263. #define SF_TX_RE_AGING_TIMER_DEF 400 /* 0.4 mSec */
  1264. /* SF Scenarios timers for BSS MAC configuration (aligned to 32 uSec) */
  1265. #define SF_SINGLE_UNICAST_IDLE_TIMER 320 /* 300 uSec */
  1266. #define SF_SINGLE_UNICAST_AGING_TIMER 2016 /* 2 mSec */
  1267. #define SF_AGG_UNICAST_IDLE_TIMER 320 /* 300 uSec */
  1268. #define SF_AGG_UNICAST_AGING_TIMER 2016 /* 2 mSec */
  1269. #define SF_MCAST_IDLE_TIMER 2016 /* 2 mSec */
  1270. #define SF_MCAST_AGING_TIMER 10016 /* 10 mSec */
  1271. #define SF_BA_IDLE_TIMER 320 /* 300 uSec */
  1272. #define SF_BA_AGING_TIMER 2016 /* 2 mSec */
  1273. #define SF_TX_RE_IDLE_TIMER 320 /* 300 uSec */
  1274. #define SF_TX_RE_AGING_TIMER 2016 /* 2 mSec */
  1275. #define SF_LONG_DELAY_AGING_TIMER 1000000 /* 1 Sec */
  1276. #define SF_CFG_DUMMY_NOTIF_OFF BIT(16)
  1277. /**
  1278. * Smart Fifo configuration command.
  1279. * @state: smart fifo state, types listed in enum %iwl_sf_sate.
  1280. * @watermark: Minimum allowed availabe free space in RXF for transient state.
  1281. * @long_delay_timeouts: aging and idle timer values for each scenario
  1282. * in long delay state.
  1283. * @full_on_timeouts: timer values for each scenario in full on state.
  1284. */
  1285. struct iwl_sf_cfg_cmd {
  1286. __le32 state;
  1287. __le32 watermark[SF_TRANSIENT_STATES_NUMBER];
  1288. __le32 long_delay_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
  1289. __le32 full_on_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
  1290. } __packed; /* SF_CFG_API_S_VER_2 */
  1291. /***********************************
  1292. * Location Aware Regulatory (LAR) API - MCC updates
  1293. ***********************************/
  1294. /**
  1295. * struct iwl_mcc_update_cmd - Request the device to update geographic
  1296. * regulatory profile according to the given MCC (Mobile Country Code).
  1297. * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
  1298. * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
  1299. * MCC in the cmd response will be the relevant MCC in the NVM.
  1300. * @mcc: given mobile country code
  1301. * @source_id: the source from where we got the MCC, see iwl_mcc_source
  1302. * @reserved: reserved for alignment
  1303. */
  1304. struct iwl_mcc_update_cmd {
  1305. __le16 mcc;
  1306. u8 source_id;
  1307. u8 reserved;
  1308. } __packed; /* LAR_UPDATE_MCC_CMD_API_S */
  1309. /**
  1310. * iwl_mcc_update_resp - response to MCC_UPDATE_CMD.
  1311. * Contains the new channel control profile map, if changed, and the new MCC
  1312. * (mobile country code).
  1313. * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
  1314. * @status: see &enum iwl_mcc_update_status
  1315. * @mcc: the new applied MCC
  1316. * @cap: capabilities for all channels which matches the MCC
  1317. * @source_id: the MCC source, see iwl_mcc_source
  1318. * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
  1319. * channels, depending on platform)
  1320. * @channels: channel control data map, DWORD for each channel. Only the first
  1321. * 16bits are used.
  1322. */
  1323. struct iwl_mcc_update_resp {
  1324. __le32 status;
  1325. __le16 mcc;
  1326. u8 cap;
  1327. u8 source_id;
  1328. __le32 n_channels;
  1329. __le32 channels[0];
  1330. } __packed; /* LAR_UPDATE_MCC_CMD_RESP_S */
  1331. /**
  1332. * struct iwl_mcc_chub_notif - chub notifies of mcc change
  1333. * (MCC_CHUB_UPDATE_CMD = 0xc9)
  1334. * The Chub (Communication Hub, CommsHUB) is a HW component that connects to
  1335. * the cellular and connectivity cores that gets updates of the mcc, and
  1336. * notifies the ucode directly of any mcc change.
  1337. * The ucode requests the driver to request the device to update geographic
  1338. * regulatory profile according to the given MCC (Mobile Country Code).
  1339. * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
  1340. * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
  1341. * MCC in the cmd response will be the relevant MCC in the NVM.
  1342. * @mcc: given mobile country code
  1343. * @source_id: identity of the change originator, see iwl_mcc_source
  1344. * @reserved1: reserved for alignment
  1345. */
  1346. struct iwl_mcc_chub_notif {
  1347. u16 mcc;
  1348. u8 source_id;
  1349. u8 reserved1;
  1350. } __packed; /* LAR_MCC_NOTIFY_S */
  1351. enum iwl_mcc_update_status {
  1352. MCC_RESP_NEW_CHAN_PROFILE,
  1353. MCC_RESP_SAME_CHAN_PROFILE,
  1354. MCC_RESP_INVALID,
  1355. MCC_RESP_NVM_DISABLED,
  1356. MCC_RESP_ILLEGAL,
  1357. MCC_RESP_LOW_PRIORITY,
  1358. };
  1359. enum iwl_mcc_source {
  1360. MCC_SOURCE_OLD_FW = 0,
  1361. MCC_SOURCE_ME = 1,
  1362. MCC_SOURCE_BIOS = 2,
  1363. MCC_SOURCE_3G_LTE_HOST = 3,
  1364. MCC_SOURCE_3G_LTE_DEVICE = 4,
  1365. MCC_SOURCE_WIFI = 5,
  1366. MCC_SOURCE_RESERVED = 6,
  1367. MCC_SOURCE_DEFAULT = 7,
  1368. MCC_SOURCE_UNINITIALIZED = 8,
  1369. MCC_SOURCE_GET_CURRENT = 0x10
  1370. };
  1371. /* DTS measurements */
  1372. enum iwl_dts_measurement_flags {
  1373. DTS_TRIGGER_CMD_FLAGS_TEMP = BIT(0),
  1374. DTS_TRIGGER_CMD_FLAGS_VOLT = BIT(1),
  1375. };
  1376. /**
  1377. * iwl_dts_measurement_cmd - request DTS temperature and/or voltage measurements
  1378. *
  1379. * @flags: indicates which measurements we want as specified in &enum
  1380. * iwl_dts_measurement_flags
  1381. */
  1382. struct iwl_dts_measurement_cmd {
  1383. __le32 flags;
  1384. } __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_CMD_S */
  1385. /**
  1386. * enum iwl_dts_control_measurement_mode - DTS measurement type
  1387. * @DTS_AUTOMATIC: Automatic mode (full SW control). Provide temperature read
  1388. * back (latest value. Not waiting for new value). Use automatic
  1389. * SW DTS configuration.
  1390. * @DTS_REQUEST_READ: Request DTS read. Configure DTS with manual settings,
  1391. * trigger DTS reading and provide read back temperature read
  1392. * when available.
  1393. * @DTS_OVER_WRITE: over-write the DTS temperatures in the SW until next read
  1394. * @DTS_DIRECT_WITHOUT_MEASURE: DTS returns its latest temperature result,
  1395. * without measurement trigger.
  1396. */
  1397. enum iwl_dts_control_measurement_mode {
  1398. DTS_AUTOMATIC = 0,
  1399. DTS_REQUEST_READ = 1,
  1400. DTS_OVER_WRITE = 2,
  1401. DTS_DIRECT_WITHOUT_MEASURE = 3,
  1402. };
  1403. /**
  1404. * enum iwl_dts_used - DTS to use or used for measurement in the DTS request
  1405. * @DTS_USE_TOP: Top
  1406. * @DTS_USE_CHAIN_A: chain A
  1407. * @DTS_USE_CHAIN_B: chain B
  1408. * @DTS_USE_CHAIN_C: chain C
  1409. * @XTAL_TEMPERATURE - read temperature from xtal
  1410. */
  1411. enum iwl_dts_used {
  1412. DTS_USE_TOP = 0,
  1413. DTS_USE_CHAIN_A = 1,
  1414. DTS_USE_CHAIN_B = 2,
  1415. DTS_USE_CHAIN_C = 3,
  1416. XTAL_TEMPERATURE = 4,
  1417. };
  1418. /**
  1419. * enum iwl_dts_bit_mode - bit-mode to use in DTS request read mode
  1420. * @DTS_BIT6_MODE: bit 6 mode
  1421. * @DTS_BIT8_MODE: bit 8 mode
  1422. */
  1423. enum iwl_dts_bit_mode {
  1424. DTS_BIT6_MODE = 0,
  1425. DTS_BIT8_MODE = 1,
  1426. };
  1427. /**
  1428. * iwl_ext_dts_measurement_cmd - request extended DTS temperature measurements
  1429. * @control_mode: see &enum iwl_dts_control_measurement_mode
  1430. * @temperature: used when over write DTS mode is selected
  1431. * @sensor: set temperature sensor to use. See &enum iwl_dts_used
  1432. * @avg_factor: average factor to DTS in request DTS read mode
  1433. * @bit_mode: value defines the DTS bit mode to use. See &enum iwl_dts_bit_mode
  1434. * @step_duration: step duration for the DTS
  1435. */
  1436. struct iwl_ext_dts_measurement_cmd {
  1437. __le32 control_mode;
  1438. __le32 temperature;
  1439. __le32 sensor;
  1440. __le32 avg_factor;
  1441. __le32 bit_mode;
  1442. __le32 step_duration;
  1443. } __packed; /* XVT_FW_DTS_CONTROL_MEASUREMENT_REQUEST_API_S */
  1444. /**
  1445. * iwl_dts_measurement_notif - notification received with the measurements
  1446. *
  1447. * @temp: the measured temperature
  1448. * @voltage: the measured voltage
  1449. */
  1450. struct iwl_dts_measurement_notif {
  1451. __le32 temp;
  1452. __le32 voltage;
  1453. } __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S */
  1454. /***********************************
  1455. * TDLS API
  1456. ***********************************/
  1457. /* Type of TDLS request */
  1458. enum iwl_tdls_channel_switch_type {
  1459. TDLS_SEND_CHAN_SW_REQ = 0,
  1460. TDLS_SEND_CHAN_SW_RESP_AND_MOVE_CH,
  1461. TDLS_MOVE_CH,
  1462. }; /* TDLS_STA_CHANNEL_SWITCH_CMD_TYPE_API_E_VER_1 */
  1463. /**
  1464. * Switch timing sub-element in a TDLS channel-switch command
  1465. * @frame_timestamp: GP2 timestamp of channel-switch request/response packet
  1466. * received from peer
  1467. * @max_offchan_duration: What amount of microseconds out of a DTIM is given
  1468. * to the TDLS off-channel communication. For instance if the DTIM is
  1469. * 200TU and the TDLS peer is to be given 25% of the time, the value
  1470. * given will be 50TU, or 50 * 1024 if translated into microseconds.
  1471. * @switch_time: switch time the peer sent in its channel switch timing IE
  1472. * @switch_timout: switch timeout the peer sent in its channel switch timing IE
  1473. */
  1474. struct iwl_tdls_channel_switch_timing {
  1475. __le32 frame_timestamp; /* GP2 time of peer packet Rx */
  1476. __le32 max_offchan_duration; /* given in micro-seconds */
  1477. __le32 switch_time; /* given in micro-seconds */
  1478. __le32 switch_timeout; /* given in micro-seconds */
  1479. } __packed; /* TDLS_STA_CHANNEL_SWITCH_TIMING_DATA_API_S_VER_1 */
  1480. #define IWL_TDLS_CH_SW_FRAME_MAX_SIZE 200
  1481. /**
  1482. * TDLS channel switch frame template
  1483. *
  1484. * A template representing a TDLS channel-switch request or response frame
  1485. *
  1486. * @switch_time_offset: offset to the channel switch timing IE in the template
  1487. * @tx_cmd: Tx parameters for the frame
  1488. * @data: frame data
  1489. */
  1490. struct iwl_tdls_channel_switch_frame {
  1491. __le32 switch_time_offset;
  1492. struct iwl_tx_cmd tx_cmd;
  1493. u8 data[IWL_TDLS_CH_SW_FRAME_MAX_SIZE];
  1494. } __packed; /* TDLS_STA_CHANNEL_SWITCH_FRAME_API_S_VER_1 */
  1495. /**
  1496. * TDLS channel switch command
  1497. *
  1498. * The command is sent to initiate a channel switch and also in response to
  1499. * incoming TDLS channel-switch request/response packets from remote peers.
  1500. *
  1501. * @switch_type: see &enum iwl_tdls_channel_switch_type
  1502. * @peer_sta_id: station id of TDLS peer
  1503. * @ci: channel we switch to
  1504. * @timing: timing related data for command
  1505. * @frame: channel-switch request/response template, depending to switch_type
  1506. */
  1507. struct iwl_tdls_channel_switch_cmd {
  1508. u8 switch_type;
  1509. __le32 peer_sta_id;
  1510. struct iwl_fw_channel_info ci;
  1511. struct iwl_tdls_channel_switch_timing timing;
  1512. struct iwl_tdls_channel_switch_frame frame;
  1513. } __packed; /* TDLS_STA_CHANNEL_SWITCH_CMD_API_S_VER_1 */
  1514. /**
  1515. * TDLS channel switch start notification
  1516. *
  1517. * @status: non-zero on success
  1518. * @offchannel_duration: duration given in microseconds
  1519. * @sta_id: peer currently performing the channel-switch with
  1520. */
  1521. struct iwl_tdls_channel_switch_notif {
  1522. __le32 status;
  1523. __le32 offchannel_duration;
  1524. __le32 sta_id;
  1525. } __packed; /* TDLS_STA_CHANNEL_SWITCH_NTFY_API_S_VER_1 */
  1526. /**
  1527. * TDLS station info
  1528. *
  1529. * @sta_id: station id of the TDLS peer
  1530. * @tx_to_peer_tid: TID reserved vs. the peer for FW based Tx
  1531. * @tx_to_peer_ssn: initial SSN the FW should use for Tx on its TID vs the peer
  1532. * @is_initiator: 1 if the peer is the TDLS link initiator, 0 otherwise
  1533. */
  1534. struct iwl_tdls_sta_info {
  1535. u8 sta_id;
  1536. u8 tx_to_peer_tid;
  1537. __le16 tx_to_peer_ssn;
  1538. __le32 is_initiator;
  1539. } __packed; /* TDLS_STA_INFO_VER_1 */
  1540. /**
  1541. * TDLS basic config command
  1542. *
  1543. * @id_and_color: MAC id and color being configured
  1544. * @tdls_peer_count: amount of currently connected TDLS peers
  1545. * @tx_to_ap_tid: TID reverved vs. the AP for FW based Tx
  1546. * @tx_to_ap_ssn: initial SSN the FW should use for Tx on its TID vs. the AP
  1547. * @sta_info: per-station info. Only the first tdls_peer_count entries are set
  1548. * @pti_req_data_offset: offset of network-level data for the PTI template
  1549. * @pti_req_tx_cmd: Tx parameters for PTI request template
  1550. * @pti_req_template: PTI request template data
  1551. */
  1552. struct iwl_tdls_config_cmd {
  1553. __le32 id_and_color; /* mac id and color */
  1554. u8 tdls_peer_count;
  1555. u8 tx_to_ap_tid;
  1556. __le16 tx_to_ap_ssn;
  1557. struct iwl_tdls_sta_info sta_info[IWL_MVM_TDLS_STA_COUNT];
  1558. __le32 pti_req_data_offset;
  1559. struct iwl_tx_cmd pti_req_tx_cmd;
  1560. u8 pti_req_template[0];
  1561. } __packed; /* TDLS_CONFIG_CMD_API_S_VER_1 */
  1562. /**
  1563. * TDLS per-station config information from FW
  1564. *
  1565. * @sta_id: station id of the TDLS peer
  1566. * @tx_to_peer_last_seq: last sequence number used by FW during FW-based Tx to
  1567. * the peer
  1568. */
  1569. struct iwl_tdls_config_sta_info_res {
  1570. __le16 sta_id;
  1571. __le16 tx_to_peer_last_seq;
  1572. } __packed; /* TDLS_STA_INFO_RSP_VER_1 */
  1573. /**
  1574. * TDLS config information from FW
  1575. *
  1576. * @tx_to_ap_last_seq: last sequence number used by FW during FW-based Tx to AP
  1577. * @sta_info: per-station TDLS config information
  1578. */
  1579. struct iwl_tdls_config_res {
  1580. __le32 tx_to_ap_last_seq;
  1581. struct iwl_tdls_config_sta_info_res sta_info[IWL_MVM_TDLS_STA_COUNT];
  1582. } __packed; /* TDLS_CONFIG_RSP_API_S_VER_1 */
  1583. #define TX_FIFO_MAX_NUM 8
  1584. #define RX_FIFO_MAX_NUM 2
  1585. /**
  1586. * Shared memory configuration information from the FW
  1587. *
  1588. * @shared_mem_addr: shared memory addr (pre 8000 HW set to 0x0 as MARBH is not
  1589. * accessible)
  1590. * @shared_mem_size: shared memory size
  1591. * @sample_buff_addr: internal sample (mon/adc) buff addr (pre 8000 HW set to
  1592. * 0x0 as accessible only via DBGM RDAT)
  1593. * @sample_buff_size: internal sample buff size
  1594. * @txfifo_addr: start addr of TXF0 (excluding the context table 0.5KB), (pre
  1595. * 8000 HW set to 0x0 as not accessible)
  1596. * @txfifo_size: size of TXF0 ... TXF7
  1597. * @rxfifo_size: RXF1, RXF2 sizes. If there is no RXF2, it'll have a value of 0
  1598. * @page_buff_addr: used by UMAC and performance debug (page miss analysis),
  1599. * when paging is not supported this should be 0
  1600. * @page_buff_size: size of %page_buff_addr
  1601. */
  1602. struct iwl_shared_mem_cfg {
  1603. __le32 shared_mem_addr;
  1604. __le32 shared_mem_size;
  1605. __le32 sample_buff_addr;
  1606. __le32 sample_buff_size;
  1607. __le32 txfifo_addr;
  1608. __le32 txfifo_size[TX_FIFO_MAX_NUM];
  1609. __le32 rxfifo_size[RX_FIFO_MAX_NUM];
  1610. __le32 page_buff_addr;
  1611. __le32 page_buff_size;
  1612. } __packed; /* SHARED_MEM_ALLOC_API_S_VER_1 */
  1613. #endif /* __fw_api_h__ */