]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/bridge/br_sysfs_br.c
arm: imx: tx6: mfgtool defconfig
[karo-tx-linux.git] / net / bridge / br_sysfs_br.c
index 8dac65552f1901817489421c2042553a663cbaf9..c9e2572b15f400f9183606922a87f024ffe6570f 100644 (file)
@@ -312,10 +312,19 @@ static ssize_t group_addr_store(struct device *d,
            new_addr[5] == 3)           /* 802.1X PAE address */
                return -EINVAL;
 
+       if (!rtnl_trylock())
+               return restart_syscall();
+
        spin_lock_bh(&br->lock);
        for (i = 0; i < 6; i++)
                br->group_addr[i] = new_addr[i];
        spin_unlock_bh(&br->lock);
+
+       br->group_addr_set = true;
+       br_recalculate_fwd_mask(br);
+
+       rtnl_unlock();
+
        return len;
 }
 
@@ -700,6 +709,22 @@ static ssize_t vlan_filtering_store(struct device *d,
        return store_bridge_parm(d, buf, len, br_vlan_filter_toggle);
 }
 static DEVICE_ATTR_RW(vlan_filtering);
+
+static ssize_t vlan_protocol_show(struct device *d,
+                                 struct device_attribute *attr,
+                                 char *buf)
+{
+       struct net_bridge *br = to_bridge(d);
+       return sprintf(buf, "%#06x\n", ntohs(br->vlan_proto));
+}
+
+static ssize_t vlan_protocol_store(struct device *d,
+                                  struct device_attribute *attr,
+                                  const char *buf, size_t len)
+{
+       return store_bridge_parm(d, buf, len, br_vlan_set_proto);
+}
+static DEVICE_ATTR_RW(vlan_protocol);
 #endif
 
 static struct attribute *bridge_attrs[] = {
@@ -745,6 +770,7 @@ static struct attribute *bridge_attrs[] = {
 #endif
 #ifdef CONFIG_BRIDGE_VLAN_FILTERING
        &dev_attr_vlan_filtering.attr,
+       &dev_attr_vlan_protocol.attr,
 #endif
        NULL
 };