X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=target%2Flinux%2Framips%2Ffiles-4.9%2Fdrivers%2Fnet%2Fethernet%2Fmtk%2Fmt7530.c;h=5216cb5c6618d018c4075791037cf91bb0398795;hb=dc7a1e855513d415ac0837b34400b98052c2090c;hp=21f892655a5a3d8a8fbf61623657e44654b9f4b0;hpb=341b1427fc247fd4c53f390f2f17258dcf052a50;p=openwrt%2Fstaging%2Fkaloz.git diff --git a/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mt7530.c b/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mt7530.c index 21f892655a..5216cb5c66 100644 --- a/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mt7530.c +++ b/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mt7530.c @@ -478,6 +478,14 @@ mt7530_set_vid(struct switch_dev *dev, const struct switch_attr *attr, return 0; } +static int +mt7621_get_vid(struct switch_dev *dev, const struct switch_attr *attr, + struct switch_val *val) +{ + val->value.i = val->port_vlan; + return 0; +} + static int mt7530_get_vid(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val) @@ -835,6 +843,17 @@ static const struct switch_attr mt7621_port[] = { }, }; +static const struct switch_attr mt7621_vlan[] = { + { + .type = SWITCH_TYPE_INT, + .name = "vid", + .description = "VLAN ID (0-4094)", + .set = mt7530_set_vid, + .get = mt7621_get_vid, + .max = 4094, + }, +}; + static const struct switch_attr mt7530_port[] = { { .type = SWITCH_TYPE_STRING, @@ -866,8 +885,8 @@ static const struct switch_dev_ops mt7621_ops = { .n_attr = ARRAY_SIZE(mt7621_port), }, .attr_vlan = { - .attr = mt7530_vlan, - .n_attr = ARRAY_SIZE(mt7530_vlan), + .attr = mt7621_vlan, + .n_attr = ARRAY_SIZE(mt7621_vlan), }, .get_vlan_ports = mt7530_get_vlan_ports, .set_vlan_ports = mt7530_set_vlan_ports,