Lines Matching refs:p_pkt
222 static uint8_t* avrc_get_data_ptr(BT_HDR* p_pkt) { in avrc_get_data_ptr() argument
223 return (uint8_t*)(p_pkt + 1) + p_pkt->offset; in avrc_get_data_ptr()
236 static BT_HDR* avrc_copy_packet(BT_HDR* p_pkt, int rsp_pkt_len) { in avrc_copy_packet() argument
237 const int offset = MAX(AVCT_MSG_OFFSET, p_pkt->offset); in avrc_copy_packet()
238 const int pkt_len = MAX(rsp_pkt_len, p_pkt->len); in avrc_copy_packet()
242 memcpy(p_pkt_copy, p_pkt, BT_HDR_SIZE); in avrc_copy_packet()
244 uint8_t* p_data = avrc_get_data_ptr(p_pkt); in avrc_copy_packet()
246 memcpy(p_data_copy, p_data, p_pkt->len); in avrc_copy_packet()
306 BT_HDR *p_pkt_old, *p_pkt; in avrc_send_continue_frag() local
311 p_pkt = p_fcb->p_fmsg; in avrc_send_continue_frag()
314 label, p_pkt->len); in avrc_send_continue_frag()
315 if (p_pkt->len > AVRC_MAX_CTRL_DATA_LEN) { in avrc_send_continue_frag()
316 int offset_len = MAX(AVCT_MSG_OFFSET, p_pkt->offset); in avrc_send_continue_frag()
318 p_pkt = (BT_HDR*)osi_malloc(AVRC_PACKET_LEN + offset_len + BT_HDR_SIZE); in avrc_send_continue_frag()
319 p_pkt->len = AVRC_MAX_CTRL_DATA_LEN; in avrc_send_continue_frag()
320 p_pkt->offset = AVCT_MSG_OFFSET; in avrc_send_continue_frag()
321 p_pkt->layer_specific = p_pkt_old->layer_specific; in avrc_send_continue_frag()
322 p_pkt->event = p_pkt_old->event; in avrc_send_continue_frag()
324 p_data = (uint8_t*)(p_pkt + 1) + p_pkt->offset; in avrc_send_continue_frag()
341 return AVCT_MsgReq(handle, label, cr, p_pkt); in avrc_send_continue_frag()
354 BT_HDR* p_pkt, in avrc_proc_vendor_command() argument
364 p_begin = (uint8_t*)(p_pkt + 1) + p_pkt->offset; in avrc_proc_vendor_command()
382 p_begin = (uint8_t*)(p_pkt + 1) + p_pkt->offset; in avrc_proc_vendor_command()
390 p_pkt->len = (p_data - p_begin); in avrc_proc_vendor_command()
392 AVCT_MsgReq(handle, label, AVCT_RSP, p_pkt); in avrc_proc_vendor_command()
429 p_rsp->offset = p_pkt->offset; in avrc_proc_vendor_command()
430 p_data = (uint8_t*)(p_rsp + 1) + p_pkt->offset; in avrc_proc_vendor_command()
454 BT_HDR* p_pkt = *pp_pkt; in avrc_proc_far_msg() local
467 p_data = (uint8_t*)(p_pkt + 1) + p_pkt->offset; in avrc_proc_far_msg()
491 memcpy(p_rcb->p_rmsg, p_pkt, sizeof(BT_HDR)); /* Copy bt hdr */ in avrc_proc_far_msg()
495 (uint8_t*)(p_pkt + 1) + p_pkt->offset, p_pkt->len); in avrc_proc_far_msg()
504 osi_free(p_pkt); in avrc_proc_far_msg()
520 osi_free(p_pkt); in avrc_proc_far_msg()
530 p_pkt->offset += (AVRC_VENDOR_HDR_SIZE + AVRC_MIN_META_HDR_SIZE); in avrc_proc_far_msg()
531 p_pkt->len -= (AVRC_VENDOR_HDR_SIZE + AVRC_MIN_META_HDR_SIZE); in avrc_proc_far_msg()
533 if ((p_rcb->p_rmsg->offset + p_pkt->len) > buf_len) { in avrc_proc_far_msg()
536 p_pkt->len = buf_len - p_rcb->p_rmsg->offset; in avrc_proc_far_msg()
543 (uint8_t*)(p_pkt + 1) + p_pkt->offset, p_pkt->len); in avrc_proc_far_msg()
547 p_rcb->p_rmsg->len += p_pkt->len; in avrc_proc_far_msg()
560 AVRC_TRACE_DEBUG("end frag:%d, total len:%d, offset:%d", p_pkt->len, in avrc_proc_far_msg()
563 p_rcb->p_rmsg->offset += p_pkt->len; in avrc_proc_far_msg()
564 p_rcb->p_rmsg->len += p_pkt->len; in avrc_proc_far_msg()
568 osi_free(p_pkt); in avrc_proc_far_msg()
621 BT_HDR* p_pkt) { in avrc_msg_cback() argument
635 if (cr == AVCT_CMD && (p_pkt->layer_specific & AVCT_DATA_CTRL && in avrc_msg_cback()
636 AVRC_PACKET_LEN < sizeof(p_pkt->len))) { in avrc_msg_cback()
639 osi_free(p_pkt); in avrc_msg_cback()
646 osi_free(p_pkt); in avrc_msg_cback()
655 p_data = (uint8_t*)(p_pkt + 1) + p_pkt->offset; in avrc_msg_cback()
658 if (p_pkt->layer_specific == AVCT_DATA_BROWSE) { in avrc_msg_cback()
662 msg.browse.browse_len = p_pkt->len; in avrc_msg_cback()
663 msg.browse.p_browse_pkt = p_pkt; in avrc_msg_cback()
665 if (p_pkt->len < AVRC_AVC_HDR_SIZE) { in avrc_msg_cback()
668 __func__, p_pkt->len, AVRC_AVC_HDR_SIZE); in avrc_msg_cback()
669 osi_free(p_pkt); in avrc_msg_cback()
674 handle, msg.hdr.ctype, p_pkt->offset, p_pkt->len); in avrc_msg_cback()
687 p_rsp = avrc_copy_packet(p_pkt, AVRC_OP_UNIT_INFO_RSP_LEN); in avrc_msg_cback()
705 if (p_pkt->len < AVRC_OP_UNIT_INFO_RSP_LEN) { in avrc_msg_cback()
708 __func__, p_pkt->len, AVRC_OP_UNIT_INFO_RSP_LEN); in avrc_msg_cback()
726 p_rsp = avrc_copy_packet(p_pkt, AVRC_OP_SUB_UNIT_INFO_RSP_LEN); in avrc_msg_cback()
743 if (p_pkt->len < AVRC_OP_SUB_UNIT_INFO_RSP_LEN) { in avrc_msg_cback()
746 __func__, p_pkt->len, AVRC_OP_SUB_UNIT_INFO_RSP_LEN); in avrc_msg_cback()
766 p_data = (uint8_t*)(p_pkt + 1) + p_pkt->offset; in avrc_msg_cback()
768 if (p_pkt->len < in avrc_msg_cback()
781 p_msg->vendor_len = p_pkt->len - (p_data - p_begin); in avrc_msg_cback()
786 if (p_pkt->len < (AVRC_VENDOR_HDR_SIZE + AVRC_MIN_META_HDR_SIZE)) { in avrc_msg_cback()
795 drop_code = avrc_proc_far_msg(handle, label, cr, &p_pkt, p_msg); in avrc_msg_cback()
825 if (p_pkt->len < 5) /* 3 bytes: ctype, subunit*, opcode & op_id & len */ in avrc_msg_cback()
842 if (msg.pass.pass_len != p_pkt->len - 5) in avrc_msg_cback()
843 msg.pass.pass_len = p_pkt->len - 5; in avrc_msg_cback()
874 p_rsp = avrc_copy_packet(p_pkt, AVRC_OP_REJ_MSG_LEN); in avrc_msg_cback()
901 if (do_free) osi_free(p_pkt); in avrc_msg_cback()
1101 BT_HDR* p_pkt) { in AVRC_MsgReq() argument
1112 if (!p_pkt) return AVRC_BAD_PARAM; in AVRC_MsgReq()
1115 handle, label, ctype, p_pkt->len); in AVRC_MsgReq()
1119 if (p_pkt->event == AVRC_OP_VENDOR) { in AVRC_MsgReq()
1121 p_start = ((uint8_t*)(p_pkt + 1) + p_pkt->offset); in AVRC_MsgReq()
1122 p_pkt->offset -= AVRC_VENDOR_HDR_SIZE; in AVRC_MsgReq()
1123 p_pkt->len += AVRC_VENDOR_HDR_SIZE; in AVRC_MsgReq()
1124 p_data = (uint8_t*)(p_pkt + 1) + p_pkt->offset; in AVRC_MsgReq()
1139 } else if (p_pkt->event == AVRC_OP_PASS_THRU) { in AVRC_MsgReq()
1141 p_start = ((uint8_t*)(p_pkt + 1) + p_pkt->offset); in AVRC_MsgReq()
1142 p_pkt->offset -= AVRC_PASS_THRU_SIZE; in AVRC_MsgReq()
1143 p_pkt->len += AVRC_PASS_THRU_SIZE; in AVRC_MsgReq()
1144 p_data = (uint8_t*)(p_pkt + 1) + p_pkt->offset; in AVRC_MsgReq()
1153 if (p_pkt->layer_specific == AVCT_DATA_BROWSE) { in AVRC_MsgReq()
1158 if (p_pkt->len > (peer_mtu - AVCT_HDR_LEN_SINGLE)) { in AVRC_MsgReq()
1161 __func__, p_pkt->len, peer_mtu, AVCT_HDR_LEN_SINGLE); in AVRC_MsgReq()
1162 osi_free(p_pkt); in AVRC_MsgReq()
1172 osi_free(p_pkt); in AVRC_MsgReq()
1184 if (p_pkt->len > AVRC_MAX_CTRL_DATA_LEN) { in AVRC_MsgReq()
1185 int offset_len = MAX(AVCT_MSG_OFFSET, p_pkt->offset); in AVRC_MsgReq()
1190 p_fcb->p_fmsg = p_pkt; in AVRC_MsgReq()
1192 p_pkt = p_pkt_new; in AVRC_MsgReq()
1194 p_pkt->len = AVRC_MAX_CTRL_DATA_LEN; in AVRC_MsgReq()
1195 p_pkt->offset = p_pkt_new->offset; in AVRC_MsgReq()
1196 p_pkt->layer_specific = p_pkt_new->layer_specific; in AVRC_MsgReq()
1197 p_pkt->event = p_pkt_new->event; in AVRC_MsgReq()
1198 p_data = (uint8_t*)(p_pkt + 1) + p_pkt->offset; in AVRC_MsgReq()
1214 p_pkt->len, len, p_fcb->p_fmsg->len); in AVRC_MsgReq()
1218 osi_free(p_pkt); in AVRC_MsgReq()
1222 } else if ((p_pkt->event == AVRC_OP_VENDOR) && (cr == AVCT_CMD) && in AVRC_MsgReq()
1232 "AVRC: Enqueuing command 0x%08x (handle=0x%02x, label=0x%02x)", p_pkt, in AVRC_MsgReq()
1236 p_pkt->layer_specific = (label << 8) | (p_pkt->layer_specific & 0xFF); in AVRC_MsgReq()
1239 fixed_queue_enqueue(avrc_cb.ccb_int[handle].cmd_q, p_pkt); in AVRC_MsgReq()
1244 status = AVCT_MsgReq(handle, label, cr, p_pkt); in AVRC_MsgReq()