• Home
  • Raw
  • Download

Lines Matching refs:p

67 void br_port_carrier_check(struct net_bridge_port *p)  in br_port_carrier_check()  argument
69 struct net_device *dev = p->dev; in br_port_carrier_check()
70 struct net_bridge *br = p->br; in br_port_carrier_check()
73 p->path_cost = port_cost(dev); in br_port_carrier_check()
78 if (p->state == BR_STATE_DISABLED) in br_port_carrier_check()
79 br_stp_enable_port(p); in br_port_carrier_check()
81 if (p->state != BR_STATE_DISABLED) in br_port_carrier_check()
82 br_stp_disable_port(p); in br_port_carrier_check()
90 struct net_bridge_port *p in release_nbp() local
92 kfree(p); in release_nbp()
102 static void destroy_nbp(struct net_bridge_port *p) in destroy_nbp() argument
104 struct net_device *dev = p->dev; in destroy_nbp()
106 p->br = NULL; in destroy_nbp()
107 p->dev = NULL; in destroy_nbp()
110 kobject_put(&p->kobj); in destroy_nbp()
115 struct net_bridge_port *p = in destroy_nbp_rcu() local
117 destroy_nbp(p); in destroy_nbp_rcu()
129 static void del_nbp(struct net_bridge_port *p) in del_nbp() argument
131 struct net_bridge *br = p->br; in del_nbp()
132 struct net_device *dev = p->dev; in del_nbp()
139 br_stp_disable_port(p); in del_nbp()
142 br_ifinfo_notify(RTM_DELLINK, p); in del_nbp()
144 br_fdb_delete_by_port(br, p, 1); in del_nbp()
146 list_del_rcu(&p->list); in del_nbp()
150 kobject_uevent(&p->kobj, KOBJ_REMOVE); in del_nbp()
151 kobject_del(&p->kobj); in del_nbp()
153 call_rcu(&p->rcu, destroy_nbp_rcu); in del_nbp()
159 struct net_bridge_port *p, *n; in del_br() local
161 list_for_each_entry_safe(p, n, &br->port_list, list) { in del_br()
162 del_nbp(p); in del_br()
220 struct net_bridge_port *p; in find_portno() local
229 list_for_each_entry(p, &br->port_list, list) { in find_portno()
230 set_bit(p->port_no, inuse); in find_portno()
243 struct net_bridge_port *p; in new_nbp() local
249 p = kzalloc(sizeof(*p), GFP_KERNEL); in new_nbp()
250 if (p == NULL) in new_nbp()
253 p->br = br; in new_nbp()
255 p->dev = dev; in new_nbp()
256 p->path_cost = port_cost(dev); in new_nbp()
257 p->priority = 0x8000 >> BR_PORT_BITS; in new_nbp()
258 p->port_no = index; in new_nbp()
259 br_init_port(p); in new_nbp()
260 p->state = BR_STATE_DISABLED; in new_nbp()
261 br_stp_port_timer_init(p); in new_nbp()
263 return p; in new_nbp()
328 const struct net_bridge_port *p; in br_min_mtu() local
336 list_for_each_entry(p, &br->port_list, list) { in br_min_mtu()
337 if (!mtu || p->dev->mtu < mtu) in br_min_mtu()
338 mtu = p->dev->mtu; in br_min_mtu()
349 struct net_bridge_port *p; in br_features_recompute() local
358 list_for_each_entry(p, &br->port_list, list) { in br_features_recompute()
360 p->dev->features, mask); in br_features_recompute()
370 struct net_bridge_port *p; in br_add_if() local
382 p = new_nbp(br, dev); in br_add_if()
383 if (IS_ERR(p)) in br_add_if()
384 return PTR_ERR(p); in br_add_if()
390 err = kobject_init_and_add(&p->kobj, &brport_ktype, &(dev->dev.kobj), in br_add_if()
395 err = br_fdb_insert(br, p, dev->dev_addr); in br_add_if()
399 err = br_sysfs_addif(p); in br_add_if()
403 rcu_assign_pointer(dev->br_port, p); in br_add_if()
406 list_add_rcu(&p->list, &br->port_list); in br_add_if()
414 br_stp_enable_port(p); in br_add_if()
417 br_ifinfo_notify(RTM_NEWLINK, p); in br_add_if()
421 kobject_uevent(&p->kobj, KOBJ_ADD); in br_add_if()
425 br_fdb_delete_by_port(br, p, 1); in br_add_if()
427 kobject_del(&p->kobj); in br_add_if()
429 kobject_put(&p->kobj); in br_add_if()
433 kfree(p); in br_add_if()
440 struct net_bridge_port *p = dev->br_port; in br_del_if() local
442 if (!p || p->br != br) in br_del_if()
445 del_nbp(p); in br_del_if()