Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[cascardo/linux.git] / drivers / net / wireless / iwlwifi / mvm / fw-api-coex.h
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
65 #ifndef __fw_api_bt_coex_h__
66 #define __fw_api_bt_coex_h__
67
68 #include <linux/types.h>
69 #include <linux/bitops.h>
70
71 #define BITS(nb) (BIT(nb) - 1)
72
73 /**
74  * enum iwl_bt_coex_flags - flags for BT_COEX command
75  * @BT_COEX_MODE_POS:
76  * @BT_COEX_MODE_MSK:
77  * @BT_COEX_DISABLE_OLD:
78  * @BT_COEX_2W_OLD:
79  * @BT_COEX_3W_OLD:
80  * @BT_COEX_NW_OLD:
81  * @BT_COEX_AUTO_OLD:
82  * @BT_COEX_BT_OLD: Antenna is for BT (manufacuring tests)
83  * @BT_COEX_WIFI_OLD: Antenna is for BT (manufacuring tests)
84  * @BT_COEX_SYNC2SCO:
85  * @BT_COEX_CORUNNING:
86  * @BT_COEX_MPLUT:
87  * @BT_COEX_TTC:
88  * @BT_COEX_RRC:
89  *
90  * The COEX_MODE must be set for each command. Even if it is not changed.
91  */
92 enum iwl_bt_coex_flags {
93         BT_COEX_MODE_POS                = 3,
94         BT_COEX_MODE_MSK                = BITS(3) << BT_COEX_MODE_POS,
95         BT_COEX_DISABLE_OLD             = 0x0 << BT_COEX_MODE_POS,
96         BT_COEX_2W_OLD                  = 0x1 << BT_COEX_MODE_POS,
97         BT_COEX_3W_OLD                  = 0x2 << BT_COEX_MODE_POS,
98         BT_COEX_NW_OLD                  = 0x3 << BT_COEX_MODE_POS,
99         BT_COEX_AUTO_OLD                = 0x5 << BT_COEX_MODE_POS,
100         BT_COEX_BT_OLD                  = 0x6 << BT_COEX_MODE_POS,
101         BT_COEX_WIFI_OLD                = 0x7 << BT_COEX_MODE_POS,
102         BT_COEX_SYNC2SCO                = BIT(7),
103         BT_COEX_CORUNNING               = BIT(8),
104         BT_COEX_MPLUT                   = BIT(9),
105         BT_COEX_TTC                     = BIT(20),
106         BT_COEX_RRC                     = BIT(21),
107 };
108
109 /*
110  * indicates what has changed in the BT_COEX command.
111  * BT_VALID_ENABLE must be set for each command. Commands without this bit will
112  * discarded by the firmware
113  */
114 enum iwl_bt_coex_valid_bit_msk {
115         BT_VALID_ENABLE                 = BIT(0),
116         BT_VALID_BT_PRIO_BOOST          = BIT(1),
117         BT_VALID_MAX_KILL               = BIT(2),
118         BT_VALID_3W_TMRS                = BIT(3),
119         BT_VALID_KILL_ACK               = BIT(4),
120         BT_VALID_KILL_CTS               = BIT(5),
121         BT_VALID_REDUCED_TX_POWER       = BIT(6),
122         BT_VALID_LUT                    = BIT(7),
123         BT_VALID_WIFI_RX_SW_PRIO_BOOST  = BIT(8),
124         BT_VALID_WIFI_TX_SW_PRIO_BOOST  = BIT(9),
125         BT_VALID_MULTI_PRIO_LUT         = BIT(10),
126         BT_VALID_TRM_KICK_FILTER        = BIT(11),
127         BT_VALID_CORUN_LUT_20           = BIT(12),
128         BT_VALID_CORUN_LUT_40           = BIT(13),
129         BT_VALID_ANT_ISOLATION          = BIT(14),
130         BT_VALID_ANT_ISOLATION_THRS     = BIT(15),
131         BT_VALID_TXTX_DELTA_FREQ_THRS   = BIT(16),
132         BT_VALID_TXRX_MAX_FREQ_0        = BIT(17),
133         BT_VALID_SYNC_TO_SCO            = BIT(18),
134         BT_VALID_TTC                    = BIT(20),
135         BT_VALID_RRC                    = BIT(21),
136 };
137
138 /**
139  * enum iwl_bt_reduced_tx_power - allows to reduce txpower for WiFi frames.
140  * @BT_REDUCED_TX_POWER_CTL: reduce Tx power for control frames
141  * @BT_REDUCED_TX_POWER_DATA: reduce Tx power for data frames
142  *
143  * This mechanism allows to have BT and WiFi run concurrently. Since WiFi
144  * reduces its Tx power, it can work along with BT, hence reducing the amount
145  * of WiFi frames being killed by BT.
146  */
147 enum iwl_bt_reduced_tx_power {
148         BT_REDUCED_TX_POWER_CTL         = BIT(0),
149         BT_REDUCED_TX_POWER_DATA        = BIT(1),
150 };
151
152 enum iwl_bt_coex_lut_type {
153         BT_COEX_TIGHT_LUT = 0,
154         BT_COEX_LOOSE_LUT,
155         BT_COEX_TX_DIS_LUT,
156
157         BT_COEX_MAX_LUT,
158         BT_COEX_INVALID_LUT = 0xff,
159 }; /* BT_COEX_DECISION_LUT_INDEX_API_E_VER_1 */
160
161 #define BT_COEX_LUT_SIZE (12)
162 #define BT_COEX_CORUN_LUT_SIZE (32)
163 #define BT_COEX_MULTI_PRIO_LUT_SIZE (2)
164 #define BT_COEX_BOOST_SIZE (4)
165 #define BT_REDUCED_TX_POWER_BIT BIT(7)
166
167 /**
168  * struct iwl_bt_coex_cmd_old - bt coex configuration command
169  * @flags:&enum iwl_bt_coex_flags
170  * @max_kill:
171  * @bt_reduced_tx_power: enum %iwl_bt_reduced_tx_power
172  * @override_primary_lut: enum %iwl_bt_coex_lut_type: BT_COEX_INVALID_LUT
173  *      should be set by default
174  * @override_secondary_lut: enum %iwl_bt_coex_lut_type: BT_COEX_INVALID_LUT
175  *      should be set by default
176  * @bt4_antenna_isolation: antenna isolation
177  * @bt4_antenna_isolation_thr: antenna threshold value
178  * @bt4_tx_tx_delta_freq_thr: TxTx delta frequency
179  * @bt4_tx_rx_max_freq0: TxRx max frequency
180  * @bt_prio_boost: BT priority boost registers
181  * @wifi_tx_prio_boost: SW boost of wifi tx priority
182  * @wifi_rx_prio_boost: SW boost of wifi rx priority
183  * @kill_ack_msk: kill ACK mask. 1 - Tx ACK, 0 - kill Tx of ACK.
184  * @kill_cts_msk: kill CTS mask. 1 - Tx CTS, 0 - kill Tx of CTS.
185  * @decision_lut: PTA decision LUT, per Prio-Ch
186  * @bt4_multiprio_lut: multi priority LUT configuration
187  * @bt4_corun_lut20: co-running 20 MHz LUT configuration
188  * @bt4_corun_lut40: co-running 40 MHz LUT configuration
189  * @valid_bit_msk: enum %iwl_bt_coex_valid_bit_msk
190  *
191  * The structure is used for the BT_COEX command.
192  */
193 struct iwl_bt_coex_cmd_old {
194         __le32 flags;
195         u8 max_kill;
196         u8 bt_reduced_tx_power;
197         u8 override_primary_lut;
198         u8 override_secondary_lut;
199
200         u8 bt4_antenna_isolation;
201         u8 bt4_antenna_isolation_thr;
202         u8 bt4_tx_tx_delta_freq_thr;
203         u8 bt4_tx_rx_max_freq0;
204
205         __le32 bt_prio_boost[BT_COEX_BOOST_SIZE];
206         __le32 wifi_tx_prio_boost;
207         __le32 wifi_rx_prio_boost;
208         __le32 kill_ack_msk;
209         __le32 kill_cts_msk;
210
211         __le32 decision_lut[BT_COEX_MAX_LUT][BT_COEX_LUT_SIZE];
212         __le32 bt4_multiprio_lut[BT_COEX_MULTI_PRIO_LUT_SIZE];
213         __le32 bt4_corun_lut20[BT_COEX_CORUN_LUT_SIZE];
214         __le32 bt4_corun_lut40[BT_COEX_CORUN_LUT_SIZE];
215
216         __le32 valid_bit_msk;
217 } __packed; /* BT_COEX_CMD_API_S_VER_5 */
218
219 enum iwl_bt_coex_mode {
220         BT_COEX_DISABLE                 = 0x0,
221         BT_COEX_NW                      = 0x1,
222         BT_COEX_BT                      = 0x2,
223         BT_COEX_WIFI                    = 0x3,
224 }; /* BT_COEX_MODES_E */
225
226 enum iwl_bt_coex_enabled_modules {
227         BT_COEX_MPLUT_ENABLED           = BIT(0),
228         BT_COEX_MPLUT_BOOST_ENABLED     = BIT(1),
229         BT_COEX_SYNC2SCO_ENABLED        = BIT(2),
230         BT_COEX_CORUN_ENABLED           = BIT(3),
231         BT_COEX_HIGH_BAND_RET           = BIT(4),
232 }; /* BT_COEX_MODULES_ENABLE_E_VER_1 */
233
234 /**
235  * struct iwl_bt_coex_cmd - bt coex configuration command
236  * @mode: enum %iwl_bt_coex_mode
237  * @enabled_modules: enum %iwl_bt_coex_enabled_modules
238  * @max_kill: max count of Tx retries due to kill from PTA
239  * @override_primary_lut: enum %iwl_bt_coex_lut_type: BT_COEX_INVALID_LUT
240  *      should be set by default
241  * @override_secondary_lut: enum %iwl_bt_coex_lut_type: BT_COEX_INVALID_LUT
242  *      should be set by default
243  * @bt4_antenna_isolation_thr: antenna threshold value
244  * @bt4_tx_tx_delta_freq_thr: TxTx delta frequency
245  * @bt4_tx_rx_max_freq0: TxRx max frequency
246  * @multiprio_lut: multi priority LUT configuration
247  * @mplut_prio_boost: BT priority boost registers
248  * @decision_lut: PTA decision LUT, per Prio-Ch
249  *
250  * The structure is used for the BT_COEX command.
251  */
252 struct iwl_bt_coex_cmd {
253         __le32 mode;
254         __le32 enabled_modules;
255
256         __le32 max_kill;
257         __le32 override_primary_lut;
258         __le32 override_secondary_lut;
259         __le32 bt4_antenna_isolation_thr;
260
261         __le32 bt4_tx_tx_delta_freq_thr;
262         __le32 bt4_tx_rx_max_freq0;
263
264         __le32 multiprio_lut[BT_COEX_MULTI_PRIO_LUT_SIZE];
265         __le32 mplut_prio_boost[BT_COEX_BOOST_SIZE];
266
267         __le32 decision_lut[BT_COEX_MAX_LUT][BT_COEX_LUT_SIZE];
268 } __packed; /* BT_COEX_CMD_API_S_VER_6 */
269
270 /**
271  * struct iwl_bt_coex_corun_lut_update - bt coex update the corun lut
272  * @corun_lut20: co-running 20 MHz LUT configuration
273  * @corun_lut40: co-running 40 MHz LUT configuration
274  *
275  * The structure is used for the BT_COEX_UPDATE_CORUN_LUT command.
276  */
277 struct iwl_bt_coex_corun_lut_update_cmd {
278         __le32 corun_lut20[BT_COEX_CORUN_LUT_SIZE];
279         __le32 corun_lut40[BT_COEX_CORUN_LUT_SIZE];
280 } __packed; /* BT_COEX_UPDATE_CORUN_LUT_API_S_VER_1 */
281
282 /**
283  * struct iwl_bt_coex_sw_boost - SW boost values
284  * @wifi_tx_prio_boost: SW boost of wifi tx priority
285  * @wifi_rx_prio_boost: SW boost of wifi rx priority
286  * @kill_ack_msk: kill ACK mask. 1 - Tx ACK, 0 - kill Tx of ACK.
287  * @kill_cts_msk: kill CTS mask. 1 - Tx CTS, 0 - kill Tx of CTS.
288  */
289 struct iwl_bt_coex_sw_boost {
290         __le32 wifi_tx_prio_boost;
291         __le32 wifi_rx_prio_boost;
292         __le32 kill_ack_msk;
293         __le32 kill_cts_msk;
294 };
295
296 /**
297  * struct iwl_bt_coex_sw_boost_update_cmd - command to update the SW boost
298  * @boost_values: check struct  %iwl_bt_coex_sw_boost - one for each channel
299  *      primary / secondary / low priority
300  */
301 struct iwl_bt_coex_sw_boost_update_cmd {
302         struct iwl_bt_coex_sw_boost boost_values[3];
303 } __packed; /* BT_COEX_UPDATE_SW_BOOST_S_VER_1 */
304
305 /**
306  * struct iwl_bt_coex_reduced_txp_update_cmd
307  * @reduced_txp: bit BT_REDUCED_TX_POWER_BIT to enable / disable, rest of the
308  *      bits are the sta_id (value)
309  */
310 struct iwl_bt_coex_reduced_txp_update_cmd {
311         __le32 reduced_txp;
312 } __packed; /* BT_COEX_UPDATE_REDUCED_TX_POWER_API_S_VER_1 */
313
314 /**
315  * struct iwl_bt_coex_ci_cmd - bt coex channel inhibition command
316  * @bt_primary_ci:
317  * @primary_ch_phy_id:
318  * @bt_secondary_ci:
319  * @secondary_ch_phy_id:
320  *
321  * Used for BT_COEX_CI command
322  */
323 struct iwl_bt_coex_ci_cmd {
324         __le64 bt_primary_ci;
325         __le32 primary_ch_phy_id;
326
327         __le64 bt_secondary_ci;
328         __le32 secondary_ch_phy_id;
329 } __packed; /* BT_CI_MSG_API_S_VER_2 */
330
331 #define BT_MBOX(n_dw, _msg, _pos, _nbits)       \
332         BT_MBOX##n_dw##_##_msg##_POS = (_pos),  \
333         BT_MBOX##n_dw##_##_msg = BITS(_nbits) << BT_MBOX##n_dw##_##_msg##_POS
334
335 enum iwl_bt_mxbox_dw0 {
336         BT_MBOX(0, LE_SLAVE_LAT, 0, 3),
337         BT_MBOX(0, LE_PROF1, 3, 1),
338         BT_MBOX(0, LE_PROF2, 4, 1),
339         BT_MBOX(0, LE_PROF_OTHER, 5, 1),
340         BT_MBOX(0, CHL_SEQ_N, 8, 4),
341         BT_MBOX(0, INBAND_S, 13, 1),
342         BT_MBOX(0, LE_MIN_RSSI, 16, 4),
343         BT_MBOX(0, LE_SCAN, 20, 1),
344         BT_MBOX(0, LE_ADV, 21, 1),
345         BT_MBOX(0, LE_MAX_TX_POWER, 24, 4),
346         BT_MBOX(0, OPEN_CON_1, 28, 2),
347 };
348
349 enum iwl_bt_mxbox_dw1 {
350         BT_MBOX(1, BR_MAX_TX_POWER, 0, 4),
351         BT_MBOX(1, IP_SR, 4, 1),
352         BT_MBOX(1, LE_MSTR, 5, 1),
353         BT_MBOX(1, AGGR_TRFC_LD, 8, 6),
354         BT_MBOX(1, MSG_TYPE, 16, 3),
355         BT_MBOX(1, SSN, 19, 2),
356 };
357
358 enum iwl_bt_mxbox_dw2 {
359         BT_MBOX(2, SNIFF_ACT, 0, 3),
360         BT_MBOX(2, PAG, 3, 1),
361         BT_MBOX(2, INQUIRY, 4, 1),
362         BT_MBOX(2, CONN, 5, 1),
363         BT_MBOX(2, SNIFF_INTERVAL, 8, 5),
364         BT_MBOX(2, DISC, 13, 1),
365         BT_MBOX(2, SCO_TX_ACT, 16, 2),
366         BT_MBOX(2, SCO_RX_ACT, 18, 2),
367         BT_MBOX(2, ESCO_RE_TX, 20, 2),
368         BT_MBOX(2, SCO_DURATION, 24, 6),
369 };
370
371 enum iwl_bt_mxbox_dw3 {
372         BT_MBOX(3, SCO_STATE, 0, 1),
373         BT_MBOX(3, SNIFF_STATE, 1, 1),
374         BT_MBOX(3, A2DP_STATE, 2, 1),
375         BT_MBOX(3, ACL_STATE, 3, 1),
376         BT_MBOX(3, MSTR_STATE, 4, 1),
377         BT_MBOX(3, OBX_STATE, 5, 1),
378         BT_MBOX(3, OPEN_CON_2, 8, 2),
379         BT_MBOX(3, TRAFFIC_LOAD, 10, 2),
380         BT_MBOX(3, CHL_SEQN_LSB, 12, 1),
381         BT_MBOX(3, INBAND_P, 13, 1),
382         BT_MBOX(3, MSG_TYPE_2, 16, 3),
383         BT_MBOX(3, SSN_2, 19, 2),
384         BT_MBOX(3, UPDATE_REQUEST, 21, 1),
385 };
386
387 #define BT_MBOX_MSG(_notif, _num, _field)                                    \
388         ((le32_to_cpu((_notif)->mbox_msg[(_num)]) & BT_MBOX##_num##_##_field)\
389         >> BT_MBOX##_num##_##_field##_POS)
390
391 enum iwl_bt_activity_grading {
392         BT_OFF                  = 0,
393         BT_ON_NO_CONNECTION     = 1,
394         BT_LOW_TRAFFIC          = 2,
395         BT_HIGH_TRAFFIC         = 3,
396
397         BT_MAX_AG,
398 }; /* BT_COEX_BT_ACTIVITY_GRADING_API_E_VER_1 */
399
400 enum iwl_bt_ci_compliance {
401         BT_CI_COMPLIANCE_NONE           = 0,
402         BT_CI_COMPLIANCE_PRIMARY        = 1,
403         BT_CI_COMPLIANCE_SECONDARY      = 2,
404         BT_CI_COMPLIANCE_BOTH           = 3,
405 }; /* BT_COEX_CI_COMPLIENCE_E_VER_1 */
406
407 #define IWL_COEX_IS_TTC_ON(_ttc_rrc_status, _phy_id)    \
408                 (_ttc_rrc_status & BIT(_phy_id))
409
410 #define IWL_COEX_IS_RRC_ON(_ttc_rrc_status, _phy_id)    \
411                 ((_ttc_rrc_status >> 4) & BIT(_phy_id))
412
413 /**
414  * struct iwl_bt_coex_profile_notif - notification about BT coex
415  * @mbox_msg: message from BT to WiFi
416  * @msg_idx: the index of the message
417  * @bt_ci_compliance: enum %iwl_bt_ci_compliance
418  * @primary_ch_lut: LUT used for primary channel enum %iwl_bt_coex_lut_type
419  * @secondary_ch_lut: LUT used for secondary channel enume %iwl_bt_coex_lut_type
420  * @bt_activity_grading: the activity of BT enum %iwl_bt_activity_grading
421  * @ttc_rrc_status: is TTC or RRC enabled - one bit per PHY
422  */
423 struct iwl_bt_coex_profile_notif {
424         __le32 mbox_msg[4];
425         __le32 msg_idx;
426         __le32 bt_ci_compliance;
427
428         __le32 primary_ch_lut;
429         __le32 secondary_ch_lut;
430         __le32 bt_activity_grading;
431         u8 ttc_rrc_status;
432         u8 reserved[3];
433 } __packed; /* BT_COEX_PROFILE_NTFY_API_S_VER_4 */
434
435 enum iwl_bt_coex_prio_table_event {
436         BT_COEX_PRIO_TBL_EVT_INIT_CALIB1                = 0,
437         BT_COEX_PRIO_TBL_EVT_INIT_CALIB2                = 1,
438         BT_COEX_PRIO_TBL_EVT_PERIODIC_CALIB_LOW1        = 2,
439         BT_COEX_PRIO_TBL_EVT_PERIODIC_CALIB_LOW2        = 3,
440         BT_COEX_PRIO_TBL_EVT_PERIODIC_CALIB_HIGH1       = 4,
441         BT_COEX_PRIO_TBL_EVT_PERIODIC_CALIB_HIGH2       = 5,
442         BT_COEX_PRIO_TBL_EVT_DTIM                       = 6,
443         BT_COEX_PRIO_TBL_EVT_SCAN52                     = 7,
444         BT_COEX_PRIO_TBL_EVT_SCAN24                     = 8,
445         BT_COEX_PRIO_TBL_EVT_IDLE                       = 9,
446         BT_COEX_PRIO_TBL_EVT_MAX                        = 16,
447 }; /* BT_COEX_PRIO_TABLE_EVENTS_API_E_VER_1 */
448
449 enum iwl_bt_coex_prio_table_prio {
450         BT_COEX_PRIO_TBL_DISABLED       = 0,
451         BT_COEX_PRIO_TBL_PRIO_LOW       = 1,
452         BT_COEX_PRIO_TBL_PRIO_HIGH      = 2,
453         BT_COEX_PRIO_TBL_PRIO_BYPASS    = 3,
454         BT_COEX_PRIO_TBL_PRIO_COEX_OFF  = 4,
455         BT_COEX_PRIO_TBL_PRIO_COEX_ON   = 5,
456         BT_COEX_PRIO_TBL_PRIO_COEX_IDLE = 6,
457         BT_COEX_PRIO_TBL_MAX            = 8,
458 }; /* BT_COEX_PRIO_TABLE_PRIORITIES_API_E_VER_1 */
459
460 #define BT_COEX_PRIO_TBL_SHRD_ANT_POS     (0)
461 #define BT_COEX_PRIO_TBL_PRIO_POS         (1)
462 #define BT_COEX_PRIO_TBL_RESERVED_POS     (4)
463
464 /**
465  * struct iwl_bt_coex_prio_tbl_cmd - priority table for BT coex
466  * @prio_tbl:
467  */
468 struct iwl_bt_coex_prio_tbl_cmd {
469         u8 prio_tbl[BT_COEX_PRIO_TBL_EVT_MAX];
470 } __packed;
471
472 /**
473  * struct iwl_bt_coex_ci_cmd_old - bt coex channel inhibition command
474  * @bt_primary_ci:
475  * @bt_secondary_ci:
476  * @co_run_bw_primary:
477  * @co_run_bw_secondary:
478  * @primary_ch_phy_id:
479  * @secondary_ch_phy_id:
480  *
481  * Used for BT_COEX_CI command
482  */
483 struct iwl_bt_coex_ci_cmd_old {
484         __le64 bt_primary_ci;
485         __le64 bt_secondary_ci;
486
487         u8 co_run_bw_primary;
488         u8 co_run_bw_secondary;
489         u8 primary_ch_phy_id;
490         u8 secondary_ch_phy_id;
491 } __packed; /* BT_CI_MSG_API_S_VER_1 */
492
493 /**
494  * struct iwl_bt_coex_profile_notif_old - notification about BT coex
495  * @mbox_msg: message from BT to WiFi
496  * @msg_idx: the index of the message
497  * @bt_status: 0 - off, 1 - on
498  * @bt_open_conn: number of BT connections open
499  * @bt_traffic_load: load of BT traffic
500  * @bt_agg_traffic_load: aggregated load of BT traffic
501  * @bt_ci_compliance: 0 - no CI compliance, 1 - CI compliant
502  * @primary_ch_lut: LUT used for primary channel
503  * @secondary_ch_lut: LUT used for secondary channel
504  * @bt_activity_grading: the activity of BT enum %iwl_bt_activity_grading
505  */
506 struct iwl_bt_coex_profile_notif_old {
507         __le32 mbox_msg[4];
508         __le32 msg_idx;
509         u8 bt_status;
510         u8 bt_open_conn;
511         u8 bt_traffic_load;
512         u8 bt_agg_traffic_load;
513         u8 bt_ci_compliance;
514         u8 ttc_enabled;
515         u8 rrc_enabled;
516         u8 reserved;
517
518         __le32 primary_ch_lut;
519         __le32 secondary_ch_lut;
520         __le32 bt_activity_grading;
521 } __packed; /* BT_COEX_PROFILE_NTFY_API_S_VER_3 */
522
523 #endif /* __fw_api_bt_coex_h__ */