Changeset dcf0597 in mainline for uspace/drv/bus/usb/xhci/rh.h
- Timestamp:
- 2017-10-13T17:40:48Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2297fab
- Parents:
- 063dfe8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/rh.h
r063dfe8 rdcf0597 38 38 39 39 #include <usb/host/usb_transfer_batch.h> 40 #include <usbvirt/virthub_base.h>41 40 #include "hw_struct/regs.h" 42 41 43 42 typedef struct xhci_hc xhci_hc_t; 44 45 enum {46 XHCI_MAX_PORTS = 255,47 };48 43 49 44 /** … … 58 53 /* XHCI root hub instance */ 59 54 typedef struct { 60 /** Virtual hub instance */61 virthub_base_t base;62 63 55 /** Host controller */ 64 56 xhci_hc_t *hc; … … 66 58 /** Port speeds reported from HC */ 67 59 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;74 60 75 61 /** Interrupt transfer waiting for an actual interrupt to occur */ … … 82 68 int xhci_rh_init(xhci_rh_t *, xhci_hc_t *); 83 69 int 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 *); 70 const xhci_port_speed_t *xhci_rh_get_port_speed(xhci_rh_t *, uint8_t); 71 int xhci_rh_reset_port(xhci_rh_t *, uint8_t); 90 72 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 } 73 int xhci_rh_handle_port_status_change_event(xhci_hc_t *, xhci_trb_t *); 74 void xhci_rh_handle_port_change(xhci_rh_t *); 102 75 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 }107 76 #endif 108 77
Note:
See TracChangeset
for help on using the changeset viewer.