diff options
Diffstat (limited to 'net/bridge/br_sysfs_br.c')
-rw-r--r-- | net/bridge/br_sysfs_br.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c index 0ab288332fc5..d2ee53b3ad7d 100644 --- a/net/bridge/br_sysfs_br.c +++ b/net/bridge/br_sysfs_br.c | |||
@@ -378,6 +378,43 @@ static ssize_t store_multicast_snooping(struct device *d, | |||
378 | } | 378 | } |
379 | static DEVICE_ATTR(multicast_snooping, S_IRUGO | S_IWUSR, | 379 | static DEVICE_ATTR(multicast_snooping, S_IRUGO | S_IWUSR, |
380 | show_multicast_snooping, store_multicast_snooping); | 380 | show_multicast_snooping, store_multicast_snooping); |
381 | |||
382 | static ssize_t show_hash_elasticity(struct device *d, | ||
383 | struct device_attribute *attr, char *buf) | ||
384 | { | ||
385 | struct net_bridge *br = to_bridge(d); | ||
386 | return sprintf(buf, "%u\n", br->hash_elasticity); | ||
387 | } | ||
388 | |||
389 | static int set_elasticity(struct net_bridge *br, unsigned long val) | ||
390 | { | ||
391 | br->hash_elasticity = val; | ||
392 | return 0; | ||
393 | } | ||
394 | |||
395 | static ssize_t store_hash_elasticity(struct device *d, | ||
396 | struct device_attribute *attr, | ||
397 | const char *buf, size_t len) | ||
398 | { | ||
399 | return store_bridge_parm(d, buf, len, set_elasticity); | ||
400 | } | ||
401 | static DEVICE_ATTR(hash_elasticity, S_IRUGO | S_IWUSR, show_hash_elasticity, | ||
402 | store_hash_elasticity); | ||
403 | |||
404 | static ssize_t show_hash_max(struct device *d, struct device_attribute *attr, | ||
405 | char *buf) | ||
406 | { | ||
407 | struct net_bridge *br = to_bridge(d); | ||
408 | return sprintf(buf, "%u\n", br->hash_max); | ||
409 | } | ||
410 | |||
411 | static ssize_t store_hash_max(struct device *d, struct device_attribute *attr, | ||
412 | const char *buf, size_t len) | ||
413 | { | ||
414 | return store_bridge_parm(d, buf, len, br_multicast_set_hash_max); | ||
415 | } | ||
416 | static DEVICE_ATTR(hash_max, S_IRUGO | S_IWUSR, show_hash_max, | ||
417 | store_hash_max); | ||
381 | #endif | 418 | #endif |
382 | 419 | ||
383 | static struct attribute *bridge_attrs[] = { | 420 | static struct attribute *bridge_attrs[] = { |
@@ -402,6 +439,8 @@ static struct attribute *bridge_attrs[] = { | |||
402 | #ifdef CONFIG_BRIDGE_IGMP_SNOOPING | 439 | #ifdef CONFIG_BRIDGE_IGMP_SNOOPING |
403 | &dev_attr_multicast_router.attr, | 440 | &dev_attr_multicast_router.attr, |
404 | &dev_attr_multicast_snooping.attr, | 441 | &dev_attr_multicast_snooping.attr, |
442 | &dev_attr_hash_elasticity.attr, | ||
443 | &dev_attr_hash_max.attr, | ||
405 | #endif | 444 | #endif |
406 | NULL | 445 | NULL |
407 | }; | 446 | }; |