Skip to content

Commit 2e18135

Browse files
atenartdavem330
authored andcommitted
net: phy: add MACsec ops in phy_device
This patch adds a reference to MACsec ops in the phy_device, to allow PHYs to support offloading MACsec operations. The phydev lock will be held while calling those helpers. Signed-off-by: Antoine Tenart <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0830e20 commit 2e18135

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/linux/phy.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ struct phy_c45_device_ids {
333333
};
334334

335335
struct macsec_context;
336+
struct macsec_ops;
336337

337338
/* phy_device: An instance of a PHY
338339
*
@@ -356,6 +357,7 @@ struct macsec_context;
356357
* attached_dev: The attached enet driver's device instance ptr
357358
* adjust_link: Callback for the enet controller to respond to
358359
* changes in the link state.
360+
* macsec_ops: MACsec offloading ops.
359361
*
360362
* speed, duplex, pause, supported, advertising, lp_advertising,
361363
* and autoneg are used like in mii_if_info
@@ -455,6 +457,11 @@ struct phy_device {
455457

456458
void (*phy_link_change)(struct phy_device *, bool up, bool do_carrier);
457459
void (*adjust_link)(struct net_device *dev);
460+
461+
#if IS_ENABLED(CONFIG_MACSEC)
462+
/* MACsec management functions */
463+
const struct macsec_ops *macsec_ops;
464+
#endif
458465
};
459466
#define to_phy_device(d) container_of(to_mdio_device(d), \
460467
struct phy_device, mdio)

0 commit comments

Comments
 (0)