Changeset 9babc17 in mainline
- Timestamp:
- 2011-12-06T15:43:03Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e8d82cb
- Parents:
- e65cd3c4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/root_hub.c
re65cd3c4 r9babc17 451 451 const usb_device_request_setup_packet_t *setup_request = 452 452 (usb_device_request_setup_packet_t *) request->setup_buffer; 453 size_t size;454 const void *descriptor = NULL;455 453 const uint16_t setup_request_value = setup_request->value_high; 456 454 switch (setup_request_value) … … 459 457 usb_log_debug2("USB_DESCTYPE_HUB\n"); 460 458 /* Hub descriptor was generated locally */ 461 descriptor = instance->descriptors.hub; 462 size = instance->hub_descriptor_size; 463 break; 459 TRANSFER_END_DATA(request, instance->descriptors.hub, 460 instance->hub_descriptor_size); 464 461 465 462 case USB_DESCTYPE_DEVICE: 466 463 usb_log_debug2("USB_DESCTYPE_DEVICE\n"); 467 /* Device descriptor is shared (No one should ask for it)*/ 468 descriptor = &ohci_rh_device_descriptor; 469 size = sizeof(ohci_rh_device_descriptor); 470 break; 464 /* Device descriptor is shared (No one should ask for it) */ 465 TRANSFER_END_DATA(request, &ohci_rh_device_descriptor, 466 sizeof(ohci_rh_device_descriptor)); 471 467 472 468 case USB_DESCTYPE_CONFIGURATION: … … 474 470 /* Start with configuration and add others depending on 475 471 * request size */ 476 descriptor = &instance->descriptors; 477 size = instance->descriptors.configuration.total_length; 478 break; 472 TRANSFER_END_DATA(request, &instance->descriptors, 473 instance->descriptors.configuration.total_length); 479 474 480 475 case USB_DESCTYPE_INTERFACE: … … 482 477 /* Use local interface descriptor. There is one and it 483 478 * might be modified */ 484 descriptor = &instance->descriptors.interface; 485 size = sizeof(instance->descriptors.interface); 486 break; 479 TRANSFER_END_DATA(request, &instance->descriptors.interface, 480 sizeof(instance->descriptors.interface)); 487 481 488 482 case USB_DESCTYPE_ENDPOINT: … … 490 484 * it might have max_packet_size field modified*/ 491 485 usb_log_debug2("USB_DESCTYPE_ENDPOINT\n"); 492 descriptor = &instance->descriptors.endpoint; 493 size = sizeof(instance->descriptors.endpoint); 494 break; 486 TRANSFER_END_DATA(request, &instance->descriptors.endpoint, 487 sizeof(instance->descriptors.endpoint)); 495 488 496 489 default: … … 504 497 TRANSFER_END(request, EINVAL); 505 498 } 506 if (request->buffer_size < size) { 507 size = request->buffer_size; 508 } 509 510 TRANSFER_END_DATA(request, descriptor, size); 499 500 TRANSFER_END(request, ENOTSUP); 511 501 } 512 502 /*----------------------------------------------------------------------------*/
Note:
See TracChangeset
for help on using the changeset viewer.