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:
parent
6c6f5beee7
commit
be295a7f02
@ -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 {
|
||||
|
||||
@ -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__ */
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user