Changeset b5111c46 in mainline for uspace/drv/bus/usb/uhci/hc.c


Ignore:
Timestamp:
2014-07-23T21:38:25Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ffa96c2
Parents:
87a3df7f
Message:

Convert OHCI and UHCI away from DDF_DATA_IMPLANT.

File:
1 edited

Legend:

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

    r87a3df7f rb5111c46  
    230230 *
    231231 * @param[in] instance Memory place to initialize.
     232 * @param[in] HC function node
    232233 * @param[in] regs Range of device's I/O control registers.
    233234 * @param[in] interrupts True if hw interrupts should be used.
     
    238239 * interrupt fibrils.
    239240 */
    240 int hc_init(hc_t *instance, addr_range_t *regs, bool interrupts)
     241int hc_init(hc_t *instance, ddf_fun_t *fun, addr_range_t *regs, bool interrupts)
    241242{
    242243        assert(regs->size >= sizeof(uhci_regs_t));
     
    266267        }
    267268
    268         hcd_init(&instance->generic, USB_SPEED_FULL,
     269        instance->generic = ddf_fun_data_alloc(fun, sizeof(hcd_t));
     270        if (instance->generic == NULL) {
     271                usb_log_error("Out of memory.\n");
     272                return ENOMEM;
     273        }
     274
     275        hcd_init(instance->generic, USB_SPEED_FULL,
    269276            BANDWIDTH_AVAILABLE_USB11, bandwidth_count_usb11);
    270277
    271         instance->generic.private_data = instance;
    272         instance->generic.schedule = hc_schedule;
    273         instance->generic.ep_add_hook = NULL;
     278        instance->generic->private_data = instance;
     279        instance->generic->schedule = hc_schedule;
     280        instance->generic->ep_add_hook = NULL;
    274281
    275282        hc_init_hw(instance);
Note: See TracChangeset for help on using the changeset viewer.