hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
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
/******************************************************************************
 *
 * Copyright(c) 2007 - 2017 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.
 *
 *****************************************************************************/
 
 
#ifndef    __PHYDM_AUTO_DBG_H__
#define    __PHYDM_AUTO_DBG_H__
 
#define AUTO_DBG_VERSION    "1.0"        /* 2017.05.015  Dino, Add phydm_auto_dbg.h*/
 
 
/* 1 ============================================================
 * 1  Definition
 * 1 ============================================================ */
 
#define    AUTO_CHK_HANG_STEP_MAX    3
#define    DBGPORT_CHK_NUM            6
 
#ifdef PHYDM_AUTO_DEGBUG
 
 
/* 1 ============================================================
 * 1  enumeration
 * 1 ============================================================ */
 
enum auto_dbg_type_e{
   AUTO_DBG_STOP         = 0,
   AUTO_DBG_CHECK_HANG     = 1,
   AUTO_DBG_CHECK_RA    = 2,
   AUTO_DBG_CHECK_DIG    = 3    
};
 
/* 1 ============================================================
 * 1  structure
 * 1 ============================================================ */
 
struct n_dbgport_803 {
   /*BYTE 3*/
   u8 bb_rst_b: 1;
   u8 glb_rst_b: 1;
   u8 zero_1bit_1:1;
   u8 ofdm_rst_b: 1;
   u8 cck_txpe: 1;
   u8 ofdm_txpe: 1;
   u8 phy_tx_on: 1;
   u8 tdrdy: 1;
   /*BYTE 2*/
   u8 txd:8;
   /*BYTE 1*/
   u8 cck_cca_pp: 1; 
   u8 ofdm_cca_pp: 1;
   u8 rx_rst: 1;
   u8 rdrdy: 1;
   u8 rxd_7_4: 4;
   /*BYTE 0*/
   u8 rxd_3_0: 4;
   u8 ofdm_tx_en: 1; 
   u8 cck_tx_en: 1;
   u8 zero_1bit_2:1;
   u8 clk_80m: 1;
};
 
struct phydm_auto_dbg_struc {
 
   enum    auto_dbg_type_e    auto_dbg_type;
   u8        dbg_step;
   u16        dbg_port_table[DBGPORT_CHK_NUM];
   u32        dbg_port_val[DBGPORT_CHK_NUM];
   u16        ofdm_t_cnt;
   u16        ofdm_r_cnt;
   u16        cck_t_cnt;
   u16        cck_r_cnt;
   u16        ofdm_crc_error_cnt;
   u16        cck_crc_error_cnt;
 
};
 
 
/* 1 ============================================================
 * 1  function prototype
 * 1 ============================================================ */
 
 
void
phydm_auto_dbg_console(
   void        *p_dm_void,
   char        input[][16],
   u32        *_used,
   char        *output,
   u32        *_out_len,
   u32        input_num
);
#endif
 
void
phydm_auto_dbg_engine(
   void            *p_dm_void
);
 
void
phydm_auto_dbg_engine_init(
   void        *p_dm_void
);
#endif