fw-api.h 53 KB

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