Changeset 3bacee1 in mainline for uspace/app/vuhid
- Timestamp:
- 2018-04-12T16:27:17Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3cf22f9
- Parents:
- 76d0981d
- git-author:
- Jiri Svoboda <jiri@…> (2018-04-11 19:25:33)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-04-12 16:27:17)
- Location:
- uspace/app/vuhid
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/vuhid/device.c
r76d0981d r3bacee1 129 129 130 130 /* Check that we have not run out of available endpoints. */ 131 if ((iface->in_data_size > 0) 132 &&(hid_data->in_endpoint_first_free >= VUHID_ENDPOINT_MAX)) {131 if ((iface->in_data_size > 0) && 132 (hid_data->in_endpoint_first_free >= VUHID_ENDPOINT_MAX)) { 133 133 return ELIMIT; 134 134 } 135 if ((iface->out_data_size > 0) 136 &&(hid_data->out_endpoint_first_free >= VUHID_ENDPOINT_MAX)) {135 if ((iface->out_data_size > 0) && 136 (hid_data->out_endpoint_first_free >= VUHID_ENDPOINT_MAX)) { 137 137 return ELIMIT; 138 138 } … … 192 192 descr_iface->length = sizeof(usb_standard_interface_descriptor_t); 193 193 descr_iface->descriptor_type = USB_DESCTYPE_INTERFACE; 194 descr_iface->interface_number 195 =dev->descriptors->configuration->descriptor->interface_count;194 descr_iface->interface_number = 195 dev->descriptors->configuration->descriptor->interface_count; 196 196 descr_iface->alternate_setting = 0; 197 197 descr_iface->endpoint_count = ep_count; … … 230 230 descr_ep_in->length = sizeof(usb_standard_endpoint_descriptor_t); 231 231 descr_ep_in->descriptor_type = USB_DESCTYPE_ENDPOINT; 232 descr_ep_in->endpoint_address 233 =0x80 | hid_data->in_endpoint_first_free;232 descr_ep_in->endpoint_address = 233 0x80 | hid_data->in_endpoint_first_free; 234 234 descr_ep_in->attributes = 3; 235 235 descr_ep_in->max_packet_size = iface->in_data_size; … … 246 246 descr_ep_out->length = sizeof(usb_standard_endpoint_descriptor_t); 247 247 descr_ep_out->descriptor_type = USB_DESCTYPE_ENDPOINT; 248 descr_ep_out->endpoint_address 249 =0x00 | hid_data->out_endpoint_first_free;248 descr_ep_out->endpoint_address = 249 0x00 | hid_data->out_endpoint_first_free; 250 250 descr_ep_out->attributes = 3; 251 251 descr_ep_out->max_packet_size = iface->out_data_size; … … 256 256 usbvirt_device_configuration_extras_t *extra_descriptors; 257 257 extra_descriptors = realloc(dev->descriptors->configuration->extra, 258 sizeof(usbvirt_device_configuration_extras_t) 259 *(dev->descriptors->configuration->extra_count + descr_count));258 sizeof(usbvirt_device_configuration_extras_t) * 259 (dev->descriptors->configuration->extra_count + descr_count)); 260 260 if (extra_descriptors == NULL) { 261 261 rc = ENOMEM; … … 300 300 */ 301 301 if (iface->in_data_size > 0) { 302 hid_data->in_endpoints_mapping[hid_data->in_endpoint_first_free] 303 =iface;304 dev->ops->data_in[hid_data->in_endpoint_first_free] 305 =on_data_from_device;302 hid_data->in_endpoints_mapping[hid_data->in_endpoint_first_free] = 303 iface; 304 dev->ops->data_in[hid_data->in_endpoint_first_free] = 305 on_data_from_device; 306 306 hid_data->in_endpoint_first_free++; 307 307 } 308 308 if (iface->out_data_size > 0) { 309 hid_data->out_endpoints_mapping[hid_data->out_endpoint_first_free] 310 =iface;311 dev->ops->data_out[hid_data->out_endpoint_first_free] 312 =on_data_to_device;309 hid_data->out_endpoints_mapping[hid_data->out_endpoint_first_free] = 310 iface; 311 dev->ops->data_out[hid_data->out_endpoint_first_free] = 312 on_data_to_device; 313 313 hid_data->out_endpoint_first_free++; 314 314 } 315 315 316 hid_data->interface_mapping[ 317 dev->descriptors->configuration->descriptor->interface_count] 318 = iface; 316 hid_data->interface_mapping[dev->descriptors->configuration->descriptor->interface_count] = 317 iface; 319 318 320 319 dev->descriptors->configuration->descriptor->interface_count++; 321 dev->descriptors->configuration->descriptor->total_length 322 +=total_descr_size;320 dev->descriptors->configuration->descriptor->total_length += 321 total_descr_size; 323 322 324 323 hid_data->iface_count++; -
uspace/app/vuhid/stdreq.c
r76d0981d r3bacee1 50 50 51 51 if (setup_packet->value_high == USB_DESCTYPE_HID_REPORT) { 52 vuhid_interface_t *iface 53 =vuhid->interface_mapping[setup_packet->index];52 vuhid_interface_t *iface = 53 vuhid->interface_mapping[setup_packet->index]; 54 54 if (iface == NULL) { 55 55 return EFORWARD;
Note:
See TracChangeset
for help on using the changeset viewer.