Changeset d09791e6 in mainline


Ignore:
Timestamp:
2012-12-20T15:40:23Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a720ff6
Parents:
d9b2c73
Message:

libusb: Add additional parameter to hcd_setup_device.

uhci will need to know hc function handle.

Location:
uspace
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ohci/ohci.c

    rd9b2c73 rd09791e6  
    117117            "Failed to register irq handler: %s.\n", str_error(ret));
    118118
    119 
    120119        /* Try to enable interrupts */
    121120        bool interrupts = false;
     
    131130        }
    132131
    133         ret = hcd_setup_device(device);
     132        /* Initialize generic HCD driver */
     133        ret = hcd_setup_device(device, NULL);
    134134        if (ret != EOK) {
    135135                unregister_interrupt_handler(device, irq);
     
    138138
    139139
    140 // TODO: Undo device_setup_hcd
     140// TODO: Undo hcd_setup_device
    141141#define CHECK_RET_CLEAN_RETURN(ret, message...) \
    142142if (ret != EOK) { \
     
    147147        hc_t *hc_impl = malloc(sizeof(hc_t));
    148148        ret = hc_impl ? EOK : ENOMEM;
    149         CHECK_RET_CLEAN_RETURN(ret, "Failed to aloocate driver structure.\n");
     149        CHECK_RET_CLEAN_RETURN(ret, "Failed to allocate driver structure.\n");
    150150
     151        /* Initialize OHCI HC */
    151152        ret = hc_init(hc_impl, reg_base, reg_size, interrupts);
    152153        CHECK_RET_CLEAN_RETURN(ret, "Failed to init hc: %s.\n", str_error(ret));
    153154
     155        /* Connect OHCI to generic HCD */
    154156        hcd_set_implementation(dev_to_hcd(device), hc_impl,
    155157            hc_schedule, ohci_endpoint_init, ohci_endpoint_fini);
     158
     159        /* HC should be running OK. We can add root hub */
    156160        ret = hcd_setup_hub(dev_to_hcd(device), &hc_impl->rh.address, device);
    157161        CHECK_RET_CLEAN_RETURN(ret,
  • uspace/lib/usbhost/include/usb/host/hcd.h

    rd9b2c73 rd09791e6  
    107107    const match_id_list_t *mids);
    108108
    109 int hcd_setup_device(ddf_dev_t *device);
     109int hcd_setup_device(ddf_dev_t *device, ddf_fun_t **fun);
    110110int hcd_setup_hub(hcd_t *instance, usb_address_t *address, ddf_dev_t *dev);
    111111
  • uspace/lib/usbhost/src/hcd.c

    rd9b2c73 rd09791e6  
    307307 *  - registers interrupt handler
    308308 */
    309 int hcd_setup_device(ddf_dev_t *device)
     309int hcd_setup_device(ddf_dev_t *device, ddf_fun_t **hc_fun)
    310310{
    311311        if (device == NULL)
     
    355355
    356356        /* HC should be ok at this point (except it can't do anything) */
     357        if (hc_fun)
     358                *hc_fun = instance->hc_fun;
    357359
    358360        return EOK;
Note: See TracChangeset for help on using the changeset viewer.