Changeset 9f807c3 in mainline
- Timestamp:
- 2012-02-24T04:41:23Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7f7e6f5
- Parents:
- dd93bb2
- Location:
- uspace
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/root_hub.c
rdd93bb2 r9f807c3 347 347 instance->interrupt_mask_size; 348 348 349 instance->descriptors.configuration.total_length = 349 instance->descriptors.configuration.total_length = uint16_host2usb( 350 350 sizeof(usb_standard_configuration_descriptor_t) + 351 351 sizeof(usb_standard_endpoint_descriptor_t) + 352 352 sizeof(usb_standard_interface_descriptor_t) + 353 instance->hub_descriptor_size ;353 instance->hub_descriptor_size); 354 354 } 355 355 /*----------------------------------------------------------------------------*/ … … 492 492 usb_device_request_setup_packet_t *setup_request = 493 493 (usb_device_request_setup_packet_t *) request->setup_buffer; 494 const int setup_request_value = uint16_usb2host(setup_request->value); 495 switch (setup_request_value) 494 /* "The wValue field specifies the descriptor type in the high byte 495 * and the descriptor index in the low byte (refer to Table 9-5)." */ 496 const int desc_type = uint16_usb2host(setup_request->value) >> 8; 497 switch (desc_type) 496 498 { 497 499 case USB_DESCTYPE_HUB: … … 540 542 setup_request->value, 541 543 setup_request->request_type, setup_request->request, 542 setup_request_value, setup_request->index,544 desc_type, setup_request->index, 543 545 setup_request->length); 544 546 TRANSFER_END(request, EINVAL); -
uspace/lib/usbdev/src/request.c
rdd93bb2 r9f807c3 114 114 * (in native endianness). 115 115 * @param actual_data_size Actual size of transfered data 116 * 116 * (in native endianness). 117 117 * @return Error code. 118 118 * @retval EBADMEM @p pipe is NULL. … … 147 147 | (request_type << 5) | recipient, 148 148 .request = request, 149 .value = value,150 .index = index,151 .length = (uint16_t) data_size,149 .value = uint16_host2usb(value), 150 .index = uint16_host2usb(index), 151 .length = uint16_host2usb(data_size), 152 152 }; 153 153 … … 375 375 usb_standard_device_descriptor_t descriptor_tmp; 376 376 int rc = usb_request_get_descriptor(pipe, 377 USB_REQUEST_TYPE_STANDARD, USB_REQUEST_RECIPIENT_DEVICE, 377 USB_REQUEST_TYPE_STANDARD, USB_REQUEST_RECIPIENT_DEVICE, 378 378 USB_DESCTYPE_DEVICE, 0, 0, 379 379 &descriptor_tmp, sizeof(descriptor_tmp), … … 435 435 /* Everything is okay, copy the descriptor. */ 436 436 memcpy(descriptor, &descriptor_tmp, sizeof(descriptor_tmp)); 437 437 descriptor->total_length = uint16_usb2host(descriptor_tmp.total_length); 438 438 return EOK; 439 439 }
Note:
See TracChangeset
for help on using the changeset viewer.