Morse Micro IoT SDK  2.9.7

Detailed Description

Note
It is highly recommended to refer to Morse Micro App Note 04 on WNM sleep for a more detailed explanation on how this feature works.

WNM sleep is an extended power save mode in which the STA need not listen for every DTIM beacon and need not perform rekey, allowing the STA to remain associated and reduce power consumption when it has no traffic to send or receive from the AP. While a STA is in WNM sleep it will be unable to communicate with the AP, and thus any traffic for the STA may be buffered or dropped at the discretion of the AP while the STA is in WNM sleep.

Note
WNM sleep can only be entered after the STA is associated to the AP. The AP must also support WNM sleep.

When entry to WNM sleep is enabled via this API, the STA sends a request to the AP and after successful negotiation, the chip is either put into a lower power mode or powered down completely, depending on arguments given when WNM sleep mode was enabled. The datapath is paused during this time. If the STA does not successfully negotiate with the AP to enter WNM Sleep, it will return an error code and the chip will not enter a low power mode.

When WNM sleep is disabled, the chip returns to normal operation and sends a request to the AP to exit WNM sleep. Note that the chip will exit low power mode regardless of whether or not the exit request was successful. WNM sleep will be exited if mmwlan_shutdown or mmwlan_sta_disable is invoked.

If the AP takes down the link, then the station will be unaware until it sends the WNM Sleep exit request. At that point the AP will send a de-authentication frame with reason code "non-associated station". After validating this is actually the AP the station was connected to, the station will bring down the connection and return MMWLAN_ERROR. The station will attempt to re-associate but will not re-enter WNM sleep. The application needs to enable WNM sleep again via this API if required.

A high level overview of enabling and disabling WNM sleep is shown below.

Data Structures

struct  mmwlan_set_wnm_sleep_enabled_args
 Structure for storing WNM sleep extended arguments. More...
 

Macros

#define MMWLAN_SET_WNM_SLEEP_ENABLED_ARGS_INIT   { false, false }
 Initializer for mmwlan_set_wnm_sleep_enabled_args. More...
 

Functions

enum mmwlan_status mmwlan_set_wnm_sleep_enabled_ext (const struct mmwlan_set_wnm_sleep_enabled_args *args)
 Sets extended WNM sleep mode. More...
 
static enum mmwlan_status mmwlan_set_wnm_sleep_enabled (bool wnm_sleep_enabled)
 Sets whether WNM sleep mode is enabled. More...
 

Macro Definition Documentation

◆ MMWLAN_SET_WNM_SLEEP_ENABLED_ARGS_INIT

#define MMWLAN_SET_WNM_SLEEP_ENABLED_ARGS_INIT   { false, false }

Initializer for mmwlan_set_wnm_sleep_enabled_args.

For example:

#define MMWLAN_SET_WNM_SLEEP_ENABLED_ARGS_INIT
Initializer for mmwlan_set_wnm_sleep_enabled_args.
Definition: mmwlan.h:2062
Structure for storing WNM sleep extended arguments.
Definition: mmwlan.h:2046

Definition at line 2062 of file mmwlan.h.

Function Documentation

◆ mmwlan_set_wnm_sleep_enabled()

static enum mmwlan_status mmwlan_set_wnm_sleep_enabled ( bool  wnm_sleep_enabled)
inlinestatic

Sets whether WNM sleep mode is enabled.

If WNM sleep mode is enabled then the transceiver will sleep across multiple DTIM periods until WNM sleep mode is disabled. This allows the transceiver to use less power with the caveat that it will not wake up for group- or individually-addressed traffic. If a group rekey occurs while the device is in WNM sleep it will be applied when the device exits WNM sleep.

Note
Data should not be queued for transmission (using, e.g., mmwlan_tx()) during WNM sleep.
802.11 power save must be enabled for any benefit to be obtained (see mmwlan_set_power_save_mode()).
Negotiation with the AP is required to enter WNM sleep. As such the transceiver will only be placed into low power mode when a connection has been establish and the AP has accepted the request to enter WNM sleep. This will automatically be handled within mmwlan once WNM sleep mode is enabled.
Parameters
wnm_sleep_enabledBoolean indicating whether WNM sleep is enabled.
Returns
MMWLAN_SUCCESS on success, MMWLAN_UNAVAILABLE if already requested or if not currently connected, else an appropriate error code. MMWLAN_TIMED_OUT if the maximum retry request reached. For WNM sleep exit request, this means that the device exited WNM sleep but failed to inform the AP.

Definition at line 2118 of file mmwlan.h.

◆ mmwlan_set_wnm_sleep_enabled_ext()

enum mmwlan_status mmwlan_set_wnm_sleep_enabled_ext ( const struct mmwlan_set_wnm_sleep_enabled_args args)

Sets extended WNM sleep mode.

Provides an extended interface for setting WNM sleep. See mmwlan_set_wnm_sleep_enabled_args for parameter details. If WNM sleep mode is enabled then the transceiver will sleep across multiple DTIM periods until WNM sleep mode is disabled. This allows the transceiver to use less power with the caveat that it will not wake up for group- or individually-addressed traffic. If a group rekey occurs while the device is in WNM sleep it will be applied when the device exits WNM sleep.

Note
Data should not be queued for transmission (using, e.g., mmwlan_tx()) during WNM sleep.
802.11 power save must be enabled for any benefit to be obtained (see mmwlan_set_power_save_mode()).
Negotiation with the AP is required to enter WNM sleep. As such the transceiver will only be placed into low power mode when a connection has been establish and the AP has accepted the request to enter WNM sleep. This will automatically be handled within mmwlan once WNM sleep mode is enabled.
Parameters
argsWNM sleep arguments - see mmwlan_set_wnm_sleep_enabled_args.
Returns
MMWLAN_SUCCESS on success, MMWLAN_UNAVAILABLE if already requested or if not currently connected, else an appropriate error code. MMWLAN_TIMED_OUT if the maximum retry request reached. For WNM sleep exit request, this means that the device exited WNM sleep but failed to inform the AP.