Skip to content

Instantly share code, notes, and snippets.

@Peetz0r
Last active February 23, 2021 14:01
Show Gist options
  • Save Peetz0r/bf8fd93a60962b4afcf2daeb4305da40 to your computer and use it in GitHub Desktop.
Save Peetz0r/bf8fd93a60962b4afcf2daeb4305da40 to your computer and use it in GitHub Desktop.
#!/bin/bash
# this script lives in /etc/NetworkManager/dispatcher.d/02-wowlan
# it matches incoming packets with destination port 22 (0x0016)
# on ipv4 (the short one) and ipv6 (the long one)
if [[ "$@" == "wlan0 up" ]]; then
iw phy0 wowlan enable any
iwpriv wlan0 wow_set_pattern clean
iwpriv wlan0 wow_set_pattern pattern=-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:00:16
iwpriv wlan0 wow_set_pattern pattern=-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:00:16
fi
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index 441358592072eb97426953ef742866ce227add97..e929d635940bee98f8c263f55b76c1e42e01ba53 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -483,6 +483,7 @@ &mmc1 {
bus-width = <4>;
non-removable;
status = "okay";
+ keep-power-in-suspend;
rtl8723cs: wifi@1 {
reg = <1>;
diff --git a/drivers/staging/rtl8723cs/Makefile b/drivers/staging/rtl8723cs/Makefile
index 60c1c864db42f22105124d1dbde68984e99e75f4..0b60caa83e75733f80fb765e49080ef190763a5e 100644
--- a/drivers/staging/rtl8723cs/Makefile
+++ b/drivers/staging/rtl8723cs/Makefile
@@ -108,9 +108,10 @@ CONFIG_RTW_LOG_LEVEL = 6
CONFIG_PROC_DEBUG = y
######################## Wake On Lan ##########################
-CONFIG_WOWLAN = n
+CONFIG_WOWLAN = y
#bit3: ARP enable, bit2: deauth, bit1: unicast, bit0: magic pkt.
-CONFIG_WAKEUP_TYPE = 0xf
+#enabling unicast causes unwanted wake-ups all the time, so disable
+CONFIG_WAKEUP_TYPE = 0xd
CONFIG_WOW_LPS_MODE = default
#bit0: disBBRF off, #bit1: Wireless remote controller (WRC)
CONFIG_SUSPEND_TYPE = 0
@@ -127,7 +128,7 @@ CONFIG_PNO_SUPPORT = n
CONFIG_PNO_SET_DEBUG = n
CONFIG_AP_WOWLAN = n
######### Notify SDIO Host Keep Power During Syspend ##########
-CONFIG_RTW_SDIO_PM_KEEP_POWER = n
+CONFIG_RTW_SDIO_PM_KEEP_POWER = y
###################### MP HW TX MODE FOR VHT #######################
CONFIG_MP_VHT_HW_TX_MODE = n
###################### ROAMING #####################################
diff --git a/drivers/staging/rtl8723cs/os_dep/linux/sdio_intf.c b/drivers/staging/rtl8723cs/os_dep/linux/sdio_intf.c
index c20c136d111d867b85b6a6c38389d5ef56f75d47..4168e2949748bdb7abdcd797f4776afbbe70ea0e 100644
--- a/drivers/staging/rtl8723cs/os_dep/linux/sdio_intf.c
+++ b/drivers/staging/rtl8723cs/os_dep/linux/sdio_intf.c
@@ -269,9 +269,7 @@ static u8 gpio_hostwakeup_alloc_irq(PADAPTER padapter)
} else
RTW_INFO("allocate gpio irq %d ok\n", oob_irq);
-#ifndef CONFIG_PLATFORM_ARM_SUN8I
enable_irq_wake(oob_irq);
-#endif
return _SUCCESS;
}
@@ -282,9 +280,7 @@ static void gpio_hostwakeup_free_irq(PADAPTER padapter)
if (oob_irq == 0)
return;
-#ifndef CONFIG_PLATFORM_ARM_SUN8I
disable_irq_wake(oob_irq);
-#endif
free_irq(oob_irq, padapter);
}
#endif
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment