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