~adam-hraska+lp/helenos/cht-bench

« back to all changes in this revision

Viewing changes to uspace/lib/drv/generic/remote_usb.c

  • Committer: Adam Hraska
  • Date: 2012-08-08 17:19:28 UTC
  • mfrom: (1574.1.16 rcu-clone)
  • Revision ID: adam.hraska+hos@gmail.com-20120808171928-7gf0fh7pcxxcoaoo
Merged in mainline changes from rcu-clone.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
int usb_get_my_address(async_exch_t *exch, usb_address_t *address)
56
56
{
57
57
        if (!exch)
58
 
                return EINVAL;
 
58
                return EBADMEM;
59
59
        sysarg_t addr;
60
60
        const int ret = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE),
61
61
            IPC_M_USB_GET_MY_ADDRESS, &addr);
64
64
                *address = (usb_address_t) addr;
65
65
        return ret;
66
66
}
67
 
/*----------------------------------------------------------------------------*/
 
67
 
68
68
/** Tell interface number given device can use.
69
69
 * @param[in] exch IPC communication exchange
70
70
 * @param[in] handle Id of the device
74
74
int usb_get_my_interface(async_exch_t *exch, int *usb_iface)
75
75
{
76
76
        if (!exch)
77
 
                return EINVAL;
 
77
                return EBADMEM;
78
78
        sysarg_t iface_no;
79
79
        const int ret = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE),
80
80
            IPC_M_USB_GET_MY_INTERFACE, &iface_no);
82
82
                *usb_iface = (int)iface_no;
83
83
        return ret;
84
84
}
85
 
/*----------------------------------------------------------------------------*/
 
85
 
86
86
/** Tell devman handle of device host controller.
87
87
 * @param[in] exch IPC communication exchange
88
88
 * @param[out] hc_handle devman handle of the HC used by the target device.
91
91
int usb_get_hc_handle(async_exch_t *exch, devman_handle_t *hc_handle)
92
92
{
93
93
        if (!exch)
94
 
                return EINVAL;
 
94
                return EBADMEM;
95
95
        devman_handle_t h;
96
96
        const int ret = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE),
97
97
            IPC_M_USB_GET_HOST_CONTROLLER_HANDLE, &h);
120
120
        .methods = remote_usb_iface_ops
121
121
};
122
122
 
123
 
/*----------------------------------------------------------------------------*/
 
123
 
124
124
void remote_usb_get_my_address(ddf_fun_t *fun, void *iface,
125
125
    ipc_callid_t callid, ipc_call_t *call)
126
126
{
139
139
                async_answer_1(callid, EOK, address);
140
140
        }
141
141
}
142
 
/*----------------------------------------------------------------------------*/
 
142
 
143
143
void remote_usb_get_my_interface(ddf_fun_t *fun, void *iface,
144
144
    ipc_callid_t callid, ipc_call_t *call)
145
145
{
158
158
                async_answer_1(callid, EOK, iface_no);
159
159
        }
160
160
}
161
 
/*----------------------------------------------------------------------------*/
 
161
 
162
162
void remote_usb_get_hc_handle(ddf_fun_t *fun, void *iface,
163
163
    ipc_callid_t callid, ipc_call_t *call)
164
164
{