Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset be2ad7cf in mainline


Ignore:
Timestamp:
2010-11-21T21:00:34Z (11 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master
Children:
4d31d58
Parents:
0ee648a
Message:

Interrupt transfers ready for local drivers

Location:
uspace/lib/usb
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/Makefile

    r0ee648a rbe2ad7cf  
    3434SOURCES = \
    3535        src/hcdhubd.c \
     36        src/localdrv.c \
    3637        src/usb.c \
    3738        src/usbdrv.c
  • uspace/lib/usb/src/hcdhubd.c

    r0ee648a rbe2ad7cf  
    9898                return EOK;
    9999        } else {
    100                 printf("%s: hub added, hurrah!\n", hc_driver->name);
    101100                /*
    102101                 * We are some (probably deeply nested) hub.
     
    272271}
    273272
    274 /** Issue interrupt OUT transfer to HC driven by current task.
    275  *
    276  * @param hc Host controller to handle the transfer.
    277  * @param target Target device address.
    278  * @param buffer Data buffer.
    279  * @param size Buffer size.
    280  * @param handle Transfer handle.
    281  * @return Error code.
    282  */
    283 int usb_hc_async_interrupt_out(usb_hc_device_t *hc, usb_target_t target,
    284     void *buffer, size_t size,
    285     usb_handle_t *handle)
    286 {
    287         if ((hc->transfer_ops == NULL)
    288             || (hc->transfer_ops->transfer_out == NULL)) {
    289                 return ENOTSUP;
    290         }
    291 
    292         /*
    293          * For debugging purposes only.
    294          * We need to find appropriate device in list of managed device
    295          * and pass it to the transfer callback function.
    296          */
    297         usb_hcd_attached_device_info_t dev = {
    298                 .address = target.address,
    299                 .endpoint_count = 0,
    300                 .endpoints = NULL,
    301         };
    302         usb_hc_endpoint_info_t endpoint = {
    303                 .endpoint = target.endpoint,
    304                 .transfer_type = USB_TRANSFER_INTERRUPT,
    305                 .direction = USB_DIRECTION_OUT,
    306                 .data_toggle = 0
    307         };
    308 
    309         hc->transfer_ops->transfer_out(hc, &dev, &endpoint, buffer, size, NULL, NULL);
    310 
    311         *handle = (usb_handle_t)NULL;
    312 
    313         return EOK;
    314 }
    315 
    316 
    317 /** Issue interrupt IN transfer to HC driven by current task.
    318  *
    319  * @warning The @p buffer and @p actual_size parameters shall not be
    320  * touched until this transfer is waited for by usb_hc_async_wait_for().
    321  *
    322  * @param hc Host controller to handle the transfer.
    323  * @param target Target device address.
    324  * @param buffer Data buffer.
    325  * @param size Buffer size.
    326  * @param actual_size Size of actually transferred data.
    327  * @param handle Transfer handle.
    328  * @return Error code.
    329  */
    330 int usb_hc_async_interrupt_in(usb_hc_device_t *hc, usb_target_t target,
    331     void *buffer, size_t size, size_t *actual_size,
    332     usb_handle_t *handle)
    333 {
    334         /*
    335          * TODO: verify that given endpoint is of interrupt type and
    336          * call hc->transfer_ops->transfer_in()
    337          */
    338         return ENOTSUP;
    339 }
    340 
    341 /** Wait for transfer to complete.
    342  *
    343  * @param handle Transfer handle.
    344  * @return Error code.
    345  */
    346 int usb_hc_async_wait_for(usb_handle_t handle)
    347 {
    348         return ENOTSUP;
    349 }
    350 
    351273/**
    352274 * @}
Note: See TracChangeset for help on using the changeset viewer.