aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm/fw-api-bt-coex.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/fw-api-bt-coex.h')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/fw-api-bt-coex.h149
1 files changed, 95 insertions, 54 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api-bt-coex.h b/drivers/net/wireless/iwlwifi/mvm/fw-api-bt-coex.h
index 05c61d6f384e..4ea5e24ca92d 100644
--- a/drivers/net/wireless/iwlwifi/mvm/fw-api-bt-coex.h
+++ b/drivers/net/wireless/iwlwifi/mvm/fw-api-bt-coex.h
@@ -82,6 +82,8 @@
82 * @BT_USE_DEFAULTS: 82 * @BT_USE_DEFAULTS:
83 * @BT_SYNC_2_BT_DISABLE: 83 * @BT_SYNC_2_BT_DISABLE:
84 * @BT_COEX_CORUNNING_TBL_EN: 84 * @BT_COEX_CORUNNING_TBL_EN:
85 *
86 * The COEX_MODE must be set for each command. Even if it is not changed.
85 */ 87 */
86enum iwl_bt_coex_flags { 88enum iwl_bt_coex_flags {
87 BT_CH_PRIMARY_EN = BIT(0), 89 BT_CH_PRIMARY_EN = BIT(0),
@@ -95,14 +97,16 @@ enum iwl_bt_coex_flags {
95 BT_COEX_NW = 0x3 << BT_COEX_MODE_POS, 97 BT_COEX_NW = 0x3 << BT_COEX_MODE_POS,
96 BT_USE_DEFAULTS = BIT(6), 98 BT_USE_DEFAULTS = BIT(6),
97 BT_SYNC_2_BT_DISABLE = BIT(7), 99 BT_SYNC_2_BT_DISABLE = BIT(7),
98 /* 100 BT_COEX_CORUNNING_TBL_EN = BIT(8),
99 * For future use - when the flags will be enlarged 101 BT_COEX_MPLUT_TBL_EN = BIT(9),
100 * BT_COEX_CORUNNING_TBL_EN = BIT(8), 102 /* Bit 10 is reserved */
101 */ 103 BT_COEX_WF_PRIO_BOOST_CHECK_EN = BIT(11),
102}; 104};
103 105
104/* 106/*
105 * indicates what has changed in the BT_COEX command. 107 * indicates what has changed in the BT_COEX command.
108 * BT_VALID_ENABLE must be set for each command. Commands without this bit will
109 * discarded by the firmware
106 */ 110 */
107enum iwl_bt_coex_valid_bit_msk { 111enum iwl_bt_coex_valid_bit_msk {
108 BT_VALID_ENABLE = BIT(0), 112 BT_VALID_ENABLE = BIT(0),
@@ -121,11 +125,8 @@ enum iwl_bt_coex_valid_bit_msk {
121 BT_VALID_CORUN_LUT_40 = BIT(13), 125 BT_VALID_CORUN_LUT_40 = BIT(13),
122 BT_VALID_ANT_ISOLATION = BIT(14), 126 BT_VALID_ANT_ISOLATION = BIT(14),
123 BT_VALID_ANT_ISOLATION_THRS = BIT(15), 127 BT_VALID_ANT_ISOLATION_THRS = BIT(15),
124 /* 128 BT_VALID_TXTX_DELTA_FREQ_THRS = BIT(16),
125 * For future use - when the valid flags will be enlarged 129 BT_VALID_TXRX_MAX_FREQ_0 = BIT(17),
126 * BT_VALID_TXTX_DELTA_FREQ_THRS = BIT(16),
127 * BT_VALID_TXRX_MAX_FREQ_0 = BIT(17),
128 */
129}; 130};
130 131
131/** 132/**
@@ -142,48 +143,88 @@ enum iwl_bt_reduced_tx_power {
142 BT_REDUCED_TX_POWER_DATA = BIT(1), 143 BT_REDUCED_TX_POWER_DATA = BIT(1),
143}; 144};
144 145
146enum iwl_bt_coex_lut_type {
147 BT_COEX_TIGHT_LUT = 0,
148 BT_COEX_LOOSE_LUT,
149 BT_COEX_TX_DIS_LUT,
150
151 BT_COEX_MAX_LUT,
152};
153
145#define BT_COEX_LUT_SIZE (12) 154#define BT_COEX_LUT_SIZE (12)
155#define BT_COEX_CORUN_LUT_SIZE (32)
156#define BT_COEX_MULTI_PRIO_LUT_SIZE (2)
157#define BT_COEX_BOOST_SIZE (4)
158#define BT_REDUCED_TX_POWER_BIT BIT(7)
146 159
147/** 160/**
148 * struct iwl_bt_coex_cmd - bt coex configuration command 161 * struct iwl_bt_coex_cmd - bt coex configuration command
149 * @flags:&enum iwl_bt_coex_flags 162 * @flags:&enum iwl_bt_coex_flags
150 * @lead_time:
151 * @max_kill: 163 * @max_kill:
152 * @bt3_time_t7_value:
153 * @kill_ack_msk:
154 * @kill_cts_msk:
155 * @bt3_prio_sample_time:
156 * @bt3_timer_t2_value:
157 * @bt4_reaction_time:
158 * @decision_lut[12]:
159 * @bt_reduced_tx_power: enum %iwl_bt_reduced_tx_power 164 * @bt_reduced_tx_power: enum %iwl_bt_reduced_tx_power
160 * @valid_bit_msk: enum %iwl_bt_coex_valid_bit_msk 165 * @bt4_antenna_isolation:
161 * @bt_prio_boost: values for PTA boost register 166 * @bt4_antenna_isolation_thr:
167 * @bt4_tx_tx_delta_freq_thr:
168 * @bt4_tx_rx_max_freq0:
169 * @bt_prio_boost:
162 * @wifi_tx_prio_boost: SW boost of wifi tx priority 170 * @wifi_tx_prio_boost: SW boost of wifi tx priority
163 * @wifi_rx_prio_boost: SW boost of wifi rx priority 171 * @wifi_rx_prio_boost: SW boost of wifi rx priority
172 * @kill_ack_msk:
173 * @kill_cts_msk:
174 * @decision_lut:
175 * @bt4_multiprio_lut:
176 * @bt4_corun_lut20:
177 * @bt4_corun_lut40:
178 * @valid_bit_msk: enum %iwl_bt_coex_valid_bit_msk
164 * 179 *
165 * The structure is used for the BT_COEX command. 180 * The structure is used for the BT_COEX command.
166 */ 181 */
167struct iwl_bt_coex_cmd { 182struct iwl_bt_coex_cmd {
168 u8 flags; 183 __le32 flags;
169 u8 lead_time;
170 u8 max_kill; 184 u8 max_kill;
171 u8 bt3_time_t7_value; 185 u8 bt_reduced_tx_power;
186 u8 reserved[2];
187
188 u8 bt4_antenna_isolation;
189 u8 bt4_antenna_isolation_thr;
190 u8 bt4_tx_tx_delta_freq_thr;
191 u8 bt4_tx_rx_max_freq0;
192
193 __le32 bt_prio_boost[BT_COEX_BOOST_SIZE];
194 __le32 wifi_tx_prio_boost;
195 __le32 wifi_rx_prio_boost;
172 __le32 kill_ack_msk; 196 __le32 kill_ack_msk;
173 __le32 kill_cts_msk; 197 __le32 kill_cts_msk;
174 u8 bt3_prio_sample_time; 198
175 u8 bt3_timer_t2_value; 199 __le32 decision_lut[BT_COEX_MAX_LUT][BT_COEX_LUT_SIZE];
176 __le16 bt4_reaction_time; 200 __le32 bt4_multiprio_lut[BT_COEX_MULTI_PRIO_LUT_SIZE];
177 __le32 decision_lut[BT_COEX_LUT_SIZE]; 201 __le32 bt4_corun_lut20[BT_COEX_CORUN_LUT_SIZE];
178 u8 bt_reduced_tx_power; 202 __le32 bt4_corun_lut40[BT_COEX_CORUN_LUT_SIZE];
179 u8 reserved; 203
180 __le16 valid_bit_msk; 204 __le32 valid_bit_msk;
181 __le32 bt_prio_boost;
182 u8 reserved2;
183 u8 wifi_tx_prio_boost;
184 __le16 wifi_rx_prio_boost;
185} __packed; /* BT_COEX_CMD_API_S_VER_3 */ 205} __packed; /* BT_COEX_CMD_API_S_VER_3 */
186 206
207/**
208 * struct iwl_bt_coex_ci_cmd - bt coex channel inhibition command
209 * @bt_primary_ci:
210 * @bt_secondary_ci:
211 * @co_run_bw_primary:
212 * @co_run_bw_secondary:
213 * @primary_ch_phy_id:
214 * @secondary_ch_phy_id:
215 *
216 * Used for BT_COEX_CI command
217 */
218struct iwl_bt_coex_ci_cmd {
219 __le64 bt_primary_ci;
220 __le64 bt_secondary_ci;
221
222 u8 co_run_bw_primary;
223 u8 co_run_bw_secondary;
224 u8 primary_ch_phy_id;
225 u8 secondary_ch_phy_id;
226} __packed; /* BT_CI_MSG_API_S_VER_1 */
227
187#define BT_MBOX(n_dw, _msg, _pos, _nbits) \ 228#define BT_MBOX(n_dw, _msg, _pos, _nbits) \
188 BT_MBOX##n_dw##_##_msg##_POS = (_pos), \ 229 BT_MBOX##n_dw##_##_msg##_POS = (_pos), \
189 BT_MBOX##n_dw##_##_msg = BITS(_nbits) << BT_MBOX##n_dw##_##_msg##_POS 230 BT_MBOX##n_dw##_##_msg = BITS(_nbits) << BT_MBOX##n_dw##_##_msg##_POS
@@ -244,23 +285,39 @@ enum iwl_bt_mxbox_dw3 {
244 ((le32_to_cpu((_notif)->mbox_msg[(_num)]) & BT_MBOX##_num##_##_field)\ 285 ((le32_to_cpu((_notif)->mbox_msg[(_num)]) & BT_MBOX##_num##_##_field)\
245 >> BT_MBOX##_num##_##_field##_POS) 286 >> BT_MBOX##_num##_##_field##_POS)
246 287
288enum iwl_bt_activity_grading {
289 BT_OFF = 0,
290 BT_ON_NO_CONNECTION = 1,
291 BT_LOW_TRAFFIC = 2,
292 BT_HIGH_TRAFFIC = 3,
293};
294
247/** 295/**
248 * struct iwl_bt_coex_profile_notif - notification about BT coex 296 * struct iwl_bt_coex_profile_notif - notification about BT coex
249 * @mbox_msg: message from BT to WiFi 297 * @mbox_msg: message from BT to WiFi
250 * @:bt_status: 0 - off, 1 - on 298 * @msg_idx: the index of the message
251 * @:bt_open_conn: number of BT connections open 299 * @bt_status: 0 - off, 1 - on
252 * @:bt_traffic_load: load of BT traffic 300 * @bt_open_conn: number of BT connections open
253 * @:bt_agg_traffic_load: aggregated load of BT traffic 301 * @bt_traffic_load: load of BT traffic
254 * @:bt_ci_compliance: 0 - no CI compliance, 1 - CI compliant 302 * @bt_agg_traffic_load: aggregated load of BT traffic
303 * @bt_ci_compliance: 0 - no CI compliance, 1 - CI compliant
304 * @primary_ch_lut: LUT used for primary channel
305 * @secondary_ch_lut: LUT used for secondary channel
306 * @bt_activity_grading: the activity of BT enum %iwl_bt_activity_grading
255 */ 307 */
256struct iwl_bt_coex_profile_notif { 308struct iwl_bt_coex_profile_notif {
257 __le32 mbox_msg[4]; 309 __le32 mbox_msg[4];
310 __le32 msg_idx;
258 u8 bt_status; 311 u8 bt_status;
259 u8 bt_open_conn; 312 u8 bt_open_conn;
260 u8 bt_traffic_load; 313 u8 bt_traffic_load;
261 u8 bt_agg_traffic_load; 314 u8 bt_agg_traffic_load;
262 u8 bt_ci_compliance; 315 u8 bt_ci_compliance;
263 u8 reserved[3]; 316 u8 reserved[3];
317
318 __le32 primary_ch_lut;
319 __le32 secondary_ch_lut;
320 __le32 bt_activity_grading;
264} __packed; /* BT_COEX_PROFILE_NTFY_API_S_VER_2 */ 321} __packed; /* BT_COEX_PROFILE_NTFY_API_S_VER_2 */
265 322
266enum iwl_bt_coex_prio_table_event { 323enum iwl_bt_coex_prio_table_event {
@@ -300,20 +357,4 @@ struct iwl_bt_coex_prio_tbl_cmd {
300 u8 prio_tbl[BT_COEX_PRIO_TBL_EVT_MAX]; 357 u8 prio_tbl[BT_COEX_PRIO_TBL_EVT_MAX];
301} __packed; 358} __packed;
302 359
303enum iwl_bt_coex_env_action {
304 BT_COEX_ENV_CLOSE = 0,
305 BT_COEX_ENV_OPEN = 1,
306}; /* BT_COEX_PROT_ENV_ACTION_API_E_VER_1 */
307
308/**
309 * struct iwl_bt_coex_prot_env_cmd - BT Protection Envelope
310 * @action: enum %iwl_bt_coex_env_action
311 * @type: enum %iwl_bt_coex_prio_table_event
312 */
313struct iwl_bt_coex_prot_env_cmd {
314 u8 action; /* 0 = closed, 1 = open */
315 u8 type; /* 0 .. 15 */
316 u8 reserved[2];
317} __packed;
318
319#endif /* __fw_api_bt_coex_h__ */ 360#endif /* __fw_api_bt_coex_h__ */