aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2010-04-30 14:35:15 -0400
committerReinette Chatre <reinette.chatre@intel.com>2010-05-10 18:09:03 -0400
commit470356b891f1d18e87d5fdc393976fab6d0a978d (patch)
treea2372834f7d624abe35bd2952060511c55fd31b5 /drivers/net
parent3bce6066263efb5733ee2141ac8b56684fb3b0a7 (diff)
iwlwifi: "tx power per chain" are part of ucode_tx_stats
Move "tx power per chain" into ucode_tx_stats, it is debugging information provided by uCode as part of statistics notification. The "tx power per chain" parameters are optional parameters which only supported by 6000 series device today; those are reserved fields for all the other devices. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c16
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-commands.h5
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c42
3 files changed, 21 insertions, 42 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
index f249b706bf17..48c023b4ca36 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
@@ -709,6 +709,22 @@ ssize_t iwl_ucode_tx_stats_read(struct file *file,
709 delta_tx->agg.rx_ba_rsp_cnt, 709 delta_tx->agg.rx_ba_rsp_cnt,
710 max_tx->agg.rx_ba_rsp_cnt); 710 max_tx->agg.rx_ba_rsp_cnt);
711 711
712 if (tx->tx_power.ant_a || tx->tx_power.ant_b || tx->tx_power.ant_c) {
713 pos += scnprintf(buf + pos, bufsz - pos,
714 "tx power: (1/2 dB step)\n");
715 if ((priv->cfg->valid_tx_ant & ANT_A) && tx->tx_power.ant_a)
716 pos += scnprintf(buf + pos, bufsz - pos,
717 "\tantenna A: 0x%X\n",
718 tx->tx_power.ant_a);
719 if ((priv->cfg->valid_tx_ant & ANT_B) && tx->tx_power.ant_b)
720 pos += scnprintf(buf + pos, bufsz - pos,
721 "\tantenna B: 0x%X\n",
722 tx->tx_power.ant_b);
723 if ((priv->cfg->valid_tx_ant & ANT_C) && tx->tx_power.ant_c)
724 pos += scnprintf(buf + pos, bufsz - pos,
725 "\tantenna C: 0x%X\n",
726 tx->tx_power.ant_c);
727 }
712 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); 728 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
713 kfree(buf); 729 kfree(buf);
714 return ret; 730 return ret;
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index 449d41f058b8..9aab020c474b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -3127,6 +3127,11 @@ struct statistics_tx {
3127 __le32 cts_timeout_collision; 3127 __le32 cts_timeout_collision;
3128 __le32 ack_or_ba_timeout_collision; 3128 __le32 ack_or_ba_timeout_collision;
3129 struct statistics_tx_non_phy_agg agg; 3129 struct statistics_tx_non_phy_agg agg;
3130 /*
3131 * "tx_power" are optional parameters provided by uCode,
3132 * 6000 series is the only device provide the information,
3133 * Those are reserved fields for all the other devices
3134 */
3130 struct statistics_tx_power tx_power; 3135 struct statistics_tx_power tx_power;
3131 __le32 reserved1; 3136 __le32 reserved1;
3132} __attribute__ ((packed)); 3137} __attribute__ ((packed));
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 06905bb9238d..4d6de2dfedd1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -1214,46 +1214,6 @@ static ssize_t iwl_dbgfs_chain_noise_read(struct file *file,
1214 return ret; 1214 return ret;
1215} 1215}
1216 1216
1217static ssize_t iwl_dbgfs_chain_tx_power_read(struct file *file,
1218 char __user *user_buf,
1219 size_t count, loff_t *ppos) {
1220
1221 struct iwl_priv *priv = file->private_data;
1222 char buf[128];
1223 int pos = 0;
1224 const size_t bufsz = sizeof(buf);
1225 struct statistics_tx *tx;
1226
1227 if (!iwl_is_alive(priv))
1228 return -EAGAIN;
1229 else {
1230 tx = &priv->statistics.tx;
1231 if (tx->tx_power.ant_a ||
1232 tx->tx_power.ant_b ||
1233 tx->tx_power.ant_c) {
1234 pos += scnprintf(buf + pos, bufsz - pos,
1235 "tx power: (1/2 dB step)\n");
1236 if ((priv->cfg->valid_tx_ant & ANT_A) &&
1237 tx->tx_power.ant_a)
1238 pos += scnprintf(buf + pos, bufsz - pos,
1239 "\tantenna A: 0x%X\n",
1240 tx->tx_power.ant_a);
1241 if ((priv->cfg->valid_tx_ant & ANT_B) &&
1242 tx->tx_power.ant_b)
1243 pos += scnprintf(buf + pos, bufsz - pos,
1244 "\tantenna B: 0x%X\n",
1245 tx->tx_power.ant_b);
1246 if ((priv->cfg->valid_tx_ant & ANT_C) &&
1247 tx->tx_power.ant_c)
1248 pos += scnprintf(buf + pos, bufsz - pos,
1249 "\tantenna C: 0x%X\n",
1250 tx->tx_power.ant_c);
1251 } else
1252 pos += scnprintf(buf + pos, bufsz - pos, "N/A\n");
1253 }
1254 return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
1255}
1256
1257static ssize_t iwl_dbgfs_power_save_status_read(struct file *file, 1217static ssize_t iwl_dbgfs_power_save_status_read(struct file *file,
1258 char __user *user_buf, 1218 char __user *user_buf,
1259 size_t count, loff_t *ppos) 1219 size_t count, loff_t *ppos)
@@ -1565,7 +1525,6 @@ DEBUGFS_READ_FILE_OPS(ucode_tx_stats);
1565DEBUGFS_READ_FILE_OPS(ucode_general_stats); 1525DEBUGFS_READ_FILE_OPS(ucode_general_stats);
1566DEBUGFS_READ_FILE_OPS(sensitivity); 1526DEBUGFS_READ_FILE_OPS(sensitivity);
1567DEBUGFS_READ_FILE_OPS(chain_noise); 1527DEBUGFS_READ_FILE_OPS(chain_noise);
1568DEBUGFS_READ_FILE_OPS(chain_tx_power);
1569DEBUGFS_READ_FILE_OPS(power_save_status); 1528DEBUGFS_READ_FILE_OPS(power_save_status);
1570DEBUGFS_WRITE_FILE_OPS(clear_ucode_statistics); 1529DEBUGFS_WRITE_FILE_OPS(clear_ucode_statistics);
1571DEBUGFS_WRITE_FILE_OPS(clear_traffic_statistics); 1530DEBUGFS_WRITE_FILE_OPS(clear_traffic_statistics);
@@ -1624,7 +1583,6 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
1624 DEBUGFS_ADD_FILE(traffic_log, dir_debug, S_IWUSR | S_IRUSR); 1583 DEBUGFS_ADD_FILE(traffic_log, dir_debug, S_IWUSR | S_IRUSR);
1625 DEBUGFS_ADD_FILE(rx_queue, dir_debug, S_IRUSR); 1584 DEBUGFS_ADD_FILE(rx_queue, dir_debug, S_IRUSR);
1626 DEBUGFS_ADD_FILE(tx_queue, dir_debug, S_IRUSR); 1585 DEBUGFS_ADD_FILE(tx_queue, dir_debug, S_IRUSR);
1627 DEBUGFS_ADD_FILE(chain_tx_power, dir_debug, S_IRUSR);
1628 DEBUGFS_ADD_FILE(power_save_status, dir_debug, S_IRUSR); 1586 DEBUGFS_ADD_FILE(power_save_status, dir_debug, S_IRUSR);
1629 DEBUGFS_ADD_FILE(clear_ucode_statistics, dir_debug, S_IWUSR); 1587 DEBUGFS_ADD_FILE(clear_ucode_statistics, dir_debug, S_IWUSR);
1630 DEBUGFS_ADD_FILE(clear_traffic_statistics, dir_debug, S_IWUSR); 1588 DEBUGFS_ADD_FILE(clear_traffic_statistics, dir_debug, S_IWUSR);