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.

(cherry picked from commit dbc6a50)

Original-Signed-off-by: Qingling Wu <qingling.wu@nxp.com>
GitOrigin-RevId: dbc6a50
Cr-Build-Id: 8728219973957200769
Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8728219973957200769
Copybot-Job-Name: zephyr-main-copybot-downstream
Change-Id: I2945c3a164c61f0eedfccb2f0ad938ae41c7a80f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/6104908
Tested-by: Dawid Niedźwiecki <dawidn@google.com>
Commit-Queue: Jonathon Murphy <jpmurphy@google.com>
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
Reviewed-by: Dawid Niedźwiecki <dawidn@google.com>
  • Loading branch information
Qingling Wu authored and Chromeos LUCI committed Dec 20, 2024
1 parent 626baa6 commit c766274
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 c766274

Please sign in to comment.