ath9k: Fix BTCOEX debugfs file usage
PATCH 1/1 ath9k: Fix BTCOEX debugfs file usage
From: Sujith Manoharan <[email protected]>
The debugfs file for dumping btcoex parameters unconditionally assumes a MCI-based device. This will not work for older btcoex chips. Fix this by branching out the routine into separate functions.
Signed-off-by Sujith Manoharan <[email protected]>
--- drivers/net/wireless/ath/ath9k/ath9k.h | 11 ++++++-- drivers/net/wireless/ath/ath9k/debug.c | 8 +++++- drivers/net/wireless/ath/ath9k/gpio.c | 51 +++++++++++++++++++++++----------- 3 files changed, 50 insertions(+), 20 deletions(-)
drivers/net/wireless/ath/ath9k/ath9k.h +8 -3
@@ -461,6 +461,12 @@ void ath9k_queue_reset(struct ath_softc *sc, enum ath_reset_type type);/* BTCOEX */ /**********/ +#define ATH_DUMP_BTCOEX (_s, _val) \ + do { \ + len += snprintf(buf + len, size - len, \ + "%20s : %10d\n", _s, (_val)); \ + } while (0) +enum bt_op_flags {BT_OP_PRIORITY_DETECTED ,BT_OP_SCAN ,
@@ -494,7 +500,7 @@ void ath9k_btcoex_timer_pause(struct ath_softc *sc);void ath9k_btcoex_handle_interrupt (struct ath_softc *sc,u32 status);u16 ath9k_btcoex_aggr_limit (struct ath_softc *sc,u32 max_4ms_framelen);void ath9k_btcoex_stop_gen_timer (struct ath_softc *sc); -int ath9k_dump_btcoex (struct ath_softc *sc,u8 *buf,u32 len,u32 size); +int ath9k_dump_btcoex (struct ath_softc *sc,u8 *buf,u32 size);#else static inline int ath9k_init_btcoex (struct ath_softc *sc) {
@@ -521,8 +527,7 @@ static inline u16 ath9k_btcoex_aggr_limit(struct ath_softc *sc,static inline void ath9k_btcoex_stop_gen_timer (struct ath_softc *sc) { } -static inline int ath9k_dump_btcoex (struct ath_softc *sc,u8 *buf, -u32 len,u32 size) +static inline int ath9k_dump_btcoex (struct ath_softc *sc,u8 *buf,u32 size) {return 0 ; }
drivers/net/wireless/ath/ath9k/debug.c +7 -1
@@ -1599,8 +1599,14 @@ static ssize_t read_file_btcoex(struct file *file, char __user *user_buf,if (buf ==NULL )return -ENOMEM ; - len =ath9k_dump_btcoex (sc, buf, len, size); +if (!sc->sc_ah->common.btcoex_enabled) { + len =snprintf (buf, size,"%s\n" , +"BTCOEX is disabled" ); + goto exit; + } + len =ath9k_dump_btcoex (sc, buf, size); +exit: retval =simple_read_from_buffer (user_buf, count, ppos, buf, len);kfree (buf);
drivers/net/wireless/ath/ath9k/gpio.c +35 -16
79 lines not on this page · raw message
Signature · 1 line
1.8.0