Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nu11secur1ty
GitHub Repository: nu11secur1ty/Kali-Linux
Path: blob/master/ALFA-W1F1/RTL8814AU/hal/phydm/halrf/halrf_debug.h
1308 views
1
/******************************************************************************
2
*
3
* Copyright(c) 2007 - 2017 Realtek Corporation.
4
*
5
* This program is free software; you can redistribute it and/or modify it
6
* under the terms of version 2 of the GNU General Public License as
7
* published by the Free Software Foundation.
8
*
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
* more details.
13
*
14
* The full GNU General Public License is included in this distribution in the
15
* file called LICENSE.
16
*
17
* Contact Information:
18
* wlanfae <[email protected]>
19
* Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
20
* Hsinchu 300, Taiwan.
21
*
22
* Larry Finger <[email protected]>
23
*
24
*****************************************************************************/
25
26
#ifndef __HALRF_DEBUG_H__
27
#define __HALRF_DEBUG_H__
28
29
/*@============================================================*/
30
/*@include files*/
31
/*@============================================================*/
32
33
/*@============================================================*/
34
/*@Definition */
35
/*@============================================================*/
36
37
#if DBG
38
39
#if (DM_ODM_SUPPORT_TYPE == ODM_AP)
40
#define RF_DBG(dm, comp, fmt, args...) \
41
do { \
42
if ((comp) & dm->rf_table.rf_dbg_comp) { \
43
pr_debug("[RF] "); \
44
RT_PRINTK(fmt, ##args); \
45
} \
46
} while (0)
47
48
#elif (DM_ODM_SUPPORT_TYPE == ODM_WIN)
49
50
static __inline void RF_DBG(PDM_ODM_T dm, int comp, char *fmt, ...)
51
{
52
RT_STATUS rt_status;
53
va_list args;
54
char buf[PRINT_MAX_SIZE] = {0};
55
56
if ((comp & dm->rf_table.rf_dbg_comp) == 0)
57
return;
58
59
if (fmt == NULL)
60
return;
61
62
va_start(args, fmt);
63
rt_status = (RT_STATUS)RtlStringCbVPrintfA(buf, PRINT_MAX_SIZE, fmt, args);
64
va_end(args);
65
66
if (rt_status != RT_STATUS_SUCCESS) {
67
DbgPrint("Failed (%d) to print message to buffer\n", rt_status);
68
return;
69
}
70
71
DbgPrint("[RF] %s", buf);
72
}
73
74
#elif (DM_ODM_SUPPORT_TYPE == ODM_IOT)
75
76
#define RF_DBG(dm, comp, fmt, args...) \
77
do { \
78
if ((comp) & dm->rf_table.rf_dbg_comp) { \
79
RT_DEBUG(COMP_PHYDM, DBG_DMESG, "[RF] " fmt, ##args); \
80
} \
81
} while (0)
82
83
#else
84
#define RF_DBG(dm, comp, fmt, args...) \
85
do { \
86
struct dm_struct *__dm = dm; \
87
if ((comp) & __dm->rf_table.rf_dbg_comp) { \
88
RT_TRACE(((struct rtl_priv *)__dm->adapter), \
89
COMP_PHYDM, DBG_DMESG, "[RF] " fmt, ##args); \
90
} \
91
} while (0)
92
#endif
93
94
#else /*#if DBG*/
95
96
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
97
static __inline void RF_DBG(struct dm_struct *dm, int comp, char *fmt, ...)
98
{
99
}
100
#else
101
#define RF_DBG(dm, comp, fmt, args...)
102
#endif
103
104
#endif /*#if DBG*/
105
106
/*@============================================================*/
107
/*@ enumeration */
108
/*@============================================================*/
109
110
/*@============================================================*/
111
/*@ structure */
112
/*@============================================================*/
113
114
/*@============================================================*/
115
/*@ function prototype */
116
/*@============================================================*/
117
118
void halrf_cmd_parser(void *dm_void, char input[][16], u32 *_used, char *output,
119
u32 *_out_len, u32 input_num);
120
121
void halrf_init_debug_setting(void *dm_void);
122
123
#endif /*__HALRF_H__*/
124
125