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


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.c

    r1ea0bbf r32fb6bce  
    432432 * Used only when polling. Shall supplement the irq_commands.
    433433 */
    434 int hc_status(xhci_hc_t *hc, uint32_t *status)
    435 {
     434int hc_status(bus_t *bus, uint32_t *status)
     435{
     436        xhci_hc_t *hc = bus_to_hc(bus);
    436437        int ip = XHCI_REG_RD(hc->rt_regs->ir, XHCI_INTR_IP);
    437438        if (ip) {
     
    449450}
    450451
    451 int hc_schedule(xhci_hc_t *hc, usb_transfer_batch_t *batch)
     452int hc_schedule(usb_transfer_batch_t *batch)
    452453{
    453454        assert(batch);
    454         assert(batch->ep);
     455        xhci_hc_t *hc = bus_to_hc(endpoint_get_bus(batch->ep));
    455456
    456457        if (!batch->target.address) {
     
    532533}
    533534
    534 void hc_interrupt(xhci_hc_t *hc, uint32_t status)
    535 {
     535void hc_interrupt(bus_t *bus, uint32_t status)
     536{
     537        xhci_hc_t *hc = bus_to_hc(bus);
    536538        status = xhci2host(32, status);
    537539
Note: See TracChangeset for help on using the changeset viewer.