mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2025-01-27 14:31:05 +02:00
generic: rtl8366: use smi->num_ports and smi->ops->get_vlan_4k
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22202 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
fc85856afd
commit
4bcb729a13
@ -721,14 +721,14 @@ static int rtl8366rb_sw_get_vlan_info(struct switch_dev *dev,
|
|||||||
|
|
||||||
memset(buf, '\0', sizeof(smi->buf));
|
memset(buf, '\0', sizeof(smi->buf));
|
||||||
|
|
||||||
err = rtl8366rb_get_vlan_4k(smi, val->port_vlan, &vlan4k);
|
err = smi->ops->get_vlan_4k(smi, val->port_vlan, &vlan4k);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
len += snprintf(buf + len, sizeof(smi->buf) - len,
|
len += snprintf(buf + len, sizeof(smi->buf) - len,
|
||||||
"VLAN %d: Ports: '", vlan4k.vid);
|
"VLAN %d: Ports: '", vlan4k.vid);
|
||||||
|
|
||||||
for (i = 0; i < RTL8366RB_NUM_PORTS; i++) {
|
for (i = 0; i < smi->num_ports; i++) {
|
||||||
if (!(vlan4k.member & (1 << i)))
|
if (!(vlan4k.member & (1 << i)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -811,11 +811,11 @@ static int rtl8366rb_sw_get_vlan_ports(struct switch_dev *dev,
|
|||||||
if (!smi->ops->is_vlan_valid(smi, val->port_vlan))
|
if (!smi->ops->is_vlan_valid(smi, val->port_vlan))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
rtl8366rb_get_vlan_4k(smi, val->port_vlan, &vlan4k);
|
smi->ops->get_vlan_4k(smi, val->port_vlan, &vlan4k);
|
||||||
|
|
||||||
port = &val->value.ports[0];
|
port = &val->value.ports[0];
|
||||||
val->len = 0;
|
val->len = 0;
|
||||||
for (i = 0; i < RTL8366RB_NUM_PORTS; i++) {
|
for (i = 0; i < smi->num_ports; i++) {
|
||||||
if (!(vlan4k.member & BIT(i)))
|
if (!(vlan4k.member & BIT(i)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -746,14 +746,14 @@ static int rtl8366s_sw_get_vlan_info(struct switch_dev *dev,
|
|||||||
|
|
||||||
memset(buf, '\0', sizeof(smi->buf));
|
memset(buf, '\0', sizeof(smi->buf));
|
||||||
|
|
||||||
err = rtl8366s_get_vlan_4k(smi, val->port_vlan, &vlan4k);
|
err = smi->ops->get_vlan_4k(smi, val->port_vlan, &vlan4k);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
len += snprintf(buf + len, sizeof(smi->buf) - len,
|
len += snprintf(buf + len, sizeof(smi->buf) - len,
|
||||||
"VLAN %d: Ports: '", vlan4k.vid);
|
"VLAN %d: Ports: '", vlan4k.vid);
|
||||||
|
|
||||||
for (i = 0; i < RTL8366S_NUM_PORTS; i++) {
|
for (i = 0; i < smi->num_ports; i++) {
|
||||||
if (!(vlan4k.member & (1 << i)))
|
if (!(vlan4k.member & (1 << i)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -838,11 +838,11 @@ static int rtl8366s_sw_get_vlan_ports(struct switch_dev *dev,
|
|||||||
if (!smi->ops->is_vlan_valid(smi, val->port_vlan))
|
if (!smi->ops->is_vlan_valid(smi, val->port_vlan))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
rtl8366s_get_vlan_4k(smi, val->port_vlan, &vlan4k);
|
smi->ops->get_vlan_4k(smi, val->port_vlan, &vlan4k);
|
||||||
|
|
||||||
port = &val->value.ports[0];
|
port = &val->value.ports[0];
|
||||||
val->len = 0;
|
val->len = 0;
|
||||||
for (i = 0; i < RTL8366S_NUM_PORTS; i++) {
|
for (i = 0; i < smi->num_ports; i++) {
|
||||||
if (!(vlan4k.member & BIT(i)))
|
if (!(vlan4k.member & BIT(i)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user