Changeset 1a02517 in mainline for uspace/drv


Ignore:
Timestamp:
2011-08-25T08:53:14Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
32e093e
Parents:
3afb758
Message:

libusbhost: Streamline new hcd arch. UHCI: follow changes in libusbhost

Add endpoint registration hook.
Remove batch private data dtor from hcd_t (it should be set during initialization)

Location:
uspace/drv/bus/usb/uhci
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/uhci/batch.c

    r3afb758 r1a02517  
    9393 * @param[in] uhci_batch Instance to destroy.
    9494 */
    95 void uhci_transfer_batch_dispose(void *uhci_batch)
     95static void uhci_transfer_batch_dispose(void *uhci_batch)
    9696{
    9797        uhci_transfer_batch_t *instance = uhci_batch;
     
    119119 * Initializes parameters needed for the transfer and callback.
    120120 */
    121 void * uhci_transfer_batch_create(usb_transfer_batch_t *batch)
     121int batch_init_private(usb_transfer_batch_t *batch)
    122122{
    123123#define CHECK_NULL_DISPOSE_RETURN(ptr, message...) \
     
    127127                        uhci_transfer_batch_dispose(uhci_data); \
    128128                } \
    129                 return NULL; \
     129                return ENOMEM; \
    130130        } else (void)0
    131131
     
    164164        /* Set generic data buffer pointer */
    165165        batch->data_buffer = setup + batch->setup_size;
     166        batch->private_data_dtor = uhci_transfer_batch_dispose;
    166167        batch->private_data = uhci_data;
    167168        usb_log_debug2("Batch %p " USB_TRANSFER_BATCH_FMT
     
    171172        batch_setup[batch->ep->transfer_type][batch->ep->direction](batch);
    172173
    173         return uhci_data;
    174 }
    175 /*----------------------------------------------------------------------------*/
     174        return EOK;
     175}
    176176/*----------------------------------------------------------------------------*/
    177177/** Check batch TDs for activity.
  • uspace/drv/bus/usb/uhci/batch.h

    r3afb758 r1a02517  
    3939#include "hw_struct/queue_head.h"
    4040
    41 void * uhci_transfer_batch_create(usb_transfer_batch_t *batch);
    42 void uhci_transfer_batch_dispose(void *uhci_batch);
    43 
    44 bool batch_is_complete(usb_transfer_batch_t *instance);
    45 
    46 qh_t * batch_qh(usb_transfer_batch_t *instance);
     41int batch_init_private(usb_transfer_batch_t *batch);
     42bool batch_is_complete(usb_transfer_batch_t *batch);
     43qh_t * batch_qh(usb_transfer_batch_t *batch);
    4744#endif
    4845/**
  • uspace/drv/bus/usb/uhci/hc.c

    r3afb758 r1a02517  
    198198        instance->generic.private_data = instance;
    199199        instance->generic.schedule = hc_schedule;
    200         instance->generic.batch_private_ctor = uhci_transfer_batch_create;
    201         instance->generic.batch_private_dtor = uhci_transfer_batch_dispose;
     200        instance->generic.batch_init_hook = batch_init_private;
     201        instance->generic.ep_add_hook = NULL;
    202202#undef CHECK_RET_DEST_FUN_RETURN
    203203
Note: See TracChangeset for help on using the changeset viewer.