linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/13] wcn36xx: Enable downstream consistent Wake on Lan
@ 2020-12-28 16:28 Bryan O'Donoghue
  2020-12-28 16:28 ` [PATCH 01/13] wcn36xx: Return result of set_power_params in suspend Bryan O'Donoghue
                   ` (12 more replies)
  0 siblings, 13 replies; 35+ messages in thread
From: Bryan O'Donoghue @ 2020-12-28 16:28 UTC (permalink / raw)
  To: kvalo, wcn36xx, linux-wireless
  Cc: bryan.odonoghue, shawn.guo, benl, loic.poulain

This series enables Wake on WLAN for the wcn36xx. Downstream implements two
competing methods for WoWLAN, only one of which is used in practice.

1. The downstream prima driver and firmware have a dedicated wowlan SMD
   command set, however for whatever reason, the downstream driver doesn't
   actually use that code path for suspend/resume.
   Similarly the downstream kernel will mask out the SMD interrupt when
   entering into suspend, so its clear the firmware assisted wowlan command
   is not used at all.
   In short, the code is implemented but not used.

2. The alternative version of wake on wlan implemented downstream does
   A. An RXP filter
   B. Frimware ipv4 ARP offload
   C. Frimware ipv6 namesapece offload
   D. GTK replay counter save/update on suspend/resume

This patchset replicates method #2 since it is the only method that
actually works. When replicating the functionality from downstream to
upsteam I found the RXP filter step to be redundant, so I skipped that.

Verified on Android/4.19 with qcom out-of-tree low-power patch on wcn3680.
Verified on Debian/kvalo/master on wcn3680 and wcn3620.

The Debian/upstream test doesn't include the low-power patches from qcom so
the time it takes the system to wake up when pinged is longer.

Test method:

1. Enable magic packet wakeup on target
   iw phy0 wowlan enable magic-packet
   iw phy0 wowlan show

2. Flush arp tables on host
   sudo ip -s -s neigh flush all
   sudo ip -6 -s -s neigh flush all

3. Suspend device
   echo 1 > /sys/kernel/debug/clk/debug_suspend
   echo mem > /sys/power/state ; cat /sys/kernel/debug/rpm_stats
   echo 0 > /sys/module/wcn36xx/parameters/debug_mask
   dmesg

4. Ping either ipv4 or ipv6
   ping 192.168.0.85
   ping -6 fe80::6455:44ff:fe33:2211%wlo1

In both cases using Wireshark we see the target system receive an ARP or
NS6 lookup and respond, followed by the host sending a ping or ping6 and
the target system coming out of suspend.

Similarly watching GTK keying on the AP when the device is in suspend, we
see the firmware successfully rekey and when we resume, the host picking up
the rekey material with persistence of the WiFi link during suspend/resume.

commit: 5336fad96e8f ("wcn36xx: Enable firmware offloaded keepalive")
ensures that the link is kept alive in suspend, this additional set gives
the ability to 

- Resolve ARP/NS6 lookups without waking the system
- Rekeying in suspend
- Suspending and resuming based on received datagram

https://git.linaro.org/people/bryan.odonoghue/kernel.git/log/?h=ath.master-wcn36xx-fw-offload-suspend-resume

Bryan O'Donoghue (13):
  wcn36xx: Return result of set_power_params in suspend
  wcn36xx: Run suspend for the first ieee80211_vif
  wcn36xx: Add ipv4 ARP offload support in suspend
  wcn36xx: Do not flush indication queue on suspend/resume
  wcn36xx: Add ipv6 address tracking
  wcn36xx: Add ipv6 namespace offload in suspend
  wcn36xx: Flag WIPHY_WOWLAN_MAGIC_PKT
  wcn36xx: Add set_rekey_data callback
  wcn36xx: Add GTK offload to WoWLAN path
  wcn36xx: Add GTK offload info to WoWLAN resume
  wcn36xx: Do not suspend if scan in progress
  wcn36xx: Add Host suspend indication support
  wcn36xx: Add host resume request support

 drivers/net/wireless/ath/wcn36xx/hal.h     |  20 +-
 drivers/net/wireless/ath/wcn36xx/main.c    | 123 +++++++++-
 drivers/net/wireless/ath/wcn36xx/smd.c     | 271 +++++++++++++++++++++
 drivers/net/wireless/ath/wcn36xx/smd.h     |  19 ++
 drivers/net/wireless/ath/wcn36xx/wcn36xx.h |  15 ++
 5 files changed, 434 insertions(+), 14 deletions(-)

