developer | 7e32f7e | 2022-05-18 21:10:08 +0800 | [diff] [blame^] | 1 | From 2e18135845b359f26c37df38ba56565496517c10 Mon Sep 17 00:00:00 2001 |
| 2 | From: Antoine Tenart <antoine.tenart@bootlin.com> |
| 3 | Date: Mon, 13 Jan 2020 23:31:42 +0100 |
| 4 | Subject: net: phy: add MACsec ops in phy_device |
| 5 | |
| 6 | This patch adds a reference to MACsec ops in the phy_device, to allow |
| 7 | PHYs to support offloading MACsec operations. The phydev lock will be |
| 8 | held while calling those helpers. |
| 9 | |
| 10 | Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com> |
| 11 | Signed-off-by: David S. Miller <davem@davemloft.net> |
| 12 | --- |
| 13 | include/linux/phy.h | 7 +++++++ |
| 14 | 1 file changed, 7 insertions(+) |
| 15 | |
| 16 | diff --git a/include/linux/phy.h b/include/linux/phy.h |
| 17 | index be079a7bb40aa..2929d0bc307fe 100644 |
| 18 | --- a/include/linux/phy.h |
| 19 | +++ b/include/linux/phy.h |
| 20 | @@ -333,6 +333,7 @@ struct phy_c45_device_ids { |
| 21 | }; |
| 22 | |
| 23 | struct macsec_context; |
| 24 | +struct macsec_ops; |
| 25 | |
| 26 | /* phy_device: An instance of a PHY |
| 27 | * |
| 28 | @@ -356,6 +357,7 @@ struct macsec_context; |
| 29 | * attached_dev: The attached enet driver's device instance ptr |
| 30 | * adjust_link: Callback for the enet controller to respond to |
| 31 | * changes in the link state. |
| 32 | + * macsec_ops: MACsec offloading ops. |
| 33 | * |
| 34 | * speed, duplex, pause, supported, advertising, lp_advertising, |
| 35 | * and autoneg are used like in mii_if_info |
| 36 | @@ -455,6 +457,11 @@ struct phy_device { |
| 37 | |
| 38 | void (*phy_link_change)(struct phy_device *, bool up, bool do_carrier); |
| 39 | void (*adjust_link)(struct net_device *dev); |
| 40 | + |
| 41 | +#if IS_ENABLED(CONFIG_MACSEC) |
| 42 | + /* MACsec management functions */ |
| 43 | + const struct macsec_ops *macsec_ops; |
| 44 | +#endif |
| 45 | }; |
| 46 | #define to_phy_device(d) container_of(to_mdio_device(d), \ |
| 47 | struct phy_device, mdio) |
| 48 | -- |
| 49 | cgit 1.2.3-1.el7 |
| 50 | |