From aad12dc40c1b56d5874be52696cbf6d78133213b Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 24 Sep 2015 11:01:13 +0100 Subject: phylink: add hooks for SFP support Add support to phylink for SFP, which needs to control and configure the ethernet MAC link state. Specifically, SFP needs to: 1. set the negotiation mode between SGMII and 1000base-X 2. attach and detach the module PHY 3. prevent the link coming up when errors are reported In the absence of a PHY, we also need to set the ethtool port type according to the module plugged in. Reviewed-by: Florian Fainelli Signed-off-by: Russell King - rework phylink_set_link_*(), combining into a single function. --- include/linux/phylink.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/linux/phylink.h b/include/linux/phylink.h index e33a7d1d7625..62786d27a5fc 100644 --- a/include/linux/phylink.h +++ b/include/linux/phylink.h @@ -125,6 +125,12 @@ int phylink_ethtool_ksettings_set(struct phylink *, const struct ethtool_link_ksettings *); int phylink_mii_ioctl(struct phylink *, struct ifreq *, int); +int phylink_set_link(struct phylink *pl, unsigned int mode, u8 port, + const unsigned long *support); +void phylink_disable(struct phylink *pl); +void phylink_enable(struct phylink *pl); +struct phylink *phylink_lookup_by_netdev(struct net_device *ndev); + #define phylink_zero(bm) \ bitmap_zero(bm, __ETHTOOL_LINK_MODE_MASK_NBITS) #define __phylink_do_bit(op, bm, mode) \ -- cgit