Changeset 50206e9 in mainline for uspace/lib/usbdev/src/pipes.c
- Timestamp:
- 2018-01-31T17:02:48Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4e17d54
- Parents:
- 98893ede
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/pipes.c
r98893ede r50206e9 36 36 #include <usb/dev/request.h> 37 37 #include <usb/usb.h> 38 #include <usb/dma_buffer.h> 38 39 39 40 #include <assert.h> … … 161 162 } 162 163 164 /** 165 * Allocate a buffer for data transmission, that satisfies the constraints 166 * imposed by the host controller. 167 * 168 * @param[in] pipe Pipe for which the buffer is allocated 169 * @param[in] size Size of the required buffer 170 */ 171 void *usb_pipe_alloc_buffer(usb_pipe_t *pipe, size_t size) 172 { 173 // FIXME: Do not use the default policy, but the one required by HC. 174 175 dma_buffer_t buf; 176 if (dma_buffer_alloc(&buf, size)) 177 return NULL; 178 179 return buf.virt; 180 } 181 182 void usb_pipe_free_buffer(usb_pipe_t *pipe, void *buffer) 183 { 184 dma_buffer_t buf; 185 buf.virt = buffer; 186 dma_buffer_free(&buf); 187 } 188 163 189 /** Request a read (in) transfer on an endpoint pipe. 164 190 *
Note:
See TracChangeset
for help on using the changeset viewer.