Changeset eb1a2f4 in mainline for uspace/lib/drv/generic/remote_usbhc.c
- Timestamp:
- 2011-02-22T23:30:56Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3b5d1535, a9c674e0
- Parents:
- dbe25f1 (diff), 664af708 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usbhc.c
rdbe25f1 reb1a2f4 35 35 #include <async.h> 36 36 #include <errno.h> 37 #include <assert.h> 37 38 38 39 #include "usbhc_iface.h" 39 #include "d river.h"40 #include "ddf/driver.h" 40 41 41 42 #define USB_MAX_PAYLOAD_SIZE 1020 … … 43 44 #define HACK_MAX_PACKET_SIZE_INTERRUPT_IN 4 44 45 45 static void remote_usbhc_interrupt_out(d evice_t *, void *, ipc_callid_t, ipc_call_t *);46 static void remote_usbhc_interrupt_in(d evice_t *, void *, ipc_callid_t, ipc_call_t *);47 static void remote_usbhc_bulk_out(d evice_t *, void *, ipc_callid_t, ipc_call_t *);48 static void remote_usbhc_bulk_in(d evice_t *, void *, ipc_callid_t, ipc_call_t *);49 static void remote_usbhc_control_write(d evice_t *, void *, ipc_callid_t, ipc_call_t *);50 static void remote_usbhc_control_read(d evice_t *, void *, ipc_callid_t, ipc_call_t *);51 static void remote_usbhc_reserve_default_address(d evice_t *, void *, ipc_callid_t, ipc_call_t *);52 static void remote_usbhc_release_default_address(d evice_t *, void *, ipc_callid_t, ipc_call_t *);53 static void remote_usbhc_request_address(d evice_t *, void *, ipc_callid_t, ipc_call_t *);54 static void remote_usbhc_bind_address(d evice_t *, void *, ipc_callid_t, ipc_call_t *);55 static void remote_usbhc_release_address(d evice_t *, void *, ipc_callid_t, ipc_call_t *);56 //static void remote_usbhc(d evice_t *, void *, ipc_callid_t, ipc_call_t *);46 static void remote_usbhc_interrupt_out(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 47 static void remote_usbhc_interrupt_in(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 48 static void remote_usbhc_bulk_out(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 49 static void remote_usbhc_bulk_in(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 50 static void remote_usbhc_control_write(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 51 static void remote_usbhc_control_read(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 52 static void remote_usbhc_reserve_default_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 53 static void remote_usbhc_release_default_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 54 static void remote_usbhc_request_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 55 static void remote_usbhc_bind_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 56 static void remote_usbhc_release_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 57 //static void remote_usbhc(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 57 58 58 59 /** Remote USB host controller interface operations. */ … … 123 124 } 124 125 125 void remote_usbhc_reserve_default_address(d evice_t *device, void *iface,126 void remote_usbhc_reserve_default_address(ddf_fun_t *fun, void *iface, 126 127 ipc_callid_t callid, ipc_call_t *call) 127 128 { … … 135 136 usb_speed_t speed = DEV_IPC_GET_ARG1(*call); 136 137 137 int rc = usb_iface->reserve_default_address( device, speed);138 int rc = usb_iface->reserve_default_address(fun, speed); 138 139 139 140 async_answer_0(callid, rc); 140 141 } 141 142 142 void remote_usbhc_release_default_address(d evice_t *device, void *iface,143 void remote_usbhc_release_default_address(ddf_fun_t *fun, void *iface, 143 144 ipc_callid_t callid, ipc_call_t *call) 144 145 { … … 150 151 } 151 152 152 int rc = usb_iface->release_default_address( device);153 int rc = usb_iface->release_default_address(fun); 153 154 154 155 async_answer_0(callid, rc); 155 156 } 156 157 157 void remote_usbhc_request_address(d evice_t *device, void *iface,158 void remote_usbhc_request_address(ddf_fun_t *fun, void *iface, 158 159 ipc_callid_t callid, ipc_call_t *call) 159 160 { … … 168 169 169 170 usb_address_t address; 170 int rc = usb_iface->request_address( device, speed, &address);171 int rc = usb_iface->request_address(fun, speed, &address); 171 172 if (rc != EOK) { 172 173 async_answer_0(callid, rc); … … 176 177 } 177 178 178 void remote_usbhc_bind_address(d evice_t *device, void *iface,179 void remote_usbhc_bind_address(ddf_fun_t *fun, void *iface, 179 180 ipc_callid_t callid, ipc_call_t *call) 180 181 { … … 189 190 devman_handle_t handle = (devman_handle_t) DEV_IPC_GET_ARG2(*call); 190 191 191 int rc = usb_iface->bind_address( device, address, handle);192 int rc = usb_iface->bind_address(fun, address, handle); 192 193 193 194 async_answer_0(callid, rc); 194 195 } 195 196 196 void remote_usbhc_release_address(d evice_t *device, void *iface,197 void remote_usbhc_release_address(ddf_fun_t *fun, void *iface, 197 198 ipc_callid_t callid, ipc_call_t *call) 198 199 { … … 206 207 usb_address_t address = (usb_address_t) DEV_IPC_GET_ARG1(*call); 207 208 208 int rc = usb_iface->release_address( device, address);209 int rc = usb_iface->release_address(fun, address); 209 210 210 211 async_answer_0(callid, rc); … … 212 213 213 214 214 static void callback_out(d evice_t *device,215 static void callback_out(ddf_fun_t *fun, 215 216 int outcome, void *arg) 216 217 { … … 222 223 } 223 224 224 static void callback_in(d evice_t *device,225 static void callback_in(ddf_fun_t *fun, 225 226 int outcome, size_t actual_size, void *arg) 226 227 { … … 255 256 * @param transfer_func Transfer function (might be NULL). 256 257 */ 257 static void remote_usbhc_out_transfer(d evice_t *device,258 static void remote_usbhc_out_transfer(ddf_fun_t *fun, 258 259 ipc_callid_t callid, ipc_call_t *call, 259 260 usbhc_iface_transfer_out_t transfer_func) … … 294 295 trans->size = len; 295 296 296 rc = transfer_func( device, target, max_packet_size,297 rc = transfer_func(fun, target, max_packet_size, 297 298 buffer, len, 298 299 callback_out, trans); … … 311 312 * @param transfer_func Transfer function (might be NULL). 312 313 */ 313 static void remote_usbhc_in_transfer(d evice_t *device,314 static void remote_usbhc_in_transfer(ddf_fun_t *fun, 314 315 ipc_callid_t callid, ipc_call_t *call, 315 316 usbhc_iface_transfer_in_t transfer_func) … … 342 343 trans->size = len; 343 344 344 int rc = transfer_func( device, target, max_packet_size,345 int rc = transfer_func(fun, target, max_packet_size, 345 346 trans->buffer, len, 346 347 callback_in, trans); … … 352 353 } 353 354 354 void remote_usbhc_interrupt_out(d evice_t *device, void *iface,355 void remote_usbhc_interrupt_out(ddf_fun_t *fun, void *iface, 355 356 ipc_callid_t callid, ipc_call_t *call) 356 357 { … … 358 359 assert(usb_iface != NULL); 359 360 360 return remote_usbhc_out_transfer( device, callid, call,361 return remote_usbhc_out_transfer(fun, callid, call, 361 362 usb_iface->interrupt_out); 362 363 } 363 364 364 void remote_usbhc_interrupt_in(d evice_t *device, void *iface,365 void remote_usbhc_interrupt_in(ddf_fun_t *fun, void *iface, 365 366 ipc_callid_t callid, ipc_call_t *call) 366 367 { … … 368 369 assert(usb_iface != NULL); 369 370 370 return remote_usbhc_in_transfer( device, callid, call,371 return remote_usbhc_in_transfer(fun, callid, call, 371 372 usb_iface->interrupt_in); 372 373 } 373 374 374 void remote_usbhc_bulk_out(d evice_t *device, void *iface,375 void remote_usbhc_bulk_out(ddf_fun_t *fun, void *iface, 375 376 ipc_callid_t callid, ipc_call_t *call) 376 377 { … … 378 379 assert(usb_iface != NULL); 379 380 380 return remote_usbhc_out_transfer( device, callid, call,381 return remote_usbhc_out_transfer(fun, callid, call, 381 382 usb_iface->bulk_out); 382 383 } 383 384 384 void remote_usbhc_bulk_in(d evice_t *device, void *iface,385 void remote_usbhc_bulk_in(ddf_fun_t *fun, void *iface, 385 386 ipc_callid_t callid, ipc_call_t *call) 386 387 { … … 388 389 assert(usb_iface != NULL); 389 390 390 return remote_usbhc_in_transfer( device, callid, call,391 return remote_usbhc_in_transfer(fun, callid, call, 391 392 usb_iface->bulk_in); 392 393 } 393 394 394 void remote_usbhc_control_write(d evice_t *device, void *iface,395 void remote_usbhc_control_write(ddf_fun_t *fun, void *iface, 395 396 ipc_callid_t callid, ipc_call_t *call) 396 397 { … … 444 445 trans->size = data_buffer_len; 445 446 446 rc = usb_iface->control_write( device, target, max_packet_size,447 rc = usb_iface->control_write(fun, target, max_packet_size, 447 448 setup_packet, setup_packet_len, 448 449 data_buffer, data_buffer_len, … … 456 457 457 458 458 void remote_usbhc_control_read(d evice_t *device, void *iface,459 void remote_usbhc_control_read(ddf_fun_t *fun, void *iface, 459 460 ipc_callid_t callid, ipc_call_t *call) 460 461 { … … 509 510 } 510 511 511 rc = usb_iface->control_read( device, target, max_packet_size,512 rc = usb_iface->control_read(fun, target, max_packet_size, 512 513 setup_packet, setup_packet_len, 513 514 trans->buffer, trans->size,
Note:
See TracChangeset
for help on using the changeset viewer.