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


Ignore:
Timestamp:
2011-04-17T19:17:55Z (13 years ago)
Author:
Matej Klonfar <maklf@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
63517c2, cfbbe1d3
Parents:
ef354b6 (diff), 8595577b (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:

new report structure fixes

File:
1 edited

Legend:

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

    ref354b6 re50cd7f  
    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;
     101
     102        /** Whether to automatically reset halt on the endpoint.
     103         * Valid only for control endpoint zero.
     104         */
     105        bool auto_reset_halt;
    82106} usb_pipe_t;
    83107
     
    134158int usb_pipe_initialize_from_configuration(usb_endpoint_mapping_t *,
    135159    size_t, uint8_t *, size_t, usb_device_connection_t *);
     160int usb_pipe_register_with_speed(usb_pipe_t *, usb_speed_t,
     161    unsigned int, usb_hc_connection_t *);
    136162int usb_pipe_register(usb_pipe_t *, unsigned int, usb_hc_connection_t *);
    137163int usb_pipe_unregister(usb_pipe_t *, usb_hc_connection_t *);
     
    140166int usb_pipe_end_session(usb_pipe_t *);
    141167bool usb_pipe_is_session_started(usb_pipe_t *);
     168
     169int usb_pipe_start_long_transfer(usb_pipe_t *);
     170void usb_pipe_end_long_transfer(usb_pipe_t *);
    142171
    143172int usb_pipe_read(usb_pipe_t *, void *, size_t, size_t *);
Note: See TracChangeset for help on using the changeset viewer.