Changeset 32fb6bce in mainline for uspace/drv/bus/usb/xhci/bus.c


Ignore:
Timestamp:
2017-12-18T22:50:21Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7f70d1c
Parents:
1ea0bbf
git-author:
Ondřej Hlavatý <aearsis@…> (2017-12-18 22:04:50)
git-committer:
Ondřej Hlavatý <aearsis@…> (2017-12-18 22:50:21)
Message:

usbhost: refactoring

This commit moves interrupt, status and schedule to bus
operations. Then the purpose of hcd_t is better defined, and split into
hc_driver_t and hc_device_t. hc_driver_t is used to wrap driver
implementation by the library (similar to how usb_driver_t is used to
wrap usb device drivers). hc_device_t is used as a parent for hc_t
inside drivers, and is allocated inside the DDF device node.

To support these changes, some local identifiers were renamed, some
functions were moved and/or renamed and their arguments changed. The
most notable one being hcd_send_batch → bus_device_send_batch.

File:
1 edited

Legend:

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

    r1ea0bbf r32fb6bce  
    111111
    112112        uint16_t max_packet_size;
    113         if ((err = hcd_get_ep0_max_packet_size(&max_packet_size, hc->hcd, &dev->base)))
     113        if ((err = hcd_get_ep0_max_packet_size(&max_packet_size, (bus_t *) &hc->bus, &dev->base)))
    114114                return err;
    115115
     
    168168
    169169        /* Read the device descriptor, derive the match ids */
    170         if ((err = hcd_ddf_device_explore(dev))) {
     170        if ((err = hcd_device_explore(dev))) {
    171171                usb_log_error("Device(%d): Failed to explore device: %s", dev->address, str_error(err));
    172172                goto err_address;
     
    233233        /* Destroy DDF device. */
    234234        /* XXX: Not a good idea, this method should not destroy devices. */
    235         hcd_ddf_device_destroy(dev);
     235        hcd_ddf_fun_destroy(dev);
    236236
    237237        return EOK;
     
    501501        BIND_OP(batch_destroy)
    502502#undef BIND_OP
     503
     504        .interrupt = hc_interrupt,
     505        .status = hc_status,
     506        .batch_schedule = hc_schedule,
    503507};
    504508
     
    507511        assert(bus);
    508512
    509         bus_init(&bus->base, hc->hcd, sizeof(xhci_device_t));
     513        bus_init(&bus->base, sizeof(xhci_device_t));
    510514
    511515        bus->devices_by_slot = calloc(hc->max_slots, sizeof(xhci_device_t *));
Note: See TracChangeset for help on using the changeset viewer.