fw-api.h 67 KB

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