Changes in uspace/drv/usbhub/usbhub_private.h [f9a0cef:5097bed4] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/usbhub_private.h
rf9a0cef r5097bed4 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> 45 #include <futex.h> 46 43 47 #include <usb/usb.h> 48 #include <usb/usbdrv.h> 44 49 #include <usb/classes/hub.h> 45 50 #include <usb/devreq.h> 51 #include <usb/debug.h> 46 52 47 53 //************ … … 55 61 //************ 56 62 // 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 63 // convenience debug printf 60 64 // 61 65 //************ 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 #define dprintf(level, format, ...) \ 67 usb_dprintf(NAME, (level), format "\n", ##__VA_ARGS__) 99 68 100 69 /** 101 * @briefcreate hub structure instance70 * create hub structure instance 102 71 * 103 72 * Set the address and port count information most importantly. … … 112 81 extern usb_general_list_t usb_hub_list; 113 82 83 /** lock for hub list*/ 84 extern futex_t usb_hub_list_lock; 85 114 86 115 87 /** 116 * @briefperform complete control read transaction88 * perform complete control read transaction 117 89 * 118 90 * manages all three steps of transaction: setup, read and finalize … … 132 104 133 105 /** 134 * @briefperform complete control write transaction106 * perform complete control write transaction 135 107 * 136 * ma anges all three steps of transaction: setup, write and finalize108 * manages all three steps of transaction: setup, write and finalize 137 109 * @param phone 138 110 * @param target … … 147 119 void * sent_buffer, size_t sent_size 148 120 ); 149 150 151 /**152 * set the device request to be a set address request153 * @param request154 * @param addr155 * \TODO this will be obsolete see usb/dev_req.h156 */157 static inline void usb_hub_set_set_address_request(158 usb_device_request_setup_packet_t * request, uint16_t addr159 ){160 request->index = 0;161 request->request_type = 0;/// \TODO this is not very nice sollution, we ned constant162 request->request = USB_DEVREQ_SET_ADDRESS;163 request->value = addr;164 request->length = 0;165 }166 121 167 122 /**
Note:
See TracChangeset
for help on using the changeset viewer.