From c400bf085d411ad6725eda78053e5d4ffec5e741 Mon Sep 17 00:00:00 2001 From: juhosg Date: Sat, 31 Dec 2011 15:02:24 +0000 Subject: kernel: swconfig: add get_port_{link,stats} callbacks git-svn-id: svn://svn.openwrt.org/openwrt/trunk@29625 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/generic/files/include/linux/switch.h | 26 +++++++++++++++++++++++ 1 file changed, 26 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 6eefb7fe6..04371ae74 100644 --- a/target/linux/generic/files/include/linux/switch.h +++ b/target/linux/generic/files/include/linux/switch.h @@ -114,6 +114,27 @@ struct switch_attrlist { const struct switch_attr *attr; }; +enum switch_port_speed { + SWITCH_PORT_SPEED_UNKNOWN = 0, + SWITCH_PORT_SPEED_10 = 10, + SWITCH_PORT_SPEED_100 = 100, + SWITCH_PORT_SPEED_1000 = 1000, +}; + +struct switch_port_link { + bool link; + bool duplex; + bool aneg; + bool tx_flow; + bool rx_flow; + enum switch_port_speed speed; +}; + +struct switch_port_stats { + unsigned long tx_bytes; + unsigned long rx_bytes; +}; + /** * struct switch_dev_ops - switch driver operations * @@ -143,6 +164,11 @@ struct switch_dev_ops { int (*apply_config)(struct switch_dev *dev); int (*reset_switch)(struct switch_dev *dev); + + int (*get_port_link)(struct switch_dev *dev, int port, + struct switch_port_link *link); + int (*get_port_stats)(struct switch_dev *dev, int port, + struct switch_port_stats *stats); }; struct switch_dev { -- cgit v1.2.3