Changes in uspace/drv/usbhub/usbhub_private.h [5097bed4:d493ac17] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/usbhub_private.h
r5097bed4 rd493ac17 27 27 */ 28 28 29 /** @addtogroup usb29 /** @addtogroup drvusbhub 30 30 * @{ 31 31 */ 32 32 /** @file 33 * @brief Hub driver .33 * @brief Hub driver private definitions 34 34 */ 35 35 … … 42 42 #include <adt/list.h> 43 43 #include <bool.h> 44 #include <d river.h>45 #include <f utex.h>44 #include <ddf/driver.h> 45 #include <fibril_synch.h> 46 46 47 #include <usb/classes/hub.h> 47 48 #include <usb/usb.h> 48 #include <usb/usbdrv.h>49 #include <usb/classes/hub.h>50 #include <usb/devreq.h>51 49 #include <usb/debug.h> 50 #include <usb/request.h> 52 51 53 52 //************ … … 61 60 //************ 62 61 // 63 // convenience debug printf 62 // convenience debug printf for usb hub 64 63 // 65 64 //************ 66 65 #define dprintf(level, format, ...) \ 67 usb_dprintf(NAME, (level), format "\n", ##__VA_ARGS__) 66 usb_log_printf((level), format "\n", ##__VA_ARGS__) 67 68 68 69 69 /** 70 * create hub structure instance70 * Create hub structure instance 71 71 * 72 72 * Set the address and port count information most importantly. … … 76 76 * @return 77 77 */ 78 usb_hub_info_t * usb_create_hub_info(d evice_t * device, int hc);78 usb_hub_info_t * usb_create_hub_info(ddf_dev_t * device); 79 79 80 /** list of hubs maanged by this driver */80 /** List of hubs maanged by this driver */ 81 81 extern usb_general_list_t usb_hub_list; 82 82 83 /** lock for hub list*/84 extern f utex_t usb_hub_list_lock;83 /** Lock for hub list*/ 84 extern fibril_mutex_t usb_hub_list_lock; 85 85 86 86 87 87 /** 88 * perform complete control read transaction88 * Perform complete control read transaction 89 89 * 90 * manages all three steps of transaction: setup, read and finalize90 * Manages all three steps of transaction: setup, read and finalize 91 91 * @param phone 92 92 * @param target 93 * @param request request for data94 * @param rcvd_buffer received data93 * @param request Request packet 94 * @param rcvd_buffer Received data 95 95 * @param rcvd_size 96 * @param actual_size actual size of received data96 * @param actual_size Actual size of received data 97 97 * @return error code 98 98 */ 99 /* 99 100 int usb_drv_sync_control_read( 100 int phone, usb_target_t target,101 usb_endpoint_pipe_t *pipe, 101 102 usb_device_request_setup_packet_t * request, 102 103 void * rcvd_buffer, size_t rcvd_size, size_t * actual_size 103 ); 104 );*/ 104 105 105 106 /** 106 * perform complete control write transaction107 * Perform complete control write transaction 107 108 * 108 * manages all three steps of transaction: setup, write and finalize109 * Manages all three steps of transaction: setup, write and finalize 109 110 * @param phone 110 111 * @param target 111 * @param request request to send data112 * @param request Request packet to send data 112 113 * @param sent_buffer 113 114 * @param sent_size 114 115 * @return error code 115 116 */ 116 int usb_drv_sync_control_write(117 int phone, usb_target_t target,117 /*int usb_drv_sync_control_write( 118 usb_endpoint_pipe_t *pipe, 118 119 usb_device_request_setup_packet_t * request, 119 120 void * sent_buffer, size_t sent_size 120 ); 121 );*/ 121 122 122 123 /** 123 * set the device request to be a get hub descriptor request.124 * Set the device request to be a get hub descriptor request. 124 125 * @warning the size is allways set to USB_HUB_MAX_DESCRIPTOR_SIZE 125 126 * @param request … … 137 138 } 138 139 139 static inline int usb_hub_clear_port_feature(int hc, usb_address_t address, 140 /** 141 * Clear feature on hub port. 142 * 143 * @param hc Host controller telephone 144 * @param address Hub address 145 * @param port_index Port 146 * @param feature Feature selector 147 * @return Operation result 148 */ 149 static inline int usb_hub_clear_port_feature(usb_endpoint_pipe_t *pipe, 140 150 int port_index, 141 151 usb_hub_class_feature_t feature) { 142 usb_target_t target = { 143 .address = address, 144 .endpoint = 0 145 }; 152 146 153 usb_device_request_setup_packet_t clear_request = { 147 154 .request_type = USB_HUB_REQ_TYPE_CLEAR_PORT_FEATURE, … … 151 158 }; 152 159 clear_request.value = feature; 153 return usb_ drv_psync_control_write(hc, target, &clear_request,160 return usb_endpoint_pipe_control_write(pipe, &clear_request, 154 161 sizeof(clear_request), NULL, 0); 155 162 } 156 163 164 /** 165 * @brief create uint8_t array with serialized descriptor 166 * 167 * @param descriptor 168 * @return newly created serializd descriptor pointer 169 */ 170 void * usb_serialize_hub_descriptor(usb_hub_descriptor_t * descriptor); 171 172 /** 173 * @brief create deserialized desriptor structure out of serialized descriptor 174 * 175 * The serialized descriptor must be proper usb hub descriptor, 176 * otherwise an eerror might occur. 177 * 178 * @param sdescriptor serialized descriptor 179 * @return newly created deserialized descriptor pointer 180 */ 181 usb_hub_descriptor_t * usb_deserialize_hub_desriptor(void * sdescriptor); 157 182 158 183
Note:
See TracChangeset
for help on using the changeset viewer.