Changes in uspace/lib/drv/generic/remote_usbhc.c [fb1dca09:eac610e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usbhc.c
rfb1dca09 reac610e 52 52 static void remote_usbhc_control_read_data(device_t *, void *, ipc_callid_t, ipc_call_t *); 53 53 static void remote_usbhc_control_read_status(device_t *, void *, ipc_callid_t, ipc_call_t *); 54 static void remote_usbhc_reserve_default_address(device_t *, void *, ipc_callid_t, ipc_call_t *); 55 static void remote_usbhc_release_default_address(device_t *, void *, ipc_callid_t, ipc_call_t *); 56 static void remote_usbhc_request_address(device_t *, void *, ipc_callid_t, ipc_call_t *); 57 static void remote_usbhc_bind_address(device_t *, void *, ipc_callid_t, ipc_call_t *); 58 static void remote_usbhc_release_address(device_t *, void *, ipc_callid_t, ipc_call_t *); 54 59 //static void remote_usbhc(device_t *, void *, ipc_callid_t, ipc_call_t *); 55 60 … … 57 62 static remote_iface_func_ptr_t remote_usbhc_iface_ops [] = { 58 63 remote_usbhc_get_address, 64 59 65 remote_usbhc_get_buffer, 66 67 remote_usbhc_reserve_default_address, 68 remote_usbhc_release_default_address, 69 70 remote_usbhc_request_address, 71 remote_usbhc_bind_address, 72 remote_usbhc_release_address, 73 60 74 remote_usbhc_interrupt_out, 61 75 remote_usbhc_interrupt_in, 76 62 77 remote_usbhc_control_write_setup, 63 78 remote_usbhc_control_write_data, 64 79 remote_usbhc_control_write_status, 80 65 81 remote_usbhc_control_read_setup, 66 82 remote_usbhc_control_read_data, … … 92 108 } 93 109 94 devman_handle_t handle = IPC_GET_ARG1(*call);110 devman_handle_t handle = DEV_IPC_GET_ARG1(*call); 95 111 96 112 usb_address_t address; … … 106 122 ipc_callid_t callid, ipc_call_t *call) 107 123 { 108 ipcarg_t buffer_hash = IPC_GET_ARG1(*call);124 ipcarg_t buffer_hash = DEV_IPC_GET_ARG1(*call); 109 125 async_transaction_t * trans = (async_transaction_t *)buffer_hash; 110 126 if (trans == NULL) { … … 128 144 accepted_size = trans->size; 129 145 } 130 async_data_read_finalize(c allid, trans->buffer, accepted_size);146 async_data_read_finalize(cid, trans->buffer, accepted_size); 131 147 132 148 ipc_answer_1(callid, EOK, accepted_size); … … 134 150 free(trans->buffer); 135 151 free(trans); 152 } 153 154 void remote_usbhc_reserve_default_address(device_t *device, void *iface, 155 ipc_callid_t callid, ipc_call_t *call) 156 { 157 usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface; 158 159 if (!usb_iface->reserve_default_address) { 160 ipc_answer_0(callid, ENOTSUP); 161 return; 162 } 163 164 int rc = usb_iface->reserve_default_address(device); 165 166 ipc_answer_0(callid, rc); 167 } 168 169 void remote_usbhc_release_default_address(device_t *device, void *iface, 170 ipc_callid_t callid, ipc_call_t *call) 171 { 172 usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface; 173 174 if (!usb_iface->release_default_address) { 175 ipc_answer_0(callid, ENOTSUP); 176 return; 177 } 178 179 int rc = usb_iface->release_default_address(device); 180 181 ipc_answer_0(callid, rc); 182 } 183 184 void remote_usbhc_request_address(device_t *device, void *iface, 185 ipc_callid_t callid, ipc_call_t *call) 186 { 187 usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface; 188 189 if (!usb_iface->request_address) { 190 ipc_answer_0(callid, ENOTSUP); 191 return; 192 } 193 194 usb_address_t address; 195 int rc = usb_iface->request_address(device, &address); 196 if (rc != EOK) { 197 ipc_answer_0(callid, rc); 198 } else { 199 ipc_answer_1(callid, EOK, (ipcarg_t) address); 200 } 201 } 202 203 void remote_usbhc_bind_address(device_t *device, void *iface, 204 ipc_callid_t callid, ipc_call_t *call) 205 { 206 usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface; 207 208 if (!usb_iface->bind_address) { 209 ipc_answer_0(callid, ENOTSUP); 210 return; 211 } 212 213 usb_address_t address = (usb_address_t) DEV_IPC_GET_ARG1(*call); 214 devman_handle_t handle = (devman_handle_t) DEV_IPC_GET_ARG2(*call); 215 216 int rc = usb_iface->bind_address(device, address, handle); 217 218 ipc_answer_0(callid, rc); 219 } 220 221 void remote_usbhc_release_address(device_t *device, void *iface, 222 ipc_callid_t callid, ipc_call_t *call) 223 { 224 usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface; 225 226 if (!usb_iface->release_address) { 227 ipc_answer_0(callid, ENOTSUP); 228 return; 229 } 230 231 usb_address_t address = (usb_address_t) DEV_IPC_GET_ARG1(*call); 232 233 int rc = usb_iface->release_address(device, address); 234 235 ipc_answer_0(callid, rc); 136 236 } 137 237 … … 175 275 } 176 276 177 size_t expected_len = IPC_GET_ARG3(*call);277 size_t expected_len = DEV_IPC_GET_ARG3(*call); 178 278 usb_target_t target = { 179 .address = IPC_GET_ARG1(*call),180 .endpoint = IPC_GET_ARG2(*call)279 .address = DEV_IPC_GET_ARG1(*call), 280 .endpoint = DEV_IPC_GET_ARG2(*call) 181 281 }; 182 282 … … 227 327 } 228 328 229 size_t len = IPC_GET_ARG3(*call);329 size_t len = DEV_IPC_GET_ARG3(*call); 230 330 usb_target_t target = { 231 .address = IPC_GET_ARG1(*call),232 .endpoint = IPC_GET_ARG2(*call)331 .address = DEV_IPC_GET_ARG1(*call), 332 .endpoint = DEV_IPC_GET_ARG2(*call) 233 333 }; 234 334 … … 284 384 285 385 usb_target_t target = { 286 .address = IPC_GET_ARG1(*call),287 .endpoint = IPC_GET_ARG2(*call)386 .address = DEV_IPC_GET_ARG1(*call), 387 .endpoint = DEV_IPC_GET_ARG2(*call) 288 388 }; 289 389
Note:
See TracChangeset
for help on using the changeset viewer.