iwlwifi: keep track of bt coex enable/disable stage
authorWey-Yi Guy <wey-yi.w.guy@intel.com>
Wed, 8 Dec 2010 23:34:52 +0000 (15:34 -0800)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Mon, 13 Dec 2010 23:53:38 +0000 (15:53 -0800)
For debugging purpose, keep track of the bt coex enable/disable state.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
drivers/net/wireless/iwlwifi/iwl-agn-lib.c
drivers/net/wireless/iwlwifi/iwl-core.c
drivers/net/wireless/iwlwifi/iwl-debugfs.c
drivers/net/wireless/iwlwifi/iwl-dev.h

index a358d4334a1a356f6cecbe2407359c8829792350..a6dbd8983dacb32dda5a2cd15ab8cc0f26bfd2f6 100644 (file)
@@ -856,6 +856,9 @@ ssize_t iwl_ucode_bt_stats_read(struct file *file,
        if (!iwl_is_alive(priv))
                return -EAGAIN;
 
+       if (!priv->bt_enable_flag)
+               return -EINVAL;
+
        /* make request to uCode to retrieve statistics information */
        mutex_lock(&priv->mutex);
        ret = iwl_send_statistics_request(priv, CMD_SYNC, false);
index 7c8010f7ce560194fe232318fb29cecbb5d0b274..4bc82fcf1652c699163a662855cee6d3f4c7ef7d 100644 (file)
@@ -1845,6 +1845,7 @@ void iwlagn_send_advance_bt_config(struct iwl_priv *priv)
                        bt_cmd.flags |= IWLAGN_BT_FLAG_CHANNEL_INHIBITION;
                IWL_DEBUG_INFO(priv, "BT coex flag: 0X%x\n", bt_cmd.flags);
        }
+       priv->bt_enable_flag = bt_cmd.flags;
        if (priv->bt_full_concurrent)
                memcpy(bt_cmd.bt3_lookup_table, iwlagn_concurrent_lookup,
                        sizeof(iwlagn_concurrent_lookup));
index 06cdc60ff87f3606f7403f807237088fceca3e92..efbde1f1a8bfca29924465c0c56ba57cf4c74e17 100644 (file)
@@ -1223,6 +1223,7 @@ void iwl_send_bt_config(struct iwl_priv *priv)
        else
                bt_cmd.flags = BT_COEX_ENABLE;
 
+       priv->bt_enable_flag = bt_cmd.flags;
        IWL_DEBUG_INFO(priv, "BT coex %s\n",
                (bt_cmd.flags == BT_COEX_DISABLE) ? "disable" : "active");
 
index d36836376e6bab183f8326167975318e8c3ffbf9..6fe80b5e7a159ab0b91450314e1cd89d7feedcd5 100644 (file)
@@ -1567,6 +1567,13 @@ static ssize_t iwl_dbgfs_bt_traffic_read(struct file *file,
        const size_t bufsz = sizeof(buf);
        ssize_t ret;
 
+       if (!priv->bt_enable_flag) {
+               pos += scnprintf(buf + pos, bufsz - pos, "BT coex disabled\n");
+               ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
+               return ret;
+       }
+       pos += scnprintf(buf + pos, bufsz - pos, "BT enable flag: 0x%x\n",
+               priv->bt_enable_flag);
        pos += scnprintf(buf + pos, bufsz - pos, "BT in %s mode\n",
                priv->bt_full_concurrent ? "full concurrency" : "3-wire");
        pos += scnprintf(buf + pos, bufsz - pos, "BT status: %s, "
index 836f1816b110ab96a907cea8aa5bc3feff756680..8dda67850af45174ed371b820934ccadd5dba1b4 100644 (file)
@@ -1468,6 +1468,7 @@ struct iwl_priv {
        };
 
        /* bt coex */
+       u8 bt_enable_flag;
        u8 bt_status;
        u8 bt_traffic_load, last_bt_traffic_load;
        bool bt_ch_announce;