Ignore:
Timestamp:
2018-02-05T02:04:58Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fc3dfe6d
Parents:
af16ebe
Message:

libdrv usbhc iface: wrap transfer arguments into structure

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/include/usbhc_iface.h

    raf16ebe r239eea41  
    126126} usb_pipe_desc_t;
    127127
     128typedef struct usb_pipe_transfer_request {
     129        usb_direction_t dir;
     130        usb_endpoint_t endpoint;
     131        usb_stream_t stream;
     132
     133        uint64_t setup;                 /**< Valid iff the transfer is of control type */
     134
     135        /**
     136         * Base address of the buffer to share. Must be at least offset + size
     137         * large. Is patched after being transmitted over IPC, so the pointer is
     138         * still valid.
     139         */
     140        void *base;                     
     141        size_t offset;                  /**< Offset to the buffer */
     142        size_t size;                    /**< Requested size. */
     143        dma_policy_t buffer_policy;     /**< Properties of the buffer. */
     144} usbhc_iface_transfer_request_t;
     145
    128146/** This structure follows standard endpoint descriptor + superspeed companion
    129147 * descriptor, and exists to avoid dependency of libdrv on libusb. Keep the
     
    157175extern errno_t usbhc_unregister_endpoint(async_exch_t *, const usb_pipe_desc_t *);
    158176
    159 extern errno_t usbhc_transfer(async_exch_t *, usb_endpoint_t, usb_direction_t,
    160     uint64_t, void *, size_t, size_t *);
     177extern errno_t usbhc_transfer(async_exch_t *, const usbhc_iface_transfer_request_t *, size_t *);
    161178
    162179/** Callback for outgoing transfer */
     
    173190        errno_t (*unregister_endpoint)(ddf_fun_t *, const usb_pipe_desc_t *);
    174191
    175         errno_t (*transfer)(ddf_fun_t *, usb_target_t,
    176                 usb_direction_t, uint64_t, char *, size_t,
    177                 usbhc_iface_transfer_callback_t, void *);
     192        errno_t (*transfer)(ddf_fun_t *, const usbhc_iface_transfer_request_t *,
     193            usbhc_iface_transfer_callback_t, void *);
    178194} usbhc_iface_t;
    179195
Note: See TracChangeset for help on using the changeset viewer.