Lines Matching refs:pchb

624 static int ppp_bridge_channels(struct channel *pch, struct channel *pchb)  in ppp_bridge_channels()  argument
632 refcount_inc(&pchb->file.refcnt); in ppp_bridge_channels()
633 rcu_assign_pointer(pch->bridge, pchb); in ppp_bridge_channels()
636 write_lock_bh(&pchb->upl); in ppp_bridge_channels()
637 if (pchb->ppp || in ppp_bridge_channels()
638 rcu_dereference_protected(pchb->bridge, lockdep_is_held(&pchb->upl))) { in ppp_bridge_channels()
639 write_unlock_bh(&pchb->upl); in ppp_bridge_channels()
643 rcu_assign_pointer(pchb->bridge, pch); in ppp_bridge_channels()
644 write_unlock_bh(&pchb->upl); in ppp_bridge_channels()
651 pchb = rcu_dereference_protected(pch->bridge, lockdep_is_held(&pch->upl)); in ppp_bridge_channels()
656 if (pchb) in ppp_bridge_channels()
657 if (refcount_dec_and_test(&pchb->file.refcnt)) in ppp_bridge_channels()
658 ppp_destroy_channel(pchb); in ppp_bridge_channels()
665 struct channel *pchb, *pchbb; in ppp_unbridge_channels() local
668 pchb = rcu_dereference_protected(pch->bridge, lockdep_is_held(&pch->upl)); in ppp_unbridge_channels()
669 if (!pchb) { in ppp_unbridge_channels()
681 write_lock_bh(&pchb->upl); in ppp_unbridge_channels()
682 pchbb = rcu_dereference_protected(pchb->bridge, lockdep_is_held(&pchb->upl)); in ppp_unbridge_channels()
684 RCU_INIT_POINTER(pchb->bridge, NULL); in ppp_unbridge_channels()
685 write_unlock_bh(&pchb->upl); in ppp_unbridge_channels()
693 if (refcount_dec_and_test(&pchb->file.refcnt)) in ppp_unbridge_channels()
694 ppp_destroy_channel(pchb); in ppp_unbridge_channels()
734 struct channel *pch, *pchb; in ppp_ioctl() local
757 pchb = ppp_find_channel(pn, unit); in ppp_ioctl()
761 if (pchb) in ppp_ioctl()
762 refcount_inc(&pchb->file.refcnt); in ppp_ioctl()
764 if (!pchb) in ppp_ioctl()
766 err = ppp_bridge_channels(pch, pchb); in ppp_ioctl()
768 if (refcount_dec_and_test(&pchb->file.refcnt)) in ppp_ioctl()
769 ppp_destroy_channel(pchb); in ppp_ioctl()
2250 struct channel *pchb; in ppp_channel_bridge_input() local
2253 pchb = rcu_dereference(pch->bridge); in ppp_channel_bridge_input()
2254 if (!pchb) in ppp_channel_bridge_input()
2257 spin_lock(&pchb->downl); in ppp_channel_bridge_input()
2258 if (!pchb->chan) { in ppp_channel_bridge_input()
2264 skb_scrub_packet(skb, !net_eq(pch->chan_net, pchb->chan_net)); in ppp_channel_bridge_input()
2265 if (!pchb->chan->ops->start_xmit(pchb->chan, skb)) in ppp_channel_bridge_input()
2269 spin_unlock(&pchb->downl); in ppp_channel_bridge_input()
2274 return !!pchb; in ppp_channel_bridge_input()