Changeset 92574f4 in mainline for uspace/lib/usb/include/usb/pipes.h


Ignore:
Timestamp:
2011-02-24T12:03:27Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e7b7ebd5
Parents:
4837092 (diff), a80849c (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.
Message:

Merged development (changes in DDF, etc.).

Conflicts in uspace/drv/usbkbd/main.c

File:
1 edited

Legend:

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

    r4837092 r92574f4  
    3131 */
    3232/** @file
    33  * Communication between device drivers and host controller driver.
     33 * USB pipes representation.
    3434 */
    3535#ifndef LIBUSB_PIPES_H_
     
    3838#include <sys/types.h>
    3939#include <usb/usb.h>
     40#include <usb/usbdevice.h>
     41#include <usb/descriptor.h>
    4042#include <ipc/devman.h>
    41 #include <driver.h>
     43#include <ddf/driver.h>
    4244
    4345/**
     
    7375        usb_direction_t direction;
    7476
     77        /** Maximum packet size for the endpoint. */
     78        size_t max_packet_size;
     79
    7580        /** Phone to the host controller.
    7681         * Negative when no session is active.
     
    8085
    8186
     87/** Description of endpoint characteristics. */
     88typedef struct {
     89        /** Transfer type (e.g. control or interrupt). */
     90        usb_transfer_type_t transfer_type;
     91        /** Transfer direction (to or from a device). */
     92        usb_direction_t direction;
     93        /** Interface class this endpoint belongs to (-1 for any). */
     94        int interface_class;
     95        /** Interface subclass this endpoint belongs to (-1 for any). */
     96        int interface_subclass;
     97        /** Interface protocol this endpoint belongs to (-1 for any). */
     98        int interface_protocol;
     99        /** Extra endpoint flags. */
     100        unsigned int flags;
     101} usb_endpoint_description_t;
     102
     103/** Mapping of endpoint pipes and endpoint descriptions. */
     104typedef struct {
     105        /** Endpoint pipe. */
     106        usb_endpoint_pipe_t *pipe;
     107        /** Endpoint description. */
     108        const usb_endpoint_description_t *description;
     109        /** Interface number the endpoint must belong to (-1 for any). */
     110        const int interface_no;
     111        /** Found descriptor fitting the description. */
     112        usb_standard_endpoint_descriptor_t *descriptor;
     113        /** Interface the endpoint belongs to. */
     114        usb_standard_interface_descriptor_t *interface;
     115        /** Whether the endpoint was actually found. */
     116        bool present;
     117} usb_endpoint_mapping_t;
     118
     119int usb_device_connection_initialize_on_default_address(
     120    usb_device_connection_t *, usb_hc_connection_t *);
    82121int usb_device_connection_initialize_from_device(usb_device_connection_t *,
    83     device_t *);
     122    ddf_dev_t *);
    84123int usb_device_connection_initialize(usb_device_connection_t *,
    85124    devman_handle_t, usb_address_t);
    86125
     126int usb_device_get_assigned_interface(ddf_dev_t *);
     127
    87128int usb_endpoint_pipe_initialize(usb_endpoint_pipe_t *,
    88129    usb_device_connection_t *,
    89     usb_endpoint_t, usb_transfer_type_t, usb_direction_t);
     130    usb_endpoint_t, usb_transfer_type_t, size_t, usb_direction_t);
    90131int usb_endpoint_pipe_initialize_default_control(usb_endpoint_pipe_t *,
    91132    usb_device_connection_t *);
     133int usb_endpoint_pipe_initialize_from_configuration(usb_endpoint_mapping_t *,
     134    size_t, uint8_t *, size_t, usb_device_connection_t *);
    92135
    93136
    94137int usb_endpoint_pipe_start_session(usb_endpoint_pipe_t *);
    95138int usb_endpoint_pipe_end_session(usb_endpoint_pipe_t *);
     139bool usb_endpoint_pipe_is_session_started(usb_endpoint_pipe_t *);
    96140
    97141int usb_endpoint_pipe_read(usb_endpoint_pipe_t *, void *, size_t, size_t *);
     
    103147    void *, size_t);
    104148
    105 
    106 
    107 int usb_endpoint_pipe_async_read(usb_endpoint_pipe_t *, void *, size_t,
    108     size_t *, usb_handle_t *);
    109 int usb_endpoint_pipe_async_write(usb_endpoint_pipe_t *, void *, size_t,
    110     usb_handle_t *);
    111 
    112 int usb_endpoint_pipe_async_control_read(usb_endpoint_pipe_t *, void *, size_t,
    113     void *, size_t, size_t *, usb_handle_t *);
    114 int usb_endpoint_pipe_async_control_write(usb_endpoint_pipe_t *, void *, size_t,
    115     void *, size_t, usb_handle_t *);
    116 
    117 int usb_endpoint_pipe_wait_for(usb_endpoint_pipe_t *, usb_handle_t);
    118 
    119149#endif
    120150/**
Note: See TracChangeset for help on using the changeset viewer.