aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath9k/Kconfig8
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.c10
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.h20
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c4
4 files changed, 36 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ath9k/Kconfig b/drivers/net/wireless/ath/ath9k/Kconfig
index 595a272aa96..e507e78398f 100644
--- a/drivers/net/wireless/ath/ath9k/Kconfig
+++ b/drivers/net/wireless/ath/ath9k/Kconfig
@@ -81,6 +81,14 @@ config ATH9K_DFS_CERTIFIED
81 developed. At this point enabling this option won't do anything 81 developed. At this point enabling this option won't do anything
82 except increase code size. 82 except increase code size.
83 83
84config ATH9K_MAC_DEBUG
85 bool "Atheros MAC statistics"
86 depends on ATH9K_DEBUGFS
87 default y
88 ---help---
89 This option enables collection of statistics for Rx/Tx status
90 data and some other MAC related statistics
91
84config ATH9K_RATE_CONTROL 92config ATH9K_RATE_CONTROL
85 bool "Atheros ath9k rate control" 93 bool "Atheros ath9k rate control"
86 depends on ATH9K 94 depends on ATH9K
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 228c18189a3..03a474092e8 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -818,6 +818,7 @@ void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf,
818 if (ts->ts_flags & ATH9K_TX_DELIM_UNDERRUN) 818 if (ts->ts_flags & ATH9K_TX_DELIM_UNDERRUN)
819 TX_STAT_INC(qnum, delim_underrun); 819 TX_STAT_INC(qnum, delim_underrun);
820 820
821#ifdef CONFIG_ATH9K_MAC_DEBUG
821 spin_lock(&sc->debug.samp_lock); 822 spin_lock(&sc->debug.samp_lock);
822 TX_SAMP_DBG(jiffies) = jiffies; 823 TX_SAMP_DBG(jiffies) = jiffies;
823 TX_SAMP_DBG(rssi_ctl0) = ts->ts_rssi_ctl0; 824 TX_SAMP_DBG(rssi_ctl0) = ts->ts_rssi_ctl0;
@@ -844,6 +845,7 @@ void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf,
844 845
845 sc->debug.tsidx = (sc->debug.tsidx + 1) % ATH_DBG_MAX_SAMPLES; 846 sc->debug.tsidx = (sc->debug.tsidx + 1) % ATH_DBG_MAX_SAMPLES;
846 spin_unlock(&sc->debug.samp_lock); 847 spin_unlock(&sc->debug.samp_lock);
848#endif
847 849
848#undef TX_SAMP_DBG 850#undef TX_SAMP_DBG
849} 851}
@@ -1019,6 +1021,7 @@ void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs)
1019 1021
1020 sc->debug.stats.rxstats.rs_antenna = rs->rs_antenna; 1022 sc->debug.stats.rxstats.rs_antenna = rs->rs_antenna;
1021 1023
1024#ifdef CONFIG_ATH9K_MAC_DEBUG
1022 spin_lock(&sc->debug.samp_lock); 1025 spin_lock(&sc->debug.samp_lock);
1023 RX_SAMP_DBG(jiffies) = jiffies; 1026 RX_SAMP_DBG(jiffies) = jiffies;
1024 RX_SAMP_DBG(rssi_ctl0) = rs->rs_rssi_ctl0; 1027 RX_SAMP_DBG(rssi_ctl0) = rs->rs_rssi_ctl0;
@@ -1035,6 +1038,8 @@ void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs)
1035 sc->debug.rsidx = (sc->debug.rsidx + 1) % ATH_DBG_MAX_SAMPLES; 1038 sc->debug.rsidx = (sc->debug.rsidx + 1) % ATH_DBG_MAX_SAMPLES;
1036 spin_unlock(&sc->debug.samp_lock); 1039 spin_unlock(&sc->debug.samp_lock);
1037 1040
1041#endif
1042
1038#undef RX_STAT_INC 1043#undef RX_STAT_INC
1039#undef RX_PHY_ERR_INC 1044#undef RX_PHY_ERR_INC
1040#undef RX_SAMP_DBG 1045#undef RX_SAMP_DBG
@@ -1278,6 +1283,8 @@ static const struct file_operations fops_modal_eeprom = {
1278 .llseek = default_llseek, 1283 .llseek = default_llseek,
1279}; 1284};
1280 1285
1286#ifdef CONFIG_ATH9K_MAC_DEBUG
1287
1281void ath9k_debug_samp_bb_mac(struct ath_softc *sc) 1288void ath9k_debug_samp_bb_mac(struct ath_softc *sc)
1282{ 1289{
1283#define ATH_SAMP_DBG(c) (sc->debug.bb_mac_samp[sc->debug.sampidx].c) 1290#define ATH_SAMP_DBG(c) (sc->debug.bb_mac_samp[sc->debug.sampidx].c)
@@ -1551,6 +1558,7 @@ static const struct file_operations fops_samps = {
1551 .llseek = default_llseek, 1558 .llseek = default_llseek,
1552}; 1559};
1553 1560
1561#endif
1554 1562
1555int ath9k_init_debug(struct ath_hw *ah) 1563int ath9k_init_debug(struct ath_hw *ah)
1556{ 1564{
@@ -1604,8 +1612,10 @@ int ath9k_init_debug(struct ath_hw *ah)
1604 &fops_base_eeprom); 1612 &fops_base_eeprom);
1605 debugfs_create_file("modal_eeprom", S_IRUSR, sc->debug.debugfs_phy, sc, 1613 debugfs_create_file("modal_eeprom", S_IRUSR, sc->debug.debugfs_phy, sc,
1606 &fops_modal_eeprom); 1614 &fops_modal_eeprom);
1615#ifdef CONFIG_ATH9K_MAC_DEBUG
1607 debugfs_create_file("samples", S_IRUSR, sc->debug.debugfs_phy, sc, 1616 debugfs_create_file("samples", S_IRUSR, sc->debug.debugfs_phy, sc,
1608 &fops_samps); 1617 &fops_samps);
1618#endif
1609 1619
1610 debugfs_create_u32("gpio_mask", S_IRUSR | S_IWUSR, 1620 debugfs_create_u32("gpio_mask", S_IRUSR | S_IWUSR,
1611 sc->debug.debugfs_phy, &sc->sc_ah->gpio_mask); 1621 sc->debug.debugfs_phy, &sc->sc_ah->gpio_mask);
diff --git a/drivers/net/wireless/ath/ath9k/debug.h b/drivers/net/wireless/ath/ath9k/debug.h
index 776a24ada60..7a519582232 100644
--- a/drivers/net/wireless/ath/ath9k/debug.h
+++ b/drivers/net/wireless/ath/ath9k/debug.h
@@ -235,16 +235,17 @@ struct ath9k_debug {
235 struct dentry *debugfs_phy; 235 struct dentry *debugfs_phy;
236 u32 regidx; 236 u32 regidx;
237 struct ath_stats stats; 237 struct ath_stats stats;
238#ifdef CONFIG_ATH9K_MAC_DEBUG
238 spinlock_t samp_lock; 239 spinlock_t samp_lock;
239 struct ath_dbg_bb_mac_samp bb_mac_samp[ATH_DBG_MAX_SAMPLES]; 240 struct ath_dbg_bb_mac_samp bb_mac_samp[ATH_DBG_MAX_SAMPLES];
240 u8 sampidx; 241 u8 sampidx;
241 u8 tsidx; 242 u8 tsidx;
242 u8 rsidx; 243 u8 rsidx;
244#endif
243}; 245};
244 246
245int ath9k_init_debug(struct ath_hw *ah); 247int ath9k_init_debug(struct ath_hw *ah);
246 248
247void ath9k_debug_samp_bb_mac(struct ath_softc *sc);
248void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status); 249void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status);
249void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf, 250void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf,
250 struct ath_tx_status *ts, struct ath_txq *txq, 251 struct ath_tx_status *ts, struct ath_txq *txq,
@@ -258,10 +259,6 @@ static inline int ath9k_init_debug(struct ath_hw *ah)
258 return 0; 259 return 0;
259} 260}
260 261
261static inline void ath9k_debug_samp_bb_mac(struct ath_softc *sc)
262{
263}
264
265static inline void ath_debug_stat_interrupt(struct ath_softc *sc, 262static inline void ath_debug_stat_interrupt(struct ath_softc *sc,
266 enum ath9k_int status) 263 enum ath9k_int status)
267{ 264{
@@ -282,4 +279,17 @@ static inline void ath_debug_stat_rx(struct ath_softc *sc,
282 279
283#endif /* CONFIG_ATH9K_DEBUGFS */ 280#endif /* CONFIG_ATH9K_DEBUGFS */
284 281
282#ifdef CONFIG_ATH9K_MAC_DEBUG
283
284void ath9k_debug_samp_bb_mac(struct ath_softc *sc);
285
286#else
287
288static inline void ath9k_debug_samp_bb_mac(struct ath_softc *sc)
289{
290}
291
292#endif
293
294
285#endif /* DEBUG_H */ 295#endif /* DEBUG_H */
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index d8b05961f7e..944e9b518f1 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -555,9 +555,11 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
555 mutex_init(&sc->mutex); 555 mutex_init(&sc->mutex);
556#ifdef CONFIG_ATH9K_DEBUGFS 556#ifdef CONFIG_ATH9K_DEBUGFS
557 spin_lock_init(&sc->nodes_lock); 557 spin_lock_init(&sc->nodes_lock);
558 spin_lock_init(&sc->debug.samp_lock);
559 INIT_LIST_HEAD(&sc->nodes); 558 INIT_LIST_HEAD(&sc->nodes);
560#endif 559#endif
560#ifdef CONFIG_ATH9K_MAC_DEBUG
561 spin_lock_init(&sc->debug.samp_lock);
562#endif
561 tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc); 563 tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc);
562 tasklet_init(&sc->bcon_tasklet, ath_beacon_tasklet, 564 tasklet_init(&sc->bcon_tasklet, ath_beacon_tasklet,
563 (unsigned long)sc); 565 (unsigned long)sc);