[][Add macsec HW offload backport from kernel 5.18]
[Description]
Add macsec HW offload backport from kernel 5.18.
[Release-log]
N/A
Change-Id: I5b143fe620ec4bcae4075d1d85db5e41c8d48717
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/5981730
diff --git a/target/linux/mediatek/patches-5.4/999-1767-03-v5.18-net-macsec-allow-to-reference-a-netdev-from-a-MACsec-context.patch b/target/linux/mediatek/patches-5.4/999-1767-03-v5.18-net-macsec-allow-to-reference-a-netdev-from-a-MACsec-context.patch
new file mode 100644
index 0000000..b3ef8df
--- /dev/null
+++ b/target/linux/mediatek/patches-5.4/999-1767-03-v5.18-net-macsec-allow-to-reference-a-netdev-from-a-MACsec-context.patch
@@ -0,0 +1,35 @@
+From 8fa9137180b2fd8482b671f7e0bd8cf7538cbf59 Mon Sep 17 00:00:00 2001
+From: Antoine Tenart <antoine.tenart@bootlin.com>
+Date: Wed, 25 Mar 2020 15:52:32 +0300
+Subject: net: macsec: allow to reference a netdev from a MACsec context
+
+This patch allows to reference a net_device from a MACsec context. This
+is needed to allow implementing MACsec operations in net device drivers.
+
+Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
+Signed-off-by: Mark Starovoytov <mstarovoitov@marvell.com>
+Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ include/net/macsec.h | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/include/net/macsec.h b/include/net/macsec.h
+index 2e4780dbf5c6a..71de2c863df70 100644
+--- a/include/net/macsec.h
++++ b/include/net/macsec.h
+@@ -220,7 +220,10 @@ struct macsec_secy {
+ * struct macsec_context - MACsec context for hardware offloading
+ */
+ struct macsec_context {
+- struct phy_device *phydev;
++ union {
++ struct net_device *netdev;
++ struct phy_device *phydev;
++ };
+ enum macsec_offload offload;
+
+ struct macsec_secy *secy;
+--
+cgit 1.2.3-1.el7
+