Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nu11secur1ty
GitHub Repository: nu11secur1ty/Kali-Linux
Path: blob/master/ALFA-W1F1/RTL8814AU/hal/phydm/phydm_cck_pd.h
1307 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 __PHYDM_CCK_PD_H__
27
#define __PHYDM_CCK_PD_H__
28
29
#define CCK_PD_VERSION "3.3" /* @ modify invalid type4 API*/
30
31
/*@
32
* 1 ============================================================
33
* 1 Definition
34
* 1 ============================================================
35
*/
36
#define CCK_FA_MA_RESET 0xffffffff
37
38
#define INVALID_CS_RATIO_0 27 /* @ only for type4 ICs*/
39
#define INVALID_CS_RATIO_1 29 /* @ only for type4 ICs*/
40
#define MAXVALID_CS_RATIO 31
41
#define MAXVALID_PD_THRES 255
42
/*@Run time flag of CCK_PD HW type*/
43
#define CCK_PD_IC_TYPE1 (ODM_RTL8188E | ODM_RTL8812 | ODM_RTL8821 |\
44
ODM_RTL8192E | ODM_RTL8723B | ODM_RTL8814A |\
45
ODM_RTL8881A | ODM_RTL8822B | ODM_RTL8703B |\
46
ODM_RTL8195A | ODM_RTL8188F)
47
48
#define CCK_PD_IC_TYPE2 (ODM_RTL8197F | ODM_RTL8821C | ODM_RTL8723D |\
49
ODM_RTL8710B | ODM_RTL8195B) /*extend 0xaaa*/
50
51
#define CCK_PD_IC_TYPE3 (ODM_RTL8192F | ODM_RTL8721D | ODM_RTL8710C)
52
/*@extend for different bw & path*/
53
54
#define CCK_PD_IC_TYPE4 ODM_IC_JGR3_SERIES /*@extend for different bw & path*/
55
56
/*@Compile time flag of CCK_PD HW type*/
57
#if (RTL8188E_SUPPORT || RTL8812A_SUPPORT || RTL8821A_SUPPORT ||\
58
RTL8192E_SUPPORT || RTL8723B_SUPPORT || RTL8814A_SUPPORT ||\
59
RTL8881A_SUPPORT || RTL8822B_SUPPORT || RTL8703B_SUPPORT ||\
60
RTL8195A_SUPPORT || RTL8188F_SUPPORT)
61
#define PHYDM_COMPILE_CCKPD_TYPE1 /*@only 0xa0a*/
62
#endif
63
64
#if (RTL8197F_SUPPORT || RTL8821C_SUPPORT || RTL8723D_SUPPORT ||\
65
RTL8710B_SUPPORT || RTL8195B_SUPPORT)
66
#define PHYDM_COMPILE_CCKPD_TYPE2 /*@extend 0xaaa*/
67
#endif
68
69
#if (RTL8192F_SUPPORT || RTL8721D_SUPPORT || RTL8710C_SUPPORT)
70
#define PHYDM_COMPILE_CCKPD_TYPE3 /*@extend for different & path*/
71
#endif
72
73
#ifdef PHYDM_IC_JGR3_SERIES_SUPPORT
74
#define PHYDM_COMPILE_CCKPD_TYPE4 /*@extend for different bw & path*/
75
#endif
76
/*@
77
* 1 ============================================================
78
* 1 enumeration
79
* 1 ============================================================
80
*/
81
enum cckpd_lv {
82
CCK_PD_LV_INIT = 0xff,
83
CCK_PD_LV_0 = 0,
84
CCK_PD_LV_1 = 1,
85
CCK_PD_LV_2 = 2,
86
CCK_PD_LV_3 = 3,
87
CCK_PD_LV_4 = 4,
88
CCK_PD_LV_MAX = 5
89
};
90
91
enum cckpd_mode {
92
CCK_BW20_1R = 0,
93
CCK_BW20_2R = 1,
94
CCK_BW20_3R = 2,
95
CCK_BW20_4R = 3,
96
CCK_BW40_1R = 4,
97
CCK_BW40_2R = 5,
98
CCK_BW40_3R = 6,
99
CCK_BW40_4R = 7
100
};
101
102
/*@
103
* 1 ============================================================
104
* 1 structure
105
* 1 ============================================================
106
*/
107
108
#ifdef PHYDM_SUPPORT_CCKPD
109
struct phydm_cckpd_struct {
110
u8 cckpd_hw_type;
111
u8 cur_cck_cca_thres; /*@current cck_pd value 0xa0a*/
112
u32 cck_fa_ma;
113
u32 rvrt_val; /*all rvrt_val for pause API must set to u32*/
114
u8 pause_lv;
115
u8 cck_n_rx;
116
enum channel_width cck_bw;
117
enum cckpd_lv cck_pd_lv;
118
#ifdef PHYDM_COMPILE_CCKPD_TYPE2
119
u8 cck_cca_th_aaa; /*@current cs_ratio value 0xaaa*/
120
u8 aaa_default; /*@Init cs_ratio value - 0xaaa*/
121
#endif
122
#ifdef PHYDM_COMPILE_CCKPD_TYPE3
123
/*Default value*/
124
u8 cck_pd_20m_1r;
125
u8 cck_pd_20m_2r;
126
u8 cck_pd_40m_1r;
127
u8 cck_pd_40m_2r;
128
u8 cck_cs_ratio_20m_1r;
129
u8 cck_cs_ratio_20m_2r;
130
u8 cck_cs_ratio_40m_1r;
131
u8 cck_cs_ratio_40m_2r;
132
/*Current value*/
133
u8 cur_cck_pd_20m_1r;
134
u8 cur_cck_pd_20m_2r;
135
u8 cur_cck_pd_40m_1r;
136
u8 cur_cck_pd_40m_2r;
137
u8 cur_cck_cs_ratio_20m_1r;
138
u8 cur_cck_cs_ratio_20m_2r;
139
u8 cur_cck_cs_ratio_40m_1r;
140
u8 cur_cck_cs_ratio_40m_2r;
141
#endif
142
#ifdef PHYDM_COMPILE_CCKPD_TYPE4
143
/*@[bw][nrx][0:PD/1:CS][lv]*/
144
u8 cck_pd_table_jgr3[2][4][2][CCK_PD_LV_MAX];
145
#endif
146
};
147
#endif
148
149
/*@
150
* 1 ============================================================
151
* 1 function prototype
152
* 1 ============================================================
153
*/
154
void phydm_set_cckpd_val(void *dm_void, u32 *val_buf, u8 val_len);
155
156
void phydm_cck_pd_th(void *dm_void);
157
158
void phydm_cck_pd_init(void *dm_void);
159
#endif
160
161