\hypertarget{xhci__pci_8c_source}{}\doxysection{xhci\+\_\+pci.\+c}
\label{xhci__pci_8c_source}\index{dev/usb/controller/xhci\_pci.c@{dev/usb/controller/xhci\_pci.c}}
\mbox{\hyperlink{xhci__pci_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2010-\/2022 Hans Petter Selasky}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00005}00005 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00006}00006 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00007}00007 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00008}00008 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00009}00009 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00010}00010 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00011}00011 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00012}00012 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00013}00013 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00014}00014 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00015}00015 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00016}00016 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00017}00017 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00018}00018 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00019}00019 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00020}00020 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00021}00021 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00022}00022 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00023}00023 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00024}00024 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00025}00025 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00026}00026 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00027}00027 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00028}00028 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00029}\mbox{\hyperlink{xhci__pci_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00029}} \mbox{\hyperlink{xhci__pci_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00031}00031 \textcolor{preprocessor}{\#include <sys/stdint.h>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <sys/stddef.h>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/types.h>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <sys/condvar.h>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <sys/sx.h>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <sys/unistd.h>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <sys/callout.h>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <sys/priv.h>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00049}00049 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb_8h}{dev/usb/usb.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usbdi_8h}{dev/usb/usbdi.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00052}00052 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__core_8h}{dev/usb/usb\_core.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00054}00054 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__busdma_8h}{dev/usb/usb\_busdma.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00055}00055 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__process_8h}{dev/usb/usb\_process.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00056}00056 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__util_8h}{dev/usb/usb\_util.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00057}00057 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00058}00058 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__controller_8h}{dev/usb/usb\_controller.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00059}00059 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__bus_8h}{dev/usb/usb\_bus.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00060}00060 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__pci_8h}{dev/usb/usb\_pci.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00061}00061 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{xhci_8h}{dev/usb/controller/xhci.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00062}00062 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{xhcireg_8h}{dev/usb/controller/xhcireg.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00063}00063 \textcolor{preprocessor}{\#include "{}usb\_if.h"{}}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00064}00064 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00065}\mbox{\hyperlink{xhci__pci_8c_a24c1afe634d7b3f30c22c36b79d26cc4}{00065}} \textcolor{preprocessor}{\#define PCI\_XHCI\_VENDORID\_AMD           0x1022}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00066}\mbox{\hyperlink{xhci__pci_8c_a7c8058923b9bff44e7a2ca476a0b6cc7}{00066}} \textcolor{preprocessor}{\#define PCI\_XHCI\_VENDORID\_INTEL         0x8086}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00067}00067 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00068}\mbox{\hyperlink{xhci__pci_8c_a54319c3bc953657335a24746034e06e0}{00068}} \textcolor{keyword}{static} device\_probe\_t \mbox{\hyperlink{xhci__pci_8c_a54319c3bc953657335a24746034e06e0}{xhci\_pci\_probe}};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00069}\mbox{\hyperlink{xhci__pci_8c_a9bf70e0327897f2796353bc947bb325f}{00069}} \textcolor{keyword}{static} device\_detach\_t \mbox{\hyperlink{xhci__pci_8c_a9bf70e0327897f2796353bc947bb325f}{xhci\_pci\_detach}};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00070}\mbox{\hyperlink{xhci__pci_8c_a6023ac356092973a7472dca68723b64e}{00070}} \textcolor{keyword}{static} usb\_take\_controller\_t \mbox{\hyperlink{xhci__pci_8c_a6023ac356092973a7472dca68723b64e}{xhci\_pci\_take\_controller}};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00071}00071 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00072}\mbox{\hyperlink{xhci__pci_8c_af1975471e8e3152926bf6234b74e5d10}{00072}} \textcolor{keyword}{static} device\_method\_t \mbox{\hyperlink{xhci__pci_8c_af1975471e8e3152926bf6234b74e5d10}{xhci\_device\_methods}}[] = \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00073}00073         \textcolor{comment}{/* device interface */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00074}00074         DEVMETHOD(device\_probe, \mbox{\hyperlink{xhci__pci_8c_a54319c3bc953657335a24746034e06e0}{xhci\_pci\_probe}}),}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00075}00075         DEVMETHOD(device\_attach, \mbox{\hyperlink{xhci__pci_8c_a4432943e8af5ff8527492b857a68aff8}{xhci\_pci\_attach}}),}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00076}00076         DEVMETHOD(device\_detach, \mbox{\hyperlink{xhci__pci_8c_a9bf70e0327897f2796353bc947bb325f}{xhci\_pci\_detach}}),}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00077}00077         DEVMETHOD(device\_suspend, bus\_generic\_suspend),}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00078}00078         DEVMETHOD(device\_resume, bus\_generic\_resume),}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00079}00079         DEVMETHOD(device\_shutdown, bus\_generic\_shutdown),}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00080}00080         DEVMETHOD(usb\_take\_controller, \mbox{\hyperlink{xhci__pci_8c_a6023ac356092973a7472dca68723b64e}{xhci\_pci\_take\_controller}}),}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00081}00081 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00082}00082         DEVMETHOD\_END}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00083}00083 \};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00084}00084 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00085}\mbox{\hyperlink{xhci__pci_8c_a10189d5c215658b76f2818078ef26141}{00085}} \mbox{\hyperlink{xhci__pci_8c_a10189d5c215658b76f2818078ef26141}{DEFINE\_CLASS\_0}}(xhci, xhci\_pci\_driver, \mbox{\hyperlink{xhci__pci_8c_af1975471e8e3152926bf6234b74e5d10}{xhci\_device\_methods}},}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00086}00086     \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}}));}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00087}00087 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00088}\mbox{\hyperlink{xhci__pci_8c_a0fd30b2fb0399bdb731e9e821ae80ed0}{00088}} \textcolor{keyword}{static} devclass\_t \mbox{\hyperlink{xhci__pci_8c_a0fd30b2fb0399bdb731e9e821ae80ed0}{xhci\_devclass}};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00089}00089 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00090}\mbox{\hyperlink{xhci__pci_8c_adf1f221c3a84baaca8a4a85d173ccbc8}{00090}} \mbox{\hyperlink{xhci__pci_8c_adf1f221c3a84baaca8a4a85d173ccbc8}{DRIVER\_MODULE}}(xhci, pci, xhci\_pci\_driver, \mbox{\hyperlink{xhci__pci_8c_a0fd30b2fb0399bdb731e9e821ae80ed0}{xhci\_devclass}}, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00091}\mbox{\hyperlink{xhci__pci_8c_a7dd581040b8c9e6d97524fd2389bc038}{00091}} \mbox{\hyperlink{xhci__pci_8c_a7dd581040b8c9e6d97524fd2389bc038}{MODULE\_DEPEND}}(xhci, \mbox{\hyperlink{usb__if_8m_adfa3f6da9c4881e494b180c4ebb06470}{usb}}, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00092}00092 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00093}00093 \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00094}\mbox{\hyperlink{xhci__pci_8c_a48620b9e207652d59d190efbbeda3776}{00094}} \mbox{\hyperlink{xhci__pci_8c_a48620b9e207652d59d190efbbeda3776}{xhci\_pci\_match}}(device\_t self)}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00095}00095 \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00096}00096         uint32\_t device\_id = pci\_get\_devid(self);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00097}00097 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00098}00098         \textcolor{keywordflow}{switch} (device\_id) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00099}00099         \textcolor{keywordflow}{case} 0x145c1022:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00100}00100                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}AMD KERNCZ USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00101}00101         \textcolor{keywordflow}{case} 0x148c1022:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00102}00102                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}AMD Starship USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00103}00103         \textcolor{keywordflow}{case} 0x149c1022:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00104}00104                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}AMD Matisse USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00105}00105         \textcolor{keywordflow}{case} 0x43ba1022:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00106}00106                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}AMD X399 USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00107}00107         \textcolor{keywordflow}{case} 0x43b91022: \textcolor{comment}{/* X370 */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00108}00108         \textcolor{keywordflow}{case} 0x43bb1022: \textcolor{comment}{/* B350 */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00109}00109                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}AMD 300 Series USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00110}00110         \textcolor{keywordflow}{case} 0x78121022:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00111}00111         \textcolor{keywordflow}{case} 0x78141022:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00112}00112         \textcolor{keywordflow}{case} 0x79141022:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00113}00113                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}AMD FCH USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00114}00114 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00115}00115         \textcolor{keywordflow}{case} 0x145f1d94:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00116}00116                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Hygon USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00117}00117 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00118}00118         \textcolor{keywordflow}{case} 0x01941033:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00119}00119                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}NEC uPD720200 USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00120}00120         \textcolor{keywordflow}{case} 0x00151912:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00121}00121                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}NEC uPD720202 USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00122}00122 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00123}00123         \textcolor{keywordflow}{case} 0x10001b73:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00124}00124                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Fresco Logic FL1000G USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00125}00125         \textcolor{keywordflow}{case} 0x11001b73:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00126}00126                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Fresco Logic FL1100 USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00127}00127 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00128}00128         \textcolor{keywordflow}{case} 0x10421b21:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00129}00129                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}ASMedia ASM1042 USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00130}00130         \textcolor{keywordflow}{case} 0x11421b21:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00131}00131                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}ASMedia ASM1042A USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00132}00132         \textcolor{keywordflow}{case} 0x13431b21:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00133}00133                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}ASMedia ASM1143 USB 3.1 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00134}00134         \textcolor{keywordflow}{case} 0x32421b21:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00135}00135                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}ASMedia ASM3242 USB 3.2 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00136}00136 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00137}00137         \textcolor{keywordflow}{case} 0x0b278086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00138}00138                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Goshen Ridge Thunderbolt 4 USB controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00139}00139         \textcolor{keywordflow}{case} 0x0f358086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00140}00140                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel BayTrail USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00141}00141         \textcolor{keywordflow}{case} 0x11388086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00142}00142                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Maple Ridge Thunderbolt 4 USB controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00143}00143         \textcolor{keywordflow}{case} 0x15c18086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00144}00144         \textcolor{keywordflow}{case} 0x15d48086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00145}00145         \textcolor{keywordflow}{case} 0x15db8086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00146}00146                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Alpine Ridge Thunderbolt 3 USB controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00147}00147         \textcolor{keywordflow}{case} 0x15e98086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00148}00148         \textcolor{keywordflow}{case} 0x15ec8086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00149}00149         \textcolor{keywordflow}{case} 0x15f08086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00150}00150                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Titan Ridge Thunderbolt 3 USB controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00151}00151         \textcolor{keywordflow}{case} 0x19d08086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00152}00152                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Denverton USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00153}00153         \textcolor{keywordflow}{case} 0x9c318086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00154}00154         \textcolor{keywordflow}{case} 0x1e318086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00155}00155                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Panther Point USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00156}00156         \textcolor{keywordflow}{case} 0x22b58086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00157}00157                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Braswell USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00158}00158         \textcolor{keywordflow}{case} 0x31a88086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00159}00159                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Gemini Lake USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00160}00160         \textcolor{keywordflow}{case} 0x34ed8086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00161}00161                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Ice Lake-\/LP USB 3.1 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00162}00162         \textcolor{keywordflow}{case} 0x43ed8086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00163}00163                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Tiger Lake-\/H USB 3.2 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00164}00164         \textcolor{keywordflow}{case} 0x461e8086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00165}00165                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Alder Lake-\/P Thunderbolt 4 USB controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00166}00166         \textcolor{keywordflow}{case} 0x51ed8086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00167}00167                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Alder Lake USB 3.2 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00168}00168         \textcolor{keywordflow}{case} 0x5aa88086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00169}00169                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Apollo Lake USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00170}00170         \textcolor{keywordflow}{case} 0x7ae08086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00171}00171                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Alder Lake USB 3.2 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00172}00172         \textcolor{keywordflow}{case} 0x8a138086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00173}00173                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Ice Lake Thunderbolt 3 USB controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00174}00174         \textcolor{keywordflow}{case} 0x8c318086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00175}00175                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Lynx Point USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00176}00176         \textcolor{keywordflow}{case} 0x8cb18086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00177}00177                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Wildcat Point USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00178}00178         \textcolor{keywordflow}{case} 0x8d318086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00179}00179                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Wellsburg USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00180}00180         \textcolor{keywordflow}{case} 0x9a138086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00181}00181                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Tiger Lake-\/LP Thunderbolt 4 USB controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00182}00182         \textcolor{keywordflow}{case} 0x9a178086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00183}00183                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Tiger Lake-\/H Thunderbolt 4 USB controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00184}00184         \textcolor{keywordflow}{case} 0x9cb18086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00185}00185                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Broadwell Integrated PCH-\/LP chipset USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00186}00186         \textcolor{keywordflow}{case} 0x9d2f8086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00187}00187                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Sunrise Point-\/LP USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00188}00188         \textcolor{keywordflow}{case} 0xa0ed8086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00189}00189                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Tiger Lake-\/LP USB 3.2 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00190}00190         \textcolor{keywordflow}{case} 0xa12f8086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00191}00191                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Sunrise Point USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00192}00192         \textcolor{keywordflow}{case} 0xa1af8086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00193}00193                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Lewisburg USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00194}00194         \textcolor{keywordflow}{case} 0xa2af8086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00195}00195                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Union Point USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00196}00196         \textcolor{keywordflow}{case} 0xa36d8086:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00197}00197                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Intel Cannon Lake USB 3.1 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00198}00198 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00199}00199         \textcolor{keywordflow}{case} 0xa01b177d:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00200}00200                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}Cavium ThunderX USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00201}00201 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00202}00202         \textcolor{keywordflow}{case} 0x1ada10de:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00203}00203                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}NVIDIA TU106 USB 3.1 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00204}00204 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00205}00205         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00206}00206                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00207}00207         \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00208}00208 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00209}00209         \textcolor{keywordflow}{if} ((pci\_get\_class(self) == PCIC\_SERIALBUS)}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00210}00210             \&\& (pci\_get\_subclass(self) == PCIS\_SERIALBUS\_USB)}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00211}00211             \&\& (pci\_get\_progif(self) == PCIP\_SERIALBUS\_USB\_XHCI)) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00212}00212                 \textcolor{keywordflow}{return} (\textcolor{stringliteral}{"{}XHCI (generic) USB 3.0 controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00213}00213         \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00214}00214         \textcolor{keywordflow}{return} (NULL);                  \textcolor{comment}{/* dunno */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00215}00215 \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00216}00216 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00217}00217 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00218}\mbox{\hyperlink{xhci__pci_8c_a516793e7e450cfd26dbd2b1270052de8}{00218}} \mbox{\hyperlink{xhci__pci_8c_a54319c3bc953657335a24746034e06e0}{xhci\_pci\_probe}}(device\_t self)}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00219}00219 \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00220}00220         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{usb__device_8h_ab3a00cd7fdc532cb4cd4d59733b440bf}{desc}} = \mbox{\hyperlink{xhci__pci_8c_a48620b9e207652d59d190efbbeda3776}{xhci\_pci\_match}}(self);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00221}00221 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00222}00222         \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__device_8h_ab3a00cd7fdc532cb4cd4d59733b440bf}{desc}}) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00223}00223                 device\_set\_desc(self, \mbox{\hyperlink{usb__device_8h_ab3a00cd7fdc532cb4cd4d59733b440bf}{desc}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00224}00224                 \textcolor{keywordflow}{return} (BUS\_PROBE\_DEFAULT);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00225}00225         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00226}00226                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00227}00227         \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00228}00228 \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00229}00229 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00230}\mbox{\hyperlink{xhci__pci_8c_aee8eecb04307b158980004cce5cb0dde}{00230}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{xhci__pci_8c_aee8eecb04307b158980004cce5cb0dde}{xhci\_use\_msi}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00231}\mbox{\hyperlink{xhci__pci_8c_a5efe7d52c9fb6a92ad8c7cd1f5e86c46}{00231}} \mbox{\hyperlink{xhci__pci_8c_a5efe7d52c9fb6a92ad8c7cd1f5e86c46}{TUNABLE\_INT}}(\textcolor{stringliteral}{"{}hw.usb.xhci.msi"{}}, \&\mbox{\hyperlink{xhci__pci_8c_aee8eecb04307b158980004cce5cb0dde}{xhci\_use\_msi}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00232}\mbox{\hyperlink{xhci__pci_8c_a3542611ca38b7d4544b281aede683526}{00232}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{xhci__pci_8c_a3542611ca38b7d4544b281aede683526}{xhci\_use\_msix}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00233}\mbox{\hyperlink{xhci__pci_8c_a45a1c90d936b4787eaa5253835432736}{00233}} \mbox{\hyperlink{xhci__pci_8c_a5efe7d52c9fb6a92ad8c7cd1f5e86c46}{TUNABLE\_INT}}(\textcolor{stringliteral}{"{}hw.usb.xhci.msix"{}}, \&\mbox{\hyperlink{xhci__pci_8c_a3542611ca38b7d4544b281aede683526}{xhci\_use\_msix}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00234}00234 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00235}00235 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00236}\mbox{\hyperlink{xhci__pci_8c_a1da327a392917dcde0a8433be702b783}{00236}} \mbox{\hyperlink{xhci__pci_8c_a1da327a392917dcde0a8433be702b783}{xhci\_interrupt\_poll}}(\textcolor{keywordtype}{void} *\_sc)}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00237}00237 \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00238}00238         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = \_sc;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00239}00239         \mbox{\hyperlink{usb__core_8h_aadb0c32f6333b8a0715929ace5f550b2}{USB\_BUS\_UNLOCK}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00240}00240         \mbox{\hyperlink{xhci_8c_ae78994eb0559b8dc21a1d11c751483cf}{xhci\_interrupt}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00241}00241         \mbox{\hyperlink{usb__core_8h_a21dab1de8f52baf9fbf7617c6b1ec033}{USB\_BUS\_LOCK}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00242}00242         \mbox{\hyperlink{usbdi_8h_a5ba556ca3595eb8006822a123ac9d54f}{usb\_callout\_reset}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_ab47a64a6d621d0f38bb041b9b13dc9ac}{sc\_callout}}, 1, (\textcolor{keywordtype}{void} *)\&\mbox{\hyperlink{xhci__pci_8c_a1da327a392917dcde0a8433be702b783}{xhci\_interrupt\_poll}}, sc);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00243}00243 \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00244}00244 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00245}00245 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00246}\mbox{\hyperlink{xhci__pci_8c_ac00171c9ef508c634ffe1e8101563b28}{00246}} \mbox{\hyperlink{xhci__pci_8c_ac00171c9ef508c634ffe1e8101563b28}{xhci\_pci\_port\_route}}(device\_t self, uint32\_t set, uint32\_t clear)}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00247}00247 \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00248}00248         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00249}00249         uint32\_t usb3\_mask;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00250}00250         uint32\_t usb2\_mask;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00251}00251 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00252}00252         temp = pci\_read\_config(self, \mbox{\hyperlink{xhcireg_8h_ae0666a45f422d69240781733b86b160c}{PCI\_XHCI\_INTEL\_USB3\_PSSEN}}, 4) |}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00253}00253             pci\_read\_config(self, \mbox{\hyperlink{xhcireg_8h_a1094c3d5d6e9b11925cab60fe0a355a1}{PCI\_XHCI\_INTEL\_XUSB2PR}}, 4);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00254}00254 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00255}00255         temp |= set;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00256}00256         temp \&= \string~clear;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00257}00257 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00258}00258         \textcolor{comment}{/* Don't set bits which the hardware doesn't support */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00259}00259         usb3\_mask = pci\_read\_config(self, \mbox{\hyperlink{xhcireg_8h_a6a60ed89e112f254aa57c0aa26453c89}{PCI\_XHCI\_INTEL\_USB3PRM}}, 4);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00260}00260         usb2\_mask = pci\_read\_config(self, \mbox{\hyperlink{xhcireg_8h_ae51eeea91489aaa82c04fa5d0a180a55}{PCI\_XHCI\_INTEL\_USB2PRM}}, 4);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00261}00261 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00262}00262         pci\_write\_config(self, \mbox{\hyperlink{xhcireg_8h_ae0666a45f422d69240781733b86b160c}{PCI\_XHCI\_INTEL\_USB3\_PSSEN}}, temp \& usb3\_mask, 4);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00263}00263         pci\_write\_config(self, \mbox{\hyperlink{xhcireg_8h_a1094c3d5d6e9b11925cab60fe0a355a1}{PCI\_XHCI\_INTEL\_XUSB2PR}}, temp \& usb2\_mask, 4);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00264}00264 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00265}00265         device\_printf(self, \textcolor{stringliteral}{"{}Port routing mask set to 0x\%08x\(\backslash\)n"{}}, temp);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00266}00266 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00267}00267         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00268}00268 \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00269}00269 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00270}00270 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00271}\mbox{\hyperlink{xhci_8h_afb385cd8795b590096bda034f63c13fd}{00271}} \mbox{\hyperlink{xhci__pci_8c_a4432943e8af5ff8527492b857a68aff8}{xhci\_pci\_attach}}(device\_t self)}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00272}00272 \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00273}00273         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = device\_get\_softc(self);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00274}00274         \textcolor{keywordtype}{int} count, err, msix\_table, rid;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00275}00275         uint8\_t usemsi = 1;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00276}00276         uint8\_t usedma32 = 0;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00277}00277 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00278}00278         rid = \mbox{\hyperlink{xhcireg_8h_ad6e30131b3bcc1dc00c99e562ffdf472}{PCI\_XHCI\_CBMEM}};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00279}00279         sc-\/>\mbox{\hyperlink{structxhci__softc_a5db200979e42a04d4d7b4ace677da2de}{sc\_io\_res}} = bus\_alloc\_resource\_any(self, SYS\_RES\_MEMORY, \&rid,}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00280}00280             RF\_ACTIVE);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00281}00281         \textcolor{keywordflow}{if} (!sc-\/>\mbox{\hyperlink{structxhci__softc_a5db200979e42a04d4d7b4ace677da2de}{sc\_io\_res}}) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00282}00282                 device\_printf(self, \textcolor{stringliteral}{"{}Could not map memory\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00283}00283                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00284}00284         \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00285}00285         sc-\/>\mbox{\hyperlink{structxhci__softc_a1799bfc499a6df8fca1eb12ea0b9e5c4}{sc\_io\_tag}} = rman\_get\_bustag(sc-\/>\mbox{\hyperlink{structxhci__softc_a5db200979e42a04d4d7b4ace677da2de}{sc\_io\_res}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00286}00286         sc-\/>\mbox{\hyperlink{structxhci__softc_a8c82dbc3063b75607dc15851c1e4bcf6}{sc\_io\_hdl}} = rman\_get\_bushandle(sc-\/>\mbox{\hyperlink{structxhci__softc_a5db200979e42a04d4d7b4ace677da2de}{sc\_io\_res}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00287}00287         sc-\/>\mbox{\hyperlink{structxhci__softc_adf07260a74f6221c49d38f504c884e4a}{sc\_io\_size}} = rman\_get\_size(sc-\/>\mbox{\hyperlink{structxhci__softc_a5db200979e42a04d4d7b4ace677da2de}{sc\_io\_res}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00288}00288 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00289}00289         \textcolor{keywordflow}{switch} (pci\_get\_devid(self)) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00290}00290         \textcolor{keywordflow}{case} 0x10091b73:        \textcolor{comment}{/* Fresco Logic FL1009 USB3.0 xHCI Controller */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00291}00291         \textcolor{keywordflow}{case} 0x8241104c:        \textcolor{comment}{/* TUSB73x0 USB3.0 xHCI Controller */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00292}00292                 sc-\/>\mbox{\hyperlink{structxhci__softc_a7a6514cc7b3d2e0e6adc813948939206}{sc\_no\_deconfigure}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00293}00293                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00294}00294         \textcolor{keywordflow}{case} 0x01941033:        \textcolor{comment}{/* NEC uPD720200 USB 3.0 controller */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00295}00295         \textcolor{keywordflow}{case} 0x00141912:        \textcolor{comment}{/* NEC uPD720201 USB 3.0 controller */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00296}00296                 \textcolor{comment}{/* Don't use 64-\/bit DMA on these controllers. */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00297}00297                 usedma32 = 1;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00298}00298                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00299}00299         \textcolor{keywordflow}{case} 0x10001b73:        \textcolor{comment}{/* FL1000G */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00300}00300                 \textcolor{comment}{/* Fresco Logic host doesn't support MSI. */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00301}00301                 usemsi = 0;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00302}00302                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00303}00303         \textcolor{keywordflow}{case} 0x0f358086:        \textcolor{comment}{/* BayTrail */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00304}00304         \textcolor{keywordflow}{case} 0x9c318086:        \textcolor{comment}{/* Panther Point */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00305}00305         \textcolor{keywordflow}{case} 0x1e318086:        \textcolor{comment}{/* Panther Point */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00306}00306         \textcolor{keywordflow}{case} 0x8c318086:        \textcolor{comment}{/* Lynx Point */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00307}00307         \textcolor{keywordflow}{case} 0x8cb18086:        \textcolor{comment}{/* Wildcat Point */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00308}00308         \textcolor{keywordflow}{case} 0x9cb18086:        \textcolor{comment}{/* Broadwell Mobile Integrated */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00309}00309                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00310}00310 \textcolor{comment}{                 * On Intel chipsets, reroute ports from EHCI to XHCI}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00311}00311 \textcolor{comment}{                 * controller and use a different IMOD value.}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00312}00312 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00313}00313                 sc-\/>\mbox{\hyperlink{structxhci__softc_a211c39599cd0592a5e9f1a8d76ae9704}{sc\_port\_route}} = \&\mbox{\hyperlink{xhci__pci_8c_ac00171c9ef508c634ffe1e8101563b28}{xhci\_pci\_port\_route}};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00314}00314                 sc-\/>\mbox{\hyperlink{structxhci__softc_aa0a66ec02f4cdcfa22813fd399547766}{sc\_imod\_default}} = \mbox{\hyperlink{xhcireg_8h_ad345af222cc4042978cbeba3422a57d1}{XHCI\_IMOD\_DEFAULT\_LP}};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00315}00315                 sc-\/>\mbox{\hyperlink{structxhci__softc_a24f42ca0c013824ce4874e10886b2d73}{sc\_ctlstep}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00316}00316                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00317}00317         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00318}00318                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00319}00319         \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00320}00320 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00321}00321         \textcolor{keywordflow}{if} (\mbox{\hyperlink{xhci_8c_a064d5971b294586b6c68154ba681cd12}{xhci\_init}}(sc, self, usedma32)) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00322}00322                 device\_printf(self, \textcolor{stringliteral}{"{}Could not initialize softc\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00323}00323                 bus\_release\_resource(self, SYS\_RES\_MEMORY, \mbox{\hyperlink{xhcireg_8h_ad6e30131b3bcc1dc00c99e562ffdf472}{PCI\_XHCI\_CBMEM}},}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00324}00324                     sc-\/>\mbox{\hyperlink{structxhci__softc_a5db200979e42a04d4d7b4ace677da2de}{sc\_io\_res}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00325}00325                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00326}00326         \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00327}00327 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00328}00328         pci\_enable\_busmaster(self);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00329}00329 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00330}00330         \mbox{\hyperlink{usbdi_8h_a1f241362056f1ed3d4c4b5cfb63ce8e5}{usb\_callout\_init\_mtx}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_ab47a64a6d621d0f38bb041b9b13dc9ac}{sc\_callout}}, \&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a7355d01a9b05ad01972eccabe5747edf}{bus\_mtx}}, 0);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00331}00331 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00332}00332         rid = 0;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00333}00333         \textcolor{keywordflow}{if} (\mbox{\hyperlink{xhci__pci_8c_a3542611ca38b7d4544b281aede683526}{xhci\_use\_msix}} \&\& (msix\_table = pci\_msix\_table\_bar(self)) >= 0) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00334}00334                 \textcolor{keywordflow}{if} (msix\_table == \mbox{\hyperlink{xhcireg_8h_ad6e30131b3bcc1dc00c99e562ffdf472}{PCI\_XHCI\_CBMEM}}) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00335}00335                         sc-\/>\mbox{\hyperlink{structxhci__softc_af7c9be72f17cc6a9e8c803c9f53d6af7}{sc\_msix\_res}} = sc-\/>\mbox{\hyperlink{structxhci__softc_a5db200979e42a04d4d7b4ace677da2de}{sc\_io\_res}};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00336}00336                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00337}00337                         sc-\/>\mbox{\hyperlink{structxhci__softc_af7c9be72f17cc6a9e8c803c9f53d6af7}{sc\_msix\_res}} = bus\_alloc\_resource\_any(self,}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00338}00338                             SYS\_RES\_MEMORY, \&msix\_table, RF\_ACTIVE);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00339}00339                         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_af7c9be72f17cc6a9e8c803c9f53d6af7}{sc\_msix\_res}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00340}00340                                 \textcolor{comment}{/* May not be enabled */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00341}00341                                 device\_printf(self,}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00342}00342                                     \textcolor{stringliteral}{"{}Unable to map MSI-\/X table\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00343}00343                         \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00344}00344                 \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00345}00345                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_af7c9be72f17cc6a9e8c803c9f53d6af7}{sc\_msix\_res}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00346}00346                         count = 1;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00347}00347                         \textcolor{keywordflow}{if} (pci\_alloc\_msix(self, \&count) == 0) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00348}00348                                 \textcolor{keywordflow}{if} (bootverbose)}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00349}00349                                         device\_printf(self, \textcolor{stringliteral}{"{}MSI-\/X enabled\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00350}00350                                 rid = 1;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00351}00351                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00352}00352                                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_af7c9be72f17cc6a9e8c803c9f53d6af7}{sc\_msix\_res}} != sc-\/>\mbox{\hyperlink{structxhci__softc_a5db200979e42a04d4d7b4ace677da2de}{sc\_io\_res}}) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00353}00353                                         bus\_release\_resource(self,}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00354}00354                                             SYS\_RES\_MEMORY,}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00355}00355                                             msix\_table, sc-\/>\mbox{\hyperlink{structxhci__softc_af7c9be72f17cc6a9e8c803c9f53d6af7}{sc\_msix\_res}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00356}00356                                 \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00357}00357                                 sc-\/>\mbox{\hyperlink{structxhci__softc_af7c9be72f17cc6a9e8c803c9f53d6af7}{sc\_msix\_res}} = NULL;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00358}00358                         \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00359}00359                 \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00360}00360         \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00361}00361         \textcolor{keywordflow}{if} (rid == 0 \&\& \mbox{\hyperlink{xhci__pci_8c_aee8eecb04307b158980004cce5cb0dde}{xhci\_use\_msi}} \&\& usemsi) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00362}00362                 count = 1;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00363}00363                 \textcolor{keywordflow}{if} (pci\_alloc\_msi(self, \&count) == 0) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00364}00364                         \textcolor{keywordflow}{if} (bootverbose)}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00365}00365                                 device\_printf(self, \textcolor{stringliteral}{"{}MSI enabled\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00366}00366                         rid = 1;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00367}00367                 \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00368}00368         \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00369}00369         sc-\/>\mbox{\hyperlink{structxhci__softc_ae2349f0dcbdbf9686b8d4dedadc7a732}{sc\_irq\_res}} = bus\_alloc\_resource\_any(self, SYS\_RES\_IRQ, \&rid,}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00370}00370             RF\_ACTIVE | (rid != 0 ? 0 : RF\_SHAREABLE));}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00371}00371         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_ae2349f0dcbdbf9686b8d4dedadc7a732}{sc\_irq\_res}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00372}00372                 pci\_release\_msi(self);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00373}00373                 device\_printf(self, \textcolor{stringliteral}{"{}Could not allocate IRQ\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00374}00374                 \textcolor{comment}{/* goto error; FALLTHROUGH -\/ use polling */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00375}00375         \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00376}00376         sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a50629655e638e1f775df1ed160d3c533}{bdev}} = device\_add\_child(self, \textcolor{stringliteral}{"{}usbus"{}}, -\/1);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00377}00377         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a50629655e638e1f775df1ed160d3c533}{bdev}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00378}00378                 device\_printf(self, \textcolor{stringliteral}{"{}Could not add USB device\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00379}00379                 \textcolor{keywordflow}{goto} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00380}00380         \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00381}00381         device\_set\_ivars(sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a50629655e638e1f775df1ed160d3c533}{bdev}}, \&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00382}00382 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00383}00383         \textcolor{keywordflow}{switch} (pci\_get\_vendor(self)) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00384}00384         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci__pci_8c_a24c1afe634d7b3f30c22c36b79d26cc4}{PCI\_XHCI\_VENDORID\_AMD}}:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00385}00385                 strlcpy(sc-\/>\mbox{\hyperlink{structxhci__softc_a029579af296025d5bbcfead3d3848a17}{sc\_vendor}}, \textcolor{stringliteral}{"{}AMD"{}}, \textcolor{keyword}{sizeof}(sc-\/>\mbox{\hyperlink{structxhci__softc_a029579af296025d5bbcfead3d3848a17}{sc\_vendor}}));}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00386}00386                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00387}00387         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci__pci_8c_a7c8058923b9bff44e7a2ca476a0b6cc7}{PCI\_XHCI\_VENDORID\_INTEL}}:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00388}00388                 strlcpy(sc-\/>\mbox{\hyperlink{structxhci__softc_a029579af296025d5bbcfead3d3848a17}{sc\_vendor}}, \textcolor{stringliteral}{"{}Intel"{}}, \textcolor{keyword}{sizeof}(sc-\/>\mbox{\hyperlink{structxhci__softc_a029579af296025d5bbcfead3d3848a17}{sc\_vendor}}));}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00389}00389                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00390}00390         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00391}00391                 \textcolor{keywordflow}{if} (bootverbose)}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00392}00392                         device\_printf(self, \textcolor{stringliteral}{"{}(New XHCI DeviceId=0x\%08x)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00393}00393                             pci\_get\_devid(self));}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00394}00394                 snprintf(sc-\/>\mbox{\hyperlink{structxhci__softc_a029579af296025d5bbcfead3d3848a17}{sc\_vendor}}, \textcolor{keyword}{sizeof}(sc-\/>\mbox{\hyperlink{structxhci__softc_a029579af296025d5bbcfead3d3848a17}{sc\_vendor}}),}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00395}00395                     \textcolor{stringliteral}{"{}(0x\%04x)"{}}, pci\_get\_vendor(self));}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00396}00396                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00397}00397         \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00398}00398 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00399}00399         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_ae2349f0dcbdbf9686b8d4dedadc7a732}{sc\_irq\_res}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00400}00400                 err = bus\_setup\_intr(self, sc-\/>\mbox{\hyperlink{structxhci__softc_ae2349f0dcbdbf9686b8d4dedadc7a732}{sc\_irq\_res}}, INTR\_TYPE\_BIO | INTR\_MPSAFE,}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00401}00401                     NULL, (driver\_intr\_t *)\mbox{\hyperlink{xhci_8c_ae78994eb0559b8dc21a1d11c751483cf}{xhci\_interrupt}}, sc, \&sc-\/>\mbox{\hyperlink{structxhci__softc_a5c214d827fedf185fcd8e1244382440a}{sc\_intr\_hdl}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00402}00402                 \textcolor{keywordflow}{if} (err != 0) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00403}00403                         bus\_release\_resource(self, SYS\_RES\_IRQ,}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00404}00404                             rman\_get\_rid(sc-\/>\mbox{\hyperlink{structxhci__softc_ae2349f0dcbdbf9686b8d4dedadc7a732}{sc\_irq\_res}}), sc-\/>\mbox{\hyperlink{structxhci__softc_ae2349f0dcbdbf9686b8d4dedadc7a732}{sc\_irq\_res}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00405}00405                         sc-\/>\mbox{\hyperlink{structxhci__softc_ae2349f0dcbdbf9686b8d4dedadc7a732}{sc\_irq\_res}} = NULL;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00406}00406                         pci\_release\_msi(self);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00407}00407                         device\_printf(self, \textcolor{stringliteral}{"{}Could not setup IRQ, err=\%d\(\backslash\)n"{}}, err);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00408}00408                         sc-\/>\mbox{\hyperlink{structxhci__softc_a5c214d827fedf185fcd8e1244382440a}{sc\_intr\_hdl}} = NULL;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00409}00409                 \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00410}00410         \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00411}00411         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_ae2349f0dcbdbf9686b8d4dedadc7a732}{sc\_irq\_res}} == NULL || sc-\/>\mbox{\hyperlink{structxhci__softc_a5c214d827fedf185fcd8e1244382440a}{sc\_intr\_hdl}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00412}00412                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{xhci_8c_a792320a79250bac66a8c52febfda3150}{xhci\_use\_polling}}() != 0) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00413}00413                         device\_printf(self, \textcolor{stringliteral}{"{}Interrupt polling at \%dHz\(\backslash\)n"{}}, hz);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00414}00414                         \mbox{\hyperlink{usb__core_8h_a21dab1de8f52baf9fbf7617c6b1ec033}{USB\_BUS\_LOCK}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00415}00415                         \mbox{\hyperlink{xhci__pci_8c_a1da327a392917dcde0a8433be702b783}{xhci\_interrupt\_poll}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00416}00416                         \mbox{\hyperlink{usb__core_8h_aadb0c32f6333b8a0715929ace5f550b2}{USB\_BUS\_UNLOCK}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00417}00417                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00418}00418                         \textcolor{keywordflow}{goto} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00419}00419         \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00420}00420 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00421}00421         \mbox{\hyperlink{xhci__pci_8c_a6023ac356092973a7472dca68723b64e}{xhci\_pci\_take\_controller}}(self);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00422}00422 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00423}00423         err = \mbox{\hyperlink{xhci_8c_a4ad6285c04ade6aa120eb6f0f78f2c69}{xhci\_halt\_controller}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00424}00424 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00425}00425         \textcolor{keywordflow}{if} (err == 0)}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00426}00426                 err = \mbox{\hyperlink{xhci_8c_ab493057cb5a03075152f14e3bf8c8e7f}{xhci\_start\_controller}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00427}00427 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00428}00428         \textcolor{keywordflow}{if} (err == 0)}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00429}00429                 err = device\_probe\_and\_attach(sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a50629655e638e1f775df1ed160d3c533}{bdev}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00430}00430 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00431}00431         \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00432}00432                 device\_printf(self, \textcolor{stringliteral}{"{}XHCI halt/start/probe failed err=\%d\(\backslash\)n"{}}, err);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00433}00433                 \textcolor{keywordflow}{goto} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00434}00434         \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00435}00435         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00436}00436 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00437}00437 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}:}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00438}00438         \mbox{\hyperlink{xhci__pci_8c_a9bf70e0327897f2796353bc947bb325f}{xhci\_pci\_detach}}(self);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00439}00439         \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00440}00440 \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00441}00441 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00442}00442 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00443}\mbox{\hyperlink{xhci__pci_8c_a3c6d7227468e53deeda41d16842646b9}{00443}} \mbox{\hyperlink{xhci__pci_8c_a9bf70e0327897f2796353bc947bb325f}{xhci\_pci\_detach}}(device\_t self)}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00444}00444 \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00445}00445         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = device\_get\_softc(self);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00446}00446 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00447}00447         \textcolor{comment}{/* during module unload there are lots of children leftover */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00448}00448         device\_delete\_children(self);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00449}00449 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00450}00450         \mbox{\hyperlink{usbdi_8h_a828c4d79b0d9b11c8dcb77899a2bffda}{usb\_callout\_drain}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_ab47a64a6d621d0f38bb041b9b13dc9ac}{sc\_callout}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00451}00451         \mbox{\hyperlink{xhci_8c_a4ad6285c04ade6aa120eb6f0f78f2c69}{xhci\_halt\_controller}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00452}00452         \mbox{\hyperlink{xhci_8c_a26c9193aeb19451e1b73d8a46be48f36}{xhci\_reset\_controller}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00453}00453 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00454}00454         pci\_disable\_busmaster(self);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00455}00455 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00456}00456         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_ae2349f0dcbdbf9686b8d4dedadc7a732}{sc\_irq\_res}} \&\& sc-\/>\mbox{\hyperlink{structxhci__softc_a5c214d827fedf185fcd8e1244382440a}{sc\_intr\_hdl}}) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00457}00457                 bus\_teardown\_intr(self, sc-\/>\mbox{\hyperlink{structxhci__softc_ae2349f0dcbdbf9686b8d4dedadc7a732}{sc\_irq\_res}}, sc-\/>\mbox{\hyperlink{structxhci__softc_a5c214d827fedf185fcd8e1244382440a}{sc\_intr\_hdl}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00458}00458                 sc-\/>\mbox{\hyperlink{structxhci__softc_a5c214d827fedf185fcd8e1244382440a}{sc\_intr\_hdl}} = NULL;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00459}00459         \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00460}00460         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_ae2349f0dcbdbf9686b8d4dedadc7a732}{sc\_irq\_res}}) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00461}00461                 bus\_release\_resource(self, SYS\_RES\_IRQ,}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00462}00462                     rman\_get\_rid(sc-\/>\mbox{\hyperlink{structxhci__softc_ae2349f0dcbdbf9686b8d4dedadc7a732}{sc\_irq\_res}}), sc-\/>\mbox{\hyperlink{structxhci__softc_ae2349f0dcbdbf9686b8d4dedadc7a732}{sc\_irq\_res}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00463}00463                 sc-\/>\mbox{\hyperlink{structxhci__softc_ae2349f0dcbdbf9686b8d4dedadc7a732}{sc\_irq\_res}} = NULL;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00464}00464                 pci\_release\_msi(self);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00465}00465         \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00466}00466         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_af7c9be72f17cc6a9e8c803c9f53d6af7}{sc\_msix\_res}} != NULL \&\& sc-\/>\mbox{\hyperlink{structxhci__softc_af7c9be72f17cc6a9e8c803c9f53d6af7}{sc\_msix\_res}} != sc-\/>\mbox{\hyperlink{structxhci__softc_a5db200979e42a04d4d7b4ace677da2de}{sc\_io\_res}}) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00467}00467                 bus\_release\_resource(self, SYS\_RES\_MEMORY,}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00468}00468                     rman\_get\_rid(sc-\/>\mbox{\hyperlink{structxhci__softc_af7c9be72f17cc6a9e8c803c9f53d6af7}{sc\_msix\_res}}), sc-\/>\mbox{\hyperlink{structxhci__softc_af7c9be72f17cc6a9e8c803c9f53d6af7}{sc\_msix\_res}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00469}00469                 sc-\/>\mbox{\hyperlink{structxhci__softc_af7c9be72f17cc6a9e8c803c9f53d6af7}{sc\_msix\_res}} = NULL;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00470}00470         \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00471}00471         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_a5db200979e42a04d4d7b4ace677da2de}{sc\_io\_res}}) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00472}00472                 bus\_release\_resource(self, SYS\_RES\_MEMORY, \mbox{\hyperlink{xhcireg_8h_ad6e30131b3bcc1dc00c99e562ffdf472}{PCI\_XHCI\_CBMEM}},}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00473}00473                     sc-\/>\mbox{\hyperlink{structxhci__softc_a5db200979e42a04d4d7b4ace677da2de}{sc\_io\_res}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00474}00474                 sc-\/>\mbox{\hyperlink{structxhci__softc_a5db200979e42a04d4d7b4ace677da2de}{sc\_io\_res}} = NULL;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00475}00475         \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00476}00476 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00477}00477         \mbox{\hyperlink{xhci_8c_a835ba675fdd367f10b76c0178c1f7ce9}{xhci\_uninit}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00478}00478 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00479}00479         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00480}00480 \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00481}00481 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00482}00482 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00483}\mbox{\hyperlink{xhci__pci_8c_a7de58e4db3aa87f23f06feff14fc7885}{00483}} \mbox{\hyperlink{xhci__pci_8c_a6023ac356092973a7472dca68723b64e}{xhci\_pci\_take\_controller}}(device\_t self)}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00484}00484 \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00485}00485         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = device\_get\_softc(self);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00486}00486         uint32\_t cparams;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00487}00487         uint32\_t eecp;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00488}00488         uint32\_t eec;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00489}00489         uint16\_t to;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00490}00490         uint8\_t bios\_sem;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00491}00491 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00492}00492         cparams = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, capa, \mbox{\hyperlink{xhcireg_8h_a4dc5731fb089b7c91cfa13cf3c62c6b5}{XHCI\_HCSPARAMS0}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00493}00493 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00494}00494         eec = -\/1;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00495}00495 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00496}00496         \textcolor{comment}{/* Synchronise with the BIOS if it owns the controller. */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00497}00497         \textcolor{keywordflow}{for} (eecp = \mbox{\hyperlink{xhcireg_8h_a688e0d926ad9f4bbd14472a204bc3723}{XHCI\_HCS0\_XECP}}(cparams) << 2; eecp != 0 \&\& \mbox{\hyperlink{xhcireg_8h_a60b5e53d5e9bb0cc35c5fc788891063c}{XHCI\_XECP\_NEXT}}(eec);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00498}00498             eecp += \mbox{\hyperlink{xhcireg_8h_a60b5e53d5e9bb0cc35c5fc788891063c}{XHCI\_XECP\_NEXT}}(eec) << 2) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00499}00499                 eec = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, capa, eecp);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00500}00500 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00501}00501                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{xhcireg_8h_aecd60540fa159516a40b9c6c616405c4}{XHCI\_XECP\_ID}}(eec) != \mbox{\hyperlink{xhcireg_8h_ae03bc3ff9fd8e2aa3f1afa5d4b07d290}{XHCI\_ID\_USB\_LEGACY}})}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00502}00502                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00503}00503                 bios\_sem = \mbox{\hyperlink{xhcireg_8h_a0d25503aa95ca95bac42c2d153744987}{XREAD1}}(sc, capa, eecp +}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00504}00504                     \mbox{\hyperlink{xhcireg_8h_aeacf67eba124c2d66aa194e1c38a9b26}{XHCI\_XECP\_BIOS\_SEM}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00505}00505                 \textcolor{keywordflow}{if} (bios\_sem == 0)}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00506}00506                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00507}00507                 device\_printf(sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a50629655e638e1f775df1ed160d3c533}{bdev}}, \textcolor{stringliteral}{"{}waiting for BIOS "{}}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00508}00508                     \textcolor{stringliteral}{"{}to give up control\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00509}00509                 \mbox{\hyperlink{xhcireg_8h_ac915f7085c4a7edfee419941d35533f1}{XWRITE1}}(sc, capa, eecp +}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00510}00510                     \mbox{\hyperlink{xhcireg_8h_a39a71133a2fdf8ec0ff5fef9ffeb360a}{XHCI\_XECP\_OS\_SEM}}, 1);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00511}00511                 to = 500;}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00512}00512                 \textcolor{keywordflow}{while} (1) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00513}00513                         bios\_sem = \mbox{\hyperlink{xhcireg_8h_a0d25503aa95ca95bac42c2d153744987}{XREAD1}}(sc, capa, eecp +}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00514}00514                             \mbox{\hyperlink{xhcireg_8h_aeacf67eba124c2d66aa194e1c38a9b26}{XHCI\_XECP\_BIOS\_SEM}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00515}00515                         \textcolor{keywordflow}{if} (bios\_sem == 0)}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00516}00516                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00517}00517 }
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00518}00518                         \textcolor{keywordflow}{if} (-\/-\/to == 0) \{}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00519}00519                                 device\_printf(sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a50629655e638e1f775df1ed160d3c533}{bdev}},}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00520}00520                                     \textcolor{stringliteral}{"{}timed out waiting for BIOS\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00521}00521                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00522}00522                         \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00523}00523                         \mbox{\hyperlink{usb__util_8c_a7ad9fc3660f5ecf96d72e499cdfeb963}{usb\_pause\_mtx}}(NULL, hz / 100);     \textcolor{comment}{/* wait 10ms */}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00524}00524                 \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00525}00525         \}}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00526}00526         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{xhci__pci_8c_source_l00527}00527 \}}

\end{DoxyCode}
