#include <sys/usb/hcd/xhci/xhci.h>
typedef struct xhci_quirk_table {
uint16_t xqt_vendor;
uint16_t xqt_device;
xhci_quirk_t xqt_quirks;
} xhci_quirk_table_t;
static xhci_quirk_table_t xhci_quirks[] = {
{ 0x1b7e, 0x1000, XHCI_QUIRK_NO_MSI },
{ 0x1033, 0x0194, XHCI_QUIRK_32_ONLY },
{ 0x1912, 0x0014, XHCI_QUIRK_32_ONLY },
{ 0x8086, 0x0f35, XHCI_QUIRK_INTC_EHCI },
{ 0x8086, 0x9c31, XHCI_QUIRK_INTC_EHCI },
{ 0x8086, 0x1e31, XHCI_QUIRK_INTC_EHCI },
{ 0x8086, 0x8c31, XHCI_QUIRK_INTC_EHCI },
{ 0x8086, 0x8cb1, XHCI_QUIRK_INTC_EHCI },
{ 0x8086, 0x9cb1, XHCI_QUIRK_INTC_EHCI },
{ 0xffff, 0xffff, 0 }
};
void
xhci_quirks_populate(xhci_t *xhcip)
{
xhci_quirk_table_t *xqt;
for (xqt = &xhci_quirks[0]; xqt->xqt_vendor != 0xffff; xqt++) {
if (xqt->xqt_vendor == xhcip->xhci_vendor_id &&
xqt->xqt_device == xhcip->xhci_device_id) {
xhcip->xhci_quirks = xqt->xqt_quirks;
return;
}
}
}
void
xhci_reroute_intel(xhci_t *xhcip)
{
uint32_t ports;
ports = pci_config_get32(xhcip->xhci_cfg_handle,
PCI_XHCI_INTEL_USB3PRM);
pci_config_put32(xhcip->xhci_cfg_handle, PCI_XHCI_INTEL_USB3_PSSEN,
ports);
ports = pci_config_get32(xhcip->xhci_cfg_handle,
PCI_XHCI_INTEL_USB2PRM);
pci_config_put32(xhcip->xhci_cfg_handle, PCI_XHCI_INTEL_XUSB2PR,
ports);
}