15typedef struct list_head
17 struct list_head *next, *prev;
20#define LIST_HEAD_INIT(name) { &(name), &(name) }
22#define LIST_HEAD(name) \
23 USB_LIST_T name = LIST_HEAD_INIT(name)
25#define INIT_LIST_HEAD(ptr) do { \
26 (ptr)->next = (ptr); (ptr)->prev = (ptr); \
36static __inline
void __list_add(USB_LIST_T *
new,
54static __inline
void list_add(USB_LIST_T *
new, USB_LIST_T *head)
56 __list_add(
new, head, head->next);
67static __inline
void list_add_tail(USB_LIST_T *
new, USB_LIST_T *head)
69 __list_add(
new, head->prev, head);
79static __inline
void __list_del(USB_LIST_T * prev,
91static __inline
void list_del(USB_LIST_T *entry)
93 __list_del(entry->prev, entry->next);
100static __inline
void list_del_init(USB_LIST_T *entry)
102 __list_del(entry->prev, entry->next);
103 INIT_LIST_HEAD(entry);
110static __inline
int list_empty(USB_LIST_T *head)
112 return head->next == head;
121#define list_entry(ptr, type, member) \
122 ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))