From 19b9e14c47cf289758dc465fd44ee282c41c469a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 3 Feb 2016 09:33:38 +0000 Subject: swconfig: add (PHY) generic helper setting port link MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 SVN-Revision: 48621 --- target/linux/generic/files/include/linux/switch.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'target/linux/generic/files/include') diff --git a/target/linux/generic/files/include/linux/switch.h b/target/linux/generic/files/include/linux/switch.h index 4ada0e5d33..0c4cce7fa5 100644 --- a/target/linux/generic/files/include/linux/switch.h +++ b/target/linux/generic/files/include/linux/switch.h @@ -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 */ -- cgit v1.2.3