18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * This file is part of wl18xx
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2011 Texas Instruments Inc.
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifndef __WL18XX_CONF_H__
98c2ecf20Sopenharmony_ci#define __WL18XX_CONF_H__
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#define WL18XX_CONF_MAGIC	0x10e100ca
128c2ecf20Sopenharmony_ci#define WL18XX_CONF_VERSION	(WLCORE_CONF_VERSION | 0x0007)
138c2ecf20Sopenharmony_ci#define WL18XX_CONF_MASK	0x0000ffff
148c2ecf20Sopenharmony_ci#define WL18XX_CONF_SIZE	(WLCORE_CONF_SIZE + \
158c2ecf20Sopenharmony_ci				 sizeof(struct wl18xx_priv_conf))
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#define NUM_OF_CHANNELS_11_ABG 150
188c2ecf20Sopenharmony_ci#define NUM_OF_CHANNELS_11_P 7
198c2ecf20Sopenharmony_ci#define SRF_TABLE_LEN 16
208c2ecf20Sopenharmony_ci#define PIN_MUXING_SIZE 2
218c2ecf20Sopenharmony_ci#define WL18XX_TRACE_LOSS_GAPS_TX 10
228c2ecf20Sopenharmony_ci#define WL18XX_TRACE_LOSS_GAPS_RX 18
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_cistruct wl18xx_mac_and_phy_params {
258c2ecf20Sopenharmony_ci	u8 phy_standalone;
268c2ecf20Sopenharmony_ci	u8 spare0;
278c2ecf20Sopenharmony_ci	u8 enable_clpc;
288c2ecf20Sopenharmony_ci	u8 enable_tx_low_pwr_on_siso_rdl;
298c2ecf20Sopenharmony_ci	u8 auto_detect;
308c2ecf20Sopenharmony_ci	u8 dedicated_fem;
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci	u8 low_band_component;
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci	/* Bit 0: One Hot, Bit 1: Control Enable, Bit 2: 1.8V, Bit 3: 3V */
358c2ecf20Sopenharmony_ci	u8 low_band_component_type;
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci	u8 high_band_component;
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci	/* Bit 0: One Hot, Bit 1: Control Enable, Bit 2: 1.8V, Bit 3: 3V */
408c2ecf20Sopenharmony_ci	u8 high_band_component_type;
418c2ecf20Sopenharmony_ci	u8 number_of_assembled_ant2_4;
428c2ecf20Sopenharmony_ci	u8 number_of_assembled_ant5;
438c2ecf20Sopenharmony_ci	u8 pin_muxing_platform_options[PIN_MUXING_SIZE];
448c2ecf20Sopenharmony_ci	u8 external_pa_dc2dc;
458c2ecf20Sopenharmony_ci	u8 tcxo_ldo_voltage;
468c2ecf20Sopenharmony_ci	u8 xtal_itrim_val;
478c2ecf20Sopenharmony_ci	u8 srf_state;
488c2ecf20Sopenharmony_ci	u8 srf1[SRF_TABLE_LEN];
498c2ecf20Sopenharmony_ci	u8 srf2[SRF_TABLE_LEN];
508c2ecf20Sopenharmony_ci	u8 srf3[SRF_TABLE_LEN];
518c2ecf20Sopenharmony_ci	u8 io_configuration;
528c2ecf20Sopenharmony_ci	u8 sdio_configuration;
538c2ecf20Sopenharmony_ci	u8 settings;
548c2ecf20Sopenharmony_ci	u8 rx_profile;
558c2ecf20Sopenharmony_ci	u8 per_chan_pwr_limit_arr_11abg[NUM_OF_CHANNELS_11_ABG];
568c2ecf20Sopenharmony_ci	u8 pwr_limit_reference_11_abg;
578c2ecf20Sopenharmony_ci	u8 per_chan_pwr_limit_arr_11p[NUM_OF_CHANNELS_11_P];
588c2ecf20Sopenharmony_ci	u8 pwr_limit_reference_11p;
598c2ecf20Sopenharmony_ci	u8 spare1;
608c2ecf20Sopenharmony_ci	u8 per_chan_bo_mode_11_abg[13];
618c2ecf20Sopenharmony_ci	u8 per_chan_bo_mode_11_p[4];
628c2ecf20Sopenharmony_ci	u8 primary_clock_setting_time;
638c2ecf20Sopenharmony_ci	u8 clock_valid_on_wake_up;
648c2ecf20Sopenharmony_ci	u8 secondary_clock_setting_time;
658c2ecf20Sopenharmony_ci	u8 board_type;
668c2ecf20Sopenharmony_ci	/* enable point saturation */
678c2ecf20Sopenharmony_ci	u8 psat;
688c2ecf20Sopenharmony_ci	/* low/medium/high Tx power in dBm for STA-HP BG */
698c2ecf20Sopenharmony_ci	s8 low_power_val;
708c2ecf20Sopenharmony_ci	s8 med_power_val;
718c2ecf20Sopenharmony_ci	s8 high_power_val;
728c2ecf20Sopenharmony_ci	s8 per_sub_band_tx_trace_loss[WL18XX_TRACE_LOSS_GAPS_TX];
738c2ecf20Sopenharmony_ci	s8 per_sub_band_rx_trace_loss[WL18XX_TRACE_LOSS_GAPS_RX];
748c2ecf20Sopenharmony_ci	u8 tx_rf_margin;
758c2ecf20Sopenharmony_ci	/* low/medium/high Tx power in dBm for other role */
768c2ecf20Sopenharmony_ci	s8 low_power_val_2nd;
778c2ecf20Sopenharmony_ci	s8 med_power_val_2nd;
788c2ecf20Sopenharmony_ci	s8 high_power_val_2nd;
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci	u8 padding[1];
818c2ecf20Sopenharmony_ci} __packed;
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_cienum wl18xx_ht_mode {
848c2ecf20Sopenharmony_ci	/* Default - use MIMO, fallback to SISO20 */
858c2ecf20Sopenharmony_ci	HT_MODE_DEFAULT = 0,
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci	/* Wide - use SISO40 */
888c2ecf20Sopenharmony_ci	HT_MODE_WIDE = 1,
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci	/* Use SISO20 */
918c2ecf20Sopenharmony_ci	HT_MODE_SISO20 = 2,
928c2ecf20Sopenharmony_ci};
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_cistruct wl18xx_ht_settings {
958c2ecf20Sopenharmony_ci	/* DEFAULT / WIDE / SISO20 */
968c2ecf20Sopenharmony_ci	u8 mode;
978c2ecf20Sopenharmony_ci} __packed;
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_cistruct conf_ap_sleep_settings {
1008c2ecf20Sopenharmony_ci	/* Duty Cycle (20-80% of staying Awake) for IDLE AP
1018c2ecf20Sopenharmony_ci	 * (0: disable)
1028c2ecf20Sopenharmony_ci	 */
1038c2ecf20Sopenharmony_ci	u8 idle_duty_cycle;
1048c2ecf20Sopenharmony_ci	/* Duty Cycle (20-80% of staying Awake) for Connected AP
1058c2ecf20Sopenharmony_ci	 * (0: disable)
1068c2ecf20Sopenharmony_ci	 */
1078c2ecf20Sopenharmony_ci	u8 connected_duty_cycle;
1088c2ecf20Sopenharmony_ci	/* Maximum stations that are allowed to be connected to AP
1098c2ecf20Sopenharmony_ci	 *  (255: no limit)
1108c2ecf20Sopenharmony_ci	 */
1118c2ecf20Sopenharmony_ci	u8 max_stations_thresh;
1128c2ecf20Sopenharmony_ci	/* Timeout till enabling the Sleep Mechanism after data stops
1138c2ecf20Sopenharmony_ci	 * [unit: 100 msec]
1148c2ecf20Sopenharmony_ci	 */
1158c2ecf20Sopenharmony_ci	u8 idle_conn_thresh;
1168c2ecf20Sopenharmony_ci} __packed;
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_cistruct wl18xx_priv_conf {
1198c2ecf20Sopenharmony_ci	/* Module params structures */
1208c2ecf20Sopenharmony_ci	struct wl18xx_ht_settings ht;
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_ci	/* this structure is copied wholesale to FW */
1238c2ecf20Sopenharmony_ci	struct wl18xx_mac_and_phy_params phy;
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci	struct conf_ap_sleep_settings ap_sleep;
1268c2ecf20Sopenharmony_ci} __packed;
1278c2ecf20Sopenharmony_ci
1288c2ecf20Sopenharmony_cienum wl18xx_sg_params {
1298c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_0 = 0,
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_ci	/* Configuration Parameters */
1328c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_ANTENNA_CONFIGURATION,
1338c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_ZIGBEE_COEX,
1348c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_TIME_SYNC,
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_4,
1378c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_5,
1388c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_6,
1398c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_7,
1408c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_8,
1418c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_9,
1428c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_10,
1438c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_11,
1448c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_12,
1458c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_13,
1468c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_14,
1478c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_15,
1488c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_16,
1498c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_17,
1508c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_18,
1518c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_19,
1528c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_20,
1538c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_21,
1548c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_22,
1558c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_23,
1568c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_24,
1578c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_25,
1588c2ecf20Sopenharmony_ci
1598c2ecf20Sopenharmony_ci	/* Active Scan Parameters */
1608c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_AUTO_SCAN_PROBE_REQ,
1618c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_ACTIVE_SCAN_DURATION_FACTOR_HV3,
1628c2ecf20Sopenharmony_ci
1638c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_28,
1648c2ecf20Sopenharmony_ci
1658c2ecf20Sopenharmony_ci	/* Passive Scan Parameters */
1668c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_29,
1678c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_30,
1688c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_HV3,
1698c2ecf20Sopenharmony_ci
1708c2ecf20Sopenharmony_ci	/* Passive Scan in Dual Antenna Parameters */
1718c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_CONSECUTIVE_HV3_IN_PASSIVE_SCAN,
1728c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_BEACON_HV3_COLL_TH_IN_PASSIVE_SCAN,
1738c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_TX_RX_PROTECT_BW_IN_PASSIVE_SCAN,
1748c2ecf20Sopenharmony_ci
1758c2ecf20Sopenharmony_ci	/* General Parameters */
1768c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_STA_FORCE_PS_IN_BT_SCO,
1778c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_36,
1788c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_BEACON_MISS_PERCENT,
1798c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_38,
1808c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_RXT,
1818c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_UNUSED,
1828c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_ADAPTIVE_RXT_TXT,
1838c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_GENERAL_USAGE_BIT_MAP,
1848c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_HV3_MAX_SERVED,
1858c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_44,
1868c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_45,
1878c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_CONSECUTIVE_CTS_THRESHOLD,
1888c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_GEMINI_PARAM_47,
1898c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_STA_CONNECTION_PROTECTION_TIME,
1908c2ecf20Sopenharmony_ci
1918c2ecf20Sopenharmony_ci	/* AP Parameters */
1928c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_AP_BEACON_MISS_TX,
1938c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_50,
1948c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_AP_BEACON_WINDOW_INTERVAL,
1958c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_AP_CONNECTION_PROTECTION_TIME,
1968c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_53,
1978c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAM_54,
1988c2ecf20Sopenharmony_ci
1998c2ecf20Sopenharmony_ci	/* CTS Diluting Parameters */
2008c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_CTS_DILUTED_BAD_RX_PACKETS_TH,
2018c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_CTS_CHOP_IN_DUAL_ANT_SCO_MASTER,
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_TEMP_PARAM_1,
2048c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_TEMP_PARAM_2,
2058c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_TEMP_PARAM_3,
2068c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_TEMP_PARAM_4,
2078c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_TEMP_PARAM_5,
2088c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_TEMP_PARAM_6,
2098c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_TEMP_PARAM_7,
2108c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_TEMP_PARAM_8,
2118c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_TEMP_PARAM_9,
2128c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_TEMP_PARAM_10,
2138c2ecf20Sopenharmony_ci
2148c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAMS_MAX,
2158c2ecf20Sopenharmony_ci	WL18XX_CONF_SG_PARAMS_ALL = 0xff
2168c2ecf20Sopenharmony_ci};
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_ci#endif /* __WL18XX_CONF_H__ */
219