Changeset 1d758fc in mainline for uspace/lib/usbhost/include
- Timestamp:
- 2018-02-12T10:11:47Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5fe3f954
- Parents:
- 2f762a7
- git-author:
- Ondřej Hlavatý <aearsis@…> (2018-02-05 03:28:50)
- git-committer:
- Ondřej Hlavatý <aearsis@…> (2018-02-12 10:11:47)
- Location:
- uspace/lib/usbhost/include/usb/host
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/bus.h
r2f762a7 r1d758fc 153 153 int bus_device_offline(device_t *); 154 154 155 int bus_device_send_batch(device_t *, usb_target_t, 156 usb_direction_t direction, char *, size_t, uint64_t, 157 usbhc_iface_transfer_callback_t, void *, const char *); 155 /** 156 * A proforma to USB transfer batch. As opposed to transfer batch, which is 157 * supposed to be a dynamic structrure, this one is static and descriptive only. 158 * Its fields are copied to the final batch. 159 */ 160 typedef struct transfer_request { 161 usb_target_t target; 162 usb_direction_t dir; 163 164 dma_buffer_t buffer; 165 size_t offset, size; 166 uint64_t setup; 167 168 usbhc_iface_transfer_callback_t on_complete; 169 void *arg; 170 171 const char *name; 172 } transfer_request_t; 173 174 int bus_issue_transfer(device_t *, const transfer_request_t *); 158 175 159 176 errno_t bus_device_send_batch_sync(device_t *, usb_target_t, -
uspace/lib/usbhost/include/usb/host/endpoint.h
r2f762a7 r1d758fc 51 51 typedef struct bus bus_t; 52 52 typedef struct device device_t; 53 typedef struct transfer_request transfer_request_t; 53 54 typedef struct usb_transfer_batch usb_transfer_batch_t; 54 55 … … 98 99 /** Maximum size of one transfer */ 99 100 size_t max_transfer_size; 100 /** Policy for transfer buffers */ 101 dma_policy_t transfer_buffer_policy; 101 102 /* Policies for transfer buffers */ 103 dma_policy_t transfer_buffer_policy; /**< A hint for optimal performance. */ 104 dma_policy_t required_transfer_buffer_policy; /**< Enforced by the library. */ 102 105 103 106 /** … … 122 125 extern void endpoint_deactivate_locked(endpoint_t *); 123 126 124 int endpoint_send_batch(endpoint_t *, usb_target_t, usb_direction_t, 125 char *, size_t, uint64_t, usbhc_iface_transfer_callback_t, void *, 126 const char *); 127 int endpoint_send_batch(endpoint_t *, const transfer_request_t *); 127 128 128 129 static inline bus_t *endpoint_get_bus(endpoint_t *ep) -
uspace/lib/usbhost/include/usb/host/usb_transfer_batch.h
r2f762a7 r1d758fc 70 70 } setup; 71 71 72 /** DMA buffer with enforced policy */ 73 dma_buffer_t dma_buffer; 74 /** Size of memory buffer */ 75 size_t offset, size; 76 72 77 /** 73 78 * In case a bounce buffer is allocated, the original buffer must to be 74 79 * stored to be filled after the IN transaction is finished. 75 80 */ 76 char *buffer; 77 /** Size of memory buffer */ 78 size_t buffer_size; 79 80 /** DMA buffer with enforced policy */ 81 dma_buffer_t dma_buffer; 81 char *original_buffer; 82 82 bool is_bounced; 83 83 … … 107 107 usb_str_transfer_type_short((batch).ep->transfer_type), \ 108 108 usb_str_direction((batch).dir), \ 109 (batch). buffer_size, (batch).ep->max_packet_size109 (batch).size, (batch).ep->max_packet_size 110 110 111 111 /** Wrapper for bus operation. */ … … 115 115 void usb_transfer_batch_init(usb_transfer_batch_t *, endpoint_t *); 116 116 117 /** Buffer handling */ 118 bool usb_transfer_batch_bounce_required(usb_transfer_batch_t *); 117 119 errno_t usb_transfer_batch_bounce(usb_transfer_batch_t *); 118 /** Buffer preparation */119 errno_t usb_transfer_batch_prepare_buffer(usb_transfer_batch_t *, char *);120 120 121 121 /** Batch finalization. */
Note:
See TracChangeset
for help on using the changeset viewer.