fw-api-coex.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  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) 2013 - 2014 Intel Corporation. All rights reserved.
  9. * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of version 2 of the GNU General Public License as
  13. * published by the Free Software Foundation.
  14. *
  15. * This program is distributed in the hope that it will be useful, but
  16. * WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
  23. * USA
  24. *
  25. * The full GNU General Public License is included in this distribution
  26. * in the file called COPYING.
  27. *
  28. * Contact Information:
  29. * Intel Linux Wireless <ilw@linux.intel.com>
  30. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  31. *
  32. * BSD LICENSE
  33. *
  34. * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved.
  35. * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
  36. * All rights reserved.
  37. *
  38. * Redistribution and use in source and binary forms, with or without
  39. * modification, are permitted provided that the following conditions
  40. * are met:
  41. *
  42. * * Redistributions of source code must retain the above copyright
  43. * notice, this list of conditions and the following disclaimer.
  44. * * Redistributions in binary form must reproduce the above copyright
  45. * notice, this list of conditions and the following disclaimer in
  46. * the documentation and/or other materials provided with the
  47. * distribution.
  48. * * Neither the name Intel Corporation nor the names of its
  49. * contributors may be used to endorse or promote products derived
  50. * from this software without specific prior written permission.
  51. *
  52. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  53. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  54. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  55. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  56. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  57. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  58. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  59. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  60. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  61. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  62. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  63. *****************************************************************************/
  64. #ifndef __fw_api_bt_coex_h__
  65. #define __fw_api_bt_coex_h__
  66. #include <linux/types.h>
  67. #include <linux/bitops.h>
  68. #define BITS(nb) (BIT(nb) - 1)
  69. /**
  70. * enum iwl_bt_coex_flags - flags for BT_COEX command
  71. * @BT_COEX_MODE_POS:
  72. * @BT_COEX_MODE_MSK:
  73. * @BT_COEX_DISABLE_OLD:
  74. * @BT_COEX_2W_OLD:
  75. * @BT_COEX_3W_OLD:
  76. * @BT_COEX_NW_OLD:
  77. * @BT_COEX_AUTO_OLD:
  78. * @BT_COEX_BT_OLD: Antenna is for BT (manufacuring tests)
  79. * @BT_COEX_WIFI_OLD: Antenna is for BT (manufacuring tests)
  80. * @BT_COEX_SYNC2SCO:
  81. * @BT_COEX_CORUNNING:
  82. * @BT_COEX_MPLUT:
  83. * @BT_COEX_TTC:
  84. * @BT_COEX_RRC:
  85. *
  86. * The COEX_MODE must be set for each command. Even if it is not changed.
  87. */
  88. enum iwl_bt_coex_flags {
  89. BT_COEX_MODE_POS = 3,
  90. BT_COEX_MODE_MSK = BITS(3) << BT_COEX_MODE_POS,
  91. BT_COEX_DISABLE_OLD = 0x0 << BT_COEX_MODE_POS,
  92. BT_COEX_2W_OLD = 0x1 << BT_COEX_MODE_POS,
  93. BT_COEX_3W_OLD = 0x2 << BT_COEX_MODE_POS,
  94. BT_COEX_NW_OLD = 0x3 << BT_COEX_MODE_POS,
  95. BT_COEX_AUTO_OLD = 0x5 << BT_COEX_MODE_POS,
  96. BT_COEX_BT_OLD = 0x6 << BT_COEX_MODE_POS,
  97. BT_COEX_WIFI_OLD = 0x7 << BT_COEX_MODE_POS,
  98. BT_COEX_SYNC2SCO = BIT(7),
  99. BT_COEX_CORUNNING = BIT(8),
  100. BT_COEX_MPLUT = BIT(9),
  101. BT_COEX_TTC = BIT(20),
  102. BT_COEX_RRC = BIT(21),
  103. };
  104. /*
  105. * indicates what has changed in the BT_COEX command.
  106. * BT_VALID_ENABLE must be set for each command. Commands without this bit will
  107. * discarded by the firmware
  108. */
  109. enum iwl_bt_coex_valid_bit_msk {
  110. BT_VALID_ENABLE = BIT(0),
  111. BT_VALID_BT_PRIO_BOOST = BIT(1),
  112. BT_VALID_MAX_KILL = BIT(2),
  113. BT_VALID_3W_TMRS = BIT(3),
  114. BT_VALID_KILL_ACK = BIT(4),
  115. BT_VALID_KILL_CTS = BIT(5),
  116. BT_VALID_REDUCED_TX_POWER = BIT(6),
  117. BT_VALID_LUT = BIT(7),
  118. BT_VALID_WIFI_RX_SW_PRIO_BOOST = BIT(8),
  119. BT_VALID_WIFI_TX_SW_PRIO_BOOST = BIT(9),
  120. BT_VALID_MULTI_PRIO_LUT = BIT(10),
  121. BT_VALID_TRM_KICK_FILTER = BIT(11),
  122. BT_VALID_CORUN_LUT_20 = BIT(12),
  123. BT_VALID_CORUN_LUT_40 = BIT(13),
  124. BT_VALID_ANT_ISOLATION = BIT(14),
  125. BT_VALID_ANT_ISOLATION_THRS = BIT(15),
  126. BT_VALID_TXTX_DELTA_FREQ_THRS = BIT(16),
  127. BT_VALID_TXRX_MAX_FREQ_0 = BIT(17),
  128. BT_VALID_SYNC_TO_SCO = BIT(18),
  129. BT_VALID_TTC = BIT(20),
  130. BT_VALID_RRC = BIT(21),
  131. };
  132. /**
  133. * enum iwl_bt_reduced_tx_power - allows to reduce txpower for WiFi frames.
  134. * @BT_REDUCED_TX_POWER_CTL: reduce Tx power for control frames
  135. * @BT_REDUCED_TX_POWER_DATA: reduce Tx power for data frames
  136. *
  137. * This mechanism allows to have BT and WiFi run concurrently. Since WiFi
  138. * reduces its Tx power, it can work along with BT, hence reducing the amount
  139. * of WiFi frames being killed by BT.
  140. */
  141. enum iwl_bt_reduced_tx_power {
  142. BT_REDUCED_TX_POWER_CTL = BIT(0),
  143. BT_REDUCED_TX_POWER_DATA = BIT(1),
  144. };
  145. enum iwl_bt_coex_lut_type {
  146. BT_COEX_TIGHT_LUT = 0,
  147. BT_COEX_LOOSE_LUT,
  148. BT_COEX_TX_DIS_LUT,
  149. BT_COEX_MAX_LUT,
  150. BT_COEX_INVALID_LUT = 0xff,
  151. }; /* BT_COEX_DECISION_LUT_INDEX_API_E_VER_1 */
  152. #define BT_COEX_LUT_SIZE (12)
  153. #define BT_COEX_CORUN_LUT_SIZE (32)
  154. #define BT_COEX_MULTI_PRIO_LUT_SIZE (2)
  155. #define BT_COEX_BOOST_SIZE (4)
  156. #define BT_REDUCED_TX_POWER_BIT BIT(7)
  157. /**
  158. * struct iwl_bt_coex_cmd_old - bt coex configuration command
  159. * @flags:&enum iwl_bt_coex_flags
  160. * @max_kill:
  161. * @bt_reduced_tx_power: enum %iwl_bt_reduced_tx_power
  162. * @override_primary_lut: enum %iwl_bt_coex_lut_type: BT_COEX_INVALID_LUT
  163. * should be set by default
  164. * @override_secondary_lut: enum %iwl_bt_coex_lut_type: BT_COEX_INVALID_LUT
  165. * should be set by default
  166. * @bt4_antenna_isolation: antenna isolation
  167. * @bt4_antenna_isolation_thr: antenna threshold value
  168. * @bt4_tx_tx_delta_freq_thr: TxTx delta frequency
  169. * @bt4_tx_rx_max_freq0: TxRx max frequency
  170. * @bt_prio_boost: BT priority boost registers
  171. * @wifi_tx_prio_boost: SW boost of wifi tx priority
  172. * @wifi_rx_prio_boost: SW boost of wifi rx priority
  173. * @kill_ack_msk: kill ACK mask. 1 - Tx ACK, 0 - kill Tx of ACK.
  174. * @kill_cts_msk: kill CTS mask. 1 - Tx CTS, 0 - kill Tx of CTS.
  175. * @decision_lut: PTA decision LUT, per Prio-Ch
  176. * @bt4_multiprio_lut: multi priority LUT configuration
  177. * @bt4_corun_lut20: co-running 20 MHz LUT configuration
  178. * @bt4_corun_lut40: co-running 40 MHz LUT configuration
  179. * @valid_bit_msk: enum %iwl_bt_coex_valid_bit_msk
  180. *
  181. * The structure is used for the BT_COEX command.
  182. */
  183. struct iwl_bt_coex_cmd_old {
  184. __le32 flags;
  185. u8 max_kill;
  186. u8 bt_reduced_tx_power;
  187. u8 override_primary_lut;
  188. u8 override_secondary_lut;
  189. u8 bt4_antenna_isolation;
  190. u8 bt4_antenna_isolation_thr;
  191. u8 bt4_tx_tx_delta_freq_thr;
  192. u8 bt4_tx_rx_max_freq0;
  193. __le32 bt_prio_boost[BT_COEX_BOOST_SIZE];
  194. __le32 wifi_tx_prio_boost;
  195. __le32 wifi_rx_prio_boost;
  196. __le32 kill_ack_msk;
  197. __le32 kill_cts_msk;
  198. __le32 decision_lut[BT_COEX_MAX_LUT][BT_COEX_LUT_SIZE];
  199. __le32 bt4_multiprio_lut[BT_COEX_MULTI_PRIO_LUT_SIZE];
  200. __le32 bt4_corun_lut20[BT_COEX_CORUN_LUT_SIZE];
  201. __le32 bt4_corun_lut40[BT_COEX_CORUN_LUT_SIZE];
  202. __le32 valid_bit_msk;
  203. } __packed; /* BT_COEX_CMD_API_S_VER_5 */
  204. enum iwl_bt_coex_mode {
  205. BT_COEX_DISABLE = 0x0,
  206. BT_COEX_NW = 0x1,
  207. BT_COEX_BT = 0x2,
  208. BT_COEX_WIFI = 0x3,
  209. }; /* BT_COEX_MODES_E */
  210. enum iwl_bt_coex_enabled_modules {
  211. BT_COEX_MPLUT_ENABLED = BIT(0),
  212. BT_COEX_MPLUT_BOOST_ENABLED = BIT(1),
  213. BT_COEX_SYNC2SCO_ENABLED = BIT(2),
  214. BT_COEX_CORUN_ENABLED = BIT(3),
  215. BT_COEX_HIGH_BAND_RET = BIT(4),
  216. }; /* BT_COEX_MODULES_ENABLE_E_VER_1 */
  217. /**
  218. * struct iwl_bt_coex_cmd - bt coex configuration command
  219. * @mode: enum %iwl_bt_coex_mode
  220. * @enabled_modules: enum %iwl_bt_coex_enabled_modules
  221. * @max_kill: max count of Tx retries due to kill from PTA
  222. * @override_primary_lut: enum %iwl_bt_coex_lut_type: BT_COEX_INVALID_LUT
  223. * should be set by default
  224. * @override_secondary_lut: enum %iwl_bt_coex_lut_type: BT_COEX_INVALID_LUT
  225. * should be set by default
  226. * @bt4_antenna_isolation_thr: antenna threshold value
  227. * @bt4_tx_tx_delta_freq_thr: TxTx delta frequency
  228. * @bt4_tx_rx_max_freq0: TxRx max frequency
  229. * @multiprio_lut: multi priority LUT configuration
  230. * @mplut_prio_boost: BT priority boost registers
  231. * @decision_lut: PTA decision LUT, per Prio-Ch
  232. *
  233. * The structure is used for the BT_COEX command.
  234. */
  235. struct iwl_bt_coex_cmd {
  236. __le32 mode;
  237. __le32 enabled_modules;
  238. __le32 max_kill;
  239. __le32 override_primary_lut;
  240. __le32 override_secondary_lut;
  241. __le32 bt4_antenna_isolation_thr;
  242. __le32 bt4_tx_tx_delta_freq_thr;
  243. __le32 bt4_tx_rx_max_freq0;
  244. __le32 multiprio_lut[BT_COEX_MULTI_PRIO_LUT_SIZE];
  245. __le32 mplut_prio_boost[BT_COEX_BOOST_SIZE];
  246. __le32 decision_lut[BT_COEX_MAX_LUT][BT_COEX_LUT_SIZE];
  247. } __packed; /* BT_COEX_CMD_API_S_VER_6 */
  248. /**
  249. * struct iwl_bt_coex_corun_lut_update - bt coex update the corun lut
  250. * @corun_lut20: co-running 20 MHz LUT configuration
  251. * @corun_lut40: co-running 40 MHz LUT configuration
  252. *
  253. * The structure is used for the BT_COEX_UPDATE_CORUN_LUT command.
  254. */
  255. struct iwl_bt_coex_corun_lut_update_cmd {
  256. __le32 corun_lut20[BT_COEX_CORUN_LUT_SIZE];
  257. __le32 corun_lut40[BT_COEX_CORUN_LUT_SIZE];
  258. } __packed; /* BT_COEX_UPDATE_CORUN_LUT_API_S_VER_1 */
  259. /**
  260. * struct iwl_bt_coex_sw_boost - SW boost values
  261. * @wifi_tx_prio_boost: SW boost of wifi tx priority
  262. * @wifi_rx_prio_boost: SW boost of wifi rx priority
  263. * @kill_ack_msk: kill ACK mask. 1 - Tx ACK, 0 - kill Tx of ACK.
  264. * @kill_cts_msk: kill CTS mask. 1 - Tx CTS, 0 - kill Tx of CTS.
  265. */
  266. struct iwl_bt_coex_sw_boost {
  267. __le32 wifi_tx_prio_boost;
  268. __le32 wifi_rx_prio_boost;
  269. __le32 kill_ack_msk;
  270. __le32 kill_cts_msk;
  271. };
  272. /**
  273. * struct iwl_bt_coex_sw_boost_update_cmd - command to update the SW boost
  274. * @boost_values: check struct %iwl_bt_coex_sw_boost - one for each channel
  275. * primary / secondary / low priority
  276. */
  277. struct iwl_bt_coex_sw_boost_update_cmd {
  278. struct iwl_bt_coex_sw_boost boost_values[3];
  279. } __packed; /* BT_COEX_UPDATE_SW_BOOST_S_VER_1 */
  280. /**
  281. * struct iwl_bt_coex_reduced_txp_update_cmd
  282. * @reduced_txp: bit BT_REDUCED_TX_POWER_BIT to enable / disable, rest of the
  283. * bits are the sta_id (value)
  284. */
  285. struct iwl_bt_coex_reduced_txp_update_cmd {
  286. __le32 reduced_txp;
  287. } __packed; /* BT_COEX_UPDATE_REDUCED_TX_POWER_API_S_VER_1 */
  288. /**
  289. * struct iwl_bt_coex_ci_cmd - bt coex channel inhibition command
  290. * @bt_primary_ci:
  291. * @primary_ch_phy_id:
  292. * @bt_secondary_ci:
  293. * @secondary_ch_phy_id:
  294. *
  295. * Used for BT_COEX_CI command
  296. */
  297. struct iwl_bt_coex_ci_cmd {
  298. __le64 bt_primary_ci;
  299. __le32 primary_ch_phy_id;
  300. __le64 bt_secondary_ci;
  301. __le32 secondary_ch_phy_id;
  302. } __packed; /* BT_CI_MSG_API_S_VER_2 */
  303. #define BT_MBOX(n_dw, _msg, _pos, _nbits) \
  304. BT_MBOX##n_dw##_##_msg##_POS = (_pos), \
  305. BT_MBOX##n_dw##_##_msg = BITS(_nbits) << BT_MBOX##n_dw##_##_msg##_POS
  306. enum iwl_bt_mxbox_dw0 {
  307. BT_MBOX(0, LE_SLAVE_LAT, 0, 3),
  308. BT_MBOX(0, LE_PROF1, 3, 1),
  309. BT_MBOX(0, LE_PROF2, 4, 1),
  310. BT_MBOX(0, LE_PROF_OTHER, 5, 1),
  311. BT_MBOX(0, CHL_SEQ_N, 8, 4),
  312. BT_MBOX(0, INBAND_S, 13, 1),
  313. BT_MBOX(0, LE_MIN_RSSI, 16, 4),
  314. BT_MBOX(0, LE_SCAN, 20, 1),
  315. BT_MBOX(0, LE_ADV, 21, 1),
  316. BT_MBOX(0, LE_MAX_TX_POWER, 24, 4),
  317. BT_MBOX(0, OPEN_CON_1, 28, 2),
  318. };
  319. enum iwl_bt_mxbox_dw1 {
  320. BT_MBOX(1, BR_MAX_TX_POWER, 0, 4),
  321. BT_MBOX(1, IP_SR, 4, 1),
  322. BT_MBOX(1, LE_MSTR, 5, 1),
  323. BT_MBOX(1, AGGR_TRFC_LD, 8, 6),
  324. BT_MBOX(1, MSG_TYPE, 16, 3),
  325. BT_MBOX(1, SSN, 19, 2),
  326. };
  327. enum iwl_bt_mxbox_dw2 {
  328. BT_MBOX(2, SNIFF_ACT, 0, 3),
  329. BT_MBOX(2, PAG, 3, 1),
  330. BT_MBOX(2, INQUIRY, 4, 1),
  331. BT_MBOX(2, CONN, 5, 1),
  332. BT_MBOX(2, SNIFF_INTERVAL, 8, 5),
  333. BT_MBOX(2, DISC, 13, 1),
  334. BT_MBOX(2, SCO_TX_ACT, 16, 2),
  335. BT_MBOX(2, SCO_RX_ACT, 18, 2),
  336. BT_MBOX(2, ESCO_RE_TX, 20, 2),
  337. BT_MBOX(2, SCO_DURATION, 24, 6),
  338. };
  339. enum iwl_bt_mxbox_dw3 {
  340. BT_MBOX(3, SCO_STATE, 0, 1),
  341. BT_MBOX(3, SNIFF_STATE, 1, 1),
  342. BT_MBOX(3, A2DP_STATE, 2, 1),
  343. BT_MBOX(3, ACL_STATE, 3, 1),
  344. BT_MBOX(3, MSTR_STATE, 4, 1),
  345. BT_MBOX(3, OBX_STATE, 5, 1),
  346. BT_MBOX(3, OPEN_CON_2, 8, 2),
  347. BT_MBOX(3, TRAFFIC_LOAD, 10, 2),
  348. BT_MBOX(3, CHL_SEQN_LSB, 12, 1),
  349. BT_MBOX(3, INBAND_P, 13, 1),
  350. BT_MBOX(3, MSG_TYPE_2, 16, 3),
  351. BT_MBOX(3, SSN_2, 19, 2),
  352. BT_MBOX(3, UPDATE_REQUEST, 21, 1),
  353. };
  354. #define BT_MBOX_MSG(_notif, _num, _field) \
  355. ((le32_to_cpu((_notif)->mbox_msg[(_num)]) & BT_MBOX##_num##_##_field)\
  356. >> BT_MBOX##_num##_##_field##_POS)
  357. enum iwl_bt_activity_grading {
  358. BT_OFF = 0,
  359. BT_ON_NO_CONNECTION = 1,
  360. BT_LOW_TRAFFIC = 2,
  361. BT_HIGH_TRAFFIC = 3,
  362. BT_MAX_AG,
  363. }; /* BT_COEX_BT_ACTIVITY_GRADING_API_E_VER_1 */
  364. enum iwl_bt_ci_compliance {
  365. BT_CI_COMPLIANCE_NONE = 0,
  366. BT_CI_COMPLIANCE_PRIMARY = 1,
  367. BT_CI_COMPLIANCE_SECONDARY = 2,
  368. BT_CI_COMPLIANCE_BOTH = 3,
  369. }; /* BT_COEX_CI_COMPLIENCE_E_VER_1 */
  370. #define IWL_COEX_IS_TTC_ON(_ttc_rrc_status, _phy_id) \
  371. (_ttc_rrc_status & BIT(_phy_id))
  372. #define IWL_COEX_IS_RRC_ON(_ttc_rrc_status, _phy_id) \
  373. ((_ttc_rrc_status >> 4) & BIT(_phy_id))
  374. /**
  375. * struct iwl_bt_coex_profile_notif - notification about BT coex
  376. * @mbox_msg: message from BT to WiFi
  377. * @msg_idx: the index of the message
  378. * @bt_ci_compliance: enum %iwl_bt_ci_compliance
  379. * @primary_ch_lut: LUT used for primary channel enum %iwl_bt_coex_lut_type
  380. * @secondary_ch_lut: LUT used for secondary channel enume %iwl_bt_coex_lut_type
  381. * @bt_activity_grading: the activity of BT enum %iwl_bt_activity_grading
  382. * @ttc_rrc_status: is TTC or RRC enabled - one bit per PHY
  383. */
  384. struct iwl_bt_coex_profile_notif {
  385. __le32 mbox_msg[4];
  386. __le32 msg_idx;
  387. __le32 bt_ci_compliance;
  388. __le32 primary_ch_lut;
  389. __le32 secondary_ch_lut;
  390. __le32 bt_activity_grading;
  391. u8 ttc_rrc_status;
  392. u8 reserved[3];
  393. } __packed; /* BT_COEX_PROFILE_NTFY_API_S_VER_4 */
  394. enum iwl_bt_coex_prio_table_event {
  395. BT_COEX_PRIO_TBL_EVT_INIT_CALIB1 = 0,
  396. BT_COEX_PRIO_TBL_EVT_INIT_CALIB2 = 1,
  397. BT_COEX_PRIO_TBL_EVT_PERIODIC_CALIB_LOW1 = 2,
  398. BT_COEX_PRIO_TBL_EVT_PERIODIC_CALIB_LOW2 = 3,
  399. BT_COEX_PRIO_TBL_EVT_PERIODIC_CALIB_HIGH1 = 4,
  400. BT_COEX_PRIO_TBL_EVT_PERIODIC_CALIB_HIGH2 = 5,
  401. BT_COEX_PRIO_TBL_EVT_DTIM = 6,
  402. BT_COEX_PRIO_TBL_EVT_SCAN52 = 7,
  403. BT_COEX_PRIO_TBL_EVT_SCAN24 = 8,
  404. BT_COEX_PRIO_TBL_EVT_IDLE = 9,
  405. BT_COEX_PRIO_TBL_EVT_MAX = 16,
  406. }; /* BT_COEX_PRIO_TABLE_EVENTS_API_E_VER_1 */
  407. enum iwl_bt_coex_prio_table_prio {
  408. BT_COEX_PRIO_TBL_DISABLED = 0,
  409. BT_COEX_PRIO_TBL_PRIO_LOW = 1,
  410. BT_COEX_PRIO_TBL_PRIO_HIGH = 2,
  411. BT_COEX_PRIO_TBL_PRIO_BYPASS = 3,
  412. BT_COEX_PRIO_TBL_PRIO_COEX_OFF = 4,
  413. BT_COEX_PRIO_TBL_PRIO_COEX_ON = 5,
  414. BT_COEX_PRIO_TBL_PRIO_COEX_IDLE = 6,
  415. BT_COEX_PRIO_TBL_MAX = 8,
  416. }; /* BT_COEX_PRIO_TABLE_PRIORITIES_API_E_VER_1 */
  417. #define BT_COEX_PRIO_TBL_SHRD_ANT_POS (0)
  418. #define BT_COEX_PRIO_TBL_PRIO_POS (1)
  419. #define BT_COEX_PRIO_TBL_RESERVED_POS (4)
  420. /**
  421. * struct iwl_bt_coex_prio_tbl_cmd - priority table for BT coex
  422. * @prio_tbl:
  423. */
  424. struct iwl_bt_coex_prio_tbl_cmd {
  425. u8 prio_tbl[BT_COEX_PRIO_TBL_EVT_MAX];
  426. } __packed;
  427. /**
  428. * struct iwl_bt_coex_ci_cmd_old - bt coex channel inhibition command
  429. * @bt_primary_ci:
  430. * @bt_secondary_ci:
  431. * @co_run_bw_primary:
  432. * @co_run_bw_secondary:
  433. * @primary_ch_phy_id:
  434. * @secondary_ch_phy_id:
  435. *
  436. * Used for BT_COEX_CI command
  437. */
  438. struct iwl_bt_coex_ci_cmd_old {
  439. __le64 bt_primary_ci;
  440. __le64 bt_secondary_ci;
  441. u8 co_run_bw_primary;
  442. u8 co_run_bw_secondary;
  443. u8 primary_ch_phy_id;
  444. u8 secondary_ch_phy_id;
  445. } __packed; /* BT_CI_MSG_API_S_VER_1 */
  446. /**
  447. * struct iwl_bt_coex_profile_notif_old - notification about BT coex
  448. * @mbox_msg: message from BT to WiFi
  449. * @msg_idx: the index of the message
  450. * @bt_status: 0 - off, 1 - on
  451. * @bt_open_conn: number of BT connections open
  452. * @bt_traffic_load: load of BT traffic
  453. * @bt_agg_traffic_load: aggregated load of BT traffic
  454. * @bt_ci_compliance: 0 - no CI compliance, 1 - CI compliant
  455. * @primary_ch_lut: LUT used for primary channel
  456. * @secondary_ch_lut: LUT used for secondary channel
  457. * @bt_activity_grading: the activity of BT enum %iwl_bt_activity_grading
  458. */
  459. struct iwl_bt_coex_profile_notif_old {
  460. __le32 mbox_msg[4];
  461. __le32 msg_idx;
  462. u8 bt_status;
  463. u8 bt_open_conn;
  464. u8 bt_traffic_load;
  465. u8 bt_agg_traffic_load;
  466. u8 bt_ci_compliance;
  467. u8 ttc_enabled;
  468. u8 rrc_enabled;
  469. u8 reserved;
  470. __le32 primary_ch_lut;
  471. __le32 secondary_ch_lut;
  472. __le32 bt_activity_grading;
  473. } __packed; /* BT_COEX_PROFILE_NTFY_API_S_VER_3 */
  474. #endif /* __fw_api_bt_coex_h__ */