X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/b02fa11a17a01d456ef0b71fb9d3725a6e0ed264..f03c775c625b9203be0b7e0d5bf0dff4e4041a63:/target/linux/generic-2.6/files/drivers/net/phy/swconfig.c diff --git a/target/linux/generic-2.6/files/drivers/net/phy/swconfig.c b/target/linux/generic-2.6/files/drivers/net/phy/swconfig.c index bb49df83e..dea8e78b7 100644 --- a/target/linux/generic-2.6/files/drivers/net/phy/swconfig.c +++ b/target/linux/generic-2.6/files/drivers/net/phy/swconfig.c @@ -92,7 +92,7 @@ swconfig_set_vlan_ports(struct switch_dev *dev, const struct switch_attr *attr, if (ports[i].id >= dev->ports) return -EINVAL; - if (dev->set_port_pvid && !(ports[i].flags & SWITCH_PORT_FLAG_TAGGED)) + if (dev->set_port_pvid && !(ports[i].flags & (1 << SWITCH_PORT_FLAG_TAGGED))) dev->set_port_pvid(dev, ports[i].id, val->port_vlan); } @@ -688,7 +688,7 @@ swconfig_get_attr(struct sk_buff *skb, struct genl_info *info) memset(&val, 0, sizeof(val)); attr = swconfig_lookup_attr(dev, info, &val); if (!attr || !attr->get) - goto error_dev; + goto error; if (attr->type == SWITCH_TYPE_PORTS) { val.value.ports = dev->portbuf; @@ -737,9 +737,8 @@ swconfig_get_attr(struct sk_buff *skb, struct genl_info *info) nla_put_failure: if (msg) nlmsg_free(msg); -error_dev: - swconfig_put_dev(dev); error: + swconfig_put_dev(dev); if (!err) err = -ENOMEM; return err; @@ -761,6 +760,7 @@ swconfig_send_switch(struct sk_buff *msg, u32 pid, u32 seq, int flags, NLA_PUT_STRING(msg, SWITCH_ATTR_DEV_NAME, dev->devname); NLA_PUT_U32(msg, SWITCH_ATTR_VLANS, dev->vlans); NLA_PUT_U32(msg, SWITCH_ATTR_PORTS, dev->ports); + NLA_PUT_U32(msg, SWITCH_ATTR_CPU_PORT, dev->cpu_port); return genlmsg_end(msg, hdr); nla_put_failure: @@ -886,6 +886,7 @@ unregister_switch(struct switch_dev *dev) swconfig_lock(); list_del(&dev->dev_list); swconfig_unlock(); + spin_unlock(&dev->lock); } EXPORT_SYMBOL_GPL(unregister_switch);