xref: /openbmc/linux/drivers/net/wireless/ti/wl18xx/conf.h (revision e2f1e50f62ae70c7ddde8420ed586c6a1aa1e28c)
146a1d512SLuciano Coelho /*
246a1d512SLuciano Coelho  * This file is part of wl18xx
346a1d512SLuciano Coelho  *
446a1d512SLuciano Coelho  * Copyright (C) 2011 Texas Instruments Inc.
546a1d512SLuciano Coelho  *
646a1d512SLuciano Coelho  * This program is free software; you can redistribute it and/or
746a1d512SLuciano Coelho  * modify it under the terms of the GNU General Public License
846a1d512SLuciano Coelho  * version 2 as published by the Free Software Foundation.
946a1d512SLuciano Coelho  *
1046a1d512SLuciano Coelho  * This program is distributed in the hope that it will be useful, but
1146a1d512SLuciano Coelho  * WITHOUT ANY WARRANTY; without even the implied warranty of
1246a1d512SLuciano Coelho  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1346a1d512SLuciano Coelho  * General Public License for more details.
1446a1d512SLuciano Coelho  *
1546a1d512SLuciano Coelho  * You should have received a copy of the GNU General Public License
1646a1d512SLuciano Coelho  * along with this program; if not, write to the Free Software
1746a1d512SLuciano Coelho  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
1846a1d512SLuciano Coelho  * 02110-1301 USA
1946a1d512SLuciano Coelho  *
2046a1d512SLuciano Coelho  */
2146a1d512SLuciano Coelho 
2246a1d512SLuciano Coelho #ifndef __WL18XX_CONF_H__
2346a1d512SLuciano Coelho #define __WL18XX_CONF_H__
2446a1d512SLuciano Coelho 
2518b70ac9SLuciano Coelho #define WL18XX_CONF_MAGIC	0x10e100ca
26*e2f1e50fSKobi L #define WL18XX_CONF_VERSION	(WLCORE_CONF_VERSION | 0x0007)
2718b70ac9SLuciano Coelho #define WL18XX_CONF_MASK	0x0000ffff
2818b70ac9SLuciano Coelho #define WL18XX_CONF_SIZE	(WLCORE_CONF_SIZE + \
2918b70ac9SLuciano Coelho 				 sizeof(struct wl18xx_priv_conf))
3018b70ac9SLuciano Coelho 
31d61c6b55SArik Nemtsov #define NUM_OF_CHANNELS_11_ABG 150
32d61c6b55SArik Nemtsov #define NUM_OF_CHANNELS_11_P 7
33d61c6b55SArik Nemtsov #define SRF_TABLE_LEN 16
34d61c6b55SArik Nemtsov #define PIN_MUXING_SIZE 2
35ec4f4b76SIdo Reis #define WL18XX_TRACE_LOSS_GAPS_TX 10
36ec4f4b76SIdo Reis #define WL18XX_TRACE_LOSS_GAPS_RX 18
37d61c6b55SArik Nemtsov 
38d61c6b55SArik Nemtsov struct wl18xx_mac_and_phy_params {
3946a1d512SLuciano Coelho 	u8 phy_standalone;
40ec4f4b76SIdo Reis 	u8 spare0;
4146a1d512SLuciano Coelho 	u8 enable_clpc;
4246a1d512SLuciano Coelho 	u8 enable_tx_low_pwr_on_siso_rdl;
4346a1d512SLuciano Coelho 	u8 auto_detect;
4446a1d512SLuciano Coelho 	u8 dedicated_fem;
45d61c6b55SArik Nemtsov 
4646a1d512SLuciano Coelho 	u8 low_band_component;
47d61c6b55SArik Nemtsov 
48d61c6b55SArik Nemtsov 	/* Bit 0: One Hot, Bit 1: Control Enable, Bit 2: 1.8V, Bit 3: 3V */
4946a1d512SLuciano Coelho 	u8 low_band_component_type;
50d61c6b55SArik Nemtsov 
5146a1d512SLuciano Coelho 	u8 high_band_component;
52d61c6b55SArik Nemtsov 
53d61c6b55SArik Nemtsov 	/* Bit 0: One Hot, Bit 1: Control Enable, Bit 2: 1.8V, Bit 3: 3V */
5446a1d512SLuciano Coelho 	u8 high_band_component_type;
55d61c6b55SArik Nemtsov 	u8 number_of_assembled_ant2_4;
56d61c6b55SArik Nemtsov 	u8 number_of_assembled_ant5;
57d61c6b55SArik Nemtsov 	u8 pin_muxing_platform_options[PIN_MUXING_SIZE];
58d61c6b55SArik Nemtsov 	u8 external_pa_dc2dc;
5946a1d512SLuciano Coelho 	u8 tcxo_ldo_voltage;
6046a1d512SLuciano Coelho 	u8 xtal_itrim_val;
6146a1d512SLuciano Coelho 	u8 srf_state;
62d61c6b55SArik Nemtsov 	u8 srf1[SRF_TABLE_LEN];
63d61c6b55SArik Nemtsov 	u8 srf2[SRF_TABLE_LEN];
64d61c6b55SArik Nemtsov 	u8 srf3[SRF_TABLE_LEN];
6546a1d512SLuciano Coelho 	u8 io_configuration;
6646a1d512SLuciano Coelho 	u8 sdio_configuration;
6746a1d512SLuciano Coelho 	u8 settings;
6846a1d512SLuciano Coelho 	u8 rx_profile;
69d61c6b55SArik Nemtsov 	u8 per_chan_pwr_limit_arr_11abg[NUM_OF_CHANNELS_11_ABG];
70d61c6b55SArik Nemtsov 	u8 pwr_limit_reference_11_abg;
71d61c6b55SArik Nemtsov 	u8 per_chan_pwr_limit_arr_11p[NUM_OF_CHANNELS_11_P];
72d61c6b55SArik Nemtsov 	u8 pwr_limit_reference_11p;
731d614665SVictor Goldenshtein 	u8 spare1;
741d614665SVictor Goldenshtein 	u8 per_chan_bo_mode_11_abg[13];
751d614665SVictor Goldenshtein 	u8 per_chan_bo_mode_11_p[4];
7646a1d512SLuciano Coelho 	u8 primary_clock_setting_time;
7746a1d512SLuciano Coelho 	u8 clock_valid_on_wake_up;
7846a1d512SLuciano Coelho 	u8 secondary_clock_setting_time;
79d61c6b55SArik Nemtsov 	u8 board_type;
80d61c6b55SArik Nemtsov 	/* enable point saturation */
8116ea4733SIdo Reis 	u8 psat;
82d88949b7SYair Shapira 	/* low/medium/high Tx power in dBm for STA-HP BG */
8316ea4733SIdo Reis 	s8 low_power_val;
8416ea4733SIdo Reis 	s8 med_power_val;
8516ea4733SIdo Reis 	s8 high_power_val;
86ec4f4b76SIdo Reis 	s8 per_sub_band_tx_trace_loss[WL18XX_TRACE_LOSS_GAPS_TX];
87ec4f4b76SIdo Reis 	s8 per_sub_band_rx_trace_loss[WL18XX_TRACE_LOSS_GAPS_RX];
88ec4f4b76SIdo Reis 	u8 tx_rf_margin;
89d88949b7SYair Shapira 	/* low/medium/high Tx power in dBm for other role */
90d88949b7SYair Shapira 	s8 low_power_val_2nd;
91d88949b7SYair Shapira 	s8 med_power_val_2nd;
92d88949b7SYair Shapira 	s8 high_power_val_2nd;
93ec4f4b76SIdo Reis 
94d88949b7SYair Shapira 	u8 padding[1];
9534bacf73SLuciano Coelho } __packed;
9646a1d512SLuciano Coelho 
97c68cc0f6SYair Shapira enum wl18xx_ht_mode {
98c68cc0f6SYair Shapira 	/* Default - use MIMO, fallback to SISO20 */
99c68cc0f6SYair Shapira 	HT_MODE_DEFAULT = 0,
100c68cc0f6SYair Shapira 
101c68cc0f6SYair Shapira 	/* Wide - use SISO40 */
102c68cc0f6SYair Shapira 	HT_MODE_WIDE = 1,
103c68cc0f6SYair Shapira 
104c68cc0f6SYair Shapira 	/* Use SISO20 */
105c68cc0f6SYair Shapira 	HT_MODE_SISO20 = 2,
106c68cc0f6SYair Shapira };
107c68cc0f6SYair Shapira 
108c68cc0f6SYair Shapira struct wl18xx_ht_settings {
109c68cc0f6SYair Shapira 	/* DEFAULT / WIDE / SISO20 */
110c68cc0f6SYair Shapira 	u8 mode;
111c68cc0f6SYair Shapira } __packed;
112c68cc0f6SYair Shapira 
113*e2f1e50fSKobi L struct conf_ap_sleep_settings {
114*e2f1e50fSKobi L 	/* Duty Cycle (20-80% of staying Awake) for IDLE AP
115*e2f1e50fSKobi L 	 * (0: disable)
116*e2f1e50fSKobi L 	 */
117*e2f1e50fSKobi L 	u8 idle_duty_cycle;
118*e2f1e50fSKobi L 	/* Duty Cycle (20-80% of staying Awake) for Connected AP
119*e2f1e50fSKobi L 	 * (0: disable)
120*e2f1e50fSKobi L 	 */
121*e2f1e50fSKobi L 	u8 connected_duty_cycle;
122*e2f1e50fSKobi L 	/* Maximum stations that are allowed to be connected to AP
123*e2f1e50fSKobi L 	 *  (255: no limit)
124*e2f1e50fSKobi L 	 */
125*e2f1e50fSKobi L 	u8 max_stations_thresh;
126*e2f1e50fSKobi L 	/* Timeout till enabling the Sleep Mechanism after data stops
127*e2f1e50fSKobi L 	 * [unit: 100 msec]
128*e2f1e50fSKobi L 	 */
129*e2f1e50fSKobi L 	u8 idle_conn_thresh;
130*e2f1e50fSKobi L } __packed;
131*e2f1e50fSKobi L 
13223ee9bf8SLuciano Coelho struct wl18xx_priv_conf {
133c68cc0f6SYair Shapira 	/* Module params structures */
134c68cc0f6SYair Shapira 	struct wl18xx_ht_settings ht;
135c68cc0f6SYair Shapira 
136d61c6b55SArik Nemtsov 	/* this structure is copied wholesale to FW */
137d61c6b55SArik Nemtsov 	struct wl18xx_mac_and_phy_params phy;
138*e2f1e50fSKobi L 
139*e2f1e50fSKobi L 	struct conf_ap_sleep_settings ap_sleep;
14034bacf73SLuciano Coelho } __packed;
14146a1d512SLuciano Coelho 
14246a1d512SLuciano Coelho #endif /* __WL18XX_CONF_H__ */
143