Changeset 32fb6bce in mainline for uspace/drv/bus/usb/ehci/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/ehci/hc.h

    r1ea0bbf r32fb6bce  
    5555/** Main EHCI driver structure */
    5656typedef struct hc {
     57        /* Common device header */
     58        hc_device_t base;
     59
    5760        /** Memory mapped CAPS register area */
    5861        ehci_caps_regs_t *caps;
     
    8588} hc_t;
    8689
    87 int hc_init(hc_t *instance, hcd_t *hcd, const hw_res_list_parsed_t *hw_res);
    88 int hc_start(hc_t *instance, bool interrupts);
    89 void hc_fini(hc_t *instance);
     90static inline hc_t *hcd_to_hc(hc_device_t *hcd)
     91{
     92        assert(hcd);
     93        return (hc_t *) hcd;
     94}
    9095
    91 void hc_enqueue_endpoint(hc_t *instance, const endpoint_t *ep);
    92 void hc_dequeue_endpoint(hc_t *instance, const endpoint_t *ep);
     96void hc_enqueue_endpoint(hc_t *, const endpoint_t *);
     97void hc_dequeue_endpoint(hc_t *, const endpoint_t *);
    9398
    94 int ehci_hc_gen_irq_code(irq_code_t *code, hcd_t *hcd, const hw_res_list_parsed_t *hw_res);
     99/* Boottime operations */
     100int hc_add(hc_device_t *, const hw_res_list_parsed_t *);
     101int hc_start(hc_device_t *);
     102int hc_gen_irq_code(irq_code_t *, hc_device_t *, const hw_res_list_parsed_t *);
     103int hc_gone(hc_device_t *);
    95104
    96 void ehci_hc_interrupt(hcd_t *hcd, uint32_t status);
    97 int ehci_hc_status(hcd_t *hcd, uint32_t *status);
    98 int ehci_hc_schedule(hcd_t *hcd, usb_transfer_batch_t *batch);
     105/** Runtime operations */
     106void ehci_hc_interrupt(bus_t *, uint32_t);
     107int ehci_hc_status(bus_t *, uint32_t *);
     108int ehci_hc_schedule(usb_transfer_batch_t *);
     109
    99110#endif
    100111/**
Note: See TracChangeset for help on using the changeset viewer.