Changeset dcf0597 in mainline for uspace/drv/bus/usb/xhci/rh.h


Ignore:
Timestamp:
2017-10-13T17:40:48Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2297fab
Parents:
063dfe8
Message:

xhci rh: move away from virthub

xHC's root hub is too different from other HCs, that it does not make sense to use usbhub for driving it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/rh.h

    r063dfe8 rdcf0597  
    3838
    3939#include <usb/host/usb_transfer_batch.h>
    40 #include <usbvirt/virthub_base.h>
    4140#include "hw_struct/regs.h"
    4241
    4342typedef struct xhci_hc xhci_hc_t;
    44 
    45 enum {
    46         XHCI_MAX_PORTS = 255,
    47 };
    4843
    4944/**
     
    5853/* XHCI root hub instance */
    5954typedef struct {
    60         /** Virtual hub instance */
    61         virthub_base_t base;
    62 
    6355        /** Host controller */
    6456        xhci_hc_t *hc;
     
    6658        /** Port speeds reported from HC */
    6759        xhci_port_speed_t speeds [16];
    68 
    69         /** USB hub descriptor describing the XHCI root hub */
    70         struct {
    71                 usb_hub_descriptor_header_t header;
    72                 uint8_t rempow[STATUS_BYTES(XHCI_MAX_PORTS) * 2];
    73         } __attribute__((packed)) hub_descriptor;
    7460
    7561        /** Interrupt transfer waiting for an actual interrupt to occur */
     
    8268int xhci_rh_init(xhci_rh_t *, xhci_hc_t *);
    8369int xhci_rh_fini(xhci_rh_t *);
    84 const xhci_port_speed_t *xhci_get_port_speed(xhci_rh_t *, uint8_t);
    85 int xhci_handle_port_status_change_event(xhci_hc_t *, xhci_trb_t *);
    86 int xhci_get_hub_port(xhci_trb_t *);
    87 int xhci_reset_hub_port(xhci_hc_t *, uint8_t);
    88 int xhci_rh_schedule(xhci_rh_t *, usb_transfer_batch_t *);
    89 int xhci_rh_interrupt(xhci_rh_t *);
     70const xhci_port_speed_t *xhci_rh_get_port_speed(xhci_rh_t *, uint8_t);
     71int xhci_rh_reset_port(xhci_rh_t *, uint8_t);
    9072
    91 /** Get XHCI rh address.
    92  *
    93  * @param rh XHCI rh instance.
    94  * @return USB address assigned to the hub.
    95  * Wrapper for virtual hub address
    96  */
    97 static inline usb_address_t xhci_rh_get_address(xhci_rh_t *rh)
    98 {
    99         assert(rh);
    100         return virthub_base_get_address(&rh->base);
    101 }
     73int xhci_rh_handle_port_status_change_event(xhci_hc_t *, xhci_trb_t *);
     74void xhci_rh_handle_port_change(xhci_rh_t *);
    10275
    103 static inline bool xhci_is_usb3_port(xhci_rh_t* rh, uint8_t port)
    104 {
    105         return xhci_get_port_speed(rh, port)->major == 3;
    106 }
    10776#endif
    10877
Note: See TracChangeset for help on using the changeset viewer.