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/drv/generic/remote_usbhc.c

    r132ab5d1 r5a6cc679  
    104104 *
    105105 */
    106 int usbhc_device_remove(async_exch_t *exch, unsigned port)
     106errno_t usbhc_device_remove(async_exch_t *exch, unsigned port)
    107107{
    108108        if (!exch)
     
    112112}
    113113
    114 int usbhc_register_endpoint(async_exch_t *exch, usb_pipe_desc_t *pipe_desc,
     114errno_t usbhc_register_endpoint(async_exch_t *exch, usb_pipe_desc_t *pipe_desc,
    115115    const usb_endpoint_descriptors_t *desc)
    116116{
     
    153153}
    154154
    155 int usbhc_unregister_endpoint(async_exch_t *exch, const usb_pipe_desc_t *pipe_desc)
     155errno_t usbhc_unregister_endpoint(async_exch_t *exch, const usb_pipe_desc_t *pipe_desc)
    156156{
    157157        if (!exch)
     
    178178}
    179179
    180 int usbhc_read(async_exch_t *exch, usb_endpoint_t endpoint, uint64_t setup,
     180errno_t usbhc_read(async_exch_t *exch, usb_endpoint_t endpoint, uint64_t setup,
    181181    void *data, size_t size, size_t *rec_size)
    182182{
     
    208208
    209209        /* Wait for the answer. */
    210         int data_request_rc;
    211         int opening_request_rc;
     210        errno_t data_request_rc;
     211        errno_t opening_request_rc;
    212212        async_wait_for(data_request, &data_request_rc);
    213213        async_wait_for(opening_request, &opening_request_rc);
     
    216216                /* Prefer the return code of the opening request. */
    217217                if (opening_request_rc != EOK) {
    218                         return (int) opening_request_rc;
     218                        return (errno_t) opening_request_rc;
    219219                } else {
    220                         return (int) data_request_rc;
     220                        return (errno_t) data_request_rc;
    221221                }
    222222        }
    223223        if (opening_request_rc != EOK) {
    224                 return (int) opening_request_rc;
     224                return (errno_t) opening_request_rc;
    225225        }
    226226
     
    229229}
    230230
    231 int usbhc_write(async_exch_t *exch, usb_endpoint_t endpoint, uint64_t setup,
     231errno_t usbhc_write(async_exch_t *exch, usb_endpoint_t endpoint, uint64_t setup,
    232232    const void *data, size_t size)
    233233{
     
    248248        /* Send the data if any. */
    249249        if (size > 0) {
    250                 const int ret = async_data_write_start(exch, data, size);
     250                const errno_t ret = async_data_write_start(exch, data, size);
    251251                if (ret != EOK) {
    252252                        async_forget(opening_request);
     
    256256
    257257        /* Wait for the answer. */
    258         int opening_request_rc;
     258        errno_t opening_request_rc;
    259259        async_wait_for(opening_request, &opening_request_rc);
    260260
    261         return (int) opening_request_rc;
     261        return (errno_t) opening_request_rc;
    262262}
    263263
     
    433433}
    434434
    435 static int callback_out(void *arg, int error, size_t transferred_size)
     435static errno_t callback_out(void *arg, int error, size_t transferred_size)
    436436{
    437437        async_transaction_t *trans = arg;
    438438
    439         const int err = async_answer_0(trans->caller, error);
     439        const errno_t err = async_answer_0(trans->caller, error);
    440440
    441441        async_transaction_destroy(trans);
     
    444444}
    445445
    446 static int callback_in(void *arg, int error, size_t transferred_size)
     446static errno_t callback_in(void *arg, int error, size_t transferred_size)
    447447{
    448448        async_transaction_t *trans = arg;
     
    457457        }
    458458
    459         const int err = async_answer_0(trans->caller, error);
     459        const errno_t err = async_answer_0(trans->caller, error);
    460460        async_transaction_destroy(trans);
    461461        return err;
     
    507507        }};
    508508
    509         const int rc = usbhc_iface->read(
     509        const errno_t rc = usbhc_iface->read(
    510510            fun, target, setup, trans->buffer, size, callback_in, trans);
    511511
     
    545545        size_t size = 0;
    546546        if (data_buffer_len > 0) {
    547                 const int rc = async_data_write_accept(&trans->buffer, false,
     547                const errno_t rc = async_data_write_accept(&trans->buffer, false,
    548548                    1, data_buffer_len, 0, &size);
    549549
     
    562562        }};
    563563
    564         const int rc = usbhc_iface->write(
     564        const errno_t rc = usbhc_iface->write(
    565565            fun, target, setup, trans->buffer, size, callback_out, trans);
    566566
Note: See TracChangeset for help on using the changeset viewer.