developer | 7e32f7e | 2022-05-18 21:10:08 +0800 | [diff] [blame^] | 1 | From 8fa9137180b2fd8482b671f7e0bd8cf7538cbf59 Mon Sep 17 00:00:00 2001 |
| 2 | From: Antoine Tenart <antoine.tenart@bootlin.com> |
| 3 | Date: Wed, 25 Mar 2020 15:52:32 +0300 |
| 4 | Subject: net: macsec: allow to reference a netdev from a MACsec context |
| 5 | |
| 6 | This patch allows to reference a net_device from a MACsec context. This |
| 7 | is needed to allow implementing MACsec operations in net device drivers. |
| 8 | |
| 9 | Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com> |
| 10 | Signed-off-by: Mark Starovoytov <mstarovoitov@marvell.com> |
| 11 | Signed-off-by: Igor Russkikh <irusskikh@marvell.com> |
| 12 | Signed-off-by: David S. Miller <davem@davemloft.net> |
| 13 | --- |
| 14 | include/net/macsec.h | 5 ++++- |
| 15 | 1 file changed, 4 insertions(+), 1 deletion(-) |
| 16 | |
| 17 | diff --git a/include/net/macsec.h b/include/net/macsec.h |
| 18 | index 2e4780dbf5c6a..71de2c863df70 100644 |
| 19 | --- a/include/net/macsec.h |
| 20 | +++ b/include/net/macsec.h |
| 21 | @@ -220,7 +220,10 @@ struct macsec_secy { |
| 22 | * struct macsec_context - MACsec context for hardware offloading |
| 23 | */ |
| 24 | struct macsec_context { |
| 25 | - struct phy_device *phydev; |
| 26 | + union { |
| 27 | + struct net_device *netdev; |
| 28 | + struct phy_device *phydev; |
| 29 | + }; |
| 30 | enum macsec_offload offload; |
| 31 | |
| 32 | struct macsec_secy *secy; |
| 33 | -- |
| 34 | cgit 1.2.3-1.el7 |
| 35 | |