Merge remote-tracking branch 'remotes/kraxel/tags/usb-20190220-pull-request' into...
[qemu/ar7.git] / hw / net / vmxnet_debug.h
blobcb50aa95dbeb5683d8420b59907afc212db7c89f
1 /*
2 * QEMU VMWARE VMXNET* paravirtual NICs - debugging facilities
4 * Copyright (c) 2012 Ravello Systems LTD (http://ravellosystems.com)
6 * Developed by Daynix Computing LTD (http://www.daynix.com)
8 * Authors:
9 * Dmitry Fleytman <dmitry@daynix.com>
10 * Tamir Shomer <tamirs@daynix.com>
11 * Yan Vugenfirer <yan@daynix.com>
13 * This work is licensed under the terms of the GNU GPL, version 2 or later.
14 * See the COPYING file in the top-level directory.
18 #ifndef QEMU_VMXNET_DEBUG_H
19 #define QEMU_VMXNET_DEBUG_H
21 #define VMXNET_DEVICE_NAME "vmxnet3"
23 #define VMXNET_DEBUG_WARNINGS
24 #define VMXNET_DEBUG_ERRORS
26 #undef VMXNET_DEBUG_CB
27 #undef VMXNET_DEBUG_INTERRUPTS
28 #undef VMXNET_DEBUG_CONFIG
29 #undef VMXNET_DEBUG_RINGS
30 #undef VMXNET_DEBUG_PACKETS
31 #undef VMXNET_DEBUG_SHMEM_ACCESS
33 #ifdef VMXNET_DEBUG_CB
34 # define VMXNET_DEBUG_CB_ENABLED 1
35 #else
36 # define VMXNET_DEBUG_CB_ENABLED 0
37 #endif
39 #ifdef VMXNET_DEBUG_WARNINGS
40 # define VMXNET_DEBUG_WARNINGS_ENABLED 1
41 #else
42 # define VMXNET_DEBUG_WARNINGS_ENABLED 0
43 #endif
45 #ifdef VMXNET_DEBUG_ERRORS
46 # define VMXNET_DEBUG_ERRORS_ENABLED 1
47 #else
48 # define VMXNET_DEBUG_ERRORS_ENABLED 0
49 #endif
51 #ifdef VMXNET_DEBUG_CONFIG
52 # define VMXNET_DEBUG_CONFIG_ENABLED 1
53 #else
54 # define VMXNET_DEBUG_CONFIG_ENABLED 0
55 #endif
57 #ifdef VMXNET_DEBUG_RINGS
58 # define VMXNET_DEBUG_RINGS_ENABLED 1
59 #else
60 # define VMXNET_DEBUG_RINGS_ENABLED 0
61 #endif
63 #ifdef VMXNET_DEBUG_PACKETS
64 # define VMXNET_DEBUG_PACKETS_ENABLED 1
65 #else
66 # define VMXNET_DEBUG_PACKETS_ENABLED 0
67 #endif
69 #ifdef VMXNET_DEBUG_INTERRUPTS
70 # define VMXNET_DEBUG_INTERRUPTS_ENABLED 1
71 #else
72 # define VMXNET_DEBUG_INTERRUPTS_ENABLED 0
73 #endif
75 #ifdef VMXNET_DEBUG_SHMEM_ACCESS
76 # define VMXNET_DEBUG_SHMEM_ACCESS_ENABLED 1
77 #else
78 # define VMXNET_DEBUG_SHMEM_ACCESS_ENABLED 0
79 #endif
81 #define VMW_SHPRN(fmt, ...) \
82 do { \
83 if (VMXNET_DEBUG_SHMEM_ACCESS_ENABLED) { \
84 printf("[%s][SH][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
85 ## __VA_ARGS__); \
86 } \
87 } while (0)
89 #define VMW_CBPRN(fmt, ...) \
90 do { \
91 if (VMXNET_DEBUG_CB_ENABLED) { \
92 printf("[%s][CB][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
93 ## __VA_ARGS__); \
94 } \
95 } while (0)
97 #define VMW_PKPRN(fmt, ...) \
98 do { \
99 if (VMXNET_DEBUG_PACKETS_ENABLED) { \
100 printf("[%s][PK][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
101 ## __VA_ARGS__); \
103 } while (0)
105 #define VMW_WRPRN(fmt, ...) \
106 do { \
107 if (VMXNET_DEBUG_WARNINGS_ENABLED) { \
108 printf("[%s][WR][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
109 ## __VA_ARGS__); \
111 } while (0)
113 #define VMW_ERPRN(fmt, ...) \
114 do { \
115 if (VMXNET_DEBUG_ERRORS_ENABLED) { \
116 printf("[%s][ER][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
117 ## __VA_ARGS__); \
119 } while (0)
121 #define VMW_IRPRN(fmt, ...) \
122 do { \
123 if (VMXNET_DEBUG_INTERRUPTS_ENABLED) { \
124 printf("[%s][IR][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
125 ## __VA_ARGS__); \
127 } while (0)
129 #define VMW_CFPRN(fmt, ...) \
130 do { \
131 if (VMXNET_DEBUG_CONFIG_ENABLED) { \
132 printf("[%s][CF][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
133 ## __VA_ARGS__); \
135 } while (0)
137 #define VMW_RIPRN(fmt, ...) \
138 do { \
139 if (VMXNET_DEBUG_RINGS_ENABLED) { \
140 printf("[%s][RI][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__, \
141 ## __VA_ARGS__); \
143 } while (0)
145 #endif /* QEMU_VMXNET_DEBUG_H */