search for: br_get_port

Displaying 5 results from an estimated 5 matches for "br_get_port".

2007 Apr 18
0
[Bridge] [PATCH] (4/11) bridge - ioctl cleanup and consolidation
...num) -{ - struct net_device *dev; - int i = 0; - - read_lock(&dev_base_lock); - for (dev = dev_base; dev && i < num; dev = dev->next) { - if (dev->priv_flags & IFF_EBRIDGE) - indices[i++] = dev->ifindex; - } - read_unlock(&dev_base_lock); - - return i; -} - -void br_get_port_ifindices(struct net_bridge *br, int *ifindices, int num) -{ - struct net_bridge_port *p; - - rcu_read_lock(); - list_for_each_entry_rcu(p, &br->port_list, list) { - if (p->port_no < num) - ifindices[p->port_no] = p->dev->ifindex; - } - rcu_read_unlock(); -} - - void __exi...
2007 Apr 18
4
[Bridge] [Patch] [2.6.7] Bridge - Fix BPDU message_age
...================ --- linux-2.6.7/net/bridge/br_stp.c.orig 2004-06-17 20:17:27.000000000 +0530 +++ linux-2.6.7/net/bridge/br_stp.c 2004-06-22 19:32:49.015908632 +0530 @@ -161,20 +161,19 @@ void br_transmit_config(struct net_bridg if (!br_is_root_bridge(br)) { struct net_bridge_port *root = br_get_port(br, br->root_port); - bpdu.max_age = root->message_age_timer.expires - jiffies; - - if (bpdu.max_age <= 0) bpdu.max_age = 1; + bpdu.message_age = br->max_age - + (root->message_age_timer.expires - jiffies) + 1; } bpdu.max_age = br->max_age; bpdu.hello_time = br->hel...
2007 Apr 18
5
[Bridge] RFC: [PATCH] bridge vlan integration
...;untagged = 1; + vlan->filter[0] = 1 << 1; +} + +/* ioctl functions */ +int br_vlan_set_untagged(struct net_bridge *br, + unsigned int port, unsigned int vid) +{ + struct net_bridge_port_vlan *vlan; + + if (vid > 4094) + return -EINVAL; + + if (port) { + struct net_bridge_port *p = br_get_port(br, port); + + if (p == NULL) + return -EINVAL; + vlan = &p->vlan; + } else { + vlan = &br->vlan; + } + + vlan->untagged = vid; + + return 0; +} + +int br_vlan_set_filter(struct net_bridge *br, + unsigned int cmd, unsigned int port, unsigned int vid) +{ + struct net_br...
2007 Apr 18
0
[Bridge] [PATCH 2.6] Fix message age in bridge STP config packets
...ot;, @@ -157,24 +162,25 @@ bpdu.root_path_cost = br->root_path_cost; bpdu.bridge_id = br->bridge_id; bpdu.port_id = p->port_id; - bpdu.message_age = 0; - if (!br_is_root_bridge(br)) { + if (br_is_root_bridge(br)) + bpdu.message_age = 0; + else { struct net_bridge_port *root = br_get_port(br, br->root_port); - bpdu.max_age = root->message_age_timer.expires - jiffies; - - if (bpdu.max_age <= 0) bpdu.max_age = 1; + bpdu.message_age = br->max_age + - (root->message_age_timer.expires - jiffies) + + MESSAGE_AGE_INCR; } bpdu.max_age = br->max_age; bpdu.hello...
2007 Apr 18
1
[Bridge] [PATCH 2.4] Bridge STP message age
...pdu.root_path_cost = br->root_path_cost; bpdu.bridge_id = br->bridge_id; bpdu.port_id = p->port_id; - bpdu.message_age = 0; - if (!br_is_root_bridge(br)) { + if (br_is_root_bridge(br)) + bpdu.message_age = 0; + else { struct net_bridge_port *root; - unsigned long age; root = br_get_port(br, br->root_port); - age = br_timer_get_residue(&root->message_age_timer) + 1; - bpdu.message_age = age; + bpdu.message_age = br_timer_get_residue(&root->message_age_timer) + + MESSAGE_AGE_INCR; } bpdu.max_age = br->max_age; bpdu.hello_time = br->hello_time; bp...