Lines Matching refs:list
162 static void n_hdlc_buf_list_init(struct n_hdlc_buf_list *list);
163 static void n_hdlc_buf_put(struct n_hdlc_buf_list *list,
165 static struct n_hdlc_buf *n_hdlc_buf_get(struct n_hdlc_buf_list *list);
891 static void n_hdlc_buf_list_init(struct n_hdlc_buf_list *list) in n_hdlc_buf_list_init() argument
893 memset(list, 0, sizeof(*list)); in n_hdlc_buf_list_init()
894 spin_lock_init(&list->spinlock); in n_hdlc_buf_list_init()
902 static void n_hdlc_buf_put(struct n_hdlc_buf_list *list, in n_hdlc_buf_put() argument
906 spin_lock_irqsave(&list->spinlock,flags); in n_hdlc_buf_put()
909 if (list->tail) in n_hdlc_buf_put()
910 list->tail->link = buf; in n_hdlc_buf_put()
912 list->head = buf; in n_hdlc_buf_put()
913 list->tail = buf; in n_hdlc_buf_put()
914 (list->count)++; in n_hdlc_buf_put()
916 spin_unlock_irqrestore(&list->spinlock,flags); in n_hdlc_buf_put()
928 static struct n_hdlc_buf* n_hdlc_buf_get(struct n_hdlc_buf_list *list) in n_hdlc_buf_get() argument
932 spin_lock_irqsave(&list->spinlock,flags); in n_hdlc_buf_get()
934 buf = list->head; in n_hdlc_buf_get()
936 list->head = buf->link; in n_hdlc_buf_get()
937 (list->count)--; in n_hdlc_buf_get()
939 if (!list->head) in n_hdlc_buf_get()
940 list->tail = NULL; in n_hdlc_buf_get()
942 spin_unlock_irqrestore(&list->spinlock,flags); in n_hdlc_buf_get()