Changeset 2b0db98 in mainline for uspace/drv/usbhub/usbhub_private.h
- Timestamp:
- 2011-01-07T14:02:56Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6986418
- Parents:
- d99120f (diff), 0f191a2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/usbhub_private.h
rd99120f r2b0db98 38 38 39 39 #include "usbhub.h" 40 #include "usblist.h" 41 40 42 #include <adt/list.h> 41 43 #include <bool.h> 42 44 #include <driver.h> 43 45 #include <usb/usb.h> 46 #include <usb/usbdrv.h> 44 47 #include <usb/classes/hub.h> 45 48 #include <usb/devreq.h> 49 #include <usb/debug.h> 46 50 47 51 //************ … … 55 59 //************ 56 60 // 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 61 // convenience debug printf 60 62 // 61 63 //************ 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 } 64 #define dprintf(level, format, ...) \ 65 usb_dprintf(NAME, (level), format "\n", ##__VA_ARGS__) 99 66 100 67 /**
Note:
See TracChangeset
for help on using the changeset viewer.