Changeset 01eeaaf in mainline
- Timestamp:
- 2012-12-22T15:07:29Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f6577d9
- Parents:
- 94c40ce2
- Location:
- uspace
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/vuhid/main.c
r94c40ce2 r01eeaaf 181 181 } 182 182 183 rc = usbvirt_device_plug(&hid_dev, "/virt/usbhc/ hc");183 rc = usbvirt_device_plug(&hid_dev, "/virt/usbhc/ctl"); 184 184 if (rc != EOK) { 185 185 printf("Unable to start communication with VHCD: %s.\n", -
uspace/drv/bus/usb/vhc/conndev.c
r94c40ce2 r01eeaaf 94 94 ipc_call_t *icall) 95 95 { 96 vhc_data_t *vhc = ddf_ dev_data_get(ddf_fun_get_dev(fun));96 vhc_data_t *vhc = ddf_fun_data_get(fun); 97 97 98 98 async_sess_t *callback = … … 125 125 void on_client_close(ddf_fun_t *fun) 126 126 { 127 vhc_data_t *vhc = ddf_ dev_data_get(ddf_fun_get_dev(fun));127 vhc_data_t *vhc = ddf_fun_data_get(fun); 128 128 129 129 if (plugged_device_handle != 0) { -
uspace/drv/bus/usb/vhc/connhost.c
r94c40ce2 r01eeaaf 158 158 return rc; 159 159 } 160 #if 0 161 /** Schedule interrupt out transfer. 162 * 163 * The callback is supposed to be called once the transfer (on the wire) is 164 * complete regardless of the outcome. 165 * However, the callback could be called only when this function returns 166 * with success status (i.e. returns EOK). 167 * 168 * @param[in] fun Device function the action was invoked on. 169 * @param[in] target Target pipe (address and endpoint number) specification. 170 * @param[in] data Data to be sent (in USB endianess, allocated and deallocated 171 * by the caller). 172 * @param[in] size Size of the @p data buffer in bytes. 173 * @param[in] callback Callback to be issued once the transfer is complete. 174 * @param[in] arg Pass-through argument to the callback. 175 * @return Error code. 176 */ 177 static int interrupt_out(ddf_fun_t *fun, usb_target_t target, 178 void *data, size_t size, 179 usbhc_iface_transfer_out_callback_t callback, void *arg) 180 { 181 VHC_DATA(vhc, fun); 182 183 vhc_transfer_t *transfer = vhc_transfer_create(target.address, 184 target.endpoint, USB_DIRECTION_OUT, USB_TRANSFER_INTERRUPT, 185 fun, arg); 186 if (transfer == NULL) { 187 return ENOMEM; 188 } 189 190 transfer->data_buffer = data; 191 transfer->data_buffer_size = size; 192 transfer->callback_out = callback; 193 194 int rc = vhc_virtdev_add_transfer(vhc, transfer); 195 if (rc != EOK) { 196 free(transfer); 197 return rc; 198 } 199 200 return EOK; 201 } 202 203 /** Schedule interrupt in transfer. 204 * 205 * The callback is supposed to be called once the transfer (on the wire) is 206 * complete regardless of the outcome. 207 * However, the callback could be called only when this function returns 208 * with success status (i.e. returns EOK). 209 * 210 * @param[in] fun Device function the action was invoked on. 211 * @param[in] target Target pipe (address and endpoint number) specification. 212 * @param[in] data Buffer where to store the data (in USB endianess, 213 * allocated and deallocated by the caller). 214 * @param[in] size Size of the @p data buffer in bytes. 215 * @param[in] callback Callback to be issued once the transfer is complete. 216 * @param[in] arg Pass-through argument to the callback. 217 * @return Error code. 218 */ 219 static int interrupt_in(ddf_fun_t *fun, usb_target_t target, 220 void *data, size_t size, 221 usbhc_iface_transfer_in_callback_t callback, void *arg) 222 { 223 VHC_DATA(vhc, fun); 224 225 vhc_transfer_t *transfer = vhc_transfer_create(target.address, 226 target.endpoint, USB_DIRECTION_IN, USB_TRANSFER_INTERRUPT, 227 fun, arg); 228 if (transfer == NULL) { 229 return ENOMEM; 230 } 231 232 transfer->data_buffer = data; 233 transfer->data_buffer_size = size; 234 transfer->callback_in = callback; 235 236 int rc = vhc_virtdev_add_transfer(vhc, transfer); 237 if (rc != EOK) { 238 free(transfer); 239 return rc; 240 } 241 242 return EOK; 243 } 244 245 /** Schedule bulk out transfer. 246 * 247 * The callback is supposed to be called once the transfer (on the wire) is 248 * complete regardless of the outcome. 249 * However, the callback could be called only when this function returns 250 * with success status (i.e. returns EOK). 251 * 252 * @param[in] fun Device function the action was invoked on. 253 * @param[in] target Target pipe (address and endpoint number) specification. 254 * @param[in] data Data to be sent (in USB endianess, allocated and deallocated 255 * by the caller). 256 * @param[in] size Size of the @p data buffer in bytes. 257 * @param[in] callback Callback to be issued once the transfer is complete. 258 * @param[in] arg Pass-through argument to the callback. 259 * @return Error code. 260 */ 261 static int bulk_out(ddf_fun_t *fun, usb_target_t target, 262 void *data, size_t size, 263 usbhc_iface_transfer_out_callback_t callback, void *arg) 264 { 265 UNSUPPORTED("bulk_out"); 266 267 return ENOTSUP; 268 } 269 270 /** Schedule bulk in transfer. 271 * 272 * The callback is supposed to be called once the transfer (on the wire) is 273 * complete regardless of the outcome. 274 * However, the callback could be called only when this function returns 275 * with success status (i.e. returns EOK). 276 * 277 * @param[in] fun Device function the action was invoked on. 278 * @param[in] target Target pipe (address and endpoint number) specification. 279 * @param[in] data Buffer where to store the data (in USB endianess, 280 * allocated and deallocated by the caller). 281 * @param[in] size Size of the @p data buffer in bytes. 282 * @param[in] callback Callback to be issued once the transfer is complete. 283 * @param[in] arg Pass-through argument to the callback. 284 * @return Error code. 285 */ 286 static int bulk_in(ddf_fun_t *fun, usb_target_t target, 287 void *data, size_t size, 288 usbhc_iface_transfer_in_callback_t callback, void *arg) 289 { 290 UNSUPPORTED("bulk_in"); 291 292 return ENOTSUP; 293 } 294 295 /** Schedule control write transfer. 296 * 297 * The callback is supposed to be called once the transfer (on the wire) is 298 * complete regardless of the outcome. 299 * However, the callback could be called only when this function returns 300 * with success status (i.e. returns EOK). 301 * 302 * @param[in] fun Device function the action was invoked on. 303 * @param[in] target Target pipe (address and endpoint number) specification. 304 * @param[in] setup_packet Setup packet buffer (in USB endianess, allocated 305 * and deallocated by the caller). 306 * @param[in] setup_packet_size Size of @p setup_packet buffer in bytes. 307 * @param[in] data_buffer Data buffer (in USB endianess, allocated and 308 * deallocated by the caller). 309 * @param[in] data_buffer_size Size of @p data_buffer buffer in bytes. 310 * @param[in] callback Callback to be issued once the transfer is complete. 311 * @param[in] arg Pass-through argument to the callback. 312 * @return Error code. 313 */ 314 static int control_write(ddf_fun_t *fun, usb_target_t target, 315 void *setup_packet, size_t setup_packet_size, 316 void *data_buffer, size_t data_buffer_size, 317 usbhc_iface_transfer_out_callback_t callback, void *arg) 318 { 319 VHC_DATA(vhc, fun); 320 321 vhc_transfer_t *transfer = vhc_transfer_create(target.address, 322 target.endpoint, USB_DIRECTION_OUT, USB_TRANSFER_CONTROL, 323 fun, arg); 324 if (transfer == NULL) { 325 return ENOMEM; 326 } 327 328 transfer->setup_buffer = setup_packet; 329 transfer->setup_buffer_size = setup_packet_size; 330 transfer->data_buffer = data_buffer; 331 transfer->data_buffer_size = data_buffer_size; 332 transfer->callback_out = callback; 333 334 int rc = vhc_virtdev_add_transfer(vhc, transfer); 335 if (rc != EOK) { 336 free(transfer); 337 return rc; 338 } 339 340 return EOK; 341 } 342 343 /** Schedule control read transfer. 344 * 345 * The callback is supposed to be called once the transfer (on the wire) is 346 * complete regardless of the outcome. 347 * However, the callback could be called only when this function returns 348 * with success status (i.e. returns EOK). 349 * 350 * @param[in] fun Device function the action was invoked on. 351 * @param[in] target Target pipe (address and endpoint number) specification. 352 * @param[in] setup_packet Setup packet buffer (in USB endianess, allocated 353 * and deallocated by the caller). 354 * @param[in] setup_packet_size Size of @p setup_packet buffer in bytes. 355 * @param[in] data_buffer Buffer where to store the data (in USB endianess, 356 * allocated and deallocated by the caller). 357 * @param[in] data_buffer_size Size of @p data_buffer buffer in bytes. 358 * @param[in] callback Callback to be issued once the transfer is complete. 359 * @param[in] arg Pass-through argument to the callback. 360 * @return Error code. 361 */ 362 static int control_read(ddf_fun_t *fun, usb_target_t target, 363 void *setup_packet, size_t setup_packet_size, 364 void *data_buffer, size_t data_buffer_size, 365 usbhc_iface_transfer_in_callback_t callback, void *arg) 366 { 367 VHC_DATA(vhc, fun); 368 369 vhc_transfer_t *transfer = vhc_transfer_create(target.address, 370 target.endpoint, USB_DIRECTION_IN, USB_TRANSFER_CONTROL, 371 fun, arg); 372 if (transfer == NULL) { 373 return ENOMEM; 374 } 375 376 transfer->setup_buffer = setup_packet; 377 transfer->setup_buffer_size = setup_packet_size; 378 transfer->data_buffer = data_buffer; 379 transfer->data_buffer_size = data_buffer_size; 380 transfer->callback_in = callback; 381 382 int rc = vhc_virtdev_add_transfer(vhc, transfer); 383 if (rc != EOK) { 384 free(transfer); 385 return rc; 386 } 387 388 return EOK; 389 } 390 #endif 160 391 161 static int usb_read(ddf_fun_t *fun, usb_target_t target, uint64_t setup_buffer, 392 162 uint8_t *data_buffer, size_t data_buffer_size, -
uspace/drv/bus/usb/vhc/devconn.c
r94c40ce2 r01eeaaf 51 51 static int vhc_virtdev_plug_generic(vhc_data_t *vhc, 52 52 async_sess_t *sess, usbvirt_device_t *virtdev, 53 uintptr_t *handle, bool connect )53 uintptr_t *handle, bool connect, usb_address_t address) 54 54 { 55 55 vhc_virtdev_t *dev = vhc_virtdev_create(); … … 60 60 dev->dev_sess = sess; 61 61 dev->dev_local = virtdev; 62 dev->address = address; 62 63 63 64 fibril_mutex_lock(&vhc->guard); … … 86 87 int vhc_virtdev_plug(vhc_data_t *vhc, async_sess_t *sess, uintptr_t *handle) 87 88 { 88 return vhc_virtdev_plug_generic(vhc, sess, NULL, handle, true );89 return vhc_virtdev_plug_generic(vhc, sess, NULL, handle, true, 0); 89 90 } 90 91 91 92 int vhc_virtdev_plug_local(vhc_data_t *vhc, usbvirt_device_t *dev, uintptr_t *handle) 92 93 { 93 return vhc_virtdev_plug_generic(vhc, NULL, dev, handle, true );94 return vhc_virtdev_plug_generic(vhc, NULL, dev, handle, true, 0); 94 95 } 95 96 96 int vhc_virtdev_plug_hub(vhc_data_t *vhc, usbvirt_device_t *dev, uintptr_t *handle )97 int vhc_virtdev_plug_hub(vhc_data_t *vhc, usbvirt_device_t *dev, uintptr_t *handle, usb_address_t address) 97 98 { 98 return vhc_virtdev_plug_generic(vhc, NULL, dev, handle, false );99 return vhc_virtdev_plug_generic(vhc, NULL, dev, handle, false, address); 99 100 } 100 101 -
uspace/drv/bus/usb/vhc/main.c
r94c40ce2 r01eeaaf 44 44 #include <ddf/driver.h> 45 45 46 #include <usb/host/ddf_helpers.h> 47 46 48 #include <usb/usb.h> 47 49 #include <usb/ddfiface.h> … … 52 54 53 55 static ddf_dev_ops_t vhc_ops = { 56 #if 0 54 57 .interfaces[USBHC_DEV_IFACE] = &vhc_iface, 55 58 .interfaces[USB_DEV_IFACE] = &vhc_usb_iface, 59 #endif 56 60 .close = on_client_close, 57 61 .default_handler = default_connection_handler 58 62 }; 59 63 64 static int vhc_control_node(ddf_dev_t *dev, ddf_fun_t **fun) 65 { 66 assert(dev); 67 assert(fun); 68 69 *fun = ddf_fun_create(dev, fun_exposed, "ctl"); 70 if (!*fun) 71 return ENOMEM; 72 73 vhc_data_t *vhc = ddf_fun_data_alloc(*fun, sizeof(vhc_data_t)); 74 if (!vhc) { 75 ddf_fun_destroy(*fun); 76 } 77 ddf_fun_set_ops(*fun, &vhc_ops); 78 const int ret = ddf_fun_bind(*fun); 79 if (ret != EOK) { 80 ddf_fun_destroy(*fun); 81 *fun = NULL; 82 return ret; 83 } 84 vhc_data_init(vhc); 85 // TODO: This limits us to single vhc instance. 86 virthub_init(&virtual_hub_device); 87 vhc->hub = &virtual_hub_device; 88 return EOK; 89 } 90 91 60 92 static int vhc_dev_add(ddf_dev_t *dev) 61 93 { 94 /* Initialize virtual structure */ 95 ddf_fun_t *ctl_fun = NULL; 96 int ret = vhc_control_node(dev, &ctl_fun); 97 if (ret != EOK) { 98 usb_log_error("Failed to setup control node.\n"); 99 return ret; 100 } 101 vhc_data_t *data = ddf_fun_data_get(ctl_fun); 102 103 /* Initialize generic structures */ 104 ret = hcd_ddf_setup_device(dev, NULL, USB_SPEED_FULL, 105 BANDWIDTH_AVAILABLE_USB11, bandwidth_count_usb11); 106 if (ret != EOK) { 107 usb_log_error("Failed to init HCD structures: %s.\n", 108 str_error(ret)); 109 free(data); 110 return ret; 111 } 112 113 hcd_set_implementation(dev_to_hcd(dev), data, vhc_schedule, NULL, NULL); 114 115 /* Add virtual hub device */ 116 usb_address_t address = 1; 117 ret = vhc_virtdev_plug_hub(data, data->hub, NULL, address); 118 if (ret != EOK) { 119 usb_log_error("Failed to plug root hub: %s.\n", str_error(ret)); 120 free(data); 121 return ret; 122 } 123 124 // TODO fix the address hack 125 ret = hcd_ddf_setup_hub(dev, &address); 126 if (ret != EOK) { 127 usb_log_error("Failed to init VHC root hub: %s\n", 128 str_error(ret)); 129 // TODO do something here... 130 } 131 132 return ret; 133 #if 0 62 134 static int vhc_count = 0; 63 135 int rc; … … 124 196 125 197 return EOK; 198 #endif 126 199 } 127 200 … … 137 210 138 211 int main(int argc, char * argv[]) 139 { 212 { 140 213 log_init(NAME); 141 214 … … 145 218 } 146 219 147 148 220 /** 149 221 * @} -
uspace/drv/bus/usb/vhc/transfer.c
r94c40ce2 r01eeaaf 64 64 static bool is_set_address_transfer(vhc_transfer_t *transfer) 65 65 { 66 if (transfer->endpoint != 0) { 67 return false; 68 } 69 if (transfer->transfer_type != USB_TRANSFER_CONTROL) { 70 return false; 71 } 72 if (transfer->direction != USB_DIRECTION_OUT) { 73 return false; 74 } 75 if (transfer->setup_buffer_size != sizeof(usb_device_request_setup_packet_t)) { 76 return false; 77 } 78 usb_device_request_setup_packet_t *setup = transfer->setup_buffer; 66 if (transfer->batch->ep->endpoint != 0) { 67 return false; 68 } 69 if (transfer->batch->ep->transfer_type != USB_TRANSFER_CONTROL) { 70 return false; 71 } 72 if (usb_transfer_batch_direction(transfer->batch) != USB_DIRECTION_OUT) { 73 return false; 74 } 75 const usb_device_request_setup_packet_t *setup = 76 (void*)transfer->batch->setup_buffer; 79 77 if (setup->request_type != 0) { 80 78 return false; … … 85 83 86 84 return true; 85 } 86 87 int vhc_schedule(hcd_t *hcd, usb_transfer_batch_t *batch) 88 { 89 assert(hcd); 90 assert(batch); 91 vhc_data_t *vhc = hcd->private_data; 92 assert(vhc); 93 94 vhc_transfer_t *transfer = malloc(sizeof(vhc_transfer_t)); 95 if (!transfer) 96 return ENOMEM; 97 link_initialize(&transfer->link); 98 transfer->batch = batch; 99 100 fibril_mutex_lock(&vhc->guard); 101 102 int targets = 0; 103 104 list_foreach(vhc->devices, pos) { 105 vhc_virtdev_t *dev = list_get_instance(pos, vhc_virtdev_t, link); 106 fibril_mutex_lock(&dev->guard); 107 if (dev->address == transfer->batch->ep->address) { 108 if (!targets) { 109 list_append(&transfer->link, &dev->transfer_queue); 110 } 111 ++targets; 112 } 113 fibril_mutex_unlock(&dev->guard); 114 } 115 116 fibril_mutex_unlock(&vhc->guard); 117 118 if (targets > 1) 119 usb_log_warning("Transfer would be accepted by more devices!\n"); 120 121 return targets ? EOK : ENOENT; 87 122 } 88 123 … … 116 151 } 117 152 118 static int process_transfer_local( vhc_transfer_t *transfer,153 static int process_transfer_local(usb_transfer_batch_t *batch, 119 154 usbvirt_device_t *dev, size_t *actual_data_size) 120 155 { 121 156 int rc; 122 123 if (transfer->transfer_type == USB_TRANSFER_CONTROL) { 124 if (transfer->direction == USB_DIRECTION_IN) { 157 158 const usb_direction_t dir = usb_transfer_batch_direction(batch); 159 160 if (batch->ep->transfer_type == USB_TRANSFER_CONTROL) { 161 if (dir == USB_DIRECTION_IN) { 125 162 rc = usbvirt_control_read(dev, 126 transfer->setup_buffer, transfer->setup_buffer_size,127 transfer->data_buffer, transfer->data_buffer_size,163 batch->setup_buffer, batch->setup_size, 164 batch->buffer, batch->buffer_size, 128 165 actual_data_size); 129 166 } else { 130 assert( transfer->direction== USB_DIRECTION_OUT);167 assert(dir == USB_DIRECTION_OUT); 131 168 rc = usbvirt_control_write(dev, 132 transfer->setup_buffer, transfer->setup_buffer_size,133 transfer->data_buffer, transfer->data_buffer_size);169 batch->setup_buffer, batch->setup_size, 170 batch->buffer, batch->buffer_size); 134 171 } 135 172 } else { 136 if ( transfer->direction== USB_DIRECTION_IN) {137 rc = usbvirt_data_in(dev, transfer->transfer_type,138 transfer->endpoint,139 transfer->data_buffer, transfer->data_buffer_size,173 if (dir == USB_DIRECTION_IN) { 174 rc = usbvirt_data_in(dev, batch->ep->transfer_type, 175 batch->ep->endpoint, 176 batch->buffer, batch->buffer_size, 140 177 actual_data_size); 141 178 } else { 142 assert( transfer->direction== USB_DIRECTION_OUT);143 rc = usbvirt_data_out(dev, transfer->transfer_type,144 transfer->endpoint,145 transfer->data_buffer, transfer->data_buffer_size);179 assert(dir == USB_DIRECTION_OUT); 180 rc = usbvirt_data_out(dev, batch->ep->transfer_type, 181 batch->ep->endpoint, 182 batch->buffer, batch->buffer_size); 146 183 } 147 184 } … … 150 187 } 151 188 152 static int process_transfer_remote( vhc_transfer_t *transfer,189 static int process_transfer_remote(usb_transfer_batch_t *batch, 153 190 async_sess_t *sess, size_t *actual_data_size) 154 191 { 155 192 int rc; 156 193 157 if (transfer->transfer_type == USB_TRANSFER_CONTROL) { 158 if (transfer->direction == USB_DIRECTION_IN) { 194 const usb_direction_t dir = usb_transfer_batch_direction(batch); 195 196 if (batch->ep->transfer_type == USB_TRANSFER_CONTROL) { 197 if (dir == USB_DIRECTION_IN) { 159 198 rc = usbvirt_ipc_send_control_read(sess, 160 transfer->setup_buffer, transfer->setup_buffer_size,161 transfer->data_buffer, transfer->data_buffer_size,199 batch->setup_buffer, batch->setup_size, 200 batch->buffer, batch->buffer_size, 162 201 actual_data_size); 163 202 } else { 164 assert( transfer->direction== USB_DIRECTION_OUT);203 assert(dir == USB_DIRECTION_OUT); 165 204 rc = usbvirt_ipc_send_control_write(sess, 166 transfer->setup_buffer, transfer->setup_buffer_size,167 transfer->data_buffer, transfer->data_buffer_size);205 batch->setup_buffer, batch->setup_size, 206 batch->buffer, batch->buffer_size); 168 207 } 169 208 } else { 170 if ( transfer->direction== USB_DIRECTION_IN) {171 rc = usbvirt_ipc_send_data_in(sess, transfer->endpoint,172 transfer->transfer_type,173 transfer->data_buffer, transfer->data_buffer_size,209 if (dir == USB_DIRECTION_IN) { 210 rc = usbvirt_ipc_send_data_in(sess, batch->ep->endpoint, 211 batch->ep->transfer_type, 212 batch->buffer, batch->buffer_size, 174 213 actual_data_size); 175 214 } else { 176 assert( transfer->direction== USB_DIRECTION_OUT);177 rc = usbvirt_ipc_send_data_out(sess, transfer->endpoint,178 transfer->transfer_type,179 transfer->data_buffer, transfer->data_buffer_size);215 assert(dir == USB_DIRECTION_OUT); 216 rc = usbvirt_ipc_send_data_out(sess, batch->ep->endpoint, 217 batch->ep->transfer_type, 218 batch->buffer, batch->buffer_size); 180 219 } 181 220 } … … 200 239 size_t data_transfer_size, int outcome) 201 240 { 241 assert(outcome != ENAK); 242 assert(transfer); 243 assert(transfer->batch); 244 usb_transfer_batch_finish_error(transfer->batch, NULL, 245 data_transfer_size, outcome); 246 usb_transfer_batch_destroy(transfer->batch); 247 free(transfer); 248 #if 0 202 249 assert(outcome != ENAK); 203 250 … … 214 261 215 262 free(transfer); 263 #endif 216 264 } 217 265 … … 234 282 size_t data_transfer_size = 0; 235 283 if (dev->dev_sess) { 236 rc = process_transfer_remote(transfer , dev->dev_sess,237 &data_transfer_size);284 rc = process_transfer_remote(transfer->batch, 285 dev->dev_sess, &data_transfer_size); 238 286 } else if (dev->dev_local != NULL) { 239 rc = process_transfer_local(transfer , dev->dev_local,240 &data_transfer_size);287 rc = process_transfer_local(transfer->batch, 288 dev->dev_local, &data_transfer_size); 241 289 } else { 242 290 usb_log_warning("Device has no remote phone nor local node.\n"); … … 251 299 if (is_set_address_transfer(transfer)) { 252 300 usb_device_request_setup_packet_t *setup 253 = transfer->setup_buffer;301 = (void*)transfer->batch->setup_buffer; 254 302 dev->address = setup->value; 255 303 usb_log_debug2("Address changed to %d\n", -
uspace/drv/bus/usb/vhc/vhcd.h
r94c40ce2 r01eeaaf 43 43 #include <async.h> 44 44 45 #include <usb/host/hcd.h> 46 47 45 48 #define NAME "vhc" 46 49 … … 67 70 typedef struct { 68 71 link_t link; 72 73 usb_transfer_batch_t *batch; 74 69 75 usb_address_t address; 70 76 usb_endpoint_t endpoint; … … 81 87 } vhc_transfer_t; 82 88 89 static inline void vhc_data_init(vhc_data_t *instance) 90 { 91 assert(instance); 92 list_initialize(&instance->devices); 93 fibril_mutex_initialize(&instance->guard); 94 instance->magic = 0xDEADBEEF; 95 } 96 97 83 98 vhc_transfer_t *vhc_transfer_create(usb_address_t, usb_endpoint_t, 84 99 usb_direction_t, usb_transfer_type_t, ddf_fun_t *, void *); 85 100 int vhc_virtdev_plug(vhc_data_t *, async_sess_t *, uintptr_t *); 86 101 int vhc_virtdev_plug_local(vhc_data_t *, usbvirt_device_t *, uintptr_t *); 87 int vhc_virtdev_plug_hub(vhc_data_t *, usbvirt_device_t *, uintptr_t * );102 int vhc_virtdev_plug_hub(vhc_data_t *, usbvirt_device_t *, uintptr_t *, usb_address_t address); 88 103 void vhc_virtdev_unplug(vhc_data_t *, uintptr_t); 89 104 int vhc_virtdev_add_transfer(vhc_data_t *, vhc_transfer_t *); … … 92 107 93 108 109 int vhc_schedule(hcd_t *hcd, usb_transfer_batch_t *batch); 110 94 111 #endif 95 112 /**
Note:
See TracChangeset
for help on using the changeset viewer.