fw-api.h 83 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905
  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. /**
  127. * enum iwl_legacy_cmds - legacy group command IDs
  128. */
  129. enum iwl_legacy_cmds {
  130. /**
  131. * @MVM_ALIVE:
  132. * Alive data from the firmware, as described in
  133. * &struct mvm_alive_resp_v3 or &struct mvm_alive_resp.
  134. */
  135. MVM_ALIVE = 0x1,
  136. /**
  137. * @REPLY_ERROR: Cause an error in the firmware, for testing purposes.
  138. */
  139. REPLY_ERROR = 0x2,
  140. /**
  141. * @ECHO_CMD: Send data to the device to have it returned immediately.
  142. */
  143. ECHO_CMD = 0x3,
  144. /**
  145. * @INIT_COMPLETE_NOTIF: Notification that initialization is complete.
  146. */
  147. INIT_COMPLETE_NOTIF = 0x4,
  148. /**
  149. * @PHY_CONTEXT_CMD:
  150. * Add/modify/remove a PHY context, using &struct iwl_phy_context_cmd.
  151. */
  152. PHY_CONTEXT_CMD = 0x8,
  153. /**
  154. * @DBG_CFG: Debug configuration command.
  155. */
  156. DBG_CFG = 0x9,
  157. /**
  158. * @ANTENNA_COUPLING_NOTIFICATION:
  159. * Antenna coupling data, &struct iwl_mvm_antenna_coupling_notif
  160. */
  161. ANTENNA_COUPLING_NOTIFICATION = 0xa,
  162. /**
  163. * @SCAN_ITERATION_COMPLETE_UMAC:
  164. * Firmware indicates a scan iteration completed, using
  165. * &struct iwl_umac_scan_iter_complete_notif.
  166. */
  167. SCAN_ITERATION_COMPLETE_UMAC = 0xb5,
  168. /**
  169. * @SCAN_CFG_CMD:
  170. * uses &struct iwl_scan_config_v1 or &struct iwl_scan_config
  171. */
  172. SCAN_CFG_CMD = 0xc,
  173. /**
  174. * @SCAN_REQ_UMAC: uses &struct iwl_scan_req_umac
  175. */
  176. SCAN_REQ_UMAC = 0xd,
  177. /**
  178. * @SCAN_ABORT_UMAC: uses &struct iwl_umac_scan_abort
  179. */
  180. SCAN_ABORT_UMAC = 0xe,
  181. /**
  182. * @SCAN_COMPLETE_UMAC: uses &struct iwl_umac_scan_complete
  183. */
  184. SCAN_COMPLETE_UMAC = 0xf,
  185. /**
  186. * @BA_WINDOW_STATUS_NOTIFICATION_ID:
  187. * uses &struct iwl_ba_window_status_notif
  188. */
  189. BA_WINDOW_STATUS_NOTIFICATION_ID = 0x13,
  190. /**
  191. * @ADD_STA_KEY:
  192. * &struct iwl_mvm_add_sta_key_cmd_v1 or
  193. * &struct iwl_mvm_add_sta_key_cmd.
  194. */
  195. ADD_STA_KEY = 0x17,
  196. /**
  197. * @ADD_STA:
  198. * &struct iwl_mvm_add_sta_cmd or &struct iwl_mvm_add_sta_cmd_v7.
  199. */
  200. ADD_STA = 0x18,
  201. /**
  202. * @REMOVE_STA: &struct iwl_mvm_rm_sta_cmd
  203. */
  204. REMOVE_STA = 0x19,
  205. /**
  206. * @FW_GET_ITEM_CMD: uses &struct iwl_fw_get_item_cmd
  207. */
  208. FW_GET_ITEM_CMD = 0x1a,
  209. /**
  210. * @TX_CMD: uses &struct iwl_tx_cmd or &struct iwl_tx_cmd_gen2,
  211. * response in &struct iwl_mvm_tx_resp or
  212. * &struct iwl_mvm_tx_resp_v3
  213. */
  214. TX_CMD = 0x1c,
  215. /**
  216. * @TXPATH_FLUSH: &struct iwl_tx_path_flush_cmd
  217. */
  218. TXPATH_FLUSH = 0x1e,
  219. /**
  220. * @MGMT_MCAST_KEY:
  221. * &struct iwl_mvm_mgmt_mcast_key_cmd or
  222. * &struct iwl_mvm_mgmt_mcast_key_cmd_v1
  223. */
  224. MGMT_MCAST_KEY = 0x1f,
  225. /* scheduler config */
  226. /**
  227. * @SCD_QUEUE_CFG: &struct iwl_scd_txq_cfg_cmd for older hardware,
  228. * &struct iwl_tx_queue_cfg_cmd with &struct iwl_tx_queue_cfg_rsp
  229. * for newer (A000) hardware.
  230. */
  231. SCD_QUEUE_CFG = 0x1d,
  232. /**
  233. * @WEP_KEY: uses &struct iwl_mvm_wep_key_cmd
  234. */
  235. WEP_KEY = 0x20,
  236. /**
  237. * @SHARED_MEM_CFG:
  238. * retrieve shared memory configuration - response in
  239. * &struct iwl_shared_mem_cfg
  240. */
  241. SHARED_MEM_CFG = 0x25,
  242. /**
  243. * @TDLS_CHANNEL_SWITCH_CMD: uses &struct iwl_tdls_channel_switch_cmd
  244. */
  245. TDLS_CHANNEL_SWITCH_CMD = 0x27,
  246. /**
  247. * @TDLS_CHANNEL_SWITCH_NOTIFICATION:
  248. * uses &struct iwl_tdls_channel_switch_notif
  249. */
  250. TDLS_CHANNEL_SWITCH_NOTIFICATION = 0xaa,
  251. /**
  252. * @TDLS_CONFIG_CMD:
  253. * &struct iwl_tdls_config_cmd, response in &struct iwl_tdls_config_res
  254. */
  255. TDLS_CONFIG_CMD = 0xa7,
  256. /**
  257. * @MAC_CONTEXT_CMD: &struct iwl_mac_ctx_cmd
  258. */
  259. MAC_CONTEXT_CMD = 0x28,
  260. /**
  261. * @TIME_EVENT_CMD:
  262. * &struct iwl_time_event_cmd, response in &struct iwl_time_event_resp
  263. */
  264. TIME_EVENT_CMD = 0x29, /* both CMD and response */
  265. /**
  266. * @TIME_EVENT_NOTIFICATION: &struct iwl_time_event_notif
  267. */
  268. TIME_EVENT_NOTIFICATION = 0x2a,
  269. /**
  270. * @BINDING_CONTEXT_CMD:
  271. * &struct iwl_binding_cmd or &struct iwl_binding_cmd_v1
  272. */
  273. BINDING_CONTEXT_CMD = 0x2b,
  274. /**
  275. * @TIME_QUOTA_CMD: &struct iwl_time_quota_cmd
  276. */
  277. TIME_QUOTA_CMD = 0x2c,
  278. /**
  279. * @NON_QOS_TX_COUNTER_CMD:
  280. * command is &struct iwl_nonqos_seq_query_cmd
  281. */
  282. NON_QOS_TX_COUNTER_CMD = 0x2d,
  283. /**
  284. * @LQ_CMD: using &struct iwl_lq_cmd
  285. */
  286. LQ_CMD = 0x4e,
  287. /**
  288. * @FW_PAGING_BLOCK_CMD:
  289. * &struct iwl_fw_paging_cmd or &struct iwl_fw_paging_cmd_v1
  290. */
  291. FW_PAGING_BLOCK_CMD = 0x4f,
  292. /**
  293. * @SCAN_OFFLOAD_REQUEST_CMD: uses &struct iwl_scan_req_lmac
  294. */
  295. SCAN_OFFLOAD_REQUEST_CMD = 0x51,
  296. /**
  297. * @SCAN_OFFLOAD_ABORT_CMD: abort the scan - no further contents
  298. */
  299. SCAN_OFFLOAD_ABORT_CMD = 0x52,
  300. /**
  301. * @HOT_SPOT_CMD: uses &struct iwl_hs20_roc_req
  302. */
  303. HOT_SPOT_CMD = 0x53,
  304. /**
  305. * @SCAN_OFFLOAD_COMPLETE:
  306. * notification, &struct iwl_periodic_scan_complete
  307. */
  308. SCAN_OFFLOAD_COMPLETE = 0x6D,
  309. /**
  310. * @SCAN_OFFLOAD_UPDATE_PROFILES_CMD:
  311. * update scan offload (scheduled scan) profiles/blacklist/etc.
  312. */
  313. SCAN_OFFLOAD_UPDATE_PROFILES_CMD = 0x6E,
  314. /**
  315. * @MATCH_FOUND_NOTIFICATION: scan match found
  316. */
  317. MATCH_FOUND_NOTIFICATION = 0xd9,
  318. /**
  319. * @SCAN_ITERATION_COMPLETE:
  320. * uses &struct iwl_lmac_scan_complete_notif
  321. */
  322. SCAN_ITERATION_COMPLETE = 0xe7,
  323. /* Phy */
  324. /**
  325. * @PHY_CONFIGURATION_CMD: &struct iwl_phy_cfg_cmd
  326. */
  327. PHY_CONFIGURATION_CMD = 0x6a,
  328. /**
  329. * @CALIB_RES_NOTIF_PHY_DB: &struct iwl_calib_res_notif_phy_db
  330. */
  331. CALIB_RES_NOTIF_PHY_DB = 0x6b,
  332. /**
  333. * @PHY_DB_CMD: &struct iwl_phy_db_cmd
  334. */
  335. PHY_DB_CMD = 0x6c,
  336. /**
  337. * @TOF_CMD: &struct iwl_tof_config_cmd
  338. */
  339. TOF_CMD = 0x10,
  340. /**
  341. * @TOF_NOTIFICATION: &struct iwl_tof_gen_resp_cmd
  342. */
  343. TOF_NOTIFICATION = 0x11,
  344. /**
  345. * @POWER_TABLE_CMD: &struct iwl_device_power_cmd
  346. */
  347. POWER_TABLE_CMD = 0x77,
  348. /**
  349. * @PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION:
  350. * &struct iwl_uapsd_misbehaving_ap_notif
  351. */
  352. PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION = 0x78,
  353. /**
  354. * @LTR_CONFIG: &struct iwl_ltr_config_cmd
  355. */
  356. LTR_CONFIG = 0xee,
  357. /**
  358. * @REPLY_THERMAL_MNG_BACKOFF:
  359. * Thermal throttling command
  360. */
  361. REPLY_THERMAL_MNG_BACKOFF = 0x7e,
  362. /**
  363. * @DC2DC_CONFIG_CMD:
  364. * Set/Get DC2DC frequency tune
  365. * Command is &struct iwl_dc2dc_config_cmd,
  366. * response is &struct iwl_dc2dc_config_resp
  367. */
  368. DC2DC_CONFIG_CMD = 0x83,
  369. /**
  370. * @NVM_ACCESS_CMD: using &struct iwl_nvm_access_cmd
  371. */
  372. NVM_ACCESS_CMD = 0x88,
  373. /**
  374. * @BEACON_NOTIFICATION: &struct iwl_extended_beacon_notif
  375. */
  376. BEACON_NOTIFICATION = 0x90,
  377. /**
  378. * @BEACON_TEMPLATE_CMD:
  379. * Uses one of &struct iwl_mac_beacon_cmd_v6,
  380. * &struct iwl_mac_beacon_cmd_v7 or &struct iwl_mac_beacon_cmd
  381. * depending on the device version.
  382. */
  383. BEACON_TEMPLATE_CMD = 0x91,
  384. /**
  385. * @TX_ANT_CONFIGURATION_CMD: &struct iwl_tx_ant_cfg_cmd
  386. */
  387. TX_ANT_CONFIGURATION_CMD = 0x98,
  388. /**
  389. * @STATISTICS_CMD: &struct iwl_statistics_cmd
  390. */
  391. STATISTICS_CMD = 0x9c,
  392. /**
  393. * @STATISTICS_NOTIFICATION:
  394. * one of &struct iwl_notif_statistics_v10,
  395. * &struct iwl_notif_statistics_v11,
  396. * &struct iwl_notif_statistics_cdb
  397. */
  398. STATISTICS_NOTIFICATION = 0x9d,
  399. /**
  400. * @EOSP_NOTIFICATION:
  401. * Notify that a service period ended,
  402. * &struct iwl_mvm_eosp_notification
  403. */
  404. EOSP_NOTIFICATION = 0x9e,
  405. /**
  406. * @REDUCE_TX_POWER_CMD:
  407. * &struct iwl_dev_tx_power_cmd_v3 or &struct iwl_dev_tx_power_cmd
  408. */
  409. REDUCE_TX_POWER_CMD = 0x9f,
  410. /**
  411. * @CARD_STATE_NOTIFICATION:
  412. * Card state (RF/CT kill) notification,
  413. * uses &struct iwl_card_state_notif
  414. */
  415. CARD_STATE_NOTIFICATION = 0xa1,
  416. /**
  417. * @MISSED_BEACONS_NOTIFICATION: &struct iwl_missed_beacons_notif
  418. */
  419. MISSED_BEACONS_NOTIFICATION = 0xa2,
  420. /**
  421. * @MAC_PM_POWER_TABLE: using &struct iwl_mac_power_cmd
  422. */
  423. MAC_PM_POWER_TABLE = 0xa9,
  424. /**
  425. * @MFUART_LOAD_NOTIFICATION: &struct iwl_mfuart_load_notif
  426. */
  427. MFUART_LOAD_NOTIFICATION = 0xb1,
  428. /**
  429. * @RSS_CONFIG_CMD: &struct iwl_rss_config_cmd
  430. */
  431. RSS_CONFIG_CMD = 0xb3,
  432. /**
  433. * @REPLY_RX_PHY_CMD: &struct iwl_rx_phy_info
  434. */
  435. REPLY_RX_PHY_CMD = 0xc0,
  436. /**
  437. * @REPLY_RX_MPDU_CMD:
  438. * &struct iwl_rx_mpdu_res_start or &struct iwl_rx_mpdu_desc
  439. */
  440. REPLY_RX_MPDU_CMD = 0xc1,
  441. /**
  442. * @FRAME_RELEASE:
  443. * Frame release (reorder helper) notification, uses
  444. * &struct iwl_frame_release
  445. */
  446. FRAME_RELEASE = 0xc3,
  447. /**
  448. * @BA_NOTIF:
  449. * BlockAck notification, uses &struct iwl_mvm_compressed_ba_notif
  450. * or &struct iwl_mvm_ba_notif depending on the HW
  451. */
  452. BA_NOTIF = 0xc5,
  453. /* Location Aware Regulatory */
  454. /**
  455. * @MCC_UPDATE_CMD: using &struct iwl_mcc_update_cmd
  456. */
  457. MCC_UPDATE_CMD = 0xc8,
  458. /**
  459. * @MCC_CHUB_UPDATE_CMD: using &struct iwl_mcc_chub_notif
  460. */
  461. MCC_CHUB_UPDATE_CMD = 0xc9,
  462. /**
  463. * @MARKER_CMD: trace marker command, uses &struct iwl_mvm_marker
  464. */
  465. MARKER_CMD = 0xcb,
  466. /**
  467. * @BT_PROFILE_NOTIFICATION: &struct iwl_bt_coex_profile_notif
  468. */
  469. BT_PROFILE_NOTIFICATION = 0xce,
  470. /**
  471. * @BT_CONFIG: &struct iwl_bt_coex_cmd
  472. */
  473. BT_CONFIG = 0x9b,
  474. /**
  475. * @BT_COEX_UPDATE_CORUN_LUT:
  476. * &struct iwl_bt_coex_corun_lut_update_cmd
  477. */
  478. BT_COEX_UPDATE_CORUN_LUT = 0x5b,
  479. /**
  480. * @BT_COEX_UPDATE_REDUCED_TXP:
  481. * &struct iwl_bt_coex_reduced_txp_update_cmd
  482. */
  483. BT_COEX_UPDATE_REDUCED_TXP = 0x5c,
  484. /**
  485. * @BT_COEX_CI: &struct iwl_bt_coex_ci_cmd
  486. */
  487. BT_COEX_CI = 0x5d,
  488. /**
  489. * @REPLY_SF_CFG_CMD: &struct iwl_sf_cfg_cmd
  490. */
  491. REPLY_SF_CFG_CMD = 0xd1,
  492. /**
  493. * @REPLY_BEACON_FILTERING_CMD: &struct iwl_beacon_filter_cmd
  494. */
  495. REPLY_BEACON_FILTERING_CMD = 0xd2,
  496. /**
  497. * @DTS_MEASUREMENT_NOTIFICATION:
  498. * &struct iwl_dts_measurement_notif_v1 or
  499. * &struct iwl_dts_measurement_notif_v2
  500. */
  501. DTS_MEASUREMENT_NOTIFICATION = 0xdd,
  502. /**
  503. * @LDBG_CONFIG_CMD: configure continuous trace recording
  504. */
  505. LDBG_CONFIG_CMD = 0xf6,
  506. /**
  507. * @DEBUG_LOG_MSG: Debugging log data from firmware
  508. */
  509. DEBUG_LOG_MSG = 0xf7,
  510. /**
  511. * @BCAST_FILTER_CMD: &struct iwl_bcast_filter_cmd
  512. */
  513. BCAST_FILTER_CMD = 0xcf,
  514. /**
  515. * @MCAST_FILTER_CMD: &struct iwl_mcast_filter_cmd
  516. */
  517. MCAST_FILTER_CMD = 0xd0,
  518. /**
  519. * @D3_CONFIG_CMD: &struct iwl_d3_manager_config
  520. */
  521. D3_CONFIG_CMD = 0xd3,
  522. /**
  523. * @PROT_OFFLOAD_CONFIG_CMD: Depending on firmware, uses one of
  524. * &struct iwl_proto_offload_cmd_v1, &struct iwl_proto_offload_cmd_v2,
  525. * &struct iwl_proto_offload_cmd_v3_small,
  526. * &struct iwl_proto_offload_cmd_v3_large
  527. */
  528. PROT_OFFLOAD_CONFIG_CMD = 0xd4,
  529. /**
  530. * @OFFLOADS_QUERY_CMD:
  531. * No data in command, response in &struct iwl_wowlan_status
  532. */
  533. OFFLOADS_QUERY_CMD = 0xd5,
  534. /**
  535. * @REMOTE_WAKE_CONFIG_CMD: &struct iwl_wowlan_remote_wake_config
  536. */
  537. REMOTE_WAKE_CONFIG_CMD = 0xd6,
  538. /**
  539. * @D0I3_END_CMD: End D0i3/D3 state, no command data
  540. */
  541. D0I3_END_CMD = 0xed,
  542. /**
  543. * @WOWLAN_PATTERNS: &struct iwl_wowlan_patterns_cmd
  544. */
  545. WOWLAN_PATTERNS = 0xe0,
  546. /**
  547. * @WOWLAN_CONFIGURATION: &struct iwl_wowlan_config_cmd
  548. */
  549. WOWLAN_CONFIGURATION = 0xe1,
  550. /**
  551. * @WOWLAN_TSC_RSC_PARAM: &struct iwl_wowlan_rsc_tsc_params_cmd
  552. */
  553. WOWLAN_TSC_RSC_PARAM = 0xe2,
  554. /**
  555. * @WOWLAN_TKIP_PARAM: &struct iwl_wowlan_tkip_params_cmd
  556. */
  557. WOWLAN_TKIP_PARAM = 0xe3,
  558. /**
  559. * @WOWLAN_KEK_KCK_MATERIAL: &struct iwl_wowlan_kek_kck_material_cmd
  560. */
  561. WOWLAN_KEK_KCK_MATERIAL = 0xe4,
  562. /**
  563. * @WOWLAN_GET_STATUSES: response in &struct iwl_wowlan_status
  564. */
  565. WOWLAN_GET_STATUSES = 0xe5,
  566. /**
  567. * @SCAN_OFFLOAD_PROFILES_QUERY_CMD:
  568. * No command data, response is &struct iwl_scan_offload_profiles_query
  569. */
  570. SCAN_OFFLOAD_PROFILES_QUERY_CMD = 0x56,
  571. };
  572. /* Please keep this enum *SORTED* by hex value.
  573. * Needed for binary search, otherwise a warning will be triggered.
  574. */
  575. enum iwl_mac_conf_subcmd_ids {
  576. LINK_QUALITY_MEASUREMENT_CMD = 0x1,
  577. LINK_QUALITY_MEASUREMENT_COMPLETE_NOTIF = 0xFE,
  578. CHANNEL_SWITCH_NOA_NOTIF = 0xFF,
  579. };
  580. /**
  581. * enum iwl_phy_ops_subcmd_ids - PHY group commands
  582. */
  583. enum iwl_phy_ops_subcmd_ids {
  584. /**
  585. * @CMD_DTS_MEASUREMENT_TRIGGER_WIDE:
  586. * Uses either &struct iwl_dts_measurement_cmd or
  587. * &struct iwl_ext_dts_measurement_cmd
  588. */
  589. CMD_DTS_MEASUREMENT_TRIGGER_WIDE = 0x0,
  590. /**
  591. * @CTDP_CONFIG_CMD: &struct iwl_mvm_ctdp_cmd
  592. */
  593. CTDP_CONFIG_CMD = 0x03,
  594. /**
  595. * @TEMP_REPORTING_THRESHOLDS_CMD: &struct temp_report_ths_cmd
  596. */
  597. TEMP_REPORTING_THRESHOLDS_CMD = 0x04,
  598. /**
  599. * @GEO_TX_POWER_LIMIT: &struct iwl_geo_tx_power_profiles_cmd
  600. */
  601. GEO_TX_POWER_LIMIT = 0x05,
  602. /**
  603. * @CT_KILL_NOTIFICATION: &struct ct_kill_notif
  604. */
  605. CT_KILL_NOTIFICATION = 0xFE,
  606. /**
  607. * @DTS_MEASUREMENT_NOTIF_WIDE:
  608. * &struct iwl_dts_measurement_notif_v1 or
  609. * &struct iwl_dts_measurement_notif_v2
  610. */
  611. DTS_MEASUREMENT_NOTIF_WIDE = 0xFF,
  612. };
  613. /**
  614. * enum iwl_system_subcmd_ids - system group command IDs
  615. */
  616. enum iwl_system_subcmd_ids {
  617. /**
  618. * @SHARED_MEM_CFG_CMD:
  619. * response in &struct iwl_shared_mem_cfg or
  620. * &struct iwl_shared_mem_cfg_v1
  621. */
  622. SHARED_MEM_CFG_CMD = 0x0,
  623. /**
  624. * @INIT_EXTENDED_CFG_CMD: &struct iwl_init_extended_cfg_cmd
  625. */
  626. INIT_EXTENDED_CFG_CMD = 0x03,
  627. };
  628. /**
  629. * enum iwl_data_path_subcmd_ids - data path group commands
  630. */
  631. enum iwl_data_path_subcmd_ids {
  632. /**
  633. * @DQA_ENABLE_CMD: &struct iwl_dqa_enable_cmd
  634. */
  635. DQA_ENABLE_CMD = 0x0,
  636. /**
  637. * @UPDATE_MU_GROUPS_CMD: &struct iwl_mu_group_mgmt_cmd
  638. */
  639. UPDATE_MU_GROUPS_CMD = 0x1,
  640. /**
  641. * @TRIGGER_RX_QUEUES_NOTIF_CMD: &struct iwl_rxq_sync_cmd
  642. */
  643. TRIGGER_RX_QUEUES_NOTIF_CMD = 0x2,
  644. /**
  645. * @STA_PM_NOTIF: &struct iwl_mvm_pm_state_notification
  646. */
  647. STA_PM_NOTIF = 0xFD,
  648. /**
  649. * @MU_GROUP_MGMT_NOTIF: &struct iwl_mu_group_mgmt_notif
  650. */
  651. MU_GROUP_MGMT_NOTIF = 0xFE,
  652. /**
  653. * @RX_QUEUES_NOTIFICATION: &struct iwl_rxq_sync_notification
  654. */
  655. RX_QUEUES_NOTIFICATION = 0xFF,
  656. };
  657. /**
  658. * enum iwl_prot_offload_subcmd_ids - protocol offload commands
  659. */
  660. enum iwl_prot_offload_subcmd_ids {
  661. /**
  662. * @STORED_BEACON_NTF: &struct iwl_stored_beacon_notif
  663. */
  664. STORED_BEACON_NTF = 0xFF,
  665. };
  666. /**
  667. * enum iwl_regulatory_and_nvm_subcmd_ids - regulatory/NVM commands
  668. */
  669. enum iwl_regulatory_and_nvm_subcmd_ids {
  670. /**
  671. * @NVM_ACCESS_COMPLETE: &struct iwl_nvm_access_complete_cmd
  672. */
  673. NVM_ACCESS_COMPLETE = 0x0,
  674. /**
  675. * @NVM_GET_INFO:
  676. * Command is &struct iwl_nvm_get_info,
  677. * response is &struct iwl_nvm_get_info_rsp
  678. */
  679. NVM_GET_INFO = 0x2,
  680. };
  681. /**
  682. * enum iwl_debug_cmds - debug commands
  683. */
  684. enum iwl_debug_cmds {
  685. /**
  686. * @LMAC_RD_WR:
  687. * LMAC memory read/write, using &struct iwl_dbg_mem_access_cmd and
  688. * &struct iwl_dbg_mem_access_rsp
  689. */
  690. LMAC_RD_WR = 0x0,
  691. /**
  692. * @UMAC_RD_WR:
  693. * UMAC memory read/write, using &struct iwl_dbg_mem_access_cmd and
  694. * &struct iwl_dbg_mem_access_rsp
  695. */
  696. UMAC_RD_WR = 0x1,
  697. /**
  698. * @MFU_ASSERT_DUMP_NTF:
  699. * &struct iwl_mfu_assert_dump_notif
  700. */
  701. MFU_ASSERT_DUMP_NTF = 0xFE,
  702. };
  703. /**
  704. * enum iwl_mvm_command_groups - command groups for the firmware
  705. * @LEGACY_GROUP: legacy group, uses command IDs from &enum iwl_legacy_cmds
  706. * @LONG_GROUP: legacy group with long header, also uses command IDs
  707. * from &enum iwl_legacy_cmds
  708. * @SYSTEM_GROUP: system group, uses command IDs from
  709. * &enum iwl_system_subcmd_ids
  710. * @MAC_CONF_GROUP: MAC configuration group, uses command IDs from
  711. * &enum iwl_mac_conf_subcmd_ids
  712. * @PHY_OPS_GROUP: PHY operations group, uses command IDs from
  713. * &enum iwl_phy_ops_subcmd_ids
  714. * @DATA_PATH_GROUP: data path group, uses command IDs from
  715. * &enum iwl_data_path_subcmd_ids
  716. * @NAN_GROUP: NAN group, uses command IDs from &enum iwl_nan_subcmd_ids
  717. * @TOF_GROUP: TOF group, uses command IDs from &enum iwl_tof_subcmd_ids
  718. * @PROT_OFFLOAD_GROUP: protocol offload group, uses command IDs from
  719. * &enum iwl_prot_offload_subcmd_ids
  720. * @REGULATORY_AND_NVM_GROUP: regulatory/NVM group, uses command IDs from
  721. * &enum iwl_regulatory_and_nvm_subcmd_ids
  722. * @DEBUG_GROUP: Debug group, uses command IDs from &enum iwl_debug_cmds
  723. */
  724. enum iwl_mvm_command_groups {
  725. LEGACY_GROUP = 0x0,
  726. LONG_GROUP = 0x1,
  727. SYSTEM_GROUP = 0x2,
  728. MAC_CONF_GROUP = 0x3,
  729. PHY_OPS_GROUP = 0x4,
  730. DATA_PATH_GROUP = 0x5,
  731. PROT_OFFLOAD_GROUP = 0xb,
  732. REGULATORY_AND_NVM_GROUP = 0xc,
  733. DEBUG_GROUP = 0xf,
  734. };
  735. /**
  736. * struct iwl_cmd_response - generic response struct for most commands
  737. * @status: status of the command asked, changes for each one
  738. */
  739. struct iwl_cmd_response {
  740. __le32 status;
  741. };
  742. /*
  743. * struct iwl_dqa_enable_cmd
  744. * @cmd_queue: the TXQ number of the command queue
  745. */
  746. struct iwl_dqa_enable_cmd {
  747. __le32 cmd_queue;
  748. } __packed; /* DQA_CONTROL_CMD_API_S_VER_1 */
  749. /*
  750. * struct iwl_tx_ant_cfg_cmd
  751. * @valid: valid antenna configuration
  752. */
  753. struct iwl_tx_ant_cfg_cmd {
  754. __le32 valid;
  755. } __packed;
  756. /**
  757. * struct iwl_calib_ctrl - Calibration control struct.
  758. * Sent as part of the phy configuration command.
  759. * @flow_trigger: bitmap for which calibrations to perform according to
  760. * flow triggers, using &enum iwl_calib_cfg
  761. * @event_trigger: bitmap for which calibrations to perform according to
  762. * event triggers, using &enum iwl_calib_cfg
  763. */
  764. struct iwl_calib_ctrl {
  765. __le32 flow_trigger;
  766. __le32 event_trigger;
  767. } __packed;
  768. /* This enum defines the bitmap of various calibrations to enable in both
  769. * init ucode and runtime ucode through CALIBRATION_CFG_CMD.
  770. */
  771. enum iwl_calib_cfg {
  772. IWL_CALIB_CFG_XTAL_IDX = BIT(0),
  773. IWL_CALIB_CFG_TEMPERATURE_IDX = BIT(1),
  774. IWL_CALIB_CFG_VOLTAGE_READ_IDX = BIT(2),
  775. IWL_CALIB_CFG_PAPD_IDX = BIT(3),
  776. IWL_CALIB_CFG_TX_PWR_IDX = BIT(4),
  777. IWL_CALIB_CFG_DC_IDX = BIT(5),
  778. IWL_CALIB_CFG_BB_FILTER_IDX = BIT(6),
  779. IWL_CALIB_CFG_LO_LEAKAGE_IDX = BIT(7),
  780. IWL_CALIB_CFG_TX_IQ_IDX = BIT(8),
  781. IWL_CALIB_CFG_TX_IQ_SKEW_IDX = BIT(9),
  782. IWL_CALIB_CFG_RX_IQ_IDX = BIT(10),
  783. IWL_CALIB_CFG_RX_IQ_SKEW_IDX = BIT(11),
  784. IWL_CALIB_CFG_SENSITIVITY_IDX = BIT(12),
  785. IWL_CALIB_CFG_CHAIN_NOISE_IDX = BIT(13),
  786. IWL_CALIB_CFG_DISCONNECTED_ANT_IDX = BIT(14),
  787. IWL_CALIB_CFG_ANT_COUPLING_IDX = BIT(15),
  788. IWL_CALIB_CFG_DAC_IDX = BIT(16),
  789. IWL_CALIB_CFG_ABS_IDX = BIT(17),
  790. IWL_CALIB_CFG_AGC_IDX = BIT(18),
  791. };
  792. /**
  793. * struct iwl_phy_cfg_cmd - Phy configuration command
  794. * @phy_cfg: PHY configuration value, uses &enum iwl_fw_phy_cfg
  795. * @calib_control: calibration control data
  796. */
  797. struct iwl_phy_cfg_cmd {
  798. __le32 phy_cfg;
  799. struct iwl_calib_ctrl calib_control;
  800. } __packed;
  801. #define PHY_CFG_RADIO_TYPE (BIT(0) | BIT(1))
  802. #define PHY_CFG_RADIO_STEP (BIT(2) | BIT(3))
  803. #define PHY_CFG_RADIO_DASH (BIT(4) | BIT(5))
  804. #define PHY_CFG_PRODUCT_NUMBER (BIT(6) | BIT(7))
  805. #define PHY_CFG_TX_CHAIN_A BIT(8)
  806. #define PHY_CFG_TX_CHAIN_B BIT(9)
  807. #define PHY_CFG_TX_CHAIN_C BIT(10)
  808. #define PHY_CFG_RX_CHAIN_A BIT(12)
  809. #define PHY_CFG_RX_CHAIN_B BIT(13)
  810. #define PHY_CFG_RX_CHAIN_C BIT(14)
  811. /**
  812. * enum iwl_nvm_access_op - NVM access opcode
  813. * @IWL_NVM_READ: read NVM
  814. * @IWL_NVM_WRITE: write NVM
  815. */
  816. enum iwl_nvm_access_op {
  817. IWL_NVM_READ = 0,
  818. IWL_NVM_WRITE = 1,
  819. };
  820. /**
  821. * enum iwl_nvm_access_target - target of the NVM_ACCESS_CMD
  822. * @NVM_ACCESS_TARGET_CACHE: access the cache
  823. * @NVM_ACCESS_TARGET_OTP: access the OTP
  824. * @NVM_ACCESS_TARGET_EEPROM: access the EEPROM
  825. */
  826. enum iwl_nvm_access_target {
  827. NVM_ACCESS_TARGET_CACHE = 0,
  828. NVM_ACCESS_TARGET_OTP = 1,
  829. NVM_ACCESS_TARGET_EEPROM = 2,
  830. };
  831. /**
  832. * enum iwl_nvm_section_type - section types for NVM_ACCESS_CMD
  833. * @NVM_SECTION_TYPE_SW: software section
  834. * @NVM_SECTION_TYPE_REGULATORY: regulatory section
  835. * @NVM_SECTION_TYPE_CALIBRATION: calibration section
  836. * @NVM_SECTION_TYPE_PRODUCTION: production section
  837. * @NVM_SECTION_TYPE_MAC_OVERRIDE: MAC override section
  838. * @NVM_SECTION_TYPE_PHY_SKU: PHY SKU section
  839. * @NVM_MAX_NUM_SECTIONS: number of sections
  840. */
  841. enum iwl_nvm_section_type {
  842. NVM_SECTION_TYPE_SW = 1,
  843. NVM_SECTION_TYPE_REGULATORY = 3,
  844. NVM_SECTION_TYPE_CALIBRATION = 4,
  845. NVM_SECTION_TYPE_PRODUCTION = 5,
  846. NVM_SECTION_TYPE_MAC_OVERRIDE = 11,
  847. NVM_SECTION_TYPE_PHY_SKU = 12,
  848. NVM_MAX_NUM_SECTIONS = 13,
  849. };
  850. /**
  851. * struct iwl_nvm_access_cmd - Request the device to send an NVM section
  852. * @op_code: &enum iwl_nvm_access_op
  853. * @target: &enum iwl_nvm_access_target
  854. * @type: &enum iwl_nvm_section_type
  855. * @offset: offset in bytes into the section
  856. * @length: in bytes, to read/write
  857. * @data: if write operation, the data to write. On read its empty
  858. */
  859. struct iwl_nvm_access_cmd {
  860. u8 op_code;
  861. u8 target;
  862. __le16 type;
  863. __le16 offset;
  864. __le16 length;
  865. u8 data[];
  866. } __packed; /* NVM_ACCESS_CMD_API_S_VER_2 */
  867. #define NUM_OF_FW_PAGING_BLOCKS 33 /* 32 for data and 1 block for CSS */
  868. /**
  869. * struct iwl_fw_paging_cmd_v1 - paging layout
  870. *
  871. * (FW_PAGING_BLOCK_CMD = 0x4f)
  872. *
  873. * Send to FW the paging layout in the driver.
  874. *
  875. * @flags: various flags for the command
  876. * @block_size: the block size in powers of 2
  877. * @block_num: number of blocks specified in the command.
  878. * @device_phy_addr: virtual addresses from device side
  879. */
  880. struct iwl_fw_paging_cmd_v1 {
  881. __le32 flags;
  882. __le32 block_size;
  883. __le32 block_num;
  884. __le32 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
  885. } __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_1 */
  886. /**
  887. * struct iwl_fw_paging_cmd - paging layout
  888. *
  889. * (FW_PAGING_BLOCK_CMD = 0x4f)
  890. *
  891. * Send to FW the paging layout in the driver.
  892. *
  893. * @flags: various flags for the command
  894. * @block_size: the block size in powers of 2
  895. * @block_num: number of blocks specified in the command.
  896. * @device_phy_addr: virtual addresses from device side
  897. */
  898. struct iwl_fw_paging_cmd {
  899. __le32 flags;
  900. __le32 block_size;
  901. __le32 block_num;
  902. __le64 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
  903. } __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_2 */
  904. /*
  905. * Fw items ID's
  906. *
  907. * @IWL_FW_ITEM_ID_PAGING: Address of the pages that the FW will upload
  908. * download
  909. */
  910. enum iwl_fw_item_id {
  911. IWL_FW_ITEM_ID_PAGING = 3,
  912. };
  913. /*
  914. * struct iwl_fw_get_item_cmd - get an item from the fw
  915. */
  916. struct iwl_fw_get_item_cmd {
  917. __le32 item_id;
  918. } __packed; /* FW_GET_ITEM_CMD_API_S_VER_1 */
  919. #define CONT_REC_COMMAND_SIZE 80
  920. #define ENABLE_CONT_RECORDING 0x15
  921. #define DISABLE_CONT_RECORDING 0x16
  922. /*
  923. * struct iwl_continuous_record_mode - recording mode
  924. */
  925. struct iwl_continuous_record_mode {
  926. __le16 enable_recording;
  927. } __packed;
  928. /*
  929. * struct iwl_continuous_record_cmd - enable/disable continuous recording
  930. */
  931. struct iwl_continuous_record_cmd {
  932. struct iwl_continuous_record_mode record_mode;
  933. u8 pad[CONT_REC_COMMAND_SIZE -
  934. sizeof(struct iwl_continuous_record_mode)];
  935. } __packed;
  936. struct iwl_fw_get_item_resp {
  937. __le32 item_id;
  938. __le32 item_byte_cnt;
  939. __le32 item_val;
  940. } __packed; /* FW_GET_ITEM_RSP_S_VER_1 */
  941. /**
  942. * struct iwl_nvm_access_resp_ver2 - response to NVM_ACCESS_CMD
  943. * @offset: offset in bytes into the section
  944. * @length: in bytes, either how much was written or read
  945. * @type: NVM_SECTION_TYPE_*
  946. * @status: 0 for success, fail otherwise
  947. * @data: if read operation, the data returned. Empty on write.
  948. */
  949. struct iwl_nvm_access_resp {
  950. __le16 offset;
  951. __le16 length;
  952. __le16 type;
  953. __le16 status;
  954. u8 data[];
  955. } __packed; /* NVM_ACCESS_CMD_RESP_API_S_VER_2 */
  956. /* MVM_ALIVE 0x1 */
  957. /* alive response is_valid values */
  958. #define ALIVE_RESP_UCODE_OK BIT(0)
  959. #define ALIVE_RESP_RFKILL BIT(1)
  960. /* alive response ver_type values */
  961. enum {
  962. FW_TYPE_HW = 0,
  963. FW_TYPE_PROT = 1,
  964. FW_TYPE_AP = 2,
  965. FW_TYPE_WOWLAN = 3,
  966. FW_TYPE_TIMING = 4,
  967. FW_TYPE_WIPAN = 5
  968. };
  969. /* alive response ver_subtype values */
  970. enum {
  971. FW_SUBTYPE_FULL_FEATURE = 0,
  972. FW_SUBTYPE_BOOTSRAP = 1, /* Not valid */
  973. FW_SUBTYPE_REDUCED = 2,
  974. FW_SUBTYPE_ALIVE_ONLY = 3,
  975. FW_SUBTYPE_WOWLAN = 4,
  976. FW_SUBTYPE_AP_SUBTYPE = 5,
  977. FW_SUBTYPE_WIPAN = 6,
  978. FW_SUBTYPE_INITIALIZE = 9
  979. };
  980. #define IWL_ALIVE_STATUS_ERR 0xDEAD
  981. #define IWL_ALIVE_STATUS_OK 0xCAFE
  982. #define IWL_ALIVE_FLG_RFKILL BIT(0)
  983. struct iwl_lmac_alive {
  984. __le32 ucode_minor;
  985. __le32 ucode_major;
  986. u8 ver_subtype;
  987. u8 ver_type;
  988. u8 mac;
  989. u8 opt;
  990. __le32 timestamp;
  991. __le32 error_event_table_ptr; /* SRAM address for error log */
  992. __le32 log_event_table_ptr; /* SRAM address for LMAC event log */
  993. __le32 cpu_register_ptr;
  994. __le32 dbgm_config_ptr;
  995. __le32 alive_counter_ptr;
  996. __le32 scd_base_ptr; /* SRAM address for SCD */
  997. __le32 st_fwrd_addr; /* pointer to Store and forward */
  998. __le32 st_fwrd_size;
  999. } __packed; /* UCODE_ALIVE_NTFY_API_S_VER_3 */
  1000. struct iwl_umac_alive {
  1001. __le32 umac_minor; /* UMAC version: minor */
  1002. __le32 umac_major; /* UMAC version: major */
  1003. __le32 error_info_addr; /* SRAM address for UMAC error log */
  1004. __le32 dbg_print_buff_addr;
  1005. } __packed; /* UMAC_ALIVE_DATA_API_S_VER_2 */
  1006. struct mvm_alive_resp_v3 {
  1007. __le16 status;
  1008. __le16 flags;
  1009. struct iwl_lmac_alive lmac_data;
  1010. struct iwl_umac_alive umac_data;
  1011. } __packed; /* ALIVE_RES_API_S_VER_3 */
  1012. struct mvm_alive_resp {
  1013. __le16 status;
  1014. __le16 flags;
  1015. struct iwl_lmac_alive lmac_data[2];
  1016. struct iwl_umac_alive umac_data;
  1017. } __packed; /* ALIVE_RES_API_S_VER_4 */
  1018. /* Error response/notification */
  1019. enum {
  1020. FW_ERR_UNKNOWN_CMD = 0x0,
  1021. FW_ERR_INVALID_CMD_PARAM = 0x1,
  1022. FW_ERR_SERVICE = 0x2,
  1023. FW_ERR_ARC_MEMORY = 0x3,
  1024. FW_ERR_ARC_CODE = 0x4,
  1025. FW_ERR_WATCH_DOG = 0x5,
  1026. FW_ERR_WEP_GRP_KEY_INDX = 0x10,
  1027. FW_ERR_WEP_KEY_SIZE = 0x11,
  1028. FW_ERR_OBSOLETE_FUNC = 0x12,
  1029. FW_ERR_UNEXPECTED = 0xFE,
  1030. FW_ERR_FATAL = 0xFF
  1031. };
  1032. /**
  1033. * struct iwl_error_resp - FW error indication
  1034. * ( REPLY_ERROR = 0x2 )
  1035. * @error_type: one of FW_ERR_*
  1036. * @cmd_id: the command ID for which the error occured
  1037. * @reserved1: reserved
  1038. * @bad_cmd_seq_num: sequence number of the erroneous command
  1039. * @error_service: which service created the error, applicable only if
  1040. * error_type = 2, otherwise 0
  1041. * @timestamp: TSF in usecs.
  1042. */
  1043. struct iwl_error_resp {
  1044. __le32 error_type;
  1045. u8 cmd_id;
  1046. u8 reserved1;
  1047. __le16 bad_cmd_seq_num;
  1048. __le32 error_service;
  1049. __le64 timestamp;
  1050. } __packed;
  1051. /* Common PHY, MAC and Bindings definitions */
  1052. #define MAX_MACS_IN_BINDING (3)
  1053. #define MAX_BINDINGS (4)
  1054. /**
  1055. * enum iwl_mvm_id_and_color - ID and color fields in context dword
  1056. * @FW_CTXT_ID_POS: position of the ID
  1057. * @FW_CTXT_ID_MSK: mask of the ID
  1058. * @FW_CTXT_COLOR_POS: position of the color
  1059. * @FW_CTXT_COLOR_MSK: mask of the color
  1060. * @FW_CTXT_INVALID: value used to indicate unused/invalid
  1061. */
  1062. enum iwl_mvm_id_and_color {
  1063. FW_CTXT_ID_POS = 0,
  1064. FW_CTXT_ID_MSK = 0xff << FW_CTXT_ID_POS,
  1065. FW_CTXT_COLOR_POS = 8,
  1066. FW_CTXT_COLOR_MSK = 0xff << FW_CTXT_COLOR_POS,
  1067. FW_CTXT_INVALID = 0xffffffff,
  1068. };
  1069. #define FW_CMD_ID_AND_COLOR(_id, _color) ((_id << FW_CTXT_ID_POS) |\
  1070. (_color << FW_CTXT_COLOR_POS))
  1071. /* Possible actions on PHYs, MACs and Bindings */
  1072. enum iwl_phy_ctxt_action {
  1073. FW_CTXT_ACTION_STUB = 0,
  1074. FW_CTXT_ACTION_ADD,
  1075. FW_CTXT_ACTION_MODIFY,
  1076. FW_CTXT_ACTION_REMOVE,
  1077. FW_CTXT_ACTION_NUM
  1078. }; /* COMMON_CONTEXT_ACTION_API_E_VER_1 */
  1079. /* Time Events */
  1080. /* Time Event types, according to MAC type */
  1081. enum iwl_time_event_type {
  1082. /* BSS Station Events */
  1083. TE_BSS_STA_AGGRESSIVE_ASSOC,
  1084. TE_BSS_STA_ASSOC,
  1085. TE_BSS_EAP_DHCP_PROT,
  1086. TE_BSS_QUIET_PERIOD,
  1087. /* P2P Device Events */
  1088. TE_P2P_DEVICE_DISCOVERABLE,
  1089. TE_P2P_DEVICE_LISTEN,
  1090. TE_P2P_DEVICE_ACTION_SCAN,
  1091. TE_P2P_DEVICE_FULL_SCAN,
  1092. /* P2P Client Events */
  1093. TE_P2P_CLIENT_AGGRESSIVE_ASSOC,
  1094. TE_P2P_CLIENT_ASSOC,
  1095. TE_P2P_CLIENT_QUIET_PERIOD,
  1096. /* P2P GO Events */
  1097. TE_P2P_GO_ASSOC_PROT,
  1098. TE_P2P_GO_REPETITIVET_NOA,
  1099. TE_P2P_GO_CT_WINDOW,
  1100. /* WiDi Sync Events */
  1101. TE_WIDI_TX_SYNC,
  1102. /* Channel Switch NoA */
  1103. TE_CHANNEL_SWITCH_PERIOD,
  1104. TE_MAX
  1105. }; /* MAC_EVENT_TYPE_API_E_VER_1 */
  1106. /* Time event - defines for command API v1 */
  1107. /*
  1108. * @TE_V1_FRAG_NONE: fragmentation of the time event is NOT allowed.
  1109. * @TE_V1_FRAG_SINGLE: fragmentation of the time event is allowed, but only
  1110. * the first fragment is scheduled.
  1111. * @TE_V1_FRAG_DUAL: fragmentation of the time event is allowed, but only
  1112. * the first 2 fragments are scheduled.
  1113. * @TE_V1_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
  1114. * number of fragments are valid.
  1115. *
  1116. * Other than the constant defined above, specifying a fragmentation value 'x'
  1117. * means that the event can be fragmented but only the first 'x' will be
  1118. * scheduled.
  1119. */
  1120. enum {
  1121. TE_V1_FRAG_NONE = 0,
  1122. TE_V1_FRAG_SINGLE = 1,
  1123. TE_V1_FRAG_DUAL = 2,
  1124. TE_V1_FRAG_ENDLESS = 0xffffffff
  1125. };
  1126. /* If a Time Event can be fragmented, this is the max number of fragments */
  1127. #define TE_V1_FRAG_MAX_MSK 0x0fffffff
  1128. /* Repeat the time event endlessly (until removed) */
  1129. #define TE_V1_REPEAT_ENDLESS 0xffffffff
  1130. /* If a Time Event has bounded repetitions, this is the maximal value */
  1131. #define TE_V1_REPEAT_MAX_MSK_V1 0x0fffffff
  1132. /* Time Event dependencies: none, on another TE, or in a specific time */
  1133. enum {
  1134. TE_V1_INDEPENDENT = 0,
  1135. TE_V1_DEP_OTHER = BIT(0),
  1136. TE_V1_DEP_TSF = BIT(1),
  1137. TE_V1_EVENT_SOCIOPATHIC = BIT(2),
  1138. }; /* MAC_EVENT_DEPENDENCY_POLICY_API_E_VER_2 */
  1139. /*
  1140. * @TE_V1_NOTIF_NONE: no notifications
  1141. * @TE_V1_NOTIF_HOST_EVENT_START: request/receive notification on event start
  1142. * @TE_V1_NOTIF_HOST_EVENT_END:request/receive notification on event end
  1143. * @TE_V1_NOTIF_INTERNAL_EVENT_START: internal FW use
  1144. * @TE_V1_NOTIF_INTERNAL_EVENT_END: internal FW use.
  1145. * @TE_V1_NOTIF_HOST_FRAG_START: request/receive notification on frag start
  1146. * @TE_V1_NOTIF_HOST_FRAG_END:request/receive notification on frag end
  1147. * @TE_V1_NOTIF_INTERNAL_FRAG_START: internal FW use.
  1148. * @TE_V1_NOTIF_INTERNAL_FRAG_END: internal FW use.
  1149. *
  1150. * Supported Time event notifications configuration.
  1151. * A notification (both event and fragment) includes a status indicating weather
  1152. * the FW was able to schedule the event or not. For fragment start/end
  1153. * notification the status is always success. There is no start/end fragment
  1154. * notification for monolithic events.
  1155. */
  1156. enum {
  1157. TE_V1_NOTIF_NONE = 0,
  1158. TE_V1_NOTIF_HOST_EVENT_START = BIT(0),
  1159. TE_V1_NOTIF_HOST_EVENT_END = BIT(1),
  1160. TE_V1_NOTIF_INTERNAL_EVENT_START = BIT(2),
  1161. TE_V1_NOTIF_INTERNAL_EVENT_END = BIT(3),
  1162. TE_V1_NOTIF_HOST_FRAG_START = BIT(4),
  1163. TE_V1_NOTIF_HOST_FRAG_END = BIT(5),
  1164. TE_V1_NOTIF_INTERNAL_FRAG_START = BIT(6),
  1165. TE_V1_NOTIF_INTERNAL_FRAG_END = BIT(7),
  1166. }; /* MAC_EVENT_ACTION_API_E_VER_2 */
  1167. /* Time event - defines for command API */
  1168. /*
  1169. * @TE_V2_FRAG_NONE: fragmentation of the time event is NOT allowed.
  1170. * @TE_V2_FRAG_SINGLE: fragmentation of the time event is allowed, but only
  1171. * the first fragment is scheduled.
  1172. * @TE_V2_FRAG_DUAL: fragmentation of the time event is allowed, but only
  1173. * the first 2 fragments are scheduled.
  1174. * @TE_V2_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
  1175. * number of fragments are valid.
  1176. *
  1177. * Other than the constant defined above, specifying a fragmentation value 'x'
  1178. * means that the event can be fragmented but only the first 'x' will be
  1179. * scheduled.
  1180. */
  1181. enum {
  1182. TE_V2_FRAG_NONE = 0,
  1183. TE_V2_FRAG_SINGLE = 1,
  1184. TE_V2_FRAG_DUAL = 2,
  1185. TE_V2_FRAG_MAX = 0xfe,
  1186. TE_V2_FRAG_ENDLESS = 0xff
  1187. };
  1188. /* Repeat the time event endlessly (until removed) */
  1189. #define TE_V2_REPEAT_ENDLESS 0xff
  1190. /* If a Time Event has bounded repetitions, this is the maximal value */
  1191. #define TE_V2_REPEAT_MAX 0xfe
  1192. #define TE_V2_PLACEMENT_POS 12
  1193. #define TE_V2_ABSENCE_POS 15
  1194. /**
  1195. * enum iwl_time_event_policy - Time event policy values
  1196. * A notification (both event and fragment) includes a status indicating weather
  1197. * the FW was able to schedule the event or not. For fragment start/end
  1198. * notification the status is always success. There is no start/end fragment
  1199. * notification for monolithic events.
  1200. *
  1201. * @TE_V2_DEFAULT_POLICY: independent, social, present, unoticable
  1202. * @TE_V2_NOTIF_HOST_EVENT_START: request/receive notification on event start
  1203. * @TE_V2_NOTIF_HOST_EVENT_END:request/receive notification on event end
  1204. * @TE_V2_NOTIF_INTERNAL_EVENT_START: internal FW use
  1205. * @TE_V2_NOTIF_INTERNAL_EVENT_END: internal FW use.
  1206. * @TE_V2_NOTIF_HOST_FRAG_START: request/receive notification on frag start
  1207. * @TE_V2_NOTIF_HOST_FRAG_END:request/receive notification on frag end
  1208. * @TE_V2_NOTIF_INTERNAL_FRAG_START: internal FW use.
  1209. * @TE_V2_NOTIF_INTERNAL_FRAG_END: internal FW use.
  1210. * @T2_V2_START_IMMEDIATELY: start time event immediately
  1211. * @TE_V2_DEP_OTHER: depends on another time event
  1212. * @TE_V2_DEP_TSF: depends on a specific time
  1213. * @TE_V2_EVENT_SOCIOPATHIC: can't co-exist with other events of tha same MAC
  1214. * @TE_V2_ABSENCE: are we present or absent during the Time Event.
  1215. */
  1216. enum iwl_time_event_policy {
  1217. TE_V2_DEFAULT_POLICY = 0x0,
  1218. /* notifications (event start/stop, fragment start/stop) */
  1219. TE_V2_NOTIF_HOST_EVENT_START = BIT(0),
  1220. TE_V2_NOTIF_HOST_EVENT_END = BIT(1),
  1221. TE_V2_NOTIF_INTERNAL_EVENT_START = BIT(2),
  1222. TE_V2_NOTIF_INTERNAL_EVENT_END = BIT(3),
  1223. TE_V2_NOTIF_HOST_FRAG_START = BIT(4),
  1224. TE_V2_NOTIF_HOST_FRAG_END = BIT(5),
  1225. TE_V2_NOTIF_INTERNAL_FRAG_START = BIT(6),
  1226. TE_V2_NOTIF_INTERNAL_FRAG_END = BIT(7),
  1227. T2_V2_START_IMMEDIATELY = BIT(11),
  1228. /* placement characteristics */
  1229. TE_V2_DEP_OTHER = BIT(TE_V2_PLACEMENT_POS),
  1230. TE_V2_DEP_TSF = BIT(TE_V2_PLACEMENT_POS + 1),
  1231. TE_V2_EVENT_SOCIOPATHIC = BIT(TE_V2_PLACEMENT_POS + 2),
  1232. /* are we present or absent during the Time Event. */
  1233. TE_V2_ABSENCE = BIT(TE_V2_ABSENCE_POS),
  1234. };
  1235. /**
  1236. * struct iwl_time_event_cmd - configuring Time Events
  1237. * with struct MAC_TIME_EVENT_DATA_API_S_VER_2 (see also
  1238. * with version 1. determined by IWL_UCODE_TLV_FLAGS)
  1239. * ( TIME_EVENT_CMD = 0x29 )
  1240. * @id_and_color: ID and color of the relevant MAC,
  1241. * &enum iwl_mvm_id_and_color
  1242. * @action: action to perform, one of &enum iwl_phy_ctxt_action
  1243. * @id: this field has two meanings, depending on the action:
  1244. * If the action is ADD, then it means the type of event to add.
  1245. * For all other actions it is the unique event ID assigned when the
  1246. * event was added by the FW.
  1247. * @apply_time: When to start the Time Event (in GP2)
  1248. * @max_delay: maximum delay to event's start (apply time), in TU
  1249. * @depends_on: the unique ID of the event we depend on (if any)
  1250. * @interval: interval between repetitions, in TU
  1251. * @duration: duration of event in TU
  1252. * @repeat: how many repetitions to do, can be TE_REPEAT_ENDLESS
  1253. * @max_frags: maximal number of fragments the Time Event can be divided to
  1254. * @policy: defines whether uCode shall notify the host or other uCode modules
  1255. * on event and/or fragment start and/or end
  1256. * using one of TE_INDEPENDENT, TE_DEP_OTHER, TE_DEP_TSF
  1257. * TE_EVENT_SOCIOPATHIC
  1258. * using TE_ABSENCE and using TE_NOTIF_*,
  1259. * &enum iwl_time_event_policy
  1260. */
  1261. struct iwl_time_event_cmd {
  1262. /* COMMON_INDEX_HDR_API_S_VER_1 */
  1263. __le32 id_and_color;
  1264. __le32 action;
  1265. __le32 id;
  1266. /* MAC_TIME_EVENT_DATA_API_S_VER_2 */
  1267. __le32 apply_time;
  1268. __le32 max_delay;
  1269. __le32 depends_on;
  1270. __le32 interval;
  1271. __le32 duration;
  1272. u8 repeat;
  1273. u8 max_frags;
  1274. __le16 policy;
  1275. } __packed; /* MAC_TIME_EVENT_CMD_API_S_VER_2 */
  1276. /**
  1277. * struct iwl_time_event_resp - response structure to iwl_time_event_cmd
  1278. * @status: bit 0 indicates success, all others specify errors
  1279. * @id: the Time Event type
  1280. * @unique_id: the unique ID assigned (in ADD) or given (others) to the TE
  1281. * @id_and_color: ID and color of the relevant MAC,
  1282. * &enum iwl_mvm_id_and_color
  1283. */
  1284. struct iwl_time_event_resp {
  1285. __le32 status;
  1286. __le32 id;
  1287. __le32 unique_id;
  1288. __le32 id_and_color;
  1289. } __packed; /* MAC_TIME_EVENT_RSP_API_S_VER_1 */
  1290. /**
  1291. * struct iwl_time_event_notif - notifications of time event start/stop
  1292. * ( TIME_EVENT_NOTIFICATION = 0x2a )
  1293. * @timestamp: action timestamp in GP2
  1294. * @session_id: session's unique id
  1295. * @unique_id: unique id of the Time Event itself
  1296. * @id_and_color: ID and color of the relevant MAC
  1297. * @action: &enum iwl_time_event_policy
  1298. * @status: true if scheduled, false otherwise (not executed)
  1299. */
  1300. struct iwl_time_event_notif {
  1301. __le32 timestamp;
  1302. __le32 session_id;
  1303. __le32 unique_id;
  1304. __le32 id_and_color;
  1305. __le32 action;
  1306. __le32 status;
  1307. } __packed; /* MAC_TIME_EVENT_NTFY_API_S_VER_1 */
  1308. /* Bindings and Time Quota */
  1309. /**
  1310. * struct iwl_binding_cmd_v1 - configuring bindings
  1311. * ( BINDING_CONTEXT_CMD = 0x2b )
  1312. * @id_and_color: ID and color of the relevant Binding,
  1313. * &enum iwl_mvm_id_and_color
  1314. * @action: action to perform, one of FW_CTXT_ACTION_*
  1315. * @macs: array of MAC id and colors which belong to the binding,
  1316. * &enum iwl_mvm_id_and_color
  1317. * @phy: PHY id and color which belongs to the binding,
  1318. * &enum iwl_mvm_id_and_color
  1319. */
  1320. struct iwl_binding_cmd_v1 {
  1321. /* COMMON_INDEX_HDR_API_S_VER_1 */
  1322. __le32 id_and_color;
  1323. __le32 action;
  1324. /* BINDING_DATA_API_S_VER_1 */
  1325. __le32 macs[MAX_MACS_IN_BINDING];
  1326. __le32 phy;
  1327. } __packed; /* BINDING_CMD_API_S_VER_1 */
  1328. /**
  1329. * struct iwl_binding_cmd - configuring bindings
  1330. * ( BINDING_CONTEXT_CMD = 0x2b )
  1331. * @id_and_color: ID and color of the relevant Binding,
  1332. * &enum iwl_mvm_id_and_color
  1333. * @action: action to perform, one of FW_CTXT_ACTION_*
  1334. * @macs: array of MAC id and colors which belong to the binding
  1335. * &enum iwl_mvm_id_and_color
  1336. * @phy: PHY id and color which belongs to the binding
  1337. * &enum iwl_mvm_id_and_color
  1338. * @lmac_id: the lmac id the binding belongs to
  1339. */
  1340. struct iwl_binding_cmd {
  1341. /* COMMON_INDEX_HDR_API_S_VER_1 */
  1342. __le32 id_and_color;
  1343. __le32 action;
  1344. /* BINDING_DATA_API_S_VER_1 */
  1345. __le32 macs[MAX_MACS_IN_BINDING];
  1346. __le32 phy;
  1347. __le32 lmac_id;
  1348. } __packed; /* BINDING_CMD_API_S_VER_2 */
  1349. #define IWL_BINDING_CMD_SIZE_V1 sizeof(struct iwl_binding_cmd_v1)
  1350. #define IWL_LMAC_24G_INDEX 0
  1351. #define IWL_LMAC_5G_INDEX 1
  1352. /* The maximal number of fragments in the FW's schedule session */
  1353. #define IWL_MVM_MAX_QUOTA 128
  1354. /**
  1355. * struct iwl_time_quota_data - configuration of time quota per binding
  1356. * @id_and_color: ID and color of the relevant Binding,
  1357. * &enum iwl_mvm_id_and_color
  1358. * @quota: absolute time quota in TU. The scheduler will try to divide the
  1359. * remainig quota (after Time Events) according to this quota.
  1360. * @max_duration: max uninterrupted context duration in TU
  1361. */
  1362. struct iwl_time_quota_data {
  1363. __le32 id_and_color;
  1364. __le32 quota;
  1365. __le32 max_duration;
  1366. } __packed; /* TIME_QUOTA_DATA_API_S_VER_1 */
  1367. /**
  1368. * struct iwl_time_quota_cmd - configuration of time quota between bindings
  1369. * ( TIME_QUOTA_CMD = 0x2c )
  1370. * @quotas: allocations per binding
  1371. * Note: on non-CDB the fourth one is the auxilary mac and is
  1372. * essentially zero.
  1373. * On CDB the fourth one is a regular binding.
  1374. */
  1375. struct iwl_time_quota_cmd {
  1376. struct iwl_time_quota_data quotas[MAX_BINDINGS];
  1377. } __packed; /* TIME_QUOTA_ALLOCATION_CMD_API_S_VER_1 */
  1378. /* PHY context */
  1379. /* Supported bands */
  1380. #define PHY_BAND_5 (0)
  1381. #define PHY_BAND_24 (1)
  1382. /* Supported channel width, vary if there is VHT support */
  1383. #define PHY_VHT_CHANNEL_MODE20 (0x0)
  1384. #define PHY_VHT_CHANNEL_MODE40 (0x1)
  1385. #define PHY_VHT_CHANNEL_MODE80 (0x2)
  1386. #define PHY_VHT_CHANNEL_MODE160 (0x3)
  1387. /*
  1388. * Control channel position:
  1389. * For legacy set bit means upper channel, otherwise lower.
  1390. * For VHT - bit-2 marks if the control is lower/upper relative to center-freq
  1391. * bits-1:0 mark the distance from the center freq. for 20Mhz, offset is 0.
  1392. * center_freq
  1393. * |
  1394. * 40Mhz |_______|_______|
  1395. * 80Mhz |_______|_______|_______|_______|
  1396. * 160Mhz |_______|_______|_______|_______|_______|_______|_______|_______|
  1397. * code 011 010 001 000 | 100 101 110 111
  1398. */
  1399. #define PHY_VHT_CTRL_POS_1_BELOW (0x0)
  1400. #define PHY_VHT_CTRL_POS_2_BELOW (0x1)
  1401. #define PHY_VHT_CTRL_POS_3_BELOW (0x2)
  1402. #define PHY_VHT_CTRL_POS_4_BELOW (0x3)
  1403. #define PHY_VHT_CTRL_POS_1_ABOVE (0x4)
  1404. #define PHY_VHT_CTRL_POS_2_ABOVE (0x5)
  1405. #define PHY_VHT_CTRL_POS_3_ABOVE (0x6)
  1406. #define PHY_VHT_CTRL_POS_4_ABOVE (0x7)
  1407. /*
  1408. * @band: PHY_BAND_*
  1409. * @channel: channel number
  1410. * @width: PHY_[VHT|LEGACY]_CHANNEL_*
  1411. * @ctrl channel: PHY_[VHT|LEGACY]_CTRL_*
  1412. */
  1413. struct iwl_fw_channel_info {
  1414. u8 band;
  1415. u8 channel;
  1416. u8 width;
  1417. u8 ctrl_pos;
  1418. } __packed;
  1419. #define PHY_RX_CHAIN_DRIVER_FORCE_POS (0)
  1420. #define PHY_RX_CHAIN_DRIVER_FORCE_MSK \
  1421. (0x1 << PHY_RX_CHAIN_DRIVER_FORCE_POS)
  1422. #define PHY_RX_CHAIN_VALID_POS (1)
  1423. #define PHY_RX_CHAIN_VALID_MSK \
  1424. (0x7 << PHY_RX_CHAIN_VALID_POS)
  1425. #define PHY_RX_CHAIN_FORCE_SEL_POS (4)
  1426. #define PHY_RX_CHAIN_FORCE_SEL_MSK \
  1427. (0x7 << PHY_RX_CHAIN_FORCE_SEL_POS)
  1428. #define PHY_RX_CHAIN_FORCE_MIMO_SEL_POS (7)
  1429. #define PHY_RX_CHAIN_FORCE_MIMO_SEL_MSK \
  1430. (0x7 << PHY_RX_CHAIN_FORCE_MIMO_SEL_POS)
  1431. #define PHY_RX_CHAIN_CNT_POS (10)
  1432. #define PHY_RX_CHAIN_CNT_MSK \
  1433. (0x3 << PHY_RX_CHAIN_CNT_POS)
  1434. #define PHY_RX_CHAIN_MIMO_CNT_POS (12)
  1435. #define PHY_RX_CHAIN_MIMO_CNT_MSK \
  1436. (0x3 << PHY_RX_CHAIN_MIMO_CNT_POS)
  1437. #define PHY_RX_CHAIN_MIMO_FORCE_POS (14)
  1438. #define PHY_RX_CHAIN_MIMO_FORCE_MSK \
  1439. (0x1 << PHY_RX_CHAIN_MIMO_FORCE_POS)
  1440. /* TODO: fix the value, make it depend on firmware at runtime? */
  1441. #define NUM_PHY_CTX 3
  1442. /* TODO: complete missing documentation */
  1443. /**
  1444. * struct iwl_phy_context_cmd - config of the PHY context
  1445. * ( PHY_CONTEXT_CMD = 0x8 )
  1446. * @id_and_color: ID and color of the relevant Binding
  1447. * @action: action to perform, one of FW_CTXT_ACTION_*
  1448. * @apply_time: 0 means immediate apply and context switch.
  1449. * other value means apply new params after X usecs
  1450. * @tx_param_color: ???
  1451. * @ci: channel info
  1452. * @txchain_info: ???
  1453. * @rxchain_info: ???
  1454. * @acquisition_data: ???
  1455. * @dsp_cfg_flags: set to 0
  1456. */
  1457. struct iwl_phy_context_cmd {
  1458. /* COMMON_INDEX_HDR_API_S_VER_1 */
  1459. __le32 id_and_color;
  1460. __le32 action;
  1461. /* PHY_CONTEXT_DATA_API_S_VER_1 */
  1462. __le32 apply_time;
  1463. __le32 tx_param_color;
  1464. struct iwl_fw_channel_info ci;
  1465. __le32 txchain_info;
  1466. __le32 rxchain_info;
  1467. __le32 acquisition_data;
  1468. __le32 dsp_cfg_flags;
  1469. } __packed; /* PHY_CONTEXT_CMD_API_VER_1 */
  1470. /*
  1471. * Aux ROC command
  1472. *
  1473. * Command requests the firmware to create a time event for a certain duration
  1474. * and remain on the given channel. This is done by using the Aux framework in
  1475. * the FW.
  1476. * The command was first used for Hot Spot issues - but can be used regardless
  1477. * to Hot Spot.
  1478. *
  1479. * ( HOT_SPOT_CMD 0x53 )
  1480. *
  1481. * @id_and_color: ID and color of the MAC
  1482. * @action: action to perform, one of FW_CTXT_ACTION_*
  1483. * @event_unique_id: If the action FW_CTXT_ACTION_REMOVE then the
  1484. * event_unique_id should be the id of the time event assigned by ucode.
  1485. * Otherwise ignore the event_unique_id.
  1486. * @sta_id_and_color: station id and color, resumed during "Remain On Channel"
  1487. * activity.
  1488. * @channel_info: channel info
  1489. * @node_addr: Our MAC Address
  1490. * @reserved: reserved for alignment
  1491. * @apply_time: GP2 value to start (should always be the current GP2 value)
  1492. * @apply_time_max_delay: Maximum apply time delay value in TU. Defines max
  1493. * time by which start of the event is allowed to be postponed.
  1494. * @duration: event duration in TU To calculate event duration:
  1495. * timeEventDuration = min(duration, remainingQuota)
  1496. */
  1497. struct iwl_hs20_roc_req {
  1498. /* COMMON_INDEX_HDR_API_S_VER_1 hdr */
  1499. __le32 id_and_color;
  1500. __le32 action;
  1501. __le32 event_unique_id;
  1502. __le32 sta_id_and_color;
  1503. struct iwl_fw_channel_info channel_info;
  1504. u8 node_addr[ETH_ALEN];
  1505. __le16 reserved;
  1506. __le32 apply_time;
  1507. __le32 apply_time_max_delay;
  1508. __le32 duration;
  1509. } __packed; /* HOT_SPOT_CMD_API_S_VER_1 */
  1510. /*
  1511. * values for AUX ROC result values
  1512. */
  1513. enum iwl_mvm_hot_spot {
  1514. HOT_SPOT_RSP_STATUS_OK,
  1515. HOT_SPOT_RSP_STATUS_TOO_MANY_EVENTS,
  1516. HOT_SPOT_MAX_NUM_OF_SESSIONS,
  1517. };
  1518. /*
  1519. * Aux ROC command response
  1520. *
  1521. * In response to iwl_hs20_roc_req the FW sends this command to notify the
  1522. * driver the uid of the timevent.
  1523. *
  1524. * ( HOT_SPOT_CMD 0x53 )
  1525. *
  1526. * @event_unique_id: Unique ID of time event assigned by ucode
  1527. * @status: Return status 0 is success, all the rest used for specific errors
  1528. */
  1529. struct iwl_hs20_roc_res {
  1530. __le32 event_unique_id;
  1531. __le32 status;
  1532. } __packed; /* HOT_SPOT_RSP_API_S_VER_1 */
  1533. /**
  1534. * struct iwl_radio_version_notif - information on the radio version
  1535. * ( RADIO_VERSION_NOTIFICATION = 0x68 )
  1536. * @radio_flavor: radio flavor
  1537. * @radio_step: radio version step
  1538. * @radio_dash: radio version dash
  1539. */
  1540. struct iwl_radio_version_notif {
  1541. __le32 radio_flavor;
  1542. __le32 radio_step;
  1543. __le32 radio_dash;
  1544. } __packed; /* RADIO_VERSION_NOTOFICATION_S_VER_1 */
  1545. enum iwl_card_state_flags {
  1546. CARD_ENABLED = 0x00,
  1547. HW_CARD_DISABLED = 0x01,
  1548. SW_CARD_DISABLED = 0x02,
  1549. CT_KILL_CARD_DISABLED = 0x04,
  1550. HALT_CARD_DISABLED = 0x08,
  1551. CARD_DISABLED_MSK = 0x0f,
  1552. CARD_IS_RX_ON = 0x10,
  1553. };
  1554. /**
  1555. * struct iwl_radio_version_notif - information on the radio version
  1556. * ( CARD_STATE_NOTIFICATION = 0xa1 )
  1557. * @flags: %iwl_card_state_flags
  1558. */
  1559. struct iwl_card_state_notif {
  1560. __le32 flags;
  1561. } __packed; /* CARD_STATE_NTFY_API_S_VER_1 */
  1562. /**
  1563. * struct iwl_missed_beacons_notif - information on missed beacons
  1564. * ( MISSED_BEACONS_NOTIFICATION = 0xa2 )
  1565. * @mac_id: interface ID
  1566. * @consec_missed_beacons_since_last_rx: number of consecutive missed
  1567. * beacons since last RX.
  1568. * @consec_missed_beacons: number of consecutive missed beacons
  1569. * @num_expected_beacons: number of expected beacons
  1570. * @num_recvd_beacons: number of received beacons
  1571. */
  1572. struct iwl_missed_beacons_notif {
  1573. __le32 mac_id;
  1574. __le32 consec_missed_beacons_since_last_rx;
  1575. __le32 consec_missed_beacons;
  1576. __le32 num_expected_beacons;
  1577. __le32 num_recvd_beacons;
  1578. } __packed; /* MISSED_BEACON_NTFY_API_S_VER_3 */
  1579. /**
  1580. * struct iwl_mfuart_load_notif - mfuart image version & status
  1581. * ( MFUART_LOAD_NOTIFICATION = 0xb1 )
  1582. * @installed_ver: installed image version
  1583. * @external_ver: external image version
  1584. * @status: MFUART loading status
  1585. * @duration: MFUART loading time
  1586. * @image_size: MFUART image size in bytes
  1587. */
  1588. struct iwl_mfuart_load_notif {
  1589. __le32 installed_ver;
  1590. __le32 external_ver;
  1591. __le32 status;
  1592. __le32 duration;
  1593. /* image size valid only in v2 of the command */
  1594. __le32 image_size;
  1595. } __packed; /*MFU_LOADER_NTFY_API_S_VER_2*/
  1596. /**
  1597. * struct iwl_mfu_assert_dump_notif - mfuart dump logs
  1598. * ( MFU_ASSERT_DUMP_NTF = 0xfe )
  1599. * @assert_id: mfuart assert id that cause the notif
  1600. * @curr_reset_num: number of asserts since uptime
  1601. * @index_num: current chunk id
  1602. * @parts_num: total number of chunks
  1603. * @data_size: number of data bytes sent
  1604. * @data: data buffer
  1605. */
  1606. struct iwl_mfu_assert_dump_notif {
  1607. __le32 assert_id;
  1608. __le32 curr_reset_num;
  1609. __le16 index_num;
  1610. __le16 parts_num;
  1611. __le32 data_size;
  1612. __le32 data[0];
  1613. } __packed; /*MFU_DUMP_ASSERT_API_S_VER_1*/
  1614. #define MAX_PORT_ID_NUM 2
  1615. #define MAX_MCAST_FILTERING_ADDRESSES 256
  1616. /**
  1617. * struct iwl_mcast_filter_cmd - configure multicast filter.
  1618. * @filter_own: Set 1 to filter out multicast packets sent by station itself
  1619. * @port_id: Multicast MAC addresses array specifier. This is a strange way
  1620. * to identify network interface adopted in host-device IF.
  1621. * It is used by FW as index in array of addresses. This array has
  1622. * MAX_PORT_ID_NUM members.
  1623. * @count: Number of MAC addresses in the array
  1624. * @pass_all: Set 1 to pass all multicast packets.
  1625. * @bssid: current association BSSID.
  1626. * @reserved: reserved
  1627. * @addr_list: Place holder for array of MAC addresses.
  1628. * IMPORTANT: add padding if necessary to ensure DWORD alignment.
  1629. */
  1630. struct iwl_mcast_filter_cmd {
  1631. u8 filter_own;
  1632. u8 port_id;
  1633. u8 count;
  1634. u8 pass_all;
  1635. u8 bssid[6];
  1636. u8 reserved[2];
  1637. u8 addr_list[0];
  1638. } __packed; /* MCAST_FILTERING_CMD_API_S_VER_1 */
  1639. #define MAX_BCAST_FILTERS 8
  1640. #define MAX_BCAST_FILTER_ATTRS 2
  1641. /**
  1642. * enum iwl_mvm_bcast_filter_attr_offset - written by fw for each Rx packet
  1643. * @BCAST_FILTER_OFFSET_PAYLOAD_START: offset is from payload start.
  1644. * @BCAST_FILTER_OFFSET_IP_END: offset is from ip header end (i.e.
  1645. * start of ip payload).
  1646. */
  1647. enum iwl_mvm_bcast_filter_attr_offset {
  1648. BCAST_FILTER_OFFSET_PAYLOAD_START = 0,
  1649. BCAST_FILTER_OFFSET_IP_END = 1,
  1650. };
  1651. /**
  1652. * struct iwl_fw_bcast_filter_attr - broadcast filter attribute
  1653. * @offset_type: &enum iwl_mvm_bcast_filter_attr_offset.
  1654. * @offset: starting offset of this pattern.
  1655. * @reserved1: reserved
  1656. * @val: value to match - big endian (MSB is the first
  1657. * byte to match from offset pos).
  1658. * @mask: mask to match (big endian).
  1659. */
  1660. struct iwl_fw_bcast_filter_attr {
  1661. u8 offset_type;
  1662. u8 offset;
  1663. __le16 reserved1;
  1664. __be32 val;
  1665. __be32 mask;
  1666. } __packed; /* BCAST_FILTER_ATT_S_VER_1 */
  1667. /**
  1668. * enum iwl_mvm_bcast_filter_frame_type - filter frame type
  1669. * @BCAST_FILTER_FRAME_TYPE_ALL: consider all frames.
  1670. * @BCAST_FILTER_FRAME_TYPE_IPV4: consider only ipv4 frames
  1671. */
  1672. enum iwl_mvm_bcast_filter_frame_type {
  1673. BCAST_FILTER_FRAME_TYPE_ALL = 0,
  1674. BCAST_FILTER_FRAME_TYPE_IPV4 = 1,
  1675. };
  1676. /**
  1677. * struct iwl_fw_bcast_filter - broadcast filter
  1678. * @discard: discard frame (1) or let it pass (0).
  1679. * @frame_type: &enum iwl_mvm_bcast_filter_frame_type.
  1680. * @reserved1: reserved
  1681. * @num_attrs: number of valid attributes in this filter.
  1682. * @attrs: attributes of this filter. a filter is considered matched
  1683. * only when all its attributes are matched (i.e. AND relationship)
  1684. */
  1685. struct iwl_fw_bcast_filter {
  1686. u8 discard;
  1687. u8 frame_type;
  1688. u8 num_attrs;
  1689. u8 reserved1;
  1690. struct iwl_fw_bcast_filter_attr attrs[MAX_BCAST_FILTER_ATTRS];
  1691. } __packed; /* BCAST_FILTER_S_VER_1 */
  1692. #define BA_WINDOW_STREAMS_MAX 16
  1693. #define BA_WINDOW_STATUS_TID_MSK 0x000F
  1694. #define BA_WINDOW_STATUS_STA_ID_POS 4
  1695. #define BA_WINDOW_STATUS_STA_ID_MSK 0x01F0
  1696. #define BA_WINDOW_STATUS_VALID_MSK BIT(9)
  1697. /**
  1698. * struct iwl_ba_window_status_notif - reordering window's status notification
  1699. * @bitmap: bitmap of received frames [start_seq_num + 0]..[start_seq_num + 63]
  1700. * @ra_tid: bit 3:0 - TID, bit 8:4 - STA_ID, bit 9 - valid
  1701. * @start_seq_num: the start sequence number of the bitmap
  1702. * @mpdu_rx_count: the number of received MPDUs since entering D0i3
  1703. */
  1704. struct iwl_ba_window_status_notif {
  1705. __le64 bitmap[BA_WINDOW_STREAMS_MAX];
  1706. __le16 ra_tid[BA_WINDOW_STREAMS_MAX];
  1707. __le32 start_seq_num[BA_WINDOW_STREAMS_MAX];
  1708. __le16 mpdu_rx_count[BA_WINDOW_STREAMS_MAX];
  1709. } __packed; /* BA_WINDOW_STATUS_NTFY_API_S_VER_1 */
  1710. /**
  1711. * struct iwl_fw_bcast_mac - per-mac broadcast filtering configuration.
  1712. * @default_discard: default action for this mac (discard (1) / pass (0)).
  1713. * @reserved1: reserved
  1714. * @attached_filters: bitmap of relevant filters for this mac.
  1715. */
  1716. struct iwl_fw_bcast_mac {
  1717. u8 default_discard;
  1718. u8 reserved1;
  1719. __le16 attached_filters;
  1720. } __packed; /* BCAST_MAC_CONTEXT_S_VER_1 */
  1721. /**
  1722. * struct iwl_bcast_filter_cmd - broadcast filtering configuration
  1723. * @disable: enable (0) / disable (1)
  1724. * @max_bcast_filters: max number of filters (MAX_BCAST_FILTERS)
  1725. * @max_macs: max number of macs (NUM_MAC_INDEX_DRIVER)
  1726. * @reserved1: reserved
  1727. * @filters: broadcast filters
  1728. * @macs: broadcast filtering configuration per-mac
  1729. */
  1730. struct iwl_bcast_filter_cmd {
  1731. u8 disable;
  1732. u8 max_bcast_filters;
  1733. u8 max_macs;
  1734. u8 reserved1;
  1735. struct iwl_fw_bcast_filter filters[MAX_BCAST_FILTERS];
  1736. struct iwl_fw_bcast_mac macs[NUM_MAC_INDEX_DRIVER];
  1737. } __packed; /* BCAST_FILTERING_HCMD_API_S_VER_1 */
  1738. /*
  1739. * enum iwl_mvm_marker_id - maker ids
  1740. *
  1741. * The ids for different type of markers to insert into the usniffer logs
  1742. */
  1743. enum iwl_mvm_marker_id {
  1744. MARKER_ID_TX_FRAME_LATENCY = 1,
  1745. }; /* MARKER_ID_API_E_VER_1 */
  1746. /**
  1747. * struct iwl_mvm_marker - mark info into the usniffer logs
  1748. *
  1749. * (MARKER_CMD = 0xcb)
  1750. *
  1751. * Mark the UTC time stamp into the usniffer logs together with additional
  1752. * metadata, so the usniffer output can be parsed.
  1753. * In the command response the ucode will return the GP2 time.
  1754. *
  1755. * @dw_len: The amount of dwords following this byte including this byte.
  1756. * @marker_id: A unique marker id (iwl_mvm_marker_id).
  1757. * @reserved: reserved.
  1758. * @timestamp: in milliseconds since 1970-01-01 00:00:00 UTC
  1759. * @metadata: additional meta data that will be written to the unsiffer log
  1760. */
  1761. struct iwl_mvm_marker {
  1762. u8 dw_len;
  1763. u8 marker_id;
  1764. __le16 reserved;
  1765. __le64 timestamp;
  1766. __le32 metadata[0];
  1767. } __packed; /* MARKER_API_S_VER_1 */
  1768. /*
  1769. * enum iwl_dc2dc_config_id - flag ids
  1770. *
  1771. * Ids of dc2dc configuration flags
  1772. */
  1773. enum iwl_dc2dc_config_id {
  1774. DCDC_LOW_POWER_MODE_MSK_SET = 0x1, /* not used */
  1775. DCDC_FREQ_TUNE_SET = 0x2,
  1776. }; /* MARKER_ID_API_E_VER_1 */
  1777. /**
  1778. * struct iwl_dc2dc_config_cmd - configure dc2dc values
  1779. *
  1780. * (DC2DC_CONFIG_CMD = 0x83)
  1781. *
  1782. * Set/Get & configure dc2dc values.
  1783. * The command always returns the current dc2dc values.
  1784. *
  1785. * @flags: set/get dc2dc
  1786. * @enable_low_power_mode: not used.
  1787. * @dc2dc_freq_tune0: frequency divider - digital domain
  1788. * @dc2dc_freq_tune1: frequency divider - analog domain
  1789. */
  1790. struct iwl_dc2dc_config_cmd {
  1791. __le32 flags;
  1792. __le32 enable_low_power_mode; /* not used */
  1793. __le32 dc2dc_freq_tune0;
  1794. __le32 dc2dc_freq_tune1;
  1795. } __packed; /* DC2DC_CONFIG_CMD_API_S_VER_1 */
  1796. /**
  1797. * struct iwl_dc2dc_config_resp - response for iwl_dc2dc_config_cmd
  1798. *
  1799. * Current dc2dc values returned by the FW.
  1800. *
  1801. * @dc2dc_freq_tune0: frequency divider - digital domain
  1802. * @dc2dc_freq_tune1: frequency divider - analog domain
  1803. */
  1804. struct iwl_dc2dc_config_resp {
  1805. __le32 dc2dc_freq_tune0;
  1806. __le32 dc2dc_freq_tune1;
  1807. } __packed; /* DC2DC_CONFIG_RESP_API_S_VER_1 */
  1808. /***********************************
  1809. * Smart Fifo API
  1810. ***********************************/
  1811. /* Smart Fifo state */
  1812. enum iwl_sf_state {
  1813. SF_LONG_DELAY_ON = 0, /* should never be called by driver */
  1814. SF_FULL_ON,
  1815. SF_UNINIT,
  1816. SF_INIT_OFF,
  1817. SF_HW_NUM_STATES
  1818. };
  1819. /* Smart Fifo possible scenario */
  1820. enum iwl_sf_scenario {
  1821. SF_SCENARIO_SINGLE_UNICAST,
  1822. SF_SCENARIO_AGG_UNICAST,
  1823. SF_SCENARIO_MULTICAST,
  1824. SF_SCENARIO_BA_RESP,
  1825. SF_SCENARIO_TX_RESP,
  1826. SF_NUM_SCENARIO
  1827. };
  1828. #define SF_TRANSIENT_STATES_NUMBER 2 /* SF_LONG_DELAY_ON and SF_FULL_ON */
  1829. #define SF_NUM_TIMEOUT_TYPES 2 /* Aging timer and Idle timer */
  1830. /* smart FIFO default values */
  1831. #define SF_W_MARK_SISO 6144
  1832. #define SF_W_MARK_MIMO2 8192
  1833. #define SF_W_MARK_MIMO3 6144
  1834. #define SF_W_MARK_LEGACY 4096
  1835. #define SF_W_MARK_SCAN 4096
  1836. /* SF Scenarios timers for default configuration (aligned to 32 uSec) */
  1837. #define SF_SINGLE_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
  1838. #define SF_SINGLE_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
  1839. #define SF_AGG_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */
  1840. #define SF_AGG_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
  1841. #define SF_MCAST_IDLE_TIMER_DEF 160 /* 150 mSec */
  1842. #define SF_MCAST_AGING_TIMER_DEF 400 /* 0.4 mSec */
  1843. #define SF_BA_IDLE_TIMER_DEF 160 /* 150 uSec */
  1844. #define SF_BA_AGING_TIMER_DEF 400 /* 0.4 mSec */
  1845. #define SF_TX_RE_IDLE_TIMER_DEF 160 /* 150 uSec */
  1846. #define SF_TX_RE_AGING_TIMER_DEF 400 /* 0.4 mSec */
  1847. /* SF Scenarios timers for BSS MAC configuration (aligned to 32 uSec) */
  1848. #define SF_SINGLE_UNICAST_IDLE_TIMER 320 /* 300 uSec */
  1849. #define SF_SINGLE_UNICAST_AGING_TIMER 2016 /* 2 mSec */
  1850. #define SF_AGG_UNICAST_IDLE_TIMER 320 /* 300 uSec */
  1851. #define SF_AGG_UNICAST_AGING_TIMER 2016 /* 2 mSec */
  1852. #define SF_MCAST_IDLE_TIMER 2016 /* 2 mSec */
  1853. #define SF_MCAST_AGING_TIMER 10016 /* 10 mSec */
  1854. #define SF_BA_IDLE_TIMER 320 /* 300 uSec */
  1855. #define SF_BA_AGING_TIMER 2016 /* 2 mSec */
  1856. #define SF_TX_RE_IDLE_TIMER 320 /* 300 uSec */
  1857. #define SF_TX_RE_AGING_TIMER 2016 /* 2 mSec */
  1858. #define SF_LONG_DELAY_AGING_TIMER 1000000 /* 1 Sec */
  1859. #define SF_CFG_DUMMY_NOTIF_OFF BIT(16)
  1860. /**
  1861. * struct iwl_sf_cfg_cmd - Smart Fifo configuration command.
  1862. * @state: smart fifo state, types listed in &enum iwl_sf_state.
  1863. * @watermark: Minimum allowed availabe free space in RXF for transient state.
  1864. * @long_delay_timeouts: aging and idle timer values for each scenario
  1865. * in long delay state.
  1866. * @full_on_timeouts: timer values for each scenario in full on state.
  1867. */
  1868. struct iwl_sf_cfg_cmd {
  1869. __le32 state;
  1870. __le32 watermark[SF_TRANSIENT_STATES_NUMBER];
  1871. __le32 long_delay_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
  1872. __le32 full_on_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
  1873. } __packed; /* SF_CFG_API_S_VER_2 */
  1874. /***********************************
  1875. * Location Aware Regulatory (LAR) API - MCC updates
  1876. ***********************************/
  1877. /**
  1878. * struct iwl_mcc_update_cmd_v1 - Request the device to update geographic
  1879. * regulatory profile according to the given MCC (Mobile Country Code).
  1880. * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
  1881. * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
  1882. * MCC in the cmd response will be the relevant MCC in the NVM.
  1883. * @mcc: given mobile country code
  1884. * @source_id: the source from where we got the MCC, see iwl_mcc_source
  1885. * @reserved: reserved for alignment
  1886. */
  1887. struct iwl_mcc_update_cmd_v1 {
  1888. __le16 mcc;
  1889. u8 source_id;
  1890. u8 reserved;
  1891. } __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_1 */
  1892. /**
  1893. * struct iwl_mcc_update_cmd - Request the device to update geographic
  1894. * regulatory profile according to the given MCC (Mobile Country Code).
  1895. * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
  1896. * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
  1897. * MCC in the cmd response will be the relevant MCC in the NVM.
  1898. * @mcc: given mobile country code
  1899. * @source_id: the source from where we got the MCC, see iwl_mcc_source
  1900. * @reserved: reserved for alignment
  1901. * @key: integrity key for MCC API OEM testing
  1902. * @reserved2: reserved
  1903. */
  1904. struct iwl_mcc_update_cmd {
  1905. __le16 mcc;
  1906. u8 source_id;
  1907. u8 reserved;
  1908. __le32 key;
  1909. u8 reserved2[20];
  1910. } __packed; /* LAR_UPDATE_MCC_CMD_API_S_VER_2 */
  1911. /**
  1912. * struct iwl_mcc_update_resp_v1 - response to MCC_UPDATE_CMD.
  1913. * Contains the new channel control profile map, if changed, and the new MCC
  1914. * (mobile country code).
  1915. * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
  1916. * @status: see &enum iwl_mcc_update_status
  1917. * @mcc: the new applied MCC
  1918. * @cap: capabilities for all channels which matches the MCC
  1919. * @source_id: the MCC source, see iwl_mcc_source
  1920. * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
  1921. * channels, depending on platform)
  1922. * @channels: channel control data map, DWORD for each channel. Only the first
  1923. * 16bits are used.
  1924. */
  1925. struct iwl_mcc_update_resp_v1 {
  1926. __le32 status;
  1927. __le16 mcc;
  1928. u8 cap;
  1929. u8 source_id;
  1930. __le32 n_channels;
  1931. __le32 channels[0];
  1932. } __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_1 */
  1933. /**
  1934. * struct iwl_mcc_update_resp - response to MCC_UPDATE_CMD.
  1935. * Contains the new channel control profile map, if changed, and the new MCC
  1936. * (mobile country code).
  1937. * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
  1938. * @status: see &enum iwl_mcc_update_status
  1939. * @mcc: the new applied MCC
  1940. * @cap: capabilities for all channels which matches the MCC
  1941. * @source_id: the MCC source, see iwl_mcc_source
  1942. * @time: time elapsed from the MCC test start (in 30 seconds TU)
  1943. * @reserved: reserved.
  1944. * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
  1945. * channels, depending on platform)
  1946. * @channels: channel control data map, DWORD for each channel. Only the first
  1947. * 16bits are used.
  1948. */
  1949. struct iwl_mcc_update_resp {
  1950. __le32 status;
  1951. __le16 mcc;
  1952. u8 cap;
  1953. u8 source_id;
  1954. __le16 time;
  1955. __le16 reserved;
  1956. __le32 n_channels;
  1957. __le32 channels[0];
  1958. } __packed; /* LAR_UPDATE_MCC_CMD_RESP_S_VER_2 */
  1959. /**
  1960. * struct iwl_mcc_chub_notif - chub notifies of mcc change
  1961. * (MCC_CHUB_UPDATE_CMD = 0xc9)
  1962. * The Chub (Communication Hub, CommsHUB) is a HW component that connects to
  1963. * the cellular and connectivity cores that gets updates of the mcc, and
  1964. * notifies the ucode directly of any mcc change.
  1965. * The ucode requests the driver to request the device to update geographic
  1966. * regulatory profile according to the given MCC (Mobile Country Code).
  1967. * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
  1968. * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
  1969. * MCC in the cmd response will be the relevant MCC in the NVM.
  1970. * @mcc: given mobile country code
  1971. * @source_id: identity of the change originator, see iwl_mcc_source
  1972. * @reserved1: reserved for alignment
  1973. */
  1974. struct iwl_mcc_chub_notif {
  1975. __le16 mcc;
  1976. u8 source_id;
  1977. u8 reserved1;
  1978. } __packed; /* LAR_MCC_NOTIFY_S */
  1979. enum iwl_mcc_update_status {
  1980. MCC_RESP_NEW_CHAN_PROFILE,
  1981. MCC_RESP_SAME_CHAN_PROFILE,
  1982. MCC_RESP_INVALID,
  1983. MCC_RESP_NVM_DISABLED,
  1984. MCC_RESP_ILLEGAL,
  1985. MCC_RESP_LOW_PRIORITY,
  1986. MCC_RESP_TEST_MODE_ACTIVE,
  1987. MCC_RESP_TEST_MODE_NOT_ACTIVE,
  1988. MCC_RESP_TEST_MODE_DENIAL_OF_SERVICE,
  1989. };
  1990. enum iwl_mcc_source {
  1991. MCC_SOURCE_OLD_FW = 0,
  1992. MCC_SOURCE_ME = 1,
  1993. MCC_SOURCE_BIOS = 2,
  1994. MCC_SOURCE_3G_LTE_HOST = 3,
  1995. MCC_SOURCE_3G_LTE_DEVICE = 4,
  1996. MCC_SOURCE_WIFI = 5,
  1997. MCC_SOURCE_RESERVED = 6,
  1998. MCC_SOURCE_DEFAULT = 7,
  1999. MCC_SOURCE_UNINITIALIZED = 8,
  2000. MCC_SOURCE_MCC_API = 9,
  2001. MCC_SOURCE_GET_CURRENT = 0x10,
  2002. MCC_SOURCE_GETTING_MCC_TEST_MODE = 0x11,
  2003. };
  2004. /* DTS measurements */
  2005. enum iwl_dts_measurement_flags {
  2006. DTS_TRIGGER_CMD_FLAGS_TEMP = BIT(0),
  2007. DTS_TRIGGER_CMD_FLAGS_VOLT = BIT(1),
  2008. };
  2009. /**
  2010. * struct iwl_dts_measurement_cmd - request DTS temp and/or voltage measurements
  2011. *
  2012. * @flags: indicates which measurements we want as specified in
  2013. * &enum iwl_dts_measurement_flags
  2014. */
  2015. struct iwl_dts_measurement_cmd {
  2016. __le32 flags;
  2017. } __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_CMD_S */
  2018. /**
  2019. * enum iwl_dts_control_measurement_mode - DTS measurement type
  2020. * @DTS_AUTOMATIC: Automatic mode (full SW control). Provide temperature read
  2021. * back (latest value. Not waiting for new value). Use automatic
  2022. * SW DTS configuration.
  2023. * @DTS_REQUEST_READ: Request DTS read. Configure DTS with manual settings,
  2024. * trigger DTS reading and provide read back temperature read
  2025. * when available.
  2026. * @DTS_OVER_WRITE: over-write the DTS temperatures in the SW until next read
  2027. * @DTS_DIRECT_WITHOUT_MEASURE: DTS returns its latest temperature result,
  2028. * without measurement trigger.
  2029. */
  2030. enum iwl_dts_control_measurement_mode {
  2031. DTS_AUTOMATIC = 0,
  2032. DTS_REQUEST_READ = 1,
  2033. DTS_OVER_WRITE = 2,
  2034. DTS_DIRECT_WITHOUT_MEASURE = 3,
  2035. };
  2036. /**
  2037. * enum iwl_dts_used - DTS to use or used for measurement in the DTS request
  2038. * @DTS_USE_TOP: Top
  2039. * @DTS_USE_CHAIN_A: chain A
  2040. * @DTS_USE_CHAIN_B: chain B
  2041. * @DTS_USE_CHAIN_C: chain C
  2042. * @XTAL_TEMPERATURE: read temperature from xtal
  2043. */
  2044. enum iwl_dts_used {
  2045. DTS_USE_TOP = 0,
  2046. DTS_USE_CHAIN_A = 1,
  2047. DTS_USE_CHAIN_B = 2,
  2048. DTS_USE_CHAIN_C = 3,
  2049. XTAL_TEMPERATURE = 4,
  2050. };
  2051. /**
  2052. * enum iwl_dts_bit_mode - bit-mode to use in DTS request read mode
  2053. * @DTS_BIT6_MODE: bit 6 mode
  2054. * @DTS_BIT8_MODE: bit 8 mode
  2055. */
  2056. enum iwl_dts_bit_mode {
  2057. DTS_BIT6_MODE = 0,
  2058. DTS_BIT8_MODE = 1,
  2059. };
  2060. /**
  2061. * struct iwl_ext_dts_measurement_cmd - request extended DTS temp measurements
  2062. * @control_mode: see &enum iwl_dts_control_measurement_mode
  2063. * @temperature: used when over write DTS mode is selected
  2064. * @sensor: set temperature sensor to use. See &enum iwl_dts_used
  2065. * @avg_factor: average factor to DTS in request DTS read mode
  2066. * @bit_mode: value defines the DTS bit mode to use. See &enum iwl_dts_bit_mode
  2067. * @step_duration: step duration for the DTS
  2068. */
  2069. struct iwl_ext_dts_measurement_cmd {
  2070. __le32 control_mode;
  2071. __le32 temperature;
  2072. __le32 sensor;
  2073. __le32 avg_factor;
  2074. __le32 bit_mode;
  2075. __le32 step_duration;
  2076. } __packed; /* XVT_FW_DTS_CONTROL_MEASUREMENT_REQUEST_API_S */
  2077. /**
  2078. * struct iwl_dts_measurement_notif_v1 - measurements notification
  2079. *
  2080. * @temp: the measured temperature
  2081. * @voltage: the measured voltage
  2082. */
  2083. struct iwl_dts_measurement_notif_v1 {
  2084. __le32 temp;
  2085. __le32 voltage;
  2086. } __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_1*/
  2087. /**
  2088. * struct iwl_dts_measurement_notif_v2 - measurements notification
  2089. *
  2090. * @temp: the measured temperature
  2091. * @voltage: the measured voltage
  2092. * @threshold_idx: the trip index that was crossed
  2093. */
  2094. struct iwl_dts_measurement_notif_v2 {
  2095. __le32 temp;
  2096. __le32 voltage;
  2097. __le32 threshold_idx;
  2098. } __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_2 */
  2099. /**
  2100. * struct ct_kill_notif - CT-kill entry notification
  2101. *
  2102. * @temperature: the current temperature in celsius
  2103. * @reserved: reserved
  2104. */
  2105. struct ct_kill_notif {
  2106. __le16 temperature;
  2107. __le16 reserved;
  2108. } __packed; /* GRP_PHY_CT_KILL_NTF */
  2109. /**
  2110. * enum ctdp_cmd_operation - CTDP command operations
  2111. * @CTDP_CMD_OPERATION_START: update the current budget
  2112. * @CTDP_CMD_OPERATION_STOP: stop ctdp
  2113. * @CTDP_CMD_OPERATION_REPORT: get the average budget
  2114. */
  2115. enum iwl_mvm_ctdp_cmd_operation {
  2116. CTDP_CMD_OPERATION_START = 0x1,
  2117. CTDP_CMD_OPERATION_STOP = 0x2,
  2118. CTDP_CMD_OPERATION_REPORT = 0x4,
  2119. };/* CTDP_CMD_OPERATION_TYPE_E */
  2120. /**
  2121. * struct iwl_mvm_ctdp_cmd - track and manage the FW power consumption budget
  2122. *
  2123. * @operation: see &enum iwl_mvm_ctdp_cmd_operation
  2124. * @budget: the budget in milliwatt
  2125. * @window_size: defined in API but not used
  2126. */
  2127. struct iwl_mvm_ctdp_cmd {
  2128. __le32 operation;
  2129. __le32 budget;
  2130. __le32 window_size;
  2131. } __packed;
  2132. #define IWL_MAX_DTS_TRIPS 8
  2133. /**
  2134. * struct temp_report_ths_cmd - set temperature thresholds
  2135. *
  2136. * @num_temps: number of temperature thresholds passed
  2137. * @thresholds: array with the thresholds to be configured
  2138. */
  2139. struct temp_report_ths_cmd {
  2140. __le32 num_temps;
  2141. __le16 thresholds[IWL_MAX_DTS_TRIPS];
  2142. } __packed; /* GRP_PHY_TEMP_REPORTING_THRESHOLDS_CMD */
  2143. /***********************************
  2144. * TDLS API
  2145. ***********************************/
  2146. /* Type of TDLS request */
  2147. enum iwl_tdls_channel_switch_type {
  2148. TDLS_SEND_CHAN_SW_REQ = 0,
  2149. TDLS_SEND_CHAN_SW_RESP_AND_MOVE_CH,
  2150. TDLS_MOVE_CH,
  2151. }; /* TDLS_STA_CHANNEL_SWITCH_CMD_TYPE_API_E_VER_1 */
  2152. /**
  2153. * struct iwl_tdls_channel_switch_timing - Switch timing in TDLS channel-switch
  2154. * @frame_timestamp: GP2 timestamp of channel-switch request/response packet
  2155. * received from peer
  2156. * @max_offchan_duration: What amount of microseconds out of a DTIM is given
  2157. * to the TDLS off-channel communication. For instance if the DTIM is
  2158. * 200TU and the TDLS peer is to be given 25% of the time, the value
  2159. * given will be 50TU, or 50 * 1024 if translated into microseconds.
  2160. * @switch_time: switch time the peer sent in its channel switch timing IE
  2161. * @switch_timeout: switch timeout the peer sent in its channel switch timing IE
  2162. */
  2163. struct iwl_tdls_channel_switch_timing {
  2164. __le32 frame_timestamp; /* GP2 time of peer packet Rx */
  2165. __le32 max_offchan_duration; /* given in micro-seconds */
  2166. __le32 switch_time; /* given in micro-seconds */
  2167. __le32 switch_timeout; /* given in micro-seconds */
  2168. } __packed; /* TDLS_STA_CHANNEL_SWITCH_TIMING_DATA_API_S_VER_1 */
  2169. #define IWL_TDLS_CH_SW_FRAME_MAX_SIZE 200
  2170. /**
  2171. * struct iwl_tdls_channel_switch_frame - TDLS channel switch frame template
  2172. *
  2173. * A template representing a TDLS channel-switch request or response frame
  2174. *
  2175. * @switch_time_offset: offset to the channel switch timing IE in the template
  2176. * @tx_cmd: Tx parameters for the frame
  2177. * @data: frame data
  2178. */
  2179. struct iwl_tdls_channel_switch_frame {
  2180. __le32 switch_time_offset;
  2181. struct iwl_tx_cmd tx_cmd;
  2182. u8 data[IWL_TDLS_CH_SW_FRAME_MAX_SIZE];
  2183. } __packed; /* TDLS_STA_CHANNEL_SWITCH_FRAME_API_S_VER_1 */
  2184. /**
  2185. * struct iwl_tdls_channel_switch_cmd - TDLS channel switch command
  2186. *
  2187. * The command is sent to initiate a channel switch and also in response to
  2188. * incoming TDLS channel-switch request/response packets from remote peers.
  2189. *
  2190. * @switch_type: see &enum iwl_tdls_channel_switch_type
  2191. * @peer_sta_id: station id of TDLS peer
  2192. * @ci: channel we switch to
  2193. * @timing: timing related data for command
  2194. * @frame: channel-switch request/response template, depending to switch_type
  2195. */
  2196. struct iwl_tdls_channel_switch_cmd {
  2197. u8 switch_type;
  2198. __le32 peer_sta_id;
  2199. struct iwl_fw_channel_info ci;
  2200. struct iwl_tdls_channel_switch_timing timing;
  2201. struct iwl_tdls_channel_switch_frame frame;
  2202. } __packed; /* TDLS_STA_CHANNEL_SWITCH_CMD_API_S_VER_1 */
  2203. /**
  2204. * struct iwl_tdls_channel_switch_notif - TDLS channel switch start notification
  2205. *
  2206. * @status: non-zero on success
  2207. * @offchannel_duration: duration given in microseconds
  2208. * @sta_id: peer currently performing the channel-switch with
  2209. */
  2210. struct iwl_tdls_channel_switch_notif {
  2211. __le32 status;
  2212. __le32 offchannel_duration;
  2213. __le32 sta_id;
  2214. } __packed; /* TDLS_STA_CHANNEL_SWITCH_NTFY_API_S_VER_1 */
  2215. /**
  2216. * struct iwl_tdls_sta_info - TDLS station info
  2217. *
  2218. * @sta_id: station id of the TDLS peer
  2219. * @tx_to_peer_tid: TID reserved vs. the peer for FW based Tx
  2220. * @tx_to_peer_ssn: initial SSN the FW should use for Tx on its TID vs the peer
  2221. * @is_initiator: 1 if the peer is the TDLS link initiator, 0 otherwise
  2222. */
  2223. struct iwl_tdls_sta_info {
  2224. u8 sta_id;
  2225. u8 tx_to_peer_tid;
  2226. __le16 tx_to_peer_ssn;
  2227. __le32 is_initiator;
  2228. } __packed; /* TDLS_STA_INFO_VER_1 */
  2229. /**
  2230. * struct iwl_tdls_config_cmd - TDLS basic config command
  2231. *
  2232. * @id_and_color: MAC id and color being configured
  2233. * @tdls_peer_count: amount of currently connected TDLS peers
  2234. * @tx_to_ap_tid: TID reverved vs. the AP for FW based Tx
  2235. * @tx_to_ap_ssn: initial SSN the FW should use for Tx on its TID vs. the AP
  2236. * @sta_info: per-station info. Only the first tdls_peer_count entries are set
  2237. * @pti_req_data_offset: offset of network-level data for the PTI template
  2238. * @pti_req_tx_cmd: Tx parameters for PTI request template
  2239. * @pti_req_template: PTI request template data
  2240. */
  2241. struct iwl_tdls_config_cmd {
  2242. __le32 id_and_color; /* mac id and color */
  2243. u8 tdls_peer_count;
  2244. u8 tx_to_ap_tid;
  2245. __le16 tx_to_ap_ssn;
  2246. struct iwl_tdls_sta_info sta_info[IWL_MVM_TDLS_STA_COUNT];
  2247. __le32 pti_req_data_offset;
  2248. struct iwl_tx_cmd pti_req_tx_cmd;
  2249. u8 pti_req_template[0];
  2250. } __packed; /* TDLS_CONFIG_CMD_API_S_VER_1 */
  2251. /**
  2252. * struct iwl_tdls_config_sta_info_res - TDLS per-station config information
  2253. *
  2254. * @sta_id: station id of the TDLS peer
  2255. * @tx_to_peer_last_seq: last sequence number used by FW during FW-based Tx to
  2256. * the peer
  2257. */
  2258. struct iwl_tdls_config_sta_info_res {
  2259. __le16 sta_id;
  2260. __le16 tx_to_peer_last_seq;
  2261. } __packed; /* TDLS_STA_INFO_RSP_VER_1 */
  2262. /**
  2263. * struct iwl_tdls_config_res - TDLS config information from FW
  2264. *
  2265. * @tx_to_ap_last_seq: last sequence number used by FW during FW-based Tx to AP
  2266. * @sta_info: per-station TDLS config information
  2267. */
  2268. struct iwl_tdls_config_res {
  2269. __le32 tx_to_ap_last_seq;
  2270. struct iwl_tdls_config_sta_info_res sta_info[IWL_MVM_TDLS_STA_COUNT];
  2271. } __packed; /* TDLS_CONFIG_RSP_API_S_VER_1 */
  2272. #define TX_FIFO_MAX_NUM_9000 8
  2273. #define TX_FIFO_MAX_NUM 15
  2274. #define RX_FIFO_MAX_NUM 2
  2275. #define TX_FIFO_INTERNAL_MAX_NUM 6
  2276. /**
  2277. * struct iwl_shared_mem_cfg_v1 - Shared memory configuration information
  2278. *
  2279. * @shared_mem_addr: shared memory addr (pre 8000 HW set to 0x0 as MARBH is not
  2280. * accessible)
  2281. * @shared_mem_size: shared memory size
  2282. * @sample_buff_addr: internal sample (mon/adc) buff addr (pre 8000 HW set to
  2283. * 0x0 as accessible only via DBGM RDAT)
  2284. * @sample_buff_size: internal sample buff size
  2285. * @txfifo_addr: start addr of TXF0 (excluding the context table 0.5KB), (pre
  2286. * 8000 HW set to 0x0 as not accessible)
  2287. * @txfifo_size: size of TXF0 ... TXF7
  2288. * @rxfifo_size: RXF1, RXF2 sizes. If there is no RXF2, it'll have a value of 0
  2289. * @page_buff_addr: used by UMAC and performance debug (page miss analysis),
  2290. * when paging is not supported this should be 0
  2291. * @page_buff_size: size of %page_buff_addr
  2292. * @rxfifo_addr: Start address of rxFifo
  2293. * @internal_txfifo_addr: start address of internalFifo
  2294. * @internal_txfifo_size: internal fifos' size
  2295. *
  2296. * NOTE: on firmware that don't have IWL_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG
  2297. * set, the last 3 members don't exist.
  2298. */
  2299. struct iwl_shared_mem_cfg_v1 {
  2300. __le32 shared_mem_addr;
  2301. __le32 shared_mem_size;
  2302. __le32 sample_buff_addr;
  2303. __le32 sample_buff_size;
  2304. __le32 txfifo_addr;
  2305. __le32 txfifo_size[TX_FIFO_MAX_NUM_9000];
  2306. __le32 rxfifo_size[RX_FIFO_MAX_NUM];
  2307. __le32 page_buff_addr;
  2308. __le32 page_buff_size;
  2309. __le32 rxfifo_addr;
  2310. __le32 internal_txfifo_addr;
  2311. __le32 internal_txfifo_size[TX_FIFO_INTERNAL_MAX_NUM];
  2312. } __packed; /* SHARED_MEM_ALLOC_API_S_VER_2 */
  2313. /**
  2314. * struct iwl_shared_mem_lmac_cfg - LMAC shared memory configuration
  2315. *
  2316. * @txfifo_addr: start addr of TXF0 (excluding the context table 0.5KB)
  2317. * @txfifo_size: size of TX FIFOs
  2318. * @rxfifo1_addr: RXF1 addr
  2319. * @rxfifo1_size: RXF1 size
  2320. */
  2321. struct iwl_shared_mem_lmac_cfg {
  2322. __le32 txfifo_addr;
  2323. __le32 txfifo_size[TX_FIFO_MAX_NUM];
  2324. __le32 rxfifo1_addr;
  2325. __le32 rxfifo1_size;
  2326. } __packed; /* SHARED_MEM_ALLOC_LMAC_API_S_VER_1 */
  2327. /**
  2328. * struct iwl_shared_mem_cfg - Shared memory configuration information
  2329. *
  2330. * @shared_mem_addr: shared memory address
  2331. * @shared_mem_size: shared memory size
  2332. * @sample_buff_addr: internal sample (mon/adc) buff addr
  2333. * @sample_buff_size: internal sample buff size
  2334. * @rxfifo2_addr: start addr of RXF2
  2335. * @rxfifo2_size: size of RXF2
  2336. * @page_buff_addr: used by UMAC and performance debug (page miss analysis),
  2337. * when paging is not supported this should be 0
  2338. * @page_buff_size: size of %page_buff_addr
  2339. * @lmac_num: number of LMACs (1 or 2)
  2340. * @lmac_smem: per - LMAC smem data
  2341. */
  2342. struct iwl_shared_mem_cfg {
  2343. __le32 shared_mem_addr;
  2344. __le32 shared_mem_size;
  2345. __le32 sample_buff_addr;
  2346. __le32 sample_buff_size;
  2347. __le32 rxfifo2_addr;
  2348. __le32 rxfifo2_size;
  2349. __le32 page_buff_addr;
  2350. __le32 page_buff_size;
  2351. __le32 lmac_num;
  2352. struct iwl_shared_mem_lmac_cfg lmac_smem[2];
  2353. } __packed; /* SHARED_MEM_ALLOC_API_S_VER_3 */
  2354. /**
  2355. * struct iwl_mu_group_mgmt_cmd - VHT MU-MIMO group configuration
  2356. *
  2357. * @reserved: reserved
  2358. * @membership_status: a bitmap of MU groups
  2359. * @user_position:the position of station in a group. If the station is in the
  2360. * group then bits (group * 2) is the position -1
  2361. */
  2362. struct iwl_mu_group_mgmt_cmd {
  2363. __le32 reserved;
  2364. __le32 membership_status[2];
  2365. __le32 user_position[4];
  2366. } __packed; /* MU_GROUP_ID_MNG_TABLE_API_S_VER_1 */
  2367. /**
  2368. * struct iwl_mu_group_mgmt_notif - VHT MU-MIMO group id notification
  2369. *
  2370. * @membership_status: a bitmap of MU groups
  2371. * @user_position: the position of station in a group. If the station is in the
  2372. * group then bits (group * 2) is the position -1
  2373. */
  2374. struct iwl_mu_group_mgmt_notif {
  2375. __le32 membership_status[2];
  2376. __le32 user_position[4];
  2377. } __packed; /* MU_GROUP_MNG_NTFY_API_S_VER_1 */
  2378. #define MAX_STORED_BEACON_SIZE 600
  2379. /**
  2380. * struct iwl_stored_beacon_notif - Stored beacon notification
  2381. *
  2382. * @system_time: system time on air rise
  2383. * @tsf: TSF on air rise
  2384. * @beacon_timestamp: beacon on air rise
  2385. * @band: band, matches &RX_RES_PHY_FLAGS_BAND_24 definition
  2386. * @channel: channel this beacon was received on
  2387. * @rates: rate in ucode internal format
  2388. * @byte_count: frame's byte count
  2389. * @data: beacon data, length in @byte_count
  2390. */
  2391. struct iwl_stored_beacon_notif {
  2392. __le32 system_time;
  2393. __le64 tsf;
  2394. __le32 beacon_timestamp;
  2395. __le16 band;
  2396. __le16 channel;
  2397. __le32 rates;
  2398. __le32 byte_count;
  2399. u8 data[MAX_STORED_BEACON_SIZE];
  2400. } __packed; /* WOWLAN_STROED_BEACON_INFO_S_VER_2 */
  2401. #define LQM_NUMBER_OF_STATIONS_IN_REPORT 16
  2402. enum iwl_lqm_cmd_operatrions {
  2403. LQM_CMD_OPERATION_START_MEASUREMENT = 0x01,
  2404. LQM_CMD_OPERATION_STOP_MEASUREMENT = 0x02,
  2405. };
  2406. enum iwl_lqm_status {
  2407. LQM_STATUS_SUCCESS = 0,
  2408. LQM_STATUS_TIMEOUT = 1,
  2409. LQM_STATUS_ABORT = 2,
  2410. };
  2411. /**
  2412. * struct iwl_link_qual_msrmnt_cmd - Link Quality Measurement command
  2413. * @cmd_operation: command operation to be performed (start or stop)
  2414. * as defined above.
  2415. * @mac_id: MAC ID the measurement applies to.
  2416. * @measurement_time: time of the total measurement to be performed, in uSec.
  2417. * @timeout: maximum time allowed until a response is sent, in uSec.
  2418. */
  2419. struct iwl_link_qual_msrmnt_cmd {
  2420. __le32 cmd_operation;
  2421. __le32 mac_id;
  2422. __le32 measurement_time;
  2423. __le32 timeout;
  2424. } __packed /* LQM_CMD_API_S_VER_1 */;
  2425. /**
  2426. * struct iwl_link_qual_msrmnt_notif - Link Quality Measurement notification
  2427. *
  2428. * @frequent_stations_air_time: an array containing the total air time
  2429. * (in uSec) used by the most frequently transmitting stations.
  2430. * @number_of_stations: the number of uniqe stations included in the array
  2431. * (a number between 0 to 16)
  2432. * @total_air_time_other_stations: the total air time (uSec) used by all the
  2433. * stations which are not included in the above report.
  2434. * @time_in_measurement_window: the total time in uSec in which a measurement
  2435. * took place.
  2436. * @tx_frame_dropped: the number of TX frames dropped due to retry limit during
  2437. * measurement
  2438. * @mac_id: MAC ID the measurement applies to.
  2439. * @status: return status. may be one of the LQM_STATUS_* defined above.
  2440. * @reserved: reserved.
  2441. */
  2442. struct iwl_link_qual_msrmnt_notif {
  2443. __le32 frequent_stations_air_time[LQM_NUMBER_OF_STATIONS_IN_REPORT];
  2444. __le32 number_of_stations;
  2445. __le32 total_air_time_other_stations;
  2446. __le32 time_in_measurement_window;
  2447. __le32 tx_frame_dropped;
  2448. __le32 mac_id;
  2449. __le32 status;
  2450. u8 reserved[12];
  2451. } __packed; /* LQM_MEASUREMENT_COMPLETE_NTF_API_S_VER1 */
  2452. /**
  2453. * struct iwl_channel_switch_noa_notif - Channel switch NOA notification
  2454. *
  2455. * @id_and_color: ID and color of the MAC
  2456. */
  2457. struct iwl_channel_switch_noa_notif {
  2458. __le32 id_and_color;
  2459. } __packed; /* CHANNEL_SWITCH_START_NTFY_API_S_VER_1 */
  2460. /* Operation types for the debug mem access */
  2461. enum {
  2462. DEBUG_MEM_OP_READ = 0,
  2463. DEBUG_MEM_OP_WRITE = 1,
  2464. DEBUG_MEM_OP_WRITE_BYTES = 2,
  2465. };
  2466. #define DEBUG_MEM_MAX_SIZE_DWORDS 32
  2467. /**
  2468. * struct iwl_dbg_mem_access_cmd - Request the device to read/write memory
  2469. * @op: DEBUG_MEM_OP_*
  2470. * @addr: address to read/write from/to
  2471. * @len: in dwords, to read/write
  2472. * @data: for write opeations, contains the source buffer
  2473. */
  2474. struct iwl_dbg_mem_access_cmd {
  2475. __le32 op;
  2476. __le32 addr;
  2477. __le32 len;
  2478. __le32 data[];
  2479. } __packed; /* DEBUG_(U|L)MAC_RD_WR_CMD_API_S_VER_1 */
  2480. /* Status responses for the debug mem access */
  2481. enum {
  2482. DEBUG_MEM_STATUS_SUCCESS = 0x0,
  2483. DEBUG_MEM_STATUS_FAILED = 0x1,
  2484. DEBUG_MEM_STATUS_LOCKED = 0x2,
  2485. DEBUG_MEM_STATUS_HIDDEN = 0x3,
  2486. DEBUG_MEM_STATUS_LENGTH = 0x4,
  2487. };
  2488. /**
  2489. * struct iwl_dbg_mem_access_rsp - Response to debug mem commands
  2490. * @status: DEBUG_MEM_STATUS_*
  2491. * @len: read dwords (0 for write operations)
  2492. * @data: contains the read DWs
  2493. */
  2494. struct iwl_dbg_mem_access_rsp {
  2495. __le32 status;
  2496. __le32 len;
  2497. __le32 data[];
  2498. } __packed; /* DEBUG_(U|L)MAC_RD_WR_RSP_API_S_VER_1 */
  2499. /**
  2500. * struct iwl_nvm_access_complete_cmd - NVM_ACCESS commands are completed
  2501. * @reserved: reserved
  2502. */
  2503. struct iwl_nvm_access_complete_cmd {
  2504. __le32 reserved;
  2505. } __packed; /* NVM_ACCESS_COMPLETE_CMD_API_S_VER_1 */
  2506. /**
  2507. * enum iwl_extended_cfg_flag - commands driver may send before
  2508. * finishing init flow
  2509. * @IWL_INIT_DEBUG_CFG: driver is going to send debug config command
  2510. * @IWL_INIT_NVM: driver is going to send NVM_ACCESS commands
  2511. * @IWL_INIT_PHY: driver is going to send PHY_DB commands
  2512. */
  2513. enum iwl_extended_cfg_flags {
  2514. IWL_INIT_DEBUG_CFG,
  2515. IWL_INIT_NVM,
  2516. IWL_INIT_PHY,
  2517. };
  2518. /**
  2519. * struct iwl_extended_cfg_cmd - mark what commands ucode should wait for
  2520. * before finishing init flows
  2521. * @init_flags: values from iwl_extended_cfg_flags
  2522. */
  2523. struct iwl_init_extended_cfg_cmd {
  2524. __le32 init_flags;
  2525. } __packed; /* INIT_EXTENDED_CFG_CMD_API_S_VER_1 */
  2526. /*
  2527. * struct iwl_nvm_get_info - request to get NVM data
  2528. */
  2529. struct iwl_nvm_get_info {
  2530. __le32 reserved;
  2531. } __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_S_VER_1 */
  2532. /**
  2533. * struct iwl_nvm_get_info_general - general NVM data
  2534. * @flags: 1 - empty, 0 - valid
  2535. * @nvm_version: nvm version
  2536. * @board_type: board type
  2537. * @reserved: reserved
  2538. */
  2539. struct iwl_nvm_get_info_general {
  2540. __le32 flags;
  2541. __le16 nvm_version;
  2542. u8 board_type;
  2543. u8 reserved;
  2544. } __packed; /* GRP_REGULATORY_NVM_GET_INFO_GENERAL_S_VER_1 */
  2545. /**
  2546. * struct iwl_nvm_get_info_sku - mac information
  2547. * @enable_24g: band 2.4G enabled
  2548. * @enable_5g: band 5G enabled
  2549. * @enable_11n: 11n enabled
  2550. * @enable_11ac: 11ac enabled
  2551. * @mimo_disable: MIMO enabled
  2552. * @ext_crypto: Extended crypto enabled
  2553. */
  2554. struct iwl_nvm_get_info_sku {
  2555. __le32 enable_24g;
  2556. __le32 enable_5g;
  2557. __le32 enable_11n;
  2558. __le32 enable_11ac;
  2559. __le32 mimo_disable;
  2560. __le32 ext_crypto;
  2561. } __packed; /* GRP_REGULATORY_NVM_GET_INFO_MAC_SKU_SECTION_S_VER_1 */
  2562. /**
  2563. * struct iwl_nvm_get_info_phy - phy information
  2564. * @tx_chains: BIT 0 chain A, BIT 1 chain B
  2565. * @rx_chains: BIT 0 chain A, BIT 1 chain B
  2566. */
  2567. struct iwl_nvm_get_info_phy {
  2568. __le32 tx_chains;
  2569. __le32 rx_chains;
  2570. } __packed; /* GRP_REGULATORY_NVM_GET_INFO_PHY_SKU_SECTION_S_VER_1 */
  2571. #define IWL_NUM_CHANNELS (51)
  2572. /**
  2573. * struct iwl_nvm_get_info_regulatory - regulatory information
  2574. * @lar_enabled: is LAR enabled
  2575. * @channel_profile: regulatory data of this channel
  2576. * @reserved: reserved
  2577. */
  2578. struct iwl_nvm_get_info_regulatory {
  2579. __le32 lar_enabled;
  2580. __le16 channel_profile[IWL_NUM_CHANNELS];
  2581. __le16 reserved;
  2582. } __packed; /* GRP_REGULATORY_NVM_GET_INFO_REGULATORY_S_VER_1 */
  2583. /**
  2584. * struct iwl_nvm_get_info_rsp - response to get NVM data
  2585. * @general: general NVM data
  2586. * @mac_sku: data relating to MAC sku
  2587. * @phy_sku: data relating to PHY sku
  2588. * @regulatory: regulatory data
  2589. */
  2590. struct iwl_nvm_get_info_rsp {
  2591. struct iwl_nvm_get_info_general general;
  2592. struct iwl_nvm_get_info_sku mac_sku;
  2593. struct iwl_nvm_get_info_phy phy_sku;
  2594. struct iwl_nvm_get_info_regulatory regulatory;
  2595. } __packed; /* GRP_REGULATORY_NVM_GET_INFO_CMD_RSP_S_VER_1 */
  2596. /**
  2597. * struct iwl_mvm_antenna_coupling_notif - antenna coupling notification
  2598. * @isolation: antenna isolation value
  2599. */
  2600. struct iwl_mvm_antenna_coupling_notif {
  2601. __le32 isolation;
  2602. } __packed;
  2603. #endif /* __fw_api_h__ */