Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c
Show First 20 Lines • Show All 465 Lines • ▼ Show 20 Lines | "dst bdaddr=%x:%x:%x:%x:%x:%x\n", | ||||
rt->src.b[2], rt->src.b[1], rt->src.b[0], | rt->src.b[2], rt->src.b[1], rt->src.b[0], | ||||
ep->bdaddr.b[5], ep->bdaddr.b[4], ep->bdaddr.b[3], | ep->bdaddr.b[5], ep->bdaddr.b[4], ep->bdaddr.b[3], | ||||
ep->bdaddr.b[2], ep->bdaddr.b[1], ep->bdaddr.b[0]); | ep->bdaddr.b[2], ep->bdaddr.b[1], ep->bdaddr.b[0]); | ||||
mtx_lock(&ng_btsocket_sco_sockets_mtx); | mtx_lock(&ng_btsocket_sco_sockets_mtx); | ||||
pcb = ng_btsocket_sco_pcb_by_addr(&rt->src); | pcb = ng_btsocket_sco_pcb_by_addr(&rt->src); | ||||
if (pcb != NULL) { | if (pcb != NULL) { | ||||
struct socket *so1 = NULL; | struct socket *so1; | ||||
/* pcb is locked */ | /* pcb is locked */ | ||||
/* | |||||
* First check the pending connections queue and if we have | |||||
* space then create new socket and set proper source address. | |||||
*/ | |||||
if (pcb->so->so_qlen <= pcb->so->so_qlimit) { | |||||
CURVNET_SET(pcb->so->so_vnet); | CURVNET_SET(pcb->so->so_vnet); | ||||
so1 = sonewconn(pcb->so, 0); | so1 = sonewconn(pcb->so, 0); | ||||
CURVNET_RESTORE(); | CURVNET_RESTORE(); | ||||
} | |||||
if (so1 == NULL) { | if (so1 == NULL) { | ||||
status = 0x0d; /* Rejected due to limited resources */ | status = 0x0d; /* Rejected due to limited resources */ | ||||
goto respond; | goto respond; | ||||
} | } | ||||
/* | /* | ||||
* If we got here than we have created new socket. So complete | * If we got here than we have created new socket. So complete | ||||
▲ Show 20 Lines • Show All 1,492 Lines • Show Last 20 Lines |