diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-07-02 10:33:52 -0400 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-07-07 14:35:57 -0400 |
commit | 160be5719bbcb97b46f008a0f9f23e80139f1e2c (patch) | |
tree | c59baa305a64b81b881a48fbb7381146b39413f7 | |
parent | 261c0ec07ecf1cc555a600315d687a94f2ee0660 (diff) |
iwlwifi: mvm: BT Coex - fix debugfs with old API
Fix the debugfs hook to make it able to display the data
with the old firmware API.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/debugfs.c | 183 |
1 files changed, 148 insertions, 35 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/iwlwifi/mvm/debugfs.c index e66c659b264a..f131ef0ec5b3 100644 --- a/drivers/net/wireless/iwlwifi/mvm/debugfs.c +++ b/drivers/net/wireless/iwlwifi/mvm/debugfs.c | |||
@@ -312,20 +312,69 @@ static ssize_t iwl_dbgfs_disable_power_off_write(struct iwl_mvm *mvm, char *buf, | |||
312 | BT_MBOX_MSG(notif, _num, _field), \ | 312 | BT_MBOX_MSG(notif, _num, _field), \ |
313 | true ? "\n" : ", "); | 313 | true ? "\n" : ", "); |
314 | 314 | ||
315 | static ssize_t iwl_dbgfs_bt_notif_read(struct file *file, char __user *user_buf, | 315 | static |
316 | size_t count, loff_t *ppos) | 316 | int iwl_mvm_coex_dump_mbox(struct iwl_bt_coex_profile_notif *notif, char *buf, |
317 | int pos, int bufsz) | ||
317 | { | 318 | { |
318 | struct iwl_mvm *mvm = file->private_data; | 319 | pos += scnprintf(buf+pos, bufsz-pos, "MBOX dw0:\n"); |
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 | 320 | ||
323 | buf = kmalloc(bufsz, GFP_KERNEL); | 321 | BT_MBOX_PRINT(0, LE_SLAVE_LAT, false); |
324 | if (!buf) | 322 | BT_MBOX_PRINT(0, LE_PROF1, false); |
325 | return -ENOMEM; | 323 | BT_MBOX_PRINT(0, LE_PROF2, false); |
324 | BT_MBOX_PRINT(0, LE_PROF_OTHER, false); | ||
325 | BT_MBOX_PRINT(0, CHL_SEQ_N, false); | ||
326 | BT_MBOX_PRINT(0, INBAND_S, false); | ||
327 | BT_MBOX_PRINT(0, LE_MIN_RSSI, false); | ||
328 | BT_MBOX_PRINT(0, LE_SCAN, false); | ||
329 | BT_MBOX_PRINT(0, LE_ADV, false); | ||
330 | BT_MBOX_PRINT(0, LE_MAX_TX_POWER, false); | ||
331 | BT_MBOX_PRINT(0, OPEN_CON_1, true); | ||
326 | 332 | ||
327 | mutex_lock(&mvm->mutex); | 333 | pos += scnprintf(buf+pos, bufsz-pos, "MBOX dw1:\n"); |
334 | |||
335 | BT_MBOX_PRINT(1, BR_MAX_TX_POWER, false); | ||
336 | BT_MBOX_PRINT(1, IP_SR, false); | ||
337 | BT_MBOX_PRINT(1, LE_MSTR, false); | ||
338 | BT_MBOX_PRINT(1, AGGR_TRFC_LD, false); | ||
339 | BT_MBOX_PRINT(1, MSG_TYPE, false); | ||
340 | BT_MBOX_PRINT(1, SSN, true); | ||
341 | |||
342 | pos += scnprintf(buf+pos, bufsz-pos, "MBOX dw2:\n"); | ||
343 | |||
344 | BT_MBOX_PRINT(2, SNIFF_ACT, false); | ||
345 | BT_MBOX_PRINT(2, PAG, false); | ||
346 | BT_MBOX_PRINT(2, INQUIRY, false); | ||
347 | BT_MBOX_PRINT(2, CONN, false); | ||
348 | BT_MBOX_PRINT(2, SNIFF_INTERVAL, false); | ||
349 | BT_MBOX_PRINT(2, DISC, false); | ||
350 | BT_MBOX_PRINT(2, SCO_TX_ACT, false); | ||
351 | BT_MBOX_PRINT(2, SCO_RX_ACT, false); | ||
352 | BT_MBOX_PRINT(2, ESCO_RE_TX, false); | ||
353 | BT_MBOX_PRINT(2, SCO_DURATION, true); | ||
328 | 354 | ||
355 | pos += scnprintf(buf+pos, bufsz-pos, "MBOX dw3:\n"); | ||
356 | |||
357 | BT_MBOX_PRINT(3, SCO_STATE, false); | ||
358 | BT_MBOX_PRINT(3, SNIFF_STATE, false); | ||
359 | BT_MBOX_PRINT(3, A2DP_STATE, false); | ||
360 | BT_MBOX_PRINT(3, ACL_STATE, false); | ||
361 | BT_MBOX_PRINT(3, MSTR_STATE, false); | ||
362 | BT_MBOX_PRINT(3, OBX_STATE, false); | ||
363 | BT_MBOX_PRINT(3, OPEN_CON_2, false); | ||
364 | BT_MBOX_PRINT(3, TRAFFIC_LOAD, false); | ||
365 | BT_MBOX_PRINT(3, CHL_SEQN_LSB, false); | ||
366 | BT_MBOX_PRINT(3, INBAND_P, false); | ||
367 | BT_MBOX_PRINT(3, MSG_TYPE_2, false); | ||
368 | BT_MBOX_PRINT(3, SSN_2, false); | ||
369 | BT_MBOX_PRINT(3, UPDATE_REQUEST, true); | ||
370 | |||
371 | return pos; | ||
372 | } | ||
373 | |||
374 | static | ||
375 | int iwl_mvm_coex_dump_mbox_old(struct iwl_bt_coex_profile_notif_old *notif, | ||
376 | char *buf, int pos, int bufsz) | ||
377 | { | ||
329 | pos += scnprintf(buf+pos, bufsz-pos, "MBOX dw0:\n"); | 378 | pos += scnprintf(buf+pos, bufsz-pos, "MBOX dw0:\n"); |
330 | 379 | ||
331 | BT_MBOX_PRINT(0, LE_SLAVE_LAT, false); | 380 | BT_MBOX_PRINT(0, LE_SLAVE_LAT, false); |
@@ -378,17 +427,59 @@ static ssize_t iwl_dbgfs_bt_notif_read(struct file *file, char __user *user_buf, | |||
378 | BT_MBOX_PRINT(3, SSN_2, false); | 427 | BT_MBOX_PRINT(3, SSN_2, false); |
379 | BT_MBOX_PRINT(3, UPDATE_REQUEST, true); | 428 | BT_MBOX_PRINT(3, UPDATE_REQUEST, true); |
380 | 429 | ||
381 | pos += scnprintf(buf+pos, bufsz-pos, "bt_ci_compliance = %d\n", | 430 | return pos; |
382 | notif->bt_ci_compliance); | 431 | } |
383 | pos += scnprintf(buf+pos, bufsz-pos, "primary_ch_lut = %d\n", | 432 | |
384 | le32_to_cpu(notif->primary_ch_lut)); | 433 | static ssize_t iwl_dbgfs_bt_notif_read(struct file *file, char __user *user_buf, |
385 | pos += scnprintf(buf+pos, bufsz-pos, "secondary_ch_lut = %d\n", | 434 | size_t count, loff_t *ppos) |
386 | le32_to_cpu(notif->secondary_ch_lut)); | 435 | { |
387 | pos += scnprintf(buf+pos, bufsz-pos, "bt_activity_grading = %d\n", | 436 | struct iwl_mvm *mvm = file->private_data; |
388 | le32_to_cpu(notif->bt_activity_grading)); | 437 | char *buf; |
389 | pos += scnprintf(buf+pos, bufsz-pos, | 438 | int ret, pos = 0, bufsz = sizeof(char) * 1024; |
390 | "antenna isolation = %d CORUN LUT index = %d\n", | 439 | |
391 | mvm->last_ant_isol, mvm->last_corun_lut); | 440 | buf = kmalloc(bufsz, GFP_KERNEL); |
441 | if (!buf) | ||
442 | return -ENOMEM; | ||
443 | |||
444 | mutex_lock(&mvm->mutex); | ||
445 | |||
446 | if (!(mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_BT_COEX_SPLIT)) { | ||
447 | struct iwl_bt_coex_profile_notif_old *notif = | ||
448 | &mvm->last_bt_notif_old; | ||
449 | |||
450 | pos += iwl_mvm_coex_dump_mbox_old(notif, buf, pos, bufsz); | ||
451 | |||
452 | pos += scnprintf(buf+pos, bufsz-pos, "bt_ci_compliance = %d\n", | ||
453 | notif->bt_ci_compliance); | ||
454 | pos += scnprintf(buf+pos, bufsz-pos, "primary_ch_lut = %d\n", | ||
455 | le32_to_cpu(notif->primary_ch_lut)); | ||
456 | pos += scnprintf(buf+pos, bufsz-pos, "secondary_ch_lut = %d\n", | ||
457 | le32_to_cpu(notif->secondary_ch_lut)); | ||
458 | pos += scnprintf(buf+pos, | ||
459 | bufsz-pos, "bt_activity_grading = %d\n", | ||
460 | le32_to_cpu(notif->bt_activity_grading)); | ||
461 | pos += scnprintf(buf+pos, bufsz-pos, | ||
462 | "antenna isolation = %d CORUN LUT index = %d\n", | ||
463 | mvm->last_ant_isol, mvm->last_corun_lut); | ||
464 | } else { | ||
465 | struct iwl_bt_coex_profile_notif *notif = | ||
466 | &mvm->last_bt_notif; | ||
467 | |||
468 | pos += iwl_mvm_coex_dump_mbox(notif, buf, pos, bufsz); | ||
469 | |||
470 | pos += scnprintf(buf+pos, bufsz-pos, "bt_ci_compliance = %d\n", | ||
471 | notif->bt_ci_compliance); | ||
472 | pos += scnprintf(buf+pos, bufsz-pos, "primary_ch_lut = %d\n", | ||
473 | le32_to_cpu(notif->primary_ch_lut)); | ||
474 | pos += scnprintf(buf+pos, bufsz-pos, "secondary_ch_lut = %d\n", | ||
475 | le32_to_cpu(notif->secondary_ch_lut)); | ||
476 | pos += scnprintf(buf+pos, | ||
477 | bufsz-pos, "bt_activity_grading = %d\n", | ||
478 | le32_to_cpu(notif->bt_activity_grading)); | ||
479 | pos += scnprintf(buf+pos, bufsz-pos, | ||
480 | "antenna isolation = %d CORUN LUT index = %d\n", | ||
481 | mvm->last_ant_isol, mvm->last_corun_lut); | ||
482 | } | ||
392 | 483 | ||
393 | mutex_unlock(&mvm->mutex); | 484 | mutex_unlock(&mvm->mutex); |
394 | 485 | ||
@@ -403,26 +494,48 @@ static ssize_t iwl_dbgfs_bt_cmd_read(struct file *file, char __user *user_buf, | |||
403 | size_t count, loff_t *ppos) | 494 | size_t count, loff_t *ppos) |
404 | { | 495 | { |
405 | struct iwl_mvm *mvm = file->private_data; | 496 | struct iwl_mvm *mvm = file->private_data; |
406 | struct iwl_bt_coex_ci_cmd *cmd = &mvm->last_bt_ci_cmd; | ||
407 | char buf[256]; | 497 | char buf[256]; |
408 | int bufsz = sizeof(buf); | 498 | int bufsz = sizeof(buf); |
409 | int pos = 0; | 499 | int pos = 0; |
410 | 500 | ||
411 | mutex_lock(&mvm->mutex); | 501 | mutex_lock(&mvm->mutex); |
412 | 502 | ||
413 | pos += scnprintf(buf+pos, bufsz-pos, "Channel inhibition CMD\n"); | 503 | if (!(mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_BT_COEX_SPLIT)) { |
414 | pos += scnprintf(buf+pos, bufsz-pos, | 504 | struct iwl_bt_coex_ci_cmd_old *cmd = &mvm->last_bt_ci_cmd_old; |
415 | "\tPrimary Channel Bitmap 0x%016llx\n", | 505 | |
416 | le64_to_cpu(cmd->bt_primary_ci)); | 506 | pos += scnprintf(buf+pos, bufsz-pos, |
417 | pos += scnprintf(buf+pos, bufsz-pos, | 507 | "Channel inhibition CMD\n"); |
418 | "\tSecondary Channel Bitmap 0x%016llx\n", | 508 | pos += scnprintf(buf+pos, bufsz-pos, |
419 | le64_to_cpu(cmd->bt_secondary_ci)); | 509 | "\tPrimary Channel Bitmap 0x%016llx\n", |
420 | 510 | le64_to_cpu(cmd->bt_primary_ci)); | |
421 | pos += scnprintf(buf+pos, bufsz-pos, "BT Configuration CMD\n"); | 511 | pos += scnprintf(buf+pos, bufsz-pos, |
422 | pos += scnprintf(buf+pos, bufsz-pos, "\tACK Kill Mask 0x%08x\n", | 512 | "\tSecondary Channel Bitmap 0x%016llx\n", |
423 | iwl_bt_ack_kill_msk[mvm->bt_kill_msk]); | 513 | le64_to_cpu(cmd->bt_secondary_ci)); |
424 | pos += scnprintf(buf+pos, bufsz-pos, "\tCTS Kill Mask 0x%08x\n", | 514 | |
425 | iwl_bt_cts_kill_msk[mvm->bt_kill_msk]); | 515 | pos += scnprintf(buf+pos, bufsz-pos, "BT Configuration CMD\n"); |
516 | pos += scnprintf(buf+pos, bufsz-pos, "\tACK Kill Mask 0x%08x\n", | ||
517 | iwl_bt_ack_kill_msk[mvm->bt_kill_msk]); | ||
518 | pos += scnprintf(buf+pos, bufsz-pos, "\tCTS Kill Mask 0x%08x\n", | ||
519 | iwl_bt_cts_kill_msk[mvm->bt_kill_msk]); | ||
520 | |||
521 | } else { | ||
522 | struct iwl_bt_coex_ci_cmd *cmd = &mvm->last_bt_ci_cmd; | ||
523 | |||
524 | pos += scnprintf(buf+pos, bufsz-pos, | ||
525 | "Channel inhibition CMD\n"); | ||
526 | pos += scnprintf(buf+pos, bufsz-pos, | ||
527 | "\tPrimary Channel Bitmap 0x%016llx\n", | ||
528 | le64_to_cpu(cmd->bt_primary_ci)); | ||
529 | pos += scnprintf(buf+pos, bufsz-pos, | ||
530 | "\tSecondary Channel Bitmap 0x%016llx\n", | ||
531 | le64_to_cpu(cmd->bt_secondary_ci)); | ||
532 | |||
533 | pos += scnprintf(buf+pos, bufsz-pos, "BT Configuration CMD\n"); | ||
534 | pos += scnprintf(buf+pos, bufsz-pos, "\tACK Kill Mask 0x%08x\n", | ||
535 | iwl_bt_ack_kill_msk[mvm->bt_kill_msk]); | ||
536 | pos += scnprintf(buf+pos, bufsz-pos, "\tCTS Kill Mask 0x%08x\n", | ||
537 | iwl_bt_cts_kill_msk[mvm->bt_kill_msk]); | ||
538 | } | ||
426 | 539 | ||
427 | mutex_unlock(&mvm->mutex); | 540 | mutex_unlock(&mvm->mutex); |
428 | 541 | ||