Changeset 1102eca in mainline for uspace/lib/usbhost/src/usb_transfer_batch.c
- Timestamp:
- 2018-01-08T17:17:38Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bdd8842c
- Parents:
- eb928c4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/usb_transfer_batch.c
reb928c4 r1102eca 44 44 #include "usb_transfer_batch.h" 45 45 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. 47 50 */ 48 51 usb_transfer_batch_t *usb_transfer_batch_create(endpoint_t *ep) … … 55 58 if (!ops) { 56 59 usb_transfer_batch_t *batch = calloc(1, sizeof(usb_transfer_batch_t)); 60 if (!batch) 61 return NULL; 57 62 usb_transfer_batch_init(batch, ep); 58 63 return batch; … … 62 67 } 63 68 64 /** Initialize given batch structure. 69 /** 70 * Initialize given batch structure. 65 71 */ 66 72 void usb_transfer_batch_init(usb_transfer_batch_t *batch, endpoint_t *ep) 67 73 { 68 74 assert(ep); 75 /* Batch reference */ 69 76 endpoint_add_ref(ep); 70 77 batch->ep = ep; 71 78 } 72 79 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. 76 82 */ 77 83 void usb_transfer_batch_destroy(usb_transfer_batch_t *batch) … … 83 89 const bus_ops_t *ops = BUS_OPS_LOOKUP(bus->ops, batch_destroy); 84 90 91 /* Batch reference */ 85 92 endpoint_del_ref(batch->ep); 86 93 … … 97 104 } 98 105 99 /** Finish a transfer batch: call handler, destroy batch, release endpoint. 106 /** 107 * Finish a transfer batch: call handler, destroy batch, release endpoint. 100 108 * 101 109 * Call only after the batch have been scheduled && completed! 102 *103 * @param[in] batch Batch structure to use.104 110 */ 105 111 void usb_transfer_batch_finish(usb_transfer_batch_t *batch) … … 121 127 } 122 128 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. 126 131 */ 127 132 void usb_transfer_batch_abort(usb_transfer_batch_t *batch)
Note:
See TracChangeset
for help on using the changeset viewer.