summaryrefslogtreecommitdiffstats
path: root/hw/net/vmxnet_debug.h
blob: 96dae0f9161a52ae191e88bc5d17271bf59fcf5e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*
 * QEMU VMWARE VMXNET* paravirtual NICs - debugging facilities
 *
 * Copyright (c) 2012 Ravello Systems LTD (http://ravellosystems.com)
 *
 * Developed by Daynix Computing LTD (http://www.daynix.com)
 *
 * Authors:
 * Dmitry Fleytman <dmitry@daynix.com>
 * Tamir Shomer <tamirs@daynix.com>
 * Yan Vugenfirer <yan@daynix.com>
 *
 * This work is licensed under the terms of the GNU GPL, version 2 or later.
 * See the COPYING file in the top-level directory.
 *
 */

#ifndef _QEMU_VMXNET_DEBUG_H
#define _QEMU_VMXNET_DEBUG_H

#define VMXNET_DEVICE_NAME "vmxnet3"

/* #define VMXNET_DEBUG_CB */
#define VMXNET_DEBUG_WARNINGS
#define VMXNET_DEBUG_ERRORS
/* #define VMXNET_DEBUG_INTERRUPTS */
/* #define VMXNET_DEBUG_CONFIG */
/* #define VMXNET_DEBUG_RINGS */
/* #define VMXNET_DEBUG_PACKETS */
/* #define VMXNET_DEBUG_SHMEM_ACCESS */

#ifdef VMXNET_DEBUG_SHMEM_ACCESS
#define VMW_SHPRN(fmt, ...)                                                   \
    do {                                                                      \
        printf("[%s][SH][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__,       \
            ## __VA_ARGS__);                                                  \
    } while (0)
#else
#define VMW_SHPRN(fmt, ...) do {} while (0)
#endif

#ifdef VMXNET_DEBUG_CB
#define VMW_CBPRN(fmt, ...)                                                   \
    do {                                                                      \
        printf("[%s][CB][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__,       \
            ## __VA_ARGS__);                                                  \
    } while (0)
#else
#define VMW_CBPRN(fmt, ...) do {} while (0)
#endif

#ifdef VMXNET_DEBUG_PACKETS
#define VMW_PKPRN(fmt, ...)                                                   \
    do {                                                                      \
        printf("[%s][PK][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__,       \
            ## __VA_ARGS__);                                                  \
    } while (0)
#else
#define VMW_PKPRN(fmt, ...) do {} while (0)
#endif

#ifdef VMXNET_DEBUG_WARNINGS
#define VMW_WRPRN(fmt, ...)                                                   \
    do {                                                                      \
        printf("[%s][WR][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__,       \
            ## __VA_ARGS__);                                                  \
    } while (0)
#else
#define VMW_WRPRN(fmt, ...) do {} while (0)
#endif

#ifdef VMXNET_DEBUG_ERRORS
#define VMW_ERPRN(fmt, ...)                                                   \
    do {                                                                      \
        printf("[%s][ER][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__,       \
            ## __VA_ARGS__);                                                  \
    } while (0)
#else
#define VMW_ERPRN(fmt, ...) do {} while (0)
#endif

#ifdef VMXNET_DEBUG_INTERRUPTS
#define VMW_IRPRN(fmt, ...)                                                   \
    do {                                                                      \
        printf("[%s][IR][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__,       \
            ## __VA_ARGS__);                                                  \
    } while (0)
#else
#define VMW_IRPRN(fmt, ...) do {} while (0)
#endif

#ifdef VMXNET_DEBUG_CONFIG
#define VMW_CFPRN(fmt, ...)                                                   \
    do {                                                                      \
        printf("[%s][CF][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__,       \
            ## __VA_ARGS__);                                                  \
    } while (0)
#else
#define VMW_CFPRN(fmt, ...) do {} while (0)
#endif

#ifdef VMXNET_DEBUG_RINGS
#define VMW_RIPRN(fmt, ...)                                                   \
    do {                                                                      \
        printf("[%s][RI][%s]: " fmt "\n", VMXNET_DEVICE_NAME, __func__,       \
            ## __VA_ARGS__);                                                  \
    } while (0)
#else
#define VMW_RIPRN(fmt, ...) do {} while (0)
#endif

#define VMXNET_MF       "%02X:%02X:%02X:%02X:%02X:%02X"
#define VMXNET_MA(a)    (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]

#endif /* _QEMU_VMXNET3_DEBUG_H  */