Changeset 97663ee in mainline
- Timestamp:
- 2013-01-05T12:48:54Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d1974966
- Parents:
- f704194
- Location:
- uspace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/vuhid/device.c
rf704194 r97663ee 254 254 255 255 /* Extend existing extra descriptors with these ones. */ 256 usbvirt_device_configuration_extras_t *extra_descriptors 257 = dev->descriptors->configuration->extra; 258 extra_descriptors = realloc(extra_descriptors, 256 usbvirt_device_configuration_extras_t *extra_descriptors; 257 extra_descriptors = realloc(dev->descriptors->configuration->extra, 259 258 sizeof(usbvirt_device_configuration_extras_t) 260 259 * (dev->descriptors->configuration->extra_count + descr_count)); -
uspace/lib/usbvirt/include/usbvirt/device.h
rf704194 r97663ee 111 111 typedef struct { 112 112 /** Actual data. */ 113 uint8_t *data;113 const uint8_t *data; 114 114 /** Data length. */ 115 115 size_t length; … … 121 121 usb_standard_configuration_descriptor_t *descriptor; 122 122 /** Array of extra data. */ 123 usbvirt_device_configuration_extras_t *extra;123 const usbvirt_device_configuration_extras_t *extra; 124 124 /** Length of @c extra array. */ 125 125 size_t extra_count; … … 131 131 * There is always only one such descriptor for the device. 132 132 */ 133 usb_standard_device_descriptor_t *device;133 const usb_standard_device_descriptor_t *device; 134 134 135 135 /** Configurations. */ … … 206 206 207 207 void usbvirt_control_reply_helper(const usb_device_request_setup_packet_t *, 208 uint8_t *, size_t *, void *, size_t);208 uint8_t *, size_t *, const void *, size_t); 209 209 210 210 int usbvirt_control_write(usbvirt_device_t *, void *, size_t, void *, size_t); -
uspace/lib/usbvirt/src/stdreq.c
rf704194 r97663ee 51 51 void usbvirt_control_reply_helper(const usb_device_request_setup_packet_t *setup_packet, 52 52 uint8_t *data, size_t *act_size, 53 void *actual_data, size_t actual_data_size)53 const void *actual_data, size_t actual_data_size) 54 54 { 55 55 size_t expected_size = setup_packet->length; … … 98 98 } 99 99 /* Copy the data. */ 100 usbvirt_device_configuration_t *config = &device->descriptors101 ->configuration[index];100 const usbvirt_device_configuration_t *config = 101 &device->descriptors->configuration[index]; 102 102 uint8_t *all_data = malloc(config->descriptor->total_length); 103 103 if (all_data == NULL) { … … 110 110 size_t i; 111 111 for (i = 0; i < config->extra_count; i++) { 112 usbvirt_device_configuration_extras_t *extra112 const usbvirt_device_configuration_extras_t *extra 113 113 = &config->extra[i]; 114 114 memcpy(ptr, extra->data, extra->length);
Note:
See TracChangeset
for help on using the changeset viewer.