-- 
2.29.2


^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2021-01-13  7:13 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-28 16:28 [PATCH 00/13] wcn36xx: Enable downstream consistent Wake on Lan Bryan O'Donoghue
2020-12-28 16:28 ` [PATCH 01/13] wcn36xx: Return result of set_power_params in suspend Bryan O'Donoghue
2020-12-28 16:28 ` [PATCH 02/13] wcn36xx: Run suspend for the first ieee80211_vif Bryan O'Donoghue
2020-12-28 20:48   ` kernel test robot
2020-12-28 16:28 ` [PATCH 03/13] wcn36xx: Add ipv4 ARP offload support in suspend Bryan O'Donoghue
2021-01-11 11:18   ` Kalle Valo
2020-12-28 16:28 ` [PATCH 04/13] wcn36xx: Do not flush indication queue on suspend/resume Bryan O'Donoghue
2020-12-28 16:28 ` [PATCH 05/13] wcn36xx: Add ipv6 address tracking Bryan O'Donoghue
2020-12-28 22:44   ` kernel test robot
2020-12-28 16:28 ` [PATCH 06/13] wcn36xx: Add ipv6 namespace offload in suspend Bryan O'Donoghue
2020-12-28 21:49   ` kernel test robot
2020-12-29  2:15     ` Bryan O'Donoghue
2021-01-11 11:27       ` Kalle Valo
2021-01-12 10:51         ` [kbuild-all] " Chen, Rong A
2021-01-12 11:18           ` Kalle Valo
2021-01-13  1:57             ` Rong Chen
2021-01-13  7:11               ` Kalle Valo
2020-12-28 16:28 ` [PATCH 07/13] wcn36xx: Flag WIPHY_WOWLAN_MAGIC_PKT Bryan O'Donoghue
2021-01-11 11:38   ` Kalle Valo
2021-01-11 11:49     ` Bryan O'Donoghue
2020-12-28 16:28 ` [PATCH 08/13] wcn36xx: Add set_rekey_data callback Bryan O'Donoghue
2020-12-28 16:28 ` [PATCH 09/13] wcn36xx: Add GTK offload to WoWLAN path Bryan O'Donoghue
2020-12-28 16:28 ` [PATCH 10/13] wcn36xx: Add GTK offload info to WoWLAN resume Bryan O'Donoghue
2021-01-11 11:28   ` Kalle Valo
2021-01-11 11:47     ` Bryan O'Donoghue
2021-01-11 11:39   ` Kalle Valo
2020-12-28 16:28 ` [PATCH 11/13] wcn36xx: Do not suspend if scan in progress Bryan O'Donoghue
2020-12-28 21:47   ` Benjamin Li
2021-01-11 11:31   ` Kalle Valo
2021-01-11 11:46     ` Bryan O'Donoghue
2021-01-11 12:26       ` Kalle Valo
2021-01-11 12:40         ` Bryan O'Donoghue
2021-01-11 11:34   ` Kalle Valo
2020-12-28 16:28 ` [PATCH 12/13] wcn36xx: Add Host suspend indication support Bryan O'Donoghue
2020-12-28 16:28 ` [PATCH 13/13] wcn36xx: Add host resume request support Bryan O'Donoghue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).