Lines Matching refs:p_buf
696 BT_HDR* p_buf; in PORT_ReadData() local
724 p_buf = (BT_HDR*)fixed_queue_try_peek_first(p_port->rx.queue); in PORT_ReadData()
725 if (p_buf == NULL) break; in PORT_ReadData()
727 if (p_buf->len > max_len) { in PORT_ReadData()
728 memcpy(p_data, (uint8_t*)(p_buf + 1) + p_buf->offset, max_len); in PORT_ReadData()
729 p_buf->offset += max_len; in PORT_ReadData()
730 p_buf->len -= max_len; in PORT_ReadData()
742 memcpy(p_data, (uint8_t*)(p_buf + 1) + p_buf->offset, p_buf->len); in PORT_ReadData()
744 *p_len += p_buf->len; in PORT_ReadData()
745 max_len -= p_buf->len; in PORT_ReadData()
749 p_port->rx.queue_size -= p_buf->len; in PORT_ReadData()
752 p_data += p_buf->len; in PORT_ReadData()
789 static int port_write(tPORT* p_port, BT_HDR* p_buf) { in port_write() argument
793 osi_free(p_buf); in port_write()
809 osi_free(p_buf); in port_write()
824 fixed_queue_enqueue(p_port->tx.queue, p_buf); in port_write()
825 p_port->tx.queue_size += p_buf->len; in port_write()
831 RFCOMM_DataReq(p_port->rfc.p_mcb, p_port->dlci, p_buf); in port_write()
850 BT_HDR* p_buf; in PORT_WriteDataCO() local
895 p_buf = (BT_HDR*)fixed_queue_try_peek_last(p_port->tx.queue); in PORT_WriteDataCO()
896 if ((p_buf != NULL) && in PORT_WriteDataCO()
897 (((int)p_buf->len + available) <= (int)p_port->peer_mtu) && in PORT_WriteDataCO()
898 (((int)p_buf->len + available) <= (int)length)) { in PORT_WriteDataCO()
902 handle, (uint8_t*)(p_buf + 1) + p_buf->offset + p_buf->len, in PORT_WriteDataCO()
918 p_buf->len += (uint16_t)available; in PORT_WriteDataCO()
945 p_buf = (BT_HDR*)osi_malloc(RFCOMM_DATA_BUF_SIZE); in PORT_WriteDataCO()
946 p_buf->offset = L2CAP_MIN_OFFSET + RFCOMM_MIN_OFFSET; in PORT_WriteDataCO()
947 p_buf->layer_specific = handle; in PORT_WriteDataCO()
951 p_buf->len = length; in PORT_WriteDataCO()
952 p_buf->event = BT_EVT_TO_BTU_SP_DATA; in PORT_WriteDataCO()
958 (uint8_t*)(p_buf + 1) + p_buf->offset, in PORT_WriteDataCO()
968 rc = port_write(p_port, p_buf); in PORT_WriteDataCO()
1008 BT_HDR* p_buf; in PORT_WriteData() local
1042 p_buf = (BT_HDR*)fixed_queue_try_peek_last(p_port->tx.queue); in PORT_WriteData()
1043 if ((p_buf != NULL) && ((p_buf->len + max_len) <= p_port->peer_mtu) && in PORT_WriteData()
1044 ((p_buf->len + max_len) <= length)) { in PORT_WriteData()
1045 memcpy((uint8_t*)(p_buf + 1) + p_buf->offset + p_buf->len, p_data, max_len); in PORT_WriteData()
1049 p_buf->len += max_len; in PORT_WriteData()
1065 p_buf = (BT_HDR*)osi_malloc(RFCOMM_DATA_BUF_SIZE); in PORT_WriteData()
1066 p_buf->offset = L2CAP_MIN_OFFSET + RFCOMM_MIN_OFFSET; in PORT_WriteData()
1067 p_buf->layer_specific = handle; in PORT_WriteData()
1071 p_buf->len = length; in PORT_WriteData()
1072 p_buf->event = BT_EVT_TO_BTU_SP_DATA; in PORT_WriteData()
1074 memcpy((uint8_t*)(p_buf + 1) + p_buf->offset, p_data, length); in PORT_WriteData()
1078 rc = port_write(p_port, p_buf); in PORT_WriteData()