Changeset be7950e8 in mainline
- Timestamp:
- 2011-03-21T13:07:56Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2bf8f8c
- Parents:
- ff582d47
- Location:
- uspace/drv/ohci
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/batch.c
rff582d47 rbe7950e8 41 41 42 42 #define DEFAULT_ERROR_COUNT 3 43 43 batch_t * batch_get( 44 ddf_fun_t *fun, 45 usb_target_t target, 46 usb_transfer_type_t transfer_type, 47 size_t max_packet_size, 48 usb_speed_t speed, 49 char *buffer, 50 size_t size, 51 char *setup_buffer, 52 size_t setup_size, 53 usbhc_iface_transfer_in_callback_t func_in, 54 usbhc_iface_transfer_out_callback_t func_out, 55 void *arg, 56 device_keeper_t *manager 57 ) 58 { 59 return NULL; 60 } 61 /*----------------------------------------------------------------------------*/ 62 void batch_dispose(batch_t *instance) 63 { 64 } 65 /*----------------------------------------------------------------------------*/ 66 void batch_control_write(batch_t *instance) 67 { 68 } 69 /*----------------------------------------------------------------------------*/ 70 void batch_control_read(batch_t *instance) 71 { 72 } 73 /*----------------------------------------------------------------------------*/ 74 void batch_interrupt_in(batch_t *instance) 75 { 76 } 77 /*----------------------------------------------------------------------------*/ 78 void batch_interrupt_out(batch_t *instance) 79 { 80 } 81 /*----------------------------------------------------------------------------*/ 82 void batch_bulk_in(batch_t *instance) 83 { 84 } 85 /*----------------------------------------------------------------------------*/ 86 void batch_bulk_out(batch_t *instance) 87 { 88 } 44 89 /** 45 90 * @} -
uspace/drv/ohci/iface.c
rff582d47 rbe7950e8 176 176 return ENOTSUP; 177 177 } 178 178 /*----------------------------------------------------------------------------*/ 179 179 /** Schedule interrupt out transfer. 180 180 * … … 198 198 usbhc_iface_transfer_out_callback_t callback, void *arg) 199 199 { 200 UNSUPPORTED("interrupt_out"); 201 202 return ENOTSUP; 203 } 204 200 hc_t *hc = fun_to_hc(fun); 201 assert(hc); 202 usb_speed_t speed = device_keeper_speed(&hc->manager, target.address); 203 204 usb_log_debug("Interrupt OUT %d:%d %zu(%zu).\n", 205 target.address, target.endpoint, size, max_packet_size); 206 207 batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT, 208 max_packet_size, speed, data, size, NULL, 0, NULL, callback, arg, 209 &hc->manager); 210 if (!batch) 211 return ENOMEM; 212 batch_interrupt_out(batch); 213 const int ret = hc_schedule(hc, batch); 214 if (ret != EOK) { 215 batch_dispose(batch); 216 return ret; 217 } 218 return EOK; 219 } 220 /*----------------------------------------------------------------------------*/ 205 221 /** Schedule interrupt in transfer. 206 222 * … … 224 240 usbhc_iface_transfer_in_callback_t callback, void *arg) 225 241 { 226 UNSUPPORTED("interrupt_in"); 227 228 return ENOTSUP; 229 } 230 242 assert(fun); 243 hc_t *hc = fun_to_hc(fun); 244 assert(hc); 245 usb_speed_t speed = device_keeper_speed(&hc->manager, target.address); 246 usb_log_debug("Interrupt IN %d:%d %zu(%zu).\n", 247 target.address, target.endpoint, size, max_packet_size); 248 249 batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT, 250 max_packet_size, speed, data, size, NULL, 0, callback, NULL, arg, 251 &hc->manager); 252 if (!batch) 253 return ENOMEM; 254 batch_interrupt_in(batch); 255 const int ret = hc_schedule(hc, batch); 256 if (ret != EOK) { 257 batch_dispose(batch); 258 return ret; 259 } 260 return EOK; 261 } 262 /*----------------------------------------------------------------------------*/ 231 263 /** Schedule bulk out transfer. 232 264 * … … 250 282 usbhc_iface_transfer_out_callback_t callback, void *arg) 251 283 { 252 UNSUPPORTED("bulk_out"); 253 254 return ENOTSUP; 255 } 256 284 assert(fun); 285 hc_t *hc = fun_to_hc(fun); 286 assert(hc); 287 usb_speed_t speed = device_keeper_speed(&hc->manager, target.address); 288 289 usb_log_debug("Bulk OUT %d:%d %zu(%zu).\n", 290 target.address, target.endpoint, size, max_packet_size); 291 292 batch_t *batch = batch_get(fun, target, USB_TRANSFER_BULK, 293 max_packet_size, speed, data, size, NULL, 0, NULL, callback, arg, 294 &hc->manager); 295 if (!batch) 296 return ENOMEM; 297 batch_bulk_out(batch); 298 const int ret = hc_schedule(hc, batch); 299 if (ret != EOK) { 300 batch_dispose(batch); 301 return ret; 302 } 303 return EOK; 304 305 } 306 /*----------------------------------------------------------------------------*/ 257 307 /** Schedule bulk in transfer. 258 308 * … … 276 326 usbhc_iface_transfer_in_callback_t callback, void *arg) 277 327 { 278 UNSUPPORTED("bulk_in"); 279 280 return ENOTSUP; 281 } 282 328 assert(fun); 329 hc_t *hc = fun_to_hc(fun); 330 assert(hc); 331 usb_speed_t speed = device_keeper_speed(&hc->manager, target.address); 332 usb_log_debug("Bulk IN %d:%d %zu(%zu).\n", 333 target.address, target.endpoint, size, max_packet_size); 334 335 batch_t *batch = batch_get(fun, target, USB_TRANSFER_BULK, 336 max_packet_size, speed, data, size, NULL, 0, callback, NULL, arg, 337 &hc->manager); 338 if (!batch) 339 return ENOMEM; 340 batch_bulk_in(batch); 341 const int ret = hc_schedule(hc, batch); 342 if (ret != EOK) { 343 batch_dispose(batch); 344 return ret; 345 } 346 return EOK; 347 } 348 /*----------------------------------------------------------------------------*/ 283 349 /** Schedule control write transfer. 284 350 * … … 303 369 static int control_write(ddf_fun_t *fun, usb_target_t target, 304 370 size_t max_packet_size, 305 void *setup_ packet, size_t setup_packet_size,306 void *data _buffer, size_t data_buffer_size,371 void *setup_data, size_t setup_size, 372 void *data, size_t size, 307 373 usbhc_iface_transfer_out_callback_t callback, void *arg) 308 374 { 309 UNSUPPORTED("control_write"); 310 311 return ENOTSUP; 312 } 313 375 assert(fun); 376 hc_t *hc = fun_to_hc(fun); 377 assert(hc); 378 usb_speed_t speed = device_keeper_speed(&hc->manager, target.address); 379 usb_log_debug("Control WRITE (%d) %d:%d %zu(%zu).\n", 380 speed, target.address, target.endpoint, size, max_packet_size); 381 382 if (setup_size != 8) 383 return EINVAL; 384 385 batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL, 386 max_packet_size, speed, data, size, setup_data, setup_size, 387 NULL, callback, arg, &hc->manager); 388 if (!batch) 389 return ENOMEM; 390 device_keeper_reset_if_need(&hc->manager, target, setup_data); 391 batch_control_write(batch); 392 const int ret = hc_schedule(hc, batch); 393 if (ret != EOK) { 394 batch_dispose(batch); 395 return ret; 396 } 397 return EOK; 398 } 399 /*----------------------------------------------------------------------------*/ 314 400 /** Schedule control read transfer. 315 401 * … … 334 420 static int control_read(ddf_fun_t *fun, usb_target_t target, 335 421 size_t max_packet_size, 336 void *setup_ packet, size_t setup_packet_size,337 void *data _buffer, size_t data_buffer_size,422 void *setup_data, size_t setup_size, 423 void *data, size_t size, 338 424 usbhc_iface_transfer_in_callback_t callback, void *arg) 339 425 { 340 UNSUPPORTED("control_read"); 341 342 return ENOTSUP; 343 } 344 426 assert(fun); 427 hc_t *hc = fun_to_hc(fun); 428 assert(hc); 429 usb_speed_t speed = device_keeper_speed(&hc->manager, target.address); 430 431 usb_log_debug("Control READ(%d) %d:%d %zu(%zu).\n", 432 speed, target.address, target.endpoint, size, max_packet_size); 433 batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL, 434 max_packet_size, speed, data, size, setup_data, setup_size, callback, 435 NULL, arg, &hc->manager); 436 if (!batch) 437 return ENOMEM; 438 batch_control_read(batch); 439 const int ret = hc_schedule(hc, batch); 440 if (ret != EOK) { 441 batch_dispose(batch); 442 return ret; 443 } 444 return EOK; 445 } 446 /*----------------------------------------------------------------------------*/ 345 447 /** Host controller interface implementation for OHCI. */ 346 448 usbhc_iface_t hc_iface = {
Note:
See TracChangeset
for help on using the changeset viewer.