diff mbox

[1/3] mwifiex: support wowlan magic-packet encapsulated as UDP packet

Message ID 1402109264-7095-1-git-send-email-bzhao@marvell.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Bing Zhao June 7, 2014, 2:47 a.m. UTC
From: Zhiyuan Yang <yangzy@marvell.com>

When magic-packet is generated as a UDP packet the offset should
be 20+8 more bytes to cover IPv4 header and UDP header. So the
total offset become 56.
Add a new MEF entry to support both magic-packet patterns
generated by different tools.

Cc: Andreas Fenkart <afenkart@gmail.com>
Signed-off-by: Zhiyuan Yang <yangzy@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/mwifiex/cfg80211.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Andreas Fenkart June 9, 2014, 12:44 p.m. UTC | #1
H Bing,

lgtm,

one question about the followup patch,
http://www.spinics.net/lists/linux-wireless/msg123503.html

how will mac events be supported in the future?
ethtool wol p  - Wake on phy activity

Guess they can't be modeled with patterns

/Andreas

2014-06-07 4:47 GMT+02:00 Bing Zhao <bzhao@marvell.com>:
> From: Zhiyuan Yang <yangzy@marvell.com>
>
> When magic-packet is generated as a UDP packet the offset should
> be 20+8 more bytes to cover IPv4 header and UDP header. So the
> total offset become 56.
> Add a new MEF entry to support both magic-packet patterns
> generated by different tools.
>
> Cc: Andreas Fenkart <afenkart@gmail.com>
> Signed-off-by: Zhiyuan Yang <yangzy@marvell.com>
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
> Signed-off-by: Bing Zhao <bzhao@marvell.com>
> ---
>  drivers/net/wireless/mwifiex/cfg80211.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
> index e95dec9..9afac2b 100644
> --- a/drivers/net/wireless/mwifiex/cfg80211.c
> +++ b/drivers/net/wireless/mwifiex/cfg80211.c
> @@ -2483,6 +2483,16 @@ static int mwifiex_cfg80211_suspend(struct wiphy *wiphy,
>                 mef_entry->filter[filt_num].filt_type = TYPE_EQ;
>                 if (filt_num)
>                         mef_entry->filter[filt_num].filt_action = TYPE_OR;
> +
> +               filt_num++;
> +               mef_entry->filter[filt_num].repeat = 16;
> +               memcpy(mef_entry->filter[filt_num].byte_seq, priv->curr_addr,
> +                      ETH_ALEN);
> +               mef_entry->filter[filt_num].byte_seq[MWIFIEX_MEF_MAX_BYTESEQ] =
> +                                                               ETH_ALEN;
> +               mef_entry->filter[filt_num].offset = 56;
> +               mef_entry->filter[filt_num].filt_type = TYPE_EQ;
> +               mef_entry->filter[filt_num].filt_action = TYPE_OR;
>         }
>
>         if (!mef_cfg.criteria)
> --
> 1.8.2.3
>
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bing Zhao June 10, 2014, 3:29 p.m. UTC | #2
Hi Andreas,

> H Bing,

> 

> lgtm,


Thanks for your review.

> 

> one question about the followup patch,

> http://www.spinics.net/lists/linux-wireless/msg123503.html

> 

> how will mac events be supported in the future?

> ethtool wol p  - Wake on phy activity

> 

> Guess they can't be modeled with patterns


Good catch! I've overlooked this "phy activity" case which isn't configurable via iw wowlan command.
I will reply to the patch in that thread.

Thanks,
Bing
diff mbox

Patch

diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index e95dec9..9afac2b 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -2483,6 +2483,16 @@  static int mwifiex_cfg80211_suspend(struct wiphy *wiphy,
 		mef_entry->filter[filt_num].filt_type = TYPE_EQ;
 		if (filt_num)
 			mef_entry->filter[filt_num].filt_action = TYPE_OR;
+
+		filt_num++;
+		mef_entry->filter[filt_num].repeat = 16;
+		memcpy(mef_entry->filter[filt_num].byte_seq, priv->curr_addr,
+		       ETH_ALEN);
+		mef_entry->filter[filt_num].byte_seq[MWIFIEX_MEF_MAX_BYTESEQ] =
+								ETH_ALEN;
+		mef_entry->filter[filt_num].offset = 56;
+		mef_entry->filter[filt_num].filt_type = TYPE_EQ;
+		mef_entry->filter[filt_num].filt_action = TYPE_OR;
 	}
 
 	if (!mef_cfg.criteria)