Changeset 09daa8b in mainline for uspace/drv/usbhub/utils.c
- Timestamp:
- 2011-03-20T21:50:20Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fd9f6e4c
- Parents:
- 59e01689
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/utils.c
r59e01689 r09daa8b 88 88 89 89 if (sdescriptor[1] != USB_DESCTYPE_HUB) { 90 dprintf(1,"[usb_hub]wrong descriptor %x\n",sdescriptor[1]);90 usb_log_warning("trying to deserialize wrong descriptor %x\n",sdescriptor[1]); 91 91 return NULL; 92 92 } … … 103 103 ? 1 : 0); 104 104 result->devices_removable = (uint8_t*) malloc(var_size); 105 //printf("[usb_hub] getting removable devices data \n"); 105 106 106 size_t i; 107 107 for (i = 0; i < var_size; ++i) { … … 111 111 } 112 112 113 //control transactions114 /*115 int usb_drv_sync_control_read(116 int phone, usb_target_t target,117 usb_device_request_setup_packet_t * request,118 void * rcvd_buffer, size_t rcvd_size, size_t * actual_size119 ) {120 usb_handle_t handle;121 int opResult;122 //setup123 opResult = usb_drv_async_control_read_setup(phone, target,124 request, sizeof (usb_device_request_setup_packet_t),125 &handle);126 if (opResult != EOK) {127 return opResult;128 }129 opResult = usb_drv_async_wait_for(handle);130 if (opResult != EOK) {131 return opResult;132 }133 //read134 opResult = usb_drv_async_control_read_data(phone, target,135 rcvd_buffer, rcvd_size, actual_size,136 &handle);137 if (opResult != EOK) {138 return opResult;139 }140 opResult = usb_drv_async_wait_for(handle);141 if (opResult != EOK) {142 return opResult;143 }144 //finalize145 opResult = usb_drv_async_control_read_status(phone, target,146 &handle);147 if (opResult != EOK) {148 return opResult;149 }150 opResult = usb_drv_async_wait_for(handle);151 if (opResult != EOK) {152 return opResult;153 }154 return EOK;155 }156 157 int usb_drv_sync_control_write(158 int phone, usb_target_t target,159 usb_device_request_setup_packet_t * request,160 void * sent_buffer, size_t sent_size161 ) {162 usb_handle_t handle;163 int opResult;164 //setup165 opResult = usb_drv_async_control_write_setup(phone, target,166 request, sizeof (usb_device_request_setup_packet_t),167 &handle);168 if (opResult != EOK) {169 return opResult;170 }171 opResult = usb_drv_async_wait_for(handle);172 if (opResult != EOK) {173 return opResult;174 }175 //write176 opResult = usb_drv_async_control_write_data(phone, target,177 sent_buffer, sent_size,178 &handle);179 if (opResult != EOK) {180 return opResult;181 }182 opResult = usb_drv_async_wait_for(handle);183 if (opResult != EOK) {184 return opResult;185 }186 //finalize187 opResult = usb_drv_async_control_write_status(phone, target,188 &handle);189 if (opResult != EOK) {190 return opResult;191 }192 opResult = usb_drv_async_wait_for(handle);193 if (opResult != EOK) {194 return opResult;195 }196 return EOK;197 }198 199 */200 201 113 202 114
Note:
See TracChangeset
for help on using the changeset viewer.