Lines Matching refs:pcb
295 tPAN_CONN* pcb = pan_get_pcb_by_addr(rem_bda); in PAN_Connect() local
300 if ((pan_cb.num_conns > 1) || (pan_cb.num_conns && (!pcb))) { in PAN_Connect()
322 if (pan_cb.num_conns && pan_cb.active_role == PAN_ROLE_CLIENT && !pcb) { in PAN_Connect()
339 if (!pcb) pcb = pan_allocate_pcb(rem_bda, BNEP_INVALID_HANDLE); in PAN_Connect()
340 if (!pcb) { in PAN_Connect()
346 if (pcb->con_state == PAN_STATE_IDLE) { in PAN_Connect()
348 } else if (pcb->con_state == PAN_STATE_CONNECTED) { in PAN_Connect()
349 pcb->con_flags |= PAN_FLAGS_CONN_COMPLETED; in PAN_Connect()
354 pcb->con_state = PAN_STATE_CONN_START; in PAN_Connect()
355 pcb->prv_src_uuid = pcb->src_uuid; in PAN_Connect()
356 pcb->prv_dst_uuid = pcb->dst_uuid; in PAN_Connect()
358 pcb->src_uuid = src_uuid; in PAN_Connect()
359 pcb->dst_uuid = dst_uuid; in PAN_Connect()
363 Uuid::From16Bit(dst_uuid), &(pcb->handle), mx_chan_id); in PAN_Connect()
365 pan_release_pcb(pcb); in PAN_Connect()
372 *handle = pcb->handle; in PAN_Connect()
391 tPAN_CONN* pcb; in PAN_Disconnect() local
395 pcb = pan_get_pcb_by_handle(handle); in PAN_Disconnect()
396 if (!pcb) { in PAN_Disconnect()
401 result = BNEP_Disconnect(pcb->handle); in PAN_Disconnect()
402 if (pcb->con_state != PAN_STATE_IDLE) pan_cb.num_conns--; in PAN_Disconnect()
404 if (pan_cb.pan_bridge_req_cb && pcb->src_uuid == UUID_SERVCLASS_NAP) in PAN_Disconnect()
405 (*pan_cb.pan_bridge_req_cb)(pcb->rem_bda, false); in PAN_Disconnect()
407 BTM_LogHistory(kBtmLogTag, pcb->rem_bda, "Disconnect"); in PAN_Disconnect()
409 pan_release_pcb(pcb); in PAN_Disconnect()
458 if (pan_cb.pcb[i].con_state == PAN_STATE_CONNECTED) in PAN_Write()
459 BNEP_Write(pan_cb.pcb[i].handle, dst, p_data, len, protocol, src, ext); in PAN_Write()
499 tPAN_CONN* pcb; in PAN_WriteBuf() local
513 if (pan_cb.pcb[i].con_state == PAN_STATE_CONNECTED) in PAN_WriteBuf()
514 BNEP_Write(pan_cb.pcb[i].handle, dst, data, p_buf->len, protocol, src, in PAN_WriteBuf()
525 if (pan_cb.pcb[i].con_state == PAN_STATE_CONNECTED && in PAN_WriteBuf()
526 pan_cb.pcb[i].src_uuid == UUID_SERVCLASS_PANU) in PAN_WriteBuf()
537 BNEP_WriteBuf(pan_cb.pcb[i].handle, dst, p_buf, protocol, src, ext); in PAN_WriteBuf()
546 pan_cb.pcb[i].write.octets += p_buf->len; in PAN_WriteBuf()
547 pan_cb.pcb[i].write.packets++; in PAN_WriteBuf()
554 pcb = pan_get_pcb_by_handle(handle); in PAN_WriteBuf()
555 if (!pcb) { in PAN_WriteBuf()
561 if (pcb->con_state != PAN_STATE_CONNECTED) { in PAN_WriteBuf()
563 pcb->write.drops++; in PAN_WriteBuf()
569 result = BNEP_WriteBuf(pcb->handle, dst, p_buf, protocol, src, ext); in PAN_WriteBuf()
572 pcb->write.errors++; in PAN_WriteBuf()
576 pcb->write.errors++; in PAN_WriteBuf()
580 pcb->write.octets += len; in PAN_WriteBuf()
581 pcb->write.packets++; in PAN_WriteBuf()
607 tPAN_CONN* pcb; in PAN_SetProtocolFilters() local
610 pcb = pan_get_pcb_by_handle(handle); in PAN_SetProtocolFilters()
611 if (!pcb) { in PAN_SetProtocolFilters()
616 tBNEP_RESULT result = BNEP_SetProtocolFilters(pcb->handle, num_filters, in PAN_SetProtocolFilters()
646 tPAN_CONN* pcb; in PAN_SetMulticastFilters() local
649 pcb = pan_get_pcb_by_handle(handle); in PAN_SetMulticastFilters()
650 if (!pcb) { in PAN_SetMulticastFilters()
655 tBNEP_RESULT result = BNEP_SetMulticastFilters(pcb->handle, num_mcast_filters, in PAN_SetMulticastFilters()
697 const tPAN_CONN* pcb = &pan_cb.pcb[0]; in PAN_Dumpsys() local
698 for (int i = 0; i < MAX_PAN_CONNS; i++, pcb++) { in PAN_Dumpsys()
699 if (pcb->con_state == PAN_STATE_IDLE) continue; in PAN_Dumpsys()
700 LOG_DUMPSYS(fd, " Id:%d peer:%s", i, ADDRESS_TO_LOGGABLE_CSTR(pcb->rem_bda)); in PAN_Dumpsys()
704 (unsigned long)pcb->read.packets, (unsigned long)pcb->read.octets, in PAN_Dumpsys()
705 (unsigned long)pcb->read.errors, (unsigned long)pcb->read.drops); in PAN_Dumpsys()
709 (unsigned long)pcb->write.packets, (unsigned long)pcb->write.octets, in PAN_Dumpsys()
710 (unsigned long)pcb->write.errors, (unsigned long)pcb->write.drops); in PAN_Dumpsys()
714 pcb->src_uuid, pcb->dst_uuid, pcb->prv_src_uuid, in PAN_Dumpsys()
715 pcb->prv_dst_uuid, pcb->bad_pkts_rcvd); in PAN_Dumpsys()