~slonua/+junk/rtl8821ce

« back to all changes in this revision

Viewing changes to hal/phydm/rtl8821c/phydm_hal_api8821c.h

  • Committer: Vitaliy Kulikov
  • Date: 2017-09-24 10:25:11 UTC
  • Revision ID: slonua@gmail.com-20170924102511-9q45rcjnowest8ee
init

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/******************************************************************************
 
2
 *
 
3
 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
 
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
 * You should have received a copy of the GNU General Public License along with
 
15
 * this program; if not, write to the Free Software Foundation, Inc.,
 
16
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
 
17
 *
 
18
 *
 
19
 ******************************************************************************/
 
20
#ifndef __INC_PHYDM_API_H_8821C__
 
21
#define __INC_PHYDM_API_H_8821C__
 
22
 
 
23
#if (RTL8821C_SUPPORT == 1)
 
24
 
 
25
#define PHY_CONFIG_VERSION_8821C                        "3.1.20"        /*2016.11.21     (HW user guide version: R03, SW user guide version: R01, Modification: R20)*/
 
26
 
 
27
#define INVALID_RF_DATA                                 0xffffffff
 
28
#define INVALID_TXAGC_DATA                              0xff
 
29
 
 
30
#define config_phydm_read_rf_check_8821c(data)                  (data != INVALID_RF_DATA)
 
31
#define config_phydm_read_txagc_check_8821c(data)               (data != INVALID_TXAGC_DATA)
 
32
 
 
33
enum rf_set_8821c {
 
34
        SWITCH_TO_BTG           = 0x0,
 
35
        SWITCH_TO_WLG   = 0x1,
 
36
        SWITCH_TO_WLA   = 0x2,
 
37
        SWITCH_TO_BT            = 0x3
 
38
};
 
39
 
 
40
enum ant_num_8821c {
 
41
        SWITCH_TO_ANT1  = 0x0,
 
42
        SWITCH_TO_ANT2  = 0x1
 
43
};
 
44
 
 
45
enum ant_num_map_8821c {
 
46
        BOTH_AVAILABLE          = 0x1,
 
47
        ONLY_ANT1                               = 0x2,
 
48
        ONLY_ANT2                               = 0x3,
 
49
        DONT_CARE                               = 0x4
 
50
};
 
51
 
 
52
u32
 
53
config_phydm_read_rf_reg_8821c(
 
54
        struct PHY_DM_STRUCT                            *p_dm_odm,
 
55
        enum odm_rf_radio_path_e                rf_path,
 
56
        u32                                     reg_addr,
 
57
        u32                                     bit_mask
 
58
);
 
59
 
 
60
boolean
 
61
config_phydm_write_rf_reg_8821c(
 
62
        struct PHY_DM_STRUCT                            *p_dm_odm,
 
63
        enum odm_rf_radio_path_e                rf_path,
 
64
        u32                                     reg_addr,
 
65
        u32                                     bit_mask,
 
66
        u32                                     data
 
67
);
 
68
 
 
69
boolean
 
70
config_phydm_write_txagc_8821c(
 
71
        struct PHY_DM_STRUCT                            *p_dm_odm,
 
72
        u32                                     power_index,
 
73
        enum odm_rf_radio_path_e                path,
 
74
        u8                                      hw_rate
 
75
);
 
76
 
 
77
u8
 
78
config_phydm_read_txagc_8821c(
 
79
        struct PHY_DM_STRUCT                            *p_dm_odm,
 
80
        enum odm_rf_radio_path_e                path,
 
81
        u8                                      hw_rate
 
82
);
 
83
 
 
84
boolean
 
85
config_phydm_switch_band_8821c(
 
86
        struct PHY_DM_STRUCT                            *p_dm_odm,
 
87
        u8                                      central_ch
 
88
);
 
89
 
 
90
boolean
 
91
config_phydm_switch_channel_8821c(
 
92
        struct PHY_DM_STRUCT                            *p_dm_odm,
 
93
        u8                                      central_ch
 
94
);
 
95
 
 
96
boolean
 
97
config_phydm_switch_bandwidth_8821c(
 
98
        struct PHY_DM_STRUCT                            *p_dm_odm,
 
99
        u8                                      primary_ch_idx,
 
100
        enum odm_bw_e                           bandwidth
 
101
);
 
