2 * This file is part of wl12xx
4 * Copyright (C) 2011 Texas Instruments. All rights reserved.
5 * Copyright (C) 2008-2009 Nokia Corporation
7 * Contact: Luciano Coelho <coelho@ti.com>
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
28 #include <linux/bitops.h>
29 #include <linux/printk.h>
31 #define DRIVER_NAME "wl12xx"
32 #define DRIVER_PREFIX DRIVER_NAME ": "
39 DEBUG_MAILBOX
= BIT(3),
40 DEBUG_TESTMODE
= BIT(4),
47 DEBUG_MAC80211
= BIT(11),
51 DEBUG_FILTERS
= BIT(15),
52 DEBUG_ADHOC
= BIT(16),
54 DEBUG_MASTER
= (DEBUG_ADHOC
| DEBUG_AP
),
58 extern u32 wl12xx_debug_level
;
60 #define DEBUG_DUMP_LIMIT 1024
62 #define wl1271_error(fmt, arg...) \
63 pr_err(DRIVER_PREFIX "ERROR " fmt "\n", ##arg)
65 #define wl1271_warning(fmt, arg...) \
66 pr_warning(DRIVER_PREFIX "WARNING " fmt "\n", ##arg)
68 #define wl1271_notice(fmt, arg...) \
69 pr_info(DRIVER_PREFIX fmt "\n", ##arg)
71 #define wl1271_info(fmt, arg...) \
72 pr_info(DRIVER_PREFIX fmt "\n", ##arg)
74 #define wl1271_debug(level, fmt, arg...) \
76 if (level & wl12xx_debug_level) \
77 pr_debug(DRIVER_PREFIX fmt "\n", ##arg); \
80 /* TODO: use pr_debug_hex_dump when it becomes available */
81 #define wl1271_dump(level, prefix, buf, len) \
83 if (level & wl12xx_debug_level) \
84 print_hex_dump(KERN_DEBUG, DRIVER_PREFIX prefix, \
85 DUMP_PREFIX_OFFSET, 16, 1, \
87 min_t(size_t, len, DEBUG_DUMP_LIMIT), \
91 #define wl1271_dump_ascii(level, prefix, buf, len) \
93 if (level & wl12xx_debug_level) \
94 print_hex_dump(KERN_DEBUG, DRIVER_PREFIX prefix, \
95 DUMP_PREFIX_OFFSET, 16, 1, \
97 min_t(size_t, len, DEBUG_DUMP_LIMIT), \
101 #endif /* __DEBUG_H__ */