Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/remote_usb.c

    rb7fd2a0 r90c340fb  
    7979 * @return Error code.
    8080 */
    81 errno_t usb_get_my_interface(async_exch_t *exch, int *usb_iface)
     81int usb_get_my_interface(async_exch_t *exch, int *usb_iface)
    8282{
    8383        if (!exch)
    8484                return EBADMEM;
    8585        sysarg_t iface_no;
    86         const errno_t ret = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE),
     86        const int ret = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE),
    8787            IPC_M_USB_GET_MY_INTERFACE, &iface_no);
    8888        if (ret == EOK && usb_iface)
     
    9999 *
    100100 */
    101 errno_t usb_get_my_device_handle(async_exch_t *exch, devman_handle_t *handle)
     101int usb_get_my_device_handle(async_exch_t *exch, devman_handle_t *handle)
    102102{
    103103        devman_handle_t h = 0;
    104         const errno_t ret = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE),
     104        const int ret = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE),
    105105            IPC_M_USB_GET_MY_DEVICE_HANDLE, &h);
    106106        if (ret == EOK && handle)
     
    114114 * @return Error code.
    115115 */
    116 errno_t usb_reserve_default_address(async_exch_t *exch, usb_speed_t speed)
     116int usb_reserve_default_address(async_exch_t *exch, usb_speed_t speed)
    117117{
    118118        if (!exch)
     
    129129 *
    130130 */
    131 errno_t usb_release_default_address(async_exch_t *exch)
     131int usb_release_default_address(async_exch_t *exch)
    132132{
    133133        if (!exch)
     
    145145 *
    146146 */
    147 errno_t usb_device_enumerate(async_exch_t *exch, unsigned port)
    148 {
    149         if (!exch)
    150                 return EBADMEM;
    151         const errno_t ret = async_req_2_0(exch, DEV_IFACE_ID(USB_DEV_IFACE),
     147int usb_device_enumerate(async_exch_t *exch, unsigned port)
     148{
     149        if (!exch)
     150                return EBADMEM;
     151        const int ret = async_req_2_0(exch, DEV_IFACE_ID(USB_DEV_IFACE),
    152152            IPC_M_USB_DEVICE_ENUMERATE, port);
    153153        return ret;
     
    162162 *
    163163 */
    164 errno_t usb_device_remove(async_exch_t *exch, unsigned port)
     164int usb_device_remove(async_exch_t *exch, unsigned port)
    165165{
    166166        if (!exch)
     
    177177} pack8_t;
    178178
    179 errno_t usb_register_endpoint(async_exch_t *exch, usb_endpoint_t endpoint,
     179int usb_register_endpoint(async_exch_t *exch, usb_endpoint_t endpoint,
    180180    usb_transfer_type_t type, usb_direction_t direction,
    181181    size_t mps, unsigned packets, unsigned interval)
     
    194194}
    195195
    196 errno_t usb_unregister_endpoint(async_exch_t *exch, usb_endpoint_t endpoint,
     196int usb_unregister_endpoint(async_exch_t *exch, usb_endpoint_t endpoint,
    197197    usb_direction_t direction)
    198198{
     
    203203}
    204204
    205 errno_t usb_read(async_exch_t *exch, usb_endpoint_t endpoint, uint64_t setup,
     205int usb_read(async_exch_t *exch, usb_endpoint_t endpoint, uint64_t setup,
    206206    void *data, size_t size, size_t *rec_size)
    207207{
     
    233233
    234234        /* Wait for the answer. */
    235         errno_t data_request_rc;
    236         errno_t opening_request_rc;
     235        sysarg_t data_request_rc;
     236        sysarg_t opening_request_rc;
    237237        async_wait_for(data_request, &data_request_rc);
    238238        async_wait_for(opening_request, &opening_request_rc);
     
    241241                /* Prefer the return code of the opening request. */
    242242                if (opening_request_rc != EOK) {
    243                         return (errno_t) opening_request_rc;
     243                        return (int) opening_request_rc;
    244244                } else {
    245                         return (errno_t) data_request_rc;
     245                        return (int) data_request_rc;
    246246                }
    247247        }
    248248        if (opening_request_rc != EOK) {
    249                 return (errno_t) opening_request_rc;
     249                return (int) opening_request_rc;
    250250        }
    251251
     
    254254}
    255255
    256 errno_t usb_write(async_exch_t *exch, usb_endpoint_t endpoint, uint64_t setup,
     256int usb_write(async_exch_t *exch, usb_endpoint_t endpoint, uint64_t setup,
    257257    const void *data, size_t size)
    258258{
     
    273273        /* Send the data if any. */
    274274        if (size > 0) {
    275                 const errno_t ret = async_data_write_start(exch, data, size);
     275                const int ret = async_data_write_start(exch, data, size);
    276276                if (ret != EOK) {
    277277                        async_forget(opening_request);
     
    281281
    282282        /* Wait for the answer. */
    283         errno_t opening_request_rc;
     283        sysarg_t opening_request_rc;
    284284        async_wait_for(opening_request, &opening_request_rc);
    285285
    286         return (errno_t) opening_request_rc;
     286        return (int) opening_request_rc;
    287287}
    288288
     
    330330
    331331        int iface_no;
    332         const errno_t ret = usb_iface->get_my_interface(fun, &iface_no);
     332        const int ret = usb_iface->get_my_interface(fun, &iface_no);
    333333        if (ret != EOK) {
    334334                async_answer_0(callid, ret);
     
    349349
    350350        devman_handle_t handle;
    351         const errno_t ret = usb_iface->get_my_device_handle(fun, &handle);
     351        const int ret = usb_iface->get_my_device_handle(fun, &handle);
    352352        if (ret != EOK) {
    353353                async_answer_0(callid, ret);
     
    368368
    369369        usb_speed_t speed = DEV_IPC_GET_ARG1(*call);
    370         const errno_t ret = usb_iface->reserve_default_address(fun, speed);
     370        const int ret = usb_iface->reserve_default_address(fun, speed);
    371371        async_answer_0(callid, ret);
    372372}
     
    382382        }
    383383
    384         const errno_t ret = usb_iface->release_default_address(fun);
     384        const int ret = usb_iface->release_default_address(fun);
    385385        async_answer_0(callid, ret);
    386386}
     
    397397
    398398        const unsigned port = DEV_IPC_GET_ARG1(*call);
    399         const errno_t ret = usb_iface->device_enumerate(fun, port);
     399        const int ret = usb_iface->device_enumerate(fun, port);
    400400        async_answer_0(callid, ret);
    401401}
     
    412412
    413413        const unsigned port = DEV_IPC_GET_ARG1(*call);
    414         const errno_t ret = usb_iface->device_remove(fun, port);
     414        const int ret = usb_iface->device_remove(fun, port);
    415415        async_answer_0(callid, ret);
    416416}
     
    435435        unsigned interval = pack.arr[3];
    436436
    437         const errno_t ret = usb_iface->register_endpoint(fun, endpoint,
     437        const int ret = usb_iface->register_endpoint(fun, endpoint,
    438438            transfer_type, direction, max_packet_size, packets, interval);
    439439
     
    454454        usb_direction_t direction = (usb_direction_t) DEV_IPC_GET_ARG2(*call);
    455455
    456         errno_t rc = usb_iface->unregister_endpoint(fun, endpoint, direction);
     456        int rc = usb_iface->unregister_endpoint(fun, endpoint, direction);
    457457
    458458        async_answer_0(callid, rc);
     
    491491}
    492492
    493 static void callback_out(errno_t outcome, void *arg)
     493static void callback_out(int outcome, void *arg)
    494494{
    495495        async_transaction_t *trans = arg;
     
    500500}
    501501
    502 static void callback_in(errno_t outcome, size_t actual_size, void *arg)
     502static void callback_in(int outcome, size_t actual_size, void *arg)
    503503{
    504504        async_transaction_t *trans = (async_transaction_t *)arg;
     
    563563        }
    564564
    565         const errno_t rc = usb_iface->read(
     565        const int rc = usb_iface->read(
    566566            fun, ep, setup, trans->buffer, size, callback_in, trans);
    567567
     
    601601        size_t size = 0;
    602602        if (data_buffer_len > 0) {
    603                 const errno_t rc = async_data_write_accept(&trans->buffer, false,
     603                const int rc = async_data_write_accept(&trans->buffer, false,
    604604                    1, data_buffer_len, 0, &size);
    605605
     
    611611        }
    612612
    613         const errno_t rc = usb_iface->write(
     613        const int rc = usb_iface->write(
    614614            fun, ep, setup, trans->buffer, size, callback_out, trans);
    615615
Note: See TracChangeset for help on using the changeset viewer.