Lines Matching refs:p_hdr
257 BUFFER_HDR_T* p_hdr; in GKI_getbuf() local
277 p_hdr = (BUFFER_HDR_T*)GKI_os_malloc(total_sz); in GKI_getbuf()
278 if (!p_hdr) { in GKI_getbuf()
287 memset(p_hdr, 0, total_sz); in GKI_getbuf()
290 *(uint32_t*)((uint8_t*)p_hdr + BUFFER_HDR_SIZE + size) = MAGIC_NO; in GKI_getbuf()
292 p_hdr->task_id = GKI_get_taskid(); in GKI_getbuf()
293 p_hdr->status = BUF_STATUS_UNLINKED; in GKI_getbuf()
294 p_hdr->p_next = nullptr; in GKI_getbuf()
295 p_hdr->Type = 0; in GKI_getbuf()
297 p_hdr->q_id = 0; in GKI_getbuf()
298 p_hdr->size = size; in GKI_getbuf()
301 Q = &gki_cb.com.freeq[p_hdr->q_id]; in GKI_getbuf()
306 "%s %p %d:%d", __func__, ((uint8_t*)p_hdr + BUFFER_HDR_SIZE), Q->cur_cnt, in GKI_getbuf()
309 return (void*)((uint8_t*)p_hdr + BUFFER_HDR_SIZE); in GKI_getbuf()
353 p_hdr = Q->p_first; in GKI_getbuf()
354 Q->p_first = p_hdr->p_next; in GKI_getbuf()
362 p_hdr->task_id = GKI_get_taskid(); in GKI_getbuf()
364 p_hdr->status = BUF_STATUS_UNLINKED; in GKI_getbuf()
365 p_hdr->p_next = nullptr; in GKI_getbuf()
366 p_hdr->Type = 0; in GKI_getbuf()
367 return ((void*)((uint8_t*)p_hdr + BUFFER_HDR_SIZE)); in GKI_getbuf()
423 BUFFER_HDR_T* p_hdr; in GKI_getpoolbuf()
441 p_hdr = Q->p_first; in GKI_getpoolbuf()
442 Q->p_first = p_hdr->p_next; in GKI_getpoolbuf()
450 p_hdr->task_id = GKI_get_taskid(); in GKI_getpoolbuf()
452 p_hdr->status = BUF_STATUS_UNLINKED; in GKI_getpoolbuf()
453 p_hdr->p_next = nullptr; in GKI_getpoolbuf()
454 p_hdr->Type = 0; in GKI_getpoolbuf()
456 return ((void*)((uint8_t*)p_hdr + BUFFER_HDR_SIZE)); in GKI_getpoolbuf()
480 BUFFER_HDR_T* p_hdr; in GKI_freebuf() local
490 p_hdr = (BUFFER_HDR_T*)((uint8_t*)p_buf - BUFFER_HDR_SIZE); in GKI_freebuf()
492 if (p_hdr->status != BUF_STATUS_UNLINKED) { in GKI_freebuf()
497 if (p_hdr->q_id >= GKI_NUM_TOTAL_BUF_POOLS) { in GKI_freebuf()
504 Q = &gki_cb.com.freeq[p_hdr->q_id]; in GKI_freebuf()
508 GKI_os_free(p_hdr); in GKI_freebuf()
515 Q = &gki_cb.com.freeq[p_hdr->q_id]; in GKI_freebuf()
517 Q->p_last->p_next = p_hdr; in GKI_freebuf()
519 Q->p_first = p_hdr; in GKI_freebuf()
521 Q->p_last = p_hdr; in GKI_freebuf()
522 p_hdr->p_next = nullptr; in GKI_freebuf()
523 p_hdr->status = BUF_STATUS_FREE; in GKI_freebuf()
524 p_hdr->task_id = GKI_INVALID_TASK; in GKI_freebuf()
543 BUFFER_HDR_T* p_hdr; in GKI_get_buf_size() local
545 p_hdr = (BUFFER_HDR_T*)((uint8_t*)p_buf - BUFFER_HDR_SIZE); in GKI_get_buf_size()
548 return p_hdr->size; in GKI_get_buf_size()
550 if ((uintptr_t)p_hdr & 1) return (0); in GKI_get_buf_size()
552 if (p_hdr->q_id < GKI_NUM_TOTAL_BUF_POOLS) { in GKI_get_buf_size()
553 return (gki_cb.com.freeq[p_hdr->q_id].size); in GKI_get_buf_size()
599 BUFFER_HDR_T* p_hdr; in GKI_send_msg() local
617 p_hdr = (BUFFER_HDR_T*)((uint8_t*)msg - BUFFER_HDR_SIZE); in GKI_send_msg()
619 if (p_hdr->status != BUF_STATUS_UNLINKED) { in GKI_send_msg()
627 p_cb->OSTaskQLast[task_id][mbox]->p_next = p_hdr; in GKI_send_msg()
629 p_cb->OSTaskQFirst[task_id][mbox] = p_hdr; in GKI_send_msg()
631 p_cb->OSTaskQLast[task_id][mbox] = p_hdr; in GKI_send_msg()
633 p_hdr->p_next = nullptr; in GKI_send_msg()
634 p_hdr->status = BUF_STATUS_QUEUED; in GKI_send_msg()
635 p_hdr->task_id = task_id; in GKI_send_msg()
659 BUFFER_HDR_T* p_hdr; in GKI_read_mbox() local
666 p_hdr = gki_cb.com.OSTaskQFirst[task_id][mbox]; in GKI_read_mbox()
667 gki_cb.com.OSTaskQFirst[task_id][mbox] = p_hdr->p_next; in GKI_read_mbox()
669 p_hdr->p_next = nullptr; in GKI_read_mbox()
670 p_hdr->status = BUF_STATUS_UNLINKED; in GKI_read_mbox()
672 p_buf = (uint8_t*)p_hdr + BUFFER_HDR_SIZE; in GKI_read_mbox()
693 BUFFER_HDR_T* p_hdr; in GKI_enqueue() local
702 p_hdr = (BUFFER_HDR_T*)((uint8_t*)p_buf - BUFFER_HDR_SIZE); in GKI_enqueue()
704 if (p_hdr->status != BUF_STATUS_UNLINKED) { in GKI_enqueue()
716 p_last_hdr->p_next = p_hdr; in GKI_enqueue()
723 p_hdr->p_next = nullptr; in GKI_enqueue()
724 p_hdr->status = BUF_STATUS_QUEUED; in GKI_enqueue()
744 BUFFER_HDR_T* p_hdr; in GKI_enqueue_head() local
753 p_hdr = (BUFFER_HDR_T*)((uint8_t*)p_buf - BUFFER_HDR_SIZE); in GKI_enqueue_head()
755 if (p_hdr->status != BUF_STATUS_UNLINKED) { in GKI_enqueue_head()
764 p_hdr->p_next = (BUFFER_HDR_T*)((uint8_t*)p_q->p_first - BUFFER_HDR_SIZE); in GKI_enqueue_head()
769 p_hdr->p_next = nullptr; in GKI_enqueue_head()
773 p_hdr->status = BUF_STATUS_QUEUED; in GKI_enqueue_head()
792 BUFFER_HDR_T* p_hdr; in GKI_dequeue() local
801 p_hdr = (BUFFER_HDR_T*)((uint8_t*)p_q->p_first - BUFFER_HDR_SIZE); in GKI_dequeue()
805 if (p_hdr->p_next) in GKI_dequeue()
806 p_q->p_first = ((uint8_t*)p_hdr->p_next + BUFFER_HDR_SIZE); in GKI_dequeue()
814 p_hdr->p_next = nullptr; in GKI_dequeue()
815 p_hdr->status = BUF_STATUS_UNLINKED; in GKI_dequeue()
819 return ((uint8_t*)p_hdr + BUFFER_HDR_SIZE); in GKI_dequeue()
912 BUFFER_HDR_T* p_hdr; in GKI_getnext() local
914 p_hdr = (BUFFER_HDR_T*)((uint8_t*)p_buf - BUFFER_HDR_SIZE); in GKI_getnext()
916 if (p_hdr->p_next) in GKI_getnext()
917 return ((uint8_t*)p_hdr->p_next + BUFFER_HDR_SIZE); in GKI_getnext()
1124 BUFFER_HDR_T* p_hdr = (BUFFER_HDR_T*)((uint8_t*)p_buf - BUFFER_HDR_SIZE); in GKI_change_buf_owner() local
1126 p_hdr->task_id = task_id; in GKI_change_buf_owner()
1142 BUFFER_HDR_T* p_hdr; in GKI_isend_msg() local
1167 p_hdr = (BUFFER_HDR_T*)((uint8_t*)msg - BUFFER_HDR_SIZE); in GKI_isend_msg()
1169 if (p_hdr->status != BUF_STATUS_UNLINKED) { in GKI_isend_msg()
1175 p_cb->OSTaskQLast[task_id][mbox]->p_next = p_hdr; in GKI_isend_msg()
1177 p_cb->OSTaskQFirst[task_id][mbox] = p_hdr; in GKI_isend_msg()
1179 p_cb->OSTaskQLast[task_id][mbox] = p_hdr; in GKI_isend_msg()
1181 p_hdr->p_next = NULL; in GKI_isend_msg()
1182 p_hdr->status = BUF_STATUS_QUEUED; in GKI_isend_msg()
1183 p_hdr->task_id = task_id; in GKI_isend_msg()