]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blame - drivers/net/wireless/zydas/zd1211rw/zd_def.h
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13
[mirror_ubuntu-focal-kernel.git] / drivers / net / wireless / zydas / zd1211rw / zd_def.h
CommitLineData
1ccea77e 1/* SPDX-License-Identifier: GPL-2.0-or-later */
66bb42fd
DD
2/* ZD1211 USB-WLAN driver for Linux
3 *
4 * Copyright (C) 2005-2007 Ulrich Kunitz <kune@deine-taler.de>
5 * Copyright (C) 2006-2007 Daniel Drake <dsd@gentoo.org>
e85d0918
DD
6 */
7
8#ifndef _ZD_DEF_H
9#define _ZD_DEF_H
10
11#include <linux/kernel.h>
12#include <linux/stringify.h>
13#include <linux/device.h>
e85d0918 14
0ce34bc8
DD
15typedef u16 __nocast zd_addr_t;
16
e85d0918
DD
17#define dev_printk_f(level, dev, fmt, args...) \
18 dev_printk(level, dev, "%s() " fmt, __func__, ##args)
19
20#ifdef DEBUG
21# define dev_dbg_f(dev, fmt, args...) \
22 dev_printk_f(KERN_DEBUG, dev, fmt, ## args)
00d3f14c
JB
23# define dev_dbg_f_limit(dev, fmt, args...) do { \
24 if (net_ratelimit()) \
25 dev_printk_f(KERN_DEBUG, dev, fmt, ## args); \
570a0a7c 26} while (0)
7a1d6564
JK
27# define dev_dbg_f_cond(dev, cond, fmt, args...) ({ \
28 bool __cond = !!(cond); \
29 if (unlikely(__cond)) \
30 dev_printk_f(KERN_DEBUG, dev, fmt, ## args); \
31})
e85d0918
DD
32#else
33# define dev_dbg_f(dev, fmt, args...) do { (void)(dev); } while (0)
570a0a7c 34# define dev_dbg_f_limit(dev, fmt, args...) do { (void)(dev); } while (0)
7a1d6564 35# define dev_dbg_f_cond(dev, cond, fmt, args...) do { (void)(dev); } while (0)
e85d0918
DD
36#endif /* DEBUG */
37
38#ifdef DEBUG
39# define ZD_ASSERT(x) \
40do { \
91f71fa5 41 if (unlikely(!(x))) { \
e85d0918
DD
42 pr_debug("%s:%d ASSERT %s VIOLATED!\n", \
43 __FILE__, __LINE__, __stringify(x)); \
741fec53 44 dump_stack(); \
e85d0918
DD
45 } \
46} while (0)
47#else
48# define ZD_ASSERT(x) do { } while (0)
49#endif
50
c48cf125
UK
51#ifdef DEBUG
52# define ZD_MEMCLEAR(pointer, size) memset((pointer), 0xff, (size))
53#else
54# define ZD_MEMCLEAR(pointer, size) do { } while (0)
55#endif
56
e85d0918 57#endif /* _ZD_DEF_H */