summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ti/wl18xx/conf.h
blob: 7aa880f14ccba8c2e0459c0e50e67a271745732c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
/*
 * This file is part of wl18xx
 *
 * Copyright (C) 2011 Texas Instruments Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA
 *
 */

#ifndef __WL18XX_CONF_H__
#define __WL18XX_CONF_H__

#define WL18XX_CONF_MAGIC	0x10e100ca
#define WL18XX_CONF_VERSION	(WLCORE_CONF_VERSION | 0x0007)
#define WL18XX_CONF_MASK	0x0000ffff
#define WL18XX_CONF_SIZE	(WLCORE_CONF_SIZE + \
				 sizeof(struct wl18xx_priv_conf))

#define NUM_OF_CHANNELS_11_ABG 150
#define NUM_OF_CHANNELS_11_P 7
#define SRF_TABLE_LEN 16
#define PIN_MUXING_SIZE 2
#define WL18XX_TRACE_LOSS_GAPS_TX 10
#define WL18XX_TRACE_LOSS_GAPS_RX 18

struct wl18xx_mac_and_phy_params {
	u8 phy_standalone;
	u8 spare0;
	u8 enable_clpc;
	u8 enable_tx_low_pwr_on_siso_rdl;
	u8 auto_detect;
	u8 dedicated_fem;

	u8 low_band_component;

	/* Bit 0: One Hot, Bit 1: Control Enable, Bit 2: 1.8V, Bit 3: 3V */
	u8 low_band_component_type;

	u8 high_band_component;

	/* Bit 0: One Hot, Bit 1: Control Enable, Bit 2: 1.8V, Bit 3: 3V */
	u8 high_band_component_type;
	u8 number_of_assembled_ant2_4;
	u8 number_of_assembled_ant5;
	u8 pin_muxing_platform_options[PIN_MUXING_SIZE];
	u8 external_pa_dc2dc;
	u8 tcxo_ldo_voltage;
	u8 xtal_itrim_val;
	u8 srf_state;
	u8 srf1[SRF_TABLE_LEN];
	u8 srf2[SRF_TABLE_LEN];
	u8 srf3[SRF_TABLE_LEN];
	u8 io_configuration;
	u8 sdio_configuration;
	u8 settings;
	u8 rx_profile;
	u8 per_chan_pwr_limit_arr_11abg[NUM_OF_CHANNELS_11_ABG];
	u8 pwr_limit_reference_11_abg;
	u8 per_chan_pwr_limit_arr_11p[NUM_OF_CHANNELS_11_P];
	u8 pwr_limit_reference_11p;
	u8 spare1;
	u8 per_chan_bo_mode_11_abg[13];
	u8 per_chan_bo_mode_11_p[4];
	u8 primary_clock_setting_time;
	u8 clock_valid_on_wake_up;
	u8 secondary_clock_setting_time;
	u8 board_type;
	/* enable point saturation */
	u8 psat;
	/* low/medium/high Tx power in dBm for STA-HP BG */
	s8 low_power_val;
	s8 med_power_val;
	s8 high_power_val;
	s8 per_sub_band_tx_trace_loss[WL18XX_TRACE_LOSS_GAPS_TX];
	s8 per_sub_band_rx_trace_loss[WL18XX_TRACE_LOSS_GAPS_RX];
	u8 tx_rf_margin;
	/* low/medium/high Tx power in dBm for other role */
	s8 low_power_val_2nd;
	s8 med_power_val_2nd;
	s8 high_power_val_2nd;

	u8 padding[1];
} __packed;

enum wl18xx_ht_mode {
	/* Default - use MIMO, fallback to SISO20 */
	HT_MODE_DEFAULT = 0,

	/* Wide - use SISO40 */
	HT_MODE_WIDE = 1,

	/* Use SISO20 */
	HT_MODE_SISO20 = 2,
};

struct wl18xx_ht_settings {
	/* DEFAULT / WIDE / SISO20 */
	u8 mode;
} __packed;

struct conf_ap_sleep_settings {
	/* Duty Cycle (20-80% of staying Awake) for IDLE AP
	 * (0: disable)
	 */
	u8 idle_duty_cycle;
	/* Duty Cycle (20-80% of staying Awake) for Connected AP
	 * (0: disable)
	 */
	u8 connected_duty_cycle;
	/* Maximum stations that are allowed to be connected to AP
	 *  (255: no limit)
	 */
	u8 max_stations_thresh;
	/* Timeout till enabling the Sleep Mechanism after data stops
	 * [unit: 100 msec]
	 */
	u8 idle_conn_thresh;
} __packed;

struct wl18xx_priv_conf {
	/* Module params structures */
	struct wl18xx_ht_settings ht;

	/* this structure is copied wholesale to FW */
	struct wl18xx_mac_and_phy_params phy;

	struct conf_ap_sleep_settings ap_sleep;
} __packed;

enum wl18xx_sg_params {
	WL18XX_CONF_SG_PARAM_0 = 0,

