Changeset 5a6cc679 in mainline for uspace/lib/usbdev/src/pipes.c
- Timestamp:
- 2018-01-31T02:21:24Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a0a9cc2
- Parents:
- 132ab5d1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/pipes.c
r132ab5d1 r5a6cc679 73 73 * @return Error code. 74 74 */ 75 int usb_pipe_control_read(usb_pipe_t *pipe,75 errno_t usb_pipe_control_read(usb_pipe_t *pipe, 76 76 const void *setup_buffer, size_t setup_buffer_size, 77 77 void *buffer, size_t buffer_size, size_t *transferred_size) … … 97 97 async_exch_t *exch = async_exchange_begin(pipe->bus_session); 98 98 size_t act_size = 0; 99 const int rc = usbhc_read(exch, pipe->desc.endpoint_no, setup_packet, buffer,99 const errno_t rc = usbhc_read(exch, pipe->desc.endpoint_no, setup_packet, buffer, 100 100 buffer_size, &act_size); 101 101 async_exchange_end(exch); … … 123 123 * @return Error code. 124 124 */ 125 int usb_pipe_control_write(usb_pipe_t *pipe,125 errno_t usb_pipe_control_write(usb_pipe_t *pipe, 126 126 const void *setup_buffer, size_t setup_buffer_size, 127 127 const void *buffer, size_t buffer_size) … … 150 150 151 151 async_exch_t *exch = async_exchange_begin(pipe->bus_session); 152 const int rc = usbhc_write(exch,152 const errno_t rc = usbhc_write(exch, 153 153 pipe->desc.endpoint_no, setup_packet, buffer, buffer_size); 154 154 async_exchange_end(exch); … … 169 169 * @return Error code. 170 170 */ 171 int usb_pipe_read(usb_pipe_t *pipe,171 errno_t usb_pipe_read(usb_pipe_t *pipe, 172 172 void *buffer, size_t size, size_t *size_transferred) 173 173 { … … 192 192 async_exch_t *exch = async_exchange_begin(pipe->bus_session); 193 193 size_t act_size = 0; 194 const int rc =194 const errno_t rc = 195 195 usbhc_read(exch, pipe->desc.endpoint_no, 0, buffer, size, &act_size); 196 196 async_exchange_end(exch); … … 210 210 * @return Error code. 211 211 */ 212 int usb_pipe_write(usb_pipe_t *pipe, const void *buffer, size_t size)212 errno_t usb_pipe_write(usb_pipe_t *pipe, const void *buffer, size_t size) 213 213 { 214 214 assert(pipe); … … 227 227 228 228 async_exch_t *exch = async_exchange_begin(pipe->bus_session); 229 const int rc = usbhc_write(exch, pipe->desc.endpoint_no, 0, buffer, size);229 const errno_t rc = usbhc_write(exch, pipe->desc.endpoint_no, 0, buffer, size); 230 230 async_exchange_end(exch); 231 231 return rc; … … 238 238 * @return Error code. 239 239 */ 240 int usb_pipe_initialize(usb_pipe_t *pipe, usb_dev_session_t *bus_session)240 errno_t usb_pipe_initialize(usb_pipe_t *pipe, usb_dev_session_t *bus_session) 241 241 { 242 242 assert(pipe); … … 263 263 * @return Error code. 264 264 */ 265 int usb_pipe_initialize_default_control(usb_pipe_t *pipe, usb_dev_session_t *bus_session)266 { 267 const int ret = usb_pipe_initialize(pipe, bus_session);265 errno_t usb_pipe_initialize_default_control(usb_pipe_t *pipe, usb_dev_session_t *bus_session) 266 { 267 const errno_t ret = usb_pipe_initialize(pipe, bus_session); 268 268 if (ret) 269 269 return ret; … … 282 282 * @return Error code. 283 283 */ 284 int usb_pipe_register(usb_pipe_t *pipe, const usb_standard_endpoint_descriptor_t *ep_desc, const usb_superspeed_endpoint_companion_descriptor_t *comp_desc)284 errno_t usb_pipe_register(usb_pipe_t *pipe, const usb_standard_endpoint_descriptor_t *ep_desc, const usb_superspeed_endpoint_companion_descriptor_t *comp_desc) 285 285 { 286 286 assert(pipe); … … 309 309 #undef COPY 310 310 311 const int ret = usbhc_register_endpoint(exch, &pipe->desc, &descriptors);311 const errno_t ret = usbhc_register_endpoint(exch, &pipe->desc, &descriptors); 312 312 async_exchange_end(exch); 313 313 return ret; … … 319 319 * @return Error code. 320 320 */ 321 int usb_pipe_unregister(usb_pipe_t *pipe)321 errno_t usb_pipe_unregister(usb_pipe_t *pipe) 322 322 { 323 323 assert(pipe); … … 327 327 return ENOMEM; 328 328 329 const int ret = usbhc_unregister_endpoint(exch, &pipe->desc);329 const errno_t ret = usbhc_unregister_endpoint(exch, &pipe->desc); 330 330 331 331 async_exchange_end(exch);
Note:
See TracChangeset
for help on using the changeset viewer.