Skip to content

Commit be295a7

Browse files
kapbhcarlescufi
authored andcommitted
drivers: nrfwifi: Get RTS threshold
Add api support to get RTS threshold. Signed-off-by: Kapil Bhatt <[email protected]>
1 parent 6c6f5be commit be295a7

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

drivers/wifi/nrfwifi/inc/fmac_main.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ struct nrf_wifi_vif_ctx_zep {
8383
#ifdef CONFIG_NRF_WIFI_RPU_RECOVERY
8484
struct k_work nrf_wifi_rpu_recovery_work;
8585
#endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */
86+
int rts_threshold_value;
8687
};
8788

8889
struct nrf_wifi_vif_ctx_map {

drivers/wifi/nrfwifi/inc/wifi_mgmt.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,7 @@ int nrf_wifi_filter(const struct device *dev,
7272

7373
int nrf_wifi_set_rts_threshold(const struct device *dev,
7474
unsigned int rts_threshold);
75+
76+
int nrf_wifi_get_rts_threshold(const struct device *dev,
77+
unsigned int *rts_threshold);
7578
#endif /* __ZEPHYR_WIFI_MGMT_H__ */

drivers/wifi/nrfwifi/src/fmac_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,7 @@ static struct wifi_mgmt_ops nrf_wifi_mgmt_ops = {
840840
.reg_domain = nrf_wifi_reg_domain,
841841
.get_power_save_config = nrf_wifi_get_power_save_config,
842842
.set_rts_threshold = nrf_wifi_set_rts_threshold,
843+
.get_rts_threshold = nrf_wifi_get_rts_threshold,
843844
#endif /* CONFIG_NRF70_STA_MODE */
844845
#ifdef CONFIG_NRF70_SYSTEM_WITH_RAW_MODES
845846
.mode = nrf_wifi_mode,

drivers/wifi/nrfwifi/src/wifi_mgmt.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,9 +1007,34 @@ int nrf_wifi_set_rts_threshold(const struct device *dev,
10071007
goto out;
10081008
}
10091009

1010+
vif_ctx_zep->rts_threshold_value = (int)rts_threshold;
1011+
10101012
ret = 0;
10111013
out:
10121014
k_mutex_unlock(&vif_ctx_zep->vif_lock);
10131015

10141016
return ret;
10151017
}
1018+
1019+
int nrf_wifi_get_rts_threshold(const struct device *dev,
1020+
unsigned int *rts_threshold)
1021+
{
1022+
struct nrf_wifi_vif_ctx_zep *vif_ctx_zep = NULL;
1023+
int ret = -1;
1024+
1025+
if (!dev) {
1026+
LOG_ERR("%s: dev is NULL", __func__);
1027+
return ret;
1028+
}
1029+
1030+
vif_ctx_zep = dev->data;
1031+
if (!vif_ctx_zep) {
1032+
LOG_ERR("%s: vif_ctx_zep is NULL", __func__);
1033+
return ret;
1034+
}
1035+
1036+
*rts_threshold = vif_ctx_zep->rts_threshold_value;
1037+
ret = 0;
1038+
1039+
return ret;
1040+
}

0 commit comments

Comments
 (0)