Changes in uspace/lib/usbdev/src/pipes.c [58563585:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/pipes.c
r58563585 rb7fd2a0 74 74 * @return Error code. 75 75 */ 76 int usb_pipe_control_read(usb_pipe_t *pipe,76 errno_t usb_pipe_control_read(usb_pipe_t *pipe, 77 77 const void *setup_buffer, size_t setup_buffer_size, 78 78 void *buffer, size_t buffer_size, size_t *transfered_size) … … 98 98 async_exch_t *exch = async_exchange_begin(pipe->bus_session); 99 99 size_t act_size = 0; 100 const int rc = usb_read(exch, pipe->endpoint_no, setup_packet, buffer,100 const errno_t rc = usb_read(exch, pipe->endpoint_no, setup_packet, buffer, 101 101 buffer_size, &act_size); 102 102 async_exchange_end(exch); … … 124 124 * @return Error code. 125 125 */ 126 int usb_pipe_control_write(usb_pipe_t *pipe,126 errno_t usb_pipe_control_write(usb_pipe_t *pipe, 127 127 const void *setup_buffer, size_t setup_buffer_size, 128 128 const void *buffer, size_t buffer_size) … … 151 151 152 152 async_exch_t *exch = async_exchange_begin(pipe->bus_session); 153 const int rc = usb_write(exch,153 const errno_t rc = usb_write(exch, 154 154 pipe->endpoint_no, setup_packet, buffer, buffer_size); 155 155 async_exchange_end(exch); … … 170 170 * @return Error code. 171 171 */ 172 int usb_pipe_read(usb_pipe_t *pipe,172 errno_t usb_pipe_read(usb_pipe_t *pipe, 173 173 void *buffer, size_t size, size_t *size_transfered) 174 174 { … … 198 198 async_exch_t *exch = async_exchange_begin(pipe->bus_session); 199 199 size_t act_size = 0; 200 const int rc =200 const errno_t rc = 201 201 usb_read(exch, pipe->endpoint_no, 0, buffer, size, &act_size); 202 202 async_exchange_end(exch); … … 216 216 * @return Error code. 217 217 */ 218 int usb_pipe_write(usb_pipe_t *pipe, const void *buffer, size_t size)218 errno_t usb_pipe_write(usb_pipe_t *pipe, const void *buffer, size_t size) 219 219 { 220 220 assert(pipe); … … 238 238 239 239 async_exch_t *exch = async_exchange_begin(pipe->bus_session); 240 const int rc = usb_write(exch, pipe->endpoint_no, 0, buffer, size);240 const errno_t rc = usb_write(exch, pipe->endpoint_no, 0, buffer, size); 241 241 async_exchange_end(exch); 242 242 return rc; … … 252 252 * @return Error code. 253 253 */ 254 int usb_pipe_initialize(usb_pipe_t *pipe, usb_endpoint_t endpoint_no,254 errno_t usb_pipe_initialize(usb_pipe_t *pipe, usb_endpoint_t endpoint_no, 255 255 usb_transfer_type_t transfer_type, size_t max_packet_size, 256 256 usb_direction_t direction, unsigned packets, usb_dev_session_t *bus_session) … … 274 274 * @return Error code. 275 275 */ 276 int usb_pipe_initialize_default_control(usb_pipe_t *pipe,276 errno_t usb_pipe_initialize_default_control(usb_pipe_t *pipe, 277 277 usb_dev_session_t *bus_session) 278 278 { 279 279 assert(pipe); 280 280 281 const int rc = usb_pipe_initialize(pipe, 0, USB_TRANSFER_CONTROL,281 const errno_t rc = usb_pipe_initialize(pipe, 0, USB_TRANSFER_CONTROL, 282 282 CTRL_PIPE_MIN_PACKET_SIZE, USB_DIRECTION_BOTH, 1, bus_session); 283 283 … … 293 293 * @return Error code. 294 294 */ 295 int usb_pipe_register(usb_pipe_t *pipe, unsigned interval)295 errno_t usb_pipe_register(usb_pipe_t *pipe, unsigned interval) 296 296 { 297 297 assert(pipe); … … 300 300 if (!exch) 301 301 return ENOMEM; 302 const int ret = usb_register_endpoint(exch, pipe->endpoint_no,302 const errno_t ret = usb_register_endpoint(exch, pipe->endpoint_no, 303 303 pipe->transfer_type, pipe->direction, pipe->max_packet_size, 304 304 pipe->packets, interval); … … 312 312 * @return Error code. 313 313 */ 314 int usb_pipe_unregister(usb_pipe_t *pipe)314 errno_t usb_pipe_unregister(usb_pipe_t *pipe) 315 315 { 316 316 assert(pipe); … … 319 319 if (!exch) 320 320 return ENOMEM; 321 const int ret = usb_unregister_endpoint(exch, pipe->endpoint_no,321 const errno_t ret = usb_unregister_endpoint(exch, pipe->endpoint_no, 322 322 pipe->direction); 323 323 async_exchange_end(exch);
Note:
See TracChangeset
for help on using the changeset viewer.