fw-api.h 78 KB

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