Ignore:
Timestamp:
2010-11-26T12:47:34Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
172c1682
Parents:
0b749a3
Message:

Add method for getting device address to USBHC interface

File:
1 edited

Legend:

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

    r0b749a3 raae339e9  
    4242#define USB_MAX_PAYLOAD_SIZE 1020
    4343
     44static void remote_usbhc_get_address(device_t *, void *, ipc_callid_t, ipc_call_t *);
    4445static void remote_usbhc_get_buffer(device_t *, void *, ipc_callid_t, ipc_call_t *);
    4546static void remote_usbhc_interrupt_out(device_t *, void *, ipc_callid_t, ipc_call_t *);
     
    4950/** Remote USB interface operations. */
    5051static remote_iface_func_ptr_t remote_usbhc_iface_ops [] = {
    51         &remote_usbhc_get_buffer,
    52         &remote_usbhc_interrupt_out,
    53         &remote_usbhc_interrupt_in
     52        remote_usbhc_get_address,
     53        remote_usbhc_get_buffer,
     54        remote_usbhc_interrupt_out,
     55        remote_usbhc_interrupt_in
    5456};
    5557
     
    6870} async_transaction_t;
    6971
     72void remote_usbhc_get_address(device_t *device, void *iface,
     73    ipc_callid_t callid, ipc_call_t *call)
     74{
     75        usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface;
     76
     77        if (!usb_iface->tell_address) {
     78                ipc_answer_0(callid, ENOTSUP);
     79                return;
     80        }
     81
     82        devman_handle_t handle = IPC_GET_ARG1(*call);
     83
     84        usb_address_t address;
     85        int rc = usb_iface->tell_address(device, handle, &address);
     86        if (rc != EOK) {
     87                ipc_answer_0(callid, rc);
     88        } else {
     89                ipc_answer_1(callid, EOK, address);
     90        }
     91}
    7092
    7193void remote_usbhc_get_buffer(device_t *device, void *iface,
Note: See TracChangeset for help on using the changeset viewer.