Changeset 501e5df in mainline for uspace/lib/usb/include/usb/pipes.h


Ignore:
Timestamp:
2011-04-09T20:56:50Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ba038f4
Parents:
8790650 (diff), 709e868 (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:

Development changes

File:
1 edited

Legend:

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

    r8790650 r501e5df  
    4242#include <ipc/devman.h>
    4343#include <ddf/driver.h>
     44#include <fibril_synch.h>
    4445
    4546/** Abstraction of a physical connection to the device.
     
    5960 * This endpoint must be bound with existing usb_device_connection_t
    6061 * (i.e. the wire to send data over).
     62 *
     63 * Locking order: if you want to lock both mutexes
     64 * (@c guard and @c hc_phone_mutex), lock @c guard first.
     65 * It is not necessary to lock @c guard if you want to lock @c hc_phone_mutex
     66 * only.
    6167 */
    6268typedef struct {
     69        /** Guard of the whole pipe. */
     70        fibril_mutex_t guard;
     71
    6372        /** The connection used for sending the data. */
    6473        usb_device_connection_t *wire;
     
    7887        /** Phone to the host controller.
    7988         * Negative when no session is active.
     89         * It is an error to access this member without @c hc_phone_mutex
     90         * being locked.
     91         * If call over the phone is to be made, it must be preceeded by
     92         * call to pipe_add_ref() [internal libusb function].
    8093         */
    8194        int hc_phone;
     95
     96        /** Guard for serialization of requests over the phone. */
     97        fibril_mutex_t hc_phone_mutex;
     98
     99        /** Number of active transfers over the pipe. */
     100        int refcount;
    82101} usb_pipe_t;
    83102
     
    134153int usb_pipe_initialize_from_configuration(usb_endpoint_mapping_t *,
    135154    size_t, uint8_t *, size_t, usb_device_connection_t *);
     155int usb_pipe_register_with_speed(usb_pipe_t *, usb_speed_t,
     156    unsigned int, usb_hc_connection_t *);
    136157int usb_pipe_register(usb_pipe_t *, unsigned int, usb_hc_connection_t *);
    137158int usb_pipe_unregister(usb_pipe_t *, usb_hc_connection_t *);
     
    140161int usb_pipe_end_session(usb_pipe_t *);
    141162bool usb_pipe_is_session_started(usb_pipe_t *);
     163
     164int usb_pipe_start_long_transfer(usb_pipe_t *);
     165void usb_pipe_end_long_transfer(usb_pipe_t *);
    142166
    143167int usb_pipe_read(usb_pipe_t *, void *, size_t, size_t *);
Note: See TracChangeset for help on using the changeset viewer.