drivers: nrfwifi: Get RTS threshold

Add api support to get RTS threshold.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
This commit is contained in:
Kapil Bhatt 2024-09-11 14:32:39 +05:30 committed by Carles Cufí
parent 6c6f5beee7
commit be295a7f02
4 changed files with 30 additions and 0 deletions

View File

@ -83,6 +83,7 @@ struct nrf_wifi_vif_ctx_zep {
#ifdef CONFIG_NRF_WIFI_RPU_RECOVERY
struct k_work nrf_wifi_rpu_recovery_work;
#endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */
int rts_threshold_value;
};
struct nrf_wifi_vif_ctx_map {

View File

@ -72,4 +72,7 @@ int nrf_wifi_filter(const struct device *dev,
int nrf_wifi_set_rts_threshold(const struct device *dev,
unsigned int rts_threshold);
int nrf_wifi_get_rts_threshold(const struct device *dev,
unsigned int *rts_threshold);
#endif /* __ZEPHYR_WIFI_MGMT_H__ */

View File

@ -840,6 +840,7 @@ static struct wifi_mgmt_ops nrf_wifi_mgmt_ops = {
.reg_domain = nrf_wifi_reg_domain,
.get_power_save_config = nrf_wifi_get_power_save_config,
.set_rts_threshold = nrf_wifi_set_rts_threshold,
.get_rts_threshold = nrf_wifi_get_rts_threshold,
#endif /* CONFIG_NRF70_STA_MODE */
#ifdef CONFIG_NRF70_SYSTEM_WITH_RAW_MODES
.mode = nrf_wifi_mode,

View File

@ -1007,9 +1007,34 @@ int nrf_wifi_set_rts_threshold(const struct device *dev,
goto out;
}
vif_ctx_zep->rts_threshold_value = (int)rts_threshold;
ret = 0;
out:
k_mutex_unlock(&vif_ctx_zep->vif_lock);
return ret;
}
int nrf_wifi_get_rts_threshold(const struct device *dev,
unsigned int *rts_threshold)
{
struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL;
int ret = -1;
if (!dev) {
LOG_ERR("%s: dev is NULL", __func__);
return ret;
}
vif_ctx_zep = dev->data;
if (!vif_ctx_zep) {
LOG_ERR("%s: vif_ctx_zep is NULL", __func__);
return ret;
}
*rts_threshold = vif_ctx_zep->rts_threshold_value;
ret = 0;
return ret;
}