fw-api.h 65 KB

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