diff --git a/fw_offload/core/inc/wlan_fw_offload_main.h b/fw_offload/core/inc/wlan_fw_offload_main.h index 5442ea1b79..7c54b4846f 100644 --- a/fw_offload/core/inc/wlan_fw_offload_main.h +++ b/fw_offload/core/inc/wlan_fw_offload_main.h @@ -154,6 +154,12 @@ struct wlan_fwol_neighbor_report_cfg { * @enable_fw_module_log_level_num: enablefw module log level num * @is_rate_limit_enabled: Enable/disable RA rate limited * @tsf_gpio_pin: TSF GPIO Pin config + * @tsf_ptp_options: TSF Plus feature options config + * @lprx_enable: LPRx feature enable config + * @sae_enable: SAE feature enable config + * @gcmp_enable: GCMP feature enable config + * @enable_tx_sch_delay: Enable TX SCH delay value config + * @enable_secondary_rate: Enable secondary retry rate config * @enable_dhcp_server_offload: DHCP Offload is enabled or not * @dhcp_max_num_clients: Max number of DHCP client supported */ @@ -183,7 +189,17 @@ struct wlan_fwol_cfg { #endif #ifdef WLAN_FEATURE_TSF uint32_t tsf_gpio_pin; +#ifdef WLAN_FEATURE_TSF_PLUS + uint32_t tsf_ptp_options; #endif +#endif + bool lprx_enable; +#ifdef WLAN_FEATURE_SAE + bool sae_enable; +#endif + bool gcmp_enable; + uint8_t enable_tx_sch_delay; + uint32_t enable_secondary_rate; #ifdef DHCP_SERVER_OFFLOAD bool enable_dhcp_server_offload; uint32_t dhcp_max_num_clients; diff --git a/fw_offload/core/src/wlan_fw_offload_main.c b/fw_offload/core/src/wlan_fw_offload_main.c index 617b73d2cd..24dba1bf9e 100644 --- a/fw_offload/core/src/wlan_fw_offload_main.c +++ b/fw_offload/core/src/wlan_fw_offload_main.c @@ -271,6 +271,46 @@ static void ucfg_fwol_fetch_tsf_gpio_pin(struct wlan_objmgr_psoc *psoc, } #endif +/** + * ucfg_fwol_init_tsf_ptp_options: Populate the tsf_ptp_options from cfg + * @psoc: The global psoc handler + * @fwol_cfg: The cfg structure + * + * Return: none + */ +#if defined(WLAN_FEATURE_TSF) && defined(WLAN_FEATURE_TSF_PLUS) +static void ucfg_fwol_init_tsf_ptp_options(struct wlan_objmgr_psoc *psoc, + struct wlan_fwol_cfg *fwol_cfg) +{ + fwol_cfg->tsf_ptp_options = cfg_get(psoc, CFG_SET_TSF_PTP_OPT); +} +#else +static void ucfg_fwol_init_tsf_ptp_options(struct wlan_objmgr_psoc *psoc, + struct wlan_fwol_cfg *fwol_cfg) +{ +} +#endif + +/** + * ucfg_fwol_init_sae_cfg: Populate the sae control config from cfg + * @psoc: The global psoc handler + * @fwol_cfg: The cfg structure + * + * Return: none + */ +#ifdef WLAN_FEATURE_SAE +static void ucfg_fwol_init_sae_cfg(struct wlan_objmgr_psoc *psoc, + struct wlan_fwol_cfg *fwol_cfg) +{ + fwol_cfg->sae_enable = cfg_get(psoc, CFG_IS_SAE_ENABLED); +} +#else +static void ucfg_fwol_init_sae_cfg(struct wlan_objmgr_psoc *psoc, + struct wlan_fwol_cfg *fwol_cfg) +{ +} +#endif + /** * ucfg_fwol_fetch_ra_filter: Populate the RA filter enabled or not from cfg * @psoc: The global psoc handler @@ -333,6 +373,13 @@ QDF_STATUS fwol_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc) &enable_fw_module_log_level_num); fwol_cfg->enable_fw_module_log_level_num = (uint8_t)enable_fw_module_log_level_num; + ucfg_fwol_init_tsf_ptp_options(psoc, fwol_cfg); + ucfg_fwol_init_sae_cfg(psoc, fwol_cfg); + fwol_cfg->lprx_enable = cfg_get(psoc, CFG_LPRX); + fwol_cfg->gcmp_enable = cfg_get(psoc, CFG_ENABLE_GCMP); + fwol_cfg->enable_tx_sch_delay = cfg_get(psoc, CFG_TX_SCH_DELAY); + fwol_cfg->enable_secondary_rate = cfg_get(psoc, + CFG_ENABLE_SECONDARY_RATE); ucfg_fwol_fetch_ra_filter(psoc, fwol_cfg); ucfg_fwol_fetch_tsf_gpio_pin(psoc, fwol_cfg); ucfg_fwol_fetch_dhcp_server_settings(psoc, fwol_cfg); diff --git a/fw_offload/dispatcher/inc/cfg_fwol_generic.h b/fw_offload/dispatcher/inc/cfg_fwol_generic.h index 4682f147f1..030acba95f 100644 --- a/fw_offload/dispatcher/inc/cfg_fwol_generic.h +++ b/fw_offload/dispatcher/inc/cfg_fwol_generic.h @@ -432,6 +432,41 @@ CFG_VALUE_OR_DEFAULT, \ "GPIO pin to toggle when capture tsf") +#if defined(WLAN_FEATURE_TSF) && defined(WLAN_FEATURE_TSF_PLUS) +/* + * gtsf_ptp_options: TSF Plus feature options + * @Min: 0 + * @Max: 0xff + * @Default: 0xf + * + * CFG_SET_TSF_PTP_OPT_RX (0x1) + * CFG_SET_TSF_PTP_OPT_TX (0x2) + * CFG_SET_TSF_PTP_OPT_RAW (0x4) + * CFG_SET_TSF_DBG_FS (0x8) + * + * Related: None + * + * Usage: Internal + * + * + */ +#define CFG_SET_TSF_PTP_OPT_RX (0x1) +#define CFG_SET_TSF_PTP_OPT_TX (0x2) +#define CFG_SET_TSF_PTP_OPT_RAW (0x4) +#define CFG_SET_TSF_DBG_FS (0x8) + +#define CFG_SET_TSF_PTP_OPT CFG_INI_UINT( \ + "gtsf_ptp_options", \ + 0, \ + 0xff, \ + 0xf, \ + CFG_VALUE_OR_DEFAULT, \ + "TSF Plus feature options") +#define __CFG_SET_TSF_PTP_OPT CFG(CFG_SET_TSF_PTP_OPT) +#else +#define __CFG_SET_TSF_PTP_OPT +#endif + #ifdef DHCP_SERVER_OFFLOAD /* * gDHCPServerOffloadEnable @@ -482,6 +517,124 @@ #define CFG_FWOL_DHCP #endif +/* + * + * gEnableLPRx - Enable/Disable LPRx + * @Min: 0 + * @Max: 1 + * @Default: 1 + * + * This ini Enables or disables the LPRx in FW + * + * Usage: External + * + * + */ + +#define CFG_LPRX CFG_INI_BOOL( \ + "gEnableLPRx", \ + 1, \ + "LPRx control") + +#ifdef WLAN_FEATURE_SAE +/* + * + * sae_enabled - Enable/Disable SAE support in driver + * @Min: 0 + * @Max: 1 + * @Default: 1 + * + * This ini is used to enable/disable SAE support in driver + * Driver will update config to supplicant based on this config. + * + * Related: None + * + * Supported Feature: SAE + * Usage: External + * + * + */ + +#define CFG_IS_SAE_ENABLED CFG_INI_BOOL( \ + "sae_enabled", \ + 1, \ + "SAE feature control") +#define __CFG_IS_SAE_ENABLED CFG(CFG_IS_SAE_ENABLED) +#else +#define __CFG_IS_SAE_ENABLED +#endif + +/* + * + * gcmp_enabled - ini to enable/disable GCMP + * @Min: 0 + * @Max: 1 + * @Default: 1 + * + * Currently Firmware update the sequence number for each TID with 2^3 + * because of security issues. But with this PN mechanism, throughput drop + * is observed. With this ini FW takes the decision to trade off between + * security and throughput + * + * Supported Feature: STA/SAP/P2P + * + * Usage: External + * + * + */ + +#define CFG_ENABLE_GCMP CFG_INI_BOOL( \ + "gcmp_enabled", \ + 1, \ + "GCMP Feature control param") + +/* + * + * gTxSchDelay - Enable/Disable Tx sch delay + * @Min: 0 + * @Max: 5 + * @Default: 0 + * + * Usage: Internal/External + * + * + */ +#define CFG_TX_SCH_DELAY CFG_INI_UINT( \ + "gTxSchDelay", \ + 0, \ + 5, \ + 0, \ + CFG_VALUE_OR_DEFAULT, \ + "Enable/Disable Tx sch delay") + +/* + * + * gEnableSecondaryRate - Enable/Disable Secondary Retry Rate feature subset + * + * @Min: 0x0 + * @Max: 0x3F + * @Default: 0x17 + * + * It is a 32 bit value such that the various bits represent as below - + * Bit-0 : is Enable/Disable Control for "PPDU Secondary Retry Support" + * Bit-1 : is Enable/Disable Control for "RTS Black/White-listing Support" + * Bit-2 : is Enable/Disable Control for "Higher MCS retry restriction + * on XRETRY failures" + * Bit 3-5 : is "Xretry threshold" to use + * Bit 3~31 : reserved for future use. + * + * Usage: External + * + * + */ +#define CFG_ENABLE_SECONDARY_RATE CFG_INI_UINT( \ + "gEnableSecondaryRate", \ + 0, \ + 0x3f, \ + 0x17, \ + CFG_VALUE_OR_DEFAULT, \ + "Secondary Retry Rate feature subset control") + #define CFG_FWOL_GENERIC_ALL \ CFG_FWOL_DHCP \ CFG(CFG_ENABLE_ANI) \ @@ -499,6 +652,12 @@ CFG(CFG_ENABLE_FW_LOG_TYPE) \ CFG(CFG_ENABLE_FW_MODULE_LOG_LEVEL) \ CFG(CFG_RA_FILTER_ENABLE) \ - CFG(CFG_SET_TSF_GPIO_PIN) + CFG(CFG_SET_TSF_GPIO_PIN) \ + __CFG_SET_TSF_PTP_OPT \ + CFG(CFG_LPRX) \ + __CFG_IS_SAE_ENABLED \ + CFG(CFG_ENABLE_GCMP) \ + CFG(CFG_TX_SCH_DELAY) \ + CFG(CFG_ENABLE_SECONDARY_RATE) #endif diff --git a/fw_offload/dispatcher/inc/wlan_fwol_ucfg_api.h b/fw_offload/dispatcher/inc/wlan_fwol_ucfg_api.h index 8611f351ed..b1cb52a942 100644 --- a/fw_offload/dispatcher/inc/wlan_fwol_ucfg_api.h +++ b/fw_offload/dispatcher/inc/wlan_fwol_ucfg_api.h @@ -323,6 +323,64 @@ ucfg_fwol_get_enable_dhcp_server_offload(struct wlan_objmgr_psoc *psoc, */ QDF_STATUS ucfg_fwol_get_dhcp_max_num_clients(struct wlan_objmgr_psoc *psoc, uint32_t *dhcp_max_num_clients); - #endif + +/** + * ucfg_fwol_get_tsf_ptp_options() - Get TSF Plus feature options + * @psoc: pointer to the psoc object + * @tsf_ptp_options: Pointer to return tsf ptp options + * + * Return: QDF Status + */ +QDF_STATUS ucfg_fwol_get_tsf_ptp_options(struct wlan_objmgr_psoc *psoc, + uint32_t *tsf_ptp_options); +/** + * ucfg_fwol_get_lprx_enable() - Get LPRx feature enable status + * @psoc: pointer to the psoc object + * @lprx_enable: Pointer to return LPRX feature enable status + * + * Return: QDF Status + */ +QDF_STATUS ucfg_fwol_get_lprx_enable(struct wlan_objmgr_psoc *psoc, + bool *lprx_enable); + +/** + * ucfg_fwol_get_sae_enable() - Get SAE feature enable status + * @psoc: pointer to the psoc object + * @sae_enable: Pointer to return SAE feature enable status + * + * Return: QDF Status + */ +QDF_STATUS ucfg_fwol_get_sae_enable(struct wlan_objmgr_psoc *psoc, + bool *sae_enable); + +/** + * ucfg_fwol_get_gcmp_enable() - Get GCMP feature enable status + * @psoc: pointer to the psoc object + * @gcmp_enable: Pointer to return GCMP feature enable status + * + * Return: QDF Status + */ +QDF_STATUS ucfg_fwol_get_gcmp_enable(struct wlan_objmgr_psoc *psoc, + bool *gcmp_enable); + +/** + * ucfg_fwol_get_enable_tx_sch_delay() - Get enable tx sch delay + * @psoc: pointer to the psoc object + * @enable_tx_sch_delay: Pointer to return enable_tx_sch_delay value + * + * Return: QDF Status + */ +QDF_STATUS ucfg_fwol_get_enable_tx_sch_delay(struct wlan_objmgr_psoc *psoc, + uint8_t *enable_tx_sch_delay); + +/** + * ucfg_fwol_get_enable_secondary_rate() - Get enable secondary rate + * @psoc: pointer to the psoc object + * @enable_tx_sch_delay: Pointer to return enable secondary rate value + * + * Return: QDF Status + */ +QDF_STATUS ucfg_fwol_get_enable_secondary_rate(struct wlan_objmgr_psoc *psoc, + uint32_t *enable_secondary_rate); #endif /* _WLAN_FWOL_UCFG_API_H_ */ diff --git a/fw_offload/dispatcher/src/wlan_fwol_ucfg_api.c b/fw_offload/dispatcher/src/wlan_fwol_ucfg_api.c index 64f557fdc4..42ff11357f 100644 --- a/fw_offload/dispatcher/src/wlan_fwol_ucfg_api.c +++ b/fw_offload/dispatcher/src/wlan_fwol_ucfg_api.c @@ -540,14 +540,120 @@ QDF_STATUS ucfg_fwol_get_tsf_gpio_pin(struct wlan_objmgr_psoc *psoc, *tsf_gpio_pin = fwol_obj->cfg.tsf_gpio_pin; return QDF_STATUS_SUCCESS; } + +#ifdef WLAN_FEATURE_TSF_PLUS +QDF_STATUS ucfg_fwol_get_tsf_ptp_options(struct wlan_objmgr_psoc *psoc, + uint32_t *tsf_ptp_options) +{ + struct wlan_fwol_psoc_obj *fwol_obj; + + fwol_obj = fwol_get_psoc_obj(psoc); + if (!fwol_obj) { + fwol_err("Failed to get FWOL obj"); + return QDF_STATUS_E_FAILURE; + } + + *tsf_ptp_options = fwol_obj->cfg.tsf_ptp_options; + return QDF_STATUS_SUCCESS; +} +#endif #else QDF_STATUS ucfg_fwol_get_tsf_gpio_pin(struct wlan_objmgr_psoc *psoc, uint32_t *tsf_gpio_pin) { return QDF_STATUS_SUCCESS; } + +QDF_STATUS ucfg_fwol_get_tsf_ptp_options(struct wlan_objmgr_psoc *psoc, + uint32_t *tsf_ptp_options) +{ + return QDF_STATUS_E_NOSUPPORT; +} #endif +QDF_STATUS ucfg_fwol_get_lprx_enable(struct wlan_objmgr_psoc *psoc, + bool *lprx_enable) +{ + struct wlan_fwol_psoc_obj *fwol_obj; + + fwol_obj = fwol_get_psoc_obj(psoc); + if (!fwol_obj) { + fwol_err("Failed to get FWOL obj"); + return QDF_STATUS_E_FAILURE; + } + + *lprx_enable = fwol_obj->cfg.lprx_enable; + return QDF_STATUS_SUCCESS; +} + +#ifdef WLAN_FEATURE_SAE +QDF_STATUS ucfg_fwol_get_sae_enable(struct wlan_objmgr_psoc *psoc, + bool *sae_enable) +{ + struct wlan_fwol_psoc_obj *fwol_obj; + + fwol_obj = fwol_get_psoc_obj(psoc); + if (!fwol_obj) { + fwol_err("Failed to get FWOL obj"); + return QDF_STATUS_E_FAILURE; + } + + *sae_enable = fwol_obj->cfg.sae_enable; + return QDF_STATUS_SUCCESS; +} +#else +QDF_STATUS ucfg_fwol_get_sae_enable(struct wlan_objmgr_psoc *psoc, + bool *sae_enable) +{ + return QDF_STATUS_E_NOSUPPORT; +} +#endif + +QDF_STATUS ucfg_fwol_get_gcmp_enable(struct wlan_objmgr_psoc *psoc, + bool *gcmp_enable) +{ + struct wlan_fwol_psoc_obj *fwol_obj; + + fwol_obj = fwol_get_psoc_obj(psoc); + if (!fwol_obj) { + fwol_err("Failed to get FWOL obj"); + return QDF_STATUS_E_FAILURE; + } + + *gcmp_enable = fwol_obj->cfg.gcmp_enable; + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS ucfg_fwol_get_enable_tx_sch_delay(struct wlan_objmgr_psoc *psoc, + uint8_t *enable_tx_sch_delay) +{ + struct wlan_fwol_psoc_obj *fwol_obj; + + fwol_obj = fwol_get_psoc_obj(psoc); + if (!fwol_obj) { + fwol_err("Failed to get FWOL obj"); + return QDF_STATUS_E_FAILURE; + } + + *enable_tx_sch_delay = fwol_obj->cfg.enable_tx_sch_delay; + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS ucfg_fwol_get_enable_secondary_rate(struct wlan_objmgr_psoc *psoc, + uint32_t *enable_secondary_rate) +{ + struct wlan_fwol_psoc_obj *fwol_obj; + + fwol_obj = fwol_get_psoc_obj(psoc); + if (!fwol_obj) { + fwol_err("Failed to get FWOL obj"); + return QDF_STATUS_E_FAILURE; + } + + *enable_secondary_rate = fwol_obj->cfg.enable_secondary_rate; + return QDF_STATUS_SUCCESS; +} + #ifdef DHCP_SERVER_OFFLOAD QDF_STATUS ucfg_fwol_get_enable_dhcp_server_offload(struct wlan_objmgr_psoc *psoc,