swconfig: add (PHY) generic helper setting port link

It's quite common for switches to have PHY per port so adding a generic
helper setting link state will help many drivers. It just needs an API
to access PHYs which this patch also adds.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 48621
This commit is contained in:
Rafał Miłecki
2016-02-03 09:33:38 +00:00
parent 8ebc9e7539
commit 19b9e14c47
2 changed files with 42 additions and 0 deletions

View File

@@ -99,6 +99,9 @@ struct switch_dev_ops {
struct switch_port_link *link);
int (*get_port_stats)(struct switch_dev *dev, int port,
struct switch_port_stats *stats);
int (*phy_read16)(struct switch_dev *dev, int addr, u8 reg, u16 *value);
int (*phy_write16)(struct switch_dev *dev, int addr, u8 reg, u16 value);
};
struct switch_dev {
@@ -170,4 +173,7 @@ struct switch_attr {
int max;
};
int switch_generic_set_link(struct switch_dev *dev, int port,
struct switch_port_link *link);
#endif /* _LINUX_SWITCH_H */