aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/374-0009-brcmfmac-Add-wowl-wake-indication-report.patch
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2016-01-10 01:30:13 +0000
committerRafał Miłecki <zajec5@gmail.com>2016-01-10 01:30:13 +0000
commit1f13935e70421827c2f1f4d44b8848397e769729 (patch)
tree94a89e9912e0b67651c79c2b5e81ee96fa35f7b5 /package/kernel/mac80211/patches/374-0009-brcmfmac-Add-wowl-wake-indication-report.patch
parentacad802bceb2d41e003c07a0f17d800151ba7975 (diff)
downloadupstream-1f13935e70421827c2f1f4d44b8848397e769729.tar.gz
upstream-1f13935e70421827c2f1f4d44b8848397e769729.tar.bz2
upstream-1f13935e70421827c2f1f4d44b8848397e769729.zip
mac80211: brcmfmac: add beamforming support
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/branches/chaos_calmer@48168 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/kernel/mac80211/patches/374-0009-brcmfmac-Add-wowl-wake-indication-report.patch')
-rw-r--r--package/kernel/mac80211/patches/374-0009-brcmfmac-Add-wowl-wake-indication-report.patch129
1 files changed, 129 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/374-0009-brcmfmac-Add-wowl-wake-indication-report.patch b/package/kernel/mac80211/patches/374-0009-brcmfmac-Add-wowl-wake-indication-report.patch
new file mode 100644
index 0000000000..4324cc70c4
--- /dev/null
+++ b/package/kernel/mac80211/patches/374-0009-brcmfmac-Add-wowl-wake-indication-report.patch
@@ -0,0 +1,129 @@
+From: Hante Meuleman <meuleman@broadcom.com>
+Date: Thu, 29 Oct 2015 20:33:19 +0100
+Subject: [PATCH] brcmfmac: Add wowl wake indication report.
+
+On wakeup of the system (resume) a wowl wakeup indication report
+can be sent to cfg80211. This patch adds support for this. The
+report specifies if the device was responsible for the wakeup
+and if so, will specify the exact reason.
+
+Reviewed-by: Arend Van Spriel <arend@broadcom.com>
+Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
+Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
+Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
+Signed-off-by: Arend van Spriel <arend@broadcom.com>
+Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
+---
+
+--- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
++++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
+@@ -3061,6 +3061,67 @@ static s32 brcmf_config_wowl_pattern(str
+ return ret;
+ }
+
++#ifdef CPTCFG_PM
++
++static void brcmf_report_wowl_wakeind(struct wiphy *wiphy, struct brcmf_if *ifp)
++{
++ struct brcmf_wowl_wakeind_le wake_ind_le;
++ struct cfg80211_wowlan_wakeup wakeup_data;
++ struct cfg80211_wowlan_wakeup *wakeup;
++ u32 wakeind;
++ s32 err;
++
++ err = brcmf_fil_iovar_data_get(ifp, "wowl_wakeind", &wake_ind_le,
++ sizeof(wake_ind_le));
++ if (!err) {
++ brcmf_err("Get wowl_wakeind failed, err = %d\n", err);
++ return;
++ }
++
++ wakeind = le32_to_cpu(wake_ind_le.ucode_wakeind);
++ if (wakeind & (BRCMF_WOWL_MAGIC | BRCMF_WOWL_DIS | BRCMF_WOWL_BCN |
++ BRCMF_WOWL_RETR | BRCMF_WOWL_NET)) {
++ wakeup = &wakeup_data;
++ memset(&wakeup_data, 0, sizeof(wakeup_data));
++ wakeup_data.pattern_idx = -1;
++
++ if (wakeind & BRCMF_WOWL_MAGIC) {
++ brcmf_dbg(INFO, "WOWL Wake indicator: BRCMF_WOWL_MAGIC\n");
++ wakeup_data.magic_pkt = true;
++ }
++ if (wakeind & BRCMF_WOWL_DIS) {
++ brcmf_dbg(INFO, "WOWL Wake indicator: BRCMF_WOWL_DIS\n");
++ wakeup_data.disconnect = true;
++ }
++ if (wakeind & BRCMF_WOWL_BCN) {
++ brcmf_dbg(INFO, "WOWL Wake indicator: BRCMF_WOWL_BCN\n");
++ wakeup_data.disconnect = true;
++ }
++ if (wakeind & BRCMF_WOWL_RETR) {
++ brcmf_dbg(INFO, "WOWL Wake indicator: BRCMF_WOWL_RETR\n");
++ wakeup_data.disconnect = true;
++ }
++ if (wakeind & BRCMF_WOWL_NET) {
++ brcmf_dbg(INFO, "WOWL Wake indicator: BRCMF_WOWL_NET\n");
++ /* For now always map to pattern 0, no API to get
++ * correct information available at the moment.
++ */
++ wakeup_data.pattern_idx = 0;
++ }
++ } else {
++ wakeup = NULL;
++ }
++ cfg80211_report_wowlan_wakeup(&ifp->vif->wdev, wakeup, GFP_KERNEL);
++}
++
++#else
++
++static void brcmf_report_wowl_wakeind(struct wiphy *wiphy, struct brcmf_if *ifp)
++{
++}
++
++#endif /* CPTCFG_PM */
++
+ static s32 brcmf_cfg80211_resume(struct wiphy *wiphy)
+ {
+ struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
+@@ -3070,11 +3131,12 @@ static s32 brcmf_cfg80211_resume(struct
+ brcmf_dbg(TRACE, "Enter\n");
+
+ if (cfg->wowl_enabled) {
++ brcmf_report_wowl_wakeind(wiphy, ifp);
++ brcmf_fil_iovar_int_set(ifp, "wowl_clear", 0);
++ brcmf_config_wowl_pattern(ifp, "clr", NULL, 0, NULL, 0);
+ brcmf_configure_arp_offload(ifp, true);
+ brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PM,
+ cfg->pre_wowl_pmmode);
+- brcmf_fil_iovar_int_set(ifp, "wowl_clear", 0);
+- brcmf_config_wowl_pattern(ifp, "clr", NULL, 0, NULL, 0);
+ cfg->wowl_enabled = false;
+ }
+ return 0;
+@@ -3108,6 +3170,7 @@ static void brcmf_configure_wowl(struct
+ wowl->patterns[i].pkt_offset);
+ }
+ }
++ brcmf_fil_iovar_data_set(ifp, "wowl_wakeind", "clear", strlen("clear"));
+ brcmf_fil_iovar_int_set(ifp, "wowl", wowl_config);
+ brcmf_fil_iovar_int_set(ifp, "wowl_activate", 1);
+ brcmf_bus_wowl_config(cfg->pub->bus_if, true);
+--- a/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h
++++ b/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h
+@@ -634,4 +634,16 @@ struct brcmf_assoclist_le {
+ u8 mac[BRCMF_MAX_ASSOCLIST][ETH_ALEN];
+ };
+
++/**
++ * struct brcmf_wowl_wakeind_le - Wakeup indicators
++ * Note: note both fields contain same information.
++ *
++ * @pci_wakeind: Whether PCI PMECSR PMEStatus bit was set.
++ * @ucode_wakeind: What wakeup-event indication was set by ucode
++ */
++struct brcmf_wowl_wakeind_le {
++ __le32 pci_wakeind;
++ __le32 ucode_wakeind;
++};
++
+ #endif /* FWIL_TYPES_H_ */