Ignore:
File:
1 edited

Legend:

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

    r9d58539 r7f80313  
    3636#include <async.h>
    3737#include <errno.h>
     38#include <macros.h>
    3839
    3940#include "usb_iface.h"
     
    5657{
    5758        if (!exch)
    58                 return EINVAL;
     59                return EBADMEM;
    5960        sysarg_t addr;
    6061        const int ret = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE),
     
    6566        return ret;
    6667}
    67 /*----------------------------------------------------------------------------*/
     68
    6869/** Tell interface number given device can use.
    6970 * @param[in] exch IPC communication exchange
     
    7576{
    7677        if (!exch)
    77                 return EINVAL;
     78                return EBADMEM;
    7879        sysarg_t iface_no;
    7980        const int ret = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE),
     
    8384        return ret;
    8485}
    85 /*----------------------------------------------------------------------------*/
     86
    8687/** Tell devman handle of device host controller.
    8788 * @param[in] exch IPC communication exchange
     
    9293{
    9394        if (!exch)
    94                 return EINVAL;
     95                return EBADMEM;
    9596        devman_handle_t h;
    9697        const int ret = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE),
     
    107108
    108109/** Remote USB interface operations. */
    109 static remote_iface_func_ptr_t remote_usb_iface_ops [] = {
     110static const remote_iface_func_ptr_t remote_usb_iface_ops [] = {
    110111        [IPC_M_USB_GET_MY_ADDRESS] = remote_usb_get_my_address,
    111112        [IPC_M_USB_GET_MY_INTERFACE] = remote_usb_get_my_interface,
     
    115116/** Remote USB interface structure.
    116117 */
    117 remote_iface_t remote_usb_iface = {
    118         .method_count = sizeof(remote_usb_iface_ops) /
    119             sizeof(remote_usb_iface_ops[0]),
     118const remote_iface_t remote_usb_iface = {
     119        .method_count = ARRAY_SIZE(remote_usb_iface_ops),
    120120        .methods = remote_usb_iface_ops
    121121};
    122122
    123 /*----------------------------------------------------------------------------*/
     123
    124124void remote_usb_get_my_address(ddf_fun_t *fun, void *iface,
    125125    ipc_callid_t callid, ipc_call_t *call)
     
    140140        }
    141141}
    142 /*----------------------------------------------------------------------------*/
     142
    143143void remote_usb_get_my_interface(ddf_fun_t *fun, void *iface,
    144144    ipc_callid_t callid, ipc_call_t *call)
     
    159159        }
    160160}
    161 /*----------------------------------------------------------------------------*/
     161
    162162void remote_usb_get_hc_handle(ddf_fun_t *fun, void *iface,
    163163    ipc_callid_t callid, ipc_call_t *call)
Note: See TracChangeset for help on using the changeset viewer.