Skip to content

Commit 6c6f5be

Browse files
kapbhcarlescufi
authored andcommitted
hostap: Add rts threshold get api support
Add api to get rts threshold. Signed-off-by: Kapil Bhatt <[email protected]>
1 parent d7bef35 commit 6c6f5be

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

modules/hostap/src/supp_api.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,6 +1182,18 @@ int supplicant_set_rts_threshold(const struct device *dev, unsigned int rts_thre
11821182
return wifi_mgmt_api->set_rts_threshold(dev, rts_threshold);
11831183
}
11841184

1185+
int supplicant_get_rts_threshold(const struct device *dev, unsigned int *rts_threshold)
1186+
{
1187+
const struct wifi_mgmt_ops *const wifi_mgmt_api = get_wifi_mgmt_api(dev);
1188+
1189+
if (!wifi_mgmt_api || !wifi_mgmt_api->get_rts_threshold) {
1190+
wpa_printf(MSG_ERROR, "Get RTS not supported");
1191+
return -ENOTSUP;
1192+
}
1193+
1194+
return wifi_mgmt_api->get_rts_threshold(dev, rts_threshold);
1195+
}
1196+
11851197
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_WNM
11861198
int supplicant_btm_query(const struct device *dev, uint8_t reason)
11871199
{

modules/hostap/src/supp_api.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,15 @@ int supplicant_channel(const struct device *dev, struct wifi_channel_info *chann
177177
*/
178178
int supplicant_set_rts_threshold(const struct device *dev, unsigned int rts_threshold);
179179

180+
/**
181+
* @brief Get Wi-Fi RTS threshold
182+
*
183+
* @param dev Wi-Fi interface handle to use
184+
* @param rts_threshold Pointer to the RTS threshold value.
185+
* @return 0 for OK; -1 for ERROR
186+
*/
187+
int supplicant_get_rts_threshold(const struct device *dev, unsigned int *rts_threshold);
188+
180189
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_WNM
181190
/** Send bss transition query
182191
*

modules/hostap/src/supp_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ static const struct wifi_mgmt_ops mgmt_ops = {
6969
.filter = supplicant_filter,
7070
.channel = supplicant_channel,
7171
.set_rts_threshold = supplicant_set_rts_threshold,
72+
.get_rts_threshold = supplicant_get_rts_threshold,
7273
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_WNM
7374
.btm_query = supplicant_btm_query,
7475
#endif

0 commit comments

Comments
 (0)