summaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files/include
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2011-12-31 15:02:24 +0000
committerGabor Juhos <juhosg@openwrt.org>2011-12-31 15:02:24 +0000
commit975355a2b1faf4e02d7c53c354fbae09ec8aa7ce (patch)
tree75260db24b9fa173aa740d983801bed7efaa6031 /target/linux/generic/files/include
parent557009bbdb764544f06b1cb623c43f7555993e96 (diff)
downloadmaster-31e0f0ae-975355a2b1faf4e02d7c53c354fbae09ec8aa7ce.tar.gz
master-31e0f0ae-975355a2b1faf4e02d7c53c354fbae09ec8aa7ce.tar.bz2
master-31e0f0ae-975355a2b1faf4e02d7c53c354fbae09ec8aa7ce.zip
kernel: swconfig: add get_port_{link,stats} callbacks
SVN-Revision: 29625
Diffstat (limited to 'target/linux/generic/files/include')
-rw-r--r--target/linux/generic/files/include/linux/switch.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/target/linux/generic/files/include/linux/switch.h b/target/linux/generic/files/include/linux/switch.h
index 6eefb7fe6b..04371ae741 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 {