Lines Matching refs:p_q
80 void utils_queue_init (BUFFER_Q *p_q)
82 p_q->p_first = p_q->p_last = NULL;
83 p_q->count = 0;
95 void utils_enqueue (BUFFER_Q *p_q, void *p_buf)
103 if (p_q->p_last)
106 (HC_BUFFER_HDR_T *)((uint8_t *)p_q->p_last - BT_HC_BUFFER_HDR_SIZE);
111 p_q->p_first = p_buf;
113 p_q->p_last = p_buf;
114 p_q->count++;
129 void *utils_dequeue (BUFFER_Q *p_q)
132 void* p_buf = utils_dequeue_unlocked(p_q);
146 void *utils_dequeue_unlocked (BUFFER_Q *p_q)
151 if (!p_q || !p_q->count)
156 p_hdr=(HC_BUFFER_HDR_T *)((uint8_t *)p_q->p_first-BT_HC_BUFFER_HDR_SIZE);
159 p_q->p_first = ((uint8_t *)p_hdr->p_next + BT_HC_BUFFER_HDR_SIZE);
162 p_q->p_first = NULL;
163 p_q->p_last = NULL;
166 p_q->count--;
204 void *utils_remove_from_queue (BUFFER_Q *p_q, void *p_buf)
207 p_buf = utils_remove_from_queue_unlocked(p_q, p_buf);
220 void *utils_remove_from_queue_unlocked (BUFFER_Q *p_q, void *p_buf)
226 if (p_buf == p_q->p_first)
228 return (utils_dequeue_unlocked (p_q));
232 p_prev=(HC_BUFFER_HDR_T *)((uint8_t *)p_q->p_first-BT_HC_BUFFER_HDR_SIZE);
242 if (p_buf == p_q->p_last)
243 p_q->p_last = p_prev + 1;
246 p_q->count--;