Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 516304b0 authored by Joe Perches's avatar Joe Perches Committed by John W. Linville
Browse files

ath: Add and use pr_fmt, convert printks to pr_<level>



Use a more current logging style.
Make sure all output is prefixed appropriately.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 47107e84
Loading
Loading
Loading
Loading
+19 −25
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include "ath5k.h"
#include "reg.h"
#include "debug.h"
@@ -728,32 +730,24 @@ void
ath5k_ani_print_counters(struct ath5k_hw *ah)
{
	/* clears too */
	printk(KERN_NOTICE "ACK fail\t%d\n",
		ath5k_hw_reg_read(ah, AR5K_ACK_FAIL));
	printk(KERN_NOTICE "RTS fail\t%d\n",
		ath5k_hw_reg_read(ah, AR5K_RTS_FAIL));
	printk(KERN_NOTICE "RTS success\t%d\n",
		ath5k_hw_reg_read(ah, AR5K_RTS_OK));
	printk(KERN_NOTICE "FCS error\t%d\n",
		ath5k_hw_reg_read(ah, AR5K_FCS_FAIL));
	pr_notice("ACK fail\t%d\n", ath5k_hw_reg_read(ah, AR5K_ACK_FAIL));
	pr_notice("RTS fail\t%d\n", ath5k_hw_reg_read(ah, AR5K_RTS_FAIL));
	pr_notice("RTS success\t%d\n", ath5k_hw_reg_read(ah, AR5K_RTS_OK));
	pr_notice("FCS error\t%d\n", ath5k_hw_reg_read(ah, AR5K_FCS_FAIL));

	/* no clear */
	printk(KERN_NOTICE "tx\t%d\n",
		ath5k_hw_reg_read(ah, AR5K_PROFCNT_TX));
	printk(KERN_NOTICE "rx\t%d\n",
		ath5k_hw_reg_read(ah, AR5K_PROFCNT_RX));
	printk(KERN_NOTICE "busy\t%d\n",
		ath5k_hw_reg_read(ah, AR5K_PROFCNT_RXCLR));
	printk(KERN_NOTICE "cycles\t%d\n",
		ath5k_hw_reg_read(ah, AR5K_PROFCNT_CYCLE));

	printk(KERN_NOTICE "AR5K_PHYERR_CNT1\t%d\n",
	pr_notice("tx\t%d\n", ath5k_hw_reg_read(ah, AR5K_PROFCNT_TX));
	pr_notice("rx\t%d\n", ath5k_hw_reg_read(ah, AR5K_PROFCNT_RX));
	pr_notice("busy\t%d\n", ath5k_hw_reg_read(ah, AR5K_PROFCNT_RXCLR));
	pr_notice("cycles\t%d\n", ath5k_hw_reg_read(ah, AR5K_PROFCNT_CYCLE));

	pr_notice("AR5K_PHYERR_CNT1\t%d\n",
		  ath5k_hw_reg_read(ah, AR5K_PHYERR_CNT1));
	printk(KERN_NOTICE "AR5K_PHYERR_CNT2\t%d\n",
	pr_notice("AR5K_PHYERR_CNT2\t%d\n",
		  ath5k_hw_reg_read(ah, AR5K_PHYERR_CNT2));
	printk(KERN_NOTICE "AR5K_OFDM_FIL_CNT\t%d\n",
	pr_notice("AR5K_OFDM_FIL_CNT\t%d\n",
		  ath5k_hw_reg_read(ah, AR5K_OFDM_FIL_CNT));
	printk(KERN_NOTICE "AR5K_CCK_FIL_CNT\t%d\n",
	pr_notice("AR5K_CCK_FIL_CNT\t%d\n",
		  ath5k_hw_reg_read(ah, AR5K_CCK_FIL_CNT));
}

+17 −15
Original line number Diff line number Diff line
@@ -77,14 +77,16 @@
\****************************/

#define ATH5K_PRINTF(fmt, ...)						\
	printk(KERN_WARNING "%s: " fmt, __func__, ##__VA_ARGS__)
	pr_warn("%s: " fmt, __func__, ##__VA_ARGS__)

#define ATH5K_PRINTK(_sc, _level, _fmt, ...)				\
	printk(_level "ath5k %s: " _fmt, \
	printk(_level pr_fmt("%s%s" _fmt),				\
	       ((_sc) && (_sc)->hw) ? wiphy_name((_sc)->hw->wiphy) : "", \
	       ((_sc) && (_sc)->hw) ? ": " : "",			\
	       ##__VA_ARGS__)

#define ATH5K_PRINTK_LIMIT(_sc, _level, _fmt, ...) do { \
#define ATH5K_PRINTK_LIMIT(_sc, _level, _fmt, ...)			\
do {									\
	if (net_ratelimit())						\
		ATH5K_PRINTK(_sc, _level, _fmt, ##__VA_ARGS__); 	\
} while (0)
+2 −0
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@
* Attach/Detach Functions and helpers *
\*************************************/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/pci.h>
#include <linux/slab.h>
#include "ath5k.h"
+2 −0
Original line number Diff line number Diff line
@@ -40,6 +40,8 @@
 *
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/delay.h>
#include <linux/dma-mapping.h>
+10 −7
Original line number Diff line number Diff line
@@ -57,6 +57,9 @@
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 * THE POSSIBILITY OF SUCH DAMAGES.
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/export.h>
#include <linux/moduleparam.h>

@@ -254,10 +257,10 @@ static ssize_t write_file_beacon(struct file *file,

	if (strncmp(buf, "disable", 7) == 0) {
		AR5K_REG_DISABLE_BITS(ah, AR5K_BEACON, AR5K_BEACON_ENABLE);
		printk(KERN_INFO "debugfs disable beacons\n");
		pr_info("debugfs disable beacons\n");
	} else if (strncmp(buf, "enable", 6) == 0) {
		AR5K_REG_ENABLE_BITS(ah, AR5K_BEACON, AR5K_BEACON_ENABLE);
		printk(KERN_INFO "debugfs enable beacons\n");
		pr_info("debugfs enable beacons\n");
	}
	return count;
}
@@ -457,19 +460,19 @@ static ssize_t write_file_antenna(struct file *file,

	if (strncmp(buf, "diversity", 9) == 0) {
		ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_DEFAULT);
		printk(KERN_INFO "ath5k debug: enable diversity\n");
		pr_info("debug: enable diversity\n");
	} else if (strncmp(buf, "fixed-a", 7) == 0) {
		ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_FIXED_A);
		printk(KERN_INFO "ath5k debugfs: fixed antenna A\n");
		pr_info("debug: fixed antenna A\n");
	} else if (strncmp(buf, "fixed-b", 7) == 0) {
		ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_FIXED_B);
		printk(KERN_INFO "ath5k debug: fixed antenna B\n");
		pr_info("debug: fixed antenna B\n");
	} else if (strncmp(buf, "clear", 5) == 0) {
		for (i = 0; i < ARRAY_SIZE(ah->stats.antenna_rx); i++) {
			ah->stats.antenna_rx[i] = 0;
			ah->stats.antenna_tx[i] = 0;
		}
		printk(KERN_INFO "ath5k debug: cleared antenna stats\n");
		pr_info("debug: cleared antenna stats\n");
	}
	return count;
}
@@ -639,7 +642,7 @@ static ssize_t write_file_frameerrors(struct file *file,
		st->txerr_fifo = 0;
		st->txerr_filt = 0;
		st->tx_all_count = 0;
		printk(KERN_INFO "ath5k debug: cleared frameerrors stats\n");
		pr_info("debug: cleared frameerrors stats\n");
	}
	return count;
}
Loading