1 /******************************************************************************
3 Copyright (c) 2013-2018, Intel Corporation
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
9 1. Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
16 3. Neither the name of the Intel Corporation nor the names of its
17 contributors may be used to endorse or promote products derived from
18 this software without specific prior written permission.
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
32 ******************************************************************************/
37 #define MAC_FORMAT "%02x:%02x:%02x:%02x:%02x:%02x"
38 #define MAC_FORMAT_ARGS(mac_addr) \
39 (mac_addr)[0], (mac_addr)[1], (mac_addr)[2], (mac_addr)[3], \
40 (mac_addr)[4], (mac_addr)[5]
41 #define ON_OFF_STR(is_set) ((is_set) ? "On" : "Off")
45 #define _DBG_PRINTF(S, ...) printf("%s: " S "\n", __func__, ##__VA_ARGS__)
46 #define _DEV_DBG_PRINTF(dev, S, ...) device_printf(dev, "%s: " S "\n", __func__, ##__VA_ARGS__)
47 #define _IF_DBG_PRINTF(ifp, S, ...) if_printf(ifp, "%s: " S "\n", __func__, ##__VA_ARGS__)
49 /* Defines for printing generic debug information */
50 #define DPRINTF(...) _DBG_PRINTF(__VA_ARGS__)
51 #define DDPRINTF(...) _DEV_DBG_PRINTF(__VA_ARGS__)
52 #define IDPRINTF(...) _IF_DBG_PRINTF(__VA_ARGS__)
54 /* Defines for printing specific debug information */
59 #define INIT_DEBUGOUT(...) if (DEBUG_INIT) _DBG_PRINTF(__VA_ARGS__)
60 #define INIT_DBG_DEV(...) if (DEBUG_INIT) _DEV_DBG_PRINTF(__VA_ARGS__)
61 #define INIT_DBG_IF(...) if (DEBUG_INIT) _IF_DBG_PRINTF(__VA_ARGS__)
63 #define IOCTL_DEBUGOUT(...) if (DEBUG_IOCTL) _DBG_PRINTF(__VA_ARGS__)
64 #define IOCTL_DBG_IF2(ifp, S, ...) if (DEBUG_IOCTL) \
65 if_printf(ifp, S "\n", ##__VA_ARGS__)
66 #define IOCTL_DBG_IF(...) if (DEBUG_IOCTL) _IF_DBG_PRINTF(__VA_ARGS__)
68 #define HW_DEBUGOUT(...) if (DEBUG_HW) _DBG_PRINTF(__VA_ARGS__)
70 #else /* no IXL_DEBUG */
79 #define INIT_DEBUGOUT(...)
80 #define INIT_DBG_DEV(...)
81 #define INIT_DBG_IF(...)
82 #define IOCTL_DEBUGOUT(...)
83 #define IOCTL_DBG_IF2(...)
84 #define IOCTL_DBG_IF(...)
85 #define HW_DEBUGOUT(...)
86 #endif /* IXL_DEBUG */
89 IXL_DBG_INFO
= 0x00000001,
90 IXL_DBG_EN_DIS
= 0x00000002,
91 IXL_DBG_AQ
= 0x00000004,
92 IXL_DBG_NVMUPD
= 0x00000008,
93 IXL_DBG_FILTER
= 0x00000010,
95 IXL_DEBUG_RSS
= 0x00000100,
97 IXL_DBG_IOV
= 0x00001000,
98 IXL_DBG_IOV_VC
= 0x00002000,
100 IXL_DBG_SWITCH_INFO
= 0x00010000,
101 IXL_DBG_I2C
= 0x00020000,
103 IXL_DBG_LINK
= 0x00100000,
105 IXL_DBG_ALL
= 0xFFFFFFFF
109 IAVF_DBG_INFO
= 0x00000001,
110 IAVF_DBG_EN_DIS
= 0x00000002,
111 IAVF_DBG_AQ
= 0x00000004,
112 IAVF_DBG_INIT
= 0x00000008,
113 IAVF_DBG_FILTER
= 0x00000010,
115 IAVF_DEBUG_RSS
= 0x00000100,
117 IAVF_DBG_VC
= 0x00001000,
119 IAVF_DBG_SWITCH_INFO
= 0x00010000,
121 IAVF_DBG_ALL
= 0xFFFFFFFF
124 #endif /* _IXL_DEBUG_H_ */