Changeset 93ef8f6 in mainline for uspace/lib/usb/include/usb/pipes.h


Ignore:
Timestamp:
2011-02-02T23:13:34Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9d4579e
Parents:
ab65fa1
Message:

Pipes initialization from config descriptor

First attempt, may contain bugs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/include/usb/pipes.h

    rab65fa1 r93ef8f6  
    3838#include <sys/types.h>
    3939#include <usb/usb.h>
     40#include <usb/descriptor.h>
    4041#include <ipc/devman.h>
    4142#include <driver.h>
     
    7980} usb_endpoint_pipe_t;
    8081
     82/** Flag for default control pipe. */
     83#define USB_ENDPOINT_DESCRIPTION_DEFAULT_CONTROL_PIPE 1
     84
     85/** Description of endpoint characteristics. */
     86typedef struct {
     87        /** Transfer type (e.g. control or interrupt). */
     88        usb_transfer_type_t transfer_type;
     89        /** Transfer direction (to or from a device). */
     90        usb_direction_t direction;
     91        /** Interface class this endpoint belongs to (-1 for any). */
     92        int interface_class;
     93        /** Interface subclass this endpoint belongs to (-1 for any). */
     94        int interface_subclass;
     95        /** Interface protocol this endpoint belogs to (-1 for any). */
     96        int interface_protocol;
     97        /** Extra endpoint flags. */
     98        unsigned int flags;
     99} usb_endpoint_description_t;
     100
     101/** Mapping of endpoint pipes and endpoint descriptions. */
     102typedef struct {
     103        /** Endpoint pipe. */
     104        usb_endpoint_pipe_t *pipe;
     105        /** Endpoint description. */
     106        const usb_endpoint_description_t *description;
     107        /** Found descriptor fitting the description. */
     108        usb_standard_endpoint_descriptor_t *descriptor;
     109        /** Whether the endpoint was actually found. */
     110        bool present;
     111} usb_endpoint_mapping_t;
    81112
    82113int usb_device_connection_initialize_from_device(usb_device_connection_t *,
     
    90121int usb_endpoint_pipe_initialize_default_control(usb_endpoint_pipe_t *,
    91122    usb_device_connection_t *);
     123int usb_endpoint_pipe_initialize_from_configuration(usb_endpoint_mapping_t *,
     124    size_t, uint8_t *, size_t, usb_device_connection_t *);
    92125
    93126
Note: See TracChangeset for help on using the changeset viewer.