Skip to content

Commit

Permalink
drivers: wifi: nxp: add set RTS threshold command support
Browse files Browse the repository at this point in the history
Add set RTS threshold command support for sta and sap in nxp driver.

Signed-off-by: Qingling Wu <[email protected]>
  • Loading branch information
Qingling-Wu authored and kartben committed Dec 18, 2024
1 parent d22026c commit dbc6a50
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/wifi/nxp/Kconfig.nxp
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,12 @@ config NXP_WIFI_11R
help
This option enables the use of 802.11r support.

config NXP_WIFI_RTS_THRESHOLD
bool "Set RTS Threshold Support"
default y
help
This option enables the set of rts threshold support.

config NXP_WIFI_INACTIVITY_TIMEOUT_EXT
bool "Inactivity Timeout Ext Support"
default y
Expand Down
32 changes: 32 additions & 0 deletions drivers/wifi/nxp/nxp_wifi_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1534,6 +1534,36 @@ static int nxp_wifi_set_btwt(const struct device *dev, struct wifi_twt_params *p
}
#endif

static int nxp_wifi_set_rts_threshold(const struct device *dev, unsigned int rts_threshold)
{
int ret = -1;

#if CONFIG_NXP_WIFI_RTS_THRESHOLD
if (rts_threshold == -1) {
rts_threshold = MLAN_RTS_MAX_VALUE;
}

ret = wlan_set_rts(rts_threshold);
#endif

return ret;
}

static int nxp_wifi_ap_set_rts_threshold(const struct device *dev, unsigned int rts_threshold)
{
int ret = -1;

#if CONFIG_NXP_WIFI_RTS_THRESHOLD
if (rts_threshold == -1) {
rts_threshold = MLAN_RTS_MAX_VALUE;
}

ret = wlan_set_uap_rts(rts_threshold);
#endif

return ret;
}

static void nxp_wifi_sta_init(struct net_if *iface)
{
const struct device *dev = net_if_get_device(iface);
Expand Down Expand Up @@ -1836,6 +1866,7 @@ static const struct wifi_mgmt_ops nxp_wifi_sta_mgmt = {
#ifdef CONFIG_NXP_WIFI_11AX_TWT
.set_twt = nxp_wifi_set_twt,
#endif
.set_rts_threshold = nxp_wifi_set_rts_threshold,
};

#if defined(CONFIG_WIFI_NM) && !defined(CONFIG_WIFI_NM_WPA_SUPPLICANT)
Expand Down Expand Up @@ -1914,6 +1945,7 @@ static const struct wifi_mgmt_ops nxp_wifi_uap_mgmt = {
#ifdef CONFIG_NXP_WIFI_11AX_TWT
.set_btwt = nxp_wifi_set_btwt,
#endif
.set_rts_threshold = nxp_wifi_ap_set_rts_threshold,
};

#if defined(CONFIG_WIFI_NM) && !defined(CONFIG_WIFI_NM_HOSTAPD_AP)
Expand Down

0 comments on commit dbc6a50

Please sign in to comment.