projects
/
librecmc
/
librecmc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
generic: provide get_port_stats() on rtl836x switches
[librecmc/librecmc.git]
/
target
/
linux
/
generic
/
files
/
drivers
/
net
/
phy
/
rtl8367.c
diff --git
a/target/linux/generic/files/drivers/net/phy/rtl8367.c
b/target/linux/generic/files/drivers/net/phy/rtl8367.c
index 97cd1acfb51428f89c68969982b7fa4320abd8ed..9549961d767589789abedafd5b2d932c0e340273 100644
(file)
--- a/
target/linux/generic/files/drivers/net/phy/rtl8367.c
+++ b/
target/linux/generic/files/drivers/net/phy/rtl8367.c
@@
-253,6
+253,9
@@
struct rtl8367_initval {
u16 val;
};
u16 val;
};
+#define RTL8367_MIB_RXB_ID 0 /* IfInOctets */
+#define RTL8367_MIB_TXB_ID 20 /* IfOutOctets */
+
static struct rtl8366_mib_counter rtl8367_mib_counters[] = {
{ 0, 0, 4, "IfInOctets" },
{ 0, 4, 2, "Dot3StatsFCSErrors" },
static struct rtl8366_mib_counter rtl8367_mib_counters[] = {
{ 0, 0, 4, "IfInOctets" },
{ 0, 4, 2, "Dot3StatsFCSErrors" },
@@
-1535,6
+1538,13
@@
static int rtl8367_sw_reset_port_mibs(struct switch_dev *dev,
RTL8367_MIB_CTRL_PORT_RESET_MASK(port % 8));
}
RTL8367_MIB_CTRL_PORT_RESET_MASK(port % 8));
}
+static int rtl8367_sw_get_port_stats(struct switch_dev *dev, int port,
+ struct switch_port_stats *stats)
+{
+ return (rtl8366_sw_get_port_stats(dev, port, stats,
+ RTL8367_MIB_TXB_ID, RTL8367_MIB_RXB_ID));
+}
+
static struct switch_attr rtl8367_globals[] = {
{
.type = SWITCH_TYPE_INT,
static struct switch_attr rtl8367_globals[] = {
{
.type = SWITCH_TYPE_INT,
@@
-1622,6
+1632,7
@@
static const struct switch_dev_ops rtl8367_sw_ops = {
.set_port_pvid = rtl8366_sw_set_port_pvid,
.reset_switch = rtl8366_sw_reset_switch,
.get_port_link = rtl8367_sw_get_port_link,
.set_port_pvid = rtl8366_sw_set_port_pvid,
.reset_switch = rtl8366_sw_reset_switch,
.get_port_link = rtl8367_sw_get_port_link,
+ .get_port_stats = rtl8367_sw_get_port_stats,
};
static int rtl8367_switch_init(struct rtl8366_smi *smi)
};
static int rtl8367_switch_init(struct rtl8366_smi *smi)