14 #include <linux/capability.h>
15 #include <linux/kernel.h>
16 #include <linux/netdevice.h>
17 #include <linux/if_bridge.h>
18 #include <linux/rtnetlink.h>
29 #define BRPORT_ATTR(_name,_mode,_show,_store) \
30 const struct brport_attribute brport_attr_##_name = { \
31 .attr = {.name = __stringify(_name), \
139 return sprintf(buf,
"%d\n", hairpin_mode);
150 show_hairpin_mode, store_hairpin_mode);
152 #ifdef CONFIG_BRIDGE_IGMP_SNOOPING
155 return sprintf(buf,
"%d\n", p->multicast_router);
164 store_multicast_router);
168 &brport_attr_path_cost,
169 &brport_attr_priority,
170 &brport_attr_port_id,
171 &brport_attr_port_no,
172 &brport_attr_designated_root,
173 &brport_attr_designated_bridge,
174 &brport_attr_designated_port,
175 &brport_attr_designated_cost,
177 &brport_attr_change_ack,
178 &brport_attr_config_pending,
179 &brport_attr_message_age_timer,
180 &brport_attr_forward_delay_timer,
181 &brport_attr_hold_timer,
183 &brport_attr_hairpin_mode,
184 #ifdef CONFIG_BRIDGE_IGMP_SNOOPING
185 &brport_attr_multicast_router,
190 #define to_brport_attr(_at) container_of(_at, struct brport_attribute, attr)
191 #define to_brport(obj) container_of(obj, struct net_bridge_port, kobj)
199 return brport_attr->
show(p, buf);
204 const char * buf,
size_t count)
218 return restart_syscall();
220 spin_lock_bh(&p->
br->lock);
221 ret = brport_attr->
store(p, val);
222 spin_unlock_bh(&p->
br->lock);
233 .store = brport_store,
252 for (a = brport_attrs; *
a; ++
a) {
275 p->sysfs_name, p->
dev->name);
277 netdev_notice(br->
dev,
"unable to rename link %s to %s",
278 p->sysfs_name, p->
dev->name);