Changes in uspace/drv/usbhub/usbhub_private.h [e080332:f9a0cef] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/usbhub_private.h
re080332 rf9a0cef 38 38 39 39 #include "usbhub.h" 40 #include "usblist.h"41 42 40 #include <adt/list.h> 43 41 #include <bool.h> 44 42 #include <driver.h> 45 43 #include <usb/usb.h> 46 #include <usb/usbdrv.h>47 44 #include <usb/classes/hub.h> 48 45 #include <usb/devreq.h> 49 #include <usb/debug.h>50 46 51 47 //************ … … 59 55 //************ 60 56 // 61 // convenience debug printf 62 // 63 //************ 64 #define dprintf(level, format, ...) \ 65 usb_dprintf(NAME, (level), format "\n", ##__VA_ARGS__) 57 // My private list implementation; I did not like the original helenos list 58 // 59 // This one does not depend on the structure of stored data 60 // 61 //************ 62 63 /** general list structure */ 64 65 66 typedef struct usb_general_list{ 67 void * data; 68 struct usb_general_list * prev, * next; 69 } usb_general_list_t; 70 71 /** create head of usb general list */ 72 usb_general_list_t * usb_lst_create(void); 73 74 /** initialize head of usb general list */ 75 void usb_lst_init(usb_general_list_t * lst); 76 77 78 /** is the list empty? */ 79 static inline bool usb_lst_empty(usb_general_list_t * lst){ 80 return lst?(lst->next==lst):true; 81 } 82 83 /** append data behind item */ 84 void usb_lst_append(usb_general_list_t * lst, void * data); 85 86 /** prepend data beore item */ 87 void usb_lst_prepend(usb_general_list_t * lst, void * data); 88 89 /** remove list item from list */ 90 void usb_lst_remove(usb_general_list_t * item); 91 92 /** get data o specified type from list item */ 93 #define usb_lst_get_data(item, type) (type *) (item->data) 94 95 /** get usb_hub_info_t data from list item */ 96 static inline usb_hub_info_t * usb_hub_lst_get_data(usb_general_list_t * item) { 97 return usb_lst_get_data(item,usb_hub_info_t); 98 } 66 99 67 100 /**
Note:
See TracChangeset
for help on using the changeset viewer.