Lines Matching refs:p_q
343 void GKI_init_q (BUFFER_Q *p_q)
345 p_q->p_first = p_q->p_last = NULL;
346 p_q->count = 0;
746 ** Parameters: p_q - (input) pointer to a queue.
752 void GKI_enqueue (BUFFER_Q *p_q, void *p_buf)
775 if (p_q->p_last)
777 BUFFER_HDR_T *p_last_hdr = (BUFFER_HDR_T *)((UINT8 *)p_q->p_last - BUFFER_HDR_SIZE);
781 p_q->p_first = p_buf;
783 p_q->p_last = p_buf;
784 p_q->count++;
801 ** Parameters: p_q - (input) pointer to a queue.
807 void GKI_enqueue_head (BUFFER_Q *p_q, void *p_buf)
829 if (p_q->p_first)
831 p_hdr->p_next = (BUFFER_HDR_T *)((UINT8 *)p_q->p_first - BUFFER_HDR_SIZE);
832 p_q->p_first = p_buf;
836 p_q->p_first = p_buf;
837 p_q->p_last = p_buf;
840 p_q->count++;
856 ** Parameters: p_q - (input) pointer to a queue.
861 void *GKI_dequeue (BUFFER_Q *p_q)
867 if (!p_q || !p_q->count)
873 p_hdr = (BUFFER_HDR_T *)((UINT8 *)p_q->p_first - BUFFER_HDR_SIZE);
878 p_q->p_first = ((UINT8 *)p_hdr->p_next + BUFFER_HDR_SIZE);
881 p_q->p_first = NULL;
882 p_q->p_last = NULL;
885 p_q->count--;
902 ** Parameters: p_q - (input) pointer to a queue.
908 void *GKI_remove_from_queue (BUFFER_Q *p_q, void *p_buf)
915 if (p_buf == p_q->p_first)
918 return (GKI_dequeue (p_q));
922 p_prev = (BUFFER_HDR_T *)((UINT8 *)p_q->p_first - BUFFER_HDR_SIZE);
932 if (p_buf == p_q->p_last)
933 p_q->p_last = p_prev + 1;
936 p_q->count--;
957 ** Parameters: p_q - (input) pointer to a queue.
962 void *GKI_getfirst (BUFFER_Q *p_q)
964 return (p_q->p_first);
974 ** Parameters: p_q - (input) pointer to a queue.
979 void *GKI_getlast (BUFFER_Q *p_q)
981 return (p_q->p_last);
1015 ** Parameters: p_q - (input) pointer to a queue.
1020 BOOLEAN GKI_queue_is_empty(BUFFER_Q *p_q)
1022 return ((BOOLEAN) (p_q->count == 0));