| From 30e9bb8472f4454d0544020574bb03d96ffa0e52 Mon Sep 17 00:00:00 2001 |
| From: Antoine Tenart <antoine.tenart@bootlin.com> |
| Date: Wed, 25 Mar 2020 15:52:31 +0300 |
| Subject: net: add a reference to MACsec ops in net_device |
| |
| This patch adds a reference to MACsec ops to the net_device structure, |
| allowing net device drivers to implement offloading operations for |
| MACsec. |
| |
| 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/linux/netdevice.h | 9 +++++++++ |
| 1 file changed, 9 insertions(+) |
| |
| --- a/include/linux/netdevice.h |
| +++ b/include/linux/netdevice.h |
| @@ -53,6 +53,8 @@ struct netpoll_info; |
| struct device; |
| struct phy_device; |
| struct dsa_port; |
| +struct macsec_context; |
| +struct macsec_ops; |
| |
| struct sfp_bus; |
| /* 802.11 specific */ |
| @@ -1805,6 +1807,8 @@ enum netdev_ml_priv_type { |
| * |
| * @threaded: napi threaded mode is enabled |
| * |
| + * @macsec_ops: MACsec offloading ops |
| + * |
| * FIXME: cleanup struct net_device such that network protocol info |
| * moves out. |
| */ |
| @@ -2109,6 +2113,11 @@ struct net_device { |
| bool proto_down; |
| unsigned wol_enabled:1; |
| unsigned threaded:1; |
| + |
| +#if IS_ENABLED(CONFIG_MACSEC) |
| + /* MACsec management functions */ |
| + const struct macsec_ops *macsec_ops; |
| +#endif |
| }; |
| #define to_net_dev(d) container_of(d, struct net_device, dev) |
| |