developer | 7e32f7e | 2022-05-18 21:10:08 +0800 | [diff] [blame] | 1 | From 30e9bb8472f4454d0544020574bb03d96ffa0e52 Mon Sep 17 00:00:00 2001 |
| 2 | From: Antoine Tenart <antoine.tenart@bootlin.com> |
| 3 | Date: Wed, 25 Mar 2020 15:52:31 +0300 |
| 4 | Subject: net: add a reference to MACsec ops in net_device |
| 5 | |
| 6 | This patch adds a reference to MACsec ops to the net_device structure, |
| 7 | allowing net device drivers to implement offloading operations for |
| 8 | MACsec. |
| 9 | |
| 10 | Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com> |
| 11 | Signed-off-by: Mark Starovoytov <mstarovoitov@marvell.com> |
| 12 | Signed-off-by: Igor Russkikh <irusskikh@marvell.com> |
| 13 | Signed-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 | |