Changeset f9d0a86 in mainline for uspace/lib/drv/include/usb_iface.h


Ignore:
Timestamp:
2017-11-14T12:24:42Z (6 years ago)
Author:
Aearsis <Hlavaty.Ondrej@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6cad776
Parents:
887c9de (diff), d2d142a (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:
Aearsis <Hlavaty.Ondrej@…> (2017-11-14 01:04:19)
git-committer:
Aearsis <Hlavaty.Ondrej@…> (2017-11-14 12:24:42)
Message:

Merge tag '0.7.1'

The merge wasn't clean, because of changes in build system. The most
significant change was partial revert of usbhc callback refactoring,
which now does not take usb transfer batch, but few named fields again.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/include/usb_iface.h

    r887c9de rf9d0a86  
    4040#include "ddf/driver.h"
    4141#include <async.h>
    42 #include <usb/usb.h>
    4342
    4443typedef async_sess_t usb_dev_session_t;
     44
     45/** USB speeds. */
     46typedef enum {
     47        /** USB 1.1 low speed (1.5Mbits/s). */
     48        USB_SPEED_LOW,
     49        /** USB 1.1 full speed (12Mbits/s). */
     50        USB_SPEED_FULL,
     51        /** USB 2.0 high speed (480Mbits/s). */
     52        USB_SPEED_HIGH,
     53        /** USB 3.0 super speed (5Gbits/s). */
     54        USB_SPEED_SUPER,
     55        /** Psuedo-speed serving as a boundary. */
     56        USB_SPEED_MAX
     57} usb_speed_t;
     58
     59/** USB endpoint number type.
     60 * Negative values could be used to indicate error.
     61 */
     62typedef int16_t usb_endpoint_t;
     63
     64/** USB address type.
     65 * Negative values could be used to indicate error.
     66 */
     67typedef int16_t usb_address_t;
     68
     69/** USB address for the purposes of Transaction Translation.
     70 */
     71typedef struct {
     72        usb_address_t address;
     73        unsigned port;
     74} usb_tt_address_t;
     75
     76/** USB transfer type. */
     77typedef enum {
     78        USB_TRANSFER_CONTROL = 0,
     79        USB_TRANSFER_ISOCHRONOUS = 1,
     80        USB_TRANSFER_BULK = 2,
     81        USB_TRANSFER_INTERRUPT = 3
     82} usb_transfer_type_t;
     83
     84/** USB data transfer direction. */
     85typedef enum {
     86        USB_DIRECTION_IN,
     87        USB_DIRECTION_OUT,
     88        USB_DIRECTION_BOTH
     89} usb_direction_t;
     90
     91/** USB complete address type.
     92 * Pair address + endpoint is identification of transaction recipient.
     93 */
     94typedef union {
     95        struct {
     96                usb_address_t address;
     97                usb_endpoint_t endpoint;
     98        } __attribute__((packed));
     99        uint32_t packed;
     100} usb_target_t;
     101
     102/** Description of usb endpoint.
     103 */
     104typedef struct {
     105        /** Endpoint number. */
     106        usb_endpoint_t endpoint_no;
     107
     108        /** Endpoint transfer type. */
     109        usb_transfer_type_t transfer_type;
     110
     111        /** Endpoint direction. */
     112        usb_direction_t direction;
     113
     114        /** Maximum packet size for the endpoint. */
     115        size_t max_packet_size;
     116
     117        /** Number of packets per frame/uframe.
     118         * Only valid for HS INT and ISO transfers. All others should set to 1*/
     119        unsigned packets;
     120
     121        struct {
     122                unsigned polling_interval;
     123        } usb2;
     124
     125        struct {
     126                unsigned max_burst;
     127                unsigned max_streams;
     128        } usb3;
     129} usb_endpoint_desc_t;
     130
    45131
    46132extern usb_dev_session_t *usb_dev_connect(devman_handle_t);
Note: See TracChangeset for help on using the changeset viewer.