Ignore:
File:
1 edited

Legend:

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

    r95120c3 r56fb3732  
    3333 */
    3434
     35#include <ipc/ipc.h>
    3536#include <async.h>
    3637#include <errno.h>
     
    4041
    4142
    42 static void remote_usb_get_address(device_t *, void *, ipc_callid_t, ipc_call_t *);
    43 static void remote_usb_get_interface(device_t *, void *, ipc_callid_t, ipc_call_t *);
    4443static void remote_usb_get_hc_handle(device_t *, void *, ipc_callid_t, ipc_call_t *);
    4544//static void remote_usb(device_t *, void *, ipc_callid_t, ipc_call_t *);
     
    4746/** Remote USB interface operations. */
    4847static remote_iface_func_ptr_t remote_usb_iface_ops [] = {
    49         remote_usb_get_address,
    50         remote_usb_get_interface,
    5148        remote_usb_get_hc_handle
    5249};
     
    6158
    6259
    63 void remote_usb_get_address(device_t *device, void *iface,
    64     ipc_callid_t callid, ipc_call_t *call)
    65 {
    66         usb_iface_t *usb_iface = (usb_iface_t *) iface;
    67 
    68         if (usb_iface->get_address == NULL) {
    69                 async_answer_0(callid, ENOTSUP);
    70                 return;
    71         }
    72 
    73         devman_handle_t handle = DEV_IPC_GET_ARG1(*call);
    74 
    75         usb_address_t address;
    76         int rc = usb_iface->get_address(device, handle, &address);
    77         if (rc != EOK) {
    78                 async_answer_0(callid, rc);
    79         } else {
    80                 async_answer_1(callid, EOK, address);
    81         }
    82 }
    83 
    84 void remote_usb_get_interface(device_t *device, void *iface,
    85     ipc_callid_t callid, ipc_call_t *call)
    86 {
    87         usb_iface_t *usb_iface = (usb_iface_t *) iface;
    88 
    89         if (usb_iface->get_interface == NULL) {
    90                 async_answer_0(callid, ENOTSUP);
    91                 return;
    92         }
    93 
    94         devman_handle_t handle = DEV_IPC_GET_ARG1(*call);
    95 
    96         int iface_no;
    97         int rc = usb_iface->get_interface(device, handle, &iface_no);
    98         if (rc != EOK) {
    99                 async_answer_0(callid, rc);
    100         } else {
    101                 async_answer_1(callid, EOK, iface_no);
    102         }
    103 }
    104 
    10560void remote_usb_get_hc_handle(device_t *device, void *iface,
    10661    ipc_callid_t callid, ipc_call_t *call)
     
    10964
    11065        if (usb_iface->get_hc_handle == NULL) {
    111                 async_answer_0(callid, ENOTSUP);
     66                ipc_answer_0(callid, ENOTSUP);
    11267                return;
    11368        }
     
    11671        int rc = usb_iface->get_hc_handle(device, &handle);
    11772        if (rc != EOK) {
    118                 async_answer_0(callid, rc);
     73                ipc_answer_0(callid, rc);
    11974        }
    12075
    121         async_answer_1(callid, EOK, (sysarg_t) handle);
     76        ipc_answer_1(callid, EOK, (sysarg_t) handle);
    12277}
    12378
Note: See TracChangeset for help on using the changeset viewer.