12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #pragma once
- #include <driver/usb/usb.h>
- #include <driver/pci/pci.h>
- #define XHCI_CAPS_CAPLENGTH 0x00
- #define XHCI_CAPS_RESERVED 0x01
- #define XHCI_CAPS_HCIVERSION 0x02
- #define XHCI_CAPS_HCSPARAMS1 0x04
- #define XHCI_CAPS_HCSPARAMS2 0x08
- #define XHCI_CAPS_HCSPARAMS3 0x0c
- #define XHCI_CAPS_HCCPARAMS1 0x10
- #define XHCI_CAPS_DBOFF 0x14
- #define XHCI_CAPS_RTSOFF 0x18
- #define XHCI_CAPS_HCCPARAMS2 0x1c
- struct xhci_caps_HCSPARAMS1_reg_t
- {
- unsigned max_slots : 8;
- unsigned max_intrs : 11;
- unsigned reserved : 5;
- unsigned max_ports : 8;
- }__attribute__((packed));
- struct xhci_port_info_t
- {
- uint8_t flags;
- uint8_t paired_port_num;
- uint8_t offset;
- uint8_t reserved;
- } __attribute__((packed));
- struct xhci_controller_t
- {
- struct pci_device_structure_general_device_t *pci_dev_hdr;
- int controller_id;
- int vbase;
- struct xhci_port_info_t *ports;
- };
- void xhci_init(struct pci_device_structure_general_device_t *header);
|