102
 
 
103
boolean
 
104
config_phydm_switch_channel_bw_8821c(
 
105
        struct PHY_DM_STRUCT                            *p_dm_odm,
 
106
        u8                                      central_ch,
 
107
        u8                                      primary_ch_idx,
 
108
        enum odm_bw_e                           bandwidth
 
109
);
 
110
 
 
111
boolean
 
112
config_phydm_trx_mode_8821c(
 
113
        struct PHY_DM_STRUCT                            *p_dm_odm,
 
114
        enum odm_rf_path_e                      tx_path,
 
115
        enum odm_rf_path_e                      rx_path,
 
116
        boolean                                 is_tx2_path
 
117
);
 
118
 
 
119
boolean
 
120
config_phydm_parameter_init_8821c(
 
121
        struct PHY_DM_STRUCT                            *p_dm_odm,
 
122
        enum odm_parameter_init_e       type
 
123
);
 
124
 
 
125
void
 
126
config_phydm_switch_rf_set_8821c(
 
127
        struct PHY_DM_STRUCT                    *p_dm_odm,
 
128
        u8                              rf_set
 
129
);
 
130
 
 
131
void
 
132
config_phydm_set_ant_path(
 
133
        struct PHY_DM_STRUCT                    *p_dm_odm,
 
134
        u8                              rf_set,
 
135
        u8                              ant_num
 
136
);
 
137
 
 
138
/* ======================================================================== */
 
139
/* These following functions can be used for PHY DM only*/
 
140
 
 
141
boolean
 
142
phydm_write_txagc_1byte_8821c(
 
143
        struct PHY_DM_STRUCT                            *p_dm_odm,
 
144
        u32                                     power_index,
 
145
        enum odm_rf_radio_path_e                path,
 
146
        u8                                      hw_rate
 
147
);
 
148
 
 
149
void
 
150
phydm_init_hw_info_by_rfe_type_8821c(
 
151
        struct PHY_DM_STRUCT                            *p_dm_odm
 
152
);
 
153
 
 
154
void
 
155
phydm_set_gnt_state_8821c(
 
156
        struct PHY_DM_STRUCT                    *p_dm_odm,
 
157
        boolean                         gnt_wl_state,
 
158
        boolean                         gnt_bt_state
 
159
);
 
160
 
 
161
/* ======================================================================== */
 
162
 
 
163
u32
 
164
query_phydm_trx_capability_8821c(
 
165
        struct PHY_DM_STRUCT                            *p_dm_odm
 
166
);
 
167
 
 
168
u32
 
169
query_phydm_stbc_capability_8821c(
 
170
        struct PHY_DM_STRUCT                            *p_dm_odm
 
171
);
 
172
 
 
173
u32
 
174
query_phydm_ldpc_capability_8821c(
 
175
        struct PHY_DM_STRUCT                            *p_dm_odm
 
176
);
 
177
 
 
178
u32
 
179
query_phydm_txbf_parameters_8821c(
 
180
        struct PHY_DM_STRUCT                            *p_dm_odm
 
181
);
 
182
 
 
183
u32
 
184
query_phydm_txbf_capability_8821c(
 
185
        struct PHY_DM_STRUCT                            *p_dm_odm
 
186
);
 
187
 
 
188
u8
 
189
query_phydm_default_rf_set_8821c(
 
190
        struct PHY_DM_STRUCT                            *p_dm_odm
 
191
);
 
192
 
 
193
u8
 
194
query_phydm_current_rf_set_8821c(
 
195
        struct PHY_DM_STRUCT                            *p_dm_odm
 
196
);
 
197
 
 
198
u8
 
199
query_phydm_rfetype_8821c(
 
200
        struct PHY_DM_STRUCT                            *p_dm_odm
 
201
);
 
202
 
 
203
u8
 
204
query_phydm_current_ant_num_8821c(
 
205
        struct PHY_DM_STRUCT                            *p_dm_odm
 
206
);
 
207
 
 
208
u8
 
209
query_phydm_ant_num_map_8821c(
 
210
        struct PHY_DM_STRUCT                            *p_dm_odm
 
211
);
 
212
 
 
213
#endif  /* RTL8821C_SUPPORT == 1 */
 
214
#endif  /*  __INC_PHYDM_API_H_8821C__ */