Ignore:
File:
1 edited

Legend:

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

    rfb1dca09 reac610e  
    5252static void remote_usbhc_control_read_data(device_t *, void *, ipc_callid_t, ipc_call_t *);
    5353static void remote_usbhc_control_read_status(device_t *, void *, ipc_callid_t, ipc_call_t *);
     54static void remote_usbhc_reserve_default_address(device_t *, void *, ipc_callid_t, ipc_call_t *);
     55static void remote_usbhc_release_default_address(device_t *, void *, ipc_callid_t, ipc_call_t *);
     56static void remote_usbhc_request_address(device_t *, void *, ipc_callid_t, ipc_call_t *);
     57static void remote_usbhc_bind_address(device_t *, void *, ipc_callid_t, ipc_call_t *);
     58static void remote_usbhc_release_address(device_t *, void *, ipc_callid_t, ipc_call_t *);
    5459//static void remote_usbhc(device_t *, void *, ipc_callid_t, ipc_call_t *);
    5560
     
    5762static remote_iface_func_ptr_t remote_usbhc_iface_ops [] = {
    5863        remote_usbhc_get_address,
     64
    5965        remote_usbhc_get_buffer,
     66
     67        remote_usbhc_reserve_default_address,
     68        remote_usbhc_release_default_address,
     69
     70        remote_usbhc_request_address,
     71        remote_usbhc_bind_address,
     72        remote_usbhc_release_address,
     73
    6074        remote_usbhc_interrupt_out,
    6175        remote_usbhc_interrupt_in,
     76
    6277        remote_usbhc_control_write_setup,
    6378        remote_usbhc_control_write_data,
    6479        remote_usbhc_control_write_status,
     80
    6581        remote_usbhc_control_read_setup,
    6682        remote_usbhc_control_read_data,
     
    92108        }
    93109
    94         devman_handle_t handle = IPC_GET_ARG1(*call);
     110        devman_handle_t handle = DEV_IPC_GET_ARG1(*call);
    95111
    96112        usb_address_t address;
     
    106122    ipc_callid_t callid, ipc_call_t *call)
    107123{
    108         ipcarg_t buffer_hash = IPC_GET_ARG1(*call);
     124        ipcarg_t buffer_hash = DEV_IPC_GET_ARG1(*call);
    109125        async_transaction_t * trans = (async_transaction_t *)buffer_hash;
    110126        if (trans == NULL) {
     
    128144                accepted_size = trans->size;
    129145        }
    130         async_data_read_finalize(callid, trans->buffer, accepted_size);
     146        async_data_read_finalize(cid, trans->buffer, accepted_size);
    131147
    132148        ipc_answer_1(callid, EOK, accepted_size);
     
    134150        free(trans->buffer);
    135151        free(trans);
     152}
     153
     154void remote_usbhc_reserve_default_address(device_t *device, void *iface,
     155    ipc_callid_t callid, ipc_call_t *call)
     156{
     157        usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface;
     158
     159        if (!usb_iface->reserve_default_address) {
     160                ipc_answer_0(callid, ENOTSUP);
     161                return;
     162        }
     163
     164        int rc = usb_iface->reserve_default_address(device);
     165
     166        ipc_answer_0(callid, rc);
     167}
     168
     169void remote_usbhc_release_default_address(device_t *device, void *iface,
     170    ipc_callid_t callid, ipc_call_t *call)
     171{
     172        usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface;
     173
     174        if (!usb_iface->release_default_address) {
     175                ipc_answer_0(callid, ENOTSUP);
     176                return;
     177        }
     178
     179        int rc = usb_iface->release_default_address(device);
     180
     181        ipc_answer_0(callid, rc);
     182}
     183
     184void remote_usbhc_request_address(device_t *device, void *iface,
     185    ipc_callid_t callid, ipc_call_t *call)
     186{
     187        usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface;
     188
     189        if (!usb_iface->request_address) {
     190                ipc_answer_0(callid, ENOTSUP);
     191                return;
     192        }
     193
     194        usb_address_t address;
     195        int rc = usb_iface->request_address(device, &address);
     196        if (rc != EOK) {
     197                ipc_answer_0(callid, rc);
     198        } else {
     199                ipc_answer_1(callid, EOK, (ipcarg_t) address);
     200        }
     201}
     202
     203void remote_usbhc_bind_address(device_t *device, void *iface,
     204    ipc_callid_t callid, ipc_call_t *call)
     205{
     206        usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface;
     207
     208        if (!usb_iface->bind_address) {
     209                ipc_answer_0(callid, ENOTSUP);
     210                return;
     211        }
     212
     213        usb_address_t address = (usb_address_t) DEV_IPC_GET_ARG1(*call);
     214        devman_handle_t handle = (devman_handle_t) DEV_IPC_GET_ARG2(*call);
     215
     216        int rc = usb_iface->bind_address(device, address, handle);
     217
     218        ipc_answer_0(callid, rc);
     219}
     220
     221void remote_usbhc_release_address(device_t *device, void *iface,
     222    ipc_callid_t callid, ipc_call_t *call)
     223{
     224        usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface;
     225
     226        if (!usb_iface->release_address) {
     227                ipc_answer_0(callid, ENOTSUP);
     228                return;
     229        }
     230
     231        usb_address_t address = (usb_address_t) DEV_IPC_GET_ARG1(*call);
     232
     233        int rc = usb_iface->release_address(device, address);
     234
     235        ipc_answer_0(callid, rc);
    136236}
    137237
     
    175275        }
    176276
    177         size_t expected_len = IPC_GET_ARG3(*call);
     277        size_t expected_len = DEV_IPC_GET_ARG3(*call);
    178278        usb_target_t target = {
    179                 .address = IPC_GET_ARG1(*call),
    180                 .endpoint = IPC_GET_ARG2(*call)
     279                .address = DEV_IPC_GET_ARG1(*call),
     280                .endpoint = DEV_IPC_GET_ARG2(*call)
    181281        };
    182282
     
    227327        }
    228328
    229         size_t len = IPC_GET_ARG3(*call);
     329        size_t len = DEV_IPC_GET_ARG3(*call);
    230330        usb_target_t target = {
    231                 .address = IPC_GET_ARG1(*call),
    232                 .endpoint = IPC_GET_ARG2(*call)
     331                .address = DEV_IPC_GET_ARG1(*call),
     332                .endpoint = DEV_IPC_GET_ARG2(*call)
    233333        };
    234334
     
    284384
    285385        usb_target_t target = {
    286                 .address = IPC_GET_ARG1(*call),
    287                 .endpoint = IPC_GET_ARG2(*call)
     386                .address = DEV_IPC_GET_ARG1(*call),
     387                .endpoint = DEV_IPC_GET_ARG2(*call)
    288388        };
    289389
Note: See TracChangeset for help on using the changeset viewer.