iwlwifi: mvm: BT Coex - adapt debugfs to new API
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Sun, 30 Jun 2013 04:43:28 +0000 (07:43 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 2 Oct 2013 16:00:43 +0000 (18:00 +0200)
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/iwlwifi/mvm/bt-coex.c
drivers/net/wireless/iwlwifi/mvm/debugfs.c
drivers/net/wireless/iwlwifi/mvm/mvm.h

index 908a8a9ca564caff2a12d6d84e5822f658c63eec..a17e2cc2bedbef2448c3b274eb847eddb30ac466 100644 (file)
@@ -112,20 +112,13 @@ int iwl_send_bt_prio_tbl(struct iwl_mvm *mvm)
                                    &iwl_bt_prio_tbl);
 }
 
-enum iwl_bt_kill_msk {
-       BT_KILL_MSK_DEFAULT,
-       BT_KILL_MSK_SCO_HID_A2DP,
-       BT_KILL_MSK_REDUCED_TXPOW,
-       BT_KILL_MSK_MAX,
-};
-
-static const u32 iwl_bt_ack_kill_msk[BT_KILL_MSK_MAX] = {
+const u32 iwl_bt_ack_kill_msk[BT_KILL_MSK_MAX] = {
        [BT_KILL_MSK_DEFAULT] = 0xffff0000,
        [BT_KILL_MSK_SCO_HID_A2DP] = 0xffffffff,
        [BT_KILL_MSK_REDUCED_TXPOW] = 0,
 };
 
-static const u32 iwl_bt_cts_kill_msk[BT_KILL_MSK_MAX] = {
+const u32 iwl_bt_cts_kill_msk[BT_KILL_MSK_MAX] = {
        [BT_KILL_MSK_DEFAULT] = 0xffff0000,
        [BT_KILL_MSK_SCO_HID_A2DP] = 0xffffffff,
        [BT_KILL_MSK_REDUCED_TXPOW] = 0,
index 26c53b37007e702a88d50a67dc1e7eaaa7947c60..e943ee125d2321c7f9ed04462082ff1c35dc76df 100644 (file)
@@ -584,15 +584,21 @@ static ssize_t iwl_dbgfs_bt_notif_read(struct file *file, char __user *user_buf,
        BT_MBOX_PRINT(3, UPDATE_REQUEST, true);
 
        pos += scnprintf(buf+pos, bufsz-pos, "bt_status = %d\n",
-                                        notif->bt_status);
+                        notif->bt_status);
        pos += scnprintf(buf+pos, bufsz-pos, "bt_open_conn = %d\n",
-                                        notif->bt_open_conn);
+                        notif->bt_open_conn);
        pos += scnprintf(buf+pos, bufsz-pos, "bt_traffic_load = %d\n",
-                                        notif->bt_traffic_load);
+                        notif->bt_traffic_load);
        pos += scnprintf(buf+pos, bufsz-pos, "bt_agg_traffic_load = %d\n",
-                                        notif->bt_agg_traffic_load);
+                        notif->bt_agg_traffic_load);
        pos += scnprintf(buf+pos, bufsz-pos, "bt_ci_compliance = %d\n",
-                                        notif->bt_ci_compliance);
+                        notif->bt_ci_compliance);
+       pos += scnprintf(buf+pos, bufsz-pos, "primary_ch_lut = %d\n",
+                        le32_to_cpu(notif->primary_ch_lut));
+       pos += scnprintf(buf+pos, bufsz-pos, "secondary_ch_lut = %d\n",
+                        le32_to_cpu(notif->secondary_ch_lut));
+       pos += scnprintf(buf+pos, bufsz-pos, "bt_activity_grading = %d\n",
+                        le32_to_cpu(notif->bt_activity_grading));
 
        mutex_unlock(&mvm->mutex);
 
@@ -603,6 +609,38 @@ static ssize_t iwl_dbgfs_bt_notif_read(struct file *file, char __user *user_buf,
 }
 #undef BT_MBOX_PRINT
 
