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


Ignore:
Timestamp:
2017-12-18T22:50:21Z (6 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/hc.h

    r1ea0bbf r32fb6bce  
    5151
    5252typedef struct xhci_hc {
     53        /** Common HC device header */
     54        hc_device_t base;
     55
    5356        /* MMIO range */
    5457        addr_range_t mmio_range;
     
    8689        xhci_port_speed_t speeds [16];
    8790        uint8_t speed_to_psiv [USB_SPEED_MAX];
     91} xhci_hc_t;
    8892
    89         /* TODO: Hack. Figure out a better way. */
    90         hcd_t *hcd;
    91 } xhci_hc_t;
     93static inline xhci_hc_t *bus_to_hc(bus_t *bus)
     94{
     95        assert(bus);
     96        return member_to_inst(bus, xhci_hc_t, bus);
     97}
    9298
    9399typedef struct xhci_endpoint xhci_endpoint_t;
     
    99105int hc_irq_code_gen(irq_code_t *, xhci_hc_t *, const hw_res_list_parsed_t *);
    100106int hc_start(xhci_hc_t *, bool);
    101 int hc_schedule(xhci_hc_t *hc, usb_transfer_batch_t *batch);
    102 int hc_status(xhci_hc_t *, uint32_t *);
    103 void hc_interrupt(xhci_hc_t *, uint32_t);
    104107void hc_fini(xhci_hc_t *);
    105108int hc_ring_doorbell(xhci_hc_t *, unsigned, unsigned);
     
    113116int hc_update_endpoint(xhci_hc_t *, uint32_t, uint8_t, xhci_ep_ctx_t *);
    114117
     118int hc_schedule(usb_transfer_batch_t *batch);
     119int hc_status(bus_t *, uint32_t *);
     120void hc_interrupt(bus_t *, uint32_t);
     121
    115122#endif
    116123
Note: See TracChangeset for help on using the changeset viewer.