fw-api.h 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431
  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. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of version 2 of the GNU General Public License as
  12. * published by the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful, but
  15. * WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
  22. * USA
  23. *
  24. * The full GNU General Public License is included in this distribution
  25. * in the file called COPYING.
  26. *
  27. * Contact Information:
  28. * Intel Linux Wireless <ilw@linux.intel.com>
  29. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  30. *
  31. * BSD LICENSE
  32. *
  33. * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  34. * All rights reserved.
  35. *
  36. * Redistribution and use in source and binary forms, with or without
  37. * modification, are permitted provided that the following conditions
  38. * are met:
  39. *
  40. * * Redistributions of source code must retain the above copyright
  41. * notice, this list of conditions and the following disclaimer.
  42. * * Redistributions in binary form must reproduce the above copyright
  43. * notice, this list of conditions and the following disclaimer in
  44. * the documentation and/or other materials provided with the
  45. * distribution.
  46. * * Neither the name Intel Corporation nor the names of its
  47. * contributors may be used to endorse or promote products derived
  48. * from this software without specific prior written permission.
  49. *
  50. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  51. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  52. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  53. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  54. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  55. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  56. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  57. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  58. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  59. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  60. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  61. *
  62. *****************************************************************************/
  63. #ifndef __fw_api_h__
  64. #define __fw_api_h__
  65. #include "fw-api-rs.h"
  66. #include "fw-api-tx.h"
  67. #include "fw-api-sta.h"
  68. #include "fw-api-mac.h"
  69. #include "fw-api-power.h"
  70. #include "fw-api-d3.h"
  71. #include "fw-api-bt-coex.h"
  72. /* maximal number of Tx queues in any platform */
  73. #define IWL_MVM_MAX_QUEUES 20
  74. /* Tx queue numbers */
  75. enum {
  76. IWL_MVM_OFFCHANNEL_QUEUE = 8,
  77. IWL_MVM_CMD_QUEUE = 9,
  78. };
  79. #define IWL_MVM_CMD_FIFO 7
  80. #define IWL_MVM_STATION_COUNT 16
  81. /* commands */
  82. enum {
  83. MVM_ALIVE = 0x1,
  84. REPLY_ERROR = 0x2,
  85. INIT_COMPLETE_NOTIF = 0x4,
  86. /* PHY context commands */
  87. PHY_CONTEXT_CMD = 0x8,
  88. DBG_CFG = 0x9,
  89. /* station table */
  90. ADD_STA_KEY = 0x17,
  91. ADD_STA = 0x18,
  92. REMOVE_STA = 0x19,
  93. /* TX */
  94. TX_CMD = 0x1c,
  95. TXPATH_FLUSH = 0x1e,
  96. MGMT_MCAST_KEY = 0x1f,
  97. /* global key */
  98. WEP_KEY = 0x20,
  99. /* MAC and Binding commands */
  100. MAC_CONTEXT_CMD = 0x28,
  101. TIME_EVENT_CMD = 0x29, /* both CMD and response */
  102. TIME_EVENT_NOTIFICATION = 0x2a,
  103. BINDING_CONTEXT_CMD = 0x2b,
  104. TIME_QUOTA_CMD = 0x2c,
  105. NON_QOS_TX_COUNTER_CMD = 0x2d,
  106. LQ_CMD = 0x4e,
  107. /* Calibration */
  108. TEMPERATURE_NOTIFICATION = 0x62,
  109. CALIBRATION_CFG_CMD = 0x65,
  110. CALIBRATION_RES_NOTIFICATION = 0x66,
  111. CALIBRATION_COMPLETE_NOTIFICATION = 0x67,
  112. RADIO_VERSION_NOTIFICATION = 0x68,
  113. /* Scan offload */
  114. SCAN_OFFLOAD_REQUEST_CMD = 0x51,
  115. SCAN_OFFLOAD_ABORT_CMD = 0x52,
  116. SCAN_OFFLOAD_COMPLETE = 0x6D,
  117. SCAN_OFFLOAD_UPDATE_PROFILES_CMD = 0x6E,
  118. SCAN_OFFLOAD_CONFIG_CMD = 0x6f,
  119. MATCH_FOUND_NOTIFICATION = 0xd9,
  120. /* Phy */
  121. PHY_CONFIGURATION_CMD = 0x6a,
  122. CALIB_RES_NOTIF_PHY_DB = 0x6b,
  123. /* PHY_DB_CMD = 0x6c, */
  124. /* Power - legacy power table command */
  125. POWER_TABLE_CMD = 0x77,
  126. PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION = 0x78,
  127. /* Thermal Throttling*/
  128. REPLY_THERMAL_MNG_BACKOFF = 0x7e,
  129. /* Scanning */
  130. SCAN_REQUEST_CMD = 0x80,
  131. SCAN_ABORT_CMD = 0x81,
  132. SCAN_START_NOTIFICATION = 0x82,
  133. SCAN_RESULTS_NOTIFICATION = 0x83,
  134. SCAN_COMPLETE_NOTIFICATION = 0x84,
  135. /* NVM */
  136. NVM_ACCESS_CMD = 0x88,
  137. SET_CALIB_DEFAULT_CMD = 0x8e,
  138. BEACON_NOTIFICATION = 0x90,
  139. BEACON_TEMPLATE_CMD = 0x91,
  140. TX_ANT_CONFIGURATION_CMD = 0x98,
  141. BT_CONFIG = 0x9b,
  142. STATISTICS_NOTIFICATION = 0x9d,
  143. REDUCE_TX_POWER_CMD = 0x9f,
  144. /* RF-KILL commands and notifications */
  145. CARD_STATE_CMD = 0xa0,
  146. CARD_STATE_NOTIFICATION = 0xa1,
  147. MISSED_BEACONS_NOTIFICATION = 0xa2,
  148. /* Power - new power table command */
  149. MAC_PM_POWER_TABLE = 0xa9,
  150. REPLY_RX_PHY_CMD = 0xc0,
  151. REPLY_RX_MPDU_CMD = 0xc1,
  152. BA_NOTIF = 0xc5,
  153. /* BT Coex */
  154. BT_COEX_PRIO_TABLE = 0xcc,
  155. BT_COEX_PROT_ENV = 0xcd,
  156. BT_PROFILE_NOTIFICATION = 0xce,
  157. BT_COEX_CI = 0x5d,
  158. REPLY_SF_CFG_CMD = 0xd1,
  159. REPLY_BEACON_FILTERING_CMD = 0xd2,
  160. REPLY_DEBUG_CMD = 0xf0,
  161. DEBUG_LOG_MSG = 0xf7,
  162. MCAST_FILTER_CMD = 0xd0,
  163. /* D3 commands/notifications */
  164. D3_CONFIG_CMD = 0xd3,
  165. PROT_OFFLOAD_CONFIG_CMD = 0xd4,
  166. OFFLOADS_QUERY_CMD = 0xd5,
  167. REMOTE_WAKE_CONFIG_CMD = 0xd6,
  168. /* for WoWLAN in particular */
  169. WOWLAN_PATTERNS = 0xe0,
  170. WOWLAN_CONFIGURATION = 0xe1,
  171. WOWLAN_TSC_RSC_PARAM = 0xe2,
  172. WOWLAN_TKIP_PARAM = 0xe3,
  173. WOWLAN_KEK_KCK_MATERIAL = 0xe4,
  174. WOWLAN_GET_STATUSES = 0xe5,
  175. WOWLAN_TX_POWER_PER_DB = 0xe6,
  176. /* and for NetDetect */
  177. NET_DETECT_CONFIG_CMD = 0x54,
  178. NET_DETECT_PROFILES_QUERY_CMD = 0x56,
  179. NET_DETECT_PROFILES_CMD = 0x57,
  180. NET_DETECT_HOTSPOTS_CMD = 0x58,
  181. NET_DETECT_HOTSPOTS_QUERY_CMD = 0x59,
  182. REPLY_MAX = 0xff,
  183. };
  184. /**
  185. * struct iwl_cmd_response - generic response struct for most commands
  186. * @status: status of the command asked, changes for each one
  187. */
  188. struct iwl_cmd_response {
  189. __le32 status;
  190. };
  191. /*
  192. * struct iwl_tx_ant_cfg_cmd
  193. * @valid: valid antenna configuration
  194. */
  195. struct iwl_tx_ant_cfg_cmd {
  196. __le32 valid;
  197. } __packed;
  198. /**
  199. * struct iwl_reduce_tx_power_cmd - TX power reduction command
  200. * REDUCE_TX_POWER_CMD = 0x9f
  201. * @flags: (reserved for future implementation)
  202. * @mac_context_id: id of the mac ctx for which we are reducing TX power.
  203. * @pwr_restriction: TX power restriction in dBms.
  204. */
  205. struct iwl_reduce_tx_power_cmd {
  206. u8 flags;
  207. u8 mac_context_id;
  208. __le16 pwr_restriction;
  209. } __packed; /* TX_REDUCED_POWER_API_S_VER_1 */
  210. /*
  211. * Calibration control struct.
  212. * Sent as part of the phy configuration command.
  213. * @flow_trigger: bitmap for which calibrations to perform according to
  214. * flow triggers.
  215. * @event_trigger: bitmap for which calibrations to perform according to
  216. * event triggers.
  217. */
  218. struct iwl_calib_ctrl {
  219. __le32 flow_trigger;
  220. __le32 event_trigger;
  221. } __packed;
  222. /* This enum defines the bitmap of various calibrations to enable in both
  223. * init ucode and runtime ucode through CALIBRATION_CFG_CMD.
  224. */
  225. enum iwl_calib_cfg {
  226. IWL_CALIB_CFG_XTAL_IDX = BIT(0),
  227. IWL_CALIB_CFG_TEMPERATURE_IDX = BIT(1),
  228. IWL_CALIB_CFG_VOLTAGE_READ_IDX = BIT(2),
  229. IWL_CALIB_CFG_PAPD_IDX = BIT(3),
  230. IWL_CALIB_CFG_TX_PWR_IDX = BIT(4),
  231. IWL_CALIB_CFG_DC_IDX = BIT(5),
  232. IWL_CALIB_CFG_BB_FILTER_IDX = BIT(6),
  233. IWL_CALIB_CFG_LO_LEAKAGE_IDX = BIT(7),
  234. IWL_CALIB_CFG_TX_IQ_IDX = BIT(8),
  235. IWL_CALIB_CFG_TX_IQ_SKEW_IDX = BIT(9),
  236. IWL_CALIB_CFG_RX_IQ_IDX = BIT(10),
  237. IWL_CALIB_CFG_RX_IQ_SKEW_IDX = BIT(11),
  238. IWL_CALIB_CFG_SENSITIVITY_IDX = BIT(12),
  239. IWL_CALIB_CFG_CHAIN_NOISE_IDX = BIT(13),
  240. IWL_CALIB_CFG_DISCONNECTED_ANT_IDX = BIT(14),
  241. IWL_CALIB_CFG_ANT_COUPLING_IDX = BIT(15),
  242. IWL_CALIB_CFG_DAC_IDX = BIT(16),
  243. IWL_CALIB_CFG_ABS_IDX = BIT(17),
  244. IWL_CALIB_CFG_AGC_IDX = BIT(18),
  245. };
  246. /*
  247. * Phy configuration command.
  248. */
  249. struct iwl_phy_cfg_cmd {
  250. __le32 phy_cfg;
  251. struct iwl_calib_ctrl calib_control;
  252. } __packed;
  253. #define PHY_CFG_RADIO_TYPE (BIT(0) | BIT(1))
  254. #define PHY_CFG_RADIO_STEP (BIT(2) | BIT(3))
  255. #define PHY_CFG_RADIO_DASH (BIT(4) | BIT(5))
  256. #define PHY_CFG_PRODUCT_NUMBER (BIT(6) | BIT(7))
  257. #define PHY_CFG_TX_CHAIN_A BIT(8)
  258. #define PHY_CFG_TX_CHAIN_B BIT(9)
  259. #define PHY_CFG_TX_CHAIN_C BIT(10)
  260. #define PHY_CFG_RX_CHAIN_A BIT(12)
  261. #define PHY_CFG_RX_CHAIN_B BIT(13)
  262. #define PHY_CFG_RX_CHAIN_C BIT(14)
  263. /* Target of the NVM_ACCESS_CMD */
  264. enum {
  265. NVM_ACCESS_TARGET_CACHE = 0,
  266. NVM_ACCESS_TARGET_OTP = 1,
  267. NVM_ACCESS_TARGET_EEPROM = 2,
  268. };
  269. /* Section types for NVM_ACCESS_CMD */
  270. enum {
  271. NVM_SECTION_TYPE_HW = 0,
  272. NVM_SECTION_TYPE_SW,
  273. NVM_SECTION_TYPE_PAPD,
  274. NVM_SECTION_TYPE_BT,
  275. NVM_SECTION_TYPE_CALIBRATION,
  276. NVM_SECTION_TYPE_PRODUCTION,
  277. NVM_SECTION_TYPE_POST_FCS_CALIB,
  278. NVM_NUM_OF_SECTIONS,
  279. };
  280. /**
  281. * struct iwl_nvm_access_cmd_ver2 - Request the device to send an NVM section
  282. * @op_code: 0 - read, 1 - write
  283. * @target: NVM_ACCESS_TARGET_*
  284. * @type: NVM_SECTION_TYPE_*
  285. * @offset: offset in bytes into the section
  286. * @length: in bytes, to read/write
  287. * @data: if write operation, the data to write. On read its empty
  288. */
  289. struct iwl_nvm_access_cmd {
  290. u8 op_code;
  291. u8 target;
  292. __le16 type;
  293. __le16 offset;
  294. __le16 length;
  295. u8 data[];
  296. } __packed; /* NVM_ACCESS_CMD_API_S_VER_2 */
  297. /**
  298. * struct iwl_nvm_access_resp_ver2 - response to NVM_ACCESS_CMD
  299. * @offset: offset in bytes into the section
  300. * @length: in bytes, either how much was written or read
  301. * @type: NVM_SECTION_TYPE_*
  302. * @status: 0 for success, fail otherwise
  303. * @data: if read operation, the data returned. Empty on write.
  304. */
  305. struct iwl_nvm_access_resp {
  306. __le16 offset;
  307. __le16 length;
  308. __le16 type;
  309. __le16 status;
  310. u8 data[];
  311. } __packed; /* NVM_ACCESS_CMD_RESP_API_S_VER_2 */
  312. /* MVM_ALIVE 0x1 */
  313. /* alive response is_valid values */
  314. #define ALIVE_RESP_UCODE_OK BIT(0)
  315. #define ALIVE_RESP_RFKILL BIT(1)
  316. /* alive response ver_type values */
  317. enum {
  318. FW_TYPE_HW = 0,
  319. FW_TYPE_PROT = 1,
  320. FW_TYPE_AP = 2,
  321. FW_TYPE_WOWLAN = 3,
  322. FW_TYPE_TIMING = 4,
  323. FW_TYPE_WIPAN = 5
  324. };
  325. /* alive response ver_subtype values */
  326. enum {
  327. FW_SUBTYPE_FULL_FEATURE = 0,
  328. FW_SUBTYPE_BOOTSRAP = 1, /* Not valid */
  329. FW_SUBTYPE_REDUCED = 2,
  330. FW_SUBTYPE_ALIVE_ONLY = 3,
  331. FW_SUBTYPE_WOWLAN = 4,
  332. FW_SUBTYPE_AP_SUBTYPE = 5,
  333. FW_SUBTYPE_WIPAN = 6,
  334. FW_SUBTYPE_INITIALIZE = 9
  335. };
  336. #define IWL_ALIVE_STATUS_ERR 0xDEAD
  337. #define IWL_ALIVE_STATUS_OK 0xCAFE
  338. #define IWL_ALIVE_FLG_RFKILL BIT(0)
  339. struct mvm_alive_resp {
  340. __le16 status;
  341. __le16 flags;
  342. u8 ucode_minor;
  343. u8 ucode_major;
  344. __le16 id;
  345. u8 api_minor;
  346. u8 api_major;
  347. u8 ver_subtype;
  348. u8 ver_type;
  349. u8 mac;
  350. u8 opt;
  351. __le16 reserved2;
  352. __le32 timestamp;
  353. __le32 error_event_table_ptr; /* SRAM address for error log */
  354. __le32 log_event_table_ptr; /* SRAM address for event log */
  355. __le32 cpu_register_ptr;
  356. __le32 dbgm_config_ptr;
  357. __le32 alive_counter_ptr;
  358. __le32 scd_base_ptr; /* SRAM address for SCD */
  359. } __packed; /* ALIVE_RES_API_S_VER_1 */
  360. /* Error response/notification */
  361. enum {
  362. FW_ERR_UNKNOWN_CMD = 0x0,
  363. FW_ERR_INVALID_CMD_PARAM = 0x1,
  364. FW_ERR_SERVICE = 0x2,
  365. FW_ERR_ARC_MEMORY = 0x3,
  366. FW_ERR_ARC_CODE = 0x4,
  367. FW_ERR_WATCH_DOG = 0x5,
  368. FW_ERR_WEP_GRP_KEY_INDX = 0x10,
  369. FW_ERR_WEP_KEY_SIZE = 0x11,
  370. FW_ERR_OBSOLETE_FUNC = 0x12,
  371. FW_ERR_UNEXPECTED = 0xFE,
  372. FW_ERR_FATAL = 0xFF
  373. };
  374. /**
  375. * struct iwl_error_resp - FW error indication
  376. * ( REPLY_ERROR = 0x2 )
  377. * @error_type: one of FW_ERR_*
  378. * @cmd_id: the command ID for which the error occured
  379. * @bad_cmd_seq_num: sequence number of the erroneous command
  380. * @error_service: which service created the error, applicable only if
  381. * error_type = 2, otherwise 0
  382. * @timestamp: TSF in usecs.
  383. */
  384. struct iwl_error_resp {
  385. __le32 error_type;
  386. u8 cmd_id;
  387. u8 reserved1;
  388. __le16 bad_cmd_seq_num;
  389. __le32 error_service;
  390. __le64 timestamp;
  391. } __packed;
  392. /* Common PHY, MAC and Bindings definitions */
  393. #define MAX_MACS_IN_BINDING (3)
  394. #define MAX_BINDINGS (4)
  395. #define AUX_BINDING_INDEX (3)
  396. #define MAX_PHYS (4)
  397. /* Used to extract ID and color from the context dword */
  398. #define FW_CTXT_ID_POS (0)
  399. #define FW_CTXT_ID_MSK (0xff << FW_CTXT_ID_POS)
  400. #define FW_CTXT_COLOR_POS (8)
  401. #define FW_CTXT_COLOR_MSK (0xff << FW_CTXT_COLOR_POS)
  402. #define FW_CTXT_INVALID (0xffffffff)
  403. #define FW_CMD_ID_AND_COLOR(_id, _color) ((_id << FW_CTXT_ID_POS) |\
  404. (_color << FW_CTXT_COLOR_POS))
  405. /* Possible actions on PHYs, MACs and Bindings */
  406. enum {
  407. FW_CTXT_ACTION_STUB = 0,
  408. FW_CTXT_ACTION_ADD,
  409. FW_CTXT_ACTION_MODIFY,
  410. FW_CTXT_ACTION_REMOVE,
  411. FW_CTXT_ACTION_NUM
  412. }; /* COMMON_CONTEXT_ACTION_API_E_VER_1 */
  413. /* Time Events */
  414. /* Time Event types, according to MAC type */
  415. enum iwl_time_event_type {
  416. /* BSS Station Events */
  417. TE_BSS_STA_AGGRESSIVE_ASSOC,
  418. TE_BSS_STA_ASSOC,
  419. TE_BSS_EAP_DHCP_PROT,
  420. TE_BSS_QUIET_PERIOD,
  421. /* P2P Device Events */
  422. TE_P2P_DEVICE_DISCOVERABLE,
  423. TE_P2P_DEVICE_LISTEN,
  424. TE_P2P_DEVICE_ACTION_SCAN,
  425. TE_P2P_DEVICE_FULL_SCAN,
  426. /* P2P Client Events */
  427. TE_P2P_CLIENT_AGGRESSIVE_ASSOC,
  428. TE_P2P_CLIENT_ASSOC,
  429. TE_P2P_CLIENT_QUIET_PERIOD,
  430. /* P2P GO Events */
  431. TE_P2P_GO_ASSOC_PROT,
  432. TE_P2P_GO_REPETITIVE_NOA,
  433. TE_P2P_GO_CT_WINDOW,
  434. /* WiDi Sync Events */
  435. TE_WIDI_TX_SYNC,
  436. TE_MAX
  437. }; /* MAC_EVENT_TYPE_API_E_VER_1 */
  438. /* Time event - defines for command API v1 */
  439. /*
  440. * @TE_V1_FRAG_NONE: fragmentation of the time event is NOT allowed.
  441. * @TE_V1_FRAG_SINGLE: fragmentation of the time event is allowed, but only
  442. * the first fragment is scheduled.
  443. * @TE_V1_FRAG_DUAL: fragmentation of the time event is allowed, but only
  444. * the first 2 fragments are scheduled.
  445. * @TE_V1_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
  446. * number of fragments are valid.
  447. *
  448. * Other than the constant defined above, specifying a fragmentation value 'x'
  449. * means that the event can be fragmented but only the first 'x' will be
  450. * scheduled.
  451. */
  452. enum {
  453. TE_V1_FRAG_NONE = 0,
  454. TE_V1_FRAG_SINGLE = 1,
  455. TE_V1_FRAG_DUAL = 2,
  456. TE_V1_FRAG_ENDLESS = 0xffffffff
  457. };
  458. /* If a Time Event can be fragmented, this is the max number of fragments */
  459. #define TE_V1_FRAG_MAX_MSK 0x0fffffff
  460. /* Repeat the time event endlessly (until removed) */
  461. #define TE_V1_REPEAT_ENDLESS 0xffffffff
  462. /* If a Time Event has bounded repetitions, this is the maximal value */
  463. #define TE_V1_REPEAT_MAX_MSK_V1 0x0fffffff
  464. /* Time Event dependencies: none, on another TE, or in a specific time */
  465. enum {
  466. TE_V1_INDEPENDENT = 0,
  467. TE_V1_DEP_OTHER = BIT(0),
  468. TE_V1_DEP_TSF = BIT(1),
  469. TE_V1_EVENT_SOCIOPATHIC = BIT(2),
  470. }; /* MAC_EVENT_DEPENDENCY_POLICY_API_E_VER_2 */
  471. /*
  472. * @TE_V1_NOTIF_NONE: no notifications
  473. * @TE_V1_NOTIF_HOST_EVENT_START: request/receive notification on event start
  474. * @TE_V1_NOTIF_HOST_EVENT_END:request/receive notification on event end
  475. * @TE_V1_NOTIF_INTERNAL_EVENT_START: internal FW use
  476. * @TE_V1_NOTIF_INTERNAL_EVENT_END: internal FW use.
  477. * @TE_V1_NOTIF_HOST_FRAG_START: request/receive notification on frag start
  478. * @TE_V1_NOTIF_HOST_FRAG_END:request/receive notification on frag end
  479. * @TE_V1_NOTIF_INTERNAL_FRAG_START: internal FW use.
  480. * @TE_V1_NOTIF_INTERNAL_FRAG_END: internal FW use.
  481. *
  482. * Supported Time event notifications configuration.
  483. * A notification (both event and fragment) includes a status indicating weather
  484. * the FW was able to schedule the event or not. For fragment start/end
  485. * notification the status is always success. There is no start/end fragment
  486. * notification for monolithic events.
  487. */
  488. enum {
  489. TE_V1_NOTIF_NONE = 0,
  490. TE_V1_NOTIF_HOST_EVENT_START = BIT(0),
  491. TE_V1_NOTIF_HOST_EVENT_END = BIT(1),
  492. TE_V1_NOTIF_INTERNAL_EVENT_START = BIT(2),
  493. TE_V1_NOTIF_INTERNAL_EVENT_END = BIT(3),
  494. TE_V1_NOTIF_HOST_FRAG_START = BIT(4),
  495. TE_V1_NOTIF_HOST_FRAG_END = BIT(5),
  496. TE_V1_NOTIF_INTERNAL_FRAG_START = BIT(6),
  497. TE_V1_NOTIF_INTERNAL_FRAG_END = BIT(7),
  498. }; /* MAC_EVENT_ACTION_API_E_VER_2 */
  499. /**
  500. * struct iwl_time_event_cmd_api_v1 - configuring Time Events
  501. * with struct MAC_TIME_EVENT_DATA_API_S_VER_1 (see also
  502. * with version 2. determined by IWL_UCODE_TLV_FLAGS)
  503. * ( TIME_EVENT_CMD = 0x29 )
  504. * @id_and_color: ID and color of the relevant MAC
  505. * @action: action to perform, one of FW_CTXT_ACTION_*
  506. * @id: this field has two meanings, depending on the action:
  507. * If the action is ADD, then it means the type of event to add.
  508. * For all other actions it is the unique event ID assigned when the
  509. * event was added by the FW.
  510. * @apply_time: When to start the Time Event (in GP2)
  511. * @max_delay: maximum delay to event's start (apply time), in TU
  512. * @depends_on: the unique ID of the event we depend on (if any)
  513. * @interval: interval between repetitions, in TU
  514. * @interval_reciprocal: 2^32 / interval
  515. * @duration: duration of event in TU
  516. * @repeat: how many repetitions to do, can be TE_REPEAT_ENDLESS
  517. * @dep_policy: one of TE_V1_INDEPENDENT, TE_V1_DEP_OTHER, TE_V1_DEP_TSF
  518. * and TE_V1_EVENT_SOCIOPATHIC
  519. * @is_present: 0 or 1, are we present or absent during the Time Event
  520. * @max_frags: maximal number of fragments the Time Event can be divided to
  521. * @notify: notifications using TE_V1_NOTIF_* (whom to notify when)
  522. */
  523. struct iwl_time_event_cmd_v1 {
  524. /* COMMON_INDEX_HDR_API_S_VER_1 */
  525. __le32 id_and_color;
  526. __le32 action;
  527. __le32 id;
  528. /* MAC_TIME_EVENT_DATA_API_S_VER_1 */
  529. __le32 apply_time;
  530. __le32 max_delay;
  531. __le32 dep_policy;
  532. __le32 depends_on;
  533. __le32 is_present;
  534. __le32 max_frags;
  535. __le32 interval;
  536. __le32 interval_reciprocal;
  537. __le32 duration;
  538. __le32 repeat;
  539. __le32 notify;
  540. } __packed; /* MAC_TIME_EVENT_CMD_API_S_VER_1 */
  541. /* Time event - defines for command API v2 */
  542. /*
  543. * @TE_V2_FRAG_NONE: fragmentation of the time event is NOT allowed.
  544. * @TE_V2_FRAG_SINGLE: fragmentation of the time event is allowed, but only
  545. * the first fragment is scheduled.
  546. * @TE_V2_FRAG_DUAL: fragmentation of the time event is allowed, but only
  547. * the first 2 fragments are scheduled.
  548. * @TE_V2_FRAG_ENDLESS: fragmentation of the time event is allowed, and any
  549. * number of fragments are valid.
  550. *
  551. * Other than the constant defined above, specifying a fragmentation value 'x'
  552. * means that the event can be fragmented but only the first 'x' will be
  553. * scheduled.
  554. */
  555. enum {
  556. TE_V2_FRAG_NONE = 0,
  557. TE_V2_FRAG_SINGLE = 1,
  558. TE_V2_FRAG_DUAL = 2,
  559. TE_V2_FRAG_MAX = 0xfe,
  560. TE_V2_FRAG_ENDLESS = 0xff
  561. };
  562. /* Repeat the time event endlessly (until removed) */
  563. #define TE_V2_REPEAT_ENDLESS 0xff
  564. /* If a Time Event has bounded repetitions, this is the maximal value */
  565. #define TE_V2_REPEAT_MAX 0xfe
  566. #define TE_V2_PLACEMENT_POS 12
  567. #define TE_V2_ABSENCE_POS 15
  568. /* Time event policy values (for time event cmd api v2)
  569. * A notification (both event and fragment) includes a status indicating weather
  570. * the FW was able to schedule the event or not. For fragment start/end
  571. * notification the status is always success. There is no start/end fragment
  572. * notification for monolithic events.
  573. *
  574. * @TE_V2_DEFAULT_POLICY: independent, social, present, unoticable
  575. * @TE_V2_NOTIF_HOST_EVENT_START: request/receive notification on event start
  576. * @TE_V2_NOTIF_HOST_EVENT_END:request/receive notification on event end
  577. * @TE_V2_NOTIF_INTERNAL_EVENT_START: internal FW use
  578. * @TE_V2_NOTIF_INTERNAL_EVENT_END: internal FW use.
  579. * @TE_V2_NOTIF_HOST_FRAG_START: request/receive notification on frag start
  580. * @TE_V2_NOTIF_HOST_FRAG_END:request/receive notification on frag end
  581. * @TE_V2_NOTIF_INTERNAL_FRAG_START: internal FW use.
  582. * @TE_V2_NOTIF_INTERNAL_FRAG_END: internal FW use.
  583. * @TE_V2_DEP_OTHER: depends on another time event
  584. * @TE_V2_DEP_TSF: depends on a specific time
  585. * @TE_V2_EVENT_SOCIOPATHIC: can't co-exist with other events of tha same MAC
  586. * @TE_V2_ABSENCE: are we present or absent during the Time Event.
  587. */
  588. enum {
  589. TE_V2_DEFAULT_POLICY = 0x0,
  590. /* notifications (event start/stop, fragment start/stop) */
  591. TE_V2_NOTIF_HOST_EVENT_START = BIT(0),
  592. TE_V2_NOTIF_HOST_EVENT_END = BIT(1),
  593. TE_V2_NOTIF_INTERNAL_EVENT_START = BIT(2),
  594. TE_V2_NOTIF_INTERNAL_EVENT_END = BIT(3),
  595. TE_V2_NOTIF_HOST_FRAG_START = BIT(4),
  596. TE_V2_NOTIF_HOST_FRAG_END = BIT(5),
  597. TE_V2_NOTIF_INTERNAL_FRAG_START = BIT(6),
  598. TE_V2_NOTIF_INTERNAL_FRAG_END = BIT(7),
  599. TE_V2_NOTIF_MSK = 0xff,
  600. /* placement characteristics */
  601. TE_V2_DEP_OTHER = BIT(TE_V2_PLACEMENT_POS),
  602. TE_V2_DEP_TSF = BIT(TE_V2_PLACEMENT_POS + 1),
  603. TE_V2_EVENT_SOCIOPATHIC = BIT(TE_V2_PLACEMENT_POS + 2),
  604. /* are we present or absent during the Time Event. */
  605. TE_V2_ABSENCE = BIT(TE_V2_ABSENCE_POS),
  606. };
  607. /**
  608. * struct iwl_time_event_cmd_api_v2 - configuring Time Events
  609. * with struct MAC_TIME_EVENT_DATA_API_S_VER_2 (see also
  610. * with version 1. determined by IWL_UCODE_TLV_FLAGS)
  611. * ( TIME_EVENT_CMD = 0x29 )
  612. * @id_and_color: ID and color of the relevant MAC
  613. * @action: action to perform, one of FW_CTXT_ACTION_*
  614. * @id: this field has two meanings, depending on the action:
  615. * If the action is ADD, then it means the type of event to add.
  616. * For all other actions it is the unique event ID assigned when the
  617. * event was added by the FW.
  618. * @apply_time: When to start the Time Event (in GP2)
  619. * @max_delay: maximum delay to event's start (apply time), in TU
  620. * @depends_on: the unique ID of the event we depend on (if any)
  621. * @interval: interval between repetitions, in TU
  622. * @duration: duration of event in TU
  623. * @repeat: how many repetitions to do, can be TE_REPEAT_ENDLESS
  624. * @max_frags: maximal number of fragments the Time Event can be divided to
  625. * @policy: defines whether uCode shall notify the host or other uCode modules
  626. * on event and/or fragment start and/or end
  627. * using one of TE_INDEPENDENT, TE_DEP_OTHER, TE_DEP_TSF
  628. * TE_EVENT_SOCIOPATHIC
  629. * using TE_ABSENCE and using TE_NOTIF_*
  630. */
  631. struct iwl_time_event_cmd_v2 {
  632. /* COMMON_INDEX_HDR_API_S_VER_1 */
  633. __le32 id_and_color;
  634. __le32 action;
  635. __le32 id;
  636. /* MAC_TIME_EVENT_DATA_API_S_VER_2 */
  637. __le32 apply_time;
  638. __le32 max_delay;
  639. __le32 depends_on;
  640. __le32 interval;
  641. __le32 duration;
  642. u8 repeat;
  643. u8 max_frags;
  644. __le16 policy;
  645. } __packed; /* MAC_TIME_EVENT_CMD_API_S_VER_2 */
  646. /**
  647. * struct iwl_time_event_resp - response structure to iwl_time_event_cmd
  648. * @status: bit 0 indicates success, all others specify errors
  649. * @id: the Time Event type
  650. * @unique_id: the unique ID assigned (in ADD) or given (others) to the TE
  651. * @id_and_color: ID and color of the relevant MAC
  652. */
  653. struct iwl_time_event_resp {
  654. __le32 status;
  655. __le32 id;
  656. __le32 unique_id;
  657. __le32 id_and_color;
  658. } __packed; /* MAC_TIME_EVENT_RSP_API_S_VER_1 */
  659. /**
  660. * struct iwl_time_event_notif - notifications of time event start/stop
  661. * ( TIME_EVENT_NOTIFICATION = 0x2a )
  662. * @timestamp: action timestamp in GP2
  663. * @session_id: session's unique id
  664. * @unique_id: unique id of the Time Event itself
  665. * @id_and_color: ID and color of the relevant MAC
  666. * @action: one of TE_NOTIF_START or TE_NOTIF_END
  667. * @status: true if scheduled, false otherwise (not executed)
  668. */
  669. struct iwl_time_event_notif {
  670. __le32 timestamp;
  671. __le32 session_id;
  672. __le32 unique_id;
  673. __le32 id_and_color;
  674. __le32 action;
  675. __le32 status;
  676. } __packed; /* MAC_TIME_EVENT_NTFY_API_S_VER_1 */
  677. /* Bindings and Time Quota */
  678. /**
  679. * struct iwl_binding_cmd - configuring bindings
  680. * ( BINDING_CONTEXT_CMD = 0x2b )
  681. * @id_and_color: ID and color of the relevant Binding
  682. * @action: action to perform, one of FW_CTXT_ACTION_*
  683. * @macs: array of MAC id and colors which belong to the binding
  684. * @phy: PHY id and color which belongs to the binding
  685. */
  686. struct iwl_binding_cmd {
  687. /* COMMON_INDEX_HDR_API_S_VER_1 */
  688. __le32 id_and_color;
  689. __le32 action;
  690. /* BINDING_DATA_API_S_VER_1 */
  691. __le32 macs[MAX_MACS_IN_BINDING];
  692. __le32 phy;
  693. } __packed; /* BINDING_CMD_API_S_VER_1 */
  694. /* The maximal number of fragments in the FW's schedule session */
  695. #define IWL_MVM_MAX_QUOTA 128
  696. /**
  697. * struct iwl_time_quota_data - configuration of time quota per binding
  698. * @id_and_color: ID and color of the relevant Binding
  699. * @quota: absolute time quota in TU. The scheduler will try to divide the
  700. * remainig quota (after Time Events) according to this quota.
  701. * @max_duration: max uninterrupted context duration in TU
  702. */
  703. struct iwl_time_quota_data {
  704. __le32 id_and_color;
  705. __le32 quota;
  706. __le32 max_duration;
  707. } __packed; /* TIME_QUOTA_DATA_API_S_VER_1 */
  708. /**
  709. * struct iwl_time_quota_cmd - configuration of time quota between bindings
  710. * ( TIME_QUOTA_CMD = 0x2c )
  711. * @quotas: allocations per binding
  712. */
  713. struct iwl_time_quota_cmd {
  714. struct iwl_time_quota_data quotas[MAX_BINDINGS];
  715. } __packed; /* TIME_QUOTA_ALLOCATION_CMD_API_S_VER_1 */
  716. /* PHY context */
  717. /* Supported bands */
  718. #define PHY_BAND_5 (0)
  719. #define PHY_BAND_24 (1)
  720. /* Supported channel width, vary if there is VHT support */
  721. #define PHY_VHT_CHANNEL_MODE20 (0x0)
  722. #define PHY_VHT_CHANNEL_MODE40 (0x1)
  723. #define PHY_VHT_CHANNEL_MODE80 (0x2)
  724. #define PHY_VHT_CHANNEL_MODE160 (0x3)
  725. /*
  726. * Control channel position:
  727. * For legacy set bit means upper channel, otherwise lower.
  728. * For VHT - bit-2 marks if the control is lower/upper relative to center-freq
  729. * bits-1:0 mark the distance from the center freq. for 20Mhz, offset is 0.
  730. * center_freq
  731. * |
  732. * 40Mhz |_______|_______|
  733. * 80Mhz |_______|_______|_______|_______|
  734. * 160Mhz |_______|_______|_______|_______|_______|_______|_______|_______|
  735. * code 011 010 001 000 | 100 101 110 111
  736. */
  737. #define PHY_VHT_CTRL_POS_1_BELOW (0x0)
  738. #define PHY_VHT_CTRL_POS_2_BELOW (0x1)
  739. #define PHY_VHT_CTRL_POS_3_BELOW (0x2)
  740. #define PHY_VHT_CTRL_POS_4_BELOW (0x3)
  741. #define PHY_VHT_CTRL_POS_1_ABOVE (0x4)
  742. #define PHY_VHT_CTRL_POS_2_ABOVE (0x5)
  743. #define PHY_VHT_CTRL_POS_3_ABOVE (0x6)
  744. #define PHY_VHT_CTRL_POS_4_ABOVE (0x7)
  745. /*
  746. * @band: PHY_BAND_*
  747. * @channel: channel number
  748. * @width: PHY_[VHT|LEGACY]_CHANNEL_*
  749. * @ctrl channel: PHY_[VHT|LEGACY]_CTRL_*
  750. */
  751. struct iwl_fw_channel_info {
  752. u8 band;
  753. u8 channel;
  754. u8 width;
  755. u8 ctrl_pos;
  756. } __packed;
  757. #define PHY_RX_CHAIN_DRIVER_FORCE_POS (0)
  758. #define PHY_RX_CHAIN_DRIVER_FORCE_MSK \
  759. (0x1 << PHY_RX_CHAIN_DRIVER_FORCE_POS)
  760. #define PHY_RX_CHAIN_VALID_POS (1)
  761. #define PHY_RX_CHAIN_VALID_MSK \
  762. (0x7 << PHY_RX_CHAIN_VALID_POS)
  763. #define PHY_RX_CHAIN_FORCE_SEL_POS (4)
  764. #define PHY_RX_CHAIN_FORCE_SEL_MSK \
  765. (0x7 << PHY_RX_CHAIN_FORCE_SEL_POS)
  766. #define PHY_RX_CHAIN_FORCE_MIMO_SEL_POS (7)
  767. #define PHY_RX_CHAIN_FORCE_MIMO_SEL_MSK \
  768. (0x7 << PHY_RX_CHAIN_FORCE_MIMO_SEL_POS)
  769. #define PHY_RX_CHAIN_CNT_POS (10)
  770. #define PHY_RX_CHAIN_CNT_MSK \
  771. (0x3 << PHY_RX_CHAIN_CNT_POS)
  772. #define PHY_RX_CHAIN_MIMO_CNT_POS (12)
  773. #define PHY_RX_CHAIN_MIMO_CNT_MSK \
  774. (0x3 << PHY_RX_CHAIN_MIMO_CNT_POS)
  775. #define PHY_RX_CHAIN_MIMO_FORCE_POS (14)
  776. #define PHY_RX_CHAIN_MIMO_FORCE_MSK \
  777. (0x1 << PHY_RX_CHAIN_MIMO_FORCE_POS)
  778. /* TODO: fix the value, make it depend on firmware at runtime? */
  779. #define NUM_PHY_CTX 3
  780. /* TODO: complete missing documentation */
  781. /**
  782. * struct iwl_phy_context_cmd - config of the PHY context
  783. * ( PHY_CONTEXT_CMD = 0x8 )
  784. * @id_and_color: ID and color of the relevant Binding
  785. * @action: action to perform, one of FW_CTXT_ACTION_*
  786. * @apply_time: 0 means immediate apply and context switch.
  787. * other value means apply new params after X usecs
  788. * @tx_param_color: ???
  789. * @channel_info:
  790. * @txchain_info: ???
  791. * @rxchain_info: ???
  792. * @acquisition_data: ???
  793. * @dsp_cfg_flags: set to 0
  794. */
  795. struct iwl_phy_context_cmd {
  796. /* COMMON_INDEX_HDR_API_S_VER_1 */
  797. __le32 id_and_color;
  798. __le32 action;
  799. /* PHY_CONTEXT_DATA_API_S_VER_1 */
  800. __le32 apply_time;
  801. __le32 tx_param_color;
  802. struct iwl_fw_channel_info ci;
  803. __le32 txchain_info;
  804. __le32 rxchain_info;
  805. __le32 acquisition_data;
  806. __le32 dsp_cfg_flags;
  807. } __packed; /* PHY_CONTEXT_CMD_API_VER_1 */
  808. #define IWL_RX_INFO_PHY_CNT 8
  809. #define IWL_RX_INFO_ENERGY_ANT_ABC_IDX 1
  810. #define IWL_RX_INFO_ENERGY_ANT_A_MSK 0x000000ff
  811. #define IWL_RX_INFO_ENERGY_ANT_B_MSK 0x0000ff00
  812. #define IWL_RX_INFO_ENERGY_ANT_C_MSK 0x00ff0000
  813. #define IWL_RX_INFO_ENERGY_ANT_A_POS 0
  814. #define IWL_RX_INFO_ENERGY_ANT_B_POS 8
  815. #define IWL_RX_INFO_ENERGY_ANT_C_POS 16
  816. #define IWL_RX_INFO_AGC_IDX 1
  817. #define IWL_RX_INFO_RSSI_AB_IDX 2
  818. #define IWL_OFDM_AGC_A_MSK 0x0000007f
  819. #define IWL_OFDM_AGC_A_POS 0
  820. #define IWL_OFDM_AGC_B_MSK 0x00003f80
  821. #define IWL_OFDM_AGC_B_POS 7
  822. #define IWL_OFDM_AGC_CODE_MSK 0x3fe00000
  823. #define IWL_OFDM_AGC_CODE_POS 20
  824. #define IWL_OFDM_RSSI_INBAND_A_MSK 0x00ff
  825. #define IWL_OFDM_RSSI_A_POS 0
  826. #define IWL_OFDM_RSSI_ALLBAND_A_MSK 0xff00
  827. #define IWL_OFDM_RSSI_ALLBAND_A_POS 8
  828. #define IWL_OFDM_RSSI_INBAND_B_MSK 0xff0000
  829. #define IWL_OFDM_RSSI_B_POS 16
  830. #define IWL_OFDM_RSSI_ALLBAND_B_MSK 0xff000000
  831. #define IWL_OFDM_RSSI_ALLBAND_B_POS 24
  832. /**
  833. * struct iwl_rx_phy_info - phy info
  834. * (REPLY_RX_PHY_CMD = 0xc0)
  835. * @non_cfg_phy_cnt: non configurable DSP phy data byte count
  836. * @cfg_phy_cnt: configurable DSP phy data byte count
  837. * @stat_id: configurable DSP phy data set ID
  838. * @reserved1:
  839. * @system_timestamp: GP2 at on air rise
  840. * @timestamp: TSF at on air rise
  841. * @beacon_time_stamp: beacon at on-air rise
  842. * @phy_flags: general phy flags: band, modulation, ...
  843. * @channel: channel number
  844. * @non_cfg_phy_buf: for various implementations of non_cfg_phy
  845. * @rate_n_flags: RATE_MCS_*
  846. * @byte_count: frame's byte-count
  847. * @frame_time: frame's time on the air, based on byte count and frame rate
  848. * calculation
  849. * @mac_active_msk: what MACs were active when the frame was received
  850. *
  851. * Before each Rx, the device sends this data. It contains PHY information
  852. * about the reception of the packet.
  853. */
  854. struct iwl_rx_phy_info {
  855. u8 non_cfg_phy_cnt;
  856. u8 cfg_phy_cnt;
  857. u8 stat_id;
  858. u8 reserved1;
  859. __le32 system_timestamp;
  860. __le64 timestamp;
  861. __le32 beacon_time_stamp;
  862. __le16 phy_flags;
  863. __le16 channel;
  864. __le32 non_cfg_phy[IWL_RX_INFO_PHY_CNT];
  865. __le32 rate_n_flags;
  866. __le32 byte_count;
  867. __le16 mac_active_msk;
  868. __le16 frame_time;
  869. } __packed;
  870. struct iwl_rx_mpdu_res_start {
  871. __le16 byte_count;
  872. __le16 reserved;
  873. } __packed;
  874. /**
  875. * enum iwl_rx_phy_flags - to parse %iwl_rx_phy_info phy_flags
  876. * @RX_RES_PHY_FLAGS_BAND_24: true if the packet was received on 2.4 band
  877. * @RX_RES_PHY_FLAGS_MOD_CCK:
  878. * @RX_RES_PHY_FLAGS_SHORT_PREAMBLE: true if packet's preamble was short
  879. * @RX_RES_PHY_FLAGS_NARROW_BAND:
  880. * @RX_RES_PHY_FLAGS_ANTENNA: antenna on which the packet was received
  881. * @RX_RES_PHY_FLAGS_AGG: set if the packet was part of an A-MPDU
  882. * @RX_RES_PHY_FLAGS_OFDM_HT: The frame was an HT frame
  883. * @RX_RES_PHY_FLAGS_OFDM_GF: The frame used GF preamble
  884. * @RX_RES_PHY_FLAGS_OFDM_VHT: The frame was a VHT frame
  885. */
  886. enum iwl_rx_phy_flags {
  887. RX_RES_PHY_FLAGS_BAND_24 = BIT(0),
  888. RX_RES_PHY_FLAGS_MOD_CCK = BIT(1),
  889. RX_RES_PHY_FLAGS_SHORT_PREAMBLE = BIT(2),
  890. RX_RES_PHY_FLAGS_NARROW_BAND = BIT(3),
  891. RX_RES_PHY_FLAGS_ANTENNA = (0x7 << 4),
  892. RX_RES_PHY_FLAGS_ANTENNA_POS = 4,
  893. RX_RES_PHY_FLAGS_AGG = BIT(7),
  894. RX_RES_PHY_FLAGS_OFDM_HT = BIT(8),
  895. RX_RES_PHY_FLAGS_OFDM_GF = BIT(9),
  896. RX_RES_PHY_FLAGS_OFDM_VHT = BIT(10),
  897. };
  898. /**
  899. * enum iwl_mvm_rx_status - written by fw for each Rx packet
  900. * @RX_MPDU_RES_STATUS_CRC_OK: CRC is fine
  901. * @RX_MPDU_RES_STATUS_OVERRUN_OK: there was no RXE overflow
  902. * @RX_MPDU_RES_STATUS_SRC_STA_FOUND:
  903. * @RX_MPDU_RES_STATUS_KEY_VALID:
  904. * @RX_MPDU_RES_STATUS_KEY_PARAM_OK:
  905. * @RX_MPDU_RES_STATUS_ICV_OK: ICV is fine, if not, the packet is destroyed
  906. * @RX_MPDU_RES_STATUS_MIC_OK: used for CCM alg only. TKIP MIC is checked
  907. * in the driver.
  908. * @RX_MPDU_RES_STATUS_TTAK_OK: TTAK is fine
  909. * @RX_MPDU_RES_STATUS_MNG_FRAME_REPLAY_ERR: valid for alg = CCM_CMAC or
  910. * alg = CCM only. Checks replay attack for 11w frames. Relevant only if
  911. * %RX_MPDU_RES_STATUS_ROBUST_MNG_FRAME is set.
  912. * @RX_MPDU_RES_STATUS_SEC_NO_ENC: this frame is not encrypted
  913. * @RX_MPDU_RES_STATUS_SEC_WEP_ENC: this frame is encrypted using WEP
  914. * @RX_MPDU_RES_STATUS_SEC_CCM_ENC: this frame is encrypted using CCM
  915. * @RX_MPDU_RES_STATUS_SEC_TKIP_ENC: this frame is encrypted using TKIP
  916. * @RX_MPDU_RES_STATUS_SEC_CCM_CMAC_ENC: this frame is encrypted using CCM_CMAC
  917. * @RX_MPDU_RES_STATUS_SEC_ENC_ERR: this frame couldn't be decrypted
  918. * @RX_MPDU_RES_STATUS_SEC_ENC_MSK: bitmask of the encryption algorithm
  919. * @RX_MPDU_RES_STATUS_DEC_DONE: this frame has been successfully decrypted
  920. * @RX_MPDU_RES_STATUS_PROTECT_FRAME_BIT_CMP:
  921. * @RX_MPDU_RES_STATUS_EXT_IV_BIT_CMP:
  922. * @RX_MPDU_RES_STATUS_KEY_ID_CMP_BIT:
  923. * @RX_MPDU_RES_STATUS_ROBUST_MNG_FRAME: this frame is an 11w management frame
  924. * @RX_MPDU_RES_STATUS_HASH_INDEX_MSK:
  925. * @RX_MPDU_RES_STATUS_STA_ID_MSK:
  926. * @RX_MPDU_RES_STATUS_RRF_KILL:
  927. * @RX_MPDU_RES_STATUS_FILTERING_MSK:
  928. * @RX_MPDU_RES_STATUS2_FILTERING_MSK:
  929. */
  930. enum iwl_mvm_rx_status {
  931. RX_MPDU_RES_STATUS_CRC_OK = BIT(0),
  932. RX_MPDU_RES_STATUS_OVERRUN_OK = BIT(1),
  933. RX_MPDU_RES_STATUS_SRC_STA_FOUND = BIT(2),
  934. RX_MPDU_RES_STATUS_KEY_VALID = BIT(3),
  935. RX_MPDU_RES_STATUS_KEY_PARAM_OK = BIT(4),
  936. RX_MPDU_RES_STATUS_ICV_OK = BIT(5),
  937. RX_MPDU_RES_STATUS_MIC_OK = BIT(6),
  938. RX_MPDU_RES_STATUS_TTAK_OK = BIT(7),
  939. RX_MPDU_RES_STATUS_MNG_FRAME_REPLAY_ERR = BIT(7),
  940. RX_MPDU_RES_STATUS_SEC_NO_ENC = (0 << 8),
  941. RX_MPDU_RES_STATUS_SEC_WEP_ENC = (1 << 8),
  942. RX_MPDU_RES_STATUS_SEC_CCM_ENC = (2 << 8),
  943. RX_MPDU_RES_STATUS_SEC_TKIP_ENC = (3 << 8),
  944. RX_MPDU_RES_STATUS_SEC_EXT_ENC = (4 << 8),
  945. RX_MPDU_RES_STATUS_SEC_CCM_CMAC_ENC = (6 << 8),
  946. RX_MPDU_RES_STATUS_SEC_ENC_ERR = (7 << 8),
  947. RX_MPDU_RES_STATUS_SEC_ENC_MSK = (7 << 8),
  948. RX_MPDU_RES_STATUS_DEC_DONE = BIT(11),
  949. RX_MPDU_RES_STATUS_PROTECT_FRAME_BIT_CMP = BIT(12),
  950. RX_MPDU_RES_STATUS_EXT_IV_BIT_CMP = BIT(13),
  951. RX_MPDU_RES_STATUS_KEY_ID_CMP_BIT = BIT(14),
  952. RX_MPDU_RES_STATUS_ROBUST_MNG_FRAME = BIT(15),
  953. RX_MPDU_RES_STATUS_HASH_INDEX_MSK = (0x3F0000),
  954. RX_MPDU_RES_STATUS_STA_ID_MSK = (0x1f000000),
  955. RX_MPDU_RES_STATUS_RRF_KILL = BIT(29),
  956. RX_MPDU_RES_STATUS_FILTERING_MSK = (0xc00000),
  957. RX_MPDU_RES_STATUS2_FILTERING_MSK = (0xc0000000),
  958. };
  959. /**
  960. * struct iwl_radio_version_notif - information on the radio version
  961. * ( RADIO_VERSION_NOTIFICATION = 0x68 )
  962. * @radio_flavor:
  963. * @radio_step:
  964. * @radio_dash:
  965. */
  966. struct iwl_radio_version_notif {
  967. __le32 radio_flavor;
  968. __le32 radio_step;
  969. __le32 radio_dash;
  970. } __packed; /* RADIO_VERSION_NOTOFICATION_S_VER_1 */
  971. enum iwl_card_state_flags {
  972. CARD_ENABLED = 0x00,
  973. HW_CARD_DISABLED = 0x01,
  974. SW_CARD_DISABLED = 0x02,
  975. CT_KILL_CARD_DISABLED = 0x04,
  976. HALT_CARD_DISABLED = 0x08,
  977. CARD_DISABLED_MSK = 0x0f,
  978. CARD_IS_RX_ON = 0x10,
  979. };
  980. /**
  981. * struct iwl_radio_version_notif - information on the radio version
  982. * ( CARD_STATE_NOTIFICATION = 0xa1 )
  983. * @flags: %iwl_card_state_flags
  984. */
  985. struct iwl_card_state_notif {
  986. __le32 flags;
  987. } __packed; /* CARD_STATE_NTFY_API_S_VER_1 */
  988. /**
  989. * struct iwl_missed_beacons_notif - information on missed beacons
  990. * ( MISSED_BEACONS_NOTIFICATION = 0xa2 )
  991. * @mac_id: interface ID
  992. * @consec_missed_beacons_since_last_rx: number of consecutive missed
  993. * beacons since last RX.
  994. * @consec_missed_beacons: number of consecutive missed beacons
  995. * @num_expected_beacons:
  996. * @num_recvd_beacons:
  997. */
  998. struct iwl_missed_beacons_notif {
  999. __le32 mac_id;
  1000. __le32 consec_missed_beacons_since_last_rx;
  1001. __le32 consec_missed_beacons;
  1002. __le32 num_expected_beacons;
  1003. __le32 num_recvd_beacons;
  1004. } __packed; /* MISSED_BEACON_NTFY_API_S_VER_3 */
  1005. /**
  1006. * struct iwl_set_calib_default_cmd - set default value for calibration.
  1007. * ( SET_CALIB_DEFAULT_CMD = 0x8e )
  1008. * @calib_index: the calibration to set value for
  1009. * @length: of data
  1010. * @data: the value to set for the calibration result
  1011. */
  1012. struct iwl_set_calib_default_cmd {
  1013. __le16 calib_index;
  1014. __le16 length;
  1015. u8 data[0];
  1016. } __packed; /* PHY_CALIB_OVERRIDE_VALUES_S */
  1017. #define MAX_PORT_ID_NUM 2
  1018. #define MAX_MCAST_FILTERING_ADDRESSES 256
  1019. /**
  1020. * struct iwl_mcast_filter_cmd - configure multicast filter.
  1021. * @filter_own: Set 1 to filter out multicast packets sent by station itself
  1022. * @port_id: Multicast MAC addresses array specifier. This is a strange way
  1023. * to identify network interface adopted in host-device IF.
  1024. * It is used by FW as index in array of addresses. This array has
  1025. * MAX_PORT_ID_NUM members.
  1026. * @count: Number of MAC addresses in the array
  1027. * @pass_all: Set 1 to pass all multicast packets.
  1028. * @bssid: current association BSSID.
  1029. * @addr_list: Place holder for array of MAC addresses.
  1030. * IMPORTANT: add padding if necessary to ensure DWORD alignment.
  1031. */
  1032. struct iwl_mcast_filter_cmd {
  1033. u8 filter_own;
  1034. u8 port_id;
  1035. u8 count;
  1036. u8 pass_all;
  1037. u8 bssid[6];
  1038. u8 reserved[2];
  1039. u8 addr_list[0];
  1040. } __packed; /* MCAST_FILTERING_CMD_API_S_VER_1 */
  1041. struct mvm_statistics_dbg {
  1042. __le32 burst_check;
  1043. __le32 burst_count;
  1044. __le32 wait_for_silence_timeout_cnt;
  1045. __le32 reserved[3];
  1046. } __packed; /* STATISTICS_DEBUG_API_S_VER_2 */
  1047. struct mvm_statistics_div {
  1048. __le32 tx_on_a;
  1049. __le32 tx_on_b;
  1050. __le32 exec_time;
  1051. __le32 probe_time;
  1052. __le32 rssi_ant;
  1053. __le32 reserved2;
  1054. } __packed; /* STATISTICS_SLOW_DIV_API_S_VER_2 */
  1055. struct mvm_statistics_general_common {
  1056. __le32 temperature; /* radio temperature */
  1057. __le32 temperature_m; /* radio voltage */
  1058. struct mvm_statistics_dbg dbg;
  1059. __le32 sleep_time;
  1060. __le32 slots_out;
  1061. __le32 slots_idle;
  1062. __le32 ttl_timestamp;
  1063. struct mvm_statistics_div div;
  1064. __le32 rx_enable_counter;
  1065. /*
  1066. * num_of_sos_states:
  1067. * count the number of times we have to re-tune
  1068. * in order to get out of bad PHY status
  1069. */
  1070. __le32 num_of_sos_states;
  1071. } __packed; /* STATISTICS_GENERAL_API_S_VER_5 */
  1072. struct mvm_statistics_rx_non_phy {
  1073. __le32 bogus_cts; /* CTS received when not expecting CTS */
  1074. __le32 bogus_ack; /* ACK received when not expecting ACK */
  1075. __le32 non_bssid_frames; /* number of frames with BSSID that
  1076. * doesn't belong to the STA BSSID */
  1077. __le32 filtered_frames; /* count frames that were dumped in the
  1078. * filtering process */
  1079. __le32 non_channel_beacons; /* beacons with our bss id but not on
  1080. * our serving channel */
  1081. __le32 channel_beacons; /* beacons with our bss id and in our
  1082. * serving channel */
  1083. __le32 num_missed_bcon; /* number of missed beacons */
  1084. __le32 adc_rx_saturation_time; /* count in 0.8us units the time the
  1085. * ADC was in saturation */
  1086. __le32 ina_detection_search_time;/* total time (in 0.8us) searched
  1087. * for INA */
  1088. __le32 beacon_silence_rssi_a; /* RSSI silence after beacon frame */
  1089. __le32 beacon_silence_rssi_b; /* RSSI silence after beacon frame */
  1090. __le32 beacon_silence_rssi_c; /* RSSI silence after beacon frame */
  1091. __le32 interference_data_flag; /* flag for interference data
  1092. * availability. 1 when data is
  1093. * available. */
  1094. __le32 channel_load; /* counts RX Enable time in uSec */
  1095. __le32 dsp_false_alarms; /* DSP false alarm (both OFDM
  1096. * and CCK) counter */
  1097. __le32 beacon_rssi_a;
  1098. __le32 beacon_rssi_b;
  1099. __le32 beacon_rssi_c;
  1100. __le32 beacon_energy_a;
  1101. __le32 beacon_energy_b;
  1102. __le32 beacon_energy_c;
  1103. __le32 num_bt_kills;
  1104. __le32 mac_id;
  1105. __le32 directed_data_mpdu;
  1106. } __packed; /* STATISTICS_RX_NON_PHY_API_S_VER_3 */
  1107. struct mvm_statistics_rx_phy {
  1108. __le32 ina_cnt;
  1109. __le32 fina_cnt;
  1110. __le32 plcp_err;
  1111. __le32 crc32_err;
  1112. __le32 overrun_err;
  1113. __le32 early_overrun_err;
  1114. __le32 crc32_good;
  1115. __le32 false_alarm_cnt;
  1116. __le32 fina_sync_err_cnt;
  1117. __le32 sfd_timeout;
  1118. __le32 fina_timeout;
  1119. __le32 unresponded_rts;
  1120. __le32 rxe_frame_limit_overrun;
  1121. __le32 sent_ack_cnt;
  1122. __le32 sent_cts_cnt;
  1123. __le32 sent_ba_rsp_cnt;
  1124. __le32 dsp_self_kill;
  1125. __le32 mh_format_err;
  1126. __le32 re_acq_main_rssi_sum;
  1127. __le32 reserved;
  1128. } __packed; /* STATISTICS_RX_PHY_API_S_VER_2 */
  1129. struct mvm_statistics_rx_ht_phy {
  1130. __le32 plcp_err;
  1131. __le32 overrun_err;
  1132. __le32 early_overrun_err;
  1133. __le32 crc32_good;
  1134. __le32 crc32_err;
  1135. __le32 mh_format_err;
  1136. __le32 agg_crc32_good;
  1137. __le32 agg_mpdu_cnt;
  1138. __le32 agg_cnt;
  1139. __le32 unsupport_mcs;
  1140. } __packed; /* STATISTICS_HT_RX_PHY_API_S_VER_1 */
  1141. #define MAX_CHAINS 3
  1142. struct mvm_statistics_tx_non_phy_agg {
  1143. __le32 ba_timeout;
  1144. __le32 ba_reschedule_frames;
  1145. __le32 scd_query_agg_frame_cnt;
  1146. __le32 scd_query_no_agg;
  1147. __le32 scd_query_agg;
  1148. __le32 scd_query_mismatch;
  1149. __le32 frame_not_ready;
  1150. __le32 underrun;
  1151. __le32 bt_prio_kill;
  1152. __le32 rx_ba_rsp_cnt;
  1153. __s8 txpower[MAX_CHAINS];
  1154. __s8 reserved;
  1155. __le32 reserved2;
  1156. } __packed; /* STATISTICS_TX_NON_PHY_AGG_API_S_VER_1 */
  1157. struct mvm_statistics_tx_channel_width {
  1158. __le32 ext_cca_narrow_ch20[1];
  1159. __le32 ext_cca_narrow_ch40[2];
  1160. __le32 ext_cca_narrow_ch80[3];
  1161. __le32 ext_cca_narrow_ch160[4];
  1162. __le32 last_tx_ch_width_indx;
  1163. __le32 rx_detected_per_ch_width[4];
  1164. __le32 success_per_ch_width[4];
  1165. __le32 fail_per_ch_width[4];
  1166. }; /* STATISTICS_TX_CHANNEL_WIDTH_API_S_VER_1 */
  1167. struct mvm_statistics_tx {
  1168. __le32 preamble_cnt;
  1169. __le32 rx_detected_cnt;
  1170. __le32 bt_prio_defer_cnt;
  1171. __le32 bt_prio_kill_cnt;
  1172. __le32 few_bytes_cnt;
  1173. __le32 cts_timeout;
  1174. __le32 ack_timeout;
  1175. __le32 expected_ack_cnt;
  1176. __le32 actual_ack_cnt;
  1177. __le32 dump_msdu_cnt;
  1178. __le32 burst_abort_next_frame_mismatch_cnt;
  1179. __le32 burst_abort_missing_next_frame_cnt;
  1180. __le32 cts_timeout_collision;
  1181. __le32 ack_or_ba_timeout_collision;
  1182. struct mvm_statistics_tx_non_phy_agg agg;
  1183. struct mvm_statistics_tx_channel_width channel_width;
  1184. } __packed; /* STATISTICS_TX_API_S_VER_4 */
  1185. struct mvm_statistics_bt_activity {
  1186. __le32 hi_priority_tx_req_cnt;
  1187. __le32 hi_priority_tx_denied_cnt;
  1188. __le32 lo_priority_tx_req_cnt;
  1189. __le32 lo_priority_tx_denied_cnt;
  1190. __le32 hi_priority_rx_req_cnt;
  1191. __le32 hi_priority_rx_denied_cnt;
  1192. __le32 lo_priority_rx_req_cnt;
  1193. __le32 lo_priority_rx_denied_cnt;
  1194. } __packed; /* STATISTICS_BT_ACTIVITY_API_S_VER_1 */
  1195. struct mvm_statistics_general {
  1196. struct mvm_statistics_general_common common;
  1197. __le32 beacon_filtered;
  1198. __le32 missed_beacons;
  1199. __s8 beacon_filter_average_energy;
  1200. __s8 beacon_filter_reason;
  1201. __s8 beacon_filter_current_energy;
  1202. __s8 beacon_filter_reserved;
  1203. __le32 beacon_filter_delta_time;
  1204. struct mvm_statistics_bt_activity bt_activity;
  1205. } __packed; /* STATISTICS_GENERAL_API_S_VER_5 */
  1206. struct mvm_statistics_rx {
  1207. struct mvm_statistics_rx_phy ofdm;
  1208. struct mvm_statistics_rx_phy cck;
  1209. struct mvm_statistics_rx_non_phy general;
  1210. struct mvm_statistics_rx_ht_phy ofdm_ht;
  1211. } __packed; /* STATISTICS_RX_API_S_VER_3 */
  1212. /*
  1213. * STATISTICS_NOTIFICATION = 0x9d (notification only, not a command)
  1214. *
  1215. * By default, uCode issues this notification after receiving a beacon
  1216. * while associated. To disable this behavior, set DISABLE_NOTIF flag in the
  1217. * REPLY_STATISTICS_CMD 0x9c, above.
  1218. *
  1219. * Statistics counters continue to increment beacon after beacon, but are
  1220. * cleared when changing channels or when driver issues REPLY_STATISTICS_CMD
  1221. * 0x9c with CLEAR_STATS bit set (see above).
  1222. *
  1223. * uCode also issues this notification during scans. uCode clears statistics
  1224. * appropriately so that each notification contains statistics for only the
  1225. * one channel that has just been scanned.
  1226. */
  1227. struct iwl_notif_statistics { /* STATISTICS_NTFY_API_S_VER_8 */
  1228. __le32 flag;
  1229. struct mvm_statistics_rx rx;
  1230. struct mvm_statistics_tx tx;
  1231. struct mvm_statistics_general general;
  1232. } __packed;
  1233. /***********************************
  1234. * Smart Fifo API
  1235. ***********************************/
  1236. /* Smart Fifo state */
  1237. enum iwl_sf_state {
  1238. SF_LONG_DELAY_ON = 0, /* should never be called by driver */
  1239. SF_FULL_ON,
  1240. SF_UNINIT,
  1241. SF_INIT_OFF,
  1242. SF_HW_NUM_STATES
  1243. };
  1244. /* Smart Fifo possible scenario */
  1245. enum iwl_sf_scenario {
  1246. SF_SCENARIO_SINGLE_UNICAST,
  1247. SF_SCENARIO_AGG_UNICAST,
  1248. SF_SCENARIO_MULTICAST,
  1249. SF_SCENARIO_BA_RESP,
  1250. SF_SCENARIO_TX_RESP,
  1251. SF_NUM_SCENARIO
  1252. };
  1253. #define SF_TRANSIENT_STATES_NUMBER 2 /* SF_LONG_DELAY_ON and SF_FULL_ON */
  1254. #define SF_NUM_TIMEOUT_TYPES 2 /* Aging timer and Idle timer */
  1255. /* smart FIFO default values */
  1256. #define SF_W_MARK_SISO 4096
  1257. #define SF_W_MARK_MIMO2 8192
  1258. #define SF_W_MARK_MIMO3 6144
  1259. #define SF_W_MARK_LEGACY 4096
  1260. #define SF_W_MARK_SCAN 4096
  1261. /* SF Scenarios timers for FULL_ON state (aligned to 32 uSec) */
  1262. #define SF_SINGLE_UNICAST_IDLE_TIMER 320 /* 300 uSec */
  1263. #define SF_SINGLE_UNICAST_AGING_TIMER 2016 /* 2 mSec */
  1264. #define SF_AGG_UNICAST_IDLE_TIMER 320 /* 300 uSec */
  1265. #define SF_AGG_UNICAST_AGING_TIMER 2016 /* 2 mSec */
  1266. #define SF_MCAST_IDLE_TIMER 2016 /* 2 mSec */
  1267. #define SF_MCAST_AGING_TIMER 10016 /* 10 mSec */
  1268. #define SF_BA_IDLE_TIMER 320 /* 300 uSec */
  1269. #define SF_BA_AGING_TIMER 2016 /* 2 mSec */
  1270. #define SF_TX_RE_IDLE_TIMER 320 /* 300 uSec */
  1271. #define SF_TX_RE_AGING_TIMER 2016 /* 2 mSec */
  1272. #define SF_LONG_DELAY_AGING_TIMER 1000000 /* 1 Sec */
  1273. /**
  1274. * Smart Fifo configuration command.
  1275. * @state: smart fifo state, types listed in iwl_sf_sate.
  1276. * @watermark: Minimum allowed availabe free space in RXF for transient state.
  1277. * @long_delay_timeouts: aging and idle timer values for each scenario
  1278. * in long delay state.
  1279. * @full_on_timeouts: timer values for each scenario in full on state.
  1280. */
  1281. struct iwl_sf_cfg_cmd {
  1282. enum iwl_sf_state state;
  1283. __le32 watermark[SF_TRANSIENT_STATES_NUMBER];
  1284. __le32 long_delay_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
  1285. __le32 full_on_timeouts[SF_NUM_SCENARIO][SF_NUM_TIMEOUT_TYPES];
  1286. } __packed; /* SF_CFG_API_S_VER_2 */
  1287. #endif /* __fw_api_h__ */