mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2025-01-11 21:50:15 +02:00
generic: rtl8366: use SWITCH_TYPE_NOVAL for reset_mib attributes
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22191 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
f6814dd201
commit
c26785337f
@ -677,13 +677,9 @@ static int rtl8366rb_sw_reset_mibs(struct switch_dev *dev,
|
|||||||
struct switch_val *val)
|
struct switch_val *val)
|
||||||
{
|
{
|
||||||
struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
|
struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
|
||||||
int err = 0;
|
|
||||||
|
|
||||||
if (val->value.i == 1)
|
return rtl8366_smi_rmwr(smi, RTL8366RB_MIB_CTRL_REG, 0,
|
||||||
err = rtl8366_smi_rmwr(smi, RTL8366RB_MIB_CTRL_REG, 0,
|
RTL8366RB_MIB_CTRL_GLOBAL_RESET);
|
||||||
RTL8366RB_MIB_CTRL_GLOBAL_RESET);
|
|
||||||
|
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtl8366rb_sw_get_vlan_enable(struct switch_dev *dev,
|
static int rtl8366rb_sw_get_vlan_enable(struct switch_dev *dev,
|
||||||
@ -1032,12 +1028,10 @@ static struct switch_attr rtl8366rb_globals[] = {
|
|||||||
.max = 1,
|
.max = 1,
|
||||||
.ofs = 2
|
.ofs = 2
|
||||||
}, {
|
}, {
|
||||||
.type = SWITCH_TYPE_INT,
|
.type = SWITCH_TYPE_NOVAL,
|
||||||
.name = "reset_mibs",
|
.name = "reset_mibs",
|
||||||
.description = "Reset all MIB counters",
|
.description = "Reset all MIB counters",
|
||||||
.set = rtl8366rb_sw_reset_mibs,
|
.set = rtl8366rb_sw_reset_mibs,
|
||||||
.get = NULL,
|
|
||||||
.max = 1
|
|
||||||
}, {
|
}, {
|
||||||
.type = SWITCH_TYPE_INT,
|
.type = SWITCH_TYPE_INT,
|
||||||
.name = "blinkrate",
|
.name = "blinkrate",
|
||||||
@ -1058,12 +1052,10 @@ static struct switch_attr rtl8366rb_port[] = {
|
|||||||
.set = NULL,
|
.set = NULL,
|
||||||
.get = rtl8366rb_sw_get_port_link,
|
.get = rtl8366rb_sw_get_port_link,
|
||||||
}, {
|
}, {
|
||||||
.type = SWITCH_TYPE_INT,
|
.type = SWITCH_TYPE_NOVAL,
|
||||||
.name = "reset_mib",
|
.name = "reset_mib",
|
||||||
.description = "Reset single port MIB counters",
|
.description = "Reset single port MIB counters",
|
||||||
.max = 1,
|
|
||||||
.set = rtl8366rb_sw_reset_port_mibs,
|
.set = rtl8366rb_sw_reset_port_mibs,
|
||||||
.get = NULL,
|
|
||||||
}, {
|
}, {
|
||||||
.type = SWITCH_TYPE_STRING,
|
.type = SWITCH_TYPE_STRING,
|
||||||
.name = "mib",
|
.name = "mib",
|
||||||
|
@ -664,12 +664,8 @@ static int rtl8366s_sw_reset_mibs(struct switch_dev *dev,
|
|||||||
struct switch_val *val)
|
struct switch_val *val)
|
||||||
{
|
{
|
||||||
struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
|
struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
|
||||||
int err = 0;
|
|
||||||
|
|
||||||
if (val->value.i == 1)
|
return rtl8366_smi_rmwr(smi, RTL8366S_MIB_CTRL_REG, 0, (1 << 2));
|
||||||
err = rtl8366_smi_rmwr(smi, RTL8366S_MIB_CTRL_REG, 0, (1 << 2));
|
|
||||||
|
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rtl8366s_sw_get_vlan_enable(struct switch_dev *dev,
|
static int rtl8366s_sw_get_vlan_enable(struct switch_dev *dev,
|
||||||
@ -1020,12 +1016,10 @@ static struct switch_attr rtl8366s_globals[] = {
|
|||||||
.max = 1,
|
.max = 1,
|
||||||
.ofs = 2
|
.ofs = 2
|
||||||
}, {
|
}, {
|
||||||
.type = SWITCH_TYPE_INT,
|
.type = SWITCH_TYPE_NOVAL,
|
||||||
.name = "reset_mibs",
|
.name = "reset_mibs",
|
||||||
.description = "Reset all MIB counters",
|
.description = "Reset all MIB counters",
|
||||||
.set = rtl8366s_sw_reset_mibs,
|
.set = rtl8366s_sw_reset_mibs,
|
||||||
.get = NULL,
|
|
||||||
.max = 1
|
|
||||||
}, {
|
}, {
|
||||||
.type = SWITCH_TYPE_INT,
|
.type = SWITCH_TYPE_INT,
|
||||||
.name = "blinkrate",
|
.name = "blinkrate",
|
||||||
@ -1046,12 +1040,10 @@ static struct switch_attr rtl8366s_port[] = {
|
|||||||
.set = NULL,
|
.set = NULL,
|
||||||
.get = rtl8366s_sw_get_port_link,
|
.get = rtl8366s_sw_get_port_link,
|
||||||
}, {
|
}, {
|
||||||
.type = SWITCH_TYPE_INT,
|
.type = SWITCH_TYPE_NOVAL,
|
||||||
.name = "reset_mib",
|
.name = "reset_mib",
|
||||||
.description = "Reset single port MIB counters",
|
.description = "Reset single port MIB counters",
|
||||||
.max = 1,
|
|
||||||
.set = rtl8366s_sw_reset_port_mibs,
|
.set = rtl8366s_sw_reset_port_mibs,
|
||||||
.get = NULL,
|
|
||||||
}, {
|
}, {
|
||||||
.type = SWITCH_TYPE_STRING,
|
.type = SWITCH_TYPE_STRING,
|
||||||
.name = "mib",
|
.name = "mib",
|
||||||
|
Loading…
Reference in New Issue
Block a user