fw-api.h 64 KB

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