Changeset df6ded8 in mainline for uspace/lib/usbdev/src/request.c


Ignore:
Timestamp:
2018-02-28T16:37:50Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1b20da0
Parents:
f5e5f73 (diff), b2dca8de (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Jakub Jermar <jakub@…> (2018-02-28 16:06:42)
git-committer:
Jakub Jermar <jakub@…> (2018-02-28 16:37:50)
Message:

Merge github.com:helenos-xhci-team/helenos

This commit merges support for USB 3 and generally refactors, fixes,
extends and cleans up the existing USB framework.

Notable additions and features:

  • new host controller driver has been implemented to control various xHC models (among others, NEC Renesas uPD720200)
  • isochronous data transfer mode
  • support for explicit USB device removal
  • USB tablet driver
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdev/src/request.c

    rf5e5f73 rdf6ded8  
    11/*
    22 * Copyright (c) 2011 Vojtech Horky
     3 * Copyright (c) 2018 Ondrej Hlavaty
    34 * All rights reserved.
    45 *
     
    118119 * @param data_size        Size of the @p data buffer
    119120 *                         (in native endianness).
    120  * @param actual_data_size Actual size of transfered data
     121 * @param actual_data_size Actual size of transferred data
    121122 *                         (in native endianness).
    122123 *
     
    183184
    184185        uint16_t status_usb_endianess;
    185         size_t data_transfered_size;
     186        size_t data_transferred_size;
    186187        errno_t rc = usb_control_request_get(pipe, USB_REQUEST_TYPE_STANDARD,
    187188            recipient, USB_DEVREQ_GET_STATUS, 0, uint16_host2usb(index),
    188             &status_usb_endianess, 2, &data_transfered_size);
    189         if (rc != EOK) {
    190                 return rc;
    191         }
    192         if (data_transfered_size != 2) {
     189            &status_usb_endianess, 2, &data_transferred_size);
     190        if (rc != EOK) {
     191                return rc;
     192        }
     193        if (data_transferred_size != 2) {
    193194                return ELIMIT;
    194195        }
     
    314315         */
    315316        uint8_t tmp_buffer;
    316         size_t bytes_transfered;
     317        size_t bytes_transferred;
    317318        rc = usb_request_get_descriptor(pipe, request_type, recipient,
    318319            descriptor_type, descriptor_index, language,
    319             &tmp_buffer, sizeof(tmp_buffer), &bytes_transfered);
    320         if (rc != EOK) {
    321                 return rc;
    322         }
    323         if (bytes_transfered != 1) {
     320            &tmp_buffer, sizeof(tmp_buffer), &bytes_transferred);
     321        if (rc != EOK) {
     322                return rc;
     323        }
     324        if (bytes_transferred != 1) {
    324325                return ELIMIT;
    325326        }
     
    340341        rc = usb_request_get_descriptor(pipe, request_type, recipient,
    341342            descriptor_type, descriptor_index, language,
    342             buffer, size, &bytes_transfered);
     343            buffer, size, &bytes_transferred);
    343344        if (rc != EOK) {
    344345                free(buffer);
    345346                return rc;
    346347        }
    347         if (bytes_transfered != size) {
     348        if (bytes_transferred != size) {
    348349                free(buffer);
    349350                return ELIMIT;
     
    824825 * @return Error code.
    825826 */
    826 errno_t usb_request_clear_endpoint_halt(usb_pipe_t *pipe, uint16_t ep_index)
     827static errno_t usb_request_clear_endpoint_halt(usb_pipe_t *pipe, uint16_t ep_index)
    827828{
    828829        return usb_request_clear_feature(pipe,
     
    843844                return EINVAL;
    844845        }
    845         return usb_request_clear_endpoint_halt(ctrl_pipe,
    846             target_pipe->endpoint_no);
     846
     847        uint16_t index = target_pipe->desc.endpoint_no;
     848        index |= (target_pipe->desc.direction == USB_DIRECTION_IN) << 7;
     849        return usb_request_clear_endpoint_halt(ctrl_pipe, index);
    847850}
    848851
     
    858861{
    859862        uint16_t status_tmp;
    860         uint16_t pipe_index = (uint16_t) pipe->endpoint_no;
     863        uint16_t pipe_index = (uint16_t) pipe->desc.endpoint_no;
    861864        errno_t rc = usb_request_get_status(ctrl_pipe,
    862865            USB_REQUEST_RECIPIENT_ENDPOINT, uint16_host2usb(pipe_index),
Note: See TracChangeset for help on using the changeset viewer.