Ignore:
Timestamp:
2011-12-23T18:13:33Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3819ce5, b39eb79, f0b74b2
Parents:
2f0dd2a (diff), 153cc76a (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:

USB branch changes.

+ USB device drivers use single async session to host controller, this session (represented by usb_hc_connection_t) is used for both HC requests and to back usb device connection.
+ Pipe locking was removed. Reference counting was moved to usb_hc_connection_t. Every read/write operation uses separate parallel exchange thus any contention is resolved on hc side.

  • async_sess_t setup using EXCHANGE_PARALLEL uses one extra phone (session phone, each exch creates its own), thus the number of phones used by usb dvice driver might increase. Possible solutions are: make read/write calls atomic (all other calls are atomic) and use EXCHANGE_ATOMIC, any other solution provided by changes to async_sess_t.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/include/usb/host/usb_transfer_batch.h

    r2f0dd2a r7e1b130  
    6565         */
    6666        size_t setup_size;
    67         /** Actually used portion of the buffer */
    68         size_t transfered_size;
    69         /** Indicates success/failure of the communication */
    70         int error;
    7167        /** Host controller function, passed to callback function */
    7268        ddf_fun_t *fun;
     69
     70        /** Actually used portion of the buffer
     71         * This member is never accessed by functions provided in this header,
     72         * with the exception of usb_transfer_batch_finish. For external use.
     73         */
     74        size_t transfered_size;
     75        /** Indicates success/failure of the communication
     76         * This member is never accessed by functions provided in this header,
     77         * with the exception of usb_transfer_batch_finish. For external use.
     78         */
     79        int error;
    7380
    7481        /** Driver specific data */
     
    106113void usb_transfer_batch_destroy(const usb_transfer_batch_t *instance);
    107114
    108 void usb_transfer_batch_finish(const usb_transfer_batch_t *instance,
    109     const void* data, size_t size);
     115void usb_transfer_batch_finish_error(const usb_transfer_batch_t *instance,
     116    const void* data, size_t size, int error);
    110117/*----------------------------------------------------------------------------*/
    111 /** Override error value and finishes transfer.
     118/** Finish batch using stored error value and transferred size.
    112119 *
    113120 * @param[in] instance Batch structure to use.
    114121 * @param[in] data Data to copy to the output buffer.
    115  * @param[in] size Size of @p data.
    116  * @param[in] error Set batch status to this error value.
    117122 */
    118 static inline void usb_transfer_batch_finish_error(
    119     usb_transfer_batch_t *instance, const void* data, size_t size, int error)
     123static inline void usb_transfer_batch_finish(
     124    const usb_transfer_batch_t *instance, const void* data)
    120125{
    121126        assert(instance);
    122         instance->error = error;
    123         usb_transfer_batch_finish(instance, data, size);
     127        usb_transfer_batch_finish_error(
     128            instance, data, instance->transfered_size, instance->error);
    124129}
    125130/*----------------------------------------------------------------------------*/
Note: See TracChangeset for help on using the changeset viewer.