Changes in uspace/lib/drv/generic/remote_usbhc.c [eac610e:fb1dca09] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usbhc.c
reac610e rfb1dca09 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 *);59 54 //static void remote_usbhc(device_t *, void *, ipc_callid_t, ipc_call_t *); 60 55 … … 62 57 static remote_iface_func_ptr_t remote_usbhc_iface_ops [] = { 63 58 remote_usbhc_get_address, 64 65 59 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 74 60 remote_usbhc_interrupt_out, 75 61 remote_usbhc_interrupt_in, 76 77 62 remote_usbhc_control_write_setup, 78 63 remote_usbhc_control_write_data, 79 64 remote_usbhc_control_write_status, 80 81 65 remote_usbhc_control_read_setup, 82 66 remote_usbhc_control_read_data, … … 108 92 } 109 93 110 devman_handle_t handle = DEV_IPC_GET_ARG1(*call);94 devman_handle_t handle = IPC_GET_ARG1(*call); 111 95 112 96 usb_address_t address; … … 122 106 ipc_callid_t callid, ipc_call_t *call) 123 107 { 124 ipcarg_t buffer_hash = DEV_IPC_GET_ARG1(*call);108 ipcarg_t buffer_hash = IPC_GET_ARG1(*call); 125 109 async_transaction_t * trans = (async_transaction_t *)buffer_hash; 126 110 if (trans == NULL) { … … 144 128 accepted_size = trans->size; 145 129 } 146 async_data_read_finalize(c id, trans->buffer, accepted_size);130 async_data_read_finalize(callid, trans->buffer, accepted_size); 147 131 148 132 ipc_answer_1(callid, EOK, accepted_size); … … 150 134 free(trans->buffer); 151 135 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);236 136 } 237 137 … … 275 175 } 276 176 277 size_t expected_len = DEV_IPC_GET_ARG3(*call);177 size_t expected_len = IPC_GET_ARG3(*call); 278 178 usb_target_t target = { 279 .address = DEV_IPC_GET_ARG1(*call),280 .endpoint = DEV_IPC_GET_ARG2(*call)179 .address = IPC_GET_ARG1(*call), 180 .endpoint = IPC_GET_ARG2(*call) 281 181 }; 282 182 … … 327 227 } 328 228 329 size_t len = DEV_IPC_GET_ARG3(*call);229 size_t len = IPC_GET_ARG3(*call); 330 230 usb_target_t target = { 331 .address = DEV_IPC_GET_ARG1(*call),332 .endpoint = DEV_IPC_GET_ARG2(*call)231 .address = IPC_GET_ARG1(*call), 232 .endpoint = IPC_GET_ARG2(*call) 333 233 }; 334 234 … … 384 284 385 285 usb_target_t target = { 386 .address = DEV_IPC_GET_ARG1(*call),387 .endpoint = DEV_IPC_GET_ARG2(*call)286 .address = IPC_GET_ARG1(*call), 287 .endpoint = IPC_GET_ARG2(*call) 388 288 }; 389 289
Note:
See TracChangeset
for help on using the changeset viewer.