+static ssize_t iwl_dbgfs_bt_cmd_read(struct file *file, char __user *user_buf,
+                                    size_t count, loff_t *ppos)
+{
+       struct iwl_mvm *mvm = file->private_data;
+       struct iwl_bt_coex_ci_cmd *cmd = &mvm->last_bt_ci_cmd;
+       char buf[256];
+       int bufsz = sizeof(buf);
+       int pos = 0;
+
+       mutex_lock(&mvm->mutex);
+
+       pos += scnprintf(buf+pos, bufsz-pos, "Channel inhibition CMD\n");
+       pos += scnprintf(buf+pos, bufsz-pos,
+                      "\tPrimary Channel Bitmap 0x%016llx Fat: %d\n",
+                      le64_to_cpu(cmd->bt_primary_ci),
+                      !!cmd->co_run_bw_primary);
+       pos += scnprintf(buf+pos, bufsz-pos,
+                      "\tSecondary Channel Bitmap 0x%016llx Fat: %d\n",
+                      le64_to_cpu(cmd->bt_secondary_ci),
+                      !!cmd->co_run_bw_secondary);
+
+       pos += scnprintf(buf+pos, bufsz-pos, "BT Configuration CMD\n");
+       pos += scnprintf(buf+pos, bufsz-pos, "\tACK Kill Mask 0x%08x\n",
+                        iwl_bt_ack_kill_msk[mvm->bt_kill_msk]);
+       pos += scnprintf(buf+pos, bufsz-pos, "\tCTS Kill Mask 0x%08x\n",
+                        iwl_bt_cts_kill_msk[mvm->bt_kill_msk]);
+
+       mutex_unlock(&mvm->mutex);
+
+       return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
+}
+
 #define PRINT_STATS_LE32(_str, _val)                                   \
                         pos += scnprintf(buf + pos, bufsz - pos,       \
                                          fmt_table, _str,              \
@@ -1120,6 +1158,7 @@ MVM_DEBUGFS_WRITE_FILE_OPS(sta_drain);
 MVM_DEBUGFS_READ_WRITE_FILE_OPS(sram);
 MVM_DEBUGFS_READ_FILE_OPS(stations);
 MVM_DEBUGFS_READ_FILE_OPS(bt_notif);
+MVM_DEBUGFS_READ_FILE_OPS(bt_cmd);
 MVM_DEBUGFS_WRITE_FILE_OPS(power_down_allow);
 MVM_DEBUGFS_WRITE_FILE_OPS(power_down_d3_allow);
 MVM_DEBUGFS_READ_FILE_OPS(fw_rx_stats);
@@ -1146,6 +1185,7 @@ int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir)
        MVM_DEBUGFS_ADD_FILE(sram, mvm->debugfs_dir, S_IWUSR | S_IRUSR);
        MVM_DEBUGFS_ADD_FILE(stations, dbgfs_dir, S_IRUSR);
        MVM_DEBUGFS_ADD_FILE(bt_notif, dbgfs_dir, S_IRUSR);
+       MVM_DEBUGFS_ADD_FILE(bt_cmd, dbgfs_dir, S_IRUSR);
        MVM_DEBUGFS_ADD_FILE(power_down_allow, mvm->debugfs_dir, S_IWUSR);
        MVM_DEBUGFS_ADD_FILE(power_down_d3_allow, mvm->debugfs_dir, S_IWUSR);
        MVM_DEBUGFS_ADD_FILE(fw_rx_stats, mvm->debugfs_dir, S_IRUSR);
index 2d65fe2474e9c0e2d386bc2f29961f0edfbb1cab..33dbc7cefeba638cf08d31c41559cb3fbb7917d1 100644 (file)
@@ -791,6 +791,14 @@ int iwl_mvm_rx_bt_coex_notif(struct iwl_mvm *mvm,
 void iwl_mvm_bt_rssi_event(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
                           enum ieee80211_rssi_event rssi_event);
 void iwl_mvm_bt_coex_vif_change(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
+enum iwl_bt_kill_msk {
+       BT_KILL_MSK_DEFAULT,
+       BT_KILL_MSK_SCO_HID_A2DP,
+       BT_KILL_MSK_REDUCED_TXPOW,
+       BT_KILL_MSK_MAX,
+};
+extern const u32 iwl_bt_ack_kill_msk[BT_KILL_MSK_MAX];
+extern const u32 iwl_bt_cts_kill_msk[BT_KILL_MSK_MAX];
 
 /* beacon filtering */
 #ifdef CONFIG_IWLWIFI_DEBUGFS