]> xenbits.xen.org Git - xenclient/linux-2.6.27-pq.git/commitdiff
[xenclient-kernel] Add patch to force bridge link state
authorThomas Horsten <thomas.horsten@citrix.com>
Thu, 9 Jul 2009 16:28:26 +0000 (17:28 +0100)
committerThomas Horsten <thomas.horsten@citrix.com>
Thu, 9 Jul 2009 16:28:26 +0000 (17:28 +0100)
This patch adds a property "linkstate" to
/sys/class/device/<brid>/bridge/ which can be written to control the
carrier of the bridge (0 to disable carrier, 1 to enable).

master/bridge-carrier [new file with mode: 0644]
master/series

diff --git a/master/bridge-carrier b/master/bridge-carrier
new file mode 100644 (file)
index 0000000..7e68e9a
--- /dev/null
@@ -0,0 +1,36 @@
+diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
+index 158dee8..2fa3bd9 100644
+--- a/net/bridge/br_sysfs_br.c
++++ b/net/bridge/br_sysfs_br.c
+@@ -344,6 +344,23 @@ static ssize_t store_flush(struct device *d,
+ }
+ static DEVICE_ATTR(flush, S_IWUSR, NULL, store_flush);
++static int set_link_state(struct net_bridge *br, unsigned long val)
++{
++      if (val)
++              netif_carrier_on(br->dev);
++      else
++              netif_carrier_off(br->dev);
++      return 0;
++}
++
++static ssize_t store_link_state(struct device *d,
++                                 struct device_attribute *attr,
++                                 const char *buf, size_t len)
++{
++      return store_bridge_parm(d, buf, len, set_link_state);
++}
++static DEVICE_ATTR(link_state, S_IWUSR, NULL, store_link_state);
++
+ static struct attribute *bridge_attrs[] = {
+       &dev_attr_forward_delay.attr,
+       &dev_attr_hello_time.attr,
+@@ -363,6 +380,7 @@ static struct attribute *bridge_attrs[] = {
+       &dev_attr_gc_timer.attr,
+       &dev_attr_group_addr.attr,
+       &dev_attr_flush.attr,
++      &dev_attr_link_state.attr,
+       NULL
+ };
index 497cfdc9a0b3e47f8fa8de6f405755b7540faea2..32f96fd3337c43c20fcce6584ac86dcc144bd116 100644 (file)
@@ -264,3 +264,5 @@ remove-release-flr
 intel-hda-2.6.30
 flr-change-sbr-d3r-lists
 on-the-fly-cx-change
+bridge-carrier
+