aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorZefir Kurtisi <zefir.kurtisi@neratec.com>2013-09-05 08:11:57 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-09-26 15:13:35 -0400
commit5e88ba6228e66741811992a6c1d7cf37195ed4be (patch)
treebbef06dfe1c87b09a3b2b5c4fde947a7030368e1 /drivers/net/wireless
parentbf7c756c5d653a63c9bbef4686ae57efcfdaee3d (diff)
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: Zefir Kurtisi <zefir.kurtisi@neratec.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_eeprom.c12
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h4
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.c446
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.h12
-rw-r--r--drivers/net/wireless/ath/ath9k/dfs_debug.c25
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom_4k.c10
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom_9287.c8
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom_def.c12
-rw-r--r--drivers/net/wireless/ath/ath9k/gpio.c22
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_debug.c456
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c22
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h4
-rw-r--r--drivers/net/wireless/ath/ath9k/rc.c32
13 files changed, 534 insertions, 531 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index 5982256078d8..1ec52356b5a1 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -3427,12 +3427,12 @@ static u32 ath9k_hw_ar9003_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
3427 struct ar9300_base_eep_hdr *pBase; 3427 struct ar9300_base_eep_hdr *pBase;
3428 3428
3429 if (!dump_base_hdr) { 3429 if (!dump_base_hdr) {
3430 len += snprintf(buf + len, size - len, 3430 len += scnprintf(buf + len, size - len,
3431 "%20s :\n", "2GHz modal Header"); 3431 "%20s :\n", "2GHz modal Header");
3432 len = ar9003_dump_modal_eeprom(buf, len, size, 3432 len = ar9003_dump_modal_eeprom(buf, len, size,
3433 &eep->modalHeader2G); 3433 &eep->modalHeader2G);
3434 len += snprintf(buf + len, size - len, 3434 len += scnprintf(buf + len, size - len,
3435 "%20s :\n", "5GHz modal Header"); 3435 "%20s :\n", "5GHz modal Header");
3436 len = ar9003_dump_modal_eeprom(buf, len, size, 3436 len = ar9003_dump_modal_eeprom(buf, len, size,
3437 &eep->modalHeader5G); 3437 &eep->modalHeader5G);
3438 goto out; 3438 goto out;
@@ -3482,8 +3482,8 @@ static u32 ath9k_hw_ar9003_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
3482 PR_EEP("Rx Gain", pBase->txrxgain & 0xf); 3482 PR_EEP("Rx Gain", pBase->txrxgain & 0xf);
3483 PR_EEP("SW Reg", le32_to_cpu(pBase->swreg)); 3483 PR_EEP("SW Reg", le32_to_cpu(pBase->swreg));
3484 3484
3485 len += snprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress", 3485 len += scnprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress",
3486 ah->eeprom.ar9300_eep.macAddr); 3486 ah->eeprom.ar9300_eep.macAddr);
3487out: 3487out:
3488 if (len > size) 3488 if (len > size)
3489 len = size; 3489 len = size;
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 5fd429485e76..8878f2dada2d 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -459,8 +459,8 @@ void ath9k_queue_reset(struct ath_softc *sc, enum ath_reset_type type);
459 459
460#define ATH_DUMP_BTCOEX(_s, _val) \ 460#define ATH_DUMP_BTCOEX(_s, _val) \
461 do { \ 461 do { \
462 len += snprintf(buf + len, size - len, \ 462 len += scnprintf(buf + len, size - len, \
463 "%20s : %10d\n", _s, (_val)); \ 463 "%20s : %10d\n", _s, (_val)); \
464 } while (0) 464 } while (0)
465 465
466enum bt_op_flags { 466enum bt_op_flags {
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index c088744a6bfb..1be2c787aac9 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -104,37 +104,37 @@ static ssize_t read_file_ani(struct file *file, char __user *user_buf,
104 return -ENOMEM; 104 return -ENOMEM;
105 105
106 if (common->disable_ani) { 106 if (common->disable_ani) {
107 len += snprintf(buf + len, size - len, "%s: %s\n", 107 len += scnprintf(buf + len, size - len, "%s: %s\n",
108 "ANI", "DISABLED"); 108 "ANI", "DISABLED");
109 goto exit; 109 goto exit;
110 } 110 }
111 111
112 len += snprintf(buf + len, size - len, "%15s: %s\n", 112 len += scnprintf(buf + len, size - len, "%15s: %s\n",
113 "ANI", "ENABLED"); 113 "ANI", "ENABLED");
114 len += snprintf(buf + len, size - len, "%15s: %u\n", 114 len += scnprintf(buf + len, size - len, "%15s: %u\n",
115 "ANI RESET", ah->stats.ast_ani_reset); 115 "ANI RESET", ah->stats.ast_ani_reset);
116 len += snprintf(buf + len, size - len, "%15s: %u\n", 116 len += scnprintf(buf + len, size - len, "%15s: %u\n",
117 "SPUR UP", ah->stats.ast_ani_spurup); 117 "SPUR UP", ah->stats.ast_ani_spurup);
118 len += snprintf(buf + len, size - len, "%15s: %u\n", 118 len += scnprintf(buf + len, size - len, "%15s: %u\n",
119 "SPUR DOWN", ah->stats.ast_ani_spurup); 119 "SPUR DOWN", ah->stats.ast_ani_spurup);
120 len += snprintf(buf + len, size - len, "%15s: %u\n", 120 len += scnprintf(buf + len, size - len, "%15s: %u\n",
121 "OFDM WS-DET ON", ah->stats.ast_ani_ofdmon); 121 "OFDM WS-DET ON", ah->stats.ast_ani_ofdmon);
122 len += snprintf(buf + len, size - len, "%15s: %u\n", 122 len += scnprintf(buf + len, size - len, "%15s: %u\n",
123 "OFDM WS-DET OFF", ah->stats.ast_ani_ofdmoff); 123 "OFDM WS-DET OFF", ah->stats.ast_ani_ofdmoff);
124 len += snprintf(buf + len, size - len, "%15s: %u\n", 124 len += scnprintf(buf + len, size - len, "%15s: %u\n",
125 "MRC-CCK ON", ah->stats.ast_ani_ccklow); 125 "MRC-CCK ON", ah->stats.ast_ani_ccklow);
126 len += snprintf(buf + len, size - len, "%15s: %u\n", 126 len += scnprintf(buf + len, size - len, "%15s: %u\n",
127 "MRC-CCK OFF", ah->stats.ast_ani_cckhigh); 127 "MRC-CCK OFF", ah->stats.ast_ani_cckhigh);
128 len += snprintf(buf + len, size - len, "%15s: %u\n", 128 len += scnprintf(buf + len, size - len, "%15s: %u\n",
129 "FIR-STEP UP", ah->stats.ast_ani_stepup); 129 "FIR-STEP UP", ah->stats.ast_ani_stepup);
130 len += snprintf(buf + len, size - len, "%15s: %u\n", 130 len += scnprintf(buf + len, size - len, "%15s: %u\n",
131 "FIR-STEP DOWN", ah->stats.ast_ani_stepdown); 131 "FIR-STEP DOWN", ah->stats.ast_ani_stepdown);
132 len += snprintf(buf + len, size - len, "%15s: %u\n", 132 len += scnprintf(buf + len, size - len, "%15s: %u\n",
133 "INV LISTENTIME", ah->stats.ast_ani_lneg_or_lzero); 133 "INV LISTENTIME", ah->stats.ast_ani_lneg_or_lzero);
134 len += snprintf(buf + len, size - len, "%15s: %u\n", 134 len += scnprintf(buf + len, size - len, "%15s: %u\n",
135 "OFDM ERRORS", ah->stats.ast_ani_ofdmerrs); 135 "OFDM ERRORS", ah->stats.ast_ani_ofdmerrs);
136 len += snprintf(buf + len, size - len, "%15s: %u\n", 136 len += scnprintf(buf + len, size - len, "%15s: %u\n",
137 "CCK ERRORS", ah->stats.ast_ani_cckerrs); 137 "CCK ERRORS", ah->stats.ast_ani_cckerrs);
138exit: 138exit:
139 if (len > size) 139 if (len > size)
140 len = size; 140 len = size;
@@ -280,70 +280,70 @@ static ssize_t read_file_antenna_diversity(struct file *file,
280 return -ENOMEM; 280 return -ENOMEM;
281 281
282 if (!(pCap->hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB)) { 282 if (!(pCap->hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB)) {
283 len += snprintf(buf + len, size - len, "%s\n", 283 len += scnprintf(buf + len, size - len, "%s\n",
284 "Antenna Diversity Combining is disabled"); 284 "Antenna Diversity Combining is disabled");
285 goto exit; 285 goto exit;
286 } 286 }
287 287
288 ath9k_ps_wakeup(sc); 288 ath9k_ps_wakeup(sc);
289 ath9k_hw_antdiv_comb_conf_get(ah, &div_ant_conf); 289 ath9k_hw_antdiv_comb_conf_get(ah, &div_ant_conf);
290 len += snprintf(buf + len, size - len, "Current MAIN config : %s\n", 290 len += scnprintf(buf + len, size - len, "Current MAIN config : %s\n",
291 lna_conf_str[div_ant_conf.main_lna_conf]); 291 lna_conf_str[div_ant_conf.main_lna_conf]);
292 len += snprintf(buf + len, size - len, "Current ALT config : %s\n", 292 len += scnprintf(buf + len, size - len, "Current ALT config : %s\n",
293 lna_conf_str[div_ant_conf.alt_lna_conf]); 293 lna_conf_str[div_ant_conf.alt_lna_conf]);
294 len += snprintf(buf + len, size - len, "Average MAIN RSSI : %d\n", 294 len += scnprintf(buf + len, size - len, "Average MAIN RSSI : %d\n",
295 as_main->rssi_avg); 295 as_main->rssi_avg);
296 len += snprintf(buf + len, size - len, "Average ALT RSSI : %d\n\n", 296 len += scnprintf(buf + len, size - len, "Average ALT RSSI : %d\n\n",
297 as_alt->rssi_avg); 297 as_alt->rssi_avg);
298 ath9k_ps_restore(sc); 298 ath9k_ps_restore(sc);
299 299
300 len += snprintf(buf + len, size - len, "Packet Receive Cnt:\n"); 300 len += scnprintf(buf + len, size - len, "Packet Receive Cnt:\n");
301 len += snprintf(buf + len, size - len, "-------------------\n"); 301 len += scnprintf(buf + len, size - len, "-------------------\n");
302 302
303 len += snprintf(buf + len, size - len, "%30s%15s\n", 303 len += scnprintf(buf + len, size - len, "%30s%15s\n",
304 "MAIN", "ALT"); 304 "MAIN", "ALT");
305 len += snprintf(buf + len, size - len, "%-14s:%15d%15d\n", 305 len += scnprintf(buf + len, size - len, "%-14s:%15d%15d\n",
306 "TOTAL COUNT", 306 "TOTAL COUNT",
307 as_main->recv_cnt, 307 as_main->recv_cnt,
308 as_alt->recv_cnt); 308 as_alt->recv_cnt);
309 len += snprintf(buf + len, size - len, "%-14s:%15d%15d\n", 309 len += scnprintf(buf + len, size - len, "%-14s:%15d%15d\n",
310 "LNA1", 310 "LNA1",
311 as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1], 311 as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1],
312 as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1]); 312 as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1]);
313 len += snprintf(buf + len, size - len, "%-14s:%15d%15d\n", 313 len += scnprintf(buf + len, size - len, "%-14s:%15d%15d\n",
314 "LNA2", 314 "LNA2",
315 as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA2], 315 as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA2],
316 as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA2]); 316 as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA2]);
317 len += snprintf(buf + len, size - len, "%-14s:%15d%15d\n", 317 len += scnprintf(buf + len, size - len, "%-14s:%15d%15d\n",
318 "LNA1 + LNA2", 318 "LNA1 + LNA2",
319 as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2], 319 as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2],
320 as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2]); 320 as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2]);
321 len += snprintf(buf + len, size - len, "%-14s:%15d%15d\n", 321 len += scnprintf(buf + len, size - len, "%-14s:%15d%15d\n",
322 "LNA1 - LNA2", 322 "LNA1 - LNA2",
323 as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2], 323 as_main->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2],
324 as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2]); 324 as_alt->lna_recv_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2]);
325 325
326 len += snprintf(buf + len, size - len, "\nLNA Config Attempts:\n"); 326 len += scnprintf(buf + len, size - len, "\nLNA Config Attempts:\n");
327 len += snprintf(buf + len, size - len, "--------------------\n"); 327 len += scnprintf(buf + len, size - len, "--------------------\n");
328 328
329 len += snprintf(buf + len, size - len, "%30s%15s\n", 329 len += scnprintf(buf + len, size - len, "%30s%15s\n",
330 "MAIN", "ALT"); 330 "MAIN", "ALT");
331 len += snprintf(buf + len, size - len, "%-14s:%15d%15d\n", 331 len += scnprintf(buf + len, size - len, "%-14s:%15d%15d\n",
332 "LNA1", 332 "LNA1",
333 as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1], 333 as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1],
334 as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1]); 334 as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1]);
335 len += snprintf(buf + len, size - len, "%-14s:%15d%15d\n", 335 len += scnprintf(buf + len, size - len, "%-14s:%15d%15d\n",
336 "LNA2", 336 "LNA2",
337 as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA2], 337 as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA2],
338 as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA2]); 338 as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA2]);
339 len += snprintf(buf + len, size - len, "%-14s:%15d%15d\n", 339 len += scnprintf(buf + len, size - len, "%-14s:%15d%15d\n",
340 "LNA1 + LNA2", 340 "LNA1 + LNA2",
341 as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2], 341 as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2],
342 as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2]); 342 as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2]);
343 len += snprintf(buf + len, size - len, "%-14s:%15d%15d\n", 343 len += scnprintf(buf + len, size - len, "%-14s:%15d%15d\n",
344 "LNA1 - LNA2", 344 "LNA1 - LNA2",
345 as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2], 345 as_main->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2],
346 as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2]); 346 as_alt->lna_attempt_cnt[ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2]);
347 347
348exit: 348exit:
349 if (len > size) 349 if (len > size)
@@ -385,21 +385,21 @@ static ssize_t read_file_dma(struct file *file, char __user *user_buf,
385 (AR_MACMISC_MISC_OBS_BUS_1 << 385 (AR_MACMISC_MISC_OBS_BUS_1 <<
386 AR_MACMISC_MISC_OBS_BUS_MSB_S))); 386 AR_MACMISC_MISC_OBS_BUS_MSB_S)));
387 387
388 len += snprintf(buf + len, DMA_BUF_LEN - len, 388 len += scnprintf(buf + len, DMA_BUF_LEN - len,
389 "Raw DMA Debug values:\n"); 389 "Raw DMA Debug values:\n");
390 390
391 for (i = 0; i < ATH9K_NUM_DMA_DEBUG_REGS; i++) { 391 for (i = 0; i < ATH9K_NUM_DMA_DEBUG_REGS; i++) {
392 if (i % 4 == 0) 392 if (i % 4 == 0)
393 len += snprintf(buf + len, DMA_BUF_LEN - len, "\n"); 393 len += scnprintf(buf + len, DMA_BUF_LEN - len, "\n");
394 394
395 val[i] = REG_READ_D(ah, AR_DMADBG_0 + (i * sizeof(u32))); 395 val[i] = REG_READ_D(ah, AR_DMADBG_0 + (i * sizeof(u32)));
396 len += snprintf(buf + len, DMA_BUF_LEN - len, "%d: %08x ", 396 len += scnprintf(buf + len, DMA_BUF_LEN - len, "%d: %08x ",
397 i, val[i]); 397 i, val[i]);
398 } 398 }
399 399
400 len += snprintf(buf + len, DMA_BUF_LEN - len, "\n\n"); 400 len += scnprintf(buf + len, DMA_BUF_LEN - len, "\n\n");
401 len += snprintf(buf + len, DMA_BUF_LEN - len, 401 len += scnprintf(buf + len, DMA_BUF_LEN - len,
402 "Num QCU: chain_st fsp_ok fsp_st DCU: chain_st\n"); 402 "Num QCU: chain_st fsp_ok fsp_st DCU: chain_st\n");
403 403
404 for (i = 0; i < ATH9K_NUM_QUEUES; i++, qcuOffset += 4, dcuOffset += 5) { 404 for (i = 0; i < ATH9K_NUM_QUEUES; i++, qcuOffset += 4, dcuOffset += 5) {
405 if (i == 8) { 405 if (i == 8) {
@@ -412,39 +412,39 @@ static ssize_t read_file_dma(struct file *file, char __user *user_buf,
412 dcuBase++; 412 dcuBase++;
413 } 413 }
414 414
415 len += snprintf(buf + len, DMA_BUF_LEN - len, 415 len += scnprintf(buf + len, DMA_BUF_LEN - len,
416 "%2d %2x %1x %2x %2x\n", 416 "%2d %2x %1x %2x %2x\n",
417 i, (*qcuBase & (0x7 << qcuOffset)) >> qcuOffset, 417 i, (*qcuBase & (0x7 << qcuOffset)) >> qcuOffset,
418 (*qcuBase & (0x8 << qcuOffset)) >> (qcuOffset + 3), 418 (*qcuBase & (0x8 << qcuOffset)) >> (qcuOffset + 3),
419 val[2] & (0x7 << (i * 3)) >> (i * 3), 419 val[2] & (0x7 << (i * 3)) >> (i * 3),
420 (*dcuBase & (0x1f << dcuOffset)) >> dcuOffset); 420 (*dcuBase & (0x1f << dcuOffset)) >> dcuOffset);
421 } 421 }
422 422
423 len += snprintf(buf + len, DMA_BUF_LEN - len, "\n"); 423 len += scnprintf(buf + len, DMA_BUF_LEN - len, "\n");
424 424
425 len += snprintf(buf + len, DMA_BUF_LEN - len, 425 len += scnprintf(buf + len, DMA_BUF_LEN - len,
426 "qcu_stitch state: %2x qcu_fetch state: %2x\n", 426 "qcu_stitch state: %2x qcu_fetch state: %2x\n",
427 (val[3] & 0x003c0000) >> 18, (val[3] & 0x03c00000) >> 22); 427 (val[3] & 0x003c0000) >> 18, (val[3] & 0x03c00000) >> 22);
428 len += snprintf(buf + len, DMA_BUF_LEN - len, 428 len += scnprintf(buf + len, DMA_BUF_LEN - len,
429 "qcu_complete state: %2x dcu_complete state: %2x\n", 429 "qcu_complete state: %2x dcu_complete state: %2x\n",
430 (val[3] & 0x1c000000) >> 26, (val[6] & 0x3)); 430 (val[3] & 0x1c000000) >> 26, (val[6] & 0x3));
431 len += snprintf(buf + len, DMA_BUF_LEN - len, 431 len += scnprintf(buf + len, DMA_BUF_LEN - len,
432 "dcu_arb state: %2x dcu_fp state: %2x\n", 432 "dcu_arb state: %2x dcu_fp state: %2x\n",
433 (val[5] & 0x06000000) >> 25, (val[5] & 0x38000000) >> 27); 433 (val[5] & 0x06000000) >> 25, (val[5] & 0x38000000) >> 27);
434 len += snprintf(buf + len, DMA_BUF_LEN - len, 434 len += scnprintf(buf + len, DMA_BUF_LEN - len,
435 "chan_idle_dur: %3d chan_idle_dur_valid: %1d\n", 435 "chan_idle_dur: %3d chan_idle_dur_valid: %1d\n",
436 (val[6] & 0x000003fc) >> 2, (val[6] & 0x00000400) >> 10); 436 (val[6] & 0x000003fc) >> 2, (val[6] & 0x00000400) >> 10);
437 len += snprintf(buf + len, DMA_BUF_LEN - len, 437 len += scnprintf(buf + len, DMA_BUF_LEN - len,
438 "txfifo_valid_0: %1d txfifo_valid_1: %1d\n", 438 "txfifo_valid_0: %1d txfifo_valid_1: %1d\n",
439 (val[6] & 0x00000800) >> 11, (val[6] & 0x00001000) >> 12); 439 (val[6] & 0x00000800) >> 11, (val[6] & 0x00001000) >> 12);
440 len += snprintf(buf + len, DMA_BUF_LEN - len, 440 len += scnprintf(buf + len, DMA_BUF_LEN - len,
441 "txfifo_dcu_num_0: %2d txfifo_dcu_num_1: %2d\n", 441 "txfifo_dcu_num_0: %2d txfifo_dcu_num_1: %2d\n",
442 (val[6] & 0x0001e000) >> 13, (val[6] & 0x001e0000) >> 17); 442 (val[6] & 0x0001e000) >> 13, (val[6] & 0x001e0000) >> 17);
443 443
444 len += snprintf(buf + len, DMA_BUF_LEN - len, "pcu observe: 0x%x\n", 444 len += scnprintf(buf + len, DMA_BUF_LEN - len, "pcu observe: 0x%x\n",
445 REG_READ_D(ah, AR_OBS_BUS_1)); 445 REG_READ_D(ah, AR_OBS_BUS_1));
446 len += snprintf(buf + len, DMA_BUF_LEN - len, 446 len += scnprintf(buf + len, DMA_BUF_LEN - len,
447 "AR_CR: 0x%x\n", REG_READ_D(ah, AR_CR)); 447 "AR_CR: 0x%x\n", REG_READ_D(ah, AR_CR));
448 448
449 ath9k_ps_restore(sc); 449 ath9k_ps_restore(sc);
450 450
@@ -530,9 +530,9 @@ static ssize_t read_file_interrupt(struct file *file, char __user *user_buf,
530 530
531#define PR_IS(a, s) \ 531#define PR_IS(a, s) \
532 do { \ 532 do { \
533 len += snprintf(buf + len, mxlen - len, \ 533 len += scnprintf(buf + len, mxlen - len, \
534 "%21s: %10u\n", a, \ 534 "%21s: %10u\n", a, \
535 sc->debug.stats.istats.s); \ 535 sc->debug.stats.istats.s); \
536 } while (0) 536 } while (0)
537 537
538 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) { 538 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 PR_IS("GENTIMER", gen_timer); 563 PR_IS("GENTIMER", gen_timer);
564 PR_IS("TOTAL", total); 564 PR_IS("TOTAL", total);
565 565
566 len += snprintf(buf + len, mxlen - len, 566 len += scnprintf(buf + len, mxlen - len,
567 "SYNC_CAUSE stats:\n"); 567 "SYNC_CAUSE stats:\n");
568 568
569 PR_IS("Sync-All", sync_cause_all); 569 PR_IS("Sync-All", sync_cause_all);
570 PR_IS("RTC-IRQ", sync_rtc_irq); 570 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 655
656 ath_txq_lock(sc, txq); 656 ath_txq_lock(sc, txq);
657 657
658 len += snprintf(buf + len, size - len, "%s: %d ", 658 len += scnprintf(buf + len, size - len, "%s: %d ",
659 "qnum", txq->axq_qnum); 659 "qnum", txq->axq_qnum);
660 len += snprintf(buf + len, size - len, "%s: %2d ", 660 len += scnprintf(buf + len, size - len, "%s: %2d ",
661 "qdepth", txq->axq_depth); 661 "qdepth", txq->axq_depth);
662 len += snprintf(buf + len, size - len, "%s: %2d ", 662 len += scnprintf(buf + len, size - len, "%s: %2d ",
663 "ampdu-depth", txq->axq_ampdu_depth); 663 "ampdu-depth", txq->axq_ampdu_depth);
664 len += snprintf(buf + len, size - len, "%s: %3d ", 664 len += scnprintf(buf + len, size - len, "%s: %3d ",
665 "pending", txq->pending_frames); 665 "pending", txq->pending_frames);
666 len += snprintf(buf + len, size - len, "%s: %d\n", 666 len += scnprintf(buf + len, size - len, "%s: %d\n",
667 "stopped", txq->stopped); 667 "stopped", txq->stopped);
668 668
669 ath_txq_unlock(sc, txq); 669 ath_txq_unlock(sc, txq);
670 return len; 670 return len;
@@ -687,11 +687,11 @@ static ssize_t read_file_queues(struct file *file, char __user *user_buf,
687 687
688 for (i = 0; i < IEEE80211_NUM_ACS; i++) { 688 for (i = 0; i < IEEE80211_NUM_ACS; i++) {
689 txq = sc->tx.txq_map[i]; 689 txq = sc->tx.txq_map[i];
690 len += snprintf(buf + len, size - len, "(%s): ", qname[i]); 690 len += scnprintf(buf + len, size - len, "(%s): ", qname[i]);
691 len += print_queue(sc, txq, buf + len, size - len); 691 len += print_queue(sc, txq, buf + len, size - len);
692 } 692 }
693 693
694 len += snprintf(buf + len, size - len, "(CAB): "); 694 len += scnprintf(buf + len, size - len, "(CAB): ");
695 len += print_queue(sc, sc->beacon.cabq, buf + len, size - len); 695 len += print_queue(sc, sc->beacon.cabq, buf + len, size - len);
696 696
697 if (len > size) 697 if (len > size)
@@ -716,80 +716,82 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf,
716 unsigned int reg; 716 unsigned int reg;
717 u32 rxfilter; 717 u32 rxfilter;
718 718
719 len += snprintf(buf + len, sizeof(buf) - len, 719 len += scnprintf(buf + len, sizeof(buf) - len,
720 "BSSID: %pM\n", common->curbssid); 720 "BSSID: %pM\n", common->curbssid);
721 len += snprintf(buf + len, sizeof(buf) - len, 721 len += scnprintf(buf + len, sizeof(buf) - len,
722 "BSSID-MASK: %pM\n", common->bssidmask); 722 "BSSID-MASK: %pM\n", common->bssidmask);
723 len += snprintf(buf + len, sizeof(buf) - len, 723 len += scnprintf(buf + len, sizeof(buf) - len,
724 "OPMODE: %s\n", ath_opmode_to_string(sc->sc_ah->opmode)); 724 "OPMODE: %s\n",
725 ath_opmode_to_string(sc->sc_ah->opmode));
725 726
726 ath9k_ps_wakeup(sc); 727 ath9k_ps_wakeup(sc);
727 rxfilter = ath9k_hw_getrxfilter(sc->sc_ah); 728 rxfilter = ath9k_hw_getrxfilter(sc->sc_ah);
728 ath9k_ps_restore(sc); 729 ath9k_ps_restore(sc);
729 730
730 len += snprintf(buf + len, sizeof(buf) - len, 731 len += scnprintf(buf + len, sizeof(buf) - len,
731 "RXFILTER: 0x%x", rxfilter); 732 "RXFILTER: 0x%x", rxfilter);
732 733
733 if (rxfilter & ATH9K_RX_FILTER_UCAST) 734 if (rxfilter & ATH9K_RX_FILTER_UCAST)
734 len += snprintf(buf + len, sizeof(buf) - len, " UCAST"); 735 len += scnprintf(buf + len, sizeof(buf) - len, " UCAST");
735 if (rxfilter & ATH9K_RX_FILTER_MCAST) 736 if (rxfilter & ATH9K_RX_FILTER_MCAST)
736 len += snprintf(buf + len, sizeof(buf) - len, " MCAST"); 737 len += scnprintf(buf + len, sizeof(buf) - len, " MCAST");
737 if (rxfilter & ATH9K_RX_FILTER_BCAST) 738 if (rxfilter & ATH9K_RX_FILTER_BCAST)
738 len += snprintf(buf + len, sizeof(buf) - len, " BCAST"); 739 len += scnprintf(buf + len, sizeof(buf) - len, " BCAST");
739 if (rxfilter & ATH9K_RX_FILTER_CONTROL) 740 if (rxfilter & ATH9K_RX_FILTER_CONTROL)
740 len += snprintf(buf + len, sizeof(buf) - len, " CONTROL"); 741 len += scnprintf(buf + len, sizeof(buf) - len, " CONTROL");
741 if (rxfilter & ATH9K_RX_FILTER_BEACON) 742 if (rxfilter & ATH9K_RX_FILTER_BEACON)
742 len += snprintf(buf + len, sizeof(buf) - len, " BEACON"); 743 len += scnprintf(buf + len, sizeof(buf) - len, " BEACON");
743 if (rxfilter & ATH9K_RX_FILTER_PROM) 744 if (rxfilter & ATH9K_RX_FILTER_PROM)
744 len += snprintf(buf + len, sizeof(buf) - len, " PROM"); 745 len += scnprintf(buf + len, sizeof(buf) - len, " PROM");
745 if (rxfilter & ATH9K_RX_FILTER_PROBEREQ) 746 if (rxfilter & ATH9K_RX_FILTER_PROBEREQ)
746 len += snprintf(buf + len, sizeof(buf) - len, " PROBEREQ"); 747 len += scnprintf(buf + len, sizeof(buf) - len, " PROBEREQ");
747 if (rxfilter & ATH9K_RX_FILTER_PHYERR) 748 if (rxfilter & ATH9K_RX_FILTER_PHYERR)
748 len += snprintf(buf + len, sizeof(buf) - len, " PHYERR"); 749 len += scnprintf(buf + len, sizeof(buf) - len, " PHYERR");
749 if (rxfilter & ATH9K_RX_FILTER_MYBEACON) 750 if (rxfilter & ATH9K_RX_FILTER_MYBEACON)
750 len += snprintf(buf + len, sizeof(buf) - len, " MYBEACON"); 751 len += scnprintf(buf + len, sizeof(buf) - len, " MYBEACON");
751 if (rxfilter & ATH9K_RX_FILTER_COMP_BAR) 752 if (rxfilter & ATH9K_RX_FILTER_COMP_BAR)
752 len += snprintf(buf + len, sizeof(buf) - len, " COMP_BAR"); 753 len += scnprintf(buf + len, sizeof(buf) - len, " COMP_BAR");
753 if (rxfilter & ATH9K_RX_FILTER_PSPOLL) 754 if (rxfilter & ATH9K_RX_FILTER_PSPOLL)
754 len += snprintf(buf + len, sizeof(buf) - len, " PSPOLL"); 755 len += scnprintf(buf + len, sizeof(buf) - len, " PSPOLL");
755 if (rxfilter & ATH9K_RX_FILTER_PHYRADAR) 756 if (rxfilter & ATH9K_RX_FILTER_PHYRADAR)
756 len += snprintf(buf + len, sizeof(buf) - len, " PHYRADAR"); 757 len += scnprintf(buf + len, sizeof(buf) - len, " PHYRADAR");
757 if (rxfilter & ATH9K_RX_FILTER_MCAST_BCAST_ALL) 758 if (rxfilter & ATH9K_RX_FILTER_MCAST_BCAST_ALL)
758 len += snprintf(buf + len, sizeof(buf) - len, " MCAST_BCAST_ALL"); 759 len += scnprintf(buf + len, sizeof(buf) - len, " MCAST_BCAST_ALL");
759 if (rxfilter & ATH9K_RX_FILTER_CONTROL_WRAPPER) 760 if (rxfilter & ATH9K_RX_FILTER_CONTROL_WRAPPER)
760 len += snprintf(buf + len, sizeof(buf) - len, " CONTROL_WRAPPER"); 761 len += scnprintf(buf + len, sizeof(buf) - len, " CONTROL_WRAPPER");
761 762
762 len += snprintf(buf + len, sizeof(buf) - len, "\n"); 763 len += scnprintf(buf + len, sizeof(buf) - len, "\n");
763 764
764 reg = sc->sc_ah->imask; 765 reg = sc->sc_ah->imask;
765 766
766 len += snprintf(buf + len, sizeof(buf) - len, "INTERRUPT-MASK: 0x%x", reg); 767 len += scnprintf(buf + len, sizeof(buf) - len,
768 "INTERRUPT-MASK: 0x%x", reg);
767 769
768 if (reg & ATH9K_INT_SWBA) 770 if (reg & ATH9K_INT_SWBA)
769 len += snprintf(buf + len, sizeof(buf) - len, " SWBA"); 771 len += scnprintf(buf + len, sizeof(buf) - len, " SWBA");
770 if (reg & ATH9K_INT_BMISS) 772 if (reg & ATH9K_INT_BMISS)
771 len += snprintf(buf + len, sizeof(buf) - len, " BMISS"); 773 len += scnprintf(buf + len, sizeof(buf) - len, " BMISS");
772 if (reg & ATH9K_INT_CST) 774 if (reg & ATH9K_INT_CST)
773 len += snprintf(buf + len, sizeof(buf) - len, " CST"); 775 len += scnprintf(buf + len, sizeof(buf) - len, " CST");
774 if (reg & ATH9K_INT_RX) 776 if (reg & ATH9K_INT_RX)
775 len += snprintf(buf + len, sizeof(buf) - len, " RX"); 777 len += scnprintf(buf + len, sizeof(buf) - len, " RX");
776 if (reg & ATH9K_INT_RXHP) 778 if (reg & ATH9K_INT_RXHP)
777 len += snprintf(buf + len, sizeof(buf) - len, " RXHP"); 779 len += scnprintf(buf + len, sizeof(buf) - len, " RXHP");
778 if (reg & ATH9K_INT_RXLP) 780 if (reg & ATH9K_INT_RXLP)
779 len += snprintf(buf + len, sizeof(buf) - len, " RXLP"); 781 len += scnprintf(buf + len, sizeof(buf) - len, " RXLP");
780 if (reg & ATH9K_INT_BB_WATCHDOG) 782 if (reg & ATH9K_INT_BB_WATCHDOG)
781 len += snprintf(buf + len, sizeof(buf) - len, " BB_WATCHDOG"); 783 len += scnprintf(buf + len, sizeof(buf) - len, " BB_WATCHDOG");
782 784
783 len += snprintf(buf + len, sizeof(buf) - len, "\n"); 785 len += scnprintf(buf + len, sizeof(buf) - len, "\n");
784 786
785 ath9k_calculate_iter_data(hw, NULL, &iter_data); 787 ath9k_calculate_iter_data(hw, NULL, &iter_data);
786 788
787 len += snprintf(buf + len, sizeof(buf) - len, 789 len += scnprintf(buf + len, sizeof(buf) - len,
788 "VIF-COUNTS: AP: %i STA: %i MESH: %i WDS: %i" 790 "VIF-COUNTS: AP: %i STA: %i MESH: %i WDS: %i"
789 " ADHOC: %i TOTAL: %hi BEACON-VIF: %hi\n", 791 " ADHOC: %i TOTAL: %hi BEACON-VIF: %hi\n",
790 iter_data.naps, iter_data.nstations, iter_data.nmeshes, 792 iter_data.naps, iter_data.nstations, iter_data.nmeshes,
791 iter_data.nwds, iter_data.nadhocs, 793 iter_data.nwds, iter_data.nadhocs,
792 sc->nvifs, sc->nbcnvifs); 794 sc->nvifs, sc->nbcnvifs);
793 795
794 if (len > sizeof(buf)) 796 if (len > sizeof(buf))
795 len = sizeof(buf); 797 len = sizeof(buf);
@@ -805,27 +807,27 @@ static ssize_t read_file_reset(struct file *file, char __user *user_buf,
805 char buf[512]; 807 char buf[512];
806 unsigned int len = 0; 808 unsigned int len = 0;
807 809
808 len += snprintf(buf + len, sizeof(buf) - len, 810 len += scnprintf(buf + len, sizeof(buf) - len,
809 "%17s: %2d\n", "Baseband Hang", 811 "%17s: %2d\n", "Baseband Hang",
810 sc->debug.stats.reset[RESET_TYPE_BB_HANG]); 812 sc->debug.stats.reset[RESET_TYPE_BB_HANG]);
811 len += snprintf(buf + len, sizeof(buf) - len, 813 len += scnprintf(buf + len, sizeof(buf) - len,
812 "%17s: %2d\n", "Baseband Watchdog", 814 "%17s: %2d\n", "Baseband Watchdog",
813 sc->debug.stats.reset[RESET_TYPE_BB_WATCHDOG]); 815 sc->debug.stats.reset[RESET_TYPE_BB_WATCHDOG]);
814 len += snprintf(buf + len, sizeof(buf) - len, 816 len += scnprintf(buf + len, sizeof(buf) - len,
815 "%17s: %2d\n", "Fatal HW Error", 817 "%17s: %2d\n", "Fatal HW Error",
816 sc->debug.stats.reset[RESET_TYPE_FATAL_INT]); 818 sc->debug.stats.reset[RESET_TYPE_FATAL_INT]);
817 len += snprintf(buf + len, sizeof(buf) - len, 819 len += scnprintf(buf + len, sizeof(buf) - len,
818 "%17s: %2d\n", "TX HW error", 820 "%17s: %2d\n", "TX HW error",
819 sc->debug.stats.reset[RESET_TYPE_TX_ERROR]); 821 sc->debug.stats.reset[RESET_TYPE_TX_ERROR]);
820 len += snprintf(buf + len, sizeof(buf) - len, 822 len += scnprintf(buf + len, sizeof(buf) - len,
821 "%17s: %2d\n", "TX Path Hang", 823 "%17s: %2d\n", "TX Path Hang",
822 sc->debug.stats.reset[RESET_TYPE_TX_HANG]); 824 sc->debug.stats.reset[RESET_TYPE_TX_HANG]);
823 len += snprintf(buf + len, sizeof(buf) - len, 825 len += scnprintf(buf + len, sizeof(buf) - len,
824 "%17s: %2d\n", "PLL RX Hang", 826 "%17s: %2d\n", "PLL RX Hang",
825 sc->debug.stats.reset[RESET_TYPE_PLL_HANG]); 827 sc->debug.stats.reset[RESET_TYPE_PLL_HANG]);
826 len += snprintf(buf + len, sizeof(buf) - len, 828 len += scnprintf(buf + len, sizeof(buf) - len,
827 "%17s: %2d\n", "MCI Reset", 829 "%17s: %2d\n", "MCI Reset",
828 sc->debug.stats.reset[RESET_TYPE_MCI]); 830 sc->debug.stats.reset[RESET_TYPE_MCI]);
829 831
830 if (len > sizeof(buf)) 832 if (len > sizeof(buf))
831 len = sizeof(buf); 833 len = sizeof(buf);
@@ -902,14 +904,14 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf,
902 size_t count, loff_t *ppos) 904 size_t count, loff_t *ppos)
903{ 905{
904#define PHY_ERR(s, p) \ 906#define PHY_ERR(s, p) \
905 len += snprintf(buf + len, size - len, "%22s : %10u\n", s, \ 907 len += scnprintf(buf + len, size - len, "%22s : %10u\n", s, \
906 sc->debug.stats.rxstats.phy_err_stats[p]); 908 sc->debug.stats.rxstats.phy_err_stats[p]);
907 909
908#define RXS_ERR(s, e) \ 910#define RXS_ERR(s, e) \
909 do { \ 911 do { \
910 len += snprintf(buf + len, size - len, \ 912 len += scnprintf(buf + len, size - len, \
911 "%22s : %10u\n", s, \ 913 "%22s : %10u\n", s, \
912 sc->debug.stats.rxstats.e); \ 914 sc->debug.stats.rxstats.e);\
913 } while (0) 915 } while (0)
914 916
915 struct ath_softc *sc = file->private_data; 917 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 if (!buf) 1441 if (!buf)
1440 return -ENOMEM; 1442 return -ENOMEM;
1441 1443
1442 len += snprintf(buf + len, size - len, 1444 len += scnprintf(buf + len, size - len,
1443 "Channel Noise Floor : %d\n", ah->noise); 1445 "Channel Noise Floor : %d\n", ah->noise);
1444 len += snprintf(buf + len, size - len, 1446 len += scnprintf(buf + len, size - len,
1445 "Chain | privNF | # Readings | NF Readings\n"); 1447 "Chain | privNF | # Readings | NF Readings\n");
1446 for (i = 0; i < NUM_NF_READINGS; i++) { 1448 for (i = 0; i < NUM_NF_READINGS; i++) {
1447 if (!(chainmask & (1 << i)) || 1449 if (!(chainmask & (1 << i)) ||
1448 ((i >= AR5416_MAX_CHAINS) && !conf_is_ht40(conf))) 1450 ((i >= AR5416_MAX_CHAINS) && !conf_is_ht40(conf)))
1449 continue; 1451 continue;
1450 1452
1451 nread = AR_PHY_CCA_FILTERWINDOW_LENGTH - h[i].invalidNFcount; 1453 nread = AR_PHY_CCA_FILTERWINDOW_LENGTH - h[i].invalidNFcount;
1452 len += snprintf(buf + len, size - len, " %d\t %d\t %d\t\t", 1454 len += scnprintf(buf + len, size - len, " %d\t %d\t %d\t\t",
1453 i, h[i].privNF, nread); 1455 i, h[i].privNF, nread);
1454 for (j = 0; j < nread; j++) 1456 for (j = 0; j < nread; j++)
1455 len += snprintf(buf + len, size - len, 1457 len += scnprintf(buf + len, size - len,
1456 " %d", h[i].nfCalBuffer[j]); 1458 " %d", h[i].nfCalBuffer[j]);
1457 len += snprintf(buf + len, size - len, "\n"); 1459 len += scnprintf(buf + len, size - len, "\n");
1458 } 1460 }
1459 1461
1460 if (len > size) 1462 if (len > size)
@@ -1543,8 +1545,8 @@ static ssize_t read_file_btcoex(struct file *file, char __user *user_buf,
1543 return -ENOMEM; 1545 return -ENOMEM;
1544 1546
1545 if (!sc->sc_ah->common.btcoex_enabled) { 1547 if (!sc->sc_ah->common.btcoex_enabled) {
1546 len = snprintf(buf, size, "%s\n", 1548 len = scnprintf(buf, size, "%s\n",
1547 "BTCOEX is disabled"); 1549 "BTCOEX is disabled");
1548 goto exit; 1550 goto exit;
1549 } 1551 }
1550 1552
@@ -1582,43 +1584,43 @@ static ssize_t read_file_node_stat(struct file *file, char __user *user_buf,
1582 return -ENOMEM; 1584 return -ENOMEM;
1583 1585
1584 if (!an->sta->ht_cap.ht_supported) { 1586 if (!an->sta->ht_cap.ht_supported) {
1585 len = snprintf(buf, size, "%s\n", 1587 len = scnprintf(buf, size, "%s\n",
1586 "HT not supported"); 1588 "HT not supported");
1587 goto exit; 1589 goto exit;
1588 } 1590 }
1589 1591
1590 len = snprintf(buf, size, "Max-AMPDU: %d\n", 1592 len = scnprintf(buf, size, "Max-AMPDU: %d\n",
1591 an->maxampdu); 1593 an->maxampdu);
1592 len += snprintf(buf + len, size - len, "MPDU Density: %d\n\n", 1594 len += scnprintf(buf + len, size - len, "MPDU Density: %d\n\n",
1593 an->mpdudensity); 1595 an->mpdudensity);
1594 1596
1595 len += snprintf(buf + len, size - len, 1597 len += scnprintf(buf + len, size - len,
1596 "%2s%7s\n", "AC", "SCHED"); 1598 "%2s%7s\n", "AC", "SCHED");
1597 1599
1598 for (acno = 0, ac = &an->ac[acno]; 1600 for (acno = 0, ac = &an->ac[acno];
1599 acno < IEEE80211_NUM_ACS; acno++, ac++) { 1601 acno < IEEE80211_NUM_ACS; acno++, ac++) {
1600 txq = ac->txq; 1602 txq = ac->txq;
1601 ath_txq_lock(sc, txq); 1603 ath_txq_lock(sc, txq);
1602 len += snprintf(buf + len, size - len, 1604 len += scnprintf(buf + len, size - len,
1603 "%2d%7d\n", 1605 "%2d%7d\n",
1604 acno, ac->sched); 1606 acno, ac->sched);
1605 ath_txq_unlock(sc, txq); 1607 ath_txq_unlock(sc, txq);
1606 } 1608 }
1607 1609
1608 len += snprintf(buf + len, size - len, 1610 len += scnprintf(buf + len, size - len,
1609 "\n%3s%11s%10s%10s%10s%10s%9s%6s%8s\n", 1611 "\n%3s%11s%10s%10s%10s%10s%9s%6s%8s\n",
1610 "TID", "SEQ_START", "SEQ_NEXT", "BAW_SIZE", 1612 "TID", "SEQ_START", "SEQ_NEXT", "BAW_SIZE",
1611 "BAW_HEAD", "BAW_TAIL", "BAR_IDX", "SCHED", "PAUSED"); 1613 "BAW_HEAD", "BAW_TAIL", "BAR_IDX", "SCHED", "PAUSED");
1612 1614
1613 for (tidno = 0, tid = &an->tid[tidno]; 1615 for (tidno = 0, tid = &an->tid[tidno];
1614 tidno < IEEE80211_NUM_TIDS; tidno++, tid++) { 1616 tidno < IEEE80211_NUM_TIDS; tidno++, tid++) {
1615 txq = tid->ac->txq; 1617 txq = tid->ac->txq;
1616 ath_txq_lock(sc, txq); 1618 ath_txq_lock(sc, txq);
1617 len += snprintf(buf + len, size - len, 1619 len += scnprintf(buf + len, size - len,
1618 "%3d%11d%10d%10d%10d%10d%9d%6d%8d\n", 1620 "%3d%11d%10d%10d%10d%10d%9d%6d%8d\n",
1619 tid->tidno, tid->seq_start, tid->seq_next, 1621 tid->tidno, tid->seq_start, tid->seq_next,
1620 tid->baw_size, tid->baw_head, tid->baw_tail, 1622 tid->baw_size, tid->baw_head, tid->baw_tail,
1621 tid->bar_index, tid->sched, tid->paused); 1623 tid->bar_index, tid->sched, tid->paused);
1622 ath_txq_unlock(sc, txq); 1624 ath_txq_unlock(sc, txq);
1623 } 1625 }
1624exit: 1626exit:
diff --git a/drivers/net/wireless/ath/ath9k/debug.h b/drivers/net/wireless/ath/ath9k/debug.h
index 6e1556fa2f3e..d6e3fa4299a4 100644
--- a/drivers/net/wireless/ath/ath9k/debug.h
+++ b/drivers/net/wireless/ath/ath9k/debug.h
@@ -193,12 +193,12 @@ struct ath_tx_stats {
193#define TXSTATS sc->debug.stats.txstats 193#define TXSTATS sc->debug.stats.txstats
194#define PR(str, elem) \ 194#define PR(str, elem) \
195 do { \ 195 do { \
196 len += snprintf(buf + len, size - len, \ 196 len += scnprintf(buf + len, size - len, \
197 "%s%13u%11u%10u%10u\n", str, \ 197 "%s%13u%11u%10u%10u\n", str, \
198 TXSTATS[PR_QNUM(IEEE80211_AC_BE)].elem, \ 198 TXSTATS[PR_QNUM(IEEE80211_AC_BE)].elem,\
199 TXSTATS[PR_QNUM(IEEE80211_AC_BK)].elem, \ 199 TXSTATS[PR_QNUM(IEEE80211_AC_BK)].elem,\
200 TXSTATS[PR_QNUM(IEEE80211_AC_VI)].elem, \ 200 TXSTATS[PR_QNUM(IEEE80211_AC_VI)].elem,\
201 TXSTATS[PR_QNUM(IEEE80211_AC_VO)].elem); \ 201 TXSTATS[PR_QNUM(IEEE80211_AC_VO)].elem); \
202 } while(0) 202 } while(0)
203 203
204#define RX_STAT_INC(c) (sc->debug.stats.rxstats.c++) 204#define RX_STAT_INC(c) (sc->debug.stats.rxstats.c++)
diff --git a/drivers/net/wireless/ath/ath9k/dfs_debug.c b/drivers/net/wireless/ath/ath9k/dfs_debug.c
index 3c6e4138a95d..821599135d8a 100644
--- a/drivers/net/wireless/ath/ath9k/dfs_debug.c
+++ b/drivers/net/wireless/ath/ath9k/dfs_debug.c
@@ -25,11 +25,11 @@
25struct ath_dfs_pool_stats global_dfs_pool_stats = { 0 }; 25struct ath_dfs_pool_stats global_dfs_pool_stats = { 0 };
26 26
27#define ATH9K_DFS_STAT(s, p) \ 27#define ATH9K_DFS_STAT(s, p) \
28 len += snprintf(buf + len, size - len, "%28s : %10u\n", s, \ 28 len += scnprintf(buf + len, size - len, "%28s : %10u\n", s, \
29 sc->debug.stats.dfs_stats.p); 29 sc->debug.stats.dfs_stats.p);
30#define ATH9K_DFS_POOL_STAT(s, p) \ 30#define ATH9K_DFS_POOL_STAT(s, p) \
31 len += snprintf(buf + len, size - len, "%28s : %10u\n", s, \ 31 len += scnprintf(buf + len, size - len, "%28s : %10u\n", s, \
32 global_dfs_pool_stats.p); 32 global_dfs_pool_stats.p);
33 33
34static ssize_t read_file_dfs(struct file *file, char __user *user_buf, 34static ssize_t read_file_dfs(struct file *file, char __user *user_buf,
35 size_t count, loff_t *ppos) 35 size_t count, loff_t *ppos)
@@ -44,12 +44,12 @@ static ssize_t read_file_dfs(struct file *file, char __user *user_buf,
44 if (buf == NULL) 44 if (buf == NULL)
45 return -ENOMEM; 45 return -ENOMEM;
46 46
47 len += snprintf(buf + len, size - len, "DFS support for " 47 len += scnprintf(buf + len, size - len, "DFS support for "
48 "macVersion = 0x%x, macRev = 0x%x: %s\n", 48 "macVersion = 0x%x, macRev = 0x%x: %s\n",
49 hw_ver->macVersion, hw_ver->macRev, 49 hw_ver->macVersion, hw_ver->macRev,
50 (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_DFS) ? 50 (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_DFS) ?
51 "enabled" : "disabled"); 51 "enabled" : "disabled");
52 len += snprintf(buf + len, size - len, "Pulse detector statistics:\n"); 52 len += scnprintf(buf + len, size - len, "Pulse detector statistics:\n");
53 ATH9K_DFS_STAT("pulse events reported ", pulses_total); 53 ATH9K_DFS_STAT("pulse events reported ", pulses_total);
54 ATH9K_DFS_STAT("invalid pulse events ", pulses_no_dfs); 54 ATH9K_DFS_STAT("invalid pulse events ", pulses_no_dfs);
55 ATH9K_DFS_STAT("DFS pulses detected ", pulses_detected); 55 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 ATH9K_DFS_STAT("Primary channel pulses ", pri_phy_errors); 59 ATH9K_DFS_STAT("Primary channel pulses ", pri_phy_errors);
60 ATH9K_DFS_STAT("Secondary channel pulses", ext_phy_errors); 60 ATH9K_DFS_STAT("Secondary channel pulses", ext_phy_errors);
61 ATH9K_DFS_STAT("Dual channel pulses ", dc_phy_errors); 61 ATH9K_DFS_STAT("Dual channel pulses ", dc_phy_errors);
62 len += snprintf(buf + len, size - len, "Radar detector statistics " 62 len += scnprintf(buf + len, size - len, "Radar detector statistics "
63 "(current DFS region: %d)\n", sc->dfs_detector->region); 63 "(current DFS region: %d)\n",
64 sc->dfs_detector->region);
64 ATH9K_DFS_STAT("Pulse events processed ", pulses_processed); 65 ATH9K_DFS_STAT("Pulse events processed ", pulses_processed);
65 ATH9K_DFS_STAT("Radars detected ", radar_detected); 66 ATH9K_DFS_STAT("Radars detected ", radar_detected);
66 len += snprintf(buf + len, size - len, "Global Pool statistics:\n"); 67 len += scnprintf(buf + len, size - len, "Global Pool statistics:\n");
67 ATH9K_DFS_POOL_STAT("Pool references ", pool_reference); 68 ATH9K_DFS_POOL_STAT("Pool references ", pool_reference);
68 ATH9K_DFS_POOL_STAT("Pulses allocated ", pulse_allocated); 69 ATH9K_DFS_POOL_STAT("Pulses allocated ", pulse_allocated);
69 ATH9K_DFS_POOL_STAT("Pulses alloc error ", pulse_alloc_error); 70 ATH9K_DFS_POOL_STAT("Pulses alloc error ", pulse_alloc_error);
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_4k.c b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
index 9ea8e4b779c9..b4091716e9b3 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
@@ -129,10 +129,10 @@ static u32 ath9k_hw_4k_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
129 struct base_eep_header_4k *pBase = &eep->baseEepHeader; 129 struct base_eep_header_4k *pBase = &eep->baseEepHeader;
130 130
131 if (!dump_base_hdr) { 131 if (!dump_base_hdr) {
132 len += snprintf(buf + len, size - len, 132 len += scnprintf(buf + len, size - len,
133 "%20s :\n", "2GHz modal Header"); 133 "%20s :\n", "2GHz modal Header");
134 len = ath9k_dump_4k_modal_eeprom(buf, len, size, 134 len = ath9k_dump_4k_modal_eeprom(buf, len, size,
135 &eep->modalHeader); 135 &eep->modalHeader);
136 goto out; 136 goto out;
137 } 137 }
138 138
@@ -160,8 +160,8 @@ static u32 ath9k_hw_4k_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
160 PR_EEP("Cal Bin Build", (pBase->binBuildNumber >> 8) & 0xFF); 160 PR_EEP("Cal Bin Build", (pBase->binBuildNumber >> 8) & 0xFF);
161 PR_EEP("TX Gain type", pBase->txGainType); 161 PR_EEP("TX Gain type", pBase->txGainType);
162 162
163 len += snprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress", 163 len += scnprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress",
164 pBase->macAddr); 164 pBase->macAddr);
165 165
166out: 166out:
167 if (len > size) 167 if (len > size)
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
index 3ae1f3df0637..e1d0c217c104 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
@@ -125,8 +125,8 @@ static u32 ath9k_hw_ar9287_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
125 struct base_eep_ar9287_header *pBase = &eep->baseEepHeader; 125 struct base_eep_ar9287_header *pBase = &eep->baseEepHeader;
126 126
127 if (!dump_base_hdr) { 127 if (!dump_base_hdr) {
128 len += snprintf(buf + len, size - len, 128 len += scnprintf(buf + len, size - len,
129 "%20s :\n", "2GHz modal Header"); 129 "%20s :\n", "2GHz modal Header");
130 len = ar9287_dump_modal_eeprom(buf, len, size, 130 len = ar9287_dump_modal_eeprom(buf, len, size,
131 &eep->modalHeader); 131 &eep->modalHeader);
132 goto out; 132 goto out;
@@ -157,8 +157,8 @@ static u32 ath9k_hw_ar9287_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
157 PR_EEP("Power Table Offset", pBase->pwrTableOffset); 157 PR_EEP("Power Table Offset", pBase->pwrTableOffset);
158 PR_EEP("OpenLoop Power Ctrl", pBase->openLoopPwrCntl); 158 PR_EEP("OpenLoop Power Ctrl", pBase->openLoopPwrCntl);
159 159
160 len += snprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress", 160 len += scnprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress",
161 pBase->macAddr); 161 pBase->macAddr);
162 162
163out: 163out:
164 if (len > size) 164 if (len > size)
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_def.c b/drivers/net/wireless/ath/ath9k/eeprom_def.c
index 1c25368b3836..39107e31e79a 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
@@ -205,12 +205,12 @@ static u32 ath9k_hw_def_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
205 struct base_eep_header *pBase = &eep->baseEepHeader; 205 struct base_eep_header *pBase = &eep->baseEepHeader;
206 206
207 if (!dump_base_hdr) { 207 if (!dump_base_hdr) {
208 len += snprintf(buf + len, size - len, 208 len += scnprintf(buf + len, size - len,
209 "%20s :\n", "2GHz modal Header"); 209 "%20s :\n", "2GHz modal Header");
210 len = ath9k_def_dump_modal_eeprom(buf, len, size, 210 len = ath9k_def_dump_modal_eeprom(buf, len, size,
211 &eep->modalHeader[0]); 211 &eep->modalHeader[0]);
212 len += snprintf(buf + len, size - len, 212 len += scnprintf(buf + len, size - len,
213 "%20s :\n", "5GHz modal Header"); 213 "%20s :\n", "5GHz modal Header");
214 len = ath9k_def_dump_modal_eeprom(buf, len, size, 214 len = ath9k_def_dump_modal_eeprom(buf, len, size,
215 &eep->modalHeader[1]); 215 &eep->modalHeader[1]);
216 goto out; 216 goto out;
@@ -240,8 +240,8 @@ static u32 ath9k_hw_def_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
240 PR_EEP("Cal Bin Build", (pBase->binBuildNumber >> 8) & 0xFF); 240 PR_EEP("Cal Bin Build", (pBase->binBuildNumber >> 8) & 0xFF);
241 PR_EEP("OpenLoop Power Ctrl", pBase->openLoopPwrCntl); 241 PR_EEP("OpenLoop Power Ctrl", pBase->openLoopPwrCntl);
242 242
243 len += snprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress", 243 len += scnprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress",
244 pBase->macAddr); 244 pBase->macAddr);
245 245
246out: 246out:
247 if (len > size) 247 if (len > size)
diff --git a/drivers/net/wireless/ath/ath9k/gpio.c b/drivers/net/wireless/ath/ath9k/gpio.c
index 4b412aaf4f36..c34f21241da9 100644
--- a/drivers/net/wireless/ath/ath9k/gpio.c
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
@@ -522,22 +522,22 @@ static int ath9k_dump_mci_btcoex(struct ath_softc *sc, u8 *buf, u32 size)
522 ATH_DUMP_BTCOEX("Concurrent Tx", btcoex_hw->mci.concur_tx); 522 ATH_DUMP_BTCOEX("Concurrent Tx", btcoex_hw->mci.concur_tx);
523 ATH_DUMP_BTCOEX("Concurrent RSSI cnt", btcoex->rssi_count); 523 ATH_DUMP_BTCOEX("Concurrent RSSI cnt", btcoex->rssi_count);
524 524
525 len += snprintf(buf + len, size - len, "BT Weights: "); 525 len += scnprintf(buf + len, size - len, "BT Weights: ");
526 for (i = 0; i < AR9300_NUM_BT_WEIGHTS; i++) 526 for (i = 0; i < AR9300_NUM_BT_WEIGHTS; i++)
527 len += snprintf(buf + len, size - len, "%08x ", 527 len += scnprintf(buf + len, size - len, "%08x ",
528 btcoex_hw->bt_weight[i]); 528 btcoex_hw->bt_weight[i]);
529 len += snprintf(buf + len, size - len, "\n"); 529 len += scnprintf(buf + len, size - len, "\n");
530 len += snprintf(buf + len, size - len, "WLAN Weights: "); 530 len += scnprintf(buf + len, size - len, "WLAN Weights: ");
531 for (i = 0; i < AR9300_NUM_BT_WEIGHTS; i++) 531 for (i = 0; i < AR9300_NUM_BT_WEIGHTS; i++)
532 len += snprintf(buf + len, size - len, "%08x ", 532 len += scnprintf(buf + len, size - len, "%08x ",
533 btcoex_hw->wlan_weight[i]); 533 btcoex_hw->wlan_weight[i]);
534 len += snprintf(buf + len, size - len, "\n"); 534 len += scnprintf(buf + len, size - len, "\n");
535 len += snprintf(buf + len, size - len, "Tx Priorities: "); 535 len += scnprintf(buf + len, size - len, "Tx Priorities: ");
536 for (i = 0; i < ATH_BTCOEX_STOMP_MAX; i++) 536 for (i = 0; i < ATH_BTCOEX_STOMP_MAX; i++)
537 len += snprintf(buf + len, size - len, "%08x ", 537 len += scnprintf(buf + len, size - len, "%08x ",
538 btcoex_hw->tx_prio[i]); 538 btcoex_hw->tx_prio[i]);
539 539
540 len += snprintf(buf + len, size - len, "\n"); 540 len += scnprintf(buf + len, size - len, "\n");
541 541
542 return len; 542 return len;
543} 543}
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
index c1b45e2f8481..fb071ee4fcfb 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
@@ -37,29 +37,29 @@ static ssize_t read_file_tgt_int_stats(struct file *file, char __user *user_buf,
37 37
38 ath9k_htc_ps_restore(priv); 38 ath9k_htc_ps_restore(priv);
39 39
40 len += snprintf(buf + len, sizeof(buf) - len, 40 len += scnprintf(buf + len, sizeof(buf) - len,
41 "%20s : %10u\n", "RX", 41 "%20s : %10u\n", "RX",
42 be32_to_cpu(cmd_rsp.rx)); 42 be32_to_cpu(cmd_rsp.rx));
43 43
44 len += snprintf(buf + len, sizeof(buf) - len, 44 len += scnprintf(buf + len, sizeof(buf) - len,
45 "%20s : %10u\n", "RXORN", 45 "%20s : %10u\n", "RXORN",
46 be32_to_cpu(cmd_rsp.rxorn)); 46 be32_to_cpu(cmd_rsp.rxorn));
47 47
48 len += snprintf(buf + len, sizeof(buf) - len, 48 len += scnprintf(buf + len, sizeof(buf) - len,
49 "%20s : %10u\n", "RXEOL", 49 "%20s : %10u\n", "RXEOL",
50 be32_to_cpu(cmd_rsp.rxeol)); 50 be32_to_cpu(cmd_rsp.rxeol));
51 51
52 len += snprintf(buf + len, sizeof(buf) - len, 52 len += scnprintf(buf + len, sizeof(buf) - len,
53 "%20s : %10u\n", "TXURN", 53 "%20s : %10u\n", "TXURN",
54 be32_to_cpu(cmd_rsp.txurn)); 54 be32_to_cpu(cmd_rsp.txurn));
55 55
56 len += snprintf(buf + len, sizeof(buf) - len, 56 len += scnprintf(buf + len, sizeof(buf) - len,
57 "%20s : %10u\n", "TXTO", 57 "%20s : %10u\n", "TXTO",
58 be32_to_cpu(cmd_rsp.txto)); 58 be32_to_cpu(cmd_rsp.txto));
59 59
60 len += snprintf(buf + len, sizeof(buf) - len, 60 len += scnprintf(buf + len, sizeof(buf) - len,
61 "%20s : %10u\n", "CST", 61 "%20s : %10u\n", "CST",
62 be32_to_cpu(cmd_rsp.cst)); 62 be32_to_cpu(cmd_rsp.cst));
63 63
64 if (len > sizeof(buf)) 64 if (len > sizeof(buf))
65 len = sizeof(buf); 65 len = sizeof(buf);
@@ -95,41 +95,41 @@ static ssize_t read_file_tgt_tx_stats(struct file *file, char __user *user_buf,
95 95
96 ath9k_htc_ps_restore(priv); 96 ath9k_htc_ps_restore(priv);
97 97
98 len += snprintf(buf + len, sizeof(buf) - len, 98 len += scnprintf(buf + len, sizeof(buf) - len,
99 "%20s : %10u\n", "Xretries", 99 "%20s : %10u\n", "Xretries",
100 be32_to_cpu(cmd_rsp.xretries)); 100 be32_to_cpu(cmd_rsp.xretries));
101 101
102 len += snprintf(buf + len, sizeof(buf) - len, 102 len += scnprintf(buf + len, sizeof(buf) - len,
103 "%20s : %10u\n", "FifoErr", 103 "%20s : %10u\n", "FifoErr",
104 be32_to_cpu(cmd_rsp.fifoerr)); 104 be32_to_cpu(cmd_rsp.fifoerr));
105 105
106 len += snprintf(buf + len, sizeof(buf) - len, 106 len += scnprintf(buf + len, sizeof(buf) - len,
107 "%20s : %10u\n", "Filtered", 107 "%20s : %10u\n", "Filtered",
108 be32_to_cpu(cmd_rsp.filtered)); 108 be32_to_cpu(cmd_rsp.filtered));
109 109
110 len += snprintf(buf + len, sizeof(buf) - len, 110 len += scnprintf(buf + len, sizeof(buf) - len,
111 "%20s : %10u\n", "TimerExp", 111 "%20s : %10u\n", "TimerExp",
112 be32_to_cpu(cmd_rsp.timer_exp)); 112 be32_to_cpu(cmd_rsp.timer_exp));
113 113
114 len += snprintf(buf + len, sizeof(buf) - len, 114 len += scnprintf(buf + len, sizeof(buf) - len,
115 "%20s : %10u\n", "ShortRetries", 115 "%20s : %10u\n", "ShortRetries",
116 be32_to_cpu(cmd_rsp.shortretries)); 116 be32_to_cpu(cmd_rsp.shortretries));
117 117
118 len += snprintf(buf + len, sizeof(buf) - len, 118 len += scnprintf(buf + len, sizeof(buf) - len,
119 "%20s : %10u\n", "LongRetries", 119 "%20s : %10u\n", "LongRetries",
120 be32_to_cpu(cmd_rsp.longretries)); 120 be32_to_cpu(cmd_rsp.longretries));
121 121
122 len += snprintf(buf + len, sizeof(buf) - len, 122 len += scnprintf(buf + len, sizeof(buf) - len,
123 "%20s : %10u\n", "QueueNull", 123 "%20s : %10u\n", "QueueNull",
124 be32_to_cpu(cmd_rsp.qnull)); 124 be32_to_cpu(cmd_rsp.qnull));
125 125
126 len += snprintf(buf + len, sizeof(buf) - len, 126 len += scnprintf(buf + len, sizeof(buf) - len,
127 "%20s : %10u\n", "EncapFail", 127 "%20s : %10u\n", "EncapFail",
128 be32_to_cpu(cmd_rsp.encap_fail)); 128 be32_to_cpu(cmd_rsp.encap_fail));
129 129
130 len += snprintf(buf + len, sizeof(buf) - len, 130 len += scnprintf(buf + len, sizeof(buf) - len,
131 "%20s : %10u\n", "NoBuf", 131 "%20s : %10u\n", "NoBuf",
132 be32_to_cpu(cmd_rsp.nobuf)); 132 be32_to_cpu(cmd_rsp.nobuf));
133 133
134 if (len > sizeof(buf)) 134 if (len > sizeof(buf))
135 len = sizeof(buf); 135 len = sizeof(buf);
@@ -165,17 +165,17 @@ static ssize_t read_file_tgt_rx_stats(struct file *file, char __user *user_buf,
165 165
166 ath9k_htc_ps_restore(priv); 166 ath9k_htc_ps_restore(priv);
167 167
168 len += snprintf(buf + len, sizeof(buf) - len, 168 len += scnprintf(buf + len, sizeof(buf) - len,
169 "%20s : %10u\n", "NoBuf", 169 "%20s : %10u\n", "NoBuf",
170 be32_to_cpu(cmd_rsp.nobuf)); 170 be32_to_cpu(cmd_rsp.nobuf));
171 171
172 len += snprintf(buf + len, sizeof(buf) - len, 172 len += scnprintf(buf + len, sizeof(buf) - len,
173 "%20s : %10u\n", "HostSend", 173 "%20s : %10u\n", "HostSend",
174 be32_to_cpu(cmd_rsp.host_send)); 174 be32_to_cpu(cmd_rsp.host_send));
175 175
176 len += snprintf(buf + len, sizeof(buf) - len, 176 len += scnprintf(buf + len, sizeof(buf) - len,
177 "%20s : %10u\n", "HostDone", 177 "%20s : %10u\n", "HostDone",
178 be32_to_cpu(cmd_rsp.host_done)); 178 be32_to_cpu(cmd_rsp.host_done));
179 179
180 if (len > sizeof(buf)) 180 if (len > sizeof(buf))
181 len = sizeof(buf); 181 len = sizeof(buf);
@@ -197,37 +197,37 @@ static ssize_t read_file_xmit(struct file *file, char __user *user_buf,
197 char buf[512]; 197 char buf[512];
198 unsigned int len = 0; 198 unsigned int len = 0;
199 199
200 len += snprintf(buf + len, sizeof(buf) - len, 200 len += scnprintf(buf + len, sizeof(buf) - len,
201 "%20s : %10u\n", "Buffers queued", 201 "%20s : %10u\n", "Buffers queued",
202 priv->debug.tx_stats.buf_queued); 202 priv->debug.tx_stats.buf_queued);
203 len += snprintf(buf + len, sizeof(buf) - len, 203 len += scnprintf(buf + len, sizeof(buf) - len,
204 "%20s : %10u\n", "Buffers completed", 204 "%20s : %10u\n", "Buffers completed",
205 priv->debug.tx_stats.buf_completed); 205 priv->debug.tx_stats.buf_completed);
206 len += snprintf(buf + len, sizeof(buf) - len, 206 len += scnprintf(buf + len, sizeof(buf) - len,
207 "%20s : %10u\n", "SKBs queued", 207 "%20s : %10u\n", "SKBs queued",
208 priv->debug.tx_stats.skb_queued); 208 priv->debug.tx_stats.skb_queued);
209 len += snprintf(buf + len, sizeof(buf) - len, 209 len += scnprintf(buf + len, sizeof(buf) - len,
210 "%20s : %10u\n", "SKBs success", 210 "%20s : %10u\n", "SKBs success",
211 priv->debug.tx_stats.skb_success); 211 priv->debug.tx_stats.skb_success);
212 len += snprintf(buf + len, sizeof(buf) - len, 212 len += scnprintf(buf + len, sizeof(buf) - len,
213 "%20s : %10u\n", "SKBs failed", 213 "%20s : %10u\n", "SKBs failed",
214 priv->debug.tx_stats.skb_failed); 214 priv->debug.tx_stats.skb_failed);
215 len += snprintf(buf + len, sizeof(buf) - len, 215 len += scnprintf(buf + len, sizeof(buf) - len,
216 "%20s : %10u\n", "CAB queued", 216 "%20s : %10u\n", "CAB queued",
217 priv->debug.tx_stats.cab_queued); 217 priv->debug.tx_stats.cab_queued);
218 218
219 len += snprintf(buf + len, sizeof(buf) - len, 219 len += scnprintf(buf + len, sizeof(buf) - len,
220 "%20s : %10u\n", "BE queued", 220 "%20s : %10u\n", "BE queued",
221 priv->debug.tx_stats.queue_stats[IEEE80211_AC_BE]); 221 priv->debug.tx_stats.queue_stats[IEEE80211_AC_BE]);
222 len += snprintf(buf + len, sizeof(buf) - len, 222 len += scnprintf(buf + len, sizeof(buf) - len,
223 "%20s : %10u\n", "BK queued", 223 "%20s : %10u\n", "BK queued",
224 priv->debug.tx_stats.queue_stats[IEEE80211_AC_BK]); 224 priv->debug.tx_stats.queue_stats[IEEE80211_AC_BK]);
225 len += snprintf(buf + len, sizeof(buf) - len, 225 len += scnprintf(buf + len, sizeof(buf) - len,
226 "%20s : %10u\n", "VI queued", 226 "%20s : %10u\n", "VI queued",
227 priv->debug.tx_stats.queue_stats[IEEE80211_AC_VI]); 227 priv->debug.tx_stats.queue_stats[IEEE80211_AC_VI]);
228 len += snprintf(buf + len, sizeof(buf) - len, 228 len += scnprintf(buf + len, sizeof(buf) - len,
229 "%20s : %10u\n", "VO queued", 229 "%20s : %10u\n", "VO queued",
230 priv->debug.tx_stats.queue_stats[IEEE80211_AC_VO]); 230 priv->debug.tx_stats.queue_stats[IEEE80211_AC_VO]);
231 231
232 if (len > sizeof(buf)) 232 if (len > sizeof(buf))
233 len = sizeof(buf); 233 len = sizeof(buf);
@@ -273,8 +273,8 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf,
273 size_t count, loff_t *ppos) 273 size_t count, loff_t *ppos)
274{ 274{
275#define PHY_ERR(s, p) \ 275#define PHY_ERR(s, p) \
276 len += snprintf(buf + len, size - len, "%20s : %10u\n", s, \ 276 len += scnprintf(buf + len, size - len, "%20s : %10u\n", s, \
277 priv->debug.rx_stats.err_phy_stats[p]); 277 priv->debug.rx_stats.err_phy_stats[p]);
278 278
279 struct ath9k_htc_priv *priv = file->private_data; 279 struct ath9k_htc_priv *priv = file->private_data;
280 char *buf; 280 char *buf;
@@ -285,37 +285,37 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf,
285 if (buf == NULL) 285 if (buf == NULL)
286 return -ENOMEM; 286 return -ENOMEM;
287 287
288 len += snprintf(buf + len, size - len, 288 len += scnprintf(buf + len, size - len,
289 "%20s : %10u\n", "SKBs allocated", 289 "%20s : %10u\n", "SKBs allocated",
290 priv->debug.rx_stats.skb_allocated); 290 priv->debug.rx_stats.skb_allocated);
291 len += snprintf(buf + len, size - len, 291 len += scnprintf(buf + len, size - len,
292 "%20s : %10u\n", "SKBs completed", 292 "%20s : %10u\n", "SKBs completed",
293 priv->debug.rx_stats.skb_completed); 293 priv->debug.rx_stats.skb_completed);
294 len += snprintf(buf + len, size - len, 294 len += scnprintf(buf + len, size - len,
295 "%20s : %10u\n", "SKBs Dropped", 295 "%20s : %10u\n", "SKBs Dropped",
296 priv->debug.rx_stats.skb_dropped); 296 priv->debug.rx_stats.skb_dropped);
297 297
298 len += snprintf(buf + len, size - len, 298 len += scnprintf(buf + len, size - len,
299 "%20s : %10u\n", "CRC ERR", 299 "%20s : %10u\n", "CRC ERR",
300 priv->debug.rx_stats.err_crc); 300 priv->debug.rx_stats.err_crc);
301 len += snprintf(buf + len, size - len, 301 len += scnprintf(buf + len, size - len,
302 "%20s : %10u\n", "DECRYPT CRC ERR", 302 "%20s : %10u\n", "DECRYPT CRC ERR",
303 priv->debug.rx_stats.err_decrypt_crc); 303 priv->debug.rx_stats.err_decrypt_crc);
304 len += snprintf(buf + len, size - len, 304 len += scnprintf(buf + len, size - len,
305 "%20s : %10u\n", "MIC ERR", 305 "%20s : %10u\n", "MIC ERR",
306 priv->debug.rx_stats.err_mic); 306 priv->debug.rx_stats.err_mic);
307 len += snprintf(buf + len, size - len, 307 len += scnprintf(buf + len, size - len,
308 "%20s : %10u\n", "PRE-DELIM CRC ERR", 308 "%20s : %10u\n", "PRE-DELIM CRC ERR",
309 priv->debug.rx_stats.err_pre_delim); 309 priv->debug.rx_stats.err_pre_delim);
310 len += snprintf(buf + len, size - len, 310 len += scnprintf(buf + len, size - len,
311 "%20s : %10u\n", "POST-DELIM CRC ERR", 311 "%20s : %10u\n", "POST-DELIM CRC ERR",
312 priv->debug.rx_stats.err_post_delim); 312 priv->debug.rx_stats.err_post_delim);
313 len += snprintf(buf + len, size - len, 313 len += scnprintf(buf + len, size - len,
314 "%20s : %10u\n", "DECRYPT BUSY ERR", 314 "%20s : %10u\n", "DECRYPT BUSY ERR",
315 priv->debug.rx_stats.err_decrypt_busy); 315 priv->debug.rx_stats.err_decrypt_busy);
316 len += snprintf(buf + len, size - len, 316 len += scnprintf(buf + len, size - len,
317 "%20s : %10u\n", "TOTAL PHY ERR", 317 "%20s : %10u\n", "TOTAL PHY ERR",
318 priv->debug.rx_stats.err_phy); 318 priv->debug.rx_stats.err_phy);
319 319
320 320
321 PHY_ERR("UNDERRUN", ATH9K_PHYERR_UNDERRUN); 321 PHY_ERR("UNDERRUN", ATH9K_PHYERR_UNDERRUN);
@@ -372,16 +372,16 @@ static ssize_t read_file_slot(struct file *file, char __user *user_buf,
372 372
373 spin_lock_bh(&priv->tx.tx_lock); 373 spin_lock_bh(&priv->tx.tx_lock);
374 374
375 len += snprintf(buf + len, sizeof(buf) - len, "TX slot bitmap : "); 375 len += scnprintf(buf + len, sizeof(buf) - len, "TX slot bitmap : ");
376 376
377 len += bitmap_scnprintf(buf + len, sizeof(buf) - len, 377 len += bitmap_scnprintf(buf + len, sizeof(buf) - len,
378 priv->tx.tx_slot, MAX_TX_BUF_NUM); 378 priv->tx.tx_slot, MAX_TX_BUF_NUM);
379 379
380 len += snprintf(buf + len, sizeof(buf) - len, "\n"); 380 len += scnprintf(buf + len, sizeof(buf) - len, "\n");
381 381
382 len += snprintf(buf + len, sizeof(buf) - len, 382 len += scnprintf(buf + len, sizeof(buf) - len,
383 "Used slots : %d\n", 383 "Used slots : %d\n",
384 bitmap_weight(priv->tx.tx_slot, MAX_TX_BUF_NUM)); 384 bitmap_weight(priv->tx.tx_slot, MAX_TX_BUF_NUM));
385 385
386 spin_unlock_bh(&priv->tx.tx_lock); 386 spin_unlock_bh(&priv->tx.tx_lock);
387 387
@@ -405,30 +405,30 @@ static ssize_t read_file_queue(struct file *file, char __user *user_buf,
405 char buf[512]; 405 char buf[512];
406 unsigned int len = 0; 406 unsigned int len = 0;
407 407
408 len += snprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", 408 len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n",
409 "Mgmt endpoint", skb_queue_len(&priv->tx.mgmt_ep_queue)); 409 "Mgmt endpoint", skb_queue_len(&priv->tx.mgmt_ep_queue));
410 410
411 len += snprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", 411 len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n",
412 "Cab endpoint", skb_queue_len(&priv->tx.cab_ep_queue)); 412 "Cab endpoint", skb_queue_len(&priv->tx.cab_ep_queue));
413 413
414 len += snprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", 414 len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n",
415 "Data BE endpoint", skb_queue_len(&priv->tx.data_be_queue)); 415 "Data BE endpoint", skb_queue_len(&priv->tx.data_be_queue));
416 416
417 len += snprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", 417 len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n",
418 "Data BK endpoint", skb_queue_len(&priv->tx.data_bk_queue)); 418 "Data BK endpoint", skb_queue_len(&priv->tx.data_bk_queue));
419 419
420 len += snprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", 420 len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n",
421 "Data VI endpoint", skb_queue_len(&priv->tx.data_vi_queue)); 421 "Data VI endpoint", skb_queue_len(&priv->tx.data_vi_queue));
422 422
423 len += snprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", 423 len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n",
424 "Data VO endpoint", skb_queue_len(&priv->tx.data_vo_queue)); 424 "Data VO endpoint", skb_queue_len(&priv->tx.data_vo_queue));
425 425
426 len += snprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", 426 len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n",
427 "Failed queue", skb_queue_len(&priv->tx.tx_failed)); 427 "Failed queue", skb_queue_len(&priv->tx.tx_failed));
428 428
429 spin_lock_bh(&priv->tx.tx_lock); 429 spin_lock_bh(&priv->tx.tx_lock);
430 len += snprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", 430 len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n",
431 "Queued count", priv->tx.queued_cnt); 431 "Queued count", priv->tx.queued_cnt);
432 spin_unlock_bh(&priv->tx.tx_lock); 432 spin_unlock_bh(&priv->tx.tx_lock);
433 433
434 if (len > sizeof(buf)) 434 if (len > sizeof(buf))
@@ -507,70 +507,70 @@ static ssize_t read_file_base_eeprom(struct file *file, char __user *user_buf,
507 if (buf == NULL) 507 if (buf == NULL)
508 return -ENOMEM; 508 return -ENOMEM;
509 509
510 len += snprintf(buf + len, size - len, 510 len += scnprintf(buf + len, size - len,
511 "%20s : %10d\n", "Major Version", 511 "%20s : %10d\n", "Major Version",
512 pBase->version >> 12); 512 pBase->version >> 12);
513 len += snprintf(buf + len, size - len, 513 len += scnprintf(buf + len, size - len,
514 "%20s : %10d\n", "Minor Version", 514 "%20s : %10d\n", "Minor Version",
515 pBase->version & 0xFFF); 515 pBase->version & 0xFFF);
516 len += snprintf(buf + len, size - len, 516 len += scnprintf(buf + len, size - len,
517 "%20s : %10d\n", "Checksum", 517 "%20s : %10d\n", "Checksum",
518 pBase->checksum); 518 pBase->checksum);
519 len += snprintf(buf + len, size - len, 519 len += scnprintf(buf + len, size - len,
520 "%20s : %10d\n", "Length", 520 "%20s : %10d\n", "Length",
521 pBase->length); 521 pBase->length);
522 len += snprintf(buf + len, size - len, 522 len += scnprintf(buf + len, size - len,
523 "%20s : %10d\n", "RegDomain1", 523 "%20s : %10d\n", "RegDomain1",
524 pBase->regDmn[0]); 524 pBase->regDmn[0]);
525 len += snprintf(buf + len, size - len, 525 len += scnprintf(buf + len, size - len,
526 "%20s : %10d\n", "RegDomain2", 526 "%20s : %10d\n", "RegDomain2",
527 pBase->regDmn[1]); 527 pBase->regDmn[1]);
528 len += snprintf(buf + len, size - len, 528 len += scnprintf(buf + len, size - len,
529 "%20s : %10d\n", 529 "%20s : %10d\n",
530 "TX Mask", pBase->txMask); 530 "TX Mask", pBase->txMask);
531 len += snprintf(buf + len, size - len, 531 len += scnprintf(buf + len, size - len,
532 "%20s : %10d\n", 532 "%20s : %10d\n",
533 "RX Mask", pBase->rxMask); 533 "RX Mask", pBase->rxMask);
534 len += snprintf(buf + len, size - len, 534 len += scnprintf(buf + len, size - len,
535 "%20s : %10d\n", 535 "%20s : %10d\n",
536 "Allow 5GHz", 536 "Allow 5GHz",
537 !!(pBase->opCapFlags & AR5416_OPFLAGS_11A)); 537 !!(pBase->opCapFlags & AR5416_OPFLAGS_11A));
538 len += snprintf(buf + len, size - len, 538 len += scnprintf(buf + len, size - len,
539 "%20s : %10d\n", 539 "%20s : %10d\n",
540 "Allow 2GHz", 540 "Allow 2GHz",
541 !!(pBase->opCapFlags & AR5416_OPFLAGS_11G)); 541 !!(pBase->opCapFlags & AR5416_OPFLAGS_11G));
542 len += snprintf(buf + len, size - len, 542 len += scnprintf(buf + len, size - len,
543 "%20s : %10d\n", 543 "%20s : %10d\n",
544 "Disable 2GHz HT20", 544 "Disable 2GHz HT20",
545 !!(pBase->opCapFlags & AR5416_OPFLAGS_N_2G_HT20)); 545 !!(pBase->opCapFlags & AR5416_OPFLAGS_N_2G_HT20));
546 len += snprintf(buf + len, size - len, 546 len += scnprintf(buf + len, size - len,
547 "%20s : %10d\n", 547 "%20s : %10d\n",
548 "Disable 2GHz HT40", 548 "Disable 2GHz HT40",
549 !!(pBase->opCapFlags & AR5416_OPFLAGS_N_2G_HT40)); 549 !!(pBase->opCapFlags & AR5416_OPFLAGS_N_2G_HT40));
550 len += snprintf(buf + len, size - len, 550 len += scnprintf(buf + len, size - len,
551 "%20s : %10d\n", 551 "%20s : %10d\n",
552 "Disable 5Ghz HT20", 552 "Disable 5Ghz HT20",
553 !!(pBase->opCapFlags & AR5416_OPFLAGS_N_5G_HT20)); 553 !!(pBase->opCapFlags & AR5416_OPFLAGS_N_5G_HT20));
554 len += snprintf(buf + len, size - len, 554 len += scnprintf(buf + len, size - len,
555 "%20s : %10d\n", 555 "%20s : %10d\n",
556 "Disable 5Ghz HT40", 556 "Disable 5Ghz HT40",
557 !!(pBase->opCapFlags & AR5416_OPFLAGS_N_5G_HT40)); 557 !!(pBase->opCapFlags & AR5416_OPFLAGS_N_5G_HT40));
558 len += snprintf(buf + len, size - len, 558 len += scnprintf(buf + len, size - len,
559 "%20s : %10d\n", 559 "%20s : %10d\n",
560 "Big Endian", 560 "Big Endian",
561 !!(pBase->eepMisc & 0x01)); 561 !!(pBase->eepMisc & 0x01));
562 len += snprintf(buf + len, size - len, 562 len += scnprintf(buf + len, size - len,
563 "%20s : %10d\n", 563 "%20s : %10d\n",
564 "Cal Bin Major Ver", 564 "Cal Bin Major Ver",
565 (pBase->binBuildNumber >> 24) & 0xFF); 565 (pBase->binBuildNumber >> 24) & 0xFF);
566 len += snprintf(buf + len, size - len, 566 len += scnprintf(buf + len, size - len,
567 "%20s : %10d\n", 567 "%20s : %10d\n",
568 "Cal Bin Minor Ver", 568 "Cal Bin Minor Ver",
569 (pBase->binBuildNumber >> 16) & 0xFF); 569 (pBase->binBuildNumber >> 16) & 0xFF);
570 len += snprintf(buf + len, size - len, 570 len += scnprintf(buf + len, size - len,
571 "%20s : %10d\n", 571 "%20s : %10d\n",
572 "Cal Bin Build", 572 "Cal Bin Build",
573 (pBase->binBuildNumber >> 8) & 0xFF); 573 (pBase->binBuildNumber >> 8) & 0xFF);
574 574
575 /* 575 /*
576 * UB91 specific data. 576 * UB91 specific data.
@@ -579,10 +579,10 @@ static ssize_t read_file_base_eeprom(struct file *file, char __user *user_buf,
579 struct base_eep_header_4k *pBase4k = 579 struct base_eep_header_4k *pBase4k =
580 &priv->ah->eeprom.map4k.baseEepHeader; 580 &priv->ah->eeprom.map4k.baseEepHeader;
581 581
582 len += snprintf(buf + len, size - len, 582 len += scnprintf(buf + len, size - len,
583 "%20s : %10d\n", 583 "%20s : %10d\n",
584 "TX Gain type", 584 "TX Gain type",
585 pBase4k->txGainType); 585 pBase4k->txGainType);
586 } 586 }
587 587
588 /* 588 /*
@@ -592,19 +592,19 @@ static ssize_t read_file_base_eeprom(struct file *file, char __user *user_buf,
592 struct base_eep_ar9287_header *pBase9287 = 592 struct base_eep_ar9287_header *pBase9287 =
593 &priv->ah->eeprom.map9287.baseEepHeader; 593 &priv->ah->eeprom.map9287.baseEepHeader;
594 594
595 len += snprintf(buf + len, size - len, 595 len += scnprintf(buf + len, size - len,
596 "%20s : %10ddB\n", 596 "%20s : %10ddB\n",
597 "Power Table Offset", 597 "Power Table Offset",
598 pBase9287->pwrTableOffset); 598 pBase9287->pwrTableOffset);
599 599
600 len += snprintf(buf + len, size - len, 600 len += scnprintf(buf + len, size - len,
601 "%20s : %10d\n", 601 "%20s : %10d\n",
602 "OpenLoop Power Ctrl", 602 "OpenLoop Power Ctrl",
603 pBase9287->openLoopPwrCntl); 603 pBase9287->openLoopPwrCntl);
604 } 604 }
605 605
606 len += snprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress", 606 len += scnprintf(buf + len, size - len, "%20s : %pM\n", "MacAddress",
607 pBase->macAddr); 607 pBase->macAddr);
608 if (len > size) 608 if (len > size)
609 len = size; 609 len = size;
610 610
@@ -627,8 +627,8 @@ static ssize_t read_4k_modal_eeprom(struct file *file,
627{ 627{
628#define PR_EEP(_s, _val) \ 628#define PR_EEP(_s, _val) \
629 do { \ 629 do { \
630 len += snprintf(buf + len, size - len, "%20s : %10d\n", \ 630 len += scnprintf(buf + len, size - len, "%20s : %10d\n",\
631 _s, (_val)); \ 631 _s, (_val)); \
632 } while (0) 632 } while (0)
633 633
634 struct ath9k_htc_priv *priv = file->private_data; 634 struct ath9k_htc_priv *priv = file->private_data;
@@ -708,12 +708,12 @@ static ssize_t read_def_modal_eeprom(struct file *file,
708 do { \ 708 do { \
709 if (pBase->opCapFlags & AR5416_OPFLAGS_11G) { \ 709 if (pBase->opCapFlags & AR5416_OPFLAGS_11G) { \
710 pModal = &priv->ah->eeprom.def.modalHeader[1]; \ 710 pModal = &priv->ah->eeprom.def.modalHeader[1]; \
711 len += snprintf(buf + len, size - len, "%20s : %8d%7s", \ 711 len += scnprintf(buf + len, size - len, "%20s : %8d%7s", \
712 _s, (_val), "|"); \ 712 _s, (_val), "|"); \
713 } \ 713 } \
714 if (pBase->opCapFlags & AR5416_OPFLAGS_11A) { \ 714 if (pBase->opCapFlags & AR5416_OPFLAGS_11A) { \
715 pModal = &priv->ah->eeprom.def.modalHeader[0]; \ 715 pModal = &priv->ah->eeprom.def.modalHeader[0]; \
716 len += snprintf(buf + len, size - len, "%9d\n", \ 716 len += scnprintf(buf + len, size - len, "%9d\n",\
717 (_val)); \ 717 (_val)); \
718 } \ 718 } \
719 } while (0) 719 } while (0)
@@ -729,10 +729,10 @@ static ssize_t read_def_modal_eeprom(struct file *file,
729 if (buf == NULL) 729 if (buf == NULL)
730 return -ENOMEM; 730 return -ENOMEM;
731 731
732 len += snprintf(buf + len, size - len, 732 len += scnprintf(buf + len, size - len,
733 "%31s %15s\n", "2G", "5G"); 733 "%31s %15s\n", "2G", "5G");
734 len += snprintf(buf + len, size - len, 734 len += scnprintf(buf + len, size - len,
735 "%32s %16s\n", "====", "====\n"); 735 "%32s %16s\n", "====", "====\n");
736 736
737 PR_EEP("Chain0 Ant. Control", pModal->antCtrlChain[0]); 737 PR_EEP("Chain0 Ant. Control", pModal->antCtrlChain[0]);
738 PR_EEP("Chain1 Ant. Control", pModal->antCtrlChain[1]); 738 PR_EEP("Chain1 Ant. Control", pModal->antCtrlChain[1]);
@@ -814,8 +814,8 @@ static ssize_t read_9287_modal_eeprom(struct file *file,
814{ 814{
815#define PR_EEP(_s, _val) \ 815#define PR_EEP(_s, _val) \
816 do { \ 816 do { \
817 len += snprintf(buf + len, size - len, "%20s : %10d\n", \ 817 len += scnprintf(buf + len, size - len, "%20s : %10d\n",\
818 _s, (_val)); \ 818 _s, (_val)); \
819 } while (0) 819 } while (0)
820 820
821 struct ath9k_htc_priv *priv = file->private_data; 821 struct ath9k_htc_priv *priv = file->private_data;
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 260e0c65f574..525ac984eafd 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -3252,19 +3252,19 @@ void ath9k_hw_name(struct ath_hw *ah, char *hw_name, size_t len)
3252 3252
3253 /* chipsets >= AR9280 are single-chip */ 3253 /* chipsets >= AR9280 are single-chip */
3254 if (AR_SREV_9280_20_OR_LATER(ah)) { 3254 if (AR_SREV_9280_20_OR_LATER(ah)) {
3255 used = snprintf(hw_name, len, 3255 used = scnprintf(hw_name, len,
3256 "Atheros AR%s Rev:%x", 3256 "Atheros AR%s Rev:%x",
3257 ath9k_hw_mac_bb_name(ah->hw_version.macVersion), 3257 ath9k_hw_mac_bb_name(ah->hw_version.macVersion),
3258 ah->hw_version.macRev); 3258 ah->hw_version.macRev);
3259 } 3259 }
3260 else { 3260 else {
3261 used = snprintf(hw_name, len, 3261 used = scnprintf(hw_name, len,
3262 "Atheros AR%s MAC/BB Rev:%x AR%s RF Rev:%x", 3262 "Atheros AR%s MAC/BB Rev:%x AR%s RF Rev:%x",
3263 ath9k_hw_mac_bb_name(ah->hw_version.macVersion), 3263 ath9k_hw_mac_bb_name(ah->hw_version.macVersion),
3264 ah->hw_version.macRev, 3264 ah->hw_version.macRev,
3265 ath9k_hw_rf_name((ah->hw_version.analog5GhzRev & 3265 ath9k_hw_rf_name((ah->hw_version.analog5GhzRev
3266 AR_RADIO_SREV_MAJOR)), 3266 & AR_RADIO_SREV_MAJOR)),
3267 ah->hw_version.phyRev); 3267 ah->hw_version.phyRev);
3268 } 3268 }
3269 3269
3270 hw_name[used] = '\0'; 3270 hw_name[used] = '\0';
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 88f67c39f94c..5e564c788813 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -98,8 +98,8 @@
98 98
99#define PR_EEP(_s, _val) \ 99#define PR_EEP(_s, _val) \
100 do { \ 100 do { \
101 len += snprintf(buf + len, size - len, "%20s : %10d\n", \ 101 len += scnprintf(buf + len, size - len, "%20s : %10d\n",\
102 _s, (_val)); \ 102 _s, (_val)); \
103 } while (0) 103 } while (0)
104 104
105#define SM(_v, _f) (((_v) << _f##_S) & _f) 105#define SM(_v, _f) (((_v) << _f##_S) & _f)
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index d3d7c51fa6c8..d829bb62a3fc 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -1387,31 +1387,31 @@ static ssize_t read_file_rcstat(struct file *file, char __user *user_buf,
1387 int used_mcs = 0, used_htmode = 0; 1387 int used_mcs = 0, used_htmode = 0;
1388 1388
1389 if (WLAN_RC_PHY_HT(rc->rate_table->info[i].phy)) { 1389 if (WLAN_RC_PHY_HT(rc->rate_table->info[i].phy)) {
1390 used_mcs = snprintf(mcs, 5, "%d", 1390 used_mcs = scnprintf(mcs, 5, "%d",
1391 rc->rate_table->info[i].ratecode); 1391 rc->rate_table->info[i].ratecode);
1392 1392
1393 if (WLAN_RC_PHY_40(rc->rate_table->info[i].phy)) 1393 if (WLAN_RC_PHY_40(rc->rate_table->info[i].phy))
1394 used_htmode = snprintf(htmode, 5, "HT40"); 1394 used_htmode = scnprintf(htmode, 5, "HT40");
1395 else if (WLAN_RC_PHY_20(rc->rate_table->info[i].phy)) 1395 else if (WLAN_RC_PHY_20(rc->rate_table->info[i].phy))
1396 used_htmode = snprintf(htmode, 5, "HT20"); 1396 used_htmode = scnprintf(htmode, 5, "HT20");
1397 else 1397 else
1398 used_htmode = snprintf(htmode, 5, "????"); 1398 used_htmode = scnprintf(htmode, 5, "????");
1399 } 1399 }
1400 1400
1401 mcs[used_mcs] = '\0'; 1401 mcs[used_mcs] = '\0';
1402 htmode[used_htmode] = '\0'; 1402 htmode[used_htmode] = '\0';
1403 1403
1404 len += snprintf(buf + len, max - len, 1404 len += scnprintf(buf + len, max - len,
1405 "%6s %6s %3u.%d: " 1405 "%6s %6s %3u.%d: "
1406 "%10u %10u %10u %10u\n", 1406 "%10u %10u %10u %10u\n",
1407 htmode, 1407 htmode,
1408 mcs, 1408 mcs,
1409 ratekbps / 1000, 1409 ratekbps / 1000,
1410 (ratekbps % 1000) / 100, 1410 (ratekbps % 1000) / 100,
1411 stats->success, 1411 stats->success,
1412 stats->retries, 1412 stats->retries,
1413 stats->xretries, 1413 stats->xretries,
1414 stats->per); 1414 stats->per);
1415 } 1415 }
1416 1416
1417 if (len > max) 1417 if (len > max)