• Jonas Dreßler's avatar
    mwifiex: Deactive host sleep using HSCFG after it was activated manually · 5943a864
    Jonas Dreßler authored
    When powersaving (so either wifi powersaving or deep sleep, depending on
    which state the firmware is in) is disabled, the way the firmware goes
    into host sleep is different: Usually the firmware implicitely enters
    host sleep on the next SLEEP event we get when we configured host sleep
    via HSCFG before. When powersaving is disabled though, there are no
    SLEEP events, the way we enter host sleep in that case is different: The
    firmware will send us a HS_ACT_REQ event and after that we "manually"
    make the firmware enter host sleep by sending it another HSCFG command
    with the action HS_ACTIVATE.
    
    Now waking up from host sleep appears to be different depending on
    whether powersaving is enabled again: When powersaving is enabled, the
    firmware implicitely leaves host sleep as soon as it wakes up and sends
    us an AWAKE event. When powersaving is disabled though, it apparently
    doesn't implicitely leave host sleep, but instead we need to send it a
    HSCFG command with the HS_CONFIGURE action and the HS_CFG_CANCEL
    condition. We didn't do that so far, which is why waking up from host
    sleep was broken when powersaving is disabled.
    
    So add some additional state to mwifiex_adapter where we keep track of
    whether host sleep was activated manually via HS_ACTIVATE, and if that
    was the case, deactivate it manually again via HS_CFG_CANCEL.
    Signed-off-by: default avatarJonas Dreßler <verdre@v0yd.nl>
    Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211016153244.24353-6-verdre@v0yd.nl
    5943a864
sta_cmd.c 74.8 KB