Commit 5e88ba62 authored by Zefir Kurtisi's avatar Zefir Kurtisi Committed by John W. Linville

ath9k: replace snprintf() with scnprintf()

Whenever the return value of snprintf() is used to calculate
remaining buffer-space, we wanted to use sncprintf() instead.

Indentation is adapted where possible. Some lines exceed the
line width limit, either they did it already before, or
since they can not be broken reasonably well.
Signed-off-by: default avatarZefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent bf7c756c
...@@ -3427,12 +3427,12 @@ static u32 ath9k_hw_ar9003_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr, ...@@ -3427,12 +3427,12 @@ static u32 ath9k_hw_ar9003_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
struct ar9300_base_eep_hdr *pBase; struct ar9300_base_eep_hdr *pBase;
if (!dump_base_hdr) { if (!dump_base_hdr) {
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s :\n", "2GHz modal Header"); "%20s :\n", "2GHz modal Header");
len = ar9003_dump_modal_eeprom(buf, len, size, len = ar9003_dump_modal_eeprom(buf, len, size,
&eep->modalHeader2G); &eep->modalHeader2G);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s :\n", "5GHz modal Header"); "%20s :\n", "5GHz modal Header");
len = ar9003_dump_modal_eeprom(buf, len, size, len = ar9003_dump_modal_eeprom(buf, len, size,
&eep->modalHeader5G); &eep->modalHeader5G);
goto out; goto out;
...@@ -3482,8 +3482,8 @@ static u32 ath9k_hw_ar9003_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr, ...@@ -3482,8 +3482,8 @@ static u32 ath9k_hw_ar9003_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
PR_EEP("Rx Gain", pBase->txrxgain & 0xf); PR_EEP("Rx Gain", pBase->txrxgain & 0xf);
PR_EEP("SW Reg", le32_to_cpu(pBase->swreg)); PR_EEP("SW Reg", le32_to_cpu(pBase->swreg));
len += snprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress", len += scnprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress",
ah->eeprom.ar9300_eep.macAddr); ah->eeprom.ar9300_eep.macAddr);
out: out:
if (len > size) if (len > size)
len = size; len = size;
......
...@@ -459,8 +459,8 @@ void ath9k_queue_reset(struct ath_softc *sc, enum ath_reset_type type); ...@@ -459,8 +459,8 @@ void ath9k_queue_reset(struct ath_softc *sc, enum ath_reset_type type);
#define ATH_DUMP_BTCOEX(_s, _val) \ #define ATH_DUMP_BTCOEX(_s, _val) \
do { \ do { \
len += snprintf(buf + len, size - len, \ len += scnprintf(buf + len, size - len, \
"%20s : %10d\n", _s, (_val)); \ "%20s : %10d\n", _s, (_val)); \
} while (0) } while (0)
enum bt_op_flags { enum bt_op_flags {
......
...@@ -104,37 +104,37 @@ static ssize_t read_file_ani(struct file *file, char __user *user_buf, ...@@ -104,37 +104,37 @@ static ssize_t read_file_ani(struct file *file, char __user *user_buf,
return -ENOMEM; return -ENOMEM;
if (common->disable_ani) { if (common->disable_ani) {
len += snprintf(buf + len, size - len, "%s: %s\n", len += scnprintf(buf + len, size - len, "%s: %s\n",
"ANI", "DISABLED"); "ANI", "DISABLED");
goto exit; goto exit;
} }
len += snprintf(buf + len, size - len, "%15s: %s\n", len += scnprintf(buf + len, size - len, "%15s: %s\n",
"ANI", "ENABLED"); "ANI", "ENABLED");
len += snprintf(buf + len, size - len, "%15s: %u\n", len += scnprintf(buf + len, size - len, "%15s: %u\n",
"ANI RESET", ah->stats.ast_ani_reset); "ANI RESET", ah->stats.ast_ani_reset);
len += snprintf(buf + len, size - len, "%15s: %u\n", len += scnprintf(buf + len, size - len, "%15s: %u\n",
"SPUR UP", ah->stats.ast_ani_spurup); "SPUR UP", ah->stats.ast_ani_spurup);
len += snprintf(buf + len, size - len, "%15s: %u\n", len += scnprintf(buf + len, size - len, "%15s: %u\n",
"SPUR DOWN", ah->stats.ast_ani_spurup); "SPUR DOWN", ah->stats.ast_ani_spurup);
len += snprintf(buf + len, size - len, "%15s: %u\n", len += scnprintf(buf + len, size - len, "%15s: %u\n",
"OFDM WS-DET ON", ah->stats.ast_ani_ofdmon); "OFDM WS-DET ON", ah->stats.ast_ani_ofdmon);
len += snprintf(buf + len, size - len, "%15s: %u\n", len += scnprintf(buf + len, size - len, "%15s: %u\n",
"OFDM WS-DET OFF", ah->stats.ast_ani_ofdmoff); "OFDM WS-DET OFF", ah->stats.ast_ani_ofdmoff);
len += snprintf(buf + len, size - len, "%15s: %u\n", len += scnprintf(buf + len, size - len, "%15s: %u\n",
"MRC-CCK ON", ah->stats.ast_ani_ccklow); "MRC-CCK ON", ah->stats.ast_ani_ccklow);
len += snprintf(buf + len, size - len, "%15s: %u\n", len += scnprintf(buf + len, size - len, "%15s: %u\n",
"MRC-CCK OFF", ah->stats.ast_ani_cckhigh); "MRC-CCK OFF", ah->stats.ast_ani_cckhigh);
len += snprintf(buf + len, size - len, "%15s: %u\n", len += scnprintf(buf + len, size - len, "%15s: %u\n",
"FIR-STEP UP", ah->stats.ast_ani_stepup); "FIR-STEP UP", ah->stats.ast_ani_stepup);
len += snprintf(buf + len, size - len, "%15s: %u\n", len += scnprintf(buf + len, size - len, "%15s: %u\n",
"FIR-STEP DOWN", ah->stats.ast_ani_stepdown); "FIR-STEP DOWN", ah->stats.ast_ani_stepdown);
len += snprintf(buf + len, size - len, "%15s: %u\n", len += scnprintf(buf + len, size - len, "%15s: %u\n",
"INV LISTENTIME", ah->stats.ast_ani_lneg_or_lzero); "INV LISTENTIME", ah->stats.ast_ani_lneg_or_lzero);
len += snprintf(buf + len, size - len, "%15s: %u\n", len += scnprintf(buf + len, size - len, "%15s: %u\n",
"OFDM ERRORS", ah->stats.ast_ani_ofdmerrs); "OFDM ERRORS", ah->stats.ast_ani_ofdmerrs);
len += snprintf(buf + len, size - len, "%15s: %u\n", len += scnprintf(buf + len, size - len, "%15s: %u\n",
"CCK ERRORS", ah->stats.ast_ani_cckerrs); "CCK ERRORS", ah->stats.ast_ani_cckerrs);
exit: exit:
if (len > size) if (len > size)
len = size; len = size;
...@@ -280,70 +280,70 @@ static ssize_t read_file_antenna_diversity(struct file *file, ...@@ -280,70 +280,70 @@ static ssize_t read_file_antenna_diversity(struct file *file,
return -ENOMEM; return -ENOMEM;
if (!(pCap->hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB)) { if (!(pCap->hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB)) {
len += snprintf(buf + len, size - len, "%s\n", len += scnprintf(buf + len, size - len, "%s\n",
"Antenna Diversity Combining is disabled"); "Antenna Diversity Combining is disabled");
goto exit; goto exit;
} }
ath9k_ps_wakeup(sc); ath9k_ps_wakeup(sc);
ath9k_hw_antdiv_comb_conf_get(ah, &div_ant_conf); ath9k_hw_antdiv_comb_conf_get(ah, &div_ant_conf);
len += snprintf(buf + len, size - len, "Current MAIN config : %s\n", len += scnprintf(buf + len, size - len, "Current MAIN config : %s\n",
lna_conf_str[div_ant_conf.main_lna_conf]); lna_conf_str[div_ant_conf.main_lna_conf]);
len += snprintf(buf + len, size - len, "Current ALT config : %s\n", len += scnprintf(buf + len, size - len, "Current ALT config : %s\n",
lna_conf_str[div_ant_conf.alt_lna_conf]); lna_conf_str[div_ant_conf.alt_lna_conf]);
len += snprintf(buf + len, size - len, "Average MAIN RSSI : %d\n", len += scnprintf(buf + len, size - len, "Average MAIN RSSI : %d\n",
as_main->rssi_avg); as_main->rssi_avg);
len += snprintf(buf + len, size - len, "Average ALT RSSI : %d\n\n", len += scnprintf(buf + len, size - len, "Average ALT RSSI : %d\n\n",
as_alt->rssi_avg); as_alt->rssi_avg);
ath9k_ps_restore(sc); ath9k_ps_restore(sc);
len += snprintf(buf + len, size - len, "Packet Receive Cnt:\n"); len += scnprintf(buf + len, size - len, "Packet Receive Cnt:\n");
len += snprintf(buf + len, size - len, "-------------------\n"); len += scnprintf(buf + len, size - len, "-------------------\n");
len += snprintf(buf + len, size - len, "%30s%15s\n", len += scnprintf(buf + len, size - len, "%30s%15s\n",
"MAIN", "ALT"); "MAIN", "ALT");
len += snprintf(buf + len, size - len, "%-14s:%15d%15d\n", len += scnprintf(buf + len, size - len, "%-14s:%15d%15d\n",
"TOTAL COUNT", "TOTAL COUNT",
as_main->recv_cnt, as_main->recv_cnt,
as_alt->recv_cnt); as_alt->recv_cnt);
len += snprintf(buf + len, size - len, "%-14s:%15d%15d\n", len += scnprintf(buf + len, size - len, "%-14s:%15d%15d\n",
"LNA1", "LNA1",
as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1], as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1],
as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1]); as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1]);
len += snprintf(buf + len, size - len, "%-14s:%15d%15d\n", len += scnprintf(buf + len, size - len, "%-14s:%15d%15d\n",
"LNA2", "LNA2",
as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA2], as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA2],
as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA2]); as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA2]);
len += snprintf(buf + len, size - len, "%-14s:%15d%15d\n", len += scnprintf(buf + len, size - len, "%-14s:%15d%15d\n",
"LNA1 + LNA2", "LNA1 + LNA2",
as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2], as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2],
as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2]); as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2]);
len += snprintf(buf + len, size - len, "%-14s:%15d%15d\n", len += scnprintf(buf + len, size - len, "%-14s:%15d%15d\n",
"LNA1 - LNA2", "LNA1 - LNA2",
as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2], as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2],
as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2]); as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2]);
len += snprintf(buf + len, size - len, "\nLNA Config Attempts:\n"); len += scnprintf(buf + len, size - len, "\nLNA Config Attempts:\n");
len += snprintf(buf + len, size - len, "--------------------\n"); len += scnprintf(buf + len, size - len, "--------------------\n");
len += snprintf(buf + len, size - len, "%30s%15s\n", len += scnprintf(buf + len, size - len, "%30s%15s\n",
"MAIN", "ALT"); "MAIN", "ALT");
len += snprintf(buf + len, size - len, "%-14s:%15d%15d\n", len += scnprintf(buf + len, size - len, "%-14s:%15d%15d\n",
"LNA1", "LNA1",
as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1], as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1],
as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1]); as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1]);
len += snprintf(buf + len, size - len, "%-14s:%15d%15d\n", len += scnprintf(buf + len, size - len, "%-14s:%15d%15d\n",
"LNA2", "LNA2",
as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA2], as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA2],
as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA2]); as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA2]);
len += snprintf(buf + len, size - len, "%-14s:%15d%15d\n", len += scnprintf(buf + len, size - len, "%-14s:%15d%15d\n",
"LNA1 + LNA2", "LNA1 + LNA2",
as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2], as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2],
as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2]); as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2]);
len += snprintf(buf + len, size - len, "%-14s:%15d%15d\n", len += scnprintf(buf + len, size - len, "%-14s:%15d%15d\n",
"LNA1 - LNA2", "LNA1 - LNA2",
as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2], as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2],
as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2]); as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2]);
exit: exit:
if (len > size) if (len > size)
...@@ -385,21 +385,21 @@ static ssize_t read_file_dma(struct file *file, char __user *user_buf, ...@@ -385,21 +385,21 @@ static ssize_t read_file_dma(struct file *file, char __user *user_buf,
(AR_MACMISC_MISC_OBS_BUS_1 << (AR_MACMISC_MISC_OBS_BUS_1 <<
AR_MACMISC_MISC_OBS_BUS_MSB_S))); AR_MACMISC_MISC_OBS_BUS_MSB_S)));
len += snprintf(buf + len, DMA_BUF_LEN - len, len += scnprintf(buf + len, DMA_BUF_LEN - len,
"Raw DMA Debug values:\n"); "Raw DMA Debug values:\n");
for (i = 0; i < ATH9K_NUM_DMA_DEBUG_REGS; i++) { for (i = 0; i < ATH9K_NUM_DMA_DEBUG_REGS; i++) {
if (i % 4 == 0) if (i % 4 == 0)
len += snprintf(buf + len, DMA_BUF_LEN - len, "\n"); len += scnprintf(buf + len, DMA_BUF_LEN - len, "\n");
val[i] = REG_READ_D(ah, AR_DMADBG_0 + (i * sizeof(u32))); val[i] = REG_READ_D(ah, AR_DMADBG_0 + (i * sizeof(u32)));
len += snprintf(buf + len, DMA_BUF_LEN - len, "%d: %08x ", len += scnprintf(buf + len, DMA_BUF_LEN - len, "%d: %08x ",
i, val[i]); i, val[i]);
} }
len += snprintf(buf + len, DMA_BUF_LEN - len, "\n\n"); len += scnprintf(buf + len, DMA_BUF_LEN - len, "\n\n");
len += snprintf(buf + len, DMA_BUF_LEN - len, len += scnprintf(buf + len, DMA_BUF_LEN - len,
"Num QCU: chain_st fsp_ok fsp_st DCU: chain_st\n"); "Num QCU: chain_st fsp_ok fsp_st DCU: chain_st\n");
for (i = 0; i < ATH9K_NUM_QUEUES; i++, qcuOffset += 4, dcuOffset += 5) { for (i = 0; i < ATH9K_NUM_QUEUES; i++, qcuOffset += 4, dcuOffset += 5) {
if (i == 8) { if (i == 8) {
...@@ -412,39 +412,39 @@ static ssize_t read_file_dma(struct file *file, char __user *user_buf, ...@@ -412,39 +412,39 @@ static ssize_t read_file_dma(struct file *file, char __user *user_buf,
dcuBase++; dcuBase++;
} }
len += snprintf(buf + len, DMA_BUF_LEN - len, len += scnprintf(buf + len, DMA_BUF_LEN - len,
"%2d %2x %1x %2x %2x\n", "%2d %2x %1x %2x %2x\n",
i, (*qcuBase & (0x7 << qcuOffset)) >> qcuOffset, i, (*qcuBase & (0x7 << qcuOffset)) >> qcuOffset,
(*qcuBase & (0x8 << qcuOffset)) >> (qcuOffset + 3), (*qcuBase & (0x8 << qcuOffset)) >> (qcuOffset + 3),
val[2] & (0x7 << (i * 3)) >> (i * 3), val[2] & (0x7 << (i * 3)) >> (i * 3),
(*dcuBase & (0x1f << dcuOffset)) >> dcuOffset); (*dcuBase & (0x1f << dcuOffset)) >> dcuOffset);
} }
len += snprintf(buf + len, DMA_BUF_LEN - len, "\n"); len += scnprintf(buf + len, DMA_BUF_LEN - len, "\n");
len += snprintf(buf + len, DMA_BUF_LEN - len, len += scnprintf(buf + len, DMA_BUF_LEN - len,
"qcu_stitch state: %2x qcu_fetch state: %2x\n", "qcu_stitch state: %2x qcu_fetch state: %2x\n",
(val[3] & 0x003c0000) >> 18, (val[3] & 0x03c00000) >> 22); (val[3] & 0x003c0000) >> 18, (val[3] & 0x03c00000) >> 22);
len += snprintf(buf + len, DMA_BUF_LEN - len, len += scnprintf(buf + len, DMA_BUF_LEN - len,
"qcu_complete state: %2x dcu_complete state: %2x\n", "qcu_complete state: %2x dcu_complete state: %2x\n",
(val[3] & 0x1c000000) >> 26, (val[6] & 0x3)); (val[3] & 0x1c000000) >> 26, (val[6] & 0x3));
len += snprintf(buf + len, DMA_BUF_LEN - len, len += scnprintf(buf + len, DMA_BUF_LEN - len,
"dcu_arb state: %2x dcu_fp state: %2x\n", "dcu_arb state: %2x dcu_fp state: %2x\n",
(val[5] & 0x06000000) >> 25, (val[5] & 0x38000000) >> 27); (val[5] & 0x06000000) >> 25, (val[5] & 0x38000000) >> 27);
len += snprintf(buf + len, DMA_BUF_LEN - len, len += scnprintf(buf + len, DMA_BUF_LEN - len,
"chan_idle_dur: %3d chan_idle_dur_valid: %1d\n", "chan_idle_dur: %3d chan_idle_dur_valid: %1d\n",
(val[6] & 0x000003fc) >> 2, (val[6] & 0x00000400) >> 10); (val[6] & 0x000003fc) >> 2, (val[6] & 0x00000400) >> 10);
len += snprintf(buf + len, DMA_BUF_LEN - len, len += scnprintf(buf + len, DMA_BUF_LEN - len,
"txfifo_valid_0: %1d txfifo_valid_1: %1d\n", "txfifo_valid_0: %1d txfifo_valid_1: %1d\n",
(val[6] & 0x00000800) >> 11, (val[6] & 0x00001000) >> 12); (val[6] & 0x00000800) >> 11, (val[6] & 0x00001000) >> 12);
len += snprintf(buf + len, DMA_BUF_LEN - len, len += scnprintf(buf + len, DMA_BUF_LEN - len,
"txfifo_dcu_num_0: %2d txfifo_dcu_num_1: %2d\n", "txfifo_dcu_num_0: %2d txfifo_dcu_num_1: %2d\n",
(val[6] & 0x0001e000) >> 13, (val[6] & 0x001e0000) >> 17); (val[6] & 0x0001e000) >> 13, (val[6] & 0x001e0000) >> 17);
len += snprintf(buf + len, DMA_BUF_LEN - len, "pcu observe: 0x%x\n", len += scnprintf(buf + len, DMA_BUF_LEN - len, "pcu observe: 0x%x\n",
REG_READ_D(ah, AR_OBS_BUS_1)); REG_READ_D(ah, AR_OBS_BUS_1));
len += snprintf(buf + len, DMA_BUF_LEN - len, len += scnprintf(buf + len, DMA_BUF_LEN - len,
"AR_CR: 0x%x\n", REG_READ_D(ah, AR_CR)); "AR_CR: 0x%x\n", REG_READ_D(ah, AR_CR));
ath9k_ps_restore(sc); ath9k_ps_restore(sc);
...@@ -530,9 +530,9 @@ static ssize_t read_file_interrupt(struct file *file, char __user *user_buf, ...@@ -530,9 +530,9 @@ static ssize_t read_file_interrupt(struct file *file, char __user *user_buf,
#define PR_IS(a, s) \ #define PR_IS(a, s) \
do { \ do { \
len += snprintf(buf + len, mxlen - len, \ len += scnprintf(buf + len, mxlen - len, \
"%21s: %10u\n", a, \ "%21s: %10u\n", a, \
sc->debug.stats.istats.s); \ sc->debug.stats.istats.s); \
} while (0) } while (0)
if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) { if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) {
...@@ -563,8 +563,8 @@ static ssize_t read_file_interrupt(struct file *file, char __user *user_buf, ...@@ -563,8 +563,8 @@ static ssize_t read_file_interrupt(struct file *file, char __user *user_buf,
PR_IS("GENTIMER", gen_timer); PR_IS("GENTIMER", gen_timer);
PR_IS("TOTAL", total); PR_IS("TOTAL", total);
len += snprintf(buf + len, mxlen - len, len += scnprintf(buf + len, mxlen - len,
"SYNC_CAUSE stats:\n"); "SYNC_CAUSE stats:\n");
PR_IS("Sync-All", sync_cause_all); PR_IS("Sync-All", sync_cause_all);
PR_IS("RTC-IRQ", sync_rtc_irq); PR_IS("RTC-IRQ", sync_rtc_irq);
...@@ -655,16 +655,16 @@ static ssize_t print_queue(struct ath_softc *sc, struct ath_txq *txq, ...@@ -655,16 +655,16 @@ static ssize_t print_queue(struct ath_softc *sc, struct ath_txq *txq,
ath_txq_lock(sc, txq); ath_txq_lock(sc, txq);
len += snprintf(buf + len, size - len, "%s: %d ", len += scnprintf(buf + len, size - len, "%s: %d ",
"qnum", txq->axq_qnum); "qnum", txq->axq_qnum);
len += snprintf(buf + len, size - len, "%s: %2d ", len += scnprintf(buf + len, size - len, "%s: %2d ",
"qdepth", txq->axq_depth); "qdepth", txq->axq_depth);
len += snprintf(buf + len, size - len, "%s: %2d ", len += scnprintf(buf + len, size - len, "%s: %2d ",
"ampdu-depth", txq->axq_ampdu_depth); "ampdu-depth", txq->axq_ampdu_depth);
len += snprintf(buf + len, size - len, "%s: %3d ", len += scnprintf(buf + len, size - len, "%s: %3d ",
"pending", txq->pending_frames); "pending", txq->pending_frames);
len += snprintf(buf + len, size - len, "%s: %d\n", len += scnprintf(buf + len, size - len, "%s: %d\n",
"stopped", txq->stopped); "stopped", txq->stopped);
ath_txq_unlock(sc, txq); ath_txq_unlock(sc, txq);
return len; return len;
...@@ -687,11 +687,11 @@ static ssize_t read_file_queues(struct file *file, char __user *user_buf, ...@@ -687,11 +687,11 @@ static ssize_t read_file_queues(struct file *file, char __user *user_buf,
for (i = 0; i < IEEE80211_NUM_ACS; i++) { for (i = 0; i < IEEE80211_NUM_ACS; i++) {
txq = sc->tx.txq_map[i]; txq = sc->tx.txq_map[i];
len += snprintf(buf + len, size - len, "(%s): ", qname[i]); len += scnprintf(buf + len, size - len, "(%s): ", qname[i]);
len += print_queue(sc, txq, buf + len, size - len); len += print_queue(sc, txq, buf + len, size - len);
} }
len += snprintf(buf + len, size - len, "(CAB): "); len += scnprintf(buf + len, size - len, "(CAB): ");
len += print_queue(sc, sc->beacon.cabq, buf + len, size - len); len += print_queue(sc, sc->beacon.cabq, buf + len, size - len);
if (len > size) if (len > size)
...@@ -716,80 +716,82 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf, ...@@ -716,80 +716,82 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf,
unsigned int reg; unsigned int reg;
u32 rxfilter; u32 rxfilter;
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"BSSID: %pM\n", common->curbssid); "BSSID: %pM\n", common->curbssid);
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"BSSID-MASK: %pM\n", common->bssidmask); "BSSID-MASK: %pM\n", common->bssidmask);
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"OPMODE: %s\n", ath_opmode_to_string(sc->sc_ah->opmode)); "OPMODE: %s\n",
ath_opmode_to_string(sc->sc_ah->opmode));
ath9k_ps_wakeup(sc); ath9k_ps_wakeup(sc);
rxfilter = ath9k_hw_getrxfilter(sc->sc_ah); rxfilter = ath9k_hw_getrxfilter(sc->sc_ah);
ath9k_ps_restore(sc); ath9k_ps_restore(sc);
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"RXFILTER: 0x%x", rxfilter); "RXFILTER: 0x%x", rxfilter);
if (rxfilter & ATH9K_RX_FILTER_UCAST) if (rxfilter & ATH9K_RX_FILTER_UCAST)
len += snprintf(buf + len, sizeof(buf) - len, " UCAST"); len += scnprintf(buf + len, sizeof(buf) - len, " UCAST");
if (rxfilter & ATH9K_RX_FILTER_MCAST) if (rxfilter & ATH9K_RX_FILTER_MCAST)
len += snprintf(buf + len, sizeof(buf) - len, " MCAST"); len += scnprintf(buf + len, sizeof(buf) - len, " MCAST");
if (rxfilter & ATH9K_RX_FILTER_BCAST) if (rxfilter & ATH9K_RX_FILTER_BCAST)
len += snprintf(buf + len, sizeof(buf) - len, " BCAST"); len += scnprintf(buf + len, sizeof(buf) - len, " BCAST");
if (rxfilter & ATH9K_RX_FILTER_CONTROL) if (rxfilter & ATH9K_RX_FILTER_CONTROL)
len += snprintf(buf + len, sizeof(buf) - len, " CONTROL"); len += scnprintf(buf + len, sizeof(buf) - len, " CONTROL");
if (rxfilter & ATH9K_RX_FILTER_BEACON) if (rxfilter & ATH9K_RX_FILTER_BEACON)
len += snprintf(buf + len, sizeof(buf) - len, " BEACON"); len += scnprintf(buf + len, sizeof(buf) - len, " BEACON");
if (rxfilter & ATH9K_RX_FILTER_PROM) if (rxfilter & ATH9K_RX_FILTER_PROM)
len += snprintf(buf + len, sizeof(buf) - len, " PROM"); len += scnprintf(buf + len, sizeof(buf) - len, " PROM");
if (rxfilter & ATH9K_RX_FILTER_PROBEREQ) if (rxfilter & ATH9K_RX_FILTER_PROBEREQ)
len += snprintf(buf + len, sizeof(buf) - len, " PROBEREQ"); len += scnprintf(buf + len, sizeof(buf) - len, " PROBEREQ");
if (rxfilter & ATH9K_RX_FILTER_PHYERR) if (rxfilter & ATH9K_RX_FILTER_PHYERR)
len += snprintf(buf + len, sizeof(buf) - len, " PHYERR"); len += scnprintf(buf + len, sizeof(buf) - len, " PHYERR");
if (rxfilter & ATH9K_RX_FILTER_MYBEACON) if (rxfilter & ATH9K_RX_FILTER_MYBEACON)
len += snprintf(buf + len, sizeof(buf) - len, " MYBEACON"); len += scnprintf(buf + len, sizeof(buf) - len, " MYBEACON");
if (rxfilter & ATH9K_RX_FILTER_COMP_BAR) if (rxfilter & ATH9K_RX_FILTER_COMP_BAR)
len += snprintf(buf + len, sizeof(buf) - len, " COMP_BAR"); len += scnprintf(buf + len, sizeof(buf) - len, " COMP_BAR");
if (rxfilter & ATH9K_RX_FILTER_PSPOLL) if (rxfilter & ATH9K_RX_FILTER_PSPOLL)
len += snprintf(buf + len, sizeof(buf) - len, " PSPOLL"); len += scnprintf(buf + len, sizeof(buf) - len, " PSPOLL");
if (rxfilter & ATH9K_RX_FILTER_PHYRADAR) if (rxfilter & ATH9K_RX_FILTER_PHYRADAR)
len += snprintf(buf + len, sizeof(buf) - len, " PHYRADAR"); len += scnprintf(buf + len, sizeof(buf) - len, " PHYRADAR");
if (rxfilter & ATH9K_RX_FILTER_MCAST_BCAST_ALL) if (rxfilter & ATH9K_RX_FILTER_MCAST_BCAST_ALL)
len += snprintf(buf + len, sizeof(buf) - len, " MCAST_BCAST_ALL"); len += scnprintf(buf + len, sizeof(buf) - len, " MCAST_BCAST_ALL");
if (rxfilter & ATH9K_RX_FILTER_CONTROL_WRAPPER) if (rxfilter & ATH9K_RX_FILTER_CONTROL_WRAPPER)
len += snprintf(buf + len, sizeof(buf) - len, " CONTROL_WRAPPER"); len += scnprintf(buf + len, sizeof(buf) - len, " CONTROL_WRAPPER");
len += snprintf(buf + len, sizeof(buf) - len, "\n"); len += scnprintf(buf + len, sizeof(buf) - len, "\n");
reg = sc->sc_ah->imask; reg = sc->sc_ah->imask;
len += snprintf(buf + len, sizeof(buf) - len, "INTERRUPT-MASK: 0x%x", reg); len += scnprintf(buf + len, sizeof(buf) - len,
"INTERRUPT-MASK: 0x%x", reg);
if (reg & ATH9K_INT_SWBA) if (reg & ATH9K_INT_SWBA)
len += snprintf(buf + len, sizeof(buf) - len, " SWBA"); len += scnprintf(buf + len, sizeof(buf) - len, " SWBA");
if (reg & ATH9K_INT_BMISS) if (reg & ATH9K_INT_BMISS)
len += snprintf(buf + len, sizeof(buf) - len, " BMISS"); len += scnprintf(buf + len, sizeof(buf) - len, " BMISS");
if (reg & ATH9K_INT_CST) if (reg & ATH9K_INT_CST)
len += snprintf(buf + len, sizeof(buf) - len, " CST"); len += scnprintf(buf + len, sizeof(buf) - len, " CST");
if (reg & ATH9K_INT_RX) if (reg & ATH9K_INT_RX)
len += snprintf(buf + len, sizeof(buf) - len, " RX"); len += scnprintf(buf + len, sizeof(buf) - len, " RX");
if (reg & ATH9K_INT_RXHP) if (reg & ATH9K_INT_RXHP)
len += snprintf(buf + len, sizeof(buf) - len, " RXHP"); len += scnprintf(buf + len, sizeof(buf) - len, " RXHP");
if (reg & ATH9K_INT_RXLP) if (reg & ATH9K_INT_RXLP)
len += snprintf(buf + len, sizeof(buf) - len, " RXLP"); len += scnprintf(buf + len, sizeof(buf) - len, " RXLP");
if (reg & ATH9K_INT_BB_WATCHDOG) if (reg & ATH9K_INT_BB_WATCHDOG)
len += snprintf(buf + len, sizeof(buf) - len, " BB_WATCHDOG"); len += scnprintf(buf + len, sizeof(buf) - len, " BB_WATCHDOG");
len += snprintf(buf + len, sizeof(buf) - len, "\n"); len += scnprintf(buf + len, sizeof(buf) - len, "\n");
ath9k_calculate_iter_data(hw, NULL, &iter_data); ath9k_calculate_iter_data(hw, NULL, &iter_data);
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"VIF-COUNTS: AP: %i STA: %i MESH: %i WDS: %i" "VIF-COUNTS: AP: %i STA: %i MESH: %i WDS: %i"
" ADHOC: %i TOTAL: %hi BEACON-VIF: %hi\n", " ADHOC: %i TOTAL: %hi BEACON-VIF: %hi\n",
iter_data.naps, iter_data.nstations, iter_data.nmeshes, iter_data.naps, iter_data.nstations, iter_data.nmeshes,
iter_data.nwds, iter_data.nadhocs, iter_data.nwds, iter_data.nadhocs,
sc->nvifs, sc->nbcnvifs); sc->nvifs, sc->nbcnvifs);
if (len > sizeof(buf)) if (len > sizeof(buf))
len = sizeof(buf); len = sizeof(buf);
...@@ -805,27 +807,27 @@ static ssize_t read_file_reset(struct file *file, char __user *user_buf, ...@@ -805,27 +807,27 @@ static ssize_t read_file_reset(struct file *file, char __user *user_buf,
char buf[512]; char buf[512];
unsigned int len = 0; unsigned int len = 0;
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%17s: %2d\n", "Baseband Hang", "%17s: %2d\n", "Baseband Hang",
sc->debug.stats.reset[RESET_TYPE_BB_HANG]); sc->debug.stats.reset[RESET_TYPE_BB_HANG]);
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%17s: %2d\n", "Baseband Watchdog", "%17s: %2d\n", "Baseband Watchdog",
sc->debug.stats.reset[RESET_TYPE_BB_WATCHDOG]); sc->debug.stats.reset[RESET_TYPE_BB_WATCHDOG]);
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%17s: %2d\n", "Fatal HW Error", "%17s: %2d\n", "Fatal HW Error",
sc->debug.stats.reset[RESET_TYPE_FATAL_INT]); sc->debug.stats.reset[RESET_TYPE_FATAL_INT]);
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%17s: %2d\n", "TX HW error", "%17s: %2d\n", "TX HW error",
sc->debug.stats.reset[RESET_TYPE_TX_ERROR]); sc->debug.stats.reset[RESET_TYPE_TX_ERROR]);
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%17s: %2d\n", "TX Path Hang", "%17s: %2d\n", "TX Path Hang",
sc->debug.stats.reset[RESET_TYPE_TX_HANG]); sc->debug.stats.reset[RESET_TYPE_TX_HANG]);
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%17s: %2d\n", "PLL RX Hang", "%17s: %2d\n", "PLL RX Hang",
sc->debug.stats.reset[RESET_TYPE_PLL_HANG]); sc->debug.stats.reset[RESET_TYPE_PLL_HANG]);
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%17s: %2d\n", "MCI Reset", "%17s: %2d\n", "MCI Reset",
sc->debug.stats.reset[RESET_TYPE_MCI]); sc->debug.stats.reset[RESET_TYPE_MCI]);
if (len > sizeof(buf)) if (len > sizeof(buf))
len = sizeof(buf); len = sizeof(buf);
...@@ -902,14 +904,14 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf, ...@@ -902,14 +904,14 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
#define PHY_ERR(s, p) \ #define PHY_ERR(s, p) \
len += snprintf(buf + len, size - len, "%22s : %10u\n", s, \ len += scnprintf(buf + len, size - len, "%22s : %10u\n", s, \
sc->debug.stats.rxstats.phy_err_stats[p]); sc->debug.stats.rxstats.phy_err_stats[p]);
#define RXS_ERR(s, e) \ #define RXS_ERR(s, e) \
do { \ do { \
len += snprintf(buf + len, size - len, \ len += scnprintf(buf + len, size - len, \
"%22s : %10u\n", s, \ "%22s : %10u\n", s, \
sc->debug.stats.rxstats.e); \ sc->debug.stats.rxstats.e);\
} while (0) } while (0)
struct ath_softc *sc = file->private_data; struct ath_softc *sc = file->private_data;
...@@ -1439,22 +1441,22 @@ static ssize_t read_file_dump_nfcal(struct file *file, char __user *user_buf, ...@@ -1439,22 +1441,22 @@ static ssize_t read_file_dump_nfcal(struct file *file, char __user *user_buf,
if (!buf) if (!buf)
return -ENOMEM; return -ENOMEM;
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"Channel Noise Floor : %d\n", ah->noise); "Channel Noise Floor : %d\n", ah->noise);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"Chain | privNF | # Readings | NF Readings\n"); "Chain | privNF | # Readings | NF Readings\n");
for (i = 0; i < NUM_NF_READINGS; i++) { for (i = 0; i < NUM_NF_READINGS; i++) {
if (!(chainmask & (1 << i)) || if (!(chainmask & (1 << i)) ||
((i >= AR5416_MAX_CHAINS) && !conf_is_ht40(conf))) ((i >= AR5416_MAX_CHAINS) && !conf_is_ht40(conf)))
continue; continue;
nread = AR_PHY_CCA_FILTERWINDOW_LENGTH - h[i].invalidNFcount; nread = AR_PHY_CCA_FILTERWINDOW_LENGTH - h[i].invalidNFcount;
len += snprintf(buf + len, size - len, " %d\t %d\t %d\t\t", len += scnprintf(buf + len, size - len, " %d\t %d\t %d\t\t",
i, h[i].privNF, nread); i, h[i].privNF, nread);
for (j = 0; j < nread; j++) for (j = 0; j < nread; j++)
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
" %d", h[i].nfCalBuffer[j]); " %d", h[i].nfCalBuffer[j]);
len += snprintf(buf + len, size - len, "\n"); len += scnprintf(buf + len, size - len, "\n");
} }
if (len > size) if (len > size)
...@@ -1543,8 +1545,8 @@ static ssize_t read_file_btcoex(struct file *file, char __user *user_buf, ...@@ -1543,8 +1545,8 @@ static ssize_t read_file_btcoex(struct file *file, char __user *user_buf,
return -ENOMEM; return -ENOMEM;
if (!sc->sc_ah->common.btcoex_enabled) { if (!sc->sc_ah->common.btcoex_enabled) {
len = snprintf(buf, size, "%s\n", len = scnprintf(buf, size, "%s\n",
"BTCOEX is disabled"); "BTCOEX is disabled");
goto exit; goto exit;
} }
...@@ -1582,43 +1584,43 @@ static ssize_t read_file_node_stat(struct file *file, char __user *user_buf, ...@@ -1582,43 +1584,43 @@ static ssize_t read_file_node_stat(struct file *file, char __user *user_buf,
return -ENOMEM; return -ENOMEM;
if (!an->sta->ht_cap.ht_supported) { if (!an->sta->ht_cap.ht_supported) {
len = snprintf(buf, size, "%s\n", len = scnprintf(buf, size, "%s\n",
"HT not supported"); "HT not supported");
goto exit; goto exit;
} }
len = snprintf(buf, size, "Max-AMPDU: %d\n", len = scnprintf(buf, size, "Max-AMPDU: %d\n",
an->maxampdu); an->maxampdu);
len += snprintf(buf + len, size - len, "MPDU Density: %d\n\n", len += scnprintf(buf + len, size - len, "MPDU Density: %d\n\n",
an->mpdudensity); an->mpdudensity);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%2s%7s\n", "AC", "SCHED"); "%2s%7s\n", "AC", "SCHED");
for (acno = 0, ac = &an->ac[acno]; for (acno = 0, ac = &an->ac[acno];
acno < IEEE80211_NUM_ACS; acno++, ac++) { acno < IEEE80211_NUM_ACS; acno++, ac++) {
txq = ac->txq; txq = ac->txq;
ath_txq_lock(sc, txq); ath_txq_lock(sc, txq);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%2d%7d\n", "%2d%7d\n",
acno, ac->sched); acno, ac->sched);
ath_txq_unlock(sc, txq); ath_txq_unlock(sc, txq);
} }
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"\n%3s%11s%10s%10s%10s%10s%9s%6s%8s\n", "\n%3s%11s%10s%10s%10s%10s%9s%6s%8s\n",
"TID", "SEQ_START", "SEQ_NEXT", "BAW_SIZE", "TID", "SEQ_START", "SEQ_NEXT", "BAW_SIZE",
"BAW_HEAD", "BAW_TAIL", "BAR_IDX", "SCHED", "PAUSED"); "BAW_HEAD", "BAW_TAIL", "BAR_IDX", "SCHED", "PAUSED");
for (tidno = 0, tid = &an->tid[tidno]; for (tidno = 0, tid = &an->tid[tidno];
tidno < IEEE80211_NUM_TIDS; tidno++, tid++) { tidno < IEEE80211_NUM_TIDS; tidno++, tid++) {
txq = tid->ac->txq; txq = tid->ac->txq;
ath_txq_lock(sc, txq); ath_txq_lock(sc, txq);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%3d%11d%10d%10d%10d%10d%9d%6d%8d\n", "%3d%11d%10d%10d%10d%10d%9d%6d%8d\n",
tid->tidno, tid->seq_start, tid->seq_next, tid->tidno, tid->seq_start, tid->seq_next,
tid->baw_size, tid->baw_head, tid->baw_tail, tid->baw_size, tid->baw_head, tid->baw_tail,
tid->bar_index, tid->sched, tid->paused); tid->bar_index, tid->sched, tid->paused);
ath_txq_unlock(sc, txq); ath_txq_unlock(sc, txq);
} }
exit: exit:
......
...@@ -193,12 +193,12 @@ struct ath_tx_stats { ...@@ -193,12 +193,12 @@ struct ath_tx_stats {
#define TXSTATS sc->debug.stats.txstats #define TXSTATS sc->debug.stats.txstats
#define PR(str, elem) \ #define PR(str, elem) \
do { \ do { \
len += snprintf(buf + len, size - len, \ len += scnprintf(buf + len, size - len, \
"%s%13u%11u%10u%10u\n", str, \ "%s%13u%11u%10u%10u\n", str, \
TXSTATS[PR_QNUM(IEEE80211_AC_BE)].elem, \ TXSTATS[PR_QNUM(IEEE80211_AC_BE)].elem,\
TXSTATS[PR_QNUM(IEEE80211_AC_BK)].elem, \ TXSTATS[PR_QNUM(IEEE80211_AC_BK)].elem,\
TXSTATS[PR_QNUM(IEEE80211_AC_VI)].elem, \ TXSTATS[PR_QNUM(IEEE80211_AC_VI)].elem,\
TXSTATS[PR_QNUM(IEEE80211_AC_VO)].elem); \ TXSTATS[PR_QNUM(IEEE80211_AC_VO)].elem); \
} while(0) } while(0)
#define RX_STAT_INC(c) (sc->debug.stats.rxstats.c++) #define RX_STAT_INC(c) (sc->debug.stats.rxstats.c++)
......
...@@ -25,11 +25,11 @@ ...@@ -25,11 +25,11 @@
struct ath_dfs_pool_stats global_dfs_pool_stats = { 0 }; struct ath_dfs_pool_stats global_dfs_pool_stats = { 0 };
#define ATH9K_DFS_STAT(s, p) \ #define ATH9K_DFS_STAT(s, p) \
len += snprintf(buf + len, size - len, "%28s : %10u\n", s, \ len += scnprintf(buf + len, size - len, "%28s : %10u\n", s, \
sc->debug.stats.dfs_stats.p); sc->debug.stats.dfs_stats.p);
#define ATH9K_DFS_POOL_STAT(s, p) \ #define ATH9K_DFS_POOL_STAT(s, p) \
len += snprintf(buf + len, size - len, "%28s : %10u\n", s, \ len += scnprintf(buf + len, size - len, "%28s : %10u\n", s, \
global_dfs_pool_stats.p); global_dfs_pool_stats.p);
static ssize_t read_file_dfs(struct file *file, char __user *user_buf, static ssize_t read_file_dfs(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
...@@ -44,12 +44,12 @@ static ssize_t read_file_dfs(struct file *file, char __user *user_buf, ...@@ -44,12 +44,12 @@ static ssize_t read_file_dfs(struct file *file, char __user *user_buf,
if (buf == NULL) if (buf == NULL)
return -ENOMEM; return -ENOMEM;
len += snprintf(buf + len, size - len, "DFS support for " len += scnprintf(buf + len, size - len, "DFS support for "
"macVersion = 0x%x, macRev = 0x%x: %s\n", "macVersion = 0x%x, macRev = 0x%x: %s\n",
hw_ver->macVersion, hw_ver->macRev, hw_ver->macVersion, hw_ver->macRev,
(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_DFS) ? (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_DFS) ?
"enabled" : "disabled"); "enabled" : "disabled");
len += snprintf(buf + len, size - len, "Pulse detector statistics:\n"); len += scnprintf(buf + len, size - len, "Pulse detector statistics:\n");
ATH9K_DFS_STAT("pulse events reported ", pulses_total); ATH9K_DFS_STAT("pulse events reported ", pulses_total);
ATH9K_DFS_STAT("invalid pulse events ", pulses_no_dfs); ATH9K_DFS_STAT("invalid pulse events ", pulses_no_dfs);
ATH9K_DFS_STAT("DFS pulses detected ", pulses_detected); ATH9K_DFS_STAT("DFS pulses detected ", pulses_detected);
...@@ -59,11 +59,12 @@ static ssize_t read_file_dfs(struct file *file, char __user *user_buf, ...@@ -59,11 +59,12 @@ static ssize_t read_file_dfs(struct file *file, char __user *user_buf,
ATH9K_DFS_STAT("Primary channel pulses ", pri_phy_errors); ATH9K_DFS_STAT("Primary channel pulses ", pri_phy_errors);
ATH9K_DFS_STAT("Secondary channel pulses", ext_phy_errors); ATH9K_DFS_STAT("Secondary channel pulses", ext_phy_errors);
ATH9K_DFS_STAT("Dual channel pulses ", dc_phy_errors); ATH9K_DFS_STAT("Dual channel pulses ", dc_phy_errors);
len += snprintf(buf + len, size - len, "Radar detector statistics " len += scnprintf(buf + len, size - len, "Radar detector statistics "
"(current DFS region: %d)\n", sc->dfs_detector->region); "(current DFS region: %d)\n",
sc->dfs_detector->region);
ATH9K_DFS_STAT("Pulse events processed ", pulses_processed); ATH9K_DFS_STAT("Pulse events processed ", pulses_processed);
ATH9K_DFS_STAT("Radars detected ", radar_detected); ATH9K_DFS_STAT("Radars detected ", radar_detected);
len += snprintf(buf + len, size - len, "Global Pool statistics:\n"); len += scnprintf(buf + len, size - len, "Global Pool statistics:\n");
ATH9K_DFS_POOL_STAT("Pool references ", pool_reference); ATH9K_DFS_POOL_STAT("Pool references ", pool_reference);
ATH9K_DFS_POOL_STAT("Pulses allocated ", pulse_allocated); ATH9K_DFS_POOL_STAT("Pulses allocated ", pulse_allocated);
ATH9K_DFS_POOL_STAT("Pulses alloc error ", pulse_alloc_error); ATH9K_DFS_POOL_STAT("Pulses alloc error ", pulse_alloc_error);
......
...@@ -129,10 +129,10 @@ static u32 ath9k_hw_4k_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr, ...@@ -129,10 +129,10 @@ static u32 ath9k_hw_4k_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
struct base_eep_header_4k *pBase = &eep->baseEepHeader; struct base_eep_header_4k *pBase = &eep->baseEepHeader;
if (!dump_base_hdr) { if (!dump_base_hdr) {
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s :\n", "2GHz modal Header"); "%20s :\n", "2GHz modal Header");
len = ath9k_dump_4k_modal_eeprom(buf, len, size, len = ath9k_dump_4k_modal_eeprom(buf, len, size,
&eep->modalHeader); &eep->modalHeader);
goto out; goto out;
} }
...@@ -160,8 +160,8 @@ static u32 ath9k_hw_4k_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr, ...@@ -160,8 +160,8 @@ static u32 ath9k_hw_4k_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
PR_EEP("Cal Bin Build", (pBase->binBuildNumber >> 8) & 0xFF); PR_EEP("Cal Bin Build", (pBase->binBuildNumber >> 8) & 0xFF);
PR_EEP("TX Gain type", pBase->txGainType); PR_EEP("TX Gain type", pBase->txGainType);
len += snprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress", len += scnprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress",
pBase->macAddr); pBase->macAddr);
out: out:
if (len > size) if (len > size)
......
...@@ -125,8 +125,8 @@ static u32 ath9k_hw_ar9287_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr, ...@@ -125,8 +125,8 @@ static u32 ath9k_hw_ar9287_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
struct base_eep_ar9287_header *pBase = &eep->baseEepHeader; struct base_eep_ar9287_header *pBase = &eep->baseEepHeader;
if (!dump_base_hdr) { if (!dump_base_hdr) {
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s :\n", "2GHz modal Header"); "%20s :\n", "2GHz modal Header");
len = ar9287_dump_modal_eeprom(buf, len, size, len = ar9287_dump_modal_eeprom(buf, len, size,
&eep->modalHeader); &eep->modalHeader);
goto out; goto out;
...@@ -157,8 +157,8 @@ static u32 ath9k_hw_ar9287_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr, ...@@ -157,8 +157,8 @@ static u32 ath9k_hw_ar9287_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
PR_EEP("Power Table Offset", pBase->pwrTableOffset); PR_EEP("Power Table Offset", pBase->pwrTableOffset);
PR_EEP("OpenLoop Power Ctrl", pBase->openLoopPwrCntl); PR_EEP("OpenLoop Power Ctrl", pBase->openLoopPwrCntl);
len += snprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress", len += scnprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress",
pBase->macAddr); pBase->macAddr);
out: out:
if (len > size) if (len > size)
......
...@@ -205,12 +205,12 @@ static u32 ath9k_hw_def_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr, ...@@ -205,12 +205,12 @@ static u32 ath9k_hw_def_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
struct base_eep_header *pBase = &eep->baseEepHeader; struct base_eep_header *pBase = &eep->baseEepHeader;
if (!dump_base_hdr) { if (!dump_base_hdr) {
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s :\n", "2GHz modal Header"); "%20s :\n", "2GHz modal Header");
len = ath9k_def_dump_modal_eeprom(buf, len, size, len = ath9k_def_dump_modal_eeprom(buf, len, size,
&eep->modalHeader[0]); &eep->modalHeader[0]);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s :\n", "5GHz modal Header"); "%20s :\n", "5GHz modal Header");
len = ath9k_def_dump_modal_eeprom(buf, len, size, len = ath9k_def_dump_modal_eeprom(buf, len, size,
&eep->modalHeader[1]); &eep->modalHeader[1]);
goto out; goto out;
...@@ -240,8 +240,8 @@ static u32 ath9k_hw_def_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr, ...@@ -240,8 +240,8 @@ static u32 ath9k_hw_def_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
PR_EEP("Cal Bin Build", (pBase->binBuildNumber >> 8) & 0xFF); PR_EEP("Cal Bin Build", (pBase->binBuildNumber >> 8) & 0xFF);
PR_EEP("OpenLoop Power Ctrl", pBase->openLoopPwrCntl); PR_EEP("OpenLoop Power Ctrl", pBase->openLoopPwrCntl);
len += snprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress", len += scnprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress",
pBase->macAddr); pBase->macAddr);
out: out:
if (len > size) if (len > size)
......
...@@ -522,22 +522,22 @@ static int ath9k_dump_mci_btcoex(struct ath_softc *sc, u8 *buf, u32 size) ...@@ -522,22 +522,22 @@ static int ath9k_dump_mci_btcoex(struct ath_softc *sc, u8 *buf, u32 size)
ATH_DUMP_BTCOEX("Concurrent Tx", btcoex_hw->mci.concur_tx); ATH_DUMP_BTCOEX("Concurrent Tx", btcoex_hw->mci.concur_tx);
ATH_DUMP_BTCOEX("Concurrent RSSI cnt", btcoex->rssi_count); ATH_DUMP_BTCOEX("Concurrent RSSI cnt", btcoex->rssi_count);
len += snprintf(buf + len, size - len, "BT Weights: "); len += scnprintf(buf + len, size - len, "BT Weights: ");
for (i = 0; i < AR9300_NUM_BT_WEIGHTS; i++) for (i = 0; i < AR9300_NUM_BT_WEIGHTS; i++)
len += snprintf(buf + len, size - len, "%08x ", len += scnprintf(buf + len, size - len, "%08x ",
btcoex_hw->bt_weight[i]); btcoex_hw->bt_weight[i]);
len += snprintf(buf + len, size - len, "\n"); len += scnprintf(buf + len, size - len, "\n");
len += snprintf(buf + len, size - len, "WLAN Weights: "); len += scnprintf(buf + len, size - len, "WLAN Weights: ");
for (i = 0; i < AR9300_NUM_BT_WEIGHTS; i++) for (i = 0; i < AR9300_NUM_BT_WEIGHTS; i++)
len += snprintf(buf + len, size - len, "%08x ", len += scnprintf(buf + len, size - len, "%08x ",
btcoex_hw->wlan_weight[i]); btcoex_hw->wlan_weight[i]);
len += snprintf(buf + len, size - len, "\n"); len += scnprintf(buf + len, size - len, "\n");
len += snprintf(buf + len, size - len, "Tx Priorities: "); len += scnprintf(buf + len, size - len, "Tx Priorities: ");
for (i = 0; i < ATH_BTCOEX_STOMP_MAX; i++) for (i = 0; i < ATH_BTCOEX_STOMP_MAX; i++)
len += snprintf(buf + len, size - len, "%08x ", len += scnprintf(buf + len, size - len, "%08x ",
btcoex_hw->tx_prio[i]); btcoex_hw->tx_prio[i]);
len += snprintf(buf + len, size - len, "\n"); len += scnprintf(buf + len, size - len, "\n");
return len; return len;
} }
......
...@@ -37,29 +37,29 @@ static ssize_t read_file_tgt_int_stats(struct file *file, char __user *user_buf, ...@@ -37,29 +37,29 @@ static ssize_t read_file_tgt_int_stats(struct file *file, char __user *user_buf,
ath9k_htc_ps_restore(priv); ath9k_htc_ps_restore(priv);
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "RX", "%20s : %10u\n", "RX",
be32_to_cpu(cmd_rsp.rx)); be32_to_cpu(cmd_rsp.rx));
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "RXORN", "%20s : %10u\n", "RXORN",
be32_to_cpu(cmd_rsp.rxorn)); be32_to_cpu(cmd_rsp.rxorn));
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "RXEOL", "%20s : %10u\n", "RXEOL",
be32_to_cpu(cmd_rsp.rxeol)); be32_to_cpu(cmd_rsp.rxeol));
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "TXURN", "%20s : %10u\n", "TXURN",
be32_to_cpu(cmd_rsp.txurn)); be32_to_cpu(cmd_rsp.txurn));
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "TXTO", "%20s : %10u\n", "TXTO",
be32_to_cpu(cmd_rsp.txto)); be32_to_cpu(cmd_rsp.txto));
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "CST", "%20s : %10u\n", "CST",
be32_to_cpu(cmd_rsp.cst)); be32_to_cpu(cmd_rsp.cst));
if (len > sizeof(buf)) if (len > sizeof(buf))
len = sizeof(buf); len = sizeof(buf);
...@@ -95,41 +95,41 @@ static ssize_t read_file_tgt_tx_stats(struct file *file, char __user *user_buf, ...@@ -95,41 +95,41 @@ static ssize_t read_file_tgt_tx_stats(struct file *file, char __user *user_buf,
ath9k_htc_ps_restore(priv); ath9k_htc_ps_restore(priv);
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "Xretries", "%20s : %10u\n", "Xretries",
be32_to_cpu(cmd_rsp.xretries)); be32_to_cpu(cmd_rsp.xretries));
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "FifoErr", "%20s : %10u\n", "FifoErr",
be32_to_cpu(cmd_rsp.fifoerr)); be32_to_cpu(cmd_rsp.fifoerr));
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "Filtered", "%20s : %10u\n", "Filtered",
be32_to_cpu(cmd_rsp.filtered)); be32_to_cpu(cmd_rsp.filtered));
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "TimerExp", "%20s : %10u\n", "TimerExp",
be32_to_cpu(cmd_rsp.timer_exp)); be32_to_cpu(cmd_rsp.timer_exp));
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "ShortRetries", "%20s : %10u\n", "ShortRetries",
be32_to_cpu(cmd_rsp.shortretries)); be32_to_cpu(cmd_rsp.shortretries));
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "LongRetries", "%20s : %10u\n", "LongRetries",
be32_to_cpu(cmd_rsp.longretries)); be32_to_cpu(cmd_rsp.longretries));
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "QueueNull", "%20s : %10u\n", "QueueNull",
be32_to_cpu(cmd_rsp.qnull)); be32_to_cpu(cmd_rsp.qnull));
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "EncapFail", "%20s : %10u\n", "EncapFail",
be32_to_cpu(cmd_rsp.encap_fail)); be32_to_cpu(cmd_rsp.encap_fail));
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "NoBuf", "%20s : %10u\n", "NoBuf",
be32_to_cpu(cmd_rsp.nobuf)); be32_to_cpu(cmd_rsp.nobuf));
if (len > sizeof(buf)) if (len > sizeof(buf))
len = sizeof(buf); len = sizeof(buf);
...@@ -165,17 +165,17 @@ static ssize_t read_file_tgt_rx_stats(struct file *file, char __user *user_buf, ...@@ -165,17 +165,17 @@ static ssize_t read_file_tgt_rx_stats(struct file *file, char __user *user_buf,
ath9k_htc_ps_restore(priv); ath9k_htc_ps_restore(priv);
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "NoBuf", "%20s : %10u\n", "NoBuf",
be32_to_cpu(cmd_rsp.nobuf)); be32_to_cpu(cmd_rsp.nobuf));
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "HostSend", "%20s : %10u\n", "HostSend",
be32_to_cpu(cmd_rsp.host_send)); be32_to_cpu(cmd_rsp.host_send));
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "HostDone", "%20s : %10u\n", "HostDone",
be32_to_cpu(cmd_rsp.host_done)); be32_to_cpu(cmd_rsp.host_done));
if (len > sizeof(buf)) if (len > sizeof(buf))
len = sizeof(buf); len = sizeof(buf);
...@@ -197,37 +197,37 @@ static ssize_t read_file_xmit(struct file *file, char __user *user_buf, ...@@ -197,37 +197,37 @@ static ssize_t read_file_xmit(struct file *file, char __user *user_buf,
char buf[512]; char buf[512];
unsigned int len = 0; unsigned int len = 0;
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "Buffers queued", "%20s : %10u\n", "Buffers queued",
priv->debug.tx_stats.buf_queued); priv->debug.tx_stats.buf_queued);
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "Buffers completed", "%20s : %10u\n", "Buffers completed",
priv->debug.tx_stats.buf_completed); priv->debug.tx_stats.buf_completed);
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "SKBs queued", "%20s : %10u\n", "SKBs queued",
priv->debug.tx_stats.skb_queued); priv->debug.tx_stats.skb_queued);
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "SKBs success", "%20s : %10u\n", "SKBs success",
priv->debug.tx_stats.skb_success); priv->debug.tx_stats.skb_success);
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "SKBs failed", "%20s : %10u\n", "SKBs failed",
priv->debug.tx_stats.skb_failed); priv->debug.tx_stats.skb_failed);
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "CAB queued", "%20s : %10u\n", "CAB queued",
priv->debug.tx_stats.cab_queued); priv->debug.tx_stats.cab_queued);
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "BE queued", "%20s : %10u\n", "BE queued",
priv->debug.tx_stats.queue_stats[IEEE80211_AC_BE]); priv->debug.tx_stats.queue_stats[IEEE80211_AC_BE]);
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "BK queued", "%20s : %10u\n", "BK queued",
priv->debug.tx_stats.queue_stats[IEEE80211_AC_BK]); priv->debug.tx_stats.queue_stats[IEEE80211_AC_BK]);
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "VI queued", "%20s : %10u\n", "VI queued",
priv->debug.tx_stats.queue_stats[IEEE80211_AC_VI]); priv->debug.tx_stats.queue_stats[IEEE80211_AC_VI]);
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"%20s : %10u\n", "VO queued", "%20s : %10u\n", "VO queued",
priv->debug.tx_stats.queue_stats[IEEE80211_AC_VO]); priv->debug.tx_stats.queue_stats[IEEE80211_AC_VO]);
if (len > sizeof(buf)) if (len > sizeof(buf))
len = sizeof(buf); len = sizeof(buf);
...@@ -273,8 +273,8 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf, ...@@ -273,8 +273,8 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
#define PHY_ERR(s, p) \ #define PHY_ERR(s, p) \
len += snprintf(buf + len, size - len, "%20s : %10u\n", s, \ len += scnprintf(buf + len, size - len, "%20s : %10u\n", s, \
priv->debug.rx_stats.err_phy_stats[p]); priv->debug.rx_stats.err_phy_stats[p]);
struct ath9k_htc_priv *priv = file->private_data; struct ath9k_htc_priv *priv = file->private_data;
char *buf; char *buf;
...@@ -285,37 +285,37 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf, ...@@ -285,37 +285,37 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf,
if (buf == NULL) if (buf == NULL)
return -ENOMEM; return -ENOMEM;
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10u\n", "SKBs allocated", "%20s : %10u\n", "SKBs allocated",
priv->debug.rx_stats.skb_allocated); priv->debug.rx_stats.skb_allocated);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10u\n", "SKBs completed", "%20s : %10u\n", "SKBs completed",
priv->debug.rx_stats.skb_completed); priv->debug.rx_stats.skb_completed);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10u\n", "SKBs Dropped", "%20s : %10u\n", "SKBs Dropped",
priv->debug.rx_stats.skb_dropped); priv->debug.rx_stats.skb_dropped);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10u\n", "CRC ERR", "%20s : %10u\n", "CRC ERR",
priv->debug.rx_stats.err_crc); priv->debug.rx_stats.err_crc);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10u\n", "DECRYPT CRC ERR", "%20s : %10u\n", "DECRYPT CRC ERR",
priv->debug.rx_stats.err_decrypt_crc); priv->debug.rx_stats.err_decrypt_crc);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10u\n", "MIC ERR", "%20s : %10u\n", "MIC ERR",
priv->debug.rx_stats.err_mic); priv->debug.rx_stats.err_mic);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10u\n", "PRE-DELIM CRC ERR", "%20s : %10u\n", "PRE-DELIM CRC ERR",
priv->debug.rx_stats.err_pre_delim); priv->debug.rx_stats.err_pre_delim);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10u\n", "POST-DELIM CRC ERR", "%20s : %10u\n", "POST-DELIM CRC ERR",
priv->debug.rx_stats.err_post_delim); priv->debug.rx_stats.err_post_delim);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10u\n", "DECRYPT BUSY ERR", "%20s : %10u\n", "DECRYPT BUSY ERR",
priv->debug.rx_stats.err_decrypt_busy); priv->debug.rx_stats.err_decrypt_busy);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10u\n", "TOTAL PHY ERR", "%20s : %10u\n", "TOTAL PHY ERR",
priv->debug.rx_stats.err_phy); priv->debug.rx_stats.err_phy);
PHY_ERR("UNDERRUN", ATH9K_PHYERR_UNDERRUN); PHY_ERR("UNDERRUN", ATH9K_PHYERR_UNDERRUN);
...@@ -372,16 +372,16 @@ static ssize_t read_file_slot(struct file *file, char __user *user_buf, ...@@ -372,16 +372,16 @@ static ssize_t read_file_slot(struct file *file, char __user *user_buf,
spin_lock_bh(&priv->tx.tx_lock); spin_lock_bh(&priv->tx.tx_lock);
len += snprintf(buf + len, sizeof(buf) - len, "TX slot bitmap : "); len += scnprintf(buf + len, sizeof(buf) - len, "TX slot bitmap : ");
len += bitmap_scnprintf(buf + len, sizeof(buf) - len, len += bitmap_scnprintf(buf + len, sizeof(buf) - len,
priv->tx.tx_slot, MAX_TX_BUF_NUM); priv->tx.tx_slot, MAX_TX_BUF_NUM);
len += snprintf(buf + len, sizeof(buf) - len, "\n"); len += scnprintf(buf + len, sizeof(buf) - len, "\n");
len += snprintf(buf + len, sizeof(buf) - len, len += scnprintf(buf + len, sizeof(buf) - len,
"Used slots : %d\n", "Used slots : %d\n",
bitmap_weight(priv->tx.tx_slot, MAX_TX_BUF_NUM)); bitmap_weight(priv->tx.tx_slot, MAX_TX_BUF_NUM));
spin_unlock_bh(&priv->tx.tx_lock); spin_unlock_bh(&priv->tx.tx_lock);
...@@ -405,30 +405,30 @@ static ssize_t read_file_queue(struct file *file, char __user *user_buf, ...@@ -405,30 +405,30 @@ static ssize_t read_file_queue(struct file *file, char __user *user_buf,
char buf[512]; char buf[512];
unsigned int len = 0; unsigned int len = 0;
len += snprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n",
"Mgmt endpoint", skb_queue_len(&priv->tx.mgmt_ep_queue)); "Mgmt endpoint", skb_queue_len(&priv->tx.mgmt_ep_queue));
len += snprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n",
"Cab endpoint", skb_queue_len(&priv->tx.cab_ep_queue)); "Cab endpoint", skb_queue_len(&priv->tx.cab_ep_queue));
len += snprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n",
"Data BE endpoint", skb_queue_len(&priv->tx.data_be_queue)); "Data BE endpoint", skb_queue_len(&priv->tx.data_be_queue));
len += snprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n",
"Data BK endpoint", skb_queue_len(&priv->tx.data_bk_queue)); "Data BK endpoint", skb_queue_len(&priv->tx.data_bk_queue));
len += snprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n",
"Data VI endpoint", skb_queue_len(&priv->tx.data_vi_queue)); "Data VI endpoint", skb_queue_len(&priv->tx.data_vi_queue));
len += snprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n",
"Data VO endpoint", skb_queue_len(&priv->tx.data_vo_queue)); "Data VO endpoint", skb_queue_len(&priv->tx.data_vo_queue));
len += snprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n",
"Failed queue", skb_queue_len(&priv->tx.tx_failed)); "Failed queue", skb_queue_len(&priv->tx.tx_failed));
spin_lock_bh(&priv->tx.tx_lock); spin_lock_bh(&priv->tx.tx_lock);
len += snprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n",
"Queued count", priv->tx.queued_cnt); "Queued count", priv->tx.queued_cnt);
spin_unlock_bh(&priv->tx.tx_lock); spin_unlock_bh(&priv->tx.tx_lock);
if (len > sizeof(buf)) if (len > sizeof(buf))
...@@ -507,70 +507,70 @@ static ssize_t read_file_base_eeprom(struct file *file, char __user *user_buf, ...@@ -507,70 +507,70 @@ static ssize_t read_file_base_eeprom(struct file *file, char __user *user_buf,
if (buf == NULL) if (buf == NULL)
return -ENOMEM; return -ENOMEM;
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10d\n", "Major Version", "%20s : %10d\n", "Major Version",
pBase->version >> 12); pBase->version >> 12);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10d\n", "Minor Version", "%20s : %10d\n", "Minor Version",
pBase->version & 0xFFF); pBase->version & 0xFFF);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10d\n", "Checksum", "%20s : %10d\n", "Checksum",
pBase->checksum); pBase->checksum);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10d\n", "Length", "%20s : %10d\n", "Length",
pBase->length); pBase->length);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10d\n", "RegDomain1", "%20s : %10d\n", "RegDomain1",
pBase->regDmn[0]); pBase->regDmn[0]);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10d\n", "RegDomain2", "%20s : %10d\n", "RegDomain2",
pBase->regDmn[1]); pBase->regDmn[1]);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10d\n", "%20s : %10d\n",
"TX Mask", pBase->txMask); "TX Mask", pBase->txMask);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10d\n", "%20s : %10d\n",
"RX Mask", pBase->rxMask); "RX Mask", pBase->rxMask);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10d\n", "%20s : %10d\n",
"Allow 5GHz", "Allow 5GHz",
!!(pBase->opCapFlags & AR5416_OPFLAGS_11A)); !!(pBase->opCapFlags & AR5416_OPFLAGS_11A));
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10d\n", "%20s : %10d\n",
"Allow 2GHz", "Allow 2GHz",
!!(pBase->opCapFlags & AR5416_OPFLAGS_11G)); !!(pBase->opCapFlags & AR5416_OPFLAGS_11G));
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10d\n", "%20s : %10d\n",
"Disable 2GHz HT20", "Disable 2GHz HT20",
!!(pBase->opCapFlags & AR5416_OPFLAGS_N_2G_HT20)); !!(pBase->opCapFlags & AR5416_OPFLAGS_N_2G_HT20));
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10d\n", "%20s : %10d\n",
"Disable 2GHz HT40", "Disable 2GHz HT40",
!!(pBase->opCapFlags & AR5416_OPFLAGS_N_2G_HT40)); !!(pBase->opCapFlags & AR5416_OPFLAGS_N_2G_HT40));
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10d\n", "%20s : %10d\n",
"Disable 5Ghz HT20", "Disable 5Ghz HT20",
!!(pBase->opCapFlags & AR5416_OPFLAGS_N_5G_HT20)); !!(pBase->opCapFlags & AR5416_OPFLAGS_N_5G_HT20));
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10d\n", "%20s : %10d\n",
"Disable 5Ghz HT40", "Disable 5Ghz HT40",
!!(pBase->opCapFlags & AR5416_OPFLAGS_N_5G_HT40)); !!(pBase->opCapFlags & AR5416_OPFLAGS_N_5G_HT40));
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10d\n", "%20s : %10d\n",
"Big Endian", "Big Endian",
!!(pBase->eepMisc & 0x01)); !!(pBase->eepMisc & 0x01));
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10d\n", "%20s : %10d\n",
"Cal Bin Major Ver", "Cal Bin Major Ver",
(pBase->binBuildNumber >> 24) & 0xFF); (pBase->binBuildNumber >> 24) & 0xFF);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10d\n", "%20s : %10d\n",
"Cal Bin Minor Ver", "Cal Bin Minor Ver",
(pBase->binBuildNumber >> 16) & 0xFF); (pBase->binBuildNumber >> 16) & 0xFF);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10d\n", "%20s : %10d\n",
"Cal Bin Build", "Cal Bin Build",
(pBase->binBuildNumber >> 8) & 0xFF); (pBase->binBuildNumber >> 8) & 0xFF);
/* /*
* UB91 specific data. * UB91 specific data.
...@@ -579,10 +579,10 @@ static ssize_t read_file_base_eeprom(struct file *file, char __user *user_buf, ...@@ -579,10 +579,10 @@ static ssize_t read_file_base_eeprom(struct file *file, char __user *user_buf,
struct base_eep_header_4k *pBase4k = struct base_eep_header_4k *pBase4k =
&priv->ah->eeprom.map4k.baseEepHeader; &priv->ah->eeprom.map4k.baseEepHeader;
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10d\n", "%20s : %10d\n",
"TX Gain type", "TX Gain type",
pBase4k->txGainType); pBase4k->txGainType);
} }
/* /*
...@@ -592,19 +592,19 @@ static ssize_t read_file_base_eeprom(struct file *file, char __user *user_buf, ...@@ -592,19 +592,19 @@ static ssize_t read_file_base_eeprom(struct file *file, char __user *user_buf,
struct base_eep_ar9287_header *pBase9287 = struct base_eep_ar9287_header *pBase9287 =
&priv->ah->eeprom.map9287.baseEepHeader; &priv->ah->eeprom.map9287.baseEepHeader;
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10ddB\n", "%20s : %10ddB\n",
"Power Table Offset", "Power Table Offset",
pBase9287->pwrTableOffset); pBase9287->pwrTableOffset);
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%20s : %10d\n", "%20s : %10d\n",
"OpenLoop Power Ctrl", "OpenLoop Power Ctrl",
pBase9287->openLoopPwrCntl); pBase9287->openLoopPwrCntl);
} }
len += snprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress", len += scnprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress",
pBase->macAddr); pBase->macAddr);
if (len > size) if (len > size)
len = size; len = size;
...@@ -627,8 +627,8 @@ static ssize_t read_4k_modal_eeprom(struct file *file, ...@@ -627,8 +627,8 @@ static ssize_t read_4k_modal_eeprom(struct file *file,
{ {
#define PR_EEP(_s, _val) \ #define PR_EEP(_s, _val) \
do { \ do { \
len += snprintf(buf + len, size - len, "%20s : %10d\n", \ len += scnprintf(buf + len, size - len, "%20s : %10d\n",\
_s, (_val)); \ _s, (_val)); \
} while (0) } while (0)
struct ath9k_htc_priv *priv = file->private_data; struct ath9k_htc_priv *priv = file->private_data;
...@@ -708,12 +708,12 @@ static ssize_t read_def_modal_eeprom(struct file *file, ...@@ -708,12 +708,12 @@ static ssize_t read_def_modal_eeprom(struct file *file,
do { \ do { \
if (pBase->opCapFlags & AR5416_OPFLAGS_11G) { \ if (pBase->opCapFlags & AR5416_OPFLAGS_11G) { \
pModal = &priv->ah->eeprom.def.modalHeader[1]; \ pModal = &priv->ah->eeprom.def.modalHeader[1]; \
len += snprintf(buf + len, size - len, "%20s : %8d%7s", \ len += scnprintf(buf + len, size - len, "%20s : %8d%7s", \
_s, (_val), "|"); \ _s, (_val), "|"); \
} \ } \
if (pBase->opCapFlags & AR5416_OPFLAGS_11A) { \ if (pBase->opCapFlags & AR5416_OPFLAGS_11A) { \
pModal = &priv->ah->eeprom.def.modalHeader[0]; \ pModal = &priv->ah->eeprom.def.modalHeader[0]; \
len += snprintf(buf + len, size - len, "%9d\n", \ len += scnprintf(buf + len, size - len, "%9d\n",\
(_val)); \ (_val)); \
} \ } \
} while (0) } while (0)
...@@ -729,10 +729,10 @@ static ssize_t read_def_modal_eeprom(struct file *file, ...@@ -729,10 +729,10 @@ static ssize_t read_def_modal_eeprom(struct file *file,
if (buf == NULL) if (buf == NULL)
return -ENOMEM; return -ENOMEM;
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%31s %15s\n", "2G", "5G"); "%31s %15s\n", "2G", "5G");
len += snprintf(buf + len, size - len, len += scnprintf(buf + len, size - len,
"%32s %16s\n", "====", "====\n"); "%32s %16s\n", "====", "====\n");
PR_EEP("Chain0 Ant. Control", pModal->antCtrlChain[0]); PR_EEP("Chain0 Ant. Control", pModal->antCtrlChain[0]);
PR_EEP("Chain1 Ant. Control", pModal->antCtrlChain[1]); PR_EEP("Chain1 Ant. Control", pModal->antCtrlChain[1]);
...@@ -814,8 +814,8 @@ static ssize_t read_9287_modal_eeprom(struct file *file, ...@@ -814,8 +814,8 @@ static ssize_t read_9287_modal_eeprom(struct file *file,
{ {
#define PR_EEP(_s, _val) \ #define PR_EEP(_s, _val) \
do { \ do { \
len += snprintf(buf + len, size - len, "%20s : %10d\n", \ len += scnprintf(buf + len, size - len, "%20s : %10d\n",\
_s, (_val)); \ _s, (_val)); \
} while (0) } while (0)
struct ath9k_htc_priv *priv = file->private_data; struct ath9k_htc_priv *priv = file->private_data;
......
...@@ -3252,19 +3252,19 @@ void ath9k_hw_name(struct ath_hw *ah, char *hw_name, size_t len) ...@@ -3252,19 +3252,19 @@ void ath9k_hw_name(struct ath_hw *ah, char *hw_name, size_t len)
/* chipsets >= AR9280 are single-chip */ /* chipsets >= AR9280 are single-chip */
if (AR_SREV_9280_20_OR_LATER(ah)) { if (AR_SREV_9280_20_OR_LATER(ah)) {
used = snprintf(hw_name, len, used = scnprintf(hw_name, len,
"Atheros AR%s Rev:%x", "Atheros AR%s Rev:%x",
ath9k_hw_mac_bb_name(ah->hw_version.macVersion), ath9k_hw_mac_bb_name(ah->hw_version.macVersion),
ah->hw_version.macRev); ah->hw_version.macRev);
} }
else { else {
used = snprintf(hw_name, len, used = scnprintf(hw_name, len,
"Atheros AR%s MAC/BB Rev:%x AR%s RF Rev:%x", "Atheros AR%s MAC/BB Rev:%x AR%s RF Rev:%x",
ath9k_hw_mac_bb_name(ah->hw_version.macVersion), ath9k_hw_mac_bb_name(ah->hw_version.macVersion),
ah->hw_version.macRev, ah->hw_version.macRev,
ath9k_hw_rf_name((ah->hw_version.analog5GhzRev & ath9k_hw_rf_name((ah->hw_version.analog5GhzRev
AR_RADIO_SREV_MAJOR)), & AR_RADIO_SREV_MAJOR)),
ah->hw_version.phyRev); ah->hw_version.phyRev);
} }
hw_name[used] = '\0'; hw_name[used] = '\0';
......
...@@ -98,8 +98,8 @@ ...@@ -98,8 +98,8 @@
#define PR_EEP(_s, _val) \ #define PR_EEP(_s, _val) \
do { \ do { \
len += snprintf(buf + len, size - len, "%20s : %10d\n", \ len += scnprintf(buf + len, size - len, "%20s : %10d\n",\
_s, (_val)); \ _s, (_val)); \
} while (0) } while (0)
#define SM(_v, _f) (((_v) << _f##_S) & _f) #define SM(_v, _f) (((_v) << _f##_S) & _f)
......
...@@ -1387,31 +1387,31 @@ static ssize_t read_file_rcstat(struct file *file, char __user *user_buf, ...@@ -1387,31 +1387,31 @@ static ssize_t read_file_rcstat(struct file *file, char __user *user_buf,
int used_mcs = 0, used_htmode = 0; int used_mcs = 0, used_htmode = 0;
if (WLAN_RC_PHY_HT(rc->rate_table->info[i].phy)) { if (WLAN_RC_PHY_HT(rc->rate_table->info[i].phy)) {
used_mcs = snprintf(mcs, 5, "%d", used_mcs = scnprintf(mcs, 5, "%d",
rc->rate_table->info[i].ratecode); rc->rate_table->info[i].ratecode);
if (WLAN_RC_PHY_40(rc->rate_table->info[i].phy)) if (WLAN_RC_PHY_40(rc->rate_table->info[i].phy))
used_htmode = snprintf(htmode, 5, "HT40"); used_htmode = scnprintf(htmode, 5, "HT40");
else if (WLAN_RC_PHY_20(rc->rate_table->info[i].phy)) else if (WLAN_RC_PHY_20(rc->rate_table->info[i].phy))
used_htmode = snprintf(htmode, 5, "HT20"); used_htmode = scnprintf(htmode, 5, "HT20");
else else
used_htmode = snprintf(htmode, 5, "????"); used_htmode = scnprintf(htmode, 5, "????");
} }
mcs[used_mcs] = '\0'; mcs[used_mcs] = '\0';
htmode[used_htmode] = '\0'; htmode[used_htmode] = '\0';
len += snprintf(buf + len, max - len, len += scnprintf(buf + len, max - len,
"%6s %6s %3u.%d: " "%6s %6s %3u.%d: "
"%10u %10u %10u %10u\n", "%10u %10u %10u %10u\n",
htmode, htmode,
mcs, mcs,
ratekbps / 1000, ratekbps / 1000,
(ratekbps % 1000) / 100, (ratekbps % 1000) / 100,
stats->success, stats->success,
stats->retries, stats->retries,
stats->xretries, stats->xretries,
stats->per); stats->per);
} }
if (len > max) if (len > max)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment