• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /* Copyright(c) 2007 - 2011 Realtek Corporation. */
3 
4 #ifndef	__RTW_RF_H_
5 #define __RTW_RF_H_
6 
7 #include "rtw_cmd.h"
8 
9 #define OFDM_PHY		1
10 #define MIXED_PHY		2
11 #define CCK_PHY		3
12 
13 #define NumRates	(13)
14 
15 /*  slot time for 11g */
16 #define SHORT_SLOT_TIME			9
17 #define NON_SHORT_SLOT_TIME		20
18 
19 #define RTL8711_RF_MAX_SENS		6
20 #define RTL8711_RF_DEF_SENS		4
21 
22 /*  We now define the following channels as the max channels in each
23  * channel plan. */
24 /*  2G, total 14 chnls */
25 /*  {1,2,3,4,5,6,7,8,9,10,11,12,13,14} */
26 #define	MAX_CHANNEL_NUM_2G		14
27 #define	MAX_CHANNEL_NUM			14	/* 2.4 GHz only */
28 
29 #define NUM_REGULATORYS	1
30 
31 /* Country codes */
32 #define USA				0x555320
33 #define EUROPE				0x1 /* temp, should be provided later */
34 #define JAPAN				0x2 /* temp, should be provided later */
35 
36 struct	regulatory_class {
37 	u32	starting_freq;				/* MHz, */
38 	u8	channel_set[MAX_CHANNEL_NUM];
39 	u8	channel_cck_power[MAX_CHANNEL_NUM];	/* dbm */
40 	u8	channel_ofdm_power[MAX_CHANNEL_NUM];	/* dbm */
41 	u8	txpower_limit;				/* dbm */
42 	u8	channel_spacing;			/* MHz */
43 	u8	modem;
44 };
45 
46 enum capability {
47 	cESS		= 0x0001,
48 	cIBSS		= 0x0002,
49 	cPollable	= 0x0004,
50 	cPollReq	= 0x0008,
51 	cPrivacy	= 0x0010,
52 	cShortPreamble	= 0x0020,
53 	cPBCC		= 0x0040,
54 	cChannelAgility	= 0x0080,
55 	cSpectrumMgnt	= 0x0100,
56 	cQos		= 0x0200,	/* For HCCA, use with CF-Pollable
57 					 * and CF-PollReq */
58 	cShortSlotTime	= 0x0400,
59 	cAPSD		= 0x0800,
60 	cRM		= 0x1000,	/*  RRM (Radio Request Measurement) */
61 	cDSSS_OFDM	= 0x2000,
62 	cDelayedBA	= 0x4000,
63 	cImmediateBA	= 0x8000,
64 };
65 
66 enum	_REG_PREAMBLE_MODE {
67 	PREAMBLE_LONG	= 1,
68 	PREAMBLE_AUTO	= 2,
69 	PREAMBLE_SHORT	= 3,
70 };
71 
72 enum _RTL8712_RF_MIMO_CONFIG_ {
73 	RTL8712_RFCONFIG_1T = 0x10,
74 	RTL8712_RFCONFIG_2T = 0x20,
75 	RTL8712_RFCONFIG_1R = 0x01,
76 	RTL8712_RFCONFIG_2R = 0x02,
77 	RTL8712_RFCONFIG_1T1R = 0x11,
78 	RTL8712_RFCONFIG_1T2R = 0x12,
79 	RTL8712_RFCONFIG_TURBO = 0x92,
80 	RTL8712_RFCONFIG_2T2R = 0x22
81 };
82 
83 enum rf90_radio_path {
84 	RF90_PATH_A = 0,		/* Radio Path A */
85 	RF90_PATH_B = 1,		/* Radio Path B */
86 	RF90_PATH_C = 2,		/* Radio Path C */
87 	RF90_PATH_D = 3			/* Radio Path D */
88 };
89 
90 /*  Bandwidth Offset */
91 #define HAL_PRIME_CHNL_OFFSET_DONT_CARE	0
92 #define HAL_PRIME_CHNL_OFFSET_LOWER	1
93 #define HAL_PRIME_CHNL_OFFSET_UPPER	2
94 
95 /*  Represent Channel Width in HT Capabilities */
96 /*  */
97 enum ht_channel_width {
98 	HT_CHANNEL_WIDTH_20 = 0,
99 	HT_CHANNEL_WIDTH_40 = 1,
100 };
101 
102 /*  */
103 /*  Represent Extension Channel Offset in HT Capabilities */
104 /*  This is available only in 40Mhz mode. */
105 /*  */
106 enum ht_extchnl_offset {
107 	HT_EXTCHNL_OFFSET_NO_EXT = 0,
108 	HT_EXTCHNL_OFFSET_UPPER = 1,
109 	HT_EXTCHNL_OFFSET_NO_DEF = 2,
110 	HT_EXTCHNL_OFFSET_LOWER = 3,
111 };
112 
113 /* 2007/11/15 MH Define different RF type. */
114 enum rt_rf_type_def {
115 	RF_1T2R = 0,
116 	RF_2T4R = 1,
117 	RF_2T2R = 2,
118 	RF_1T1R = 3,
119 	RF_2T2R_GREEN = 4,
120 	RF_819X_MAX_TYPE = 5,
121 };
122 
123 u32 rtw_ch2freq(u32 ch);
124 u32 rtw_freq2ch(u32 freq);
125 
126 #endif /* _RTL8711_RF_H_ */
127