Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twt sleep status fix #11488

Merged
merged 2 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,9 @@ DTIM-based power save performs better in high throughput applications compared t
As the device sleeps longer and does not wake up to receive DTIM beacons, it misses all multicast or broadcast frames.
The TWT session is expected to be set up by the application after the network level negotiation, after which it is not expected to receive any multicast or broadcast frames.

Additionally, by using the ``NET_EVENT_WIFI_TWT_SLEEP_STATE``, the application layer can subscribe to TWT events
to be notified of beginning and end of service period, so as to be able to send or receive data.

.. _ug_nrf70_developing_powersave_api:

Power Save API
Expand All @@ -365,7 +368,7 @@ The following shell commands and network management APIs are provided for power
:header-rows: 1

* - Network management APIs
- Command
- Wi-Fi shell command
- Description
- Expected output
* - net_mgmt(NET_REQUEST_WIFI_PS)
Expand Down Expand Up @@ -414,6 +417,10 @@ The following shell commands and network management APIs are provided for power
- wifi twt teardown_all
- Tear down all sessions
- TWT operation TWT teardown all flows
* - net_mgmt_event_notify_with_info(NET_EVENT_WIFI_TWT_SLEEP_STATE)
- N/A
- Application can register to this event to be notified about TWT sleep/wake events.
-
ajayparida marked this conversation as resolved.
Show resolved Hide resolved

See the :ref:`wifi_shell_sample` sample for more information.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ Wi-Fi
* Integration of Wi-Fi connectivity with Connection Manager connectivity API.
* The :kconfig:option:`CONFIG_NRF_WIFI_IF_AUTO_START` Kconfig option to enable an application to set/unset AUTO_START on an interface.
This can be done by using the ``NET_IF_NO_AUTO_START`` flag.
* Support for sending TWT sleep/wake events to applications.

Applications
============
Expand Down
4 changes: 4 additions & 0 deletions drivers/wifi/nrf700x/zephyr/src/zephyr_wifi_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -880,13 +880,17 @@ void wifi_nrf_event_proc_twt_sleep_zep(void *vif_ctx,

fmac_dev_ctx->twt_sleep_status = WIFI_NRF_FMAC_TWT_STATE_SLEEP;

wifi_mgmt_raise_twt_sleep_state(vif_ctx_zep->zep_net_if_ctx,
krish2718 marked this conversation as resolved.
Show resolved Hide resolved
WIFI_TWT_STATE_SLEEP);
wifi_nrf_osal_spinlock_rel(fmac_dev_ctx->fpriv->opriv,
fmac_dev_ctx->tx_config.tx_lock);
break;
case TWT_UNBLOCK_TX:
wifi_nrf_osal_spinlock_take(fmac_dev_ctx->fpriv->opriv,
fmac_dev_ctx->tx_config.tx_lock);
fmac_dev_ctx->twt_sleep_status = WIFI_NRF_FMAC_TWT_STATE_AWAKE;
wifi_mgmt_raise_twt_sleep_state(vif_ctx_zep->zep_net_if_ctx,
WIFI_TWT_STATE_AWAKE);
#ifdef CONFIG_NRF700X_DATA_TX
for (ac = WIFI_NRF_FMAC_AC_BE;
ac <= WIFI_NRF_FMAC_AC_MAX; ++ac) {
Expand Down