aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/bt-coex.c3
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/debugfs.c100
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mvm.h1
3 files changed, 104 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/bt-coex.c b/drivers/net/wireless/iwlwifi/mvm/bt-coex.c
index fa054b364e52..47954deb6493 100644
--- a/drivers/net/wireless/iwlwifi/mvm/bt-coex.c
+++ b/drivers/net/wireless/iwlwifi/mvm/bt-coex.c
@@ -307,6 +307,9 @@ int iwl_mvm_rx_bt_coex_notif(struct iwl_mvm *mvm,
307 notif->bt_agg_traffic_load); 307 notif->bt_agg_traffic_load);
308 IWL_DEBUG_COEX(mvm, "\tBT ci compliance %d\n", notif->bt_ci_compliance); 308 IWL_DEBUG_COEX(mvm, "\tBT ci compliance %d\n", notif->bt_ci_compliance);
309 309
310 /* remember this notification for future use: rssi fluctuations */
311 memcpy(&mvm->last_bt_notif, notif, sizeof(mvm->last_bt_notif));
312
310 ieee80211_iterate_active_interfaces_atomic( 313 ieee80211_iterate_active_interfaces_atomic(
311 mvm->hw, IEEE80211_IFACE_ITER_NORMAL, 314 mvm->hw, IEEE80211_IFACE_ITER_NORMAL,
312 iwl_mvm_bt_notif_iterator, &data); 315 iwl_mvm_bt_notif_iterator, &data);
diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/iwlwifi/mvm/debugfs.c
index 2ad301164bd9..56bf601f8991 100644
--- a/drivers/net/wireless/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/iwlwifi/mvm/debugfs.c
@@ -300,6 +300,104 @@ static ssize_t iwl_dbgfs_power_down_d3_allow_write(struct file *file,
300 return count; 300 return count;
301} 301}
302 302
303#define BT_MBOX_MSG(_notif, _num, _field) \
304 ((le32_to_cpu((_notif)->mbox_msg[(_num)]) & BT_MBOX##_num##_##_field)\
305 >> BT_MBOX##_num##_##_field##_POS)
306
307
308#define BT_MBOX_PRINT(_num, _field, _end) \
309 pos += scnprintf(buf + pos, bufsz - pos, \
310 "\t%s: %d%s", \
311 #_field, \
312 BT_MBOX_MSG(notif, _num, _field), \
313 true ? "\n" : ", ");
314
315static ssize_t iwl_dbgfs_bt_notif_read(struct file *file, char __user *user_buf,
316 size_t count, loff_t *ppos)
317{
318 struct iwl_mvm *mvm = file->private_data;
319 struct iwl_bt_coex_profile_notif *notif = &mvm->last_bt_notif;
320 char *buf;
321 int ret, pos = 0, bufsz = sizeof(char) * 1024;
322
323 buf = kmalloc(bufsz, GFP_KERNEL);
324 if (!buf)
325 return -ENOMEM;
326
327 mutex_lock(&mvm->mutex);
328
329 pos += scnprintf(buf+pos, bufsz-pos, "MBOX dw0:\n");
330
331 BT_MBOX_PRINT(0, LE_SLAVE_LAT, false);
332 BT_MBOX_PRINT(0, LE_PROF1, false);
333 BT_MBOX_PRINT(0, LE_PROF2, false);
334 BT_MBOX_PRINT(0, LE_PROF_OTHER, false);
335 BT_MBOX_PRINT(0, CHL_SEQ_N, false);
336 BT_MBOX_PRINT(0, INBAND_S, false);
337 BT_MBOX_PRINT(0, LE_MIN_RSSI, false);
338 BT_MBOX_PRINT(0, LE_SCAN, false);
339 BT_MBOX_PRINT(0, LE_ADV, false);
340 BT_MBOX_PRINT(0, LE_MAX_TX_POWER, false);
341 BT_MBOX_PRINT(0, OPEN_CON_1, true);
342
343 pos += scnprintf(buf+pos, bufsz-pos, "MBOX dw1:\n");
344
345 BT_MBOX_PRINT(1, BR_MAX_TX_POWER, false);
346 BT_MBOX_PRINT(1, IP_SR, false);
347 BT_MBOX_PRINT(1, LE_MSTR, false);
348 BT_MBOX_PRINT(1, AGGR_TRFC_LD, false);
349 BT_MBOX_PRINT(1, MSG_TYPE, false);
350 BT_MBOX_PRINT(1, SSN, true);
351
352 pos += scnprintf(buf+pos, bufsz-pos, "MBOX dw2:\n");
353
354 BT_MBOX_PRINT(2, SNIFF_ACT, false);
355 BT_MBOX_PRINT(2, PAG, false);
356 BT_MBOX_PRINT(2, INQUIRY, false);
357 BT_MBOX_PRINT(2, CONN, false);
358 BT_MBOX_PRINT(2, SNIFF_INTERVAL, false);
359 BT_MBOX_PRINT(2, DISC, false);
360 BT_MBOX_PRINT(2, SCO_TX_ACT, false);
361 BT_MBOX_PRINT(2, SCO_RX_ACT, false);
362 BT_MBOX_PRINT(2, ESCO_RE_TX, false);
363 BT_MBOX_PRINT(2, SCO_DURATION, true);
364
365 pos += scnprintf(buf+pos, bufsz-pos, "MBOX dw3:\n");
366
367 BT_MBOX_PRINT(3, SCO_STATE, false);
368 BT_MBOX_PRINT(3, SNIFF_STATE, false);
369 BT_MBOX_PRINT(3, A2DP_STATE, false);
370 BT_MBOX_PRINT(3, ACL_STATE, false);
371 BT_MBOX_PRINT(3, MSTR_STATE, false);
372 BT_MBOX_PRINT(3, OBX_STATE, false);
373 BT_MBOX_PRINT(3, OPEN_CON_2, false);
374 BT_MBOX_PRINT(3, TRAFFIC_LOAD, false);
375 BT_MBOX_PRINT(3, CHL_SEQN_LSB, false);
376 BT_MBOX_PRINT(3, INBAND_P, false);
377 BT_MBOX_PRINT(3, MSG_TYPE_2, false);
378 BT_MBOX_PRINT(3, SSN_2, false);
379 BT_MBOX_PRINT(3, UPDATE_REQUEST, true);
380
381 pos += scnprintf(buf+pos, bufsz-pos, "bt_status = %d\n",
382 notif->bt_status);
383 pos += scnprintf(buf+pos, bufsz-pos, "bt_open_conn = %d\n",
384 notif->bt_open_conn);
385 pos += scnprintf(buf+pos, bufsz-pos, "bt_traffic_load = %d\n",
386 notif->bt_traffic_load);
387 pos += scnprintf(buf+pos, bufsz-pos, "bt_agg_traffic_load = %d\n",
388 notif->bt_agg_traffic_load);
389 pos += scnprintf(buf+pos, bufsz-pos, "bt_ci_compliance = %d\n",
390 notif->bt_ci_compliance);
391
392 mutex_unlock(&mvm->mutex);
393
394 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
395 kfree(buf);
396
397 return ret;
398}
399#undef BT_MBOX_PRINT
400
303#define MVM_DEBUGFS_READ_FILE_OPS(name) \ 401#define MVM_DEBUGFS_READ_FILE_OPS(name) \
304static const struct file_operations iwl_dbgfs_##name##_ops = { \ 402static const struct file_operations iwl_dbgfs_##name##_ops = { \
305 .read = iwl_dbgfs_##name##_read, \ 403 .read = iwl_dbgfs_##name##_read, \
@@ -339,6 +437,7 @@ MVM_DEBUGFS_WRITE_FILE_OPS(tx_flush);
339MVM_DEBUGFS_WRITE_FILE_OPS(sta_drain); 437MVM_DEBUGFS_WRITE_FILE_OPS(sta_drain);
340MVM_DEBUGFS_READ_WRITE_FILE_OPS(sram); 438MVM_DEBUGFS_READ_WRITE_FILE_OPS(sram);
341MVM_DEBUGFS_READ_FILE_OPS(stations); 439MVM_DEBUGFS_READ_FILE_OPS(stations);
440MVM_DEBUGFS_READ_FILE_OPS(bt_notif);
342MVM_DEBUGFS_WRITE_FILE_OPS(power_down_allow); 441MVM_DEBUGFS_WRITE_FILE_OPS(power_down_allow);
343MVM_DEBUGFS_WRITE_FILE_OPS(power_down_d3_allow); 442MVM_DEBUGFS_WRITE_FILE_OPS(power_down_d3_allow);
344 443
@@ -352,6 +451,7 @@ int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir)
352 MVM_DEBUGFS_ADD_FILE(sta_drain, mvm->debugfs_dir, S_IWUSR); 451 MVM_DEBUGFS_ADD_FILE(sta_drain, mvm->debugfs_dir, S_IWUSR);
353 MVM_DEBUGFS_ADD_FILE(sram, mvm->debugfs_dir, S_IWUSR | S_IRUSR); 452 MVM_DEBUGFS_ADD_FILE(sram, mvm->debugfs_dir, S_IWUSR | S_IRUSR);
354 MVM_DEBUGFS_ADD_FILE(stations, dbgfs_dir, S_IRUSR); 453 MVM_DEBUGFS_ADD_FILE(stations, dbgfs_dir, S_IRUSR);
454 MVM_DEBUGFS_ADD_FILE(bt_notif, dbgfs_dir, S_IRUSR);
355 MVM_DEBUGFS_ADD_FILE(power_down_allow, mvm->debugfs_dir, S_IWUSR); 455 MVM_DEBUGFS_ADD_FILE(power_down_allow, mvm->debugfs_dir, S_IWUSR);
356 MVM_DEBUGFS_ADD_FILE(power_down_d3_allow, mvm->debugfs_dir, S_IWUSR); 456 MVM_DEBUGFS_ADD_FILE(power_down_d3_allow, mvm->debugfs_dir, S_IWUSR);
357 457
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h
index a1f1a86643e5..203eb85e03d3 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h
@@ -337,6 +337,7 @@ struct iwl_mvm {
337 337
338 /* BT-Coex */ 338 /* BT-Coex */
339 u8 bt_kill_msk; 339 u8 bt_kill_msk;
340 struct iwl_bt_coex_profile_notif last_bt_notif;
340}; 341};
341 342
342/* Extract MVM priv from op_mode and _hw */ 343/* Extract MVM priv from op_mode and _hw */