net: phy: move phy_lookup_setting() and guts of phy_supported_speeds() to phy-core
phy_lookup_setting() provides useful functionality in ethtool code outside phylib. Move it to phy-core and allow it to be re-used (eg, in phylink) rather than duplicated elsewhere. Note that this supports the larger linkmode space. As we move the phy settings table, we also need to move the guts of phy_supported_speeds() as well. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
da4625ac26
commit
0ccb4fc65d
@@ -670,6 +670,21 @@ struct phy_fixup {
|
||||
const char *phy_speed_to_str(int speed);
|
||||
const char *phy_duplex_to_str(unsigned int duplex);
|
||||
|
||||
/* A structure for mapping a particular speed and duplex
|
||||
* combination to a particular SUPPORTED and ADVERTISED value
|
||||
*/
|
||||
struct phy_setting {
|
||||
u32 speed;
|
||||
u8 duplex;
|
||||
u8 bit;
|
||||
};
|
||||
|
||||
const struct phy_setting *
|
||||
phy_lookup_setting(int speed, int duplex, const unsigned long *mask,
|
||||
size_t maxbit, bool exact);
|
||||
size_t phy_speeds(unsigned int *speeds, size_t size,
|
||||
unsigned long *mask, size_t maxbit);
|
||||
|
||||
/**
|
||||
* phy_read_mmd - Convenience function for reading a register
|
||||
* from an MMD on a given PHY.
|
||||
|
Reference in New Issue
Block a user