hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
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
/******************************************************************************
 *
 * Copyright(c) 2007 - 2020  Realtek Corporation.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of version 2 of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * The full GNU General Public License is included in this distribution in the
 * file called LICENSE.
 *
 * Contact Information:
 * wlanfae <wlanfae@realtek.com>
 * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
 * Hsinchu 300, Taiwan.
 *
 * Larry Finger <Larry.Finger@lwfinger.net>
 *
 *****************************************************************************/
#ifndef __HALRF_DBG_H__
#define __HALRF_DBG_H__
 
/*@--------------------------[Define] ---------------------------------------*/
#define HALRF_WATCHDOG_PERIOD    2 /*second*/
 
 
 
#define RFDBG_TRACE_EN
#ifdef RFDBG_TRACE_EN
   #define RF_DBG(rf, comp, fmt, ...)     \
       do {\
           if(rf->dbg_component & comp)\
               _os_dbgdump("[RF]" fmt, ##__VA_ARGS__);\
       } while (0)
       
   #define RF_TRACE(fmt, ...)     \
       do {\
           _os_dbgdump("[RF]" fmt, ##__VA_ARGS__);\
       } while (0)
       
   #define RF_WARNING(fmt, ...)     \
       do {\
           _os_dbgdump("[WARNING][RF]" fmt, ##__VA_ARGS__);\
       } while (0)
 
   #define RF_DBG_VAST(max_buff_len, used_len, buff_addr, remain_len, fmt, ...)\
       do {\
           _os_dbgdump(fmt, ##__VA_ARGS__);\
       } while (0)
 
   #define    RF_DBG_CNSL(max_buff_len, used_len, buff_addr, remain_len, fmt, ...)\
       do {                                    \
           u32 *used_len_tmp = &(used_len);                \
           if (*used_len_tmp < max_buff_len)                \
               *used_len_tmp += _os_snprintf(buff_addr, remain_len, fmt, ##__VA_ARGS__);\
       } while (0)
#else
   #define RF_DBG
   #define RF_TRACE
   #define RF_WARNING
   #define RF_DBG_CNSL        /*Print on Consol,CLI */
   #define RF_DBG_VAST        /*Print to Comport, Debug View*/
#endif    
 
 
/*@--------------------------[Enum]------------------------------------------*/
 
/*@--------------------------[Structure]-------------------------------------*/
 
/*@--------------------------[Prptotype]-------------------------------------*/
struct rf_info;
void halrf_dbg_setting_init(struct rf_info *rf);
void halrf_iqk_log(struct rf_info *rf);
void halrf_lck_log(struct rf_info *rf);
void halrf_dump_rfk_reg(struct rf_info *rf, char input[][16], u32 *_used, char *output, u32 *_out_len);
void halrf_support_ability(struct rf_info *rf, char input[][16], u32 *_used, char *output, u32 *_out_len);
void halrf_dbg_trace(struct rf_info *rf, char input[][16], u32 *_used, char *output, u32 *_out_len);
void halrf_dpk_dbg_cmd(struct rf_info *rf, char input[][16], u32 *_used, char *output, u32 *_out_len);
void halrf_dpk_track_dbg_cmd(struct rf_info *rf, char input[][16], u32 *_used, char *output, u32 *_out_len);
void halrf_rx_dck_dbg_cmd(struct rf_info *rf, char input[][16], u32 *_used, char *output, u32 *_out_len);
void halrf_dack_dbg_cmd(struct rf_info *rf, char input[][16], u32 *_used, char *output, u32 *_out_len);
void halrf_tssi_dbg_cmd(struct rf_info *rf, char input[][16], u32 *_used, char *output, u32 *_out_len);
void halrf_iqk_dbg_cmd(struct rf_info *rf, char input[][16], u32 *_used,
              char *output, u32 *_out_len);
void halrf_iqk_bypass_cmd(struct rf_info *rf, char input[][16], u32 *_used,
            char *output, u32 *_out_len);
void halrf_iqk_klog_cmd(struct rf_info *rf, char input[][16], u32 *_used,
            char *output, u32 *_out_len);
void halrf_pwr_table_dbg_cmd(struct rf_info *rf, char input[][16], u32 *_used, char *output, u32 *_out_len);
void halrf_rfk_check_reg_cmd(struct rf_info *rf, char input[][16], u32 *_used, char *output, u32 *_out_len);
void halrf_test_cmd(struct rf_info *rf, char input[][16], u32 *_used,  char *output, u32 *_out_len);
void halrf_scanf(char *in, enum rf_scanf_type type, u32 *out);
void halrf_txgapk_dbg_cmd(struct rf_info *rf, char input[][16], u32 *_used, char *output, u32 *_out_len);
void halrf_dump_rf_reg_cmd(struct rf_info *rf, char input[][16], u32 *_used, char *output, u32 *_out_len);
void halrf_hwtx_dbg_cmd(struct rf_info *rf, char input[][16], u32 *_used, char *output, u32 *_out_len);
void halrf_kfree_dbg_cmd(struct rf_info *rf, char input[][16], u32 *_used, char *output, u32 *_out_len);
void halrf_chl_rfk_dbg_cmd(struct rf_info *rf, char input[][16], u32 *_used, char *output, u32 *_out_len);
void halrf_op5k_dbg_cmd(struct rf_info *rf, char input[][16], u32 *_used, char *output, u32 *_out_len);
void halrf_rfk_dbg_cmd(struct rf_info *rf, char input[][16], u32 *_used, char *output, u32 *_out_len);
void halrf_psd_cmd(struct rf_info *rf, char input[][16], u32 *_used, char *output, u32 *_out_len);
void halrf_dz_dbg_cmd(struct rf_info *rf, char input[][16], u32 *_used, char *output, u32 *_out_len);
 
#endif