fw-api.h 65 KB

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