Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nu11secur1ty
GitHub Repository: nu11secur1ty/Kali-Linux
Path: blob/master/ALFA-W1F1/RTL8814AU/hal/phydm/phydm_dynamictxpower.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 __PHYDMDYNAMICTXPOWER_H__
27
#define __PHYDMDYNAMICTXPOWER_H__
28
29
#ifdef CONFIG_DYNAMIC_TX_TWR
30
/* @============================================================
31
* Definition
32
* ============================================================
33
*/
34
35
/* 2019.2.12, refine code structure and set macid 127 only for 22C*/
36
#define DYNAMIC_TXPWR_VERSION "1.8"
37
38
#if (DM_ODM_SUPPORT_TYPE == ODM_AP)
39
#define TX_POWER_NEAR_FIELD_THRESH_LVL2 74
40
#define TX_POWER_NEAR_FIELD_THRESH_LVL1 60
41
#define TX_POWER_NEAR_FIELD_THRESH_AP 0x3F
42
#elif (DM_ODM_SUPPORT_TYPE == ODM_WIN)
43
#define TX_POWER_NEAR_FIELD_THRESH_LVL2 74
44
#define TX_POWER_NEAR_FIELD_THRESH_LVL1 67
45
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
46
#define TX_POWER_NEAR_FIELD_THRESH_LVL2 74
47
#define TX_POWER_NEAR_FIELD_THRESH_LVL1 60
48
#endif
49
50
#if (DM_ODM_SUPPORT_TYPE == ODM_AP)
51
#define TX_PWR_NEAR_FIELD_TH_JGR3_LVL3 255
52
#define TX_PWR_NEAR_FIELD_TH_JGR3_LVL2 74
53
#define TX_PWR_NEAR_FIELD_TH_JGR3_LVL1 60
54
#elif (DM_ODM_SUPPORT_TYPE == ODM_WIN)
55
#define TX_PWR_NEAR_FIELD_TH_JGR3_LVL3 90
56
#define TX_PWR_NEAR_FIELD_TH_JGR3_LVL2 85
57
#define TX_PWR_NEAR_FIELD_TH_JGR3_LVL1 80
58
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
59
#define TX_PWR_NEAR_FIELD_TH_JGR3_LVL3 90
60
#define TX_PWR_NEAR_FIELD_TH_JGR3_LVL2 85
61
#define TX_PWR_NEAR_FIELD_TH_JGR3_LVL1 80
62
#endif
63
64
#define tx_high_pwr_level_normal 0
65
#define tx_high_pwr_level_level1 1
66
#define tx_high_pwr_level_level2 2
67
#define tx_high_pwr_level_level3 3
68
#define tx_high_pwr_level_unchange 4
69
70
/* @============================================================
71
* enumrate
72
* ============================================================
73
*/
74
enum phydm_dtp_power_offset {
75
PHYDM_OFFSET_ZERO = 0,
76
PHYDM_OFFSET_MINUS_3DB = 1,
77
PHYDM_OFFSET_MINUS_7DB = 2,
78
PHYDM_OFFSET_MINUS_11DB = 3,
79
PHYDM_OFFSET_ADD_3DB = 4,
80
PHYDM_OFFSET_ADD_6DB = 5
81
};
82
83
enum phydm_dtp_power_offset_2nd {
84
PHYDM_2ND_OFFSET_ZERO = 0,
85
PHYDM_2ND_OFFSET_MINUS_3DB = 1,
86
PHYDM_2ND_OFFSET_MINUS_7DB = 2,
87
PHYDM_2ND_OFFSET_MINUS_11DB = 3
88
};
89
90
enum phydm_dtp_power_offset_bbram {
91
/*@ HW min use 1dB*/
92
PHYDM_BBRAM_OFFSET_ZERO = 0,
93
PHYDM_BBRAM_OFFSET_MINUS_3DB = -3,
94
PHYDM_BBRAM_OFFSET_MINUS_7DB = -7,
95
PHYDM_BBRAM_OFFSET_MINUS_11DB = -11
96
};
97
98
enum phydm_dtp_power_pkt_type {
99
RAM_PWR_OFST0 = 0,
100
RAM_PWR_OFST1 = 1,
101
REG_PWR_OFST0 = 2,
102
REG_PWR_OFST1 = 3
103
};
104
105
/* @============================================================
106
* structure
107
* ============================================================
108
*/
109
110
/* @============================================================
111
* Function Prototype
112
* ============================================================
113
*/
114
115
extern void
116
odm_set_dyntxpwr(void *dm_void, u8 *desc, u8 mac_id);
117
118
void phydm_dynamic_tx_power(void *dm_void);
119
120
void phydm_dynamic_tx_power_init(void *dm_void);
121
122
void phydm_dtp_debug(void *dm_void, char input[][16], u32 *_used, char *output,
123
u32 *_out_len);
124
125
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
126
void odm_dynamic_tx_power_win(void *dm_void);
127
#endif
128
129
#endif
130
#endif
131
132