	/* Configuration Parameters */
	WL18XX_CONF_SG_ANTENNA_CONFIGURATION,
	WL18XX_CONF_SG_ZIGBEE_COEX,
	WL18XX_CONF_SG_TIME_SYNC,

	WL18XX_CONF_SG_PARAM_4,
	WL18XX_CONF_SG_PARAM_5,
	WL18XX_CONF_SG_PARAM_6,
	WL18XX_CONF_SG_PARAM_7,
	WL18XX_CONF_SG_PARAM_8,
	WL18XX_CONF_SG_PARAM_9,
	WL18XX_CONF_SG_PARAM_10,
	WL18XX_CONF_SG_PARAM_11,
	WL18XX_CONF_SG_PARAM_12,
	WL18XX_CONF_SG_PARAM_13,
	WL18XX_CONF_SG_PARAM_14,
	WL18XX_CONF_SG_PARAM_15,
	WL18XX_CONF_SG_PARAM_16,
	WL18XX_CONF_SG_PARAM_17,
	WL18XX_CONF_SG_PARAM_18,
	WL18XX_CONF_SG_PARAM_19,
	WL18XX_CONF_SG_PARAM_20,
	WL18XX_CONF_SG_PARAM_21,
	WL18XX_CONF_SG_PARAM_22,
	WL18XX_CONF_SG_PARAM_23,
	WL18XX_CONF_SG_PARAM_24,
	WL18XX_CONF_SG_PARAM_25,

	/* Active Scan Parameters */
	WL18XX_CONF_SG_AUTO_SCAN_PROBE_REQ,
	WL18XX_CONF_SG_ACTIVE_SCAN_DURATION_FACTOR_HV3,

	WL18XX_CONF_SG_PARAM_28,

	/* Passive Scan Parameters */
	WL18XX_CONF_SG_PARAM_29,
	WL18XX_CONF_SG_PARAM_30,
	WL18XX_CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_HV3,

	/* Passive Scan in Dual Antenna Parameters */
	WL18XX_CONF_SG_CONSECUTIVE_HV3_IN_PASSIVE_SCAN,
	WL18XX_CONF_SG_BEACON_HV3_COLL_TH_IN_PASSIVE_SCAN,
	WL18XX_CONF_SG_TX_RX_PROTECT_BW_IN_PASSIVE_SCAN,

	/* General Parameters */
	WL18XX_CONF_SG_STA_FORCE_PS_IN_BT_SCO,
	WL18XX_CONF_SG_PARAM_36,
	WL18XX_CONF_SG_BEACON_MISS_PERCENT,
	WL18XX_CONF_SG_PARAM_38,
	WL18XX_CONF_SG_RXT,
	WL18XX_CONF_SG_UNUSED,
	WL18XX_CONF_SG_ADAPTIVE_RXT_TXT,
	WL18XX_CONF_SG_GENERAL_USAGE_BIT_MAP,
	WL18XX_CONF_SG_HV3_MAX_SERVED,
	WL18XX_CONF_SG_PARAM_44,
	WL18XX_CONF_SG_PARAM_45,
	WL18XX_CONF_SG_CONSECUTIVE_CTS_THRESHOLD,
	WL18XX_CONF_SG_GEMINI_PARAM_47,
	WL18XX_CONF_SG_STA_CONNECTION_PROTECTION_TIME,

	/* AP Parameters */
	WL18XX_CONF_SG_AP_BEACON_MISS_TX,
	WL18XX_CONF_SG_PARAM_50,
	WL18XX_CONF_SG_AP_BEACON_WINDOW_INTERVAL,
	WL18XX_CONF_SG_AP_CONNECTION_PROTECTION_TIME,
	WL18XX_CONF_SG_PARAM_53,
	WL18XX_CONF_SG_PARAM_54,

	/* CTS Diluting Parameters */
	WL18XX_CONF_SG_CTS_DILUTED_BAD_RX_PACKETS_TH,
	WL18XX_CONF_SG_CTS_CHOP_IN_DUAL_ANT_SCO_MASTER,

	WL18XX_CONF_SG_TEMP_PARAM_1,
	WL18XX_CONF_SG_TEMP_PARAM_2,
	WL18XX_CONF_SG_TEMP_PARAM_3,
	WL18XX_CONF_SG_TEMP_PARAM_4,
	WL18XX_CONF_SG_TEMP_PARAM_5,
	WL18XX_CONF_SG_TEMP_PARAM_6,
	WL18XX_CONF_SG_TEMP_PARAM_7,
	WL18XX_CONF_SG_TEMP_PARAM_8,
	WL18XX_CONF_SG_TEMP_PARAM_9,
	WL18XX_CONF_SG_TEMP_PARAM_10,

	WL18XX_CONF_SG_PARAMS_MAX,
	WL18XX_CONF_SG_PARAMS_ALL = 0xff
};

#endif /* __WL18XX_CONF_H__ */