FreeBSD/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c
/*
 * Look for the socket in CONNECTING state with given source and destination
 * addresses. Caller must hold ng_btsocket_sco_sockets_mtx.
 * Returns with locked pcb.
 */
Look for the socket in CONNECTING state with given source and destination
addresses. Caller must hold ng_btsocket_sco_sockets_mtx.
Returns with locked pcb.
Look for the socket in CONNECTING state with given source and destination addresses . Caller must hold ng_btsocket_sco_sockets_mtx . Returns with locked pcb .
static ng_btsocket_sco_pcb_p
ng_btsocket_sco_pcb_by_addrs(bdaddr_p src, bdaddr_p dst)
{
	ng_btsocket_sco_pcb_p	p = NULL;
	mtx_assert(&ng_btsocket_sco_sockets_mtx, MA_OWNED);
	LIST_FOREACH(p, &ng_btsocket_sco_sockets, next) {
		mtx_lock(&p->pcb_mtx);
		if (p->state == NG_BTSOCKET_SCO_CONNECTING &&
		    bcmp(src, &p->src, sizeof(p->src)) == 0 &&
		    bcmp(dst, &p->dst, sizeof(p->dst)) == 0)
			return (p); 
		mtx_unlock(&p->pcb_mtx);
	}
	return (NULL);
}
static ng_btsocket_sco_pcb_p ng_btsocket_sco_pcb_by_addrs ( bdaddr_p src , bdaddr_p dst ) { ng_btsocket_sco_pcb_p p = NULL ; mtx_assert ( & ng_btsocket_sco_sockets_mtx , MA_OWNED ) ; LIST_FOREACH ( p , & ng_btsocket_sco_sockets , next ) { mtx_lock ( & p -> pcb_mtx ) ; if ( p -> state == NG_BTSOCKET_SCO_CONNECTING && bcmp ( src , & p -> src , sizeof ( p -> src ) ) == 0 && bcmp ( dst , & p -> dst , sizeof ( p -> dst ) ) == 0 ) return ( p ) ; mtx_unlock ( & p -> pcb_mtx ) ; } return ( NULL ) ; }
Look for the socket in CONNECTING state with given source and destination
 addresses.
Look for the socket in CONNECTING state with given source and destination addresses .
/* return with locked pcb */