drivers: wifi: nxp: Host sleep handshake enhancement
To reduce low power current value, added host sleep handshake enhancement. If CPU3 is wokenup by WLAN, do host sleep handshake with CPU1 as before. For other wakeup sources, skip host sleep handshake. Signed-off-by: Hui Bai <hui.bai@nxp.com>
This commit is contained in:
parent
bf86f1f1c0
commit
4868c8acae
1 changed files with 24 additions and 5 deletions
|
@ -76,6 +76,8 @@ extern const rtos_wpa_supp_dev_ops wpa_supp_ops;
|
|||
#if defined(CONFIG_PM_DEVICE) && defined(CONFIG_NXP_RW610)
|
||||
extern int is_hs_handshake_done;
|
||||
extern int wlan_host_sleep_state;
|
||||
extern bool skip_hs_handshake;
|
||||
extern void wlan_hs_hanshake_cfg(bool skip);
|
||||
#endif
|
||||
|
||||
static int nxp_wifi_recv(struct net_if *iface, struct net_pkt *pkt);
|
||||
|
@ -2102,16 +2104,33 @@ static int device_wlan_pm_action(const struct device *dev, enum pm_device_action
|
|||
* User can use this time to issue other commands.
|
||||
*/
|
||||
if (is_hs_handshake_done == WLAN_HOSTSLEEP_SUCCESS) {
|
||||
ret = wlan_hs_send_event(HOST_SLEEP_EXIT, NULL);
|
||||
if (ret != 0) {
|
||||
return -EFAULT;
|
||||
/* If we are not woken up by WLAN, skip posting host sleep exit event.
|
||||
* And skip host sleep handshake next time we are about to sleep.
|
||||
*/
|
||||
if (POWER_GetWakeupStatus(WL_MCI_WAKEUP0_IRQn)) {
|
||||
ret = wlan_hs_send_event(HOST_SLEEP_EXIT, NULL);
|
||||
if (ret != 0) {
|
||||
return -EFAULT;
|
||||
}
|
||||
wlan_hs_hanshake_cfg(false);
|
||||
} else {
|
||||
wlan_hs_hanshake_cfg(true);
|
||||
}
|
||||
|
||||
device_pm_dump_wakeup_source();
|
||||
/* reset hs hanshake flag after waking up */
|
||||
is_hs_handshake_done = 0;
|
||||
if (wlan_host_sleep_state == HOST_SLEEP_ONESHOT) {
|
||||
wlan_host_sleep_state = HOST_SLEEP_DISABLE;
|
||||
wlan_hs_hanshake_cfg(false);
|
||||
}
|
||||
#ifndef CONFIG_BT
|
||||
if (skip_hs_handshake == true &&
|
||||
is_hs_handshake_done == WLAN_HOSTSLEEP_SUCCESS) {
|
||||
ret = wlan_hs_send_event(HOST_SLEEP_HANDSHAKE_SKIP, NULL);
|
||||
if (ret != 0) {
|
||||
return -EFAULT;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue