Ignore:
Timestamp:
2018-02-05T00:54:08Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
af16ebe
Parents:
65c059f
git-author:
Ondřej Hlavatý <aearsis@…> (2018-02-05 00:27:40)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-02-05 00:54:08)
Message:

usbhost: prepare buffers for transfers in library

File:
1 edited

Legend:

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

    r65c059f rc21e6a5  
    4141#include <stddef.h>
    4242#include <stdint.h>
     43#include <usb/dma_buffer.h>
    4344#include <usb/request.h>
    4445#include <usb/usb.h>
     
    5657        /** Target for communication */
    5758        usb_target_t target;
     59        /** Direction of the transfer */
     60        usb_direction_t dir;
    5861
    5962        /** Endpoint used for communication */
    6063        endpoint_t *ep;
    61 
    62         /** Direction of the transfer */
    63         usb_direction_t dir;
    64 
    65         /** Function called on completion */
    66         usbhc_iface_transfer_callback_t on_complete;
    67         /** Arbitrary data for the handler */
    68         void *on_complete_data;
    6964
    7065        /** Place to store SETUP data needed by control transfers */
     
    7570        } setup;
    7671
    77         /** Place for data to send/receive */
    78         char *buffer;
    79         /** Size of memory pointed to by buffer member */
     72        /** DMA buffer with enforced policy */
     73        dma_buffer_t dma_buffer;
     74        /** Size of memory buffer */
    8075        size_t buffer_size;
     76
     77        /**
     78         * In case the DMA buffer is allocated, the original buffer must to be
     79         * stored to be filled after the IN transaction is finished.
     80         */
     81        char *original_buffer;
     82
     83        /** Indicates success/failure of the communication */
     84        errno_t error;
    8185        /** Actually used portion of the buffer */
    8286        size_t transferred_size;
    8387
    84         /** Indicates success/failure of the communication */
    85         errno_t error;
     88        /** Function called on completion */
     89        usbhc_iface_transfer_callback_t on_complete;
     90        /** Arbitrary data for the handler */
     91        void *on_complete_data;
    8692} usb_transfer_batch_t;
    8793
     
    108114void usb_transfer_batch_init(usb_transfer_batch_t *, endpoint_t *);
    109115
     116/** Buffer preparation */
     117errno_t usb_transfer_batch_prepare_buffer(usb_transfer_batch_t *, char *);
     118
    110119/** Batch finalization. */
    111120void usb_transfer_batch_finish(usb_transfer_batch_t *);
Note: See TracChangeset for help on using the changeset viewer.