Ignore:
Timestamp:
2012-07-29T03:07:52Z (12 years ago)
Author:
Sean Bartell <wingedtachikoma@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
10334c2e
Parents:
d7c8e39f (diff), b2ba418 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

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

    rd7c8e39f rd1e580a  
    165165{
    166166        if (!exch || !address)
    167                 return EINVAL;
     167                return EBADMEM;
    168168        sysarg_t new_address;
    169169        const int ret = async_req_4_1(exch, DEV_IFACE_ID(USBHC_DEV_IFACE),
     
    173173        return ret;
    174174}
    175 /*----------------------------------------------------------------------------*/
     175
    176176int usbhc_bind_address(async_exch_t *exch, usb_address_t address,
    177177    devman_handle_t handle)
    178178{
    179179        if (!exch)
    180                 return EINVAL;
     180                return EBADMEM;
    181181        return async_req_3_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE),
    182182            IPC_M_USBHC_BIND_ADDRESS, address, handle);
    183183}
    184 /*----------------------------------------------------------------------------*/
     184
    185185int usbhc_get_handle(async_exch_t *exch, usb_address_t address,
    186186    devman_handle_t *handle)
    187187{
    188188        if (!exch)
    189                 return EINVAL;
     189                return EBADMEM;
    190190        sysarg_t h;
    191191        const int ret = async_req_2_1(exch, DEV_IFACE_ID(USBHC_DEV_IFACE),
     
    195195        return ret;
    196196}
    197 /*----------------------------------------------------------------------------*/
     197
    198198int usbhc_release_address(async_exch_t *exch, usb_address_t address)
    199199{
    200200        if (!exch)
    201                 return EINVAL;
     201                return EBADMEM;
    202202        return async_req_2_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE),
    203203            IPC_M_USBHC_RELEASE_ADDRESS, address);
    204204}
    205 /*----------------------------------------------------------------------------*/
     205
    206206int usbhc_register_endpoint(async_exch_t *exch, usb_address_t address,
    207207    usb_endpoint_t endpoint, usb_transfer_type_t type,
     
    209209{
    210210        if (!exch)
    211                 return EINVAL;
     211                return EBADMEM;
    212212        const usb_target_t target =
    213213            {{ .address = address, .endpoint = endpoint }};
     
    220220#undef _PACK2
    221221}
    222 /*----------------------------------------------------------------------------*/
     222
    223223int usbhc_unregister_endpoint(async_exch_t *exch, usb_address_t address,
    224224    usb_endpoint_t endpoint, usb_direction_t direction)
    225225{
    226226        if (!exch)
    227                 return EINVAL;
     227                return EBADMEM;
    228228        return async_req_4_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE),
    229229            IPC_M_USBHC_UNREGISTER_ENDPOINT, address, endpoint, direction);
    230230}
    231 /*----------------------------------------------------------------------------*/
     231
    232232int usbhc_read(async_exch_t *exch, usb_address_t address,
    233233    usb_endpoint_t endpoint, uint64_t setup, void *data, size_t size,
    234234    size_t *rec_size)
    235235{
     236        if (!exch)
     237                return EBADMEM;
     238
    236239        if (size == 0 && setup == 0)
    237240                return EOK;
    238241
    239         if (!exch)
    240                 return EINVAL;
    241242        const usb_target_t target =
    242243            {{ .address = address, .endpoint = endpoint }};
     
    284285        return EOK;
    285286}
    286 /*----------------------------------------------------------------------------*/
     287
    287288int usbhc_write(async_exch_t *exch, usb_address_t address,
    288289    usb_endpoint_t endpoint, uint64_t setup, const void *data, size_t size)
    289290{
     291        if (!exch)
     292                return EBADMEM;
     293
    290294        if (size == 0 && setup == 0)
    291295                return EOK;
    292296
    293         if (!exch)
    294                 return EINVAL;
    295297        const usb_target_t target =
    296298            {{ .address = address, .endpoint = endpoint }};
     
    319321        return (int) opening_request_rc;
    320322}
    321 /*----------------------------------------------------------------------------*/
     323
    322324
    323325static void remote_usbhc_request_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
     
    384386        return trans;
    385387}
    386 /*----------------------------------------------------------------------------*/
     388
    387389void remote_usbhc_request_address(ddf_fun_t *fun, void *iface,
    388390    ipc_callid_t callid, ipc_call_t *call)
     
    406408        }
    407409}
    408 /*----------------------------------------------------------------------------*/
     410
    409411void remote_usbhc_bind_address(ddf_fun_t *fun, void *iface,
    410412    ipc_callid_t callid, ipc_call_t *call)
     
    423425        async_answer_0(callid, ret);
    424426}
    425 /*----------------------------------------------------------------------------*/
     427
    426428void remote_usbhc_get_handle(ddf_fun_t *fun, void *iface,
    427429    ipc_callid_t callid, ipc_call_t *call)
     
    444446        }
    445447}
    446 /*----------------------------------------------------------------------------*/
     448
    447449void remote_usbhc_release_address(ddf_fun_t *fun, void *iface,
    448450    ipc_callid_t callid, ipc_call_t *call)
     
    460462        async_answer_0(callid, ret);
    461463}
    462 /*----------------------------------------------------------------------------*/
     464
    463465static void callback_out(ddf_fun_t *fun,
    464466    int outcome, void *arg)
     
    470472        async_transaction_destroy(trans);
    471473}
    472 /*----------------------------------------------------------------------------*/
     474
    473475static void callback_in(ddf_fun_t *fun,
    474476    int outcome, size_t actual_size, void *arg)
     
    494496        async_transaction_destroy(trans);
    495497}
    496 /*----------------------------------------------------------------------------*/
     498
    497499void remote_usbhc_register_endpoint(ddf_fun_t *fun, void *iface,
    498500    ipc_callid_t callid, ipc_call_t *call)
     
    594596        }
    595597}
    596 /*----------------------------------------------------------------------------*/
     598
    597599void remote_usbhc_write(
    598600    ddf_fun_t *fun, void *iface, ipc_callid_t callid, ipc_call_t *call)
Note: See TracChangeset for help on using the changeset viewer.