Lines Matching refs:p_buf
1071 BT_HDR* p_buf; in PORT_Purge() local
1093 while ((p_buf = (BT_HDR*)fixed_queue_try_dequeue(p_port->rx.queue)) != NULL) in PORT_Purge()
1094 osi_free(p_buf); in PORT_Purge()
1107 while ((p_buf = (BT_HDR*)fixed_queue_try_dequeue(p_port->tx.queue)) != NULL) in PORT_Purge()
1108 osi_free(p_buf); in PORT_Purge()
1143 BT_HDR* p_buf; in PORT_ReadData() local
1171 p_buf = (BT_HDR*)fixed_queue_try_peek_first(p_port->rx.queue); in PORT_ReadData()
1172 if (p_buf == NULL) break; in PORT_ReadData()
1174 if (p_buf->len > max_len) { in PORT_ReadData()
1175 memcpy(p_data, (uint8_t*)(p_buf + 1) + p_buf->offset, max_len); in PORT_ReadData()
1176 p_buf->offset += max_len; in PORT_ReadData()
1177 p_buf->len -= max_len; in PORT_ReadData()
1189 memcpy(p_data, (uint8_t*)(p_buf + 1) + p_buf->offset, p_buf->len); in PORT_ReadData()
1191 *p_len += p_buf->len; in PORT_ReadData()
1192 max_len -= p_buf->len; in PORT_ReadData()
1196 p_port->rx.queue_size -= p_buf->len; in PORT_ReadData()
1199 p_data += p_buf->len; in PORT_ReadData()
1238 BT_HDR* p_buf; in PORT_Read() local
1258 p_buf = (BT_HDR*)fixed_queue_try_dequeue(p_port->rx.queue); in PORT_Read()
1259 if (p_buf) { in PORT_Read()
1260 p_port->rx.queue_size -= p_buf->len; in PORT_Read()
1271 *pp_buf = p_buf; in PORT_Read()
1286 static int port_write(tPORT* p_port, BT_HDR* p_buf) { in port_write() argument
1290 osi_free(p_buf); in port_write()
1306 osi_free(p_buf); in port_write()
1321 fixed_queue_enqueue(p_port->tx.queue, p_buf); in port_write()
1322 p_port->tx.queue_size += p_buf->len; in port_write()
1328 RFCOMM_DataReq(p_port->rfc.p_mcb, p_port->dlci, p_buf); in port_write()
1344 int PORT_Write(uint16_t handle, BT_HDR* p_buf) { in PORT_Write() argument
1353 osi_free(p_buf); in PORT_Write()
1360 osi_free(p_buf); in PORT_Write()
1367 osi_free(p_buf); in PORT_Write()
1371 rc = port_write(p_port, p_buf); in PORT_Write()
1405 BT_HDR* p_buf; in PORT_WriteDataCO() local
1450 p_buf = (BT_HDR*)fixed_queue_try_peek_last(p_port->tx.queue); in PORT_WriteDataCO()
1451 if ((p_buf != NULL) && in PORT_WriteDataCO()
1452 (((int)p_buf->len + available) <= (int)p_port->peer_mtu) && in PORT_WriteDataCO()
1453 (((int)p_buf->len + available) <= (int)length)) { in PORT_WriteDataCO()
1457 handle, (uint8_t*)(p_buf + 1) + p_buf->offset + p_buf->len, in PORT_WriteDataCO()
1473 p_buf->len += (uint16_t)available; in PORT_WriteDataCO()
1500 p_buf = (BT_HDR*)osi_malloc(RFCOMM_DATA_BUF_SIZE); in PORT_WriteDataCO()
1501 p_buf->offset = L2CAP_MIN_OFFSET + RFCOMM_MIN_OFFSET; in PORT_WriteDataCO()
1502 p_buf->layer_specific = handle; in PORT_WriteDataCO()
1506 p_buf->len = length; in PORT_WriteDataCO()
1507 p_buf->event = BT_EVT_TO_BTU_SP_DATA; in PORT_WriteDataCO()
1513 (uint8_t*)(p_buf + 1) + p_buf->offset, in PORT_WriteDataCO()
1523 rc = port_write(p_port, p_buf); in PORT_WriteDataCO()
1563 BT_HDR* p_buf; in PORT_WriteData() local
1597 p_buf = (BT_HDR*)fixed_queue_try_peek_last(p_port->tx.queue); in PORT_WriteData()
1598 if ((p_buf != NULL) && ((p_buf->len + max_len) <= p_port->peer_mtu) && in PORT_WriteData()
1599 ((p_buf->len + max_len) <= length)) { in PORT_WriteData()
1600 memcpy((uint8_t*)(p_buf + 1) + p_buf->offset + p_buf->len, p_data, max_len); in PORT_WriteData()
1604 p_buf->len += max_len; in PORT_WriteData()
1620 p_buf = (BT_HDR*)osi_malloc(RFCOMM_DATA_BUF_SIZE); in PORT_WriteData()
1621 p_buf->offset = L2CAP_MIN_OFFSET + RFCOMM_MIN_OFFSET; in PORT_WriteData()
1622 p_buf->layer_specific = handle; in PORT_WriteData()
1626 p_buf->len = length; in PORT_WriteData()
1627 p_buf->event = BT_EVT_TO_BTU_SP_DATA; in PORT_WriteData()
1629 memcpy((uint8_t*)(p_buf + 1) + p_buf->offset, p_data, length); in PORT_WriteData()
1633 rc = port_write(p_port, p_buf); in PORT_WriteData()
1687 BT_HDR* p_buf = (BT_HDR*)osi_malloc(RFCOMM_CMD_BUF_SIZE); in PORT_Test() local
1688 p_buf->offset = L2CAP_MIN_OFFSET + RFCOMM_MIN_OFFSET + 2; in PORT_Test()
1689 p_buf->len = len; in PORT_Test()
1691 memcpy((uint8_t*)(p_buf + 1) + p_buf->offset, p_data, p_buf->len); in PORT_Test()
1693 rfc_send_test(p_port->rfc.p_mcb, true, p_buf); in PORT_Test()