Changeset 5a6cc679 in mainline for uspace/lib/usbdev/src/pipes.c


Ignore:
Timestamp:
2018-01-31T02:21:24Z (7 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a0a9cc2
Parents:
132ab5d1
Message:

Merge commit '50f19b7ee8e94570b5c63896736c4eb49cfa18db' into forwardport

Not all ints are converted to errno_t in xhci tree yet, however it compiles and works :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdev/src/pipes.c

    r132ab5d1 r5a6cc679  
    7373 * @return Error code.
    7474 */
    75 int usb_pipe_control_read(usb_pipe_t *pipe,
     75errno_t usb_pipe_control_read(usb_pipe_t *pipe,
    7676    const void *setup_buffer, size_t setup_buffer_size,
    7777    void *buffer, size_t buffer_size, size_t *transferred_size)
     
    9797        async_exch_t *exch = async_exchange_begin(pipe->bus_session);
    9898        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,
    100100            buffer_size, &act_size);
    101101        async_exchange_end(exch);
     
    123123 * @return Error code.
    124124 */
    125 int usb_pipe_control_write(usb_pipe_t *pipe,
     125errno_t usb_pipe_control_write(usb_pipe_t *pipe,
    126126    const void *setup_buffer, size_t setup_buffer_size,
    127127    const void *buffer, size_t buffer_size)
     
    150150
    151151        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,
    153153            pipe->desc.endpoint_no, setup_packet, buffer, buffer_size);
    154154        async_exchange_end(exch);
     
    169169 * @return Error code.
    170170 */
    171 int usb_pipe_read(usb_pipe_t *pipe,
     171errno_t usb_pipe_read(usb_pipe_t *pipe,
    172172    void *buffer, size_t size, size_t *size_transferred)
    173173{
     
    192192        async_exch_t *exch = async_exchange_begin(pipe->bus_session);
    193193        size_t act_size = 0;
    194         const int rc =
     194        const errno_t rc =
    195195            usbhc_read(exch, pipe->desc.endpoint_no, 0, buffer, size, &act_size);
    196196        async_exchange_end(exch);
     
    210210 * @return Error code.
    211211 */
    212 int usb_pipe_write(usb_pipe_t *pipe, const void *buffer, size_t size)
     212errno_t usb_pipe_write(usb_pipe_t *pipe, const void *buffer, size_t size)
    213213{
    214214        assert(pipe);
     
    227227
    228228        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);
    230230        async_exchange_end(exch);
    231231        return rc;
     
    238238 * @return Error code.
    239239 */
    240 int usb_pipe_initialize(usb_pipe_t *pipe, usb_dev_session_t *bus_session)
     240errno_t usb_pipe_initialize(usb_pipe_t *pipe, usb_dev_session_t *bus_session)
    241241{
    242242        assert(pipe);
     
    263263 * @return Error code.
    264264 */
    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);
     265errno_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);
    268268        if (ret)
    269269                return ret;
     
    282282 * @return Error code.
    283283 */
    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)
     284errno_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)
    285285{
    286286        assert(pipe);
     
    309309#undef COPY
    310310
    311         const int ret = usbhc_register_endpoint(exch, &pipe->desc, &descriptors);
     311        const errno_t ret = usbhc_register_endpoint(exch, &pipe->desc, &descriptors);
    312312        async_exchange_end(exch);
    313313        return ret;
     
    319319 * @return Error code.
    320320 */
    321 int usb_pipe_unregister(usb_pipe_t *pipe)
     321errno_t usb_pipe_unregister(usb_pipe_t *pipe)
    322322{
    323323        assert(pipe);
     
    327327                return ENOMEM;
    328328
    329         const int ret = usbhc_unregister_endpoint(exch, &pipe->desc);
     329        const errno_t ret = usbhc_unregister_endpoint(exch, &pipe->desc);
    330330
    331331        async_exchange_end(exch);
Note: See TracChangeset for help on using the changeset viewer.