Changeset ad4562c2 in mainline
- Timestamp:
- 2011-02-26T23:48:57Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 882f8b1
- Parents:
- 3a1aa20
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/usbhub.c
r3a1aa20 rad4562c2 253 253 usb_endpoint_pipe_start_session(&result->endpoints.control); 254 254 opResult = usb_request_get_descriptor(&result->endpoints.control, 255 USB_REQUEST_TYPE_CLASS, 256 USB_DESCTYPE_HUB, 0, 0, serialized_descriptor, 255 USB_REQUEST_TYPE_CLASS, USB_REQUEST_RECIPIENT_DEVICE, 256 USB_DESCTYPE_HUB, 257 0, 0, serialized_descriptor, 257 258 USB_HUB_MAX_DESCRIPTOR_SIZE, &received_size); 258 259 usb_endpoint_pipe_end_session(&result->endpoints.control); -
uspace/lib/usb/include/usb/request.h
r3a1aa20 rad4562c2 96 96 int usb_request_set_address(usb_endpoint_pipe_t *, usb_address_t); 97 97 int usb_request_get_descriptor(usb_endpoint_pipe_t *, usb_request_type_t, 98 uint8_t, uint8_t, uint16_t, void *, size_t, size_t *); 98 usb_request_recipient_t, uint8_t, uint8_t, uint16_t, void *, size_t, 99 size_t *); 99 100 int usb_request_get_descriptor_alloc(usb_endpoint_pipe_t *, usb_request_type_t, 100 u int8_t, uint8_t, uint16_t, void **, size_t *);101 usb_request_recipient_t, uint8_t, uint8_t, uint16_t, void **, size_t *); 101 102 int usb_request_get_device_descriptor(usb_endpoint_pipe_t *, 102 103 usb_standard_device_descriptor_t *); -
uspace/lib/usb/src/hidparser.c
r3a1aa20 rad4562c2 144 144 int usb_hid_boot_keyboard_output_report(uint8_t leds, uint8_t *data, size_t size) 145 145 { 146 if (size < 2){146 if (size < 1){ 147 147 return -1; 148 148 } 149 149 150 data[ 1] = leds;150 data[0] = leds; 151 151 return EOK; 152 152 } -
uspace/lib/usb/src/request.c
r3a1aa20 rad4562c2 36 36 #include <errno.h> 37 37 #include <assert.h> 38 #include <usb/debug.h> 38 39 39 40 #define MAX_DATA_LENGTH ((size_t)(0xFFFF)) … … 209 210 */ 210 211 int usb_request_get_descriptor(usb_endpoint_pipe_t *pipe, 211 usb_request_type_t request_type, 212 usb_request_type_t request_type, usb_request_recipient_t recipient, 212 213 uint8_t descriptor_type, uint8_t descriptor_index, 213 214 uint16_t language, … … 224 225 225 226 return usb_control_request_get(pipe, 226 request_type, USB_REQUEST_RECIPIENT_DEVICE,227 request_type, recipient, 227 228 USB_DEVREQ_GET_DESCRIPTOR, 228 229 wValue, language, … … 242 243 */ 243 244 int usb_request_get_descriptor_alloc(usb_endpoint_pipe_t * pipe, 244 usb_request_type_t request_type, 245 usb_request_type_t request_type, usb_request_recipient_t recipient, 245 246 uint8_t descriptor_type, uint8_t descriptor_index, 246 247 uint16_t language, … … 258 259 uint8_t tmp_buffer[1]; 259 260 size_t bytes_transfered; 260 rc = usb_request_get_descriptor(pipe, request_type, 261 rc = usb_request_get_descriptor(pipe, request_type, recipient, 261 262 descriptor_type, descriptor_index, language, 262 263 &tmp_buffer, 1, &bytes_transfered); … … 283 284 } 284 285 285 rc = usb_request_get_descriptor(pipe, request_type, 286 rc = usb_request_get_descriptor(pipe, request_type, recipient, 286 287 descriptor_type, descriptor_index, language, 287 288 buffer, size, &bytes_transfered); … … 320 321 usb_standard_device_descriptor_t descriptor_tmp; 321 322 int rc = usb_request_get_descriptor(pipe, 322 USB_REQUEST_TYPE_STANDARD, USB_ DESCTYPE_DEVICE,323 0, 0,323 USB_REQUEST_TYPE_STANDARD, USB_REQUEST_RECIPIENT_DEVICE, 324 USB_DESCTYPE_DEVICE, 0, 0, 324 325 &descriptor_tmp, sizeof(descriptor_tmp), 325 326 &actually_transferred); … … 366 367 usb_standard_configuration_descriptor_t descriptor_tmp; 367 368 int rc = usb_request_get_descriptor(pipe, 368 USB_REQUEST_TYPE_STANDARD, USB_ DESCTYPE_CONFIGURATION,369 index, 0,369 USB_REQUEST_TYPE_STANDARD, USB_REQUEST_RECIPIENT_DEVICE, 370 USB_DESCTYPE_CONFIGURATION, index, 0, 370 371 &descriptor_tmp, sizeof(descriptor_tmp), 371 372 &actually_transferred); … … 406 407 407 408 return usb_request_get_descriptor(pipe, 408 USB_REQUEST_TYPE_STANDARD, USB_ DESCTYPE_CONFIGURATION,409 index, 0,409 USB_REQUEST_TYPE_STANDARD, USB_REQUEST_RECIPIENT_DEVICE, 410 USB_DESCTYPE_CONFIGURATION, index, 0, 410 411 descriptor, descriptor_size, actual_size); 411 412 } … … 452 453 size_t string_descriptor_size = 0; 453 454 rc = usb_request_get_descriptor_alloc(pipe, 454 USB_REQUEST_TYPE_STANDARD, USB_DESCTYPE_STRING, 0, 0, 455 USB_REQUEST_TYPE_STANDARD, USB_REQUEST_RECIPIENT_DEVICE, 456 USB_DESCTYPE_STRING, 0, 0, 455 457 (void **) &string_descriptor, &string_descriptor_size); 456 458 if (rc != EOK) { … … 531 533 size_t string_size; 532 534 rc = usb_request_get_descriptor_alloc(pipe, 533 USB_REQUEST_TYPE_STANDARD, USB_ DESCTYPE_STRING,534 index, uint16_host2usb(lang),535 USB_REQUEST_TYPE_STANDARD, USB_REQUEST_RECIPIENT_DEVICE, 536 USB_DESCTYPE_STRING, index, uint16_host2usb(lang), 535 537 (void **) &string, &string_size); 536 538 if (rc != EOK) {
Note:
See TracChangeset
for help on using the changeset viewer.