Ignore:
Timestamp:
2018-01-08T17:17:38Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bdd8842c
Parents:
eb928c4
Message:

usbhost: documentation & cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/src/usb_transfer_batch.c

    reb928c4 r1102eca  
    4444#include "usb_transfer_batch.h"
    4545
    46 /** Create a batch on given endpoint.
     46/**
     47 * Create a batch on a given endpoint.
     48 *
     49 * If the bus callback is not defined, it just creates a default batch.
    4750 */
    4851usb_transfer_batch_t *usb_transfer_batch_create(endpoint_t *ep)
     
    5558        if (!ops) {
    5659                usb_transfer_batch_t *batch = calloc(1, sizeof(usb_transfer_batch_t));
     60                if (!batch)
     61                        return NULL;
    5762                usb_transfer_batch_init(batch, ep);
    5863                return batch;
     
    6267}
    6368
    64 /** Initialize given batch structure.
     69/**
     70 * Initialize given batch structure.
    6571 */
    6672void usb_transfer_batch_init(usb_transfer_batch_t *batch, endpoint_t *ep)
    6773{
    6874        assert(ep);
     75        /* Batch reference */
    6976        endpoint_add_ref(ep);
    7077        batch->ep = ep;
    7178}
    7279
    73 /** Destroy the batch.
    74  *
    75  * @param[in] batch Batch structure to use.
     80/**
     81 * Destroy the batch. If there's no bus callback, just free it.
    7682 */
    7783void usb_transfer_batch_destroy(usb_transfer_batch_t *batch)
     
    8389        const bus_ops_t *ops = BUS_OPS_LOOKUP(bus->ops, batch_destroy);
    8490
     91        /* Batch reference */
    8592        endpoint_del_ref(batch->ep);
    8693
     
    97104}
    98105
    99 /** Finish a transfer batch: call handler, destroy batch, release endpoint.
     106/**
     107 * Finish a transfer batch: call handler, destroy batch, release endpoint.
    100108 *
    101109 * Call only after the batch have been scheduled && completed!
    102  *
    103  * @param[in] batch Batch structure to use.
    104110 */
    105111void usb_transfer_batch_finish(usb_transfer_batch_t *batch)
     
    121127}
    122128
    123 /** Finish a transfer batch as an aborted one.
    124  *
    125  * @param[in] batch Batch structure to use.
     129/**
     130 * Finish a transfer batch as an aborted one.
    126131 */
    127132void usb_transfer_batch_abort(usb_transfer_batch_t *batch)
Note: See TracChangeset for help on using the changeset viewer.