blob: c3372fd40388f23887ed4a5c7a78f2a54b54a183 [file] [log] [blame]
developer7e32f7e2022-05-18 21:10:08 +08001From 30e9bb8472f4454d0544020574bb03d96ffa0e52 Mon Sep 17 00:00:00 2001
2From: Antoine Tenart <antoine.tenart@bootlin.com>
3Date: Wed, 25 Mar 2020 15:52:31 +0300
4Subject: net: add a reference to MACsec ops in net_device
5
6This patch adds a reference to MACsec ops to the net_device structure,
7allowing net device drivers to implement offloading operations for
8MACsec.
9
10Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
11Signed-off-by: Mark Starovoytov <mstarovoitov@marvell.com>
12Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
13Signed-off-by: David S. Miller <davem@davemloft.net>
14---
15 include/linux/netdevice.h | 9 +++++++++
16 1 file changed, 9 insertions(+)
17
18--- a/include/linux/netdevice.h
19+++ b/include/linux/netdevice.h
20@@ -53,6 +53,8 @@ struct netpoll_info;
21 struct device;
22 struct phy_device;
23 struct dsa_port;
24+struct macsec_context;
25+struct macsec_ops;
26
27 struct sfp_bus;
28 /* 802.11 specific */
29@@ -1805,6 +1807,8 @@ enum netdev_ml_priv_type {
30 *
31 * @threaded: napi threaded mode is enabled
32 *
33+ * @macsec_ops: MACsec offloading ops
34+ *
35 * FIXME: cleanup struct net_device such that network protocol info
36 * moves out.
37 */
38@@ -2109,6 +2113,11 @@ struct net_device {
39 bool proto_down;
40 unsigned wol_enabled:1;
41 unsigned threaded:1;
42+
43+#if IS_ENABLED(CONFIG_MACSEC)
44+ /* MACsec management functions */
45+ const struct macsec_ops *macsec_ops;
46+#endif
47 };
48 #define to_net_dev(d) container_of(d, struct net_device, dev)
49