Skip to content

Commit 70be6ad

Browse files
kapbhcarlescufi
authored andcommitted
hostap: Add rts threshold set api support
Add api to set rts threshold. Signed-off-by: Kapil Bhatt <[email protected]>
1 parent 8c3790d commit 70be6ad

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
@@ -1137,6 +1137,18 @@ int supplicant_channel(const struct device *dev, struct wifi_channel_info *chann
11371137
return wifi_mgmt_api->channel(dev, channel);
11381138
}
11391139

1140+
int supplicant_set_rts_threshold(const struct device *dev, unsigned int rts_threshold)
1141+
{
1142+
const struct wifi_mgmt_ops *const wifi_mgmt_api = get_wifi_mgmt_api(dev);
1143+
1144+
if (!wifi_mgmt_api || !wifi_mgmt_api->set_rts_threshold) {
1145+
wpa_printf(MSG_ERROR, "Set RTS not supported");
1146+
return -ENOTSUP;
1147+
}
1148+
1149+
return wifi_mgmt_api->set_rts_threshold(dev, rts_threshold);
1150+
}
1151+
11401152
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_WNM
11411153
int supplicant_btm_query(const struct device *dev, uint8_t reason)
11421154
{

modules/hostap/src/supp_api.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,15 @@ int supplicant_filter(const struct device *dev, struct wifi_filter_info *filter)
168168
*/
169169
int supplicant_channel(const struct device *dev, struct wifi_channel_info *channel);
170170

171+
/**
172+
* @brief Set Wi-Fi RTS threshold
173+
*
174+
* @param dev Wi-Fi interface handle to use
175+
* @param rts_threshold RTS threshold to set
176+
* @return 0 for OK; -1 for ERROR
177+
*/
178+
int supplicant_set_rts_threshold(const struct device *dev, unsigned int rts_threshold);
179+
171180
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_WNM
172181
/** Send bss transition query
173182
*

modules/hostap/src/supp_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ static const struct wifi_mgmt_ops mgmt_ops = {
6868
.mode = supplicant_mode,
6969
.filter = supplicant_filter,
7070
.channel = supplicant_channel,
71+
.set_rts_threshold = supplicant_set_rts_threshold,
7172
#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_WNM
7273
.btm_query = supplicant_btm_query,
7374
#endif

0 commit comments

Comments
 (0)