hc
2023-11-06 15ade055295d13f95d49e3d99b09f3bbfb4a43e7
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/******************************************************************************
 *
 * 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    __PHYDMCCX_H__
#define    __PHYDMCCX_H__
 
#define CCX_EN 1
 
#define IGI_TO_NHM_TH_MULTIPLIER    2
#define CCA_CAP    14
 
 
 
enum nhm_setting {
   SET_NHM_SETTING,
   STORE_NHM_SETTING,
   RESTORE_NHM_SETTING
};
 
enum nhm_inexclude_cca {
   NHM_EXCLUDE_CCA,
   NHM_INCLUDE_CCA
};
 
enum nhm_inexclude_txon {
   NHM_EXCLUDE_TXON,
   NHM_INCLUDE_TXON
};
 
 
struct _CCX_INFO {
 
   /*Settings*/
   u8                    nhm_th[11];
   u16                    nhm_period;                /* 4us per unit */
   u16                    clm_period;                /* 4us per unit */
   enum nhm_inexclude_txon        nhm_inexclude_txon;
   enum nhm_inexclude_cca        nhm_inexclude_cca;
 
   /*Previous Settings*/
   u8                    nhm_th_restore[11];
   u16                    nhm_period_restore;                /* 4us per unit */
   u16                    clm_period_restore;                /* 4us per unit */
   enum nhm_inexclude_txon        nhm_inexclude_txon_restore;
   enum nhm_inexclude_cca        nhm_inexclude_cca_restore;
 
   /*Report*/
   u8        nhm_result[12];
   u8        nhm_ratio;        /*1% per nuit, it means the interference igi can't overcome.*/
   u8        nhm_result_total;
   u16        nhm_duration;
   u16        clm_result;
   u8        clm_ratio;
 
   boolean        echo_clm_en;
   u8            echo_igi;    /* nhm_result comes from this igi */
 
};
 
/*NHM*/
 
void
phydm_nhm_init(
   void                    *p_dm_void
);
 
boolean
phydm_cal_nhm_cnt(
   void        *p_dm_void
);
 
void
phydm_nhm_setting(
   void        *p_dm_void,
   u8    nhm_setting
);
 
void
phydm_nhm_trigger(
   void        *p_dm_void
);
 
void
phydm_get_nhm_result(
   void        *p_dm_void
);
 
boolean
phydm_check_nhm_rdy(
   void        *p_dm_void
);
 
/*CLM*/
 
void
phydm_clm_setting(
   void            *p_dm_void
);
 
void
phydm_clm_trigger(
   void            *p_dm_void
);
 
boolean
phydm_check_clm_rdy(
   void            *p_dm_void
);
 
void
phydm_get_clm_result(
   void            *p_dm_void
);
 
void
phydm_ccx_monitor(
   void            *p_dm_void
);
 
void
phydm_ccx_monitor_trigger(
   void            *p_dm_void,
   u16                monitor_time
);
 
void
phydm_ccx_monitor_result(
   void            *p_dm_void
);
 
void
phydm_set_nhm_th_by_igi(
   void            *p_dm_void,
   u8                igi
);
 
#endif