aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlegacy/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlegacy/debug.c')
-rw-r--r--drivers/net/wireless/iwlegacy/debug.c43
1 files changed, 19 insertions, 24 deletions
diff --git a/drivers/net/wireless/iwlegacy/debug.c b/drivers/net/wireless/iwlegacy/debug.c
index b1b8926a9c7b..bb7c95607a69 100644
--- a/drivers/net/wireless/iwlegacy/debug.c
+++ b/drivers/net/wireless/iwlegacy/debug.c
@@ -361,7 +361,7 @@ il_dbgfs_nvm_read(struct file *file, char __user *user_buf, size_t count,
361 const u8 *ptr; 361 const u8 *ptr;
362 char *buf; 362 char *buf;
363 u16 eeprom_ver; 363 u16 eeprom_ver;
364 size_t eeprom_len = il->cfg->base_params->eeprom_size; 364 size_t eeprom_len = il->cfg->eeprom_size;
365 buf_size = 4 * eeprom_len + 256; 365 buf_size = 4 * eeprom_len + 256;
366 366
367 if (eeprom_len % 16) { 367 if (eeprom_len % 16) {
@@ -644,12 +644,10 @@ il_dbgfs_qos_read(struct file *file, char __user *user_buf, size_t count,
644 loff_t *ppos) 644 loff_t *ppos)
645{ 645{
646 struct il_priv *il = file->private_data; 646 struct il_priv *il = file->private_data;
647 struct il_rxon_context *ctx = &il->ctx;
648 int pos = 0, i; 647 int pos = 0, i;
649 char buf[256]; 648 char buf[256];
650 const size_t bufsz = sizeof(buf); 649 const size_t bufsz = sizeof(buf);
651 650
652 pos += scnprintf(buf + pos, bufsz - pos, "context %d:\n", ctx->ctxid);
653 for (i = 0; i < AC_NUM; i++) { 651 for (i = 0; i < AC_NUM; i++) {
654 pos += 652 pos +=
655 scnprintf(buf + pos, bufsz - pos, 653 scnprintf(buf + pos, bufsz - pos,
@@ -657,10 +655,10 @@ il_dbgfs_qos_read(struct file *file, char __user *user_buf, size_t count,
657 pos += 655 pos +=
658 scnprintf(buf + pos, bufsz - pos, 656 scnprintf(buf + pos, bufsz - pos,
659 "AC[%d]\t%u\t%u\t%u\t%u\n", i, 657 "AC[%d]\t%u\t%u\t%u\t%u\n", i,
660 ctx->qos_data.def_qos_parm.ac[i].cw_min, 658 il->qos_data.def_qos_parm.ac[i].cw_min,
661 ctx->qos_data.def_qos_parm.ac[i].cw_max, 659 il->qos_data.def_qos_parm.ac[i].cw_max,
662 ctx->qos_data.def_qos_parm.ac[i].aifsn, 660 il->qos_data.def_qos_parm.ac[i].aifsn,
663 ctx->qos_data.def_qos_parm.ac[i].edca_txop); 661 il->qos_data.def_qos_parm.ac[i].edca_txop);
664 } 662 }
665 663
666 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); 664 return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
@@ -729,7 +727,7 @@ il_dbgfs_traffic_log_read(struct file *file, char __user *user_buf,
729 char *buf; 727 char *buf;
730 int bufsz = 728 int bufsz =
731 ((IL_TRAFFIC_ENTRIES * IL_TRAFFIC_ENTRY_SIZE * 64) * 2) + 729 ((IL_TRAFFIC_ENTRIES * IL_TRAFFIC_ENTRY_SIZE * 64) * 2) +
732 (il->cfg->base_params->num_of_queues * 32 * 8) + 400; 730 (il->cfg->num_of_queues * 32 * 8) + 400;
733 const u8 *ptr; 731 const u8 *ptr;
734 ssize_t ret; 732 ssize_t ret;
735 733
@@ -835,7 +833,7 @@ il_dbgfs_tx_queue_read(struct file *file, char __user *user_buf, size_t count,
835 int cnt; 833 int cnt;
836 int ret; 834 int ret;
837 const size_t bufsz = 835 const size_t bufsz =
838 sizeof(char) * 64 * il->cfg->base_params->num_of_queues; 836 sizeof(char) * 64 * il->cfg->num_of_queues;
839 837
840 if (!il->txq) { 838 if (!il->txq) {
841 IL_ERR("txq not ready\n"); 839 IL_ERR("txq not ready\n");
@@ -903,8 +901,7 @@ il_dbgfs_ucode_rx_stats_read(struct file *file, char __user *user_buf,
903 size_t count, loff_t *ppos) 901 size_t count, loff_t *ppos)
904{ 902{
905 struct il_priv *il = file->private_data; 903 struct il_priv *il = file->private_data;
906 return il->cfg->ops->lib->debugfs_ops.rx_stats_read(file, user_buf, 904 return il->ops->lib->debugfs_ops.rx_stats_read(file, user_buf, count, ppos);
907 count, ppos);
908} 905}
909 906
910static ssize_t 907static ssize_t
@@ -912,8 +909,7 @@ il_dbgfs_ucode_tx_stats_read(struct file *file, char __user *user_buf,
912 size_t count, loff_t *ppos) 909 size_t count, loff_t *ppos)
913{ 910{
914 struct il_priv *il = file->private_data; 911 struct il_priv *il = file->private_data;
915 return il->cfg->ops->lib->debugfs_ops.tx_stats_read(file, user_buf, 912 return il->ops->lib->debugfs_ops.tx_stats_read(file, user_buf, count, ppos);
916 count, ppos);
917} 913}
918 914
919static ssize_t 915static ssize_t
@@ -921,8 +917,7 @@ il_dbgfs_ucode_general_stats_read(struct file *file, char __user *user_buf,
921 size_t count, loff_t *ppos) 917 size_t count, loff_t *ppos)
922{ 918{
923 struct il_priv *il = file->private_data; 919 struct il_priv *il = file->private_data;
924 return il->cfg->ops->lib->debugfs_ops.general_stats_read(file, user_buf, 920 return il->ops->lib->debugfs_ops.general_stats_read(file, user_buf, count, ppos);
925 count, ppos);
926} 921}
927 922
928static ssize_t 923static ssize_t
@@ -1153,7 +1148,7 @@ il_dbgfs_rxon_flags_read(struct file *file, char __user *user_buf,
1153 int len = 0; 1148 int len = 0;
1154 char buf[20]; 1149 char buf[20];
1155 1150
1156 len = sprintf(buf, "0x%04X\n", le32_to_cpu(il->ctx.active.flags)); 1151 len = sprintf(buf, "0x%04X\n", le32_to_cpu(il->active.flags));
1157 return simple_read_from_buffer(user_buf, count, ppos, buf, len); 1152 return simple_read_from_buffer(user_buf, count, ppos, buf, len);
1158} 1153}
1159 1154
@@ -1167,7 +1162,7 @@ il_dbgfs_rxon_filter_flags_read(struct file *file, char __user *user_buf,
1167 char buf[20]; 1162 char buf[20];
1168 1163
1169 len = 1164 len =
1170 sprintf(buf, "0x%04X\n", le32_to_cpu(il->ctx.active.filter_flags)); 1165 sprintf(buf, "0x%04X\n", le32_to_cpu(il->active.filter_flags));
1171 return simple_read_from_buffer(user_buf, count, ppos, buf, len); 1166 return simple_read_from_buffer(user_buf, count, ppos, buf, len);
1172} 1167}
1173 1168
@@ -1180,8 +1175,8 @@ il_dbgfs_fh_reg_read(struct file *file, char __user *user_buf, size_t count,
1180 int pos = 0; 1175 int pos = 0;
1181 ssize_t ret = -EFAULT; 1176 ssize_t ret = -EFAULT;
1182 1177
1183 if (il->cfg->ops->lib->dump_fh) { 1178 if (il->ops->lib->dump_fh) {
1184 ret = pos = il->cfg->ops->lib->dump_fh(il, &buf, true); 1179 ret = pos = il->ops->lib->dump_fh(il, &buf, true);
1185 if (buf) { 1180 if (buf) {
1186 ret = 1181 ret =
1187 simple_read_from_buffer(user_buf, count, ppos, buf, 1182 simple_read_from_buffer(user_buf, count, ppos, buf,
@@ -1298,7 +1293,7 @@ il_dbgfs_wd_timeout_write(struct file *file, const char __user *user_buf,
1298 if (timeout < 0 || timeout > IL_MAX_WD_TIMEOUT) 1293 if (timeout < 0 || timeout > IL_MAX_WD_TIMEOUT)
1299 timeout = IL_DEF_WD_TIMEOUT; 1294 timeout = IL_DEF_WD_TIMEOUT;
1300 1295
1301 il->cfg->base_params->wd_timeout = timeout; 1296 il->cfg->wd_timeout = timeout;
1302 il_setup_watchdog(il); 1297 il_setup_watchdog(il);
1303 return count; 1298 return count;
1304} 1299}
@@ -1372,17 +1367,17 @@ il_dbgfs_register(struct il_priv *il, const char *name)
1372 DEBUGFS_ADD_FILE(ucode_tx_stats, dir_debug, S_IRUSR); 1367 DEBUGFS_ADD_FILE(ucode_tx_stats, dir_debug, S_IRUSR);
1373 DEBUGFS_ADD_FILE(ucode_general_stats, dir_debug, S_IRUSR); 1368 DEBUGFS_ADD_FILE(ucode_general_stats, dir_debug, S_IRUSR);
1374 1369
1375 if (il->cfg->base_params->sensitivity_calib_by_driver) 1370 if (il->cfg->sensitivity_calib_by_driver)
1376 DEBUGFS_ADD_FILE(sensitivity, dir_debug, S_IRUSR); 1371 DEBUGFS_ADD_FILE(sensitivity, dir_debug, S_IRUSR);
1377 if (il->cfg->base_params->chain_noise_calib_by_driver) 1372 if (il->cfg->chain_noise_calib_by_driver)
1378 DEBUGFS_ADD_FILE(chain_noise, dir_debug, S_IRUSR); 1373 DEBUGFS_ADD_FILE(chain_noise, dir_debug, S_IRUSR);
1379 DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR); 1374 DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR);
1380 DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR); 1375 DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR);
1381 DEBUGFS_ADD_FILE(wd_timeout, dir_debug, S_IWUSR); 1376 DEBUGFS_ADD_FILE(wd_timeout, dir_debug, S_IWUSR);
1382 if (il->cfg->base_params->sensitivity_calib_by_driver) 1377 if (il->cfg->sensitivity_calib_by_driver)
1383 DEBUGFS_ADD_BOOL(disable_sensitivity, dir_rf, 1378 DEBUGFS_ADD_BOOL(disable_sensitivity, dir_rf,
1384 &il->disable_sens_cal); 1379 &il->disable_sens_cal);
1385 if (il->cfg->base_params->chain_noise_calib_by_driver) 1380 if (il->cfg->chain_noise_calib_by_driver)
1386 DEBUGFS_ADD_BOOL(disable_chain_noise, dir_rf, 1381 DEBUGFS_ADD_BOOL(disable_chain_noise, dir_rf,
1387 &il->disable_chain_noise_cal); 1382 &il->disable_chain_noise_cal);
1388 DEBUGFS_ADD_BOOL(disable_tx_power, dir_rf, &il->disable_tx_power_cal); 1383 DEBUGFS_ADD_BOOL(disable_tx_power, dir_rf, &il->disable_tx_power_cal);