From: Rajkumar Manoharan Date: Tue, 6 Sep 2011 15:30:06 +0000 (+0530) Subject: ath9k: Take the samples in unassociated state X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f7e014dac29b1abe5c8fa8d721d43928633340ab;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git ath9k: Take the samples in unassociated state Currently the samples debugfs which maintains the snapshorts of mac/bb only on associated state. Hence to cover issues on idle state, the samples are taken whenever the driver is ready. Signed-off-by: Rajkumar Manoharan Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index 19ef559ac78..55603276269 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c @@ -1373,6 +1373,9 @@ static int open_file_bb_mac_samps(struct inode *inode, struct file *file) u8 chainmask = (ah->rxchainmask << 3) | ah->rxchainmask; u8 nread; + if (sc->sc_flags & SC_OP_INVALID) + return -EAGAIN; + buf = vmalloc(size); if (!buf) return -ENOMEM; @@ -1381,6 +1384,8 @@ static int open_file_bb_mac_samps(struct inode *inode, struct file *file) vfree(buf); return -ENOMEM; } + /* Account the current state too */ + ath9k_debug_samp_bb_mac(sc); spin_lock_bh(&sc->debug.samp_lock); memcpy(bb_mac_samp, sc->debug.bb_mac_samp,