File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -1026,6 +1026,38 @@ unsigned int phy_inband_caps(struct phy_device *phydev,
1026
1026
}
1027
1027
EXPORT_SYMBOL_GPL (phy_inband_caps );
1028
1028
1029
+ /**
1030
+ * phy_config_inband - configure the desired PHY in-band mode
1031
+ * @phydev: the phy_device struct
1032
+ * @modes: in-band modes to configure
1033
+ *
1034
+ * Description: disables, enables or enables-with-bypass in-band signalling
1035
+ * between the PHY and host system.
1036
+ *
1037
+ * Returns: zero on success, or negative errno value.
1038
+ */
1039
+ int phy_config_inband (struct phy_device * phydev , unsigned int modes )
1040
+ {
1041
+ int err ;
1042
+
1043
+ if (!!(modes & LINK_INBAND_DISABLE ) +
1044
+ !!(modes & LINK_INBAND_ENABLE ) +
1045
+ !!(modes & LINK_INBAND_BYPASS ) != 1 )
1046
+ return - EINVAL ;
1047
+
1048
+ mutex_lock (& phydev -> lock );
1049
+ if (!phydev -> drv )
1050
+ err = - EIO ;
1051
+ else if (!phydev -> drv -> config_inband )
1052
+ err = - EOPNOTSUPP ;
1053
+ else
1054
+ err = phydev -> drv -> config_inband (phydev , modes );
1055
+ mutex_unlock (& phydev -> lock );
1056
+
1057
+ return err ;
1058
+ }
1059
+ EXPORT_SYMBOL (phy_config_inband );
1060
+
1029
1061
/**
1030
1062
* _phy_start_aneg - start auto-negotiation for this PHY device
1031
1063
* @phydev: the phy_device struct
Original file line number Diff line number Diff line change @@ -982,6 +982,11 @@ struct phy_driver {
982
982
unsigned int (* inband_caps )(struct phy_device * phydev ,
983
983
phy_interface_t interface );
984
984
985
+ /**
986
+ * @config_inband: configure in-band mode for the PHY
987
+ */
988
+ int (* config_inband )(struct phy_device * phydev , unsigned int modes );
989
+
985
990
/**
986
991
* @get_rate_matching: Get the supported type of rate matching for a
987
992
* particular phy interface. This is used by phy consumers to determine
@@ -1846,6 +1851,7 @@ int phy_start_aneg(struct phy_device *phydev);
1846
1851
int phy_aneg_done (struct phy_device * phydev );
1847
1852
unsigned int phy_inband_caps (struct phy_device * phydev ,
1848
1853
phy_interface_t interface );
1854
+ int phy_config_inband (struct phy_device * phydev , unsigned int modes );
1849
1855
int phy_speed_down (struct phy_device * phydev , bool sync );
1850
1856
int phy_speed_up (struct phy_device * phydev );
1851
1857
bool phy_check_valid (int speed , int duplex , unsigned long * features );
You can’t perform that action at this time.
0 commit comments