Changeset 92574f4 in mainline for uspace/lib/drv/generic/remote_usb.c


Ignore:
Timestamp:
2011-02-24T12:03:27Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e7b7ebd5
Parents:
4837092 (diff), a80849c (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:

Merged development (changes in DDF, etc.).

Conflicts in uspace/drv/usbkbd/main.c

File:
1 edited

Legend:

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

    r4837092 r92574f4  
    3333 */
    3434
    35 #include <ipc/ipc.h>
    3635#include <async.h>
    3736#include <errno.h>
    3837
    3938#include "usb_iface.h"
    40 #include "driver.h"
     39#include "ddf/driver.h"
    4140
    4241
    43 static void remote_usb_get_hc_handle(device_t *, void *, ipc_callid_t, ipc_call_t *);
     42static void remote_usb_get_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
     43static void remote_usb_get_interface(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
     44static void remote_usb_get_hc_handle(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
    4445//static void remote_usb(device_t *, void *, ipc_callid_t, ipc_call_t *);
    4546
    4647/** Remote USB interface operations. */
    4748static remote_iface_func_ptr_t remote_usb_iface_ops [] = {
     49        remote_usb_get_address,
     50        remote_usb_get_interface,
    4851        remote_usb_get_hc_handle
    4952};
     
    5861
    5962
    60 void remote_usb_get_hc_handle(device_t *device, void *iface,
     63void remote_usb_get_address(ddf_fun_t *fun, 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(fun, handle, &address);
     77        if (rc != EOK) {
     78                async_answer_0(callid, rc);
     79        } else {
     80                async_answer_1(callid, EOK, address);
     81        }
     82}
     83
     84void remote_usb_get_interface(ddf_fun_t *fun, 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(fun, 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
     105void remote_usb_get_hc_handle(ddf_fun_t *fun, void *iface,
    61106    ipc_callid_t callid, ipc_call_t *call)
    62107{
     
    64109
    65110        if (usb_iface->get_hc_handle == NULL) {
    66                 ipc_answer_0(callid, ENOTSUP);
     111                async_answer_0(callid, ENOTSUP);
    67112                return;
    68113        }
    69114
    70115        devman_handle_t handle;
    71         int rc = usb_iface->get_hc_handle(device, &handle);
     116        int rc = usb_iface->get_hc_handle(fun, &handle);
    72117        if (rc != EOK) {
    73                 ipc_answer_0(callid, rc);
     118                async_answer_0(callid, rc);
    74119        }
    75120
    76         ipc_answer_1(callid, EOK, (sysarg_t) handle);
     121        async_answer_1(callid, EOK, (sysarg_t) handle);
    77122}
    78123
Note: See TracChangeset for help on using the changeset viewer.