1 /* SPDX-License-Identifier: GPL-2.0 */
2 /******************************************************************************
3  *
4  * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
5  *
6  ******************************************************************************/
7 #ifndef	__RTW_RF_H_
8 #define __RTW_RF_H_
9 
10 #include <rtw_cmd.h>
11 
12 #define OFDM_PHY		1
13 #define MIXED_PHY		2
14 #define CCK_PHY		3
15 
16 #define NumRates	(13)
17 
18 /*  slot time for 11g */
19 #define SHORT_SLOT_TIME			9
20 #define NON_SHORT_SLOT_TIME		20
21 
22 /*  We now define the following channels as the max channels in each
23  * channel plan.
24  */
25 /*  2G, total 14 chnls */
26 /*  {1,2,3,4,5,6,7,8,9,10,11,12,13,14} */
27 #define	MAX_CHANNEL_NUM_2G		14
28 #define	MAX_CHANNEL_NUM			14	/* 2.4 GHz only */
29 
30 /* Country codes */
31 #define USA				0x555320
32 #define EUROPE				0x1 /* temp, should be provided later */
33 #define JAPAN				0x2 /* temp, should be provided later */
34 
35 struct	regulatory_class {
36 	u32	starting_freq;				/* MHz, */
37 	u8	channel_set[MAX_CHANNEL_NUM];
38 	u8	channel_cck_power[MAX_CHANNEL_NUM];	/* dbm */
39 	u8	channel_ofdm_power[MAX_CHANNEL_NUM];	/* dbm */
40 	u8	txpower_limit;				/* dbm */
41 	u8	channel_spacing;			/* MHz */
42 	u8	modem;
43 };
44 
45 enum capability {
46 	cESS		= 0x0001,
47 	cIBSS		= 0x0002,
48 	cPollable	= 0x0004,
49 	cPollReq	= 0x0008,
50 	cPrivacy	= 0x0010,
51 	cShortPreamble	= 0x0020,
52 	cPBCC		= 0x0040,
53 	cChannelAgility	= 0x0080,
54 	cSpectrumMgnt	= 0x0100,
55 	cQos		= 0x0200,	/* For HCCA, use with CF-Pollable
56 					 * and CF-PollReq
57 					 */
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 rf90_radio_path {
73 	RF90_PATH_A = 0,		/* Radio Path A */
74 	RF90_PATH_B = 1,		/* Radio Path B */
75 	RF90_PATH_C = 2,		/* Radio Path C */
76 	RF90_PATH_D = 3			/* Radio Path D */
77 };
78 
79 /*  Bandwidth Offset */
80 #define HAL_PRIME_CHNL_OFFSET_DONT_CARE	0
81 #define HAL_PRIME_CHNL_OFFSET_LOWER	1
82 #define HAL_PRIME_CHNL_OFFSET_UPPER	2
83 
84 /*  Represent Channel Width in HT Capabilities */
85 /*  */
86 enum ht_channel_width {
87 	HT_CHANNEL_WIDTH_20 = 0,
88 	HT_CHANNEL_WIDTH_40 = 1,
89 	HT_CHANNEL_WIDTH_80 = 2,
90 	HT_CHANNEL_WIDTH_160 = 3,
91 	HT_CHANNEL_WIDTH_10 = 4,
92 };
93 
94 /*  */
95 /*  Represent Extension Channel Offset in HT Capabilities */
96 /*  This is available only in 40Mhz mode. */
97 /*  */
98 enum ht_extchnl_offset {
99 	HT_EXTCHNL_OFFSET_NO_EXT = 0,
100 	HT_EXTCHNL_OFFSET_UPPER = 1,
101 	HT_EXTCHNL_OFFSET_NO_DEF = 2,
102 	HT_EXTCHNL_OFFSET_LOWER = 3,
103 };
104 
105 /* 2007/11/15 MH Define different RF type. */
106 enum rt_rf_type_def {
107 	RF_1T2R = 0,
108 	RF_2T4R = 1,
109 	RF_2T2R = 2,
110 	RF_1T1R = 3,
111 	RF_2T2R_GREEN = 4,
112 	RF_819X_MAX_TYPE = 5,
113 };
114 
115 u32 rtw_ch2freq(u32 ch);
116 
117 #endif /* _RTL8711_RF_H_ */
118