\hypertarget{xhci_8c_source}{}\doxysection{xhci.\+c}
\label{xhci_8c_source}\index{dev/usb/controller/xhci.c@{dev/usb/controller/xhci.c}}
\mbox{\hyperlink{xhci_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00001}00001 \textcolor{comment}{/* \$FreeBSD\$ */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00002}00002 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00003}00003 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00004}00004 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 2010-\/2022 Hans Petter Selasky}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00007}00007 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00008}00008 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00009}00009 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00010}00010 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00011}00011 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00012}00012 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00013}00013 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00014}00014 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00015}00015 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00016}00016 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00017}00017 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00018}00018 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00019}00019 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00020}00020 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00021}00021 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00022}00022 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00023}00023 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00024}00024 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00025}00025 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00026}00026 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00027}00027 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00028}00028 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00029}00029 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00030}00030 \textcolor{comment}{ * USB eXtensible Host Controller Interface, a.k.a. USB 3.0 controller.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00031}00031 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00032}00032 \textcolor{comment}{ * The XHCI 1.0 spec can be found at}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00033}00033 \textcolor{comment}{ * http://www.intel.com/technology/usb/download/xHCI\_Specification\_for\_USB.pdf}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00034}00034 \textcolor{comment}{ * and the USB 3.0 spec at}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00035}00035 \textcolor{comment}{ * http://www.usb.org/developers/docs/usb\_30\_spec\_060910.zip}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00036}00036 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00037}00037 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00038}00038 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00039}00039 \textcolor{comment}{ * A few words about the design implementation: This driver emulates}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00040}00040 \textcolor{comment}{ * the concept about TDs which is found in EHCI specification. This}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00041}00041 \textcolor{comment}{ * way we achieve that the USB controller drivers look similar to}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00042}00042 \textcolor{comment}{ * eachother which makes it easier to understand the code.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00043}00043 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00044}00044 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00045}00045 \textcolor{preprocessor}{\#ifdef USB\_GLOBAL\_INCLUDE\_FILE}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00046}00046 \textcolor{preprocessor}{\#include USB\_GLOBAL\_INCLUDE\_FILE}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00047}00047 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <sys/stdint.h>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <sys/stddef.h>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00052}00052 \textcolor{preprocessor}{\#include <sys/types.h>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00054}00054 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00055}00055 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00056}00056 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00057}00057 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00058}00058 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00059}00059 \textcolor{preprocessor}{\#include <sys/condvar.h>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00060}00060 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00061}00061 \textcolor{preprocessor}{\#include <sys/sx.h>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00062}00062 \textcolor{preprocessor}{\#include <sys/unistd.h>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00063}00063 \textcolor{preprocessor}{\#include <sys/callout.h>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00064}00064 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00065}00065 \textcolor{preprocessor}{\#include <sys/priv.h>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00066}00066 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00067}00067 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb_8h}{dev/usb/usb.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00068}00068 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usbdi_8h}{dev/usb/usbdi.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00069}00069 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00070}\mbox{\hyperlink{xhci_8c_a927dd6f59caf10a2991dfb564bcbb1e1}{00070}} \textcolor{preprocessor}{\#define USB\_DEBUG\_VAR xhcidebug}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00071}00071 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00072}00072 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__core_8h}{dev/usb/usb\_core.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00073}00073 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__debug_8h}{dev/usb/usb\_debug.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00074}00074 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__busdma_8h}{dev/usb/usb\_busdma.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00075}00075 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__process_8h}{dev/usb/usb\_process.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00076}00076 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__transfer_8h}{dev/usb/usb\_transfer.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00077}00077 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__device_8h}{dev/usb/usb\_device.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00078}00078 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__hub_8h}{dev/usb/usb\_hub.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00079}00079 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__util_8h}{dev/usb/usb\_util.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00080}00080 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00081}00081 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__controller_8h}{dev/usb/usb\_controller.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00082}00082 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__bus_8h}{dev/usb/usb\_bus.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00083}00083 \textcolor{preprocessor}{\#endif                  }\textcolor{comment}{/* USB\_GLOBAL\_INCLUDE\_FILE */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00084}00084 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00085}00085 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{xhci_8h}{dev/usb/controller/xhci.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00086}00086 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{xhcireg_8h}{dev/usb/controller/xhcireg.h}}>}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00087}00087 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00088}\mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{00088}} \textcolor{preprocessor}{\#define XHCI\_BUS2SC(bus) \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00089}00089 \textcolor{preprocessor}{        \_\_containerof(bus, struct xhci\_softc, sc\_bus)}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00090}00090 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00091}\mbox{\hyperlink{xhci_8c_a7282cd159e63bc916b5f3d5b828ff61f}{00091}} \textcolor{preprocessor}{\#define XHCI\_GET\_CTX(sc, which, field, ptr) \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00092}00092 \textcolor{preprocessor}{        ((sc)-\/>sc\_ctx\_is\_64\_byte ? \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00093}00093 \textcolor{preprocessor}{            \&((struct which\#\#64 *)(ptr))-\/>field.ctx : \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00094}00094 \textcolor{preprocessor}{            \&((struct which *)(ptr))-\/>field)}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00095}00095 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00096}\mbox{\hyperlink{xhci_8c_a678a2f37e465fa8bfb4ce67b9e0c3fce}{00096}} \textcolor{keyword}{static} \mbox{\hyperlink{xhci_8c_a678a2f37e465fa8bfb4ce67b9e0c3fce}{SYSCTL\_NODE}}(\_hw\_usb, OID\_AUTO, xhci, CTLFLAG\_RW | CTLFLAG\_MPSAFE, 0,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00097}00097     \textcolor{stringliteral}{"{}USB XHCI"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00098}00098 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00099}\mbox{\hyperlink{xhci_8c_af1d95c2ebda02042f9804bb1d9601ac6}{00099}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{xhci_8c_af1d95c2ebda02042f9804bb1d9601ac6}{xhcistreams}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00100}\mbox{\hyperlink{xhci_8c_a3f0677904c2c21e380e59d3a206b37d9}{00100}} \mbox{\hyperlink{xhci_8c_a3f0677904c2c21e380e59d3a206b37d9}{SYSCTL\_INT}}(\_hw\_usb\_xhci, OID\_AUTO, streams, CTLFLAG\_RWTUN,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00101}00101     \&\mbox{\hyperlink{xhci_8c_af1d95c2ebda02042f9804bb1d9601ac6}{xhcistreams}}, 0, \textcolor{stringliteral}{"{}Set to enable streams mode support"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00102}00102 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00103}\mbox{\hyperlink{xhci_8c_aa182f39a05061278181a021b2264f511}{00103}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{xhci_8c_aa182f39a05061278181a021b2264f511}{xhcictlquirk}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00104}\mbox{\hyperlink{xhci_8c_a8f144f751d7d3a146914b86f08294e5b}{00104}} \mbox{\hyperlink{xhci_8c_a3f0677904c2c21e380e59d3a206b37d9}{SYSCTL\_INT}}(\_hw\_usb\_xhci, OID\_AUTO, ctlquirk, CTLFLAG\_RWTUN,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00105}00105     \&\mbox{\hyperlink{xhci_8c_aa182f39a05061278181a021b2264f511}{xhcictlquirk}}, 0, \textcolor{stringliteral}{"{}Set to enable control endpoint quirk"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00106}00106 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00107}\mbox{\hyperlink{xhci_8c_aad092ea903bd4bb5af8775ac55c28e78}{00107}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{xhci_8c_aad092ea903bd4bb5af8775ac55c28e78}{xhcidcepquirk}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00108}\mbox{\hyperlink{xhci_8c_a2a34270fa21fbf2e13940891c6beb657}{00108}} \mbox{\hyperlink{xhci_8c_a3f0677904c2c21e380e59d3a206b37d9}{SYSCTL\_INT}}(\_hw\_usb\_xhci, OID\_AUTO, dcepquirk, CTLFLAG\_RWTUN,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00109}00109     \&\mbox{\hyperlink{xhci_8c_aad092ea903bd4bb5af8775ac55c28e78}{xhcidcepquirk}}, 0, \textcolor{stringliteral}{"{}Set to disable endpoint deconfigure command"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00110}00110 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00111}00111 \textcolor{preprocessor}{\#ifdef USB\_DEBUG}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00112}00112 \textcolor{keyword}{static} \textcolor{keywordtype}{int} xhcidebug;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00113}00113 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{xhci_8c_a18858e55a37ba1b5ebdf24adf69d4fca}{xhciroute}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00114}00114 \textcolor{keyword}{static} \textcolor{keywordtype}{int} xhcipolling;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00115}00115 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{xhci_8c_a9399ccdd896649b516c33c491b004aab}{xhcidma32}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00116}00116 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{xhci_8c_aa8d8bbfd8f26cc1854c765de6ab341b0}{xhcictlstep}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00117}00117 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00118}00118 \mbox{\hyperlink{xhci_8c_a3f0677904c2c21e380e59d3a206b37d9}{SYSCTL\_INT}}(\_hw\_usb\_xhci, OID\_AUTO, \mbox{\hyperlink{cfumass_8c_ac3e1795766a80ec63b157951b4b9a7d4}{debug}}, CTLFLAG\_RWTUN,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00119}00119     \&xhcidebug, 0, \textcolor{stringliteral}{"{}Debug level"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00120}00120 \mbox{\hyperlink{xhci_8c_a3f0677904c2c21e380e59d3a206b37d9}{SYSCTL\_INT}}(\_hw\_usb\_xhci, OID\_AUTO, xhci\_port\_route, CTLFLAG\_RWTUN,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00121}00121     \&\mbox{\hyperlink{xhci_8c_a18858e55a37ba1b5ebdf24adf69d4fca}{xhciroute}}, 0, \textcolor{stringliteral}{"{}Routing bitmap for switching EHCI ports to the XHCI controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00122}00122 \mbox{\hyperlink{xhci_8c_a3f0677904c2c21e380e59d3a206b37d9}{SYSCTL\_INT}}(\_hw\_usb\_xhci, OID\_AUTO, use\_polling, CTLFLAG\_RWTUN,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00123}00123     \&xhcipolling, 0, \textcolor{stringliteral}{"{}Set to enable software interrupt polling for the XHCI controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00124}00124 \mbox{\hyperlink{xhci_8c_a3f0677904c2c21e380e59d3a206b37d9}{SYSCTL\_INT}}(\_hw\_usb\_xhci, OID\_AUTO, dma32, CTLFLAG\_RWTUN,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00125}00125     \&\mbox{\hyperlink{xhci_8c_a9399ccdd896649b516c33c491b004aab}{xhcidma32}}, 0, \textcolor{stringliteral}{"{}Set to only use 32-\/bit DMA for the XHCI controller"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00126}00126 \mbox{\hyperlink{xhci_8c_a3f0677904c2c21e380e59d3a206b37d9}{SYSCTL\_INT}}(\_hw\_usb\_xhci, OID\_AUTO, ctlstep, CTLFLAG\_RWTUN,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00127}00127     \&\mbox{\hyperlink{xhci_8c_aa8d8bbfd8f26cc1854c765de6ab341b0}{xhcictlstep}}, 0, \textcolor{stringliteral}{"{}Set to enable control endpoint status stage stepping"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00128}00128 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00129}\mbox{\hyperlink{xhci_8c_a18858e55a37ba1b5ebdf24adf69d4fca}{00129}} \textcolor{preprocessor}{\#define xhciroute 0}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00130}\mbox{\hyperlink{xhci_8c_a9399ccdd896649b516c33c491b004aab}{00130}} \textcolor{preprocessor}{\#define xhcidma32 0}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00131}\mbox{\hyperlink{xhci_8c_aa8d8bbfd8f26cc1854c765de6ab341b0}{00131}} \textcolor{preprocessor}{\#define xhcictlstep 0}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00132}00132 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00133}00133 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00134}\mbox{\hyperlink{xhci_8c_aace92486baf2b1ea89acbbd4208458d2}{00134}} \textcolor{preprocessor}{\#define XHCI\_INTR\_ENDPT 1}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00135}00135 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00136}\mbox{\hyperlink{structxhci__std__temp}{00136}} \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__std__temp}{xhci\_std\_temp}} \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00137}\mbox{\hyperlink{structxhci__std__temp_a3c5f08c10a5b2a98578c1343a2d1d453}{00137}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}}     *\mbox{\hyperlink{structxhci__std__temp_a3c5f08c10a5b2a98578c1343a2d1d453}{sc}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00138}\mbox{\hyperlink{structxhci__std__temp_a68bcaf0634e7bc8003aba215fbcca3db}{00138}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__cache}{usb\_page\_cache}}     *\mbox{\hyperlink{structxhci__std__temp_a68bcaf0634e7bc8003aba215fbcca3db}{pc}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00139}\mbox{\hyperlink{structxhci__std__temp_a97640b5f307d3e536d453c14a4affd77}{00139}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__td}{xhci\_td}}           *\mbox{\hyperlink{structxhci__std__temp_a97640b5f307d3e536d453c14a4affd77}{td}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00140}\mbox{\hyperlink{structxhci__std__temp_a9ab0e210ab84dc7b1e7ef7a190807f69}{00140}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__td}{xhci\_td}}           *\mbox{\hyperlink{structxhci__std__temp_a9ab0e210ab84dc7b1e7ef7a190807f69}{td\_next}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00141}\mbox{\hyperlink{structxhci__std__temp_add6b0d8ed853586f60e64b9459fd1e26}{00141}}         uint32\_t                \mbox{\hyperlink{structxhci__std__temp_add6b0d8ed853586f60e64b9459fd1e26}{len}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00142}\mbox{\hyperlink{structxhci__std__temp_a55123af6322a622c819cfb61594134cc}{00142}}         uint32\_t                \mbox{\hyperlink{structxhci__std__temp_a55123af6322a622c819cfb61594134cc}{offset}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00143}\mbox{\hyperlink{structxhci__std__temp_a3f097828c3213bda781076ae2fbca2d2}{00143}}         uint32\_t                \mbox{\hyperlink{structxhci__std__temp_a3f097828c3213bda781076ae2fbca2d2}{max\_packet\_size}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00144}\mbox{\hyperlink{structxhci__std__temp_a416d01cab8353ddcffb73180b6cefb36}{00144}}         uint32\_t                \mbox{\hyperlink{structxhci__std__temp_a416d01cab8353ddcffb73180b6cefb36}{average}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00145}\mbox{\hyperlink{structxhci__std__temp_aa72c74487f0ca9d8950d8da8ee06ac24}{00145}}         uint32\_t                \mbox{\hyperlink{structxhci__std__temp_aa72c74487f0ca9d8950d8da8ee06ac24}{isoc\_frame}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00146}\mbox{\hyperlink{structxhci__std__temp_a0aec911700f80d4c6e75f88e6e38b9e0}{00146}}         uint16\_t                \mbox{\hyperlink{structxhci__std__temp_a0aec911700f80d4c6e75f88e6e38b9e0}{isoc\_delta}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00147}\mbox{\hyperlink{structxhci__std__temp_ae4c55d20a4f917c6f912e5c19d3eeea7}{00147}}         uint8\_t                 \mbox{\hyperlink{structxhci__std__temp_ae4c55d20a4f917c6f912e5c19d3eeea7}{shortpkt}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00148}\mbox{\hyperlink{structxhci__std__temp_a8073e2d949efe0ab7c52c4699b0816d9}{00148}}         uint8\_t                 \mbox{\hyperlink{structxhci__std__temp_a8073e2d949efe0ab7c52c4699b0816d9}{multishort}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00149}\mbox{\hyperlink{structxhci__std__temp_a3443c5aa093ec654f4eba646894fad0b}{00149}}         uint8\_t                 \mbox{\hyperlink{structxhci__std__temp_a3443c5aa093ec654f4eba646894fad0b}{last\_frame}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00150}\mbox{\hyperlink{structxhci__std__temp_a472beaff68e74d92a131cf96f9ca6980}{00150}}         uint8\_t                 \mbox{\hyperlink{structxhci__std__temp_a472beaff68e74d92a131cf96f9ca6980}{trb\_type}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00151}\mbox{\hyperlink{structxhci__std__temp_a7ddf0ca9044a87d90f1e2ff9e638b10e}{00151}}         uint8\_t                 \mbox{\hyperlink{structxhci__std__temp_a7ddf0ca9044a87d90f1e2ff9e638b10e}{direction}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00152}\mbox{\hyperlink{structxhci__std__temp_a940c8282c529ed2045cf59f23baf6d19}{00152}}         uint8\_t                 \mbox{\hyperlink{structxhci__std__temp_a940c8282c529ed2045cf59f23baf6d19}{tbc}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00153}\mbox{\hyperlink{structxhci__std__temp_a6d1e95771a382f5a768300fa1d31f42b}{00153}}         uint8\_t                 \mbox{\hyperlink{structxhci__std__temp_a6d1e95771a382f5a768300fa1d31f42b}{tlbpc}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00154}\mbox{\hyperlink{structxhci__std__temp_a81162b8d3cdd84242fab306cf671199d}{00154}}         uint8\_t                 \mbox{\hyperlink{structxhci__std__temp_a81162b8d3cdd84242fab306cf671199d}{step\_td}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00155}\mbox{\hyperlink{structxhci__std__temp_ac7fad8d4d9d825a7f5e564d5df88f988}{00155}}         uint8\_t                 \mbox{\hyperlink{structxhci__std__temp_ac7fad8d4d9d825a7f5e564d5df88f988}{do\_isoc\_sync}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00156}00156 \};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00157}00157 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00158}00158 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{xhci_8c_aa22a4e89f235d46a713288b1f0dc0257}{xhci\_do\_poll}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__bus}{usb\_bus}} *);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00159}00159 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{xhci_8c_a599f5f1237516bdefbf20695b1f8400c}{xhci\_device\_done}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00160}00160 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{xhci_8c_a31e9863c6b47913bfde367b708bdca5d}{xhci\_root\_intr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00161}00161 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{xhci_8c_a4dc0e10a8aa2b401fa2d24ea6ce12e05}{xhci\_free\_device\_ext}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00162}00162 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__endpoint__ext}{xhci\_endpoint\_ext}} *\mbox{\hyperlink{xhci_8c_af1c3f8bc816768b3a290ad69aafa7af0}{xhci\_get\_endpoint\_ext}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00163}00163                     \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__endpoint__descriptor}{usb\_endpoint\_descriptor}} *);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00164}\mbox{\hyperlink{xhci_8c_a78c5be35a2941f280b4fc373247c2bc4}{00164}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a1ef139097c29321af159f8c11cdaad3d}{usb\_proc\_callback\_t}} \mbox{\hyperlink{xhci_8c_a78c5be35a2941f280b4fc373247c2bc4}{xhci\_configure\_msg}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00165}00165 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{xhci_8c_a3d9f016a4907ccb7c68fb3742c93a0c2}{xhci\_configure\_device}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00166}00166 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{xhci_8c_a256565a843bbdd01a3cc34cddaae615d}{xhci\_configure\_endpoint}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00167}00167                    \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__endpoint__descriptor}{usb\_endpoint\_descriptor}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__endpoint__ext}{xhci\_endpoint\_ext}} *,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00168}00168                    uint16\_t, uint8\_t, uint8\_t, uint8\_t, uint16\_t, uint16\_t,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00169}00169                    uint8\_t);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00170}00170 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{xhci_8c_a2b5fcb1981b6791181beb8c1f7710b10}{xhci\_configure\_mask}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00171}00171                     uint32\_t, uint8\_t);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00172}00172 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{xhci_8c_ab64f4e8f1f9b93086b3453647cd7b8c4}{xhci\_cmd\_evaluate\_ctx}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00173}00173                     uint64\_t, uint8\_t);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00174}00174 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{xhci_8c_aabc890bb66c8517ca8b7475cf04a1a18}{xhci\_endpoint\_doorbell}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00175}00175 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00176}\mbox{\hyperlink{xhci_8c_a51381416e71fbaba56583085b8387582}{00176}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__bus__methods}{usb\_bus\_methods}} \mbox{\hyperlink{xhci_8c_a51381416e71fbaba56583085b8387582}{xhci\_bus\_methods}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00177}00177 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00178}00178 \textcolor{preprocessor}{\#ifdef USB\_DEBUG}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00179}00179 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00180}00180 xhci\_dump\_trb(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__trb}{xhci\_trb}} *trb)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00181}00181 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00182}00182         DPRINTFN(5, \textcolor{stringliteral}{"{}trb = \%p\(\backslash\)n"{}}, trb);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00183}00183         DPRINTFN(5, \textcolor{stringliteral}{"{}qwTrb0 = 0x\%016llx\(\backslash\)n"{}}, (\textcolor{keywordtype}{long} \textcolor{keywordtype}{long})le64toh(trb-\/>\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00184}00184         DPRINTFN(5, \textcolor{stringliteral}{"{}dwTrb2 = 0x\%08x\(\backslash\)n"{}}, le32toh(trb-\/>\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00185}00185         DPRINTFN(5, \textcolor{stringliteral}{"{}dwTrb3 = 0x\%08x\(\backslash\)n"{}}, le32toh(trb-\/>\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00186}00186 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00187}00187 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00188}00188 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00189}00189 xhci\_dump\_endpoint(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__endp__ctx}{xhci\_endp\_ctx}} *pep)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00190}00190 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00191}00191         DPRINTFN(5, \textcolor{stringliteral}{"{}pep = \%p\(\backslash\)n"{}}, pep);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00192}00192         DPRINTFN(5, \textcolor{stringliteral}{"{}dwEpCtx0=0x\%08x\(\backslash\)n"{}}, le32toh(pep-\/>\mbox{\hyperlink{structxhci__endp__ctx_a129e6f08dff2bafd7de6e7288c564f9d}{dwEpCtx0}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00193}00193         DPRINTFN(5, \textcolor{stringliteral}{"{}dwEpCtx1=0x\%08x\(\backslash\)n"{}}, le32toh(pep-\/>\mbox{\hyperlink{structxhci__endp__ctx_aeb8495dd7099cce78c165adfe6106420}{dwEpCtx1}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00194}00194         DPRINTFN(5, \textcolor{stringliteral}{"{}qwEpCtx2=0x\%016llx\(\backslash\)n"{}}, (\textcolor{keywordtype}{long} \textcolor{keywordtype}{long})le64toh(pep-\/>\mbox{\hyperlink{structxhci__endp__ctx_a4df6879017927395713c29dc8630b231}{qwEpCtx2}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00195}00195         DPRINTFN(5, \textcolor{stringliteral}{"{}dwEpCtx4=0x\%08x\(\backslash\)n"{}}, le32toh(pep-\/>\mbox{\hyperlink{structxhci__endp__ctx_ad5be17592f4c3aa83bbc9c86c01fcb1e}{dwEpCtx4}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00196}00196         DPRINTFN(5, \textcolor{stringliteral}{"{}dwEpCtx5=0x\%08x\(\backslash\)n"{}}, le32toh(pep-\/>\mbox{\hyperlink{structxhci__endp__ctx_af41aaa31167a42784bf543ab971faaa0}{dwEpCtx5}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00197}00197         DPRINTFN(5, \textcolor{stringliteral}{"{}dwEpCtx6=0x\%08x\(\backslash\)n"{}}, le32toh(pep-\/>\mbox{\hyperlink{structxhci__endp__ctx_a0d40c357943595f9ba4c3991624a4568}{dwEpCtx6}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00198}00198         DPRINTFN(5, \textcolor{stringliteral}{"{}dwEpCtx7=0x\%08x\(\backslash\)n"{}}, le32toh(pep-\/>\mbox{\hyperlink{structxhci__endp__ctx_a3d5bff9011ef97178754055345c0b8d3}{dwEpCtx7}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00199}00199 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00200}00200 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00201}00201 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00202}00202 xhci\_dump\_device(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__slot__ctx}{xhci\_slot\_ctx}} *psl)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00203}00203 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00204}00204         DPRINTFN(5, \textcolor{stringliteral}{"{}psl = \%p\(\backslash\)n"{}}, psl);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00205}00205         DPRINTFN(5, \textcolor{stringliteral}{"{}dwSctx0=0x\%08x\(\backslash\)n"{}}, le32toh(psl-\/>\mbox{\hyperlink{structxhci__slot__ctx_af595ec29619d74782c73b7e9d09acd3d}{dwSctx0}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00206}00206         DPRINTFN(5, \textcolor{stringliteral}{"{}dwSctx1=0x\%08x\(\backslash\)n"{}}, le32toh(psl-\/>\mbox{\hyperlink{structxhci__slot__ctx_ab2b78cbc1c12874b33eb172c00640cb1}{dwSctx1}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00207}00207         DPRINTFN(5, \textcolor{stringliteral}{"{}dwSctx2=0x\%08x\(\backslash\)n"{}}, le32toh(psl-\/>\mbox{\hyperlink{structxhci__slot__ctx_a8c5c6237514807c125c8bb700f2f9758}{dwSctx2}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00208}00208         DPRINTFN(5, \textcolor{stringliteral}{"{}dwSctx3=0x\%08x\(\backslash\)n"{}}, le32toh(psl-\/>\mbox{\hyperlink{structxhci__slot__ctx_a1655e9d709139cf9bf9701e111c15d0b}{dwSctx3}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00209}00209 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00210}00210 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00211}00211 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00212}00212 uint8\_t}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00213}\mbox{\hyperlink{xhci_8c_a792320a79250bac66a8c52febfda3150}{00213}} \mbox{\hyperlink{xhci_8c_a792320a79250bac66a8c52febfda3150}{xhci\_use\_polling}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00214}00214 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00215}00215 \textcolor{preprocessor}{\#ifdef USB\_DEBUG}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00216}00216         \textcolor{keywordflow}{return} (xhcipolling != 0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00217}00217 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00218}00218         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00219}00219 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00220}00220 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00221}00221 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00222}00222 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00223}\mbox{\hyperlink{xhci_8c_a15914cb5a3da0d74f35c742ba568ef6e}{00223}} \mbox{\hyperlink{xhci_8c_a15914cb5a3da0d74f35c742ba568ef6e}{xhci\_iterate\_hw\_softc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__bus}{usb\_bus}} *bus, \mbox{\hyperlink{usb__controller_8h_ab49538f4f3e99cbc0f4537570b1dd7bb}{usb\_bus\_mem\_sub\_cb\_t}} *cb)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00224}00224 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00225}00225         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(bus);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00226}00226         uint16\_t i;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00227}00227 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00228}00228         cb(bus, \&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_ad3092c299c1ffb37df7c893f89ec88e5}{root\_pc}}, \&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_abda3e2f7d5c73e2d6bbb584dc9b3265e}{root\_pg}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00229}00229            \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__hw__root}{xhci\_hw\_root}}), \mbox{\hyperlink{xhci_8h_ad30aefaae2d4403c5082da7a10c54d21}{XHCI\_PAGE\_SIZE}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00230}00230 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00231}00231         cb(bus, \&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a03fea6135fac6428bcd31c9b80b5969c}{ctx\_pc}}, \&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_abbf2704b7edf4915ecb266adb1ee4ec6}{ctx\_pg}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00232}00232            \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__dev__ctx__addr}{xhci\_dev\_ctx\_addr}}), \mbox{\hyperlink{xhci_8h_ad30aefaae2d4403c5082da7a10c54d21}{XHCI\_PAGE\_SIZE}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00233}00233 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00234}00234         \textcolor{keywordflow}{for} (i = 0; i != sc-\/>\mbox{\hyperlink{structxhci__softc_aa1cc43abb5ad71899ab66ceea9e99a1d}{sc\_noscratch}}; i++) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00235}00235                 cb(bus, \&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a3a153d531b68154300513d84800d4994}{scratch\_pc}}[i], \&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_aeac47bac1c5074c6b437d05d1686a29e}{scratch\_pg}}[i],}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00236}00236                     \mbox{\hyperlink{xhci_8h_ad30aefaae2d4403c5082da7a10c54d21}{XHCI\_PAGE\_SIZE}}, \mbox{\hyperlink{xhci_8h_ad30aefaae2d4403c5082da7a10c54d21}{XHCI\_PAGE\_SIZE}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00237}00237         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00238}00238 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00239}00239 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00240}00240 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00241}\mbox{\hyperlink{xhci_8c_a639e42eb84d1d0cf58a29a6f260ac64d}{00241}} \mbox{\hyperlink{xhci_8c_a639e42eb84d1d0cf58a29a6f260ac64d}{xhci\_reset\_command\_queue\_locked}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00242}00242 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00243}00243         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__search}{usb\_page\_search}} buf\_res;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00244}00244         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__hw__root}{xhci\_hw\_root}} *phwr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00245}00245         uint64\_t addr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00246}00246         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00247}00247 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00248}00248         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00249}00249 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00250}00250         temp = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_ac90d9513cbbcb160fa2438040c919647}{XHCI\_CRCR\_LO}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00251}00251         \textcolor{keywordflow}{if} (temp \& \mbox{\hyperlink{xhcireg_8h_a18cd4b3bf848d6837f50ea5c0cb9b9ed}{XHCI\_CRCR\_LO\_CRR}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00252}00252                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Command ring running\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00253}00253                 temp \&= \string~(\mbox{\hyperlink{xhcireg_8h_a2622341abd8c467d5d3006a77f3bd09f}{XHCI\_CRCR\_LO\_CS}} | \mbox{\hyperlink{xhcireg_8h_a3bb5ca7214d759f15e6c44c38f966e9e}{XHCI\_CRCR\_LO\_CA}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00254}00254 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00255}00255                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00256}00256 \textcolor{comment}{                 * Try to abort the last command as per section}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00257}00257 \textcolor{comment}{                 * 4.6.1.2 "{}Aborting a Command"{} of the XHCI}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00258}00258 \textcolor{comment}{                 * specification:}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00259}00259 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00260}00260 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00261}00261                 \textcolor{comment}{/* stop and cancel */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00262}00262                 \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_ac90d9513cbbcb160fa2438040c919647}{XHCI\_CRCR\_LO}}, temp | \mbox{\hyperlink{xhcireg_8h_a2622341abd8c467d5d3006a77f3bd09f}{XHCI\_CRCR\_LO\_CS}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00263}00263                 \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_ad1f896e47806ae455282e6c9a7e40d5b}{XHCI\_CRCR\_HI}}, 0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00264}00264 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00265}00265                 \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_ac90d9513cbbcb160fa2438040c919647}{XHCI\_CRCR\_LO}}, temp | \mbox{\hyperlink{xhcireg_8h_a3bb5ca7214d759f15e6c44c38f966e9e}{XHCI\_CRCR\_LO\_CA}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00266}00266                 \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_ad1f896e47806ae455282e6c9a7e40d5b}{XHCI\_CRCR\_HI}}, 0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00267}00267 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00268}00268                 \textcolor{comment}{/* wait 250ms */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00269}00269                 \mbox{\hyperlink{usb__util_8c_a7ad9fc3660f5ecf96d72e499cdfeb963}{usb\_pause\_mtx}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a7355d01a9b05ad01972eccabe5747edf}{bus\_mtx}}, hz / 4);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00270}00270 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00271}00271                 \textcolor{comment}{/* check if command ring is still running */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00272}00272                 temp = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_ac90d9513cbbcb160fa2438040c919647}{XHCI\_CRCR\_LO}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00273}00273                 \textcolor{keywordflow}{if} (temp \& \mbox{\hyperlink{xhcireg_8h_a18cd4b3bf848d6837f50ea5c0cb9b9ed}{XHCI\_CRCR\_LO\_CRR}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00274}00274                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Comand ring still running\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00275}00275                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00276}00276                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00277}00277         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00278}00278 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00279}00279         \textcolor{comment}{/* reset command ring */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00280}00280         sc-\/>\mbox{\hyperlink{structxhci__softc_afa9f2c1ced23ffb70a9aff7c67681124}{sc\_command\_ccs}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00281}00281         sc-\/>\mbox{\hyperlink{structxhci__softc_a68c02b0eb3783e457f67e42f2cd18dec}{sc\_command\_idx}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00282}00282 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00283}00283         \mbox{\hyperlink{usb__busdma_8c_ab4f9d07714be540b6d002b44b3716bb2}{usbd\_get\_page}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_ad3092c299c1ffb37df7c893f89ec88e5}{root\_pc}}, 0, \&buf\_res);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00284}00284 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00285}00285         \textcolor{comment}{/* set up command ring control base address */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00286}00286         addr = buf\_res.physaddr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00287}00287         phwr = buf\_res.\mbox{\hyperlink{structusb__page__search_a60cd5ce1bbfbf2d2dec7677b1ba9b01a}{buffer}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00288}00288         addr += \_\_offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__hw__root}{xhci\_hw\_root}}, \mbox{\hyperlink{structxhci__hw__root_ad6adb836ca2f3add145c5942b269c975}{hwr\_commands}}[0]);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00289}00289 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00290}00290         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}CRCR=0x\%016llx\(\backslash\)n"{}}, (\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} \textcolor{keywordtype}{long})addr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00291}00291 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00292}00292         memset(phwr-\/>\mbox{\hyperlink{structxhci__hw__root_ad6adb836ca2f3add145c5942b269c975}{hwr\_commands}}, 0, \textcolor{keyword}{sizeof}(phwr-\/>\mbox{\hyperlink{structxhci__hw__root_ad6adb836ca2f3add145c5942b269c975}{hwr\_commands}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00293}00293         phwr-\/>\mbox{\hyperlink{structxhci__hw__root_ad6adb836ca2f3add145c5942b269c975}{hwr\_commands}}[\mbox{\hyperlink{xhci_8h_ac1e7d87d433a7d957f6984db21b6b24f}{XHCI\_MAX\_COMMANDS}} -\/ 1].\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}} = htole64(addr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00294}00294 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00295}00295         \mbox{\hyperlink{usb__busdma_8h_a988a5299f521e8a8d94a68a03015bd77}{usb\_pc\_cpu\_flush}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_ad3092c299c1ffb37df7c893f89ec88e5}{root\_pc}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00296}00296 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00297}00297         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_ac90d9513cbbcb160fa2438040c919647}{XHCI\_CRCR\_LO}}, ((uint32\_t)addr) | \mbox{\hyperlink{xhcireg_8h_a4d3ffe4c6482cae83c912ad1777278cd}{XHCI\_CRCR\_LO\_RCS}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00298}00298         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_ad1f896e47806ae455282e6c9a7e40d5b}{XHCI\_CRCR\_HI}}, (uint32\_t)(addr >> 32));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00299}00299 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00300}00300         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00301}00301 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00302}00302 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00303}00303 \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00304}\mbox{\hyperlink{xhci_8c_ab493057cb5a03075152f14e3bf8c8e7f}{00304}} \mbox{\hyperlink{xhci_8c_ab493057cb5a03075152f14e3bf8c8e7f}{xhci\_start\_controller}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00305}00305 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00306}00306         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__search}{usb\_page\_search}} buf\_res;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00307}00307         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__hw__root}{xhci\_hw\_root}} *phwr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00308}00308         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__dev__ctx__addr}{xhci\_dev\_ctx\_addr}} *pdctxa;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00309}00309         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00310}00310         uint64\_t addr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00311}00311         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00312}00312         uint16\_t i;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00313}00313 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00314}00314         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00315}00315 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00316}00316         sc-\/>\mbox{\hyperlink{structxhci__softc_ad7ac9452ecbf9500721ebdb7201d2557}{sc\_event\_ccs}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00317}00317         sc-\/>\mbox{\hyperlink{structxhci__softc_a31e830c155c51dd3c4d4c343dcdc05b1}{sc\_event\_idx}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00318}00318         sc-\/>\mbox{\hyperlink{structxhci__softc_afa9f2c1ced23ffb70a9aff7c67681124}{sc\_command\_ccs}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00319}00319         sc-\/>\mbox{\hyperlink{structxhci__softc_a68c02b0eb3783e457f67e42f2cd18dec}{sc\_command\_idx}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00320}00320 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00321}00321         err = \mbox{\hyperlink{xhci_8c_a26c9193aeb19451e1b73d8a46be48f36}{xhci\_reset\_controller}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00322}00322         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00323}00323                 \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00324}00324 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00325}00325         \textcolor{comment}{/* set up number of device slots */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00326}00326         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}CONFIG=0x\%08x -\/> 0x\%08x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00327}00327             \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_a26e4e2cb2ebdb4a4359b84ecdec3faf3}{XHCI\_CONFIG}}), sc-\/>\mbox{\hyperlink{structxhci__softc_a3f2b7f637e15b8e6f00eacfea6ab2c97}{sc\_noslot}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00328}00328 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00329}00329         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_a26e4e2cb2ebdb4a4359b84ecdec3faf3}{XHCI\_CONFIG}}, sc-\/>\mbox{\hyperlink{structxhci__softc_a3f2b7f637e15b8e6f00eacfea6ab2c97}{sc\_noslot}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00330}00330 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00331}00331         temp = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_aac4af15758e601077fbefb4465b0d8d7}{XHCI\_USBSTS}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00332}00332 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00333}00333         \textcolor{comment}{/* clear interrupts */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00334}00334         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_aac4af15758e601077fbefb4465b0d8d7}{XHCI\_USBSTS}}, temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00335}00335         \textcolor{comment}{/* disable all device notifications */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00336}00336         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_a034e24d4522fa3c26ab1ad8771f71179}{XHCI\_DNCTRL}}, 0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00337}00337 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00338}00338         \textcolor{comment}{/* set up device context base address */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00339}00339         \mbox{\hyperlink{usb__busdma_8c_ab4f9d07714be540b6d002b44b3716bb2}{usbd\_get\_page}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a03fea6135fac6428bcd31c9b80b5969c}{ctx\_pc}}, 0, \&buf\_res);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00340}00340         pdctxa = buf\_res.\mbox{\hyperlink{structusb__page__search_a60cd5ce1bbfbf2d2dec7677b1ba9b01a}{buffer}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00341}00341         memset(pdctxa, 0, \textcolor{keyword}{sizeof}(*pdctxa));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00342}00342 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00343}00343         addr = buf\_res.physaddr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00344}00344         addr += \_\_offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__dev__ctx__addr}{xhci\_dev\_ctx\_addr}}, \mbox{\hyperlink{structxhci__dev__ctx__addr_a455eaacb7c2102dd4f53fcab914e8e12}{qwSpBufPtr}}[0]);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00345}00345 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00346}00346         \textcolor{comment}{/* slot 0 points to the table of scratchpad pointers */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00347}00347         pdctxa-\/>\mbox{\hyperlink{structxhci__dev__ctx__addr_a06164d244d319322739083a40f0fe486}{qwBaaDevCtxAddr}}[0] = htole64(addr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00348}00348 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00349}00349         \textcolor{keywordflow}{for} (i = 0; i != sc-\/>\mbox{\hyperlink{structxhci__softc_aa1cc43abb5ad71899ab66ceea9e99a1d}{sc\_noscratch}}; i++) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00350}00350                 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__search}{usb\_page\_search}} buf\_scp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00351}00351                 \mbox{\hyperlink{usb__busdma_8c_ab4f9d07714be540b6d002b44b3716bb2}{usbd\_get\_page}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a3a153d531b68154300513d84800d4994}{scratch\_pc}}[i], 0, \&buf\_scp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00352}00352                 pdctxa-\/>\mbox{\hyperlink{structxhci__dev__ctx__addr_a455eaacb7c2102dd4f53fcab914e8e12}{qwSpBufPtr}}[i] = htole64((uint64\_t)buf\_scp.physaddr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00353}00353         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00354}00354 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00355}00355         addr = buf\_res.physaddr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00356}00356 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00357}00357         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_aa88a74faa5093ac64bf204766f88e7bf}{XHCI\_DCBAAP\_LO}}, (uint32\_t)addr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00358}00358         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_adc344d0ccfd5cbb5ba518c885ad4aa3b}{XHCI\_DCBAAP\_HI}}, (uint32\_t)(addr >> 32));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00359}00359         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_aa88a74faa5093ac64bf204766f88e7bf}{XHCI\_DCBAAP\_LO}}, (uint32\_t)addr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00360}00360         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_adc344d0ccfd5cbb5ba518c885ad4aa3b}{XHCI\_DCBAAP\_HI}}, (uint32\_t)(addr >> 32));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00361}00361 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00362}00362         \textcolor{comment}{/* set up event table size */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00363}00363         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}ERSTSZ=0x\%08x -\/> 0x\%08x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00364}00364             \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, runt, \mbox{\hyperlink{xhcireg_8h_a3ac467a9f8ff1f4fc232e7719fc80a34}{XHCI\_ERSTSZ}}(0)), sc-\/>\mbox{\hyperlink{structxhci__softc_a83151e541fb4105540f50242abe059ee}{sc\_erst\_max}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00365}00365 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00366}00366         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, runt, \mbox{\hyperlink{xhcireg_8h_a3ac467a9f8ff1f4fc232e7719fc80a34}{XHCI\_ERSTSZ}}(0), \mbox{\hyperlink{xhcireg_8h_a9d8826d9da1bb47bc277beb470722170}{XHCI\_ERSTS\_SET}}(sc-\/>\mbox{\hyperlink{structxhci__softc_a83151e541fb4105540f50242abe059ee}{sc\_erst\_max}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00367}00367 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00368}00368         \textcolor{comment}{/* set up interrupt rate */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00369}00369         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, runt, \mbox{\hyperlink{xhcireg_8h_a1dcc5e4d6cd538d2466317e8bf6cbb91}{XHCI\_IMOD}}(0), sc-\/>\mbox{\hyperlink{structxhci__softc_aa0a66ec02f4cdcfa22813fd399547766}{sc\_imod\_default}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00370}00370 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00371}00371         \mbox{\hyperlink{usb__busdma_8c_ab4f9d07714be540b6d002b44b3716bb2}{usbd\_get\_page}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_ad3092c299c1ffb37df7c893f89ec88e5}{root\_pc}}, 0, \&buf\_res);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00372}00372 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00373}00373         phwr = buf\_res.\mbox{\hyperlink{structusb__page__search_a60cd5ce1bbfbf2d2dec7677b1ba9b01a}{buffer}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00374}00374         addr = buf\_res.physaddr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00375}00375         addr += \_\_offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__hw__root}{xhci\_hw\_root}}, hwr\_events[0]);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00376}00376 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00377}00377         \textcolor{comment}{/* reset hardware root structure */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00378}00378         memset(phwr, 0, \textcolor{keyword}{sizeof}(*phwr));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00379}00379 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00380}00380         phwr-\/>\mbox{\hyperlink{structxhci__hw__root_ac0824d2b3ecf98e6468f0b62754c07d1}{hwr\_ring\_seg}}[0].\mbox{\hyperlink{structxhci__event__ring__seg_a918d3383db927bf79ffb27fee1b28b02}{qwEvrsTablePtr}} = htole64(addr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00381}00381         phwr-\/>\mbox{\hyperlink{structxhci__hw__root_ac0824d2b3ecf98e6468f0b62754c07d1}{hwr\_ring\_seg}}[0].\mbox{\hyperlink{structxhci__event__ring__seg_a13083a190ad2b844e5a9d65eef25d684}{dwEvrsTableSize}} = htole32(\mbox{\hyperlink{xhci_8h_a4c38a8b27628fd16ca580b0ace17ae55}{XHCI\_MAX\_EVENTS}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00382}00382 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00383}00383         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00384}00384 \textcolor{comment}{         * PR 237666:}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00385}00385 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00386}00386 \textcolor{comment}{         * According to the XHCI specification, the XWRITE4's to}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00387}00387 \textcolor{comment}{         * XHCI\_ERSTBA\_LO and \_HI lead to the XHCI to copy the}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00388}00388 \textcolor{comment}{         * qwEvrsTablePtr and dwEvrsTableSize values above at that}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00389}00389 \textcolor{comment}{         * time, as the XHCI initializes its event ring support. This}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00390}00390 \textcolor{comment}{         * is before the event ring starts to pay attention to the}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00391}00391 \textcolor{comment}{         * RUN/STOP bit. Thus, make sure the values are observable to}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00392}00392 \textcolor{comment}{         * the XHCI before that point.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00393}00393 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00394}00394         \mbox{\hyperlink{usb__controller_8h_a2f3049b04c9d56b9434a65011f382b44}{usb\_bus\_mem\_flush\_all}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}, \&\mbox{\hyperlink{xhci_8c_a15914cb5a3da0d74f35c742ba568ef6e}{xhci\_iterate\_hw\_softc}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00395}00395 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00396}00396         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}ERDP(0)=0x\%016llx\(\backslash\)n"{}}, (\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} \textcolor{keywordtype}{long})addr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00397}00397 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00398}00398         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, runt, \mbox{\hyperlink{xhcireg_8h_a9d29850de9597ee9387b5827e509066f}{XHCI\_ERDP\_LO}}(0), (uint32\_t)addr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00399}00399         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, runt, \mbox{\hyperlink{xhcireg_8h_ab89bf9fe3d9247a7ea029000a1bfa95e}{XHCI\_ERDP\_HI}}(0), (uint32\_t)(addr >> 32));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00400}00400 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00401}00401         addr = buf\_res.physaddr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00402}00402 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00403}00403         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}ERSTBA(0)=0x\%016llx\(\backslash\)n"{}}, (\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} \textcolor{keywordtype}{long})addr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00404}00404 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00405}00405         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, runt, \mbox{\hyperlink{xhcireg_8h_ad184281c7ae02c8073c8e429284e748c}{XHCI\_ERSTBA\_LO}}(0), (uint32\_t)addr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00406}00406         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, runt, \mbox{\hyperlink{xhcireg_8h_ae2a417902887d2f467b4b99f3ac4d6a6}{XHCI\_ERSTBA\_HI}}(0), (uint32\_t)(addr >> 32));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00407}00407 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00408}00408         \textcolor{comment}{/* set up interrupter registers */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00409}00409         temp = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, runt, \mbox{\hyperlink{xhcireg_8h_a6d4c1a2eb813b6c60026458dc7034526}{XHCI\_IMAN}}(0));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00410}00410         temp |= \mbox{\hyperlink{xhcireg_8h_a57b850d101e7404864e999caf13512b1}{XHCI\_IMAN\_INTR\_ENA}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00411}00411         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, runt, \mbox{\hyperlink{xhcireg_8h_a6d4c1a2eb813b6c60026458dc7034526}{XHCI\_IMAN}}(0), temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00412}00412 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00413}00413         \textcolor{comment}{/* set up command ring control base address */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00414}00414         addr = buf\_res.physaddr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00415}00415         addr += \_\_offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__hw__root}{xhci\_hw\_root}}, hwr\_commands[0]);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00416}00416 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00417}00417         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}CRCR=0x\%016llx\(\backslash\)n"{}}, (\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} \textcolor{keywordtype}{long})addr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00418}00418 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00419}00419         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_ac90d9513cbbcb160fa2438040c919647}{XHCI\_CRCR\_LO}}, ((uint32\_t)addr) | \mbox{\hyperlink{xhcireg_8h_a4d3ffe4c6482cae83c912ad1777278cd}{XHCI\_CRCR\_LO\_RCS}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00420}00420         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_ad1f896e47806ae455282e6c9a7e40d5b}{XHCI\_CRCR\_HI}}, (uint32\_t)(addr >> 32));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00421}00421 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00422}00422         phwr-\/>\mbox{\hyperlink{structxhci__hw__root_ad6adb836ca2f3add145c5942b269c975}{hwr\_commands}}[\mbox{\hyperlink{xhci_8h_ac1e7d87d433a7d957f6984db21b6b24f}{XHCI\_MAX\_COMMANDS}} -\/ 1].\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}} = htole64(addr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00423}00423 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00424}00424         \mbox{\hyperlink{usb__controller_8h_a2f3049b04c9d56b9434a65011f382b44}{usb\_bus\_mem\_flush\_all}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}, \&\mbox{\hyperlink{xhci_8c_a15914cb5a3da0d74f35c742ba568ef6e}{xhci\_iterate\_hw\_softc}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00425}00425 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00426}00426         \textcolor{comment}{/* Go! */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00427}00427         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_a1d6d2838b0a4b24cd4067572523ee346}{XHCI\_USBCMD}}, \mbox{\hyperlink{xhcireg_8h_a1e13f11c24817d264c199ee4714ec13b}{XHCI\_CMD\_RS}} |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00428}00428             \mbox{\hyperlink{xhcireg_8h_aff9c6d6c7a2f437c79cd18b9e2645dd7}{XHCI\_CMD\_INTE}} | \mbox{\hyperlink{xhcireg_8h_a5072372af7147a9494b45445a2679786}{XHCI\_CMD\_HSEE}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00429}00429 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00430}00430         \textcolor{keywordflow}{for} (i = 0; i != 100; i++) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00431}00431                 \mbox{\hyperlink{usb__util_8c_a7ad9fc3660f5ecf96d72e499cdfeb963}{usb\_pause\_mtx}}(NULL, hz / 100);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00432}00432                 temp = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_aac4af15758e601077fbefb4465b0d8d7}{XHCI\_USBSTS}}) \& \mbox{\hyperlink{xhcireg_8h_a0388c1acea4a4b50c5a61ebde8df68b0}{XHCI\_STS\_HCH}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00433}00433                 \textcolor{keywordflow}{if} (!temp)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00434}00434                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00435}00435         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00436}00436         \textcolor{keywordflow}{if} (temp) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00437}00437                 \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_a1d6d2838b0a4b24cd4067572523ee346}{XHCI\_USBCMD}}, 0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00438}00438                 device\_printf(sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a7855a7fc5c4b3f5289323c7743c6a975}{parent}}, \textcolor{stringliteral}{"{}Run timeout.\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00439}00439                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00440}00440         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00441}00441 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00442}00442         \textcolor{comment}{/* catch any lost interrupts */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00443}00443         \mbox{\hyperlink{xhci_8c_aa22a4e89f235d46a713288b1f0dc0257}{xhci\_do\_poll}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00444}00444 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00445}00445         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_a211c39599cd0592a5e9f1a8d76ae9704}{sc\_port\_route}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00446}00446                 \textcolor{comment}{/* Route all ports to the XHCI by default */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00447}00447                 sc-\/>\mbox{\hyperlink{structxhci__softc_a211c39599cd0592a5e9f1a8d76ae9704}{sc\_port\_route}}(sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a7855a7fc5c4b3f5289323c7743c6a975}{parent}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00448}00448                     \string~\mbox{\hyperlink{xhci_8c_a18858e55a37ba1b5ebdf24adf69d4fca}{xhciroute}}, \mbox{\hyperlink{xhci_8c_a18858e55a37ba1b5ebdf24adf69d4fca}{xhciroute}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00449}00449         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00450}00450         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00451}00451 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00452}00452 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00453}00453 \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00454}\mbox{\hyperlink{xhci_8c_a4ad6285c04ade6aa120eb6f0f78f2c69}{00454}} \mbox{\hyperlink{xhci_8c_a4ad6285c04ade6aa120eb6f0f78f2c69}{xhci\_halt\_controller}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00455}00455 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00456}00456         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00457}00457         uint16\_t i;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00458}00458 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00459}00459         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00460}00460 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00461}00461         sc-\/>\mbox{\hyperlink{structxhci__softc_a7ea6ab0ee6444e9381661ee43d1187f3}{sc\_capa\_off}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00462}00462         sc-\/>\mbox{\hyperlink{structxhci__softc_a815535a8a9187fd66a153bc24dbe11e6}{sc\_oper\_off}} = \mbox{\hyperlink{xhcireg_8h_a0d25503aa95ca95bac42c2d153744987}{XREAD1}}(sc, capa, \mbox{\hyperlink{xhcireg_8h_a9eb421accfa3703cbd3cc412cb4c248a}{XHCI\_CAPLENGTH}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00463}00463         sc-\/>\mbox{\hyperlink{structxhci__softc_a694e994dbb5c25918734713a19f463bb}{sc\_runt\_off}} = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, capa, \mbox{\hyperlink{xhcireg_8h_a2419137254c9e37d5225f136751dcbfa}{XHCI\_RTSOFF}}) \& \string~0xF;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00464}00464         sc-\/>\mbox{\hyperlink{structxhci__softc_a095fa35477324a1429a23533784c8517}{sc\_door\_off}} = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, capa, \mbox{\hyperlink{xhcireg_8h_aa78159a18783ebe5c4ccb1ad666a5658}{XHCI\_DBOFF}}) \& \string~0x3;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00465}00465 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00466}00466         \textcolor{comment}{/* Halt controller */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00467}00467         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_a1d6d2838b0a4b24cd4067572523ee346}{XHCI\_USBCMD}}, 0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00468}00468 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00469}00469         \textcolor{keywordflow}{for} (i = 0; i != 100; i++) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00470}00470                 \mbox{\hyperlink{usb__util_8c_a7ad9fc3660f5ecf96d72e499cdfeb963}{usb\_pause\_mtx}}(NULL, hz / 100);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00471}00471                 temp = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_aac4af15758e601077fbefb4465b0d8d7}{XHCI\_USBSTS}}) \& \mbox{\hyperlink{xhcireg_8h_a0388c1acea4a4b50c5a61ebde8df68b0}{XHCI\_STS\_HCH}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00472}00472                 \textcolor{keywordflow}{if} (temp)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00473}00473                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00474}00474         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00475}00475 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00476}00476         \textcolor{keywordflow}{if} (!temp) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00477}00477                 device\_printf(sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a7855a7fc5c4b3f5289323c7743c6a975}{parent}}, \textcolor{stringliteral}{"{}Controller halt timeout.\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00478}00478                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00479}00479         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00480}00480         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00481}00481 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00482}00482 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00483}00483 \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00484}\mbox{\hyperlink{xhci_8c_a26c9193aeb19451e1b73d8a46be48f36}{00484}} \mbox{\hyperlink{xhci_8c_a26c9193aeb19451e1b73d8a46be48f36}{xhci\_reset\_controller}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00485}00485 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00486}00486         uint32\_t temp = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00487}00487         uint16\_t i;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00488}00488 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00489}00489         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00490}00490 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00491}00491         \textcolor{comment}{/* Reset controller */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00492}00492         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_a1d6d2838b0a4b24cd4067572523ee346}{XHCI\_USBCMD}}, \mbox{\hyperlink{xhcireg_8h_ad2a59ed3421ba1e51afd3ee773879b85}{XHCI\_CMD\_HCRST}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00493}00493 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00494}00494         \textcolor{keywordflow}{for} (i = 0; i != 100; i++) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00495}00495                 \mbox{\hyperlink{usb__util_8c_a7ad9fc3660f5ecf96d72e499cdfeb963}{usb\_pause\_mtx}}(NULL, hz / 100);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00496}00496                 temp = (\mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_a1d6d2838b0a4b24cd4067572523ee346}{XHCI\_USBCMD}}) \& \mbox{\hyperlink{xhcireg_8h_ad2a59ed3421ba1e51afd3ee773879b85}{XHCI\_CMD\_HCRST}}) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00497}00497                     (\mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_aac4af15758e601077fbefb4465b0d8d7}{XHCI\_USBSTS}}) \& \mbox{\hyperlink{xhcireg_8h_af132c9d4d7fa59c09448301919db3e39}{XHCI\_STS\_CNR}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00498}00498                 \textcolor{keywordflow}{if} (!temp)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00499}00499                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00500}00500         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00501}00501 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00502}00502         \textcolor{keywordflow}{if} (temp) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00503}00503                 device\_printf(sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a7855a7fc5c4b3f5289323c7743c6a975}{parent}}, \textcolor{stringliteral}{"{}Controller "{}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00504}00504                     \textcolor{stringliteral}{"{}reset timeout.\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00505}00505                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00506}00506         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00507}00507         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00508}00508 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00509}00509 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00510}00510 \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00511}\mbox{\hyperlink{xhci_8c_a064d5971b294586b6c68154ba681cd12}{00511}} \mbox{\hyperlink{xhci_8c_a064d5971b294586b6c68154ba681cd12}{xhci\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc, device\_t self, uint8\_t dma32)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00512}00512 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00513}00513         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00514}00514 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00515}00515         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00516}00516 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00517}00517         \textcolor{comment}{/* initialize some bus fields */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00518}00518         sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a7855a7fc5c4b3f5289323c7743c6a975}{parent}} = self;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00519}00519 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00520}00520         \textcolor{comment}{/* set the bus revision */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00521}00521         sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a333d9234cb56ddeb93ac0625c3d48252}{usbrev}} = \mbox{\hyperlink{usb_8h_ad11f3f35a7768f59a4f69ad460a7661fa820aa09d9c56cb3196d5adb61918db1f}{USB\_REV\_3\_0}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00522}00522 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00523}00523         \textcolor{comment}{/* set up the bus struct */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00524}00524         sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a81450db76aab5d75bdc5a8a67b2d0939}{methods}} = \&\mbox{\hyperlink{xhci_8c_a51381416e71fbaba56583085b8387582}{xhci\_bus\_methods}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00525}00525 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00526}00526         \textcolor{comment}{/* set up devices array */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00527}00527         sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a9412f3e10804046f19d5e8ab00a38b59}{devices}} = sc-\/>\mbox{\hyperlink{structxhci__softc_a759bff1f4ca18101ee48e28dc013c137}{sc\_devices}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00528}00528         sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_ac665d059dd509782705e2eb35fdc9c58}{devices\_max}} = \mbox{\hyperlink{xhci_8h_a2b2516e724c30cdbc16fcb8e16e92228}{XHCI\_MAX\_DEVICES}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00529}00529 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00530}00530         \textcolor{comment}{/* set default cycle state in case of early interrupts */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00531}00531         sc-\/>\mbox{\hyperlink{structxhci__softc_ad7ac9452ecbf9500721ebdb7201d2557}{sc\_event\_ccs}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00532}00532         sc-\/>\mbox{\hyperlink{structxhci__softc_afa9f2c1ced23ffb70a9aff7c67681124}{sc\_command\_ccs}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00533}00533 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00534}00534         \textcolor{comment}{/* set up bus space offsets */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00535}00535         sc-\/>\mbox{\hyperlink{structxhci__softc_a7ea6ab0ee6444e9381661ee43d1187f3}{sc\_capa\_off}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00536}00536         sc-\/>\mbox{\hyperlink{structxhci__softc_a815535a8a9187fd66a153bc24dbe11e6}{sc\_oper\_off}} = \mbox{\hyperlink{xhcireg_8h_a0d25503aa95ca95bac42c2d153744987}{XREAD1}}(sc, capa, \mbox{\hyperlink{xhcireg_8h_a9eb421accfa3703cbd3cc412cb4c248a}{XHCI\_CAPLENGTH}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00537}00537         sc-\/>\mbox{\hyperlink{structxhci__softc_a694e994dbb5c25918734713a19f463bb}{sc\_runt\_off}} = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, capa, \mbox{\hyperlink{xhcireg_8h_a2419137254c9e37d5225f136751dcbfa}{XHCI\_RTSOFF}}) \& \string~0x1F;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00538}00538         sc-\/>\mbox{\hyperlink{structxhci__softc_a095fa35477324a1429a23533784c8517}{sc\_door\_off}} = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, capa, \mbox{\hyperlink{xhcireg_8h_aa78159a18783ebe5c4ccb1ad666a5658}{XHCI\_DBOFF}}) \& \string~0x3;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00539}00539 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00540}00540         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}CAPLENGTH=0x\%x\(\backslash\)n"{}}, sc-\/>\mbox{\hyperlink{structxhci__softc_a815535a8a9187fd66a153bc24dbe11e6}{sc\_oper\_off}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00541}00541         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}RUNTIMEOFFSET=0x\%x\(\backslash\)n"{}}, sc-\/>\mbox{\hyperlink{structxhci__softc_a694e994dbb5c25918734713a19f463bb}{sc\_runt\_off}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00542}00542         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}DOOROFFSET=0x\%x\(\backslash\)n"{}}, sc-\/>\mbox{\hyperlink{structxhci__softc_a095fa35477324a1429a23533784c8517}{sc\_door\_off}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00543}00543 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00544}00544         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}xHCI version = 0x\%04x\(\backslash\)n"{}}, \mbox{\hyperlink{xhcireg_8h_a44e65597cfebc9361f35d65f66a92d32}{XREAD2}}(sc, capa, \mbox{\hyperlink{xhcireg_8h_ac0e3294d2230f4cf1c8343bc6cea3e6c}{XHCI\_HCIVERSION}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00545}00545 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00546}00546         \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_a58eca7c7aeecb3b2041c78d324958d5c}{XHCI\_PAGESIZE}}) \& \mbox{\hyperlink{xhcireg_8h_af216d2cc0c27b7cbd5bf0d243fedd7f5}{XHCI\_PAGESIZE\_4K}})) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00547}00547                 device\_printf(sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a7855a7fc5c4b3f5289323c7743c6a975}{parent}}, \textcolor{stringliteral}{"{}Controller does "{}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00548}00548                     \textcolor{stringliteral}{"{}not support 4K page size.\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00549}00549                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00550}00550         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00551}00551 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00552}00552         temp = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, capa, \mbox{\hyperlink{xhcireg_8h_a4dc5731fb089b7c91cfa13cf3c62c6b5}{XHCI\_HCSPARAMS0}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00553}00553 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00554}00554         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}HCS0 = 0x\%08x\(\backslash\)n"{}}, temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00555}00555 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00556}00556         \textcolor{comment}{/* set up context size */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00557}00557         \textcolor{keywordflow}{if} (\mbox{\hyperlink{xhcireg_8h_a2dedde0ccc57f632c7c0f49a8c4fc878}{XHCI\_HCS0\_CSZ}}(temp)) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00558}00558                 sc-\/>\mbox{\hyperlink{structxhci__softc_abfa50efdcd8dcd891372a6bafb5e5615}{sc\_ctx\_is\_64\_byte}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00559}00559         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00560}00560                 sc-\/>\mbox{\hyperlink{structxhci__softc_abfa50efdcd8dcd891372a6bafb5e5615}{sc\_ctx\_is\_64\_byte}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00561}00561         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00562}00562 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00563}00563         \textcolor{comment}{/* get DMA bits */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00564}00564         sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_af7cf6d04a3d928e28be8825b637fab68}{dma\_bits}} = (\mbox{\hyperlink{xhcireg_8h_a56610946618533c9dd1f282b8f2f531e}{XHCI\_HCS0\_AC64}}(temp) \&\&}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00565}00565             \mbox{\hyperlink{xhci_8c_a9399ccdd896649b516c33c491b004aab}{xhcidma32}} == 0 \&\& dma32 == 0) ? 64 : 32;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00566}00566 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00567}00567         device\_printf(self, \textcolor{stringliteral}{"{}\%d bytes context size, \%d-\/bit DMA\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00568}00568             sc-\/>\mbox{\hyperlink{structxhci__softc_abfa50efdcd8dcd891372a6bafb5e5615}{sc\_ctx\_is\_64\_byte}} ? 64 : 32, (\textcolor{keywordtype}{int})sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_af7cf6d04a3d928e28be8825b637fab68}{dma\_bits}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00569}00569 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00570}00570         \textcolor{comment}{/* enable 64Kbyte control endpoint quirk */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00571}00571         sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_ac655af036d8a6d28592b8ad645265f70}{control\_ep\_quirk}} = (\mbox{\hyperlink{xhci_8c_aa182f39a05061278181a021b2264f511}{xhcictlquirk}} ? 1 : 0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00572}00572 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00573}00573         temp = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, capa, \mbox{\hyperlink{xhcireg_8h_abe894882caf19ae9166ec01f62a8c04a}{XHCI\_HCSPARAMS1}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00574}00574 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00575}00575         \textcolor{comment}{/* get number of device slots */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00576}00576         sc-\/>\mbox{\hyperlink{structxhci__softc_aee3ef1fdb126d4c5e6f41099fc63c5ea}{sc\_noport}} = \mbox{\hyperlink{xhcireg_8h_ad5a7839d67ed3df6302229a037783fbc}{XHCI\_HCS1\_N\_PORTS}}(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00577}00577 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00578}00578         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_aee3ef1fdb126d4c5e6f41099fc63c5ea}{sc\_noport}} == 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00579}00579                 device\_printf(sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a7855a7fc5c4b3f5289323c7743c6a975}{parent}}, \textcolor{stringliteral}{"{}Invalid number "{}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00580}00580                     \textcolor{stringliteral}{"{}of ports: \%u\(\backslash\)n"{}}, sc-\/>\mbox{\hyperlink{structxhci__softc_aee3ef1fdb126d4c5e6f41099fc63c5ea}{sc\_noport}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00581}00581                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00582}00582         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00583}00583 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00584}00584         sc-\/>\mbox{\hyperlink{structxhci__softc_aee3ef1fdb126d4c5e6f41099fc63c5ea}{sc\_noport}} = sc-\/>\mbox{\hyperlink{structxhci__softc_aee3ef1fdb126d4c5e6f41099fc63c5ea}{sc\_noport}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00585}00585         sc-\/>\mbox{\hyperlink{structxhci__softc_a3f2b7f637e15b8e6f00eacfea6ab2c97}{sc\_noslot}} = \mbox{\hyperlink{xhcireg_8h_ade1a03e3249532249360050c8923cc06}{XHCI\_HCS1\_DEVSLOT\_MAX}}(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00586}00586 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00587}00587         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Max slots: \%u\(\backslash\)n"{}}, sc-\/>\mbox{\hyperlink{structxhci__softc_a3f2b7f637e15b8e6f00eacfea6ab2c97}{sc\_noslot}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00588}00588 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00589}00589         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_a3f2b7f637e15b8e6f00eacfea6ab2c97}{sc\_noslot}} > \mbox{\hyperlink{xhci_8h_a2b2516e724c30cdbc16fcb8e16e92228}{XHCI\_MAX\_DEVICES}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00590}00590                 sc-\/>\mbox{\hyperlink{structxhci__softc_a3f2b7f637e15b8e6f00eacfea6ab2c97}{sc\_noslot}} = \mbox{\hyperlink{xhci_8h_a2b2516e724c30cdbc16fcb8e16e92228}{XHCI\_MAX\_DEVICES}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00591}00591 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00592}00592         temp = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, capa, \mbox{\hyperlink{xhcireg_8h_a6835159e3a6e9944b5a0ce49e0c9a514}{XHCI\_HCSPARAMS2}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00593}00593 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00594}00594         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}HCS2=0x\%08x\(\backslash\)n"{}}, temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00595}00595 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00596}00596         \textcolor{comment}{/* get isochronous scheduling threshold */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00597}00597         sc-\/>\mbox{\hyperlink{structxhci__softc_a1470713117661f8dac211925d11ba183}{sc\_ist}} = \mbox{\hyperlink{xhcireg_8h_afb7d2a1d25d30ddedc2c9ab9eda25b08}{XHCI\_HCS2\_IST}}(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00598}00598 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00599}00599         \textcolor{comment}{/* get number of scratchpads */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00600}00600         sc-\/>\mbox{\hyperlink{structxhci__softc_aa1cc43abb5ad71899ab66ceea9e99a1d}{sc\_noscratch}} = \mbox{\hyperlink{xhcireg_8h_ae7f7ce7b9abe19f6a432da3a1e081955}{XHCI\_HCS2\_SPB\_MAX}}(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00601}00601 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00602}00602         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_aa1cc43abb5ad71899ab66ceea9e99a1d}{sc\_noscratch}} > \mbox{\hyperlink{xhci_8h_a4e0192861840236a940b6bc11e23cc1a}{XHCI\_MAX\_SCRATCHPADS}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00603}00603                 device\_printf(sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a7855a7fc5c4b3f5289323c7743c6a975}{parent}}, \textcolor{stringliteral}{"{}XHCI request "{}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00604}00604                     \textcolor{stringliteral}{"{}too many scratchpads\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00605}00605                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00606}00606         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00607}00607 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00608}00608         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Max scratch: \%u\(\backslash\)n"{}}, sc-\/>\mbox{\hyperlink{structxhci__softc_aa1cc43abb5ad71899ab66ceea9e99a1d}{sc\_noscratch}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00609}00609 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00610}00610         \textcolor{comment}{/* get event table size */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00611}00611         sc-\/>\mbox{\hyperlink{structxhci__softc_a83151e541fb4105540f50242abe059ee}{sc\_erst\_max}} = 1U << \mbox{\hyperlink{xhcireg_8h_a150598a334f942b8701fe55ff5fa52d1}{XHCI\_HCS2\_ERST\_MAX}}(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00612}00612         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_a83151e541fb4105540f50242abe059ee}{sc\_erst\_max}} > \mbox{\hyperlink{xhci_8h_a80fd32c89c224419e497355b6636aa8a}{XHCI\_MAX\_RSEG}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00613}00613                 sc-\/>\mbox{\hyperlink{structxhci__softc_a83151e541fb4105540f50242abe059ee}{sc\_erst\_max}} = \mbox{\hyperlink{xhci_8h_a80fd32c89c224419e497355b6636aa8a}{XHCI\_MAX\_RSEG}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00614}00614 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00615}00615         temp = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, capa, \mbox{\hyperlink{xhcireg_8h_a4c4760835948e3fc08c3f31a4820deca}{XHCI\_HCSPARAMS3}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00616}00616 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00617}00617         \textcolor{comment}{/* get maximum exit latency */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00618}00618         sc-\/>\mbox{\hyperlink{structxhci__softc_a58cae568b6a8cf886ffc16cee2b89b43}{sc\_exit\_lat\_max}} = \mbox{\hyperlink{xhcireg_8h_aaa6bc83b8c8c4b364c1c985e37707219}{XHCI\_HCS3\_U1\_DEL}}(temp) +}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00619}00619             \mbox{\hyperlink{xhcireg_8h_a28e901909c9b51d42b6c0f3b3afdd337}{XHCI\_HCS3\_U2\_DEL}}(temp) + 250 \textcolor{comment}{/* us */};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00620}00620 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00621}00621         \textcolor{comment}{/* Check if we should use the default IMOD value. */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00622}00622         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_aa0a66ec02f4cdcfa22813fd399547766}{sc\_imod\_default}} == 0)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00623}00623                 sc-\/>\mbox{\hyperlink{structxhci__softc_aa0a66ec02f4cdcfa22813fd399547766}{sc\_imod\_default}} = \mbox{\hyperlink{xhcireg_8h_a1f640a535167c7709ee66dc690363052}{XHCI\_IMOD\_DEFAULT}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00624}00624 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00625}00625         \textcolor{comment}{/* get all DMA memory */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00626}00626         \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__controller_8c_a736f5aa67bd8014944a1dc24fbf3fbb5}{usb\_bus\_mem\_alloc\_all}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00627}00627             \mbox{\hyperlink{usb__busdma_8h_acec0356df4d4a6905c59303652de41ad}{USB\_GET\_DMA\_TAG}}(self), \&\mbox{\hyperlink{xhci_8c_a15914cb5a3da0d74f35c742ba568ef6e}{xhci\_iterate\_hw\_softc}})) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00628}00628                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00629}00629         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00630}00630 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00631}00631         \textcolor{comment}{/* set up command queue mutex and condition varible */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00632}00632         cv\_init(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a497ea89372e7a70ccf9b6292e0d4a373}{sc\_cmd\_cv}}, \textcolor{stringliteral}{"{}CMDQ"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00633}00633         sx\_init(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a712693add33b77bfabffd4c71fd615eb}{sc\_cmd\_sx}}, \textcolor{stringliteral}{"{}CMDQ lock"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00634}00634 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00635}00635         sc-\/>\mbox{\hyperlink{structxhci__softc_a713afcfe3bcc8d061211f946ec6b36cc}{sc\_config\_msg}}[0].\mbox{\hyperlink{structusb__bus__msg_a58d8fb00571bfdcd3afb6a584baa6193}{hdr}}.\mbox{\hyperlink{structusb__proc__msg_a3ef3a62c9c45df2eca4677c43eb0e1a0}{pm\_callback}} = \&\mbox{\hyperlink{xhci_8c_a78c5be35a2941f280b4fc373247c2bc4}{xhci\_configure\_msg}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00636}00636         sc-\/>\mbox{\hyperlink{structxhci__softc_a713afcfe3bcc8d061211f946ec6b36cc}{sc\_config\_msg}}[0].\mbox{\hyperlink{structusb__bus__msg_a49e7ef076b49c9407a48f36c65ed4b39}{bus}} = \&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00637}00637         sc-\/>\mbox{\hyperlink{structxhci__softc_a713afcfe3bcc8d061211f946ec6b36cc}{sc\_config\_msg}}[1].\mbox{\hyperlink{structusb__bus__msg_a58d8fb00571bfdcd3afb6a584baa6193}{hdr}}.\mbox{\hyperlink{structusb__proc__msg_a3ef3a62c9c45df2eca4677c43eb0e1a0}{pm\_callback}} = \&\mbox{\hyperlink{xhci_8c_a78c5be35a2941f280b4fc373247c2bc4}{xhci\_configure\_msg}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00638}00638         sc-\/>\mbox{\hyperlink{structxhci__softc_a713afcfe3bcc8d061211f946ec6b36cc}{sc\_config\_msg}}[1].\mbox{\hyperlink{structusb__bus__msg_a49e7ef076b49c9407a48f36c65ed4b39}{bus}} = \&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00639}00639 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00640}00640         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00641}00641 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00642}00642 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00643}00643 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00644}\mbox{\hyperlink{xhci_8c_a835ba675fdd367f10b76c0178c1f7ce9}{00644}} \mbox{\hyperlink{xhci_8c_a835ba675fdd367f10b76c0178c1f7ce9}{xhci\_uninit}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00645}00645 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00646}00646         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00647}00647 \textcolor{comment}{         * NOTE: At this point the control transfer process is gone}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00648}00648 \textcolor{comment}{         * and "{}xhci\_configure\_msg"{} is no longer called. Consequently}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00649}00649 \textcolor{comment}{         * waiting for the configuration messages to complete is not}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00650}00650 \textcolor{comment}{         * needed.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00651}00651 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00652}00652         \mbox{\hyperlink{usb__controller_8c_a0a85a587a062a4af3f1df6fc298a02b2}{usb\_bus\_mem\_free\_all}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}, \&\mbox{\hyperlink{xhci_8c_a15914cb5a3da0d74f35c742ba568ef6e}{xhci\_iterate\_hw\_softc}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00653}00653 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00654}00654         cv\_destroy(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a497ea89372e7a70ccf9b6292e0d4a373}{sc\_cmd\_cv}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00655}00655         sx\_destroy(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a712693add33b77bfabffd4c71fd615eb}{sc\_cmd\_sx}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00656}00656 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00657}00657 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00658}00658 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00659}\mbox{\hyperlink{xhci_8c_a4a434aa128f347b0f879c4067f7cb1c6}{00659}} \mbox{\hyperlink{xhci_8c_a4a434aa128f347b0f879c4067f7cb1c6}{xhci\_set\_hw\_power\_sleep}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__bus}{usb\_bus}} *bus, uint32\_t state)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00660}00660 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00661}00661         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(bus);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00662}00662 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00663}00663         \textcolor{keywordflow}{switch} (state) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00664}00664         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__controller_8h_a7059f3b2b6c2ad966a4c72fc57b72de1}{USB\_HW\_POWER\_SUSPEND}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00665}00665                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Stopping the XHCI\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00666}00666                 \mbox{\hyperlink{xhci_8c_a4ad6285c04ade6aa120eb6f0f78f2c69}{xhci\_halt\_controller}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00667}00667                 \mbox{\hyperlink{xhci_8c_a26c9193aeb19451e1b73d8a46be48f36}{xhci\_reset\_controller}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00668}00668                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00669}00669         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__controller_8h_a9bf3bc2863030915ae241b50188c8f21}{USB\_HW\_POWER\_SHUTDOWN}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00670}00670                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Stopping the XHCI\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00671}00671                 \mbox{\hyperlink{xhci_8c_a4ad6285c04ade6aa120eb6f0f78f2c69}{xhci\_halt\_controller}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00672}00672                 \mbox{\hyperlink{xhci_8c_a26c9193aeb19451e1b73d8a46be48f36}{xhci\_reset\_controller}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00673}00673                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00674}00674         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__controller_8h_a13be95e61855e5fddce8004288a740ca}{USB\_HW\_POWER\_RESUME}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00675}00675                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Starting the XHCI\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00676}00676                 \mbox{\hyperlink{xhci_8c_ab493057cb5a03075152f14e3bf8c8e7f}{xhci\_start\_controller}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00677}00677                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00678}00678         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00679}00679                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00680}00680         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00681}00681 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00682}00682 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00683}00683 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00684}\mbox{\hyperlink{xhci_8c_abf6301458e1be0fed9b7001a011d3fc3}{00684}} \mbox{\hyperlink{xhci_8c_abf6301458e1be0fed9b7001a011d3fc3}{xhci\_generic\_done\_sub}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00685}00685 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00686}00686         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__td}{xhci\_td}} *td;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00687}00687         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__td}{xhci\_td}} *td\_alt\_next;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00688}00688         uint32\_t \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00689}00689         uint8\_t \mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00690}00690 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00691}00691         td = xfer-\/>\mbox{\hyperlink{structusb__xfer_ab03dbdacd225824d88b55ea51d0434e1}{td\_transfer\_cache}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00692}00692         td\_alt\_next = td-\/>\mbox{\hyperlink{structxhci__td_a1905030d8977ae3cafb1582ac8966099}{alt\_next}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00693}00693 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00694}00694         \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a7f58fffa56cac11410055f785c4c5ffa}{aframes}} != xfer-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00695}00695                 \mbox{\hyperlink{usb__transfer_8c_a31786497f0f4222203b1e993d52af753}{usbd\_xfer\_set\_frame\_len}}(xfer, xfer-\/>\mbox{\hyperlink{structusb__xfer_a7f58fffa56cac11410055f785c4c5ffa}{aframes}}, 0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00696}00696 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00697}00697         \textcolor{keywordflow}{while} (1) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00698}00698                 \mbox{\hyperlink{usb__busdma_8h_a8752e7de57d1aa5d26c2cd8209162f69}{usb\_pc\_cpu\_invalidate}}(td-\/>\mbox{\hyperlink{structxhci__td_a933fec23ad2794824d084b5a78397a87}{page\_cache}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00699}00699 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00700}00700                 \mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}} = td-\/>\mbox{\hyperlink{structxhci__td_a6c52dc7bc931740cdde6b22406d33797}{status}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00701}00701                 \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} = td-\/>\mbox{\hyperlink{structxhci__td_adb1c8bba4f8650a5fa89a67d1a77e0db}{remainder}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00702}00702 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00703}00703                 DPRINTFN(4, \textcolor{stringliteral}{"{}xfer=\%p[\%u/\%u] rem=\%u/\%u status=\%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00704}00704                     xfer, (\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int})xfer-\/>\mbox{\hyperlink{structusb__xfer_a7f58fffa56cac11410055f785c4c5ffa}{aframes}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00705}00705                     (\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int})xfer-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00706}00706                     (\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int})\mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}}, (\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int})td-\/>\mbox{\hyperlink{structxhci__td_a68bcdae31a91364bd83ee2eeb001b6ab}{len}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00707}00707                     (\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int})\mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00708}00708 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00709}00709                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00710}00710 \textcolor{comment}{                 * Verify the status length and}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00711}00711 \textcolor{comment}{                 * add the length to "{}frlengths[]"{}:}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00712}00712 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00713}00713                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} > td-\/>\mbox{\hyperlink{structxhci__td_a68bcdae31a91364bd83ee2eeb001b6ab}{len}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00714}00714                         \textcolor{comment}{/* should not happen */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00715}00715                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Invalid status length, "{}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00716}00716                             \textcolor{stringliteral}{"{}0x\%04x/0x\%04x bytes\(\backslash\)n"{}}, \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}}, td-\/>\mbox{\hyperlink{structxhci__td_a68bcdae31a91364bd83ee2eeb001b6ab}{len}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00717}00717                         \mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}} = \mbox{\hyperlink{xhci_8h_ab011113597a7b22bc36727530de98425}{XHCI\_TRB\_ERROR\_LENGTH}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00718}00718                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a7f58fffa56cac11410055f785c4c5ffa}{aframes}} != xfer-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00719}00719                         xfer-\/>\mbox{\hyperlink{structusb__xfer_a04bfeb929b15a30d355f94eb7ff2a586}{frlengths}}[xfer-\/>\mbox{\hyperlink{structusb__xfer_a7f58fffa56cac11410055f785c4c5ffa}{aframes}}] += td-\/>\mbox{\hyperlink{structxhci__td_a68bcdae31a91364bd83ee2eeb001b6ab}{len}} -\/ \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00720}00720                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00721}00721                 \textcolor{comment}{/* Check for last transfer */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00722}00722                 \textcolor{keywordflow}{if} (((\textcolor{keywordtype}{void} *)td) == xfer-\/>\mbox{\hyperlink{structusb__xfer_ae74733ea0d49027c19477ea63a223f26}{td\_transfer\_last}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00723}00723                         td = NULL;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00724}00724                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00725}00725                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00726}00726                 \textcolor{comment}{/* Check for transfer error */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00727}00727                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}} != \mbox{\hyperlink{xhci_8h_a99c2f4c9e886f99ad35cf06efbea9c27}{XHCI\_TRB\_ERROR\_SHORT\_PKT}} \&\&}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00728}00728                     \mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}} != \mbox{\hyperlink{xhci_8h_a4ede7960d12e943e57da8a3da7388b8d}{XHCI\_TRB\_ERROR\_SUCCESS}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00729}00729                         \textcolor{comment}{/* the transfer is finished */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00730}00730                         td = NULL;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00731}00731                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00732}00732                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00733}00733                 \textcolor{comment}{/* Check for short transfer */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00734}00734                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} > 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00735}00735                         \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a1023a81a83c7acfbe3134100363e7fde}{short\_frames\_ok}} || }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00736}00736                             xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a5367e64daae30f55ec887872d577fa80}{isochronous\_xfr}} ||}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00737}00737                             xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a777cf7dd18178f84b0d6e0a086f72a7a}{control\_xfr}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00738}00738                                 \textcolor{comment}{/* follow alt next */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00739}00739                                 td = td-\/>alt\_next;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00740}00740                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00741}00741                                 \textcolor{comment}{/* the transfer is finished */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00742}00742                                 td = NULL;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00743}00743                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00744}00744                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00745}00745                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00746}00746                 td = td-\/>obj\_next;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00747}00747 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00748}00748                 \textcolor{keywordflow}{if} (td-\/>alt\_next != td\_alt\_next) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00749}00749                         \textcolor{comment}{/* this USB frame is complete */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00750}00750                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00751}00751                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00752}00752         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00753}00753 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00754}00754         \textcolor{comment}{/* update transfer cache */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00755}00755 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00756}00756         xfer-\/>\mbox{\hyperlink{structusb__xfer_ab03dbdacd225824d88b55ea51d0434e1}{td\_transfer\_cache}} = td;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00757}00757 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00758}00758         \textcolor{keywordflow}{return} ((\mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}} == \mbox{\hyperlink{xhci_8h_a8e6c53be58d2b0160ac7107c4c66ef11}{XHCI\_TRB\_ERROR\_STALL}}) ? \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a83258c6183686c303988db96e7f5713a}{USB\_ERR\_STALLED}} : }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00759}00759             (\mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}} != \mbox{\hyperlink{xhci_8h_a99c2f4c9e886f99ad35cf06efbea9c27}{XHCI\_TRB\_ERROR\_SHORT\_PKT}} \&\& }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00760}00760             \mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}} != \mbox{\hyperlink{xhci_8h_a4ede7960d12e943e57da8a3da7388b8d}{XHCI\_TRB\_ERROR\_SUCCESS}}) ? \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}} :}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00761}00761             \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a01e440e0629669433dd14bc477757c74}{USB\_ERR\_NORMAL\_COMPLETION}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00762}00762 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00763}00763 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00764}00764 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00765}\mbox{\hyperlink{xhci_8c_a1b4d083b1deb9859e620082f2acfaf09}{00765}} \mbox{\hyperlink{xhci_8c_a1b4d083b1deb9859e620082f2acfaf09}{xhci\_generic\_done}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00766}00766 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00767}00767         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00768}00768 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00769}00769         DPRINTFN(13, \textcolor{stringliteral}{"{}xfer=\%p endpoint=\%p transfer done\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00770}00770             xfer, xfer-\/>\mbox{\hyperlink{structusb__xfer_a8de3fd948d496c7901b307b13a1c6e99}{endpoint}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00771}00771 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00772}00772         \textcolor{comment}{/* reset scanner */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00773}00773 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00774}00774         xfer-\/>\mbox{\hyperlink{structusb__xfer_ab03dbdacd225824d88b55ea51d0434e1}{td\_transfer\_cache}} = xfer-\/>\mbox{\hyperlink{structusb__xfer_ae7adef379254c2ca0c87f265c59f5f5c}{td\_transfer\_first}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00775}00775 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00776}00776         \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a777cf7dd18178f84b0d6e0a086f72a7a}{control\_xfr}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00777}00777                 \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a0add2c86d09b768df5f354746b8fe16f}{control\_hdr}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00778}00778                         err = \mbox{\hyperlink{xhci_8c_abf6301458e1be0fed9b7001a011d3fc3}{xhci\_generic\_done\_sub}}(xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00779}00779 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00780}00780                 xfer-\/>\mbox{\hyperlink{structusb__xfer_a7f58fffa56cac11410055f785c4c5ffa}{aframes}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00781}00781 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00782}00782                 \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_ab03dbdacd225824d88b55ea51d0434e1}{td\_transfer\_cache}} == NULL)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00783}00783                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00784}00784         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00785}00785 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00786}00786         \textcolor{keywordflow}{while} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a7f58fffa56cac11410055f785c4c5ffa}{aframes}} != xfer-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00787}00787                 err = \mbox{\hyperlink{xhci_8c_abf6301458e1be0fed9b7001a011d3fc3}{xhci\_generic\_done\_sub}}(xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00788}00788                 xfer-\/>\mbox{\hyperlink{structusb__xfer_a7f58fffa56cac11410055f785c4c5ffa}{aframes}}++;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00789}00789 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00790}00790                 \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_ab03dbdacd225824d88b55ea51d0434e1}{td\_transfer\_cache}} == NULL)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00791}00791                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00792}00792         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00793}00793 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00794}00794         \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a777cf7dd18178f84b0d6e0a086f72a7a}{control\_xfr}} \&\&}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00795}00795             !xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a100da5a86a7ab85605683dc51d48ef86}{control\_act}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00796}00796                 err = \mbox{\hyperlink{xhci_8c_abf6301458e1be0fed9b7001a011d3fc3}{xhci\_generic\_done\_sub}}(xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00797}00797 done:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00798}00798         \textcolor{comment}{/* transfer is complete */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00799}00799         \mbox{\hyperlink{xhci_8c_a599f5f1237516bdefbf20695b1f8400c}{xhci\_device\_done}}(xfer, err);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00800}00800 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00801}00801 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00802}00802 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00803}\mbox{\hyperlink{xhci_8c_abcc8e05708be30afca00509152a78f52}{00803}} \mbox{\hyperlink{xhci_8c_abcc8e05708be30afca00509152a78f52}{xhci\_activate\_transfer}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00804}00804 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00805}00805         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__td}{xhci\_td}} *td;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00806}00806 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00807}00807         td = xfer-\/>\mbox{\hyperlink{structusb__xfer_ab03dbdacd225824d88b55ea51d0434e1}{td\_transfer\_cache}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00808}00808 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00809}00809         \mbox{\hyperlink{usb__busdma_8h_a8752e7de57d1aa5d26c2cd8209162f69}{usb\_pc\_cpu\_invalidate}}(td-\/>\mbox{\hyperlink{structxhci__td_a933fec23ad2794824d084b5a78397a87}{page\_cache}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00810}00810 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00811}00811         \textcolor{keywordflow}{if} (!(td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[0].\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} \& htole32(\mbox{\hyperlink{xhci_8h_aa99a6646570c85221b01f657524071ed}{XHCI\_TRB\_3\_CYCLE\_BIT}}))) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00812}00812                 \textcolor{comment}{/* activate the transfer */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00813}00813 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00814}00814                 td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[0].\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} |= htole32(\mbox{\hyperlink{xhci_8h_aa99a6646570c85221b01f657524071ed}{XHCI\_TRB\_3\_CYCLE\_BIT}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00815}00815                 \mbox{\hyperlink{usb__busdma_8h_a988a5299f521e8a8d94a68a03015bd77}{usb\_pc\_cpu\_flush}}(td-\/>\mbox{\hyperlink{structxhci__td_a933fec23ad2794824d084b5a78397a87}{page\_cache}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00816}00816 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00817}00817                 \mbox{\hyperlink{xhci_8c_aabc890bb66c8517ca8b7475cf04a1a18}{xhci\_endpoint\_doorbell}}(xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00818}00818         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00819}00819 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00820}00820 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00821}00821 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00822}\mbox{\hyperlink{xhci_8c_a41697c94e5610d9401f9ea734a3e0d02}{00822}} \mbox{\hyperlink{xhci_8c_a41697c94e5610d9401f9ea734a3e0d02}{xhci\_skip\_transfer}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00823}00823 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00824}00824         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__td}{xhci\_td}} *td;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00825}00825         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__td}{xhci\_td}} *td\_last;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00826}00826 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00827}00827         td = xfer-\/>\mbox{\hyperlink{structusb__xfer_ab03dbdacd225824d88b55ea51d0434e1}{td\_transfer\_cache}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00828}00828         td\_last = xfer-\/>\mbox{\hyperlink{structusb__xfer_ae74733ea0d49027c19477ea63a223f26}{td\_transfer\_last}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00829}00829 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00830}00830         td = td-\/>\mbox{\hyperlink{structxhci__td_a1905030d8977ae3cafb1582ac8966099}{alt\_next}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00831}00831 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00832}00832         \mbox{\hyperlink{usb__busdma_8h_a8752e7de57d1aa5d26c2cd8209162f69}{usb\_pc\_cpu\_invalidate}}(td-\/>\mbox{\hyperlink{structxhci__td_a933fec23ad2794824d084b5a78397a87}{page\_cache}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00833}00833 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00834}00834         \textcolor{keywordflow}{if} (!(td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[0].\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} \& htole32(\mbox{\hyperlink{xhci_8h_aa99a6646570c85221b01f657524071ed}{XHCI\_TRB\_3\_CYCLE\_BIT}}))) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00835}00835                 \mbox{\hyperlink{usb__busdma_8h_a8752e7de57d1aa5d26c2cd8209162f69}{usb\_pc\_cpu\_invalidate}}(td\_last-\/>\mbox{\hyperlink{structxhci__td_a933fec23ad2794824d084b5a78397a87}{page\_cache}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00836}00836 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00837}00837                 \textcolor{comment}{/* copy LINK TRB to current waiting location */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00838}00838 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00839}00839                 td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[0].\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}} = td\_last-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[td\_last-\/>\mbox{\hyperlink{structxhci__td_a8d57ed1abb0a3eaf8f5695c4ae4db737}{ntrb}}].\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00840}00840                 td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[0].\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}} = td\_last-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[td\_last-\/>\mbox{\hyperlink{structxhci__td_a8d57ed1abb0a3eaf8f5695c4ae4db737}{ntrb}}].\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00841}00841                 \mbox{\hyperlink{usb__busdma_8h_a988a5299f521e8a8d94a68a03015bd77}{usb\_pc\_cpu\_flush}}(td-\/>\mbox{\hyperlink{structxhci__td_a933fec23ad2794824d084b5a78397a87}{page\_cache}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00842}00842 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00843}00843                 td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[0].\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} = td\_last-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[td\_last-\/>\mbox{\hyperlink{structxhci__td_a8d57ed1abb0a3eaf8f5695c4ae4db737}{ntrb}}].\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00844}00844                 \mbox{\hyperlink{usb__busdma_8h_a988a5299f521e8a8d94a68a03015bd77}{usb\_pc\_cpu\_flush}}(td-\/>\mbox{\hyperlink{structxhci__td_a933fec23ad2794824d084b5a78397a87}{page\_cache}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00845}00845 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00846}00846                 \mbox{\hyperlink{xhci_8c_aabc890bb66c8517ca8b7475cf04a1a18}{xhci\_endpoint\_doorbell}}(xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00847}00847         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00848}00848 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00849}00849 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00850}00850 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00851}00851 \textcolor{comment}{ *      xhci\_check\_transfer}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00852}00852 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00853}00853 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00854}\mbox{\hyperlink{xhci_8c_a3c15a89d1fd659bea92b431bc6e0216c}{00854}} \mbox{\hyperlink{xhci_8c_a3c15a89d1fd659bea92b431bc6e0216c}{xhci\_check\_transfer}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__trb}{xhci\_trb}} *trb)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00855}00855 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00856}00856         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__endpoint__ext}{xhci\_endpoint\_ext}} *pepext;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00857}00857         int64\_t \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00858}00858         uint64\_t td\_event;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00859}00859         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00860}00860         uint32\_t \mbox{\hyperlink{xhci_8h_a6ccdd9ce01c26d9c463f093ee27e4c84}{remainder}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00861}00861         uint16\_t stream\_id = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00862}00862         uint16\_t i;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00863}00863         uint8\_t \mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00864}00864         uint8\_t halted;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00865}00865         uint8\_t epno;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00866}00866         uint8\_t index;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00867}00867 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00868}00868         \textcolor{comment}{/* decode TRB */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00869}00869         td\_event = le64toh(\mbox{\hyperlink{structxhci__endpoint__ext_a0606813689084e8c7bc08cd9269b8a77}{trb}}-\/>\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00870}00870         temp = le32toh(\mbox{\hyperlink{structxhci__endpoint__ext_a0606813689084e8c7bc08cd9269b8a77}{trb}}-\/>\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00871}00871 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00872}00872         \mbox{\hyperlink{xhci_8h_a6ccdd9ce01c26d9c463f093ee27e4c84}{remainder}} = \mbox{\hyperlink{xhci_8h_aad8444697bdd7e57248ac3dafeeba8e5}{XHCI\_TRB\_2\_REM\_GET}}(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00873}00873         \mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}} = \mbox{\hyperlink{xhci_8h_a2bcd66e0f6962e2a238d3d36b09c6e88}{XHCI\_TRB\_2\_ERROR\_GET}}(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00874}00874 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00875}00875         temp = le32toh(\mbox{\hyperlink{structxhci__endpoint__ext_a0606813689084e8c7bc08cd9269b8a77}{trb}}-\/>\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00876}00876         epno = \mbox{\hyperlink{xhci_8h_a8354bd288a0175fb7e2b8d365a9217fe}{XHCI\_TRB\_3\_EP\_GET}}(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00877}00877         index = \mbox{\hyperlink{xhci_8h_a3a9ab735ddbdf5ec0994633624158e18}{XHCI\_TRB\_3\_SLOT\_GET}}(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00878}00878 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00879}00879         \textcolor{comment}{/* check if error means halted */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00880}00880         halted = (\mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}} != \mbox{\hyperlink{xhci_8h_a99c2f4c9e886f99ad35cf06efbea9c27}{XHCI\_TRB\_ERROR\_SHORT\_PKT}} \&\&}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00881}00881             \mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}} != \mbox{\hyperlink{xhci_8h_a4ede7960d12e943e57da8a3da7388b8d}{XHCI\_TRB\_ERROR\_SUCCESS}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00882}00882 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00883}00883         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}slot=\%u epno=\%u remainder=\%u status=\%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00884}00884             index, epno, \mbox{\hyperlink{xhci_8h_a6ccdd9ce01c26d9c463f093ee27e4c84}{remainder}}, \mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00885}00885 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00886}00886         \textcolor{keywordflow}{if} (index > sc-\/>\mbox{\hyperlink{structxhci__softc_a3f2b7f637e15b8e6f00eacfea6ab2c97}{sc\_noslot}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00887}00887                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Invalid slot.\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00888}00888                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00889}00889         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00890}00890 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00891}00891         \textcolor{keywordflow}{if} ((epno == 0) || (epno >= \mbox{\hyperlink{xhci_8h_a1f646fdf1c9542e107d082158bcb1411}{XHCI\_MAX\_ENDPOINTS}})) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00892}00892                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Invalid endpoint.\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00893}00893                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00894}00894         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00895}00895 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00896}00896         pepext = \&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_aeb24a0d226849fb00f40e331f9a7b434}{endp}}[epno];}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00897}00897 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00898}00898         \textcolor{comment}{/* try to find the USB transfer that generated the event */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00899}00899         \textcolor{keywordflow}{for} (i = 0;; i++) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00900}00900                 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00901}00901                 \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__td}{xhci\_td}} *td;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00902}00902 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00903}00903                 \textcolor{keywordflow}{if} (i == (\mbox{\hyperlink{xhci_8h_ad65c5c3edb879e07bba8237211cf64c5}{XHCI\_MAX\_TRANSFERS}} -\/ 1)) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00904}00904                         \textcolor{keywordflow}{if} (pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_aea5b33a29ac8208a4e58aaddc503e49c}{trb\_ep\_mode}} != \mbox{\hyperlink{usb_8h_aa37eb5438eb0251d10367fc72a76e2b8a6517fbedeae183c025bdb38abc2f1733}{USB\_EP\_MODE\_STREAMS}} ||}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00905}00905                             stream\_id == (XHCI\_MAX\_STREAMS -\/ 1))}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00906}00906                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00907}00907                         stream\_id++;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00908}00908                         i = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00909}00909                         DPRINTFN(5, \textcolor{stringliteral}{"{}stream\_id=\%u\(\backslash\)n"{}}, stream\_id);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00910}00910                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00911}00911 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00912}00912                 xfer = pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a950f74c7e80c49fd46b528c6ab9c78ad}{xfer}}[i + (\mbox{\hyperlink{xhci_8h_ad65c5c3edb879e07bba8237211cf64c5}{XHCI\_MAX\_TRANSFERS}} * stream\_id)];}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00913}00913                 \textcolor{keywordflow}{if} (xfer == NULL)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00914}00914                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00915}00915 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00916}00916                 td = xfer-\/>\mbox{\hyperlink{structusb__xfer_ab03dbdacd225824d88b55ea51d0434e1}{td\_transfer\_cache}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00917}00917 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00918}00918                 DPRINTFN(5, \textcolor{stringliteral}{"{}Checking if 0x\%016llx == (0x\%016llx .. 0x\%016llx)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00919}00919                         (\textcolor{keywordtype}{long} \textcolor{keywordtype}{long})td\_event,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00920}00920                         (\textcolor{keywordtype}{long} \textcolor{keywordtype}{long})td-\/>\mbox{\hyperlink{structxhci__td_a7d6a15b4a2d6e680a794e420a42d6124}{td\_self}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00921}00921                         (\textcolor{keywordtype}{long} \textcolor{keywordtype}{long})td-\/>\mbox{\hyperlink{structxhci__td_a7d6a15b4a2d6e680a794e420a42d6124}{td\_self}} + \textcolor{keyword}{sizeof}(td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00922}00922 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00923}00923                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00924}00924 \textcolor{comment}{                 * NOTE: Some XHCI implementations might not trigger}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00925}00925 \textcolor{comment}{                 * an event on the last LINK TRB so we need to}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00926}00926 \textcolor{comment}{                 * consider both the last and second last event}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00927}00927 \textcolor{comment}{                 * address as conditions for a successful transfer.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00928}00928 \textcolor{comment}{                 *}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00929}00929 \textcolor{comment}{                 * NOTE: We assume that the XHCI will only trigger one}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00930}00930 \textcolor{comment}{                 * event per chain of TRBs.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00931}00931 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00932}00932 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00933}00933                 \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}} = td\_event -\/ td-\/>\mbox{\hyperlink{structxhci__td_a7d6a15b4a2d6e680a794e420a42d6124}{td\_self}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00934}00934 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00935}00935                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}} >= 0 \&\&}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00936}00936                     \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}} < (int64\_t)\textcolor{keyword}{sizeof}(td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}})) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00937}00937                         \mbox{\hyperlink{usb__busdma_8h_a8752e7de57d1aa5d26c2cd8209162f69}{usb\_pc\_cpu\_invalidate}}(td-\/>\mbox{\hyperlink{structxhci__td_a933fec23ad2794824d084b5a78397a87}{page\_cache}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00938}00938 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00939}00939                         \textcolor{comment}{/* compute rest of remainder, if any */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00940}00940                         \textcolor{keywordflow}{for} (i = (\mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}} / 16) + 1; i < td-\/>\mbox{\hyperlink{structxhci__td_a8d57ed1abb0a3eaf8f5695c4ae4db737}{ntrb}}; i++) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00941}00941                                 temp = le32toh(td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[i].\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00942}00942                                 \mbox{\hyperlink{xhci_8h_a6ccdd9ce01c26d9c463f093ee27e4c84}{remainder}} += \mbox{\hyperlink{xhci_8h_ac631868aecc1540e340e0a5666c58e8c}{XHCI\_TRB\_2\_BYTES\_GET}}(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00943}00943                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00944}00944 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00945}00945                         DPRINTFN(5, \textcolor{stringliteral}{"{}New remainder: \%u\(\backslash\)n"{}}, \mbox{\hyperlink{xhci_8h_a6ccdd9ce01c26d9c463f093ee27e4c84}{remainder}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00946}00946 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00947}00947                         \textcolor{comment}{/* clear isochronous transfer errors */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00948}00948                         \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a5367e64daae30f55ec887872d577fa80}{isochronous\_xfr}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00949}00949                                 \textcolor{keywordflow}{if} (halted) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00950}00950                                         halted = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00951}00951                                         \mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}} = \mbox{\hyperlink{xhci_8h_a4ede7960d12e943e57da8a3da7388b8d}{XHCI\_TRB\_ERROR\_SUCCESS}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00952}00952                                         \mbox{\hyperlink{xhci_8h_a6ccdd9ce01c26d9c463f093ee27e4c84}{remainder}} = td-\/>\mbox{\hyperlink{structxhci__td_a68bcdae31a91364bd83ee2eeb001b6ab}{len}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00953}00953                                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00954}00954                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00955}00955 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00956}00956                         \textcolor{comment}{/* "{}td-\/>remainder"{} is verified later */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00957}00957                         td-\/>\mbox{\hyperlink{structxhci__td_adb1c8bba4f8650a5fa89a67d1a77e0db}{remainder}} = \mbox{\hyperlink{xhci_8h_a6ccdd9ce01c26d9c463f093ee27e4c84}{remainder}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00958}00958                         td-\/>\mbox{\hyperlink{structxhci__td_a6c52dc7bc931740cdde6b22406d33797}{status}} = \mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00959}00959 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00960}00960                         \mbox{\hyperlink{usb__busdma_8h_a988a5299f521e8a8d94a68a03015bd77}{usb\_pc\_cpu\_flush}}(td-\/>\mbox{\hyperlink{structxhci__td_a933fec23ad2794824d084b5a78397a87}{page\_cache}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00961}00961 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00962}00962                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00963}00963 \textcolor{comment}{                         * 1) Last transfer descriptor makes the}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00964}00964 \textcolor{comment}{                         * transfer done}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00965}00965 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00966}00966                         \textcolor{keywordflow}{if} (((\textcolor{keywordtype}{void} *)td) == xfer-\/>\mbox{\hyperlink{structusb__xfer_ae74733ea0d49027c19477ea63a223f26}{td\_transfer\_last}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00967}00967                                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}TD is last\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00968}00968                                 \mbox{\hyperlink{xhci_8c_a1b4d083b1deb9859e620082f2acfaf09}{xhci\_generic\_done}}(xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00969}00969                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00970}00970                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00971}00971 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00972}00972                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00973}00973 \textcolor{comment}{                         * 2) Any kind of error makes the transfer}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00974}00974 \textcolor{comment}{                         * done}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00975}00975 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00976}00976                         \textcolor{keywordflow}{if} (halted) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00977}00977                                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}TD has I/O error\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00978}00978                                 \mbox{\hyperlink{xhci_8c_a1b4d083b1deb9859e620082f2acfaf09}{xhci\_generic\_done}}(xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00979}00979                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00980}00980                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00981}00981 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00982}00982                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00983}00983 \textcolor{comment}{                         * 3) If there is no alternate next transfer,}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00984}00984 \textcolor{comment}{                         * a short packet also makes the transfer done}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00985}00985 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00986}00986                         \textcolor{keywordflow}{if} (td-\/>remainder > 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00987}00987                                 \textcolor{keywordflow}{if} (td-\/>alt\_next == NULL) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00988}00988                                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00989}00989                                             \textcolor{stringliteral}{"{}short TD has no alternate next\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00990}00990                                         \mbox{\hyperlink{xhci_8c_a1b4d083b1deb9859e620082f2acfaf09}{xhci\_generic\_done}}(xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00991}00991                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00992}00992                                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00993}00993                                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}TD has short pkt\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00994}00994                                 \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a1023a81a83c7acfbe3134100363e7fde}{short\_frames\_ok}} ||}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00995}00995                                     xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a5367e64daae30f55ec887872d577fa80}{isochronous\_xfr}} ||}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00996}00996                                     xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a777cf7dd18178f84b0d6e0a086f72a7a}{control\_xfr}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00997}00997                                         \textcolor{comment}{/* follow the alt next */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00998}00998                                         xfer-\/>\mbox{\hyperlink{structusb__xfer_ab03dbdacd225824d88b55ea51d0434e1}{td\_transfer\_cache}} = td-\/>alt\_next;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l00999}00999                                         \mbox{\hyperlink{xhci_8c_abcc8e05708be30afca00509152a78f52}{xhci\_activate\_transfer}}(xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01000}01000                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01001}01001                                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01002}01002                                 \mbox{\hyperlink{xhci_8c_a41697c94e5610d9401f9ea734a3e0d02}{xhci\_skip\_transfer}}(xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01003}01003                                 \mbox{\hyperlink{xhci_8c_a1b4d083b1deb9859e620082f2acfaf09}{xhci\_generic\_done}}(xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01004}01004                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01005}01005                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01006}01006 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01007}01007                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01008}01008 \textcolor{comment}{                         * 4) Transfer complete -\/ go to next TD}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01009}01009 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01010}01010                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Following next TD\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01011}01011                         xfer-\/>\mbox{\hyperlink{structusb__xfer_ab03dbdacd225824d88b55ea51d0434e1}{td\_transfer\_cache}} = td-\/>obj\_next;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01012}01012                         \mbox{\hyperlink{xhci_8c_abcc8e05708be30afca00509152a78f52}{xhci\_activate\_transfer}}(xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01013}01013                         \textcolor{keywordflow}{break};          \textcolor{comment}{/* there should only be one match */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01014}01014                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01015}01015         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01016}01016 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01017}01017 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01018}01018 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01019}\mbox{\hyperlink{xhci_8c_a8f71c3d4ab796c9505c91cfa9b5d7646}{01019}} \mbox{\hyperlink{xhci_8c_a8f71c3d4ab796c9505c91cfa9b5d7646}{xhci\_check\_command}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__trb}{xhci\_trb}} *trb)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01020}01020 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01021}01021         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_a47035c30cabc82ef877cf02e52508910}{sc\_cmd\_addr}} == trb-\/>\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01022}01022                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Received command event\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01023}01023                 sc-\/>\mbox{\hyperlink{structxhci__softc_a96011a473ce8dae4646ae57cafda105a}{sc\_cmd\_result}}[0] = trb-\/>\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01024}01024                 sc-\/>\mbox{\hyperlink{structxhci__softc_a96011a473ce8dae4646ae57cafda105a}{sc\_cmd\_result}}[1] = trb-\/>\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01025}01025                 cv\_signal(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a497ea89372e7a70ccf9b6292e0d4a373}{sc\_cmd\_cv}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01026}01026                 \textcolor{keywordflow}{return} (1);     \textcolor{comment}{/* command match */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01027}01027         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01028}01028         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01029}01029 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01030}01030 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01031}01031 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01032}\mbox{\hyperlink{xhci_8c_ad00a3e3c3a93f2ad2f96e7c08db75c83}{01032}} \mbox{\hyperlink{xhci_8c_ad00a3e3c3a93f2ad2f96e7c08db75c83}{xhci\_interrupt\_poll}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01033}01033 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01034}01034         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__search}{usb\_page\_search}} buf\_res;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01035}01035         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__hw__root}{xhci\_hw\_root}} *phwr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01036}01036         uint64\_t addr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01037}01037         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01038}01038         \textcolor{keywordtype}{int} retval = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01039}01039         uint16\_t i;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01040}01040         uint8\_t event;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01041}01041         uint8\_t j;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01042}01042         uint8\_t \mbox{\hyperlink{if__run_8c_aae04ad987a21b789518aaae9825b668c}{k}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01043}01043         uint8\_t t;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01044}01044 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01045}01045         \mbox{\hyperlink{usb__busdma_8c_ab4f9d07714be540b6d002b44b3716bb2}{usbd\_get\_page}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_ad3092c299c1ffb37df7c893f89ec88e5}{root\_pc}}, 0, \&buf\_res);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01046}01046 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01047}01047         phwr = buf\_res.\mbox{\hyperlink{structusb__page__search_a60cd5ce1bbfbf2d2dec7677b1ba9b01a}{buffer}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01048}01048 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01049}01049         \textcolor{comment}{/* Receive any events */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01050}01050 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01051}01051         \mbox{\hyperlink{usb__busdma_8h_a8752e7de57d1aa5d26c2cd8209162f69}{usb\_pc\_cpu\_invalidate}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_ad3092c299c1ffb37df7c893f89ec88e5}{root\_pc}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01052}01052 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01053}01053         i = sc-\/>\mbox{\hyperlink{structxhci__softc_a31e830c155c51dd3c4d4c343dcdc05b1}{sc\_event\_idx}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01054}01054         j = sc-\/>\mbox{\hyperlink{structxhci__softc_ad7ac9452ecbf9500721ebdb7201d2557}{sc\_event\_ccs}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01055}01055         t = 2;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01056}01056 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01057}01057         \textcolor{keywordflow}{while} (1) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01058}01058                 temp = le32toh(phwr-\/>\mbox{\hyperlink{structxhci__hw__root_a7540bc1a8fbb56049844a2b8f7d7c6d2}{hwr\_events}}[i].\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01059}01059 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01060}01060                 \mbox{\hyperlink{if__run_8c_aae04ad987a21b789518aaae9825b668c}{k}} = (temp \& \mbox{\hyperlink{xhci_8h_aa99a6646570c85221b01f657524071ed}{XHCI\_TRB\_3\_CYCLE\_BIT}}) ? 1 : 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01061}01061 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01062}01062                 \textcolor{keywordflow}{if} (j != \mbox{\hyperlink{if__run_8c_aae04ad987a21b789518aaae9825b668c}{k}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01063}01063                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01064}01064 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01065}01065                 \textcolor{keyword}{event} = \mbox{\hyperlink{xhci_8h_af0483be73e5f240812ebb9ca1e108770}{XHCI\_TRB\_3\_TYPE\_GET}}(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01066}01066 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01067}01067                 DPRINTFN(10, \textcolor{stringliteral}{"{}event[\%u] = \%u (0x\%016llx 0x\%08lx 0x\%08lx)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01068}01068                     i, event, (\textcolor{keywordtype}{long} \textcolor{keywordtype}{long})le64toh(phwr-\/>\mbox{\hyperlink{structxhci__hw__root_a7540bc1a8fbb56049844a2b8f7d7c6d2}{hwr\_events}}[i].\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}}),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01069}01069                     (\textcolor{keywordtype}{long})le32toh(phwr-\/>\mbox{\hyperlink{structxhci__hw__root_a7540bc1a8fbb56049844a2b8f7d7c6d2}{hwr\_events}}[i].\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}}),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01070}01070                     (\textcolor{keywordtype}{long})le32toh(phwr-\/>\mbox{\hyperlink{structxhci__hw__root_a7540bc1a8fbb56049844a2b8f7d7c6d2}{hwr\_events}}[i].\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01071}01071 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01072}01072                 \textcolor{keywordflow}{switch} (event) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01073}01073                 \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8h_a34df6ac954e0d06bb942ad9e2e396d83}{XHCI\_TRB\_EVENT\_TRANSFER}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01074}01074                         \mbox{\hyperlink{xhci_8c_a3c15a89d1fd659bea92b431bc6e0216c}{xhci\_check\_transfer}}(sc, \&phwr-\/>\mbox{\hyperlink{structxhci__hw__root_a7540bc1a8fbb56049844a2b8f7d7c6d2}{hwr\_events}}[i]);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01075}01075                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01076}01076                 \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8h_a8cda02100fb773a373a8a87d60a94ff7}{XHCI\_TRB\_EVENT\_CMD\_COMPLETE}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01077}01077                         retval |= \mbox{\hyperlink{xhci_8c_a8f71c3d4ab796c9505c91cfa9b5d7646}{xhci\_check\_command}}(sc, \&phwr-\/>\mbox{\hyperlink{structxhci__hw__root_a7540bc1a8fbb56049844a2b8f7d7c6d2}{hwr\_events}}[i]);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01078}01078                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01079}01079                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01080}01080                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Unhandled event = \%u\(\backslash\)n"{}}, event);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01081}01081                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01082}01082                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01083}01083 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01084}01084                 i++;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01085}01085 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01086}01086                 \textcolor{keywordflow}{if} (i == \mbox{\hyperlink{xhci_8h_a4c38a8b27628fd16ca580b0ace17ae55}{XHCI\_MAX\_EVENTS}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01087}01087                         i = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01088}01088                         j \string^= 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01089}01089 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01090}01090                         \textcolor{comment}{/* check for timeout */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01091}01091                         \textcolor{keywordflow}{if} (!-\/-\/t)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01092}01092                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01093}01093                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01094}01094         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01095}01095 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01096}01096         sc-\/>\mbox{\hyperlink{structxhci__softc_a31e830c155c51dd3c4d4c343dcdc05b1}{sc\_event\_idx}} = i;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01097}01097         sc-\/>\mbox{\hyperlink{structxhci__softc_ad7ac9452ecbf9500721ebdb7201d2557}{sc\_event\_ccs}} = j;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01098}01098 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01099}01099         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01100}01100 \textcolor{comment}{         * NOTE: The Event Ring Dequeue Pointer Register is 64-\/bit}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01101}01101 \textcolor{comment}{         * latched. That means to activate the register we need to}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01102}01102 \textcolor{comment}{         * write both the low and high double word of the 64-\/bit}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01103}01103 \textcolor{comment}{         * register.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01104}01104 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01105}01105 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01106}01106         addr = buf\_res.physaddr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01107}01107         addr += \_\_offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__hw__root}{xhci\_hw\_root}}, \mbox{\hyperlink{structxhci__hw__root_a7540bc1a8fbb56049844a2b8f7d7c6d2}{hwr\_events}}[i]);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01108}01108 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01109}01109         \textcolor{comment}{/* try to clear busy bit */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01110}01110         addr |= \mbox{\hyperlink{xhcireg_8h_ad266405575c5ce7ebab6d63b49605444}{XHCI\_ERDP\_LO\_BUSY}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01111}01111 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01112}01112         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, runt, \mbox{\hyperlink{xhcireg_8h_a9d29850de9597ee9387b5827e509066f}{XHCI\_ERDP\_LO}}(0), (uint32\_t)addr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01113}01113         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, runt, \mbox{\hyperlink{xhcireg_8h_ab89bf9fe3d9247a7ea029000a1bfa95e}{XHCI\_ERDP\_HI}}(0), (uint32\_t)(addr >> 32));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01114}01114 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01115}01115         \textcolor{keywordflow}{return} (retval);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01116}01116 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01117}01117 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01118}01118 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01119}\mbox{\hyperlink{xhci_8c_aeb8e3310cbb12e5e7d422f38117dc73b}{01119}} \mbox{\hyperlink{xhci_8c_aeb8e3310cbb12e5e7d422f38117dc73b}{xhci\_do\_command}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__trb}{xhci\_trb}} *trb, }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01120}01120     uint16\_t timeout\_ms)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01121}01121 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01122}01122         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__search}{usb\_page\_search}} buf\_res;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01123}01123         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__hw__root}{xhci\_hw\_root}} *phwr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01124}01124         uint64\_t addr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01125}01125         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01126}01126         uint8\_t i;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01127}01127         uint8\_t j;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01128}01128         uint8\_t timeout = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01129}01129         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01130}01130 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01131}01131         \mbox{\hyperlink{xhci_8h_a797a3dc22af78df2e10d54912babdb5b}{XHCI\_CMD\_ASSERT\_LOCKED}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01132}01132 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01133}01133         \textcolor{comment}{/* get hardware root structure */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01134}01134 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01135}01135         \mbox{\hyperlink{usb__busdma_8c_ab4f9d07714be540b6d002b44b3716bb2}{usbd\_get\_page}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_ad3092c299c1ffb37df7c893f89ec88e5}{root\_pc}}, 0, \&buf\_res);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01136}01136 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01137}01137         phwr = buf\_res.\mbox{\hyperlink{structusb__page__search_a60cd5ce1bbfbf2d2dec7677b1ba9b01a}{buffer}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01138}01138 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01139}01139         \textcolor{comment}{/* Queue command */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01140}01140 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01141}01141         \mbox{\hyperlink{usb__core_8h_a21dab1de8f52baf9fbf7617c6b1ec033}{USB\_BUS\_LOCK}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01142}01142 \mbox{\hyperlink{if__runreg_8h_a84d98c1273f31ffccb7266bea38d8e83}{retry}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01143}01143         i = sc-\/>\mbox{\hyperlink{structxhci__softc_a68c02b0eb3783e457f67e42f2cd18dec}{sc\_command\_idx}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01144}01144         j = sc-\/>\mbox{\hyperlink{structxhci__softc_afa9f2c1ced23ffb70a9aff7c67681124}{sc\_command\_ccs}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01145}01145 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01146}01146         DPRINTFN(10, \textcolor{stringliteral}{"{}command[\%u] = \%u (0x\%016llx, 0x\%08lx, 0x\%08lx)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01147}01147             i, \mbox{\hyperlink{xhci_8h_af0483be73e5f240812ebb9ca1e108770}{XHCI\_TRB\_3\_TYPE\_GET}}(le32toh(trb-\/>\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}})),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01148}01148             (\textcolor{keywordtype}{long} \textcolor{keywordtype}{long})le64toh(trb-\/>\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}}),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01149}01149             (\textcolor{keywordtype}{long})le32toh(trb-\/>\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}}),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01150}01150             (\textcolor{keywordtype}{long})le32toh(trb-\/>\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01151}01151 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01152}01152         phwr-\/>\mbox{\hyperlink{structxhci__hw__root_ad6adb836ca2f3add145c5942b269c975}{hwr\_commands}}[i].\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}} = trb-\/>\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01153}01153         phwr-\/>\mbox{\hyperlink{structxhci__hw__root_ad6adb836ca2f3add145c5942b269c975}{hwr\_commands}}[i].\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}} = trb-\/>\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01154}01154 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01155}01155         \mbox{\hyperlink{usb__busdma_8h_a988a5299f521e8a8d94a68a03015bd77}{usb\_pc\_cpu\_flush}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_ad3092c299c1ffb37df7c893f89ec88e5}{root\_pc}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01156}01156 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01157}01157         temp = trb-\/>\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01158}01158 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01159}01159         \textcolor{keywordflow}{if} (j)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01160}01160                 temp |= htole32(\mbox{\hyperlink{xhci_8h_aa99a6646570c85221b01f657524071ed}{XHCI\_TRB\_3\_CYCLE\_BIT}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01161}01161         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01162}01162                 temp \&= \string~htole32(\mbox{\hyperlink{xhci_8h_aa99a6646570c85221b01f657524071ed}{XHCI\_TRB\_3\_CYCLE\_BIT}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01163}01163 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01164}01164         temp \&= \string~htole32(\mbox{\hyperlink{xhci_8h_a8e366d26d6727dae690b738361e04d9a}{XHCI\_TRB\_3\_TC\_BIT}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01165}01165 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01166}01166         phwr-\/>\mbox{\hyperlink{structxhci__hw__root_ad6adb836ca2f3add145c5942b269c975}{hwr\_commands}}[i].\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} = temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01167}01167 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01168}01168         \mbox{\hyperlink{usb__busdma_8h_a988a5299f521e8a8d94a68a03015bd77}{usb\_pc\_cpu\_flush}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_ad3092c299c1ffb37df7c893f89ec88e5}{root\_pc}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01169}01169 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01170}01170         addr = buf\_res.physaddr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01171}01171         addr += \_\_offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__hw__root}{xhci\_hw\_root}}, \mbox{\hyperlink{structxhci__hw__root_ad6adb836ca2f3add145c5942b269c975}{hwr\_commands}}[i]);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01172}01172 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01173}01173         sc-\/>\mbox{\hyperlink{structxhci__softc_a47035c30cabc82ef877cf02e52508910}{sc\_cmd\_addr}} = htole64(addr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01174}01174 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01175}01175         i++;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01176}01176 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01177}01177         \textcolor{keywordflow}{if} (i == (\mbox{\hyperlink{xhci_8h_ac1e7d87d433a7d957f6984db21b6b24f}{XHCI\_MAX\_COMMANDS}} -\/ 1)) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01178}01178                 \textcolor{keywordflow}{if} (j) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01179}01179                         temp = htole32(\mbox{\hyperlink{xhci_8h_a8e366d26d6727dae690b738361e04d9a}{XHCI\_TRB\_3\_TC\_BIT}} |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01180}01180                             \mbox{\hyperlink{xhci_8h_a414401db438c92fd85d7d5179712c75e}{XHCI\_TRB\_3\_TYPE\_SET}}(\mbox{\hyperlink{xhci_8h_ad488af824032c353f8b7630f7f8abc7f}{XHCI\_TRB\_TYPE\_LINK}}) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01181}01181                             \mbox{\hyperlink{xhci_8h_aa99a6646570c85221b01f657524071ed}{XHCI\_TRB\_3\_CYCLE\_BIT}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01182}01182                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01183}01183                         temp = htole32(\mbox{\hyperlink{xhci_8h_a8e366d26d6727dae690b738361e04d9a}{XHCI\_TRB\_3\_TC\_BIT}} |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01184}01184                             \mbox{\hyperlink{xhci_8h_a414401db438c92fd85d7d5179712c75e}{XHCI\_TRB\_3\_TYPE\_SET}}(\mbox{\hyperlink{xhci_8h_ad488af824032c353f8b7630f7f8abc7f}{XHCI\_TRB\_TYPE\_LINK}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01185}01185                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01186}01186 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01187}01187                 phwr-\/>\mbox{\hyperlink{structxhci__hw__root_ad6adb836ca2f3add145c5942b269c975}{hwr\_commands}}[i].\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} = temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01188}01188 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01189}01189                 \mbox{\hyperlink{usb__busdma_8h_a988a5299f521e8a8d94a68a03015bd77}{usb\_pc\_cpu\_flush}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_ad3092c299c1ffb37df7c893f89ec88e5}{root\_pc}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01190}01190 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01191}01191                 i = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01192}01192                 j \string^= 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01193}01193         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01194}01194 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01195}01195         sc-\/>\mbox{\hyperlink{structxhci__softc_a68c02b0eb3783e457f67e42f2cd18dec}{sc\_command\_idx}} = i;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01196}01196         sc-\/>\mbox{\hyperlink{structxhci__softc_afa9f2c1ced23ffb70a9aff7c67681124}{sc\_command\_ccs}} = j;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01197}01197 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01198}01198         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, door, \mbox{\hyperlink{xhcireg_8h_a6b426074e34edc0a6aef5a1d32ac445b}{XHCI\_DOORBELL}}(0), 0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01199}01199 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01200}01200         err = cv\_timedwait(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a497ea89372e7a70ccf9b6292e0d4a373}{sc\_cmd\_cv}}, \&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a7355d01a9b05ad01972eccabe5747edf}{bus\_mtx}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01201}01201             \mbox{\hyperlink{usbdi_8h_a9715d25e0db2e92bd86423a9283893b7}{USB\_MS\_TO\_TICKS}}(timeout\_ms));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01202}01202 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01203}01203         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01204}01204 \textcolor{comment}{         * In some error cases event interrupts are not generated.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01205}01205 \textcolor{comment}{         * Poll one time to see if the command has completed.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01206}01206 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01207}01207         \textcolor{keywordflow}{if} (err != 0 \&\& \mbox{\hyperlink{xhci_8c_ad00a3e3c3a93f2ad2f96e7c08db75c83}{xhci\_interrupt\_poll}}(sc) != 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01208}01208                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Command was completed when polling\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01209}01209                 err = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01210}01210         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01211}01211         \textcolor{keywordflow}{if} (err != 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01212}01212                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Command timeout!\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01213}01213                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01214}01214 \textcolor{comment}{                 * After some weeks of continuous operation, it has}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01215}01215 \textcolor{comment}{                 * been observed that the ASMedia Technology, ASM1042}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01216}01216 \textcolor{comment}{                 * SuperSpeed USB Host Controller can suddenly stop}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01217}01217 \textcolor{comment}{                 * accepting commands via the command queue. Try to}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01218}01218 \textcolor{comment}{                 * first reset the command queue. If that fails do a}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01219}01219 \textcolor{comment}{                 * host controller reset.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01220}01220 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01221}01221                 \textcolor{keywordflow}{if} (timeout == 0 \&\&}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01222}01222                     \mbox{\hyperlink{xhci_8c_a639e42eb84d1d0cf58a29a6f260ac64d}{xhci\_reset\_command\_queue\_locked}}(sc) == 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01223}01223                         temp = le32toh(trb-\/>\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01224}01224 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01225}01225                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01226}01226 \textcolor{comment}{                         * Avoid infinite XHCI reset loops if the set}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01227}01227 \textcolor{comment}{                         * address command fails to respond due to a}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01228}01228 \textcolor{comment}{                         * non-\/enumerating device:}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01229}01229 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01230}01230                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{xhci_8h_af0483be73e5f240812ebb9ca1e108770}{XHCI\_TRB\_3\_TYPE\_GET}}(temp) == \mbox{\hyperlink{xhci_8h_a272dc1e850ef8a8b1bf56b74413c8d14}{XHCI\_TRB\_TYPE\_ADDRESS\_DEVICE}} \&\&}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01231}01231                             (temp \& \mbox{\hyperlink{xhci_8h_a3eb20824ec5796e1e2a35c9b81f670f8}{XHCI\_TRB\_3\_BSR\_BIT}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01232}01232                                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Set address timeout\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01233}01233                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01234}01234                                 timeout = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01235}01235                                 \textcolor{keywordflow}{goto} \mbox{\hyperlink{if__runreg_8h_a84d98c1273f31ffccb7266bea38d8e83}{retry}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01236}01236                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01237}01237                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01238}01238                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Controller reset!\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01239}01239                         \mbox{\hyperlink{usb__controller_8c_af29ad0f0ce750070a6c1c71598fc6223}{usb\_bus\_reset\_async\_locked}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01240}01240                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01241}01241                 err = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945aeb31baaa7bf416e200f2a0d4ece60820}{USB\_ERR\_TIMEOUT}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01242}01242                 trb-\/>\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01243}01243                 trb-\/>\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01244}01244         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01245}01245                 temp = le32toh(sc-\/>\mbox{\hyperlink{structxhci__softc_a96011a473ce8dae4646ae57cafda105a}{sc\_cmd\_result}}[0]);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01246}01246                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{xhci_8h_a2bcd66e0f6962e2a238d3d36b09c6e88}{XHCI\_TRB\_2\_ERROR\_GET}}(temp) != \mbox{\hyperlink{xhci_8h_a4ede7960d12e943e57da8a3da7388b8d}{XHCI\_TRB\_ERROR\_SUCCESS}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01247}01247                         err = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01248}01248 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01249}01249                 trb-\/>\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}} = sc-\/>\mbox{\hyperlink{structxhci__softc_a96011a473ce8dae4646ae57cafda105a}{sc\_cmd\_result}}[0];}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01250}01250                 trb-\/>\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} = sc-\/>\mbox{\hyperlink{structxhci__softc_a96011a473ce8dae4646ae57cafda105a}{sc\_cmd\_result}}[1];}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01251}01251         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01252}01252 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01253}01253         \mbox{\hyperlink{usb__core_8h_aadb0c32f6333b8a0715929ace5f550b2}{USB\_BUS\_UNLOCK}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01254}01254 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01255}01255         \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01256}01256 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01257}01257 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01258}01258 \textcolor{preprocessor}{\#if 0}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01259}01259 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01260}01260 xhci\_cmd\_nop(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01261}01261 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01262}01262         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__trb}{xhci\_trb}} trb;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01263}01263         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01264}01264 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01265}01265         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01266}01266 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01267}01267         trb.\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01268}01268         trb.\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01269}01269         temp = \mbox{\hyperlink{xhci_8h_a414401db438c92fd85d7d5179712c75e}{XHCI\_TRB\_3\_TYPE\_SET}}(\mbox{\hyperlink{xhci_8h_a1ad82ed5e61b2c7c81378eee03535b0d}{XHCI\_TRB\_TYPE\_NOOP}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01270}01270 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01271}01271         trb.\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} = htole32(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01272}01272 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01273}01273         \textcolor{keywordflow}{return} (\mbox{\hyperlink{xhci_8c_aeb8e3310cbb12e5e7d422f38117dc73b}{xhci\_do\_command}}(sc, \&trb, 100 \textcolor{comment}{/* ms */}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01274}01274 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01275}01275 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01276}01276 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01277}01277 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01278}\mbox{\hyperlink{xhci_8c_a4b932ee0f04df09946cfd99dd76efc8c}{01278}} \mbox{\hyperlink{xhci_8c_a4b932ee0f04df09946cfd99dd76efc8c}{xhci\_cmd\_enable\_slot}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc, uint8\_t *pslot)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01279}01279 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01280}01280         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__trb}{xhci\_trb}} trb;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01281}01281         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01282}01282         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01283}01283 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01284}01284         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01285}01285 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01286}01286         trb.\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01287}01287         trb.\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01288}01288         trb.\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} = htole32(\mbox{\hyperlink{xhci_8h_a414401db438c92fd85d7d5179712c75e}{XHCI\_TRB\_3\_TYPE\_SET}}(\mbox{\hyperlink{xhci_8h_a096e543c7eb6b9fa4028965e27f5ca4b}{XHCI\_TRB\_TYPE\_ENABLE\_SLOT}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01289}01289 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01290}01290         err = \mbox{\hyperlink{xhci_8c_aeb8e3310cbb12e5e7d422f38117dc73b}{xhci\_do\_command}}(sc, \&trb, 100 \textcolor{comment}{/* ms */});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01291}01291         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01292}01292                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01293}01293 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01294}01294         temp = le32toh(trb.\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01295}01295 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01296}01296         *pslot = \mbox{\hyperlink{xhci_8h_a3a9ab735ddbdf5ec0994633624158e18}{XHCI\_TRB\_3\_SLOT\_GET}}(temp); }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01297}01297 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01298}01298 done:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01299}01299         \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01300}01300 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01301}01301 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01302}01302 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01303}\mbox{\hyperlink{xhci_8c_aa95cb7c051f87708cd47681e9c046b3f}{01303}} \mbox{\hyperlink{xhci_8c_aa95cb7c051f87708cd47681e9c046b3f}{xhci\_cmd\_disable\_slot}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc, uint8\_t slot\_id)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01304}01304 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01305}01305         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__trb}{xhci\_trb}} trb;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01306}01306         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01307}01307 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01308}01308         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01309}01309 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01310}01310         trb.\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01311}01311         trb.\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01312}01312         temp = \mbox{\hyperlink{xhci_8h_a414401db438c92fd85d7d5179712c75e}{XHCI\_TRB\_3\_TYPE\_SET}}(\mbox{\hyperlink{xhci_8h_a0fb7bf7860637dd58c157f7e0d2bd647}{XHCI\_TRB\_TYPE\_DISABLE\_SLOT}}) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01313}01313             \mbox{\hyperlink{xhci_8h_a90fb617e24880e59415aaff6f0fe14e3}{XHCI\_TRB\_3\_SLOT\_SET}}(slot\_id);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01314}01314 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01315}01315         trb.\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} = htole32(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01316}01316 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01317}01317         \textcolor{keywordflow}{return} (\mbox{\hyperlink{xhci_8c_aeb8e3310cbb12e5e7d422f38117dc73b}{xhci\_do\_command}}(sc, \&trb, 100 \textcolor{comment}{/* ms */}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01318}01318 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01319}01319 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01320}01320 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01321}\mbox{\hyperlink{xhci_8c_a12540b267a7faccea0b01b32df41e54e}{01321}} \mbox{\hyperlink{xhci_8c_a12540b267a7faccea0b01b32df41e54e}{xhci\_cmd\_set\_address}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc, uint64\_t input\_ctx,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01322}01322     uint8\_t bsr, uint8\_t slot\_id)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01323}01323 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01324}01324         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__trb}{xhci\_trb}} trb;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01325}01325         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01326}01326 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01327}01327         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01328}01328 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01329}01329         trb.\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}} = htole64(input\_ctx);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01330}01330         trb.\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01331}01331         temp = \mbox{\hyperlink{xhci_8h_a414401db438c92fd85d7d5179712c75e}{XHCI\_TRB\_3\_TYPE\_SET}}(\mbox{\hyperlink{xhci_8h_a272dc1e850ef8a8b1bf56b74413c8d14}{XHCI\_TRB\_TYPE\_ADDRESS\_DEVICE}}) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01332}01332             \mbox{\hyperlink{xhci_8h_a90fb617e24880e59415aaff6f0fe14e3}{XHCI\_TRB\_3\_SLOT\_SET}}(slot\_id);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01333}01333 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01334}01334         \textcolor{keywordflow}{if} (bsr)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01335}01335                 temp |= \mbox{\hyperlink{xhci_8h_a3eb20824ec5796e1e2a35c9b81f670f8}{XHCI\_TRB\_3\_BSR\_BIT}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01336}01336 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01337}01337         trb.\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} = htole32(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01338}01338 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01339}01339         \textcolor{keywordflow}{return} (\mbox{\hyperlink{xhci_8c_aeb8e3310cbb12e5e7d422f38117dc73b}{xhci\_do\_command}}(sc, \&trb, 500 \textcolor{comment}{/* ms */}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01340}01340 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01341}01341 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01342}01342 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01343}\mbox{\hyperlink{xhci_8c_ab7465de65dd12d049b64457d366a78f6}{01343}} \mbox{\hyperlink{xhci_8c_ab7465de65dd12d049b64457d366a78f6}{xhci\_set\_address}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev, \textcolor{keyword}{struct} mtx *mtx, uint16\_t address)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01344}01344 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01345}01345         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__search}{usb\_page\_search}} buf\_inp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01346}01346         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__search}{usb\_page\_search}} buf\_dev;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01347}01347         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01348}01348         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__hw__dev}{xhci\_hw\_dev}} *hdev;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01349}01349         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__slot__ctx}{xhci\_slot\_ctx}} *slot;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01350}01350         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__endpoint__ext}{xhci\_endpoint\_ext}} *pepext;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01351}01351         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01352}01352         uint16\_t mps;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01353}01353         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01354}01354         uint8\_t index;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01355}01355 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01356}01356         \textcolor{comment}{/* the root HUB case is not handled here */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01357}01357         \textcolor{keywordflow}{if} (udev-\/>\mbox{\hyperlink{structusb__device_aa35d4d1b88f22abb34d30e9762153e0b}{parent\_hub}} == NULL)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01358}01358                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945ac568d752239d287fca75588222df1bdf}{USB\_ERR\_INVAL}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01359}01359 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01360}01360         index = udev-\/>\mbox{\hyperlink{structusb__device_a9f275ef5fb35734f8174c9b01a855973}{controller\_slot\_id}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01361}01361 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01362}01362         hdev =  \&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index];}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01363}01363 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01364}01364         \textcolor{keywordflow}{if} (mtx != NULL)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01365}01365                 mtx\_unlock(mtx);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01366}01366 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01367}01367         \mbox{\hyperlink{xhci_8h_a8f5a32cd58a3c26992ea354dfe7b0956}{XHCI\_CMD\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01368}01368 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01369}01369         \textcolor{keywordflow}{switch} (hdev-\/>\mbox{\hyperlink{structxhci__hw__dev_a7f2e54fe3e374be4e1d6bf9a39a5872d}{state}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01370}01370         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8h_a06fc87d81c62e9abb8790b6e5713c55bafc3382fbc4a702a9a5819ca84840d05f}{XHCI\_ST\_DEFAULT}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01371}01371         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8h_a06fc87d81c62e9abb8790b6e5713c55bad10e3bda83ffdc25738f3a60bc6750dc}{XHCI\_ST\_ENABLED}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01372}01372 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01373}01373                 hdev-\/>\mbox{\hyperlink{structxhci__hw__dev_a7f2e54fe3e374be4e1d6bf9a39a5872d}{state}} = \mbox{\hyperlink{xhci_8h_a06fc87d81c62e9abb8790b6e5713c55bad10e3bda83ffdc25738f3a60bc6750dc}{XHCI\_ST\_ENABLED}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01374}01374 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01375}01375                 \textcolor{comment}{/* set configure mask to slot and EP0 */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01376}01376                 \mbox{\hyperlink{xhci_8c_a2b5fcb1981b6791181beb8c1f7710b10}{xhci\_configure\_mask}}(udev, 3, 0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01377}01377 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01378}01378                 \textcolor{comment}{/* configure input slot context structure */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01379}01379                 err = \mbox{\hyperlink{xhci_8c_a3d9f016a4907ccb7c68fb3742c93a0c2}{xhci\_configure\_device}}(udev);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01380}01380 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01381}01381                 \textcolor{keywordflow}{if} (err != 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01382}01382                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Could not configure device\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01383}01383                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01384}01384                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01385}01385 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01386}01386                 \textcolor{comment}{/* configure input endpoint context structure */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01387}01387                 \textcolor{keywordflow}{switch} (udev-\/>\mbox{\hyperlink{structusb__device_a1fc02abd43bd33f295493ed23debd852}{speed}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01388}01388                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a97e7c882fa8cd21898173a29471616ffa0ec4f8f66feaf7ee8f2ee618302e9470}{USB\_SPEED\_LOW}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01389}01389                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a97e7c882fa8cd21898173a29471616ffa0f17d0b9928086c6114fea73e08f1780}{USB\_SPEED\_FULL}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01390}01390                         mps = 8;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01391}01391                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01392}01392                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a97e7c882fa8cd21898173a29471616ffa57eeede6d769b09c01ac9c9c62fef8c9}{USB\_SPEED\_HIGH}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01393}01393                         mps = 64;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01394}01394                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01395}01395                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01396}01396                         mps = 512;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01397}01397                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01398}01398                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01399}01399 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01400}01400                 pepext = \mbox{\hyperlink{xhci_8c_af1c3f8bc816768b3a290ad69aafa7af0}{xhci\_get\_endpoint\_ext}}(udev,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01401}01401                     \&udev-\/>\mbox{\hyperlink{structusb__device_aee47847d32fc0bba304429c98097304e}{ctrl\_ep\_desc}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01402}01402 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01403}01403                 \textcolor{comment}{/* ensure the control endpoint is setup again */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01404}01404                 \mbox{\hyperlink{usb__core_8h_a21dab1de8f52baf9fbf7617c6b1ec033}{USB\_BUS\_LOCK}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01405}01405                 pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a3e583572d83c2276b0cc995d08574f1d}{trb\_halted}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01406}01406                 pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_ac3b4c115bbc8f9df3b922c27036ea47c}{trb\_running}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01407}01407                 \mbox{\hyperlink{usb__core_8h_aadb0c32f6333b8a0715929ace5f550b2}{USB\_BUS\_UNLOCK}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01408}01408 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01409}01409                 err = \mbox{\hyperlink{xhci_8c_a256565a843bbdd01a3cc34cddaae615d}{xhci\_configure\_endpoint}}(udev,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01410}01410                     \&udev-\/>\mbox{\hyperlink{structusb__device_aee47847d32fc0bba304429c98097304e}{ctrl\_ep\_desc}}, pepext,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01411}01411                     0, 1, 1, 0, mps, mps, \mbox{\hyperlink{usb_8h_aa37eb5438eb0251d10367fc72a76e2b8a2c6c87a8b2f969b4b79e01861720675e}{USB\_EP\_MODE\_DEFAULT}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01412}01412 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01413}01413                 \textcolor{keywordflow}{if} (err != 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01414}01414                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Could not configure default endpoint\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01415}01415                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01416}01416                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01417}01417 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01418}01418                 \textcolor{comment}{/* execute set address command */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01419}01419                 \mbox{\hyperlink{usb__busdma_8c_ab4f9d07714be540b6d002b44b3716bb2}{usbd\_get\_page}}(\&hdev-\/>\mbox{\hyperlink{structxhci__hw__dev_ac3b7a1fbfd567e6b9c3cdcbc58bcd40e}{input\_pc}}, 0, \&buf\_inp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01420}01420 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01421}01421                 err = \mbox{\hyperlink{xhci_8c_a12540b267a7faccea0b01b32df41e54e}{xhci\_cmd\_set\_address}}(sc, buf\_inp.physaddr,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01422}01422                     (address == 0), index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01423}01423 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01424}01424                 \textcolor{keywordflow}{if} (err != 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01425}01425                         temp = le32toh(sc-\/>\mbox{\hyperlink{structxhci__softc_a96011a473ce8dae4646ae57cafda105a}{sc\_cmd\_result}}[0]);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01426}01426                         \textcolor{keywordflow}{if} (address == 0 \&\& sc-\/>\mbox{\hyperlink{structxhci__softc_a211c39599cd0592a5e9f1a8d76ae9704}{sc\_port\_route}} != NULL \&\&}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01427}01427                             \mbox{\hyperlink{xhci_8h_a2bcd66e0f6962e2a238d3d36b09c6e88}{XHCI\_TRB\_2\_ERROR\_GET}}(temp) ==}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01428}01428                             \mbox{\hyperlink{xhci_8h_ad6bb0cb2b67da1cf1dd0cdd812f33693}{XHCI\_TRB\_ERROR\_PARAMETER}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01429}01429                                 \textcolor{comment}{/* LynxPoint XHCI -\/ ports are not switchable */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01430}01430                                 \textcolor{comment}{/* Un-\/route all ports from the XHCI */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01431}01431                                 sc-\/>\mbox{\hyperlink{structxhci__softc_a211c39599cd0592a5e9f1a8d76ae9704}{sc\_port\_route}}(sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a7855a7fc5c4b3f5289323c7743c6a975}{parent}}, 0, \string~0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01432}01432                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01433}01433                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Could not set address "{}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01434}01434                             \textcolor{stringliteral}{"{}for slot \%u.\(\backslash\)n"{}}, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01435}01435                         \textcolor{keywordflow}{if} (address != 0)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01436}01436                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01437}01437                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01438}01438 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01439}01439                 \textcolor{comment}{/* update device address to new value */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01440}01440 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01441}01441                 \mbox{\hyperlink{usb__busdma_8c_ab4f9d07714be540b6d002b44b3716bb2}{usbd\_get\_page}}(\&hdev-\/>\mbox{\hyperlink{structxhci__hw__dev_a58b4c8a6356c9035a0b83599b8f8579b}{device\_pc}}, 0, \&buf\_dev);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01442}01442                 slot = \mbox{\hyperlink{xhci_8c_a7282cd159e63bc916b5f3d5b828ff61f}{XHCI\_GET\_CTX}}(sc, \mbox{\hyperlink{structxhci__dev__ctx}{xhci\_dev\_ctx}}, \mbox{\hyperlink{xhci_8h_a102d058fa213774dd6a3aa079747d54f}{ctx\_slot}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01443}01443                     buf\_dev.\mbox{\hyperlink{structusb__page__search_a60cd5ce1bbfbf2d2dec7677b1ba9b01a}{buffer}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01444}01444                 \mbox{\hyperlink{usb__busdma_8h_a8752e7de57d1aa5d26c2cd8209162f69}{usb\_pc\_cpu\_invalidate}}(\&hdev-\/>\mbox{\hyperlink{structxhci__hw__dev_a58b4c8a6356c9035a0b83599b8f8579b}{device\_pc}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01445}01445 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01446}01446                 temp = le32toh(slot-\/>dwSctx3);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01447}01447                 udev-\/>\mbox{\hyperlink{structusb__device_ab9873df4422a53f4fa2d7c17460b11a1}{address}} = \mbox{\hyperlink{xhci_8h_a8d66026398339b4607726a251ec8a2fd}{XHCI\_SCTX\_3\_DEV\_ADDR\_GET}}(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01448}01448 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01449}01449                 \textcolor{comment}{/* update device state to new value */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01450}01450 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01451}01451                 \textcolor{keywordflow}{if} (address != 0)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01452}01452                         hdev-\/>\mbox{\hyperlink{structxhci__hw__dev_a7f2e54fe3e374be4e1d6bf9a39a5872d}{state}} = \mbox{\hyperlink{xhci_8h_a06fc87d81c62e9abb8790b6e5713c55ba771247684dda3a43baaf50c3ed07e0f4}{XHCI\_ST\_ADDRESSED}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01453}01453                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01454}01454                         hdev-\/>\mbox{\hyperlink{structxhci__hw__dev_a7f2e54fe3e374be4e1d6bf9a39a5872d}{state}} = \mbox{\hyperlink{xhci_8h_a06fc87d81c62e9abb8790b6e5713c55bafc3382fbc4a702a9a5819ca84840d05f}{XHCI\_ST\_DEFAULT}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01455}01455                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01456}01456 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01457}01457         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01458}01458                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Wrong state for set address.\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01459}01459                 err = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01460}01460                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01461}01461         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01462}01462         \mbox{\hyperlink{xhci_8h_a338ae22d11f2b1dbc1a2fc8b9ef50c8a}{XHCI\_CMD\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01463}01463 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01464}01464         \textcolor{keywordflow}{if} (mtx != NULL)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01465}01465                 mtx\_lock(mtx);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01466}01466 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01467}01467         \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01468}01468 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01469}01469 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01470}01470 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01471}\mbox{\hyperlink{xhci_8c_a16bb129b4a583fc8ed747de71aee1f4e}{01471}} \mbox{\hyperlink{xhci_8c_a16bb129b4a583fc8ed747de71aee1f4e}{xhci\_cmd\_configure\_ep}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc, uint64\_t input\_ctx,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01472}01472     uint8\_t deconfigure, uint8\_t slot\_id)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01473}01473 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01474}01474         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__trb}{xhci\_trb}} trb;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01475}01475         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01476}01476 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01477}01477         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01478}01478 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01479}01479         trb.\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}} = htole64(input\_ctx);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01480}01480         trb.\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01481}01481         temp = \mbox{\hyperlink{xhci_8h_a414401db438c92fd85d7d5179712c75e}{XHCI\_TRB\_3\_TYPE\_SET}}(\mbox{\hyperlink{xhci_8h_a25162fa872c778d775790f63567aa688}{XHCI\_TRB\_TYPE\_CONFIGURE\_EP}}) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01482}01482             \mbox{\hyperlink{xhci_8h_a90fb617e24880e59415aaff6f0fe14e3}{XHCI\_TRB\_3\_SLOT\_SET}}(slot\_id);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01483}01483 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01484}01484         \textcolor{keywordflow}{if} (deconfigure) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01485}01485                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_a7a6514cc7b3d2e0e6adc813948939206}{sc\_no\_deconfigure}} != 0 || \mbox{\hyperlink{xhci_8c_aad092ea903bd4bb5af8775ac55c28e78}{xhcidcepquirk}} != 0)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01486}01486                         \textcolor{keywordflow}{return} (0);     \textcolor{comment}{/* Success */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01487}01487                 temp |= \mbox{\hyperlink{xhci_8h_a8ed0772ca7974f3138db154964ab9a99}{XHCI\_TRB\_3\_DCEP\_BIT}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01488}01488         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01489}01489 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01490}01490         trb.\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} = htole32(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01491}01491 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01492}01492         \textcolor{keywordflow}{return} (\mbox{\hyperlink{xhci_8c_aeb8e3310cbb12e5e7d422f38117dc73b}{xhci\_do\_command}}(sc, \&trb, 100 \textcolor{comment}{/* ms */}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01493}01493 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01494}01494 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01495}01495 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01496}\mbox{\hyperlink{xhci_8c_ab64f4e8f1f9b93086b3453647cd7b8c4}{01496}} \mbox{\hyperlink{xhci_8c_ab64f4e8f1f9b93086b3453647cd7b8c4}{xhci\_cmd\_evaluate\_ctx}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc, uint64\_t input\_ctx,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01497}01497     uint8\_t slot\_id)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01498}01498 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01499}01499         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__trb}{xhci\_trb}} trb;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01500}01500         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01501}01501 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01502}01502         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01503}01503 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01504}01504         trb.\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}} = htole64(input\_ctx);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01505}01505         trb.\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01506}01506         temp = \mbox{\hyperlink{xhci_8h_a414401db438c92fd85d7d5179712c75e}{XHCI\_TRB\_3\_TYPE\_SET}}(\mbox{\hyperlink{xhci_8h_af7c9a45a8380e7d979225bb1baddcf2f}{XHCI\_TRB\_TYPE\_EVALUATE\_CTX}}) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01507}01507             \mbox{\hyperlink{xhci_8h_a90fb617e24880e59415aaff6f0fe14e3}{XHCI\_TRB\_3\_SLOT\_SET}}(slot\_id);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01508}01508         trb.\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} = htole32(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01509}01509 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01510}01510         \textcolor{keywordflow}{return} (\mbox{\hyperlink{xhci_8c_aeb8e3310cbb12e5e7d422f38117dc73b}{xhci\_do\_command}}(sc, \&trb, 100 \textcolor{comment}{/* ms */}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01511}01511 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01512}01512 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01513}01513 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01514}\mbox{\hyperlink{xhci_8c_a5f90610f10451590e1430e509a42ebfc}{01514}} \mbox{\hyperlink{xhci_8c_a5f90610f10451590e1430e509a42ebfc}{xhci\_cmd\_reset\_ep}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc, uint8\_t preserve,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01515}01515     uint8\_t ep\_id, uint8\_t slot\_id)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01516}01516 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01517}01517         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__trb}{xhci\_trb}} trb;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01518}01518         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01519}01519 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01520}01520         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01521}01521 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01522}01522         trb.\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01523}01523         trb.\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01524}01524         temp = \mbox{\hyperlink{xhci_8h_a414401db438c92fd85d7d5179712c75e}{XHCI\_TRB\_3\_TYPE\_SET}}(\mbox{\hyperlink{xhci_8h_a57e9fde5adef036f4fcf81a89ff545b4}{XHCI\_TRB\_TYPE\_RESET\_EP}}) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01525}01525             \mbox{\hyperlink{xhci_8h_a90fb617e24880e59415aaff6f0fe14e3}{XHCI\_TRB\_3\_SLOT\_SET}}(slot\_id) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01526}01526             \mbox{\hyperlink{xhci_8h_afa33177cd67d9dd990fbb18bc04a045d}{XHCI\_TRB\_3\_EP\_SET}}(ep\_id);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01527}01527 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01528}01528         \textcolor{keywordflow}{if} (preserve)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01529}01529                 temp |= \mbox{\hyperlink{xhci_8h_ab0c5070287c91adff24298a52d8070a4}{XHCI\_TRB\_3\_PRSV\_BIT}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01530}01530 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01531}01531         trb.\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} = htole32(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01532}01532 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01533}01533         \textcolor{keywordflow}{return} (\mbox{\hyperlink{xhci_8c_aeb8e3310cbb12e5e7d422f38117dc73b}{xhci\_do\_command}}(sc, \&trb, 100 \textcolor{comment}{/* ms */}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01534}01534 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01535}01535 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01536}01536 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01537}\mbox{\hyperlink{xhci_8c_a202ffeab386ad0b2b4f34e9a4e0ba3c5}{01537}} \mbox{\hyperlink{xhci_8c_a202ffeab386ad0b2b4f34e9a4e0ba3c5}{xhci\_cmd\_set\_tr\_dequeue\_ptr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc, uint64\_t dequeue\_ptr,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01538}01538     uint16\_t stream\_id, uint8\_t ep\_id, uint8\_t slot\_id)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01539}01539 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01540}01540         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__trb}{xhci\_trb}} trb;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01541}01541         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01542}01542 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01543}01543         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01544}01544 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01545}01545         trb.\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}} = htole64(dequeue\_ptr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01546}01546 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01547}01547         temp = \mbox{\hyperlink{xhci_8h_a448d248875e2ac0ef99d2f070a7a1729}{XHCI\_TRB\_2\_STREAM\_SET}}(stream\_id);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01548}01548         trb.\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}} = htole32(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01549}01549 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01550}01550         temp = \mbox{\hyperlink{xhci_8h_a414401db438c92fd85d7d5179712c75e}{XHCI\_TRB\_3\_TYPE\_SET}}(\mbox{\hyperlink{xhci_8h_a0cb9c7038b5fcc4a168dd57156f7a225}{XHCI\_TRB\_TYPE\_SET\_TR\_DEQUEUE}}) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01551}01551             \mbox{\hyperlink{xhci_8h_a90fb617e24880e59415aaff6f0fe14e3}{XHCI\_TRB\_3\_SLOT\_SET}}(slot\_id) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01552}01552             \mbox{\hyperlink{xhci_8h_afa33177cd67d9dd990fbb18bc04a045d}{XHCI\_TRB\_3\_EP\_SET}}(ep\_id);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01553}01553         trb.\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} = htole32(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01554}01554 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01555}01555         \textcolor{keywordflow}{return} (\mbox{\hyperlink{xhci_8c_aeb8e3310cbb12e5e7d422f38117dc73b}{xhci\_do\_command}}(sc, \&trb, 100 \textcolor{comment}{/* ms */}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01556}01556 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01557}01557 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01558}01558 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01559}\mbox{\hyperlink{xhci_8c_a7b2c3df0830d4cd7171b2a6f4fe351f3}{01559}} \mbox{\hyperlink{xhci_8c_a7b2c3df0830d4cd7171b2a6f4fe351f3}{xhci\_cmd\_stop\_ep}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc, uint8\_t suspend,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01560}01560     uint8\_t ep\_id, uint8\_t slot\_id)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01561}01561 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01562}01562         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__trb}{xhci\_trb}} trb;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01563}01563         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01564}01564 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01565}01565         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01566}01566 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01567}01567         trb.\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01568}01568         trb.\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01569}01569         temp = \mbox{\hyperlink{xhci_8h_a414401db438c92fd85d7d5179712c75e}{XHCI\_TRB\_3\_TYPE\_SET}}(\mbox{\hyperlink{xhci_8h_a3c89646d78400d3991441e10267a3b09}{XHCI\_TRB\_TYPE\_STOP\_EP}}) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01570}01570             \mbox{\hyperlink{xhci_8h_a90fb617e24880e59415aaff6f0fe14e3}{XHCI\_TRB\_3\_SLOT\_SET}}(slot\_id) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01571}01571             \mbox{\hyperlink{xhci_8h_afa33177cd67d9dd990fbb18bc04a045d}{XHCI\_TRB\_3\_EP\_SET}}(ep\_id);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01572}01572 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01573}01573         \textcolor{keywordflow}{if} (suspend)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01574}01574                 temp |= \mbox{\hyperlink{xhci_8h_abaaba36c5d0c1d3b50f464155c276489}{XHCI\_TRB\_3\_SUSP\_EP\_BIT}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01575}01575 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01576}01576         trb.\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} = htole32(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01577}01577 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01578}01578         \textcolor{keywordflow}{return} (\mbox{\hyperlink{xhci_8c_aeb8e3310cbb12e5e7d422f38117dc73b}{xhci\_do\_command}}(sc, \&trb, 100 \textcolor{comment}{/* ms */}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01579}01579 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01580}01580 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01581}01581 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01582}\mbox{\hyperlink{xhci_8c_ad369bf26b8730d48408bf25bf367f468}{01582}} \mbox{\hyperlink{xhci_8c_ad369bf26b8730d48408bf25bf367f468}{xhci\_cmd\_reset\_dev}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc, uint8\_t slot\_id)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01583}01583 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01584}01584         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__trb}{xhci\_trb}} trb;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01585}01585         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01586}01586 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01587}01587         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01588}01588 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01589}01589         trb.\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01590}01590         trb.\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01591}01591         temp = \mbox{\hyperlink{xhci_8h_a414401db438c92fd85d7d5179712c75e}{XHCI\_TRB\_3\_TYPE\_SET}}(\mbox{\hyperlink{xhci_8h_af381be32baccf626e00e4ec12eee1e4f}{XHCI\_TRB\_TYPE\_RESET\_DEVICE}}) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01592}01592             \mbox{\hyperlink{xhci_8h_a90fb617e24880e59415aaff6f0fe14e3}{XHCI\_TRB\_3\_SLOT\_SET}}(slot\_id);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01593}01593 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01594}01594         trb.\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} = htole32(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01595}01595 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01596}01596         \textcolor{keywordflow}{return} (\mbox{\hyperlink{xhci_8c_aeb8e3310cbb12e5e7d422f38117dc73b}{xhci\_do\_command}}(sc, \&trb, 100 \textcolor{comment}{/* ms */}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01597}01597 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01598}01598 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01599}01599 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01600}01600 \textcolor{comment}{ *      xhci\_interrupt -\/ XHCI interrupt handler}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01601}01601 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01602}01602 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01603}\mbox{\hyperlink{xhci_8c_ae78994eb0559b8dc21a1d11c751483cf}{01603}} \mbox{\hyperlink{xhci_8c_ae78994eb0559b8dc21a1d11c751483cf}{xhci\_interrupt}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01604}01604 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01605}01605         uint32\_t \mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01606}01606         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01607}01607 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01608}01608         \mbox{\hyperlink{usb__core_8h_a21dab1de8f52baf9fbf7617c6b1ec033}{USB\_BUS\_LOCK}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01609}01609 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01610}01610         \mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}} = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_aac4af15758e601077fbefb4465b0d8d7}{XHCI\_USBSTS}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01611}01611 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01612}01612         \textcolor{comment}{/* acknowledge interrupts, if any */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01613}01613         \textcolor{keywordflow}{if} (\mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}} != 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01614}01614                 \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_aac4af15758e601077fbefb4465b0d8d7}{XHCI\_USBSTS}}, \mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01615}01615                 DPRINTFN(16, \textcolor{stringliteral}{"{}real interrupt (status=0x\%08x)\(\backslash\)n"{}}, \mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01616}01616         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01617}01617 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01618}01618         temp = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, runt, \mbox{\hyperlink{xhcireg_8h_a6d4c1a2eb813b6c60026458dc7034526}{XHCI\_IMAN}}(0));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01619}01619 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01620}01620         \textcolor{comment}{/* force clearing of pending interrupts */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01621}01621         \textcolor{keywordflow}{if} (temp \& \mbox{\hyperlink{xhcireg_8h_a0d050d13db1059a45773ed0769ae117d}{XHCI\_IMAN\_INTR\_PEND}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01622}01622                 \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, runt, \mbox{\hyperlink{xhcireg_8h_a6d4c1a2eb813b6c60026458dc7034526}{XHCI\_IMAN}}(0), temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01623}01623 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01624}01624         \textcolor{comment}{/* check for event(s) */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01625}01625         \mbox{\hyperlink{xhci_8c_ad00a3e3c3a93f2ad2f96e7c08db75c83}{xhci\_interrupt\_poll}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01626}01626 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01627}01627         \textcolor{keywordflow}{if} (\mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}} \& (\mbox{\hyperlink{xhcireg_8h_a170e64bde9bb0790ea2fbe9f19338162}{XHCI\_STS\_PCD}} | \mbox{\hyperlink{xhcireg_8h_a0388c1acea4a4b50c5a61ebde8df68b0}{XHCI\_STS\_HCH}} |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01628}01628             \mbox{\hyperlink{xhcireg_8h_a560471703723a2e934a30e60b5b8934d}{XHCI\_STS\_HSE}} | \mbox{\hyperlink{xhcireg_8h_a28763f546507ec7ac06e27b9b24758f3}{XHCI\_STS\_HCE}})) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01629}01629                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}} \& \mbox{\hyperlink{xhcireg_8h_a170e64bde9bb0790ea2fbe9f19338162}{XHCI\_STS\_PCD}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01630}01630                         \mbox{\hyperlink{xhci_8c_a31e9863c6b47913bfde367b708bdca5d}{xhci\_root\_intr}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01631}01631                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01632}01632 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01633}01633                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}} \& \mbox{\hyperlink{xhcireg_8h_a0388c1acea4a4b50c5a61ebde8df68b0}{XHCI\_STS\_HCH}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01634}01634                         printf(\textcolor{stringliteral}{"{}\%s: host controller halted\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01635}01635                             \_\_FUNCTION\_\_);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01636}01636                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01637}01637 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01638}01638                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}} \& \mbox{\hyperlink{xhcireg_8h_a560471703723a2e934a30e60b5b8934d}{XHCI\_STS\_HSE}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01639}01639                         printf(\textcolor{stringliteral}{"{}\%s: host system error\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01640}01640                             \_\_FUNCTION\_\_);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01641}01641                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01642}01642 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01643}01643                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{xhci_8h_ade818037fd6c985038ff29656089758d}{status}} \& \mbox{\hyperlink{xhcireg_8h_a28763f546507ec7ac06e27b9b24758f3}{XHCI\_STS\_HCE}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01644}01644                         printf(\textcolor{stringliteral}{"{}\%s: host controller error\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01645}01645                            \_\_FUNCTION\_\_);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01646}01646                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01647}01647         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01648}01648         \mbox{\hyperlink{usb__core_8h_aadb0c32f6333b8a0715929ace5f550b2}{USB\_BUS\_UNLOCK}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01649}01649 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01650}01650 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01651}01651 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01652}01652 \textcolor{comment}{ *      xhci\_timeout -\/ XHCI timeout handler}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01653}01653 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01654}01654 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01655}\mbox{\hyperlink{xhci_8c_a35999b36530a5835ab3a475b358c2a76}{01655}} \mbox{\hyperlink{xhci_8c_a35999b36530a5835ab3a475b358c2a76}{xhci\_timeout}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01656}01656 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01657}01657         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer = arg;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01658}01658 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01659}01659         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}xfer=\%p\(\backslash\)n"{}}, xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01660}01660 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01661}01661         \mbox{\hyperlink{usb__core_8h_adf78e1178dd30ec4a8a53087fe6c7e02}{USB\_BUS\_LOCK\_ASSERT}}(xfer-\/>\mbox{\hyperlink{structusb__xfer_ad188b4cd79900e1cd04aba6c140e9ab3}{xroot}}-\/>\mbox{\hyperlink{structusb__xfer__root_a870218d57253f00f1e9baa19401c9b0c}{bus}}, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01662}01662 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01663}01663         \textcolor{comment}{/* transfer is transferred */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01664}01664         \mbox{\hyperlink{xhci_8c_a599f5f1237516bdefbf20695b1f8400c}{xhci\_device\_done}}(xfer, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945aeb31baaa7bf416e200f2a0d4ece60820}{USB\_ERR\_TIMEOUT}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01665}01665 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01666}01666 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01667}01667 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01668}\mbox{\hyperlink{xhci_8c_aa22a4e89f235d46a713288b1f0dc0257}{01668}} \mbox{\hyperlink{xhci_8c_aa22a4e89f235d46a713288b1f0dc0257}{xhci\_do\_poll}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__bus}{usb\_bus}} *bus)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01669}01669 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01670}01670         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(bus);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01671}01671 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01672}01672         \mbox{\hyperlink{usb__core_8h_a21dab1de8f52baf9fbf7617c6b1ec033}{USB\_BUS\_LOCK}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01673}01673         \mbox{\hyperlink{xhci_8c_ad00a3e3c3a93f2ad2f96e7c08db75c83}{xhci\_interrupt\_poll}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01674}01674         \mbox{\hyperlink{usb__core_8h_aadb0c32f6333b8a0715929ace5f550b2}{USB\_BUS\_UNLOCK}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01675}01675 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01676}01676 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01677}01677 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01678}\mbox{\hyperlink{xhci_8c_a89f9417bcfe9c8c03ed60726ae113390}{01678}} \mbox{\hyperlink{xhci_8c_a89f9417bcfe9c8c03ed60726ae113390}{xhci\_setup\_generic\_chain\_sub}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__std__temp}{xhci\_std\_temp}} *temp)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01679}01679 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01680}01680         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__search}{usb\_page\_search}} buf\_res;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01681}01681         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__td}{xhci\_td}} *td;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01682}01682         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__td}{xhci\_td}} *\mbox{\hyperlink{ohci_8h_a4173b5c34e0ac9c0b499c02d7e5a1b21}{td\_next}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01683}01683         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__td}{xhci\_td}} *td\_alt\_next;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01684}01684         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__td}{xhci\_td}} *td\_first;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01685}01685         uint32\_t buf\_offset;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01686}01686         uint32\_t average;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01687}01687         uint32\_t len\_old;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01688}01688         uint32\_t npkt\_off;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01689}01689         uint32\_t dword;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01690}01690         uint8\_t shortpkt\_old;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01691}01691         uint8\_t precompute;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01692}01692         uint8\_t x;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01693}01693 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01694}01694         td\_alt\_next = NULL;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01695}01695         buf\_offset = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01696}01696         shortpkt\_old = temp-\/>\mbox{\hyperlink{structxhci__std__temp_ae4c55d20a4f917c6f912e5c19d3eeea7}{shortpkt}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01697}01697         len\_old = temp-\/>\mbox{\hyperlink{structxhci__std__temp_add6b0d8ed853586f60e64b9459fd1e26}{len}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01698}01698         npkt\_off = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01699}01699         precompute = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01700}01700 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01701}01701 restart:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01702}01702 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01703}01703         td = temp-\/>\mbox{\hyperlink{structxhci__std__temp_a97640b5f307d3e536d453c14a4affd77}{td}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01704}01704         \mbox{\hyperlink{ohci_8h_a4173b5c34e0ac9c0b499c02d7e5a1b21}{td\_next}} = td\_first = temp-\/>\mbox{\hyperlink{structxhci__std__temp_a9ab0e210ab84dc7b1e7ef7a190807f69}{td\_next}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01705}01705 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01706}01706         \textcolor{keywordflow}{while} (1) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01707}01707                 \textcolor{keywordflow}{if} (temp-\/>\mbox{\hyperlink{structxhci__std__temp_add6b0d8ed853586f60e64b9459fd1e26}{len}} == 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01708}01708                         \textcolor{keywordflow}{if} (temp-\/>\mbox{\hyperlink{structxhci__std__temp_ae4c55d20a4f917c6f912e5c19d3eeea7}{shortpkt}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01709}01709                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01710}01710 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01711}01711                         \textcolor{comment}{/* send a Zero Length Packet, ZLP, last */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01712}01712 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01713}01713                         temp-\/>\mbox{\hyperlink{structxhci__std__temp_ae4c55d20a4f917c6f912e5c19d3eeea7}{shortpkt}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01714}01714                         average = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01715}01715 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01716}01716                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01717}01717                         average = temp-\/>\mbox{\hyperlink{structxhci__std__temp_a416d01cab8353ddcffb73180b6cefb36}{average}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01718}01718 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01719}01719                         \textcolor{keywordflow}{if} (temp-\/>\mbox{\hyperlink{structxhci__std__temp_add6b0d8ed853586f60e64b9459fd1e26}{len}} < average) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01720}01720                                 \textcolor{keywordflow}{if} (temp-\/>\mbox{\hyperlink{structxhci__std__temp_add6b0d8ed853586f60e64b9459fd1e26}{len}} \% temp-\/>\mbox{\hyperlink{structxhci__std__temp_a3f097828c3213bda781076ae2fbca2d2}{max\_packet\_size}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01721}01721                                         temp-\/>\mbox{\hyperlink{structxhci__std__temp_ae4c55d20a4f917c6f912e5c19d3eeea7}{shortpkt}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01722}01722                                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01723}01723                                 average = temp-\/>\mbox{\hyperlink{structxhci__std__temp_add6b0d8ed853586f60e64b9459fd1e26}{len}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01724}01724                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01725}01725                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01726}01726 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01727}01727                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{ohci_8h_a4173b5c34e0ac9c0b499c02d7e5a1b21}{td\_next}} == NULL)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01728}01728                         panic(\textcolor{stringliteral}{"{}\%s: out of XHCI transfer descriptors!"{}}, \_\_FUNCTION\_\_);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01729}01729 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01730}01730                 \textcolor{comment}{/* get next TD */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01731}01731 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01732}01732                 td = \mbox{\hyperlink{ohci_8h_a4173b5c34e0ac9c0b499c02d7e5a1b21}{td\_next}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01733}01733                 \mbox{\hyperlink{ohci_8h_a4173b5c34e0ac9c0b499c02d7e5a1b21}{td\_next}} = td-\/>\mbox{\hyperlink{structxhci__td_aaf4e303e8091c679002bb91a2203f7ad}{obj\_next}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01734}01734 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01735}01735                 \textcolor{comment}{/* check if we are pre-\/computing */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01736}01736 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01737}01737                 \textcolor{keywordflow}{if} (precompute) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01738}01738                         \textcolor{comment}{/* update remaining length */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01739}01739 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01740}01740                         temp-\/>\mbox{\hyperlink{structxhci__std__temp_add6b0d8ed853586f60e64b9459fd1e26}{len}} -\/= average;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01741}01741 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01742}01742                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01743}01743                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01744}01744                 \textcolor{comment}{/* fill out current TD */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01745}01745 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01746}01746                 td-\/>\mbox{\hyperlink{structxhci__td_a68bcdae31a91364bd83ee2eeb001b6ab}{len}} = average;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01747}01747                 td-\/>\mbox{\hyperlink{structxhci__td_adb1c8bba4f8650a5fa89a67d1a77e0db}{remainder}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01748}01748                 td-\/>\mbox{\hyperlink{structxhci__td_a6c52dc7bc931740cdde6b22406d33797}{status}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01749}01749 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01750}01750                 \textcolor{comment}{/* update remaining length */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01751}01751 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01752}01752                 temp-\/>\mbox{\hyperlink{structxhci__std__temp_add6b0d8ed853586f60e64b9459fd1e26}{len}} -\/= average;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01753}01753 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01754}01754                 \textcolor{comment}{/* reset TRB index */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01755}01755 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01756}01756                 x = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01757}01757 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01758}01758                 \textcolor{keywordflow}{if} (temp-\/>\mbox{\hyperlink{structxhci__std__temp_a472beaff68e74d92a131cf96f9ca6980}{trb\_type}} == \mbox{\hyperlink{xhci_8h_ad6c096edc9c25618a05c3fac352c5167}{XHCI\_TRB\_TYPE\_SETUP\_STAGE}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01759}01759                         \textcolor{comment}{/* immediate data */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01760}01760 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01761}01761                         \textcolor{keywordflow}{if} (average > 8)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01762}01762                                 average = 8;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01763}01763 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01764}01764                         td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[0].\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01765}01765 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01766}01766                         \mbox{\hyperlink{usb__busdma_8c_af52eece45b7868dbf58386f4c9e4eb9a}{usbd\_copy\_out}}(temp-\/>\mbox{\hyperlink{structxhci__std__temp_a68bcaf0634e7bc8003aba215fbcca3db}{pc}}, temp-\/>\mbox{\hyperlink{structxhci__std__temp_a55123af6322a622c819cfb61594134cc}{offset}} + buf\_offset, }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01767}01767                            (uint8\_t *)(uintptr\_t)\&td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[0].\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01768}01768                            average);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01769}01769 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01770}01770                         dword = \mbox{\hyperlink{xhci_8h_a05141f32fdc7363ee15d48772efbcc79}{XHCI\_TRB\_2\_BYTES\_SET}}(8) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01771}01771                             \mbox{\hyperlink{xhci_8h_ae6b4387fd4b6332a484747b7a001c1ed}{XHCI\_TRB\_2\_TDSZ\_SET}}(0) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01772}01772                             \mbox{\hyperlink{xhci_8h_a71fea2699e725eecdaabc99bcd675fb5}{XHCI\_TRB\_2\_IRQ\_SET}}(0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01773}01773 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01774}01774                         td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[0].\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}} = htole32(dword);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01775}01775 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01776}01776                         dword = \mbox{\hyperlink{xhci_8h_a414401db438c92fd85d7d5179712c75e}{XHCI\_TRB\_3\_TYPE\_SET}}(\mbox{\hyperlink{xhci_8h_ad6c096edc9c25618a05c3fac352c5167}{XHCI\_TRB\_TYPE\_SETUP\_STAGE}}) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01777}01777                           \mbox{\hyperlink{xhci_8h_a76bb7fc2f4348e99ffa6de837e33555a}{XHCI\_TRB\_3\_IDT\_BIT}} | \mbox{\hyperlink{xhci_8h_aa99a6646570c85221b01f657524071ed}{XHCI\_TRB\_3\_CYCLE\_BIT}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01778}01778 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01779}01779                         \textcolor{comment}{/* check wLength */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01780}01780                         \textcolor{keywordflow}{if} (td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[0].\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}} \&}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01781}01781                            htole64(\mbox{\hyperlink{xhci_8h_a067384556fc991f9c4772a57e3a6404f}{XHCI\_TRB\_0\_WLENGTH\_MASK}})) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01782}01782                                 \textcolor{keywordflow}{if} (td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[0].\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}} \&}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01783}01783                                     htole64(\mbox{\hyperlink{xhci_8h_a811656468d78892c6026c01c55719ae5}{XHCI\_TRB\_0\_DIR\_IN\_MASK}}))}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01784}01784                                         dword |= \mbox{\hyperlink{xhci_8h_a81894c060f2ba5cbd3d48b5b56c1d5af}{XHCI\_TRB\_3\_TRT\_IN}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01785}01785                                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01786}01786                                         dword |= \mbox{\hyperlink{xhci_8h_ae41e6075670de7b48242012569c8efdc}{XHCI\_TRB\_3\_TRT\_OUT}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01787}01787                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01788}01788 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01789}01789                         td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[0].\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} = htole32(dword);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01790}01790 \textcolor{preprocessor}{\#ifdef USB\_DEBUG}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01791}01791                         xhci\_dump\_trb(\&td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[x]);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01792}01792 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01793}01793                         x++;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01794}01794 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01795}01795                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{do} \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01796}01796                         uint32\_t npkt;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01797}01797 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01798}01798                         \textcolor{comment}{/* fill out buffer pointers */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01799}01799 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01800}01800                         \textcolor{keywordflow}{if} (average == 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01801}01801                                 memset(\&buf\_res, 0, \textcolor{keyword}{sizeof}(buf\_res));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01802}01802                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01803}01803                                 \mbox{\hyperlink{usb__busdma_8c_ab4f9d07714be540b6d002b44b3716bb2}{usbd\_get\_page}}(temp-\/>\mbox{\hyperlink{structxhci__std__temp_a68bcaf0634e7bc8003aba215fbcca3db}{pc}}, temp-\/>\mbox{\hyperlink{structxhci__std__temp_a55123af6322a622c819cfb61594134cc}{offset}} +}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01804}01804                                     buf\_offset, \&buf\_res);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01805}01805 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01806}01806                                 \textcolor{comment}{/* get length to end of page */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01807}01807                                 \textcolor{keywordflow}{if} (buf\_res.\mbox{\hyperlink{structusb__page__search_add91edb75c219e6992906292ae22bb26}{length}} > average)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01808}01808                                         buf\_res.\mbox{\hyperlink{structusb__page__search_add91edb75c219e6992906292ae22bb26}{length}} = average;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01809}01809 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01810}01810                                 \textcolor{comment}{/* check for maximum length */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01811}01811                                 \textcolor{keywordflow}{if} (buf\_res.\mbox{\hyperlink{structusb__page__search_add91edb75c219e6992906292ae22bb26}{length}} > \mbox{\hyperlink{xhci_8h_a83886c410fd31eb63b58ce4c6fbffb56}{XHCI\_TD\_PAGE\_SIZE}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01812}01812                                         buf\_res.\mbox{\hyperlink{structusb__page__search_add91edb75c219e6992906292ae22bb26}{length}} = \mbox{\hyperlink{xhci_8h_a83886c410fd31eb63b58ce4c6fbffb56}{XHCI\_TD\_PAGE\_SIZE}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01813}01813 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01814}01814                                 npkt\_off += buf\_res.\mbox{\hyperlink{structusb__page__search_add91edb75c219e6992906292ae22bb26}{length}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01815}01815                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01816}01816 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01817}01817                         \textcolor{comment}{/* set up npkt */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01818}01818                         npkt = howmany(len\_old -\/ npkt\_off,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01819}01819                                        temp-\/>\mbox{\hyperlink{structxhci__std__temp_a3f097828c3213bda781076ae2fbca2d2}{max\_packet\_size}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01820}01820 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01821}01821                         \textcolor{keywordflow}{if} (npkt == 0)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01822}01822                                 npkt = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01823}01823                         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (npkt > 31)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01824}01824                                 npkt = 31;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01825}01825 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01826}01826                         \textcolor{comment}{/* fill out TRB's */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01827}01827                         td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[x].\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}} =}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01828}01828                             htole64((uint64\_t)buf\_res.physaddr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01829}01829 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01830}01830                         dword =}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01831}01831                           \mbox{\hyperlink{xhci_8h_a05141f32fdc7363ee15d48772efbcc79}{XHCI\_TRB\_2\_BYTES\_SET}}(buf\_res.\mbox{\hyperlink{structusb__page__search_add91edb75c219e6992906292ae22bb26}{length}}) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01832}01832                           \mbox{\hyperlink{xhci_8h_ae6b4387fd4b6332a484747b7a001c1ed}{XHCI\_TRB\_2\_TDSZ\_SET}}(npkt) | }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01833}01833                           \mbox{\hyperlink{xhci_8h_a71fea2699e725eecdaabc99bcd675fb5}{XHCI\_TRB\_2\_IRQ\_SET}}(0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01834}01834 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01835}01835                         td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[x].\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}} = htole32(dword);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01836}01836 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01837}01837                         \textcolor{keywordflow}{switch} (temp-\/>\mbox{\hyperlink{structxhci__std__temp_a472beaff68e74d92a131cf96f9ca6980}{trb\_type}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01838}01838                         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8h_a1529c577462015d09c815ba9e222eca5}{XHCI\_TRB\_TYPE\_ISOCH}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01839}01839                                 dword = \mbox{\hyperlink{xhci_8h_a7bbb1e28c643bce00a702f40c8b985bf}{XHCI\_TRB\_3\_CHAIN\_BIT}} | \mbox{\hyperlink{xhci_8h_aa99a6646570c85221b01f657524071ed}{XHCI\_TRB\_3\_CYCLE\_BIT}} |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01840}01840                                     \mbox{\hyperlink{xhci_8h_afd8bc529ac7043200283561e3c675e66}{XHCI\_TRB\_3\_TBC\_SET}}(temp-\/>\mbox{\hyperlink{structxhci__std__temp_a940c8282c529ed2045cf59f23baf6d19}{tbc}}) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01841}01841                                     \mbox{\hyperlink{xhci_8h_a17ddb6beae2f4813842807a7a706490f}{XHCI\_TRB\_3\_TLBPC\_SET}}(temp-\/>\mbox{\hyperlink{structxhci__std__temp_a6d1e95771a382f5a768300fa1d31f42b}{tlbpc}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01842}01842                                 \textcolor{keywordflow}{if} (td != td\_first) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01843}01843                                         dword |= \mbox{\hyperlink{xhci_8h_a414401db438c92fd85d7d5179712c75e}{XHCI\_TRB\_3\_TYPE\_SET}}(\mbox{\hyperlink{xhci_8h_a634876bb60ba63b046c9bc8d302875e1}{XHCI\_TRB\_TYPE\_NORMAL}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01844}01844                                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (temp-\/>\mbox{\hyperlink{structxhci__std__temp_ac7fad8d4d9d825a7f5e564d5df88f988}{do\_isoc\_sync}} != 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01845}01845                                         temp-\/>\mbox{\hyperlink{structxhci__std__temp_ac7fad8d4d9d825a7f5e564d5df88f988}{do\_isoc\_sync}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01846}01846                                         \textcolor{comment}{/* wait until "{}isoc\_frame"{} */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01847}01847                                         dword |= \mbox{\hyperlink{xhci_8h_a414401db438c92fd85d7d5179712c75e}{XHCI\_TRB\_3\_TYPE\_SET}}(\mbox{\hyperlink{xhci_8h_a1529c577462015d09c815ba9e222eca5}{XHCI\_TRB\_TYPE\_ISOCH}}) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01848}01848                                             \mbox{\hyperlink{xhci_8h_a4c55ecdd11366e019c799a79703ee88f}{XHCI\_TRB\_3\_FRID\_SET}}(temp-\/>\mbox{\hyperlink{structxhci__std__temp_aa72c74487f0ca9d8950d8da8ee06ac24}{isoc\_frame}} / 8);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01849}01849                                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01850}01850                                         \textcolor{comment}{/* start data transfer at next interval */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01851}01851                                         dword |= \mbox{\hyperlink{xhci_8h_a414401db438c92fd85d7d5179712c75e}{XHCI\_TRB\_3\_TYPE\_SET}}(\mbox{\hyperlink{xhci_8h_a1529c577462015d09c815ba9e222eca5}{XHCI\_TRB\_TYPE\_ISOCH}}) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01852}01852                                             \mbox{\hyperlink{xhci_8h_ab921883ca201b0be2126423781201b49}{XHCI\_TRB\_3\_ISO\_SIA\_BIT}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01853}01853                                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01854}01854                                 \textcolor{keywordflow}{if} (temp-\/>\mbox{\hyperlink{structxhci__std__temp_a7ddf0ca9044a87d90f1e2ff9e638b10e}{direction}} == \mbox{\hyperlink{usb_8h_a72bb077a860132c175c166f344c75893}{UE\_DIR\_IN}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01855}01855                                         dword |= \mbox{\hyperlink{xhci_8h_aa773f9a91025ec9b534a349de6033b00}{XHCI\_TRB\_3\_ISP\_BIT}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01856}01856                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01857}01857                         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8h_afc512c8717943327112525d5c8673a03}{XHCI\_TRB\_TYPE\_DATA\_STAGE}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01858}01858                                 dword = \mbox{\hyperlink{xhci_8h_a7bbb1e28c643bce00a702f40c8b985bf}{XHCI\_TRB\_3\_CHAIN\_BIT}} | \mbox{\hyperlink{xhci_8h_aa99a6646570c85221b01f657524071ed}{XHCI\_TRB\_3\_CYCLE\_BIT}} |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01859}01859                                     \mbox{\hyperlink{xhci_8h_a414401db438c92fd85d7d5179712c75e}{XHCI\_TRB\_3\_TYPE\_SET}}(\mbox{\hyperlink{xhci_8h_afc512c8717943327112525d5c8673a03}{XHCI\_TRB\_TYPE\_DATA\_STAGE}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01860}01860                                 \textcolor{keywordflow}{if} (temp-\/>\mbox{\hyperlink{structxhci__std__temp_a7ddf0ca9044a87d90f1e2ff9e638b10e}{direction}} == \mbox{\hyperlink{usb_8h_a72bb077a860132c175c166f344c75893}{UE\_DIR\_IN}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01861}01861                                         dword |= \mbox{\hyperlink{xhci_8h_a03bf1378b83b960ac3c3fa054f9c5998}{XHCI\_TRB\_3\_DIR\_IN}} | \mbox{\hyperlink{xhci_8h_aa773f9a91025ec9b534a349de6033b00}{XHCI\_TRB\_3\_ISP\_BIT}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01862}01862                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01863}01863 \textcolor{comment}{                                 * Section 3.2.9 in the XHCI}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01864}01864 \textcolor{comment}{                                 * specification about control}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01865}01865 \textcolor{comment}{                                 * transfers says that we should use a}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01866}01866 \textcolor{comment}{                                 * normal-\/TRB if there are more TRBs}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01867}01867 \textcolor{comment}{                                 * extending the data-\/stage}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01868}01868 \textcolor{comment}{                                 * TRB. Update the "{}trb\_type"{}.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01869}01869 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01870}01870                                 temp-\/>\mbox{\hyperlink{structxhci__std__temp_a472beaff68e74d92a131cf96f9ca6980}{trb\_type}} = \mbox{\hyperlink{xhci_8h_a634876bb60ba63b046c9bc8d302875e1}{XHCI\_TRB\_TYPE\_NORMAL}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01871}01871                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01872}01872                         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8h_aa4fd9d06964d91c25cd512fea639a184}{XHCI\_TRB\_TYPE\_STATUS\_STAGE}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01873}01873                                 dword = \mbox{\hyperlink{xhci_8h_a7bbb1e28c643bce00a702f40c8b985bf}{XHCI\_TRB\_3\_CHAIN\_BIT}} | \mbox{\hyperlink{xhci_8h_aa99a6646570c85221b01f657524071ed}{XHCI\_TRB\_3\_CYCLE\_BIT}} |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01874}01874                                     \mbox{\hyperlink{xhci_8h_a414401db438c92fd85d7d5179712c75e}{XHCI\_TRB\_3\_TYPE\_SET}}(\mbox{\hyperlink{xhci_8h_aa4fd9d06964d91c25cd512fea639a184}{XHCI\_TRB\_TYPE\_STATUS\_STAGE}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01875}01875                                 \textcolor{keywordflow}{if} (temp-\/>\mbox{\hyperlink{structxhci__std__temp_a7ddf0ca9044a87d90f1e2ff9e638b10e}{direction}} == \mbox{\hyperlink{usb_8h_a72bb077a860132c175c166f344c75893}{UE\_DIR\_IN}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01876}01876                                         dword |= \mbox{\hyperlink{xhci_8h_a03bf1378b83b960ac3c3fa054f9c5998}{XHCI\_TRB\_3\_DIR\_IN}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01877}01877                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01878}01878                         \textcolor{keywordflow}{default}:        \textcolor{comment}{/* XHCI\_TRB\_TYPE\_NORMAL */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01879}01879                                 dword = \mbox{\hyperlink{xhci_8h_a7bbb1e28c643bce00a702f40c8b985bf}{XHCI\_TRB\_3\_CHAIN\_BIT}} | \mbox{\hyperlink{xhci_8h_aa99a6646570c85221b01f657524071ed}{XHCI\_TRB\_3\_CYCLE\_BIT}} |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01880}01880                                     \mbox{\hyperlink{xhci_8h_a414401db438c92fd85d7d5179712c75e}{XHCI\_TRB\_3\_TYPE\_SET}}(\mbox{\hyperlink{xhci_8h_a634876bb60ba63b046c9bc8d302875e1}{XHCI\_TRB\_TYPE\_NORMAL}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01881}01881                                 \textcolor{keywordflow}{if} (temp-\/>\mbox{\hyperlink{structxhci__std__temp_a7ddf0ca9044a87d90f1e2ff9e638b10e}{direction}} == \mbox{\hyperlink{usb_8h_a72bb077a860132c175c166f344c75893}{UE\_DIR\_IN}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01882}01882                                         dword |= \mbox{\hyperlink{xhci_8h_aa773f9a91025ec9b534a349de6033b00}{XHCI\_TRB\_3\_ISP\_BIT}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01883}01883                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01884}01884                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01885}01885                         td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[x].\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} = htole32(dword);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01886}01886 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01887}01887                         average -\/= buf\_res.\mbox{\hyperlink{structusb__page__search_add91edb75c219e6992906292ae22bb26}{length}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01888}01888                         buf\_offset += buf\_res.\mbox{\hyperlink{structusb__page__search_add91edb75c219e6992906292ae22bb26}{length}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01889}01889 \textcolor{preprocessor}{\#ifdef USB\_DEBUG}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01890}01890                         xhci\_dump\_trb(\&td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[x]);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01891}01891 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01892}01892                         x++;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01893}01893 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01894}01894                 \} \textcolor{keywordflow}{while} (average != 0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01895}01895 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01896}01896                 td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[x-\/1].\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} |= htole32(\mbox{\hyperlink{xhci_8h_a0e23ab21bb123ac78940cde5c5398809}{XHCI\_TRB\_3\_IOC\_BIT}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01897}01897 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01898}01898                 \textcolor{comment}{/* store number of data TRB's */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01899}01899 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01900}01900                 td-\/>\mbox{\hyperlink{structxhci__td_a8d57ed1abb0a3eaf8f5695c4ae4db737}{ntrb}} = x;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01901}01901 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01902}01902                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}NTRB=\%u\(\backslash\)n"{}}, x);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01903}01903 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01904}01904                 \textcolor{comment}{/* fill out link TRB */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01905}01905 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01906}01906                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{ohci_8h_a4173b5c34e0ac9c0b499c02d7e5a1b21}{td\_next}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01907}01907                         \textcolor{comment}{/* link the current TD with the next one */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01908}01908                         td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[x].\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}} = htole64((uint64\_t)\mbox{\hyperlink{ohci_8h_a4173b5c34e0ac9c0b499c02d7e5a1b21}{td\_next}}-\/>td\_self);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01909}01909                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}LINK=0x\%08llx\(\backslash\)n"{}}, (\textcolor{keywordtype}{long} \textcolor{keywordtype}{long})\mbox{\hyperlink{ohci_8h_a4173b5c34e0ac9c0b499c02d7e5a1b21}{td\_next}}-\/>td\_self);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01910}01910                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01911}01911                         \textcolor{comment}{/* this field will get updated later */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01912}01912                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}NOLINK\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01913}01913                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01914}01914 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01915}01915                 dword = \mbox{\hyperlink{xhci_8h_a71fea2699e725eecdaabc99bcd675fb5}{XHCI\_TRB\_2\_IRQ\_SET}}(0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01916}01916 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01917}01917                 td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[x].\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}} = htole32(dword);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01918}01918 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01919}01919                 dword = \mbox{\hyperlink{xhci_8h_a414401db438c92fd85d7d5179712c75e}{XHCI\_TRB\_3\_TYPE\_SET}}(\mbox{\hyperlink{xhci_8h_ad488af824032c353f8b7630f7f8abc7f}{XHCI\_TRB\_TYPE\_LINK}}) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01920}01920                     \mbox{\hyperlink{xhci_8h_aa99a6646570c85221b01f657524071ed}{XHCI\_TRB\_3\_CYCLE\_BIT}} | \mbox{\hyperlink{xhci_8h_a0e23ab21bb123ac78940cde5c5398809}{XHCI\_TRB\_3\_IOC\_BIT}} |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01921}01921                     \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01922}01922 \textcolor{comment}{                     * CHAIN-\/BIT: Ensure that a multi-\/TRB IN-\/endpoint}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01923}01923 \textcolor{comment}{                     * frame only receives a single short packet event}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01924}01924 \textcolor{comment}{                     * by setting the CHAIN bit in the LINK field. In}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01925}01925 \textcolor{comment}{                     * addition some XHCI controllers have problems}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01926}01926 \textcolor{comment}{                     * sending a ZLP unless the CHAIN-\/BIT is set in}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01927}01927 \textcolor{comment}{                     * the LINK TRB.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01928}01928 \textcolor{comment}{                     */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01929}01929                     \mbox{\hyperlink{xhci_8h_a7bbb1e28c643bce00a702f40c8b985bf}{XHCI\_TRB\_3\_CHAIN\_BIT}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01930}01930 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01931}01931                 td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[x].\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} = htole32(dword);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01932}01932 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01933}01933                 td-\/>\mbox{\hyperlink{structxhci__td_a1905030d8977ae3cafb1582ac8966099}{alt\_next}} = td\_alt\_next;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01934}01934 \textcolor{preprocessor}{\#ifdef USB\_DEBUG}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01935}01935                 xhci\_dump\_trb(\&td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[x]);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01936}01936 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01937}01937                 \mbox{\hyperlink{usb__busdma_8h_a988a5299f521e8a8d94a68a03015bd77}{usb\_pc\_cpu\_flush}}(td-\/>\mbox{\hyperlink{structxhci__td_a933fec23ad2794824d084b5a78397a87}{page\_cache}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01938}01938         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01939}01939 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01940}01940         \textcolor{keywordflow}{if} (precompute) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01941}01941                 precompute = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01942}01942 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01943}01943                 \textcolor{comment}{/* set up alt next pointer, if any */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01944}01944                 \textcolor{keywordflow}{if} (temp-\/>\mbox{\hyperlink{structxhci__std__temp_a3443c5aa093ec654f4eba646894fad0b}{last\_frame}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01945}01945                         td\_alt\_next = NULL;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01946}01946                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01947}01947                         \textcolor{comment}{/* we use this field internally */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01948}01948                         td\_alt\_next = \mbox{\hyperlink{ohci_8h_a4173b5c34e0ac9c0b499c02d7e5a1b21}{td\_next}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01949}01949                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01950}01950 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01951}01951                 \textcolor{comment}{/* restore */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01952}01952                 temp-\/>\mbox{\hyperlink{structxhci__std__temp_ae4c55d20a4f917c6f912e5c19d3eeea7}{shortpkt}} = shortpkt\_old;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01953}01953                 temp-\/>\mbox{\hyperlink{structxhci__std__temp_add6b0d8ed853586f60e64b9459fd1e26}{len}} = len\_old;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01954}01954                 \textcolor{keywordflow}{goto} restart;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01955}01955         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01956}01956 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01957}01957         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01958}01958 \textcolor{comment}{         * Remove cycle bit from the first TRB if we are}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01959}01959 \textcolor{comment}{         * stepping them:}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01960}01960 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01961}01961         \textcolor{keywordflow}{if} (temp-\/>\mbox{\hyperlink{structxhci__std__temp_a81162b8d3cdd84242fab306cf671199d}{step\_td}} != 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01962}01962                 td\_first-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[0].\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} \&= \string~htole32(\mbox{\hyperlink{xhci_8h_aa99a6646570c85221b01f657524071ed}{XHCI\_TRB\_3\_CYCLE\_BIT}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01963}01963                 \mbox{\hyperlink{usb__busdma_8h_a988a5299f521e8a8d94a68a03015bd77}{usb\_pc\_cpu\_flush}}(td\_first-\/>\mbox{\hyperlink{structxhci__td_a933fec23ad2794824d084b5a78397a87}{page\_cache}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01964}01964         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01965}01965 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01966}01966         \textcolor{comment}{/* clear TD SIZE to zero, hence this is the last TRB */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01967}01967         \textcolor{comment}{/* remove chain bit because this is the last data TRB in the chain */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01968}01968         td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[td-\/>\mbox{\hyperlink{structxhci__td_a8d57ed1abb0a3eaf8f5695c4ae4db737}{ntrb}} -\/ 1].\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}} \&= \string~htole32(\mbox{\hyperlink{xhci_8h_ae6b4387fd4b6332a484747b7a001c1ed}{XHCI\_TRB\_2\_TDSZ\_SET}}(31));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01969}01969         td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[td-\/>\mbox{\hyperlink{structxhci__td_a8d57ed1abb0a3eaf8f5695c4ae4db737}{ntrb}} -\/ 1].\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} \&= \string~htole32(\mbox{\hyperlink{xhci_8h_a7bbb1e28c643bce00a702f40c8b985bf}{XHCI\_TRB\_3\_CHAIN\_BIT}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01970}01970         \textcolor{comment}{/* remove CHAIN-\/BIT from last LINK TRB */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01971}01971         td-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[td-\/>\mbox{\hyperlink{structxhci__td_a8d57ed1abb0a3eaf8f5695c4ae4db737}{ntrb}}].\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} \&= \string~htole32(\mbox{\hyperlink{xhci_8h_a7bbb1e28c643bce00a702f40c8b985bf}{XHCI\_TRB\_3\_CHAIN\_BIT}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01972}01972 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01973}01973         \mbox{\hyperlink{usb__busdma_8h_a988a5299f521e8a8d94a68a03015bd77}{usb\_pc\_cpu\_flush}}(td-\/>\mbox{\hyperlink{structxhci__td_a933fec23ad2794824d084b5a78397a87}{page\_cache}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01974}01974 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01975}01975         temp-\/>\mbox{\hyperlink{structxhci__std__temp_a97640b5f307d3e536d453c14a4affd77}{td}} = td;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01976}01976         temp-\/>\mbox{\hyperlink{structxhci__std__temp_a9ab0e210ab84dc7b1e7ef7a190807f69}{td\_next}} = \mbox{\hyperlink{ohci_8h_a4173b5c34e0ac9c0b499c02d7e5a1b21}{td\_next}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01977}01977 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01978}01978 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01979}01979 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01980}\mbox{\hyperlink{xhci_8c_a952ecf0f25dda140516aa09999937a5a}{01980}} \mbox{\hyperlink{xhci_8c_a952ecf0f25dda140516aa09999937a5a}{xhci\_setup\_generic\_chain}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01981}01981 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01982}01982         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__std__temp}{xhci\_std\_temp}} temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01983}01983         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__td}{xhci\_td}} *td;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01984}01984         uint32\_t x;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01985}01985         uint32\_t y;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01986}01986         uint8\_t mult;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01987}01987 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01988}01988         temp.\mbox{\hyperlink{structxhci__std__temp_ac7fad8d4d9d825a7f5e564d5df88f988}{do\_isoc\_sync}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01989}01989         temp.\mbox{\hyperlink{structxhci__std__temp_a81162b8d3cdd84242fab306cf671199d}{step\_td}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01990}01990         temp.\mbox{\hyperlink{structxhci__std__temp_a940c8282c529ed2045cf59f23baf6d19}{tbc}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01991}01991         temp.\mbox{\hyperlink{structxhci__std__temp_a6d1e95771a382f5a768300fa1d31f42b}{tlbpc}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01992}01992         temp.\mbox{\hyperlink{structxhci__std__temp_a416d01cab8353ddcffb73180b6cefb36}{average}} = xfer-\/>\mbox{\hyperlink{structusb__xfer_ad26ff9271d8a65e58ecec095be9cc78d}{max\_hc\_frame\_size}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01993}01993         temp.\mbox{\hyperlink{structxhci__std__temp_a3f097828c3213bda781076ae2fbca2d2}{max\_packet\_size}} = xfer-\/>\mbox{\hyperlink{structusb__xfer_aefcde8a630b7adefe68cc72e7e7a5bb5}{max\_packet\_size}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01994}01994         temp.\mbox{\hyperlink{structxhci__std__temp_a3c5f08c10a5b2a98578c1343a2d1d453}{sc}} = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(xfer-\/>\mbox{\hyperlink{structusb__xfer_ad188b4cd79900e1cd04aba6c140e9ab3}{xroot}}-\/>\mbox{\hyperlink{structusb__xfer__root_a870218d57253f00f1e9baa19401c9b0c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01995}01995         temp.\mbox{\hyperlink{structxhci__std__temp_a68bcaf0634e7bc8003aba215fbcca3db}{pc}} = NULL;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01996}01996         temp.\mbox{\hyperlink{structxhci__std__temp_a3443c5aa093ec654f4eba646894fad0b}{last\_frame}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01997}01997         temp.\mbox{\hyperlink{structxhci__std__temp_a55123af6322a622c819cfb61594134cc}{offset}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01998}01998         temp.\mbox{\hyperlink{structxhci__std__temp_a8073e2d949efe0ab7c52c4699b0816d9}{multishort}} = xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a5367e64daae30f55ec887872d577fa80}{isochronous\_xfr}} ||}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l01999}01999             xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a777cf7dd18178f84b0d6e0a086f72a7a}{control\_xfr}} ||}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02000}02000             xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a1023a81a83c7acfbe3134100363e7fde}{short\_frames\_ok}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02001}02001 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02002}02002         \textcolor{comment}{/* toggle the DMA set we are using */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02003}02003         xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a7574b7503818fc7c9e8f08fb5919a373}{curr\_dma\_set}} \string^= 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02004}02004 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02005}02005         \textcolor{comment}{/* get next DMA set */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02006}02006         td = xfer-\/>\mbox{\hyperlink{structusb__xfer_a68f3cea7860d801fe4e03b3301c9381d}{td\_start}}[xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a7574b7503818fc7c9e8f08fb5919a373}{curr\_dma\_set}}];}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02007}02007 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02008}02008         temp.\mbox{\hyperlink{structxhci__std__temp_a97640b5f307d3e536d453c14a4affd77}{td}} = NULL;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02009}02009         temp.\mbox{\hyperlink{structxhci__std__temp_a9ab0e210ab84dc7b1e7ef7a190807f69}{td\_next}} = td;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02010}02010 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02011}02011         xfer-\/>\mbox{\hyperlink{structusb__xfer_ae7adef379254c2ca0c87f265c59f5f5c}{td\_transfer\_first}} = td;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02012}02012         xfer-\/>\mbox{\hyperlink{structusb__xfer_ab03dbdacd225824d88b55ea51d0434e1}{td\_transfer\_cache}} = td;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02013}02013 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02014}02014         \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a5367e64daae30f55ec887872d577fa80}{isochronous\_xfr}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02015}02015                 uint8\_t shift;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02016}02016 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02017}02017                 \textcolor{comment}{/* compute multiplier for ISOCHRONOUS transfers */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02018}02018                 mult = xfer-\/>\mbox{\hyperlink{structusb__xfer_a8de3fd948d496c7901b307b13a1c6e99}{endpoint}}-\/>\mbox{\hyperlink{structusb__endpoint_a702da1f344a591607260d638613a43ff}{ecomp}} ?}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02019}02019                     \mbox{\hyperlink{usb_8h_ae54fa22265bd721ecfb464b6369c36ef}{UE\_GET\_SS\_ISO\_MULT}}(xfer-\/>\mbox{\hyperlink{structusb__xfer_a8de3fd948d496c7901b307b13a1c6e99}{endpoint}}-\/>\mbox{\hyperlink{structusb__endpoint_a702da1f344a591607260d638613a43ff}{ecomp}}-\/>\mbox{\hyperlink{structusb__endpoint__ss__comp__descriptor_a86c44b415c00a6225bda0e34313336d1}{bmAttributes}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02020}02020                     : 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02021}02021                 \textcolor{comment}{/* check for USB 2.0 multiplier */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02022}02022                 \textcolor{keywordflow}{if} (mult == 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02023}02023                         mult = (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8de3fd948d496c7901b307b13a1c6e99}{endpoint}}-\/>\mbox{\hyperlink{structusb__endpoint_af3b96b9fe1e612b303833c2e2d0365e1}{edesc}}-\/>}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02024}02024                             wMaxPacketSize[1] >> 3) \& 3;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02025}02025                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02026}02026                 \textcolor{comment}{/* range check */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02027}02027                 \textcolor{keywordflow}{if} (mult > 2)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02028}02028                         mult = 3;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02029}02029                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02030}02030                         mult++;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02031}02031 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02032}02032                 x = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(temp.\mbox{\hyperlink{structxhci__std__temp_a3c5f08c10a5b2a98578c1343a2d1d453}{sc}}, runt, \mbox{\hyperlink{xhcireg_8h_aeda9ef077a3022d8d1c5ade54b32c960}{XHCI\_MFINDEX}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02033}02033 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02034}02034                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}MFINDEX=0x\%08x IST=0x\%x\(\backslash\)n"{}}, x, temp.\mbox{\hyperlink{structxhci__std__temp_a3c5f08c10a5b2a98578c1343a2d1d453}{sc}}-\/>\mbox{\hyperlink{structxhci__softc_a1470713117661f8dac211925d11ba183}{sc\_ist}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02035}02035 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02036}02036                 \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usb__device_8c_a7aed6ff31c86f304cb29317095a0de1c}{usbd\_get\_speed}}(xfer-\/>\mbox{\hyperlink{structusb__xfer_ad188b4cd79900e1cd04aba6c140e9ab3}{xroot}}-\/>\mbox{\hyperlink{structusb__xfer__root_ad636fcdafa42c174cdf281bb144b1e67}{udev}})) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02037}02037                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a97e7c882fa8cd21898173a29471616ffa0f17d0b9928086c6114fea73e08f1780}{USB\_SPEED\_FULL}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02038}02038                         shift = 3;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02039}02039                         temp.\mbox{\hyperlink{structxhci__std__temp_a0aec911700f80d4c6e75f88e6e38b9e0}{isoc\_delta}} = 8;  \textcolor{comment}{/* 1ms */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02040}02040                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02041}02041                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02042}02042                         shift = \mbox{\hyperlink{usb__transfer_8c_a479907ed14a6a7e05e1409a19562b8c2}{usbd\_xfer\_get\_fps\_shift}}(xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02043}02043                         temp.\mbox{\hyperlink{structxhci__std__temp_a0aec911700f80d4c6e75f88e6e38b9e0}{isoc\_delta}} = 1U << shift;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02044}02044                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02045}02045                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02046}02046 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02047}02047                 \textcolor{comment}{/* Compute isochronous scheduling threshold. */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02048}02048                 \textcolor{keywordflow}{if} (temp.\mbox{\hyperlink{structxhci__std__temp_a3c5f08c10a5b2a98578c1343a2d1d453}{sc}}-\/>\mbox{\hyperlink{structxhci__softc_a1470713117661f8dac211925d11ba183}{sc\_ist}} \& 8)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02049}02049                         y = (temp.\mbox{\hyperlink{structxhci__std__temp_a3c5f08c10a5b2a98578c1343a2d1d453}{sc}}-\/>\mbox{\hyperlink{structxhci__softc_a1470713117661f8dac211925d11ba183}{sc\_ist}} \& 7) << 3;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02050}02050                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02051}02051                         y = (temp.\mbox{\hyperlink{structxhci__std__temp_a3c5f08c10a5b2a98578c1343a2d1d453}{sc}}-\/>\mbox{\hyperlink{structxhci__softc_a1470713117661f8dac211925d11ba183}{sc\_ist}} \& 7);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02052}02052 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02053}02053                 \textcolor{comment}{/* Range check the IST. */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02054}02054                 \textcolor{keywordflow}{if} (y < 8) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02055}02055                         y = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02056}02056                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (y > 15) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02057}02057                         DPRINTFN(3, \textcolor{stringliteral}{"{}IST(\%d) is too big!\(\backslash\)n"{}}, temp.\mbox{\hyperlink{structxhci__std__temp_a3c5f08c10a5b2a98578c1343a2d1d453}{sc}}-\/>\mbox{\hyperlink{structxhci__softc_a1470713117661f8dac211925d11ba183}{sc\_ist}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02058}02058                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02059}02059 \textcolor{comment}{                         * The USB stack minimum isochronous transfer}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02060}02060 \textcolor{comment}{                         * size is typically 2x2 ms of payload. If the}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02061}02061 \textcolor{comment}{                         * IST makes is above 15 microframes, we have}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02062}02062 \textcolor{comment}{                         * an effective scheduling delay of more than}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02063}02063 \textcolor{comment}{                         * or equal to 2 milliseconds, which is too}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02064}02064 \textcolor{comment}{                         * much.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02065}02065 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02066}02066                         y = 7;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02067}02067                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02068}02068                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02069}02069 \textcolor{comment}{                         * Subtract one millisecond, because the}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02070}02070 \textcolor{comment}{                         * generic code adds that to the latency.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02071}02071 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02072}02072                         y -\/= 8;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02073}02073                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02074}02074 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02075}02075                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__transfer_8c_ac7c1dd004c5c80fdda721a68ad16504d}{usbd\_xfer\_get\_isochronous\_start\_frame}}(}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02076}02076                     xfer, x, y, 8, \mbox{\hyperlink{xhcireg_8h_a6e570459d450bac6c40eb6842b64bc87}{XHCI\_MFINDEX\_GET}}(-\/1), \&temp.\mbox{\hyperlink{structxhci__std__temp_aa72c74487f0ca9d8950d8da8ee06ac24}{isoc\_frame}})) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02077}02077                         \textcolor{comment}{/* Start isochronous transfer at specified time. */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02078}02078                         temp.\mbox{\hyperlink{structxhci__std__temp_ac7fad8d4d9d825a7f5e564d5df88f988}{do\_isoc\_sync}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02079}02079 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02080}02080                         DPRINTFN(3, \textcolor{stringliteral}{"{}start next=\%d\(\backslash\)n"{}}, temp.\mbox{\hyperlink{structxhci__std__temp_aa72c74487f0ca9d8950d8da8ee06ac24}{isoc\_frame}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02081}02081                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02082}02082 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02083}02083                 x = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02084}02084                 temp.\mbox{\hyperlink{structxhci__std__temp_a472beaff68e74d92a131cf96f9ca6980}{trb\_type}} = \mbox{\hyperlink{xhci_8h_a1529c577462015d09c815ba9e222eca5}{XHCI\_TRB\_TYPE\_ISOCH}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02085}02085 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02086}02086         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a777cf7dd18178f84b0d6e0a086f72a7a}{control\_xfr}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02087}02087                 \textcolor{comment}{/* check if we should prepend a setup message */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02088}02088 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02089}02089                 \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a0add2c86d09b768df5f354746b8fe16f}{control\_hdr}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02090}02090                         temp.\mbox{\hyperlink{structxhci__std__temp_add6b0d8ed853586f60e64b9459fd1e26}{len}} = xfer-\/>\mbox{\hyperlink{structusb__xfer_a04bfeb929b15a30d355f94eb7ff2a586}{frlengths}}[0];}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02091}02091                         temp.\mbox{\hyperlink{structxhci__std__temp_a68bcaf0634e7bc8003aba215fbcca3db}{pc}} = xfer-\/>\mbox{\hyperlink{structusb__xfer_a5937368645458023af557e100989c64a}{frbuffers}} + 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02092}02092                         temp.\mbox{\hyperlink{structxhci__std__temp_ae4c55d20a4f917c6f912e5c19d3eeea7}{shortpkt}} = temp.\mbox{\hyperlink{structxhci__std__temp_add6b0d8ed853586f60e64b9459fd1e26}{len}} ? 1 : 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02093}02093                         temp.\mbox{\hyperlink{structxhci__std__temp_a472beaff68e74d92a131cf96f9ca6980}{trb\_type}} = \mbox{\hyperlink{xhci_8h_ad6c096edc9c25618a05c3fac352c5167}{XHCI\_TRB\_TYPE\_SETUP\_STAGE}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02094}02094                         temp.\mbox{\hyperlink{structxhci__std__temp_a7ddf0ca9044a87d90f1e2ff9e638b10e}{direction}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02095}02095 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02096}02096                         \textcolor{comment}{/* check for last frame */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02097}02097                         \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}} == 1) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02098}02098                                 \textcolor{comment}{/* no STATUS stage yet, SETUP is last */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02099}02099                                 \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a100da5a86a7ab85605683dc51d48ef86}{control\_act}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02100}02100                                         temp.\mbox{\hyperlink{structxhci__std__temp_a3443c5aa093ec654f4eba646894fad0b}{last\_frame}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02101}02101                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02102}02102 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02103}02103                         \mbox{\hyperlink{xhci_8c_a89f9417bcfe9c8c03ed60726ae113390}{xhci\_setup\_generic\_chain\_sub}}(\&temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02104}02104                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02105}02105                 x = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02106}02106                 mult = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02107}02107                 temp.\mbox{\hyperlink{structxhci__std__temp_a0aec911700f80d4c6e75f88e6e38b9e0}{isoc\_delta}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02108}02108                 temp.\mbox{\hyperlink{structxhci__std__temp_aa72c74487f0ca9d8950d8da8ee06ac24}{isoc\_frame}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02109}02109                 temp.\mbox{\hyperlink{structxhci__std__temp_a472beaff68e74d92a131cf96f9ca6980}{trb\_type}} = xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a1b1e4bb2f7a82e1b2970ce0167e3d68a}{control\_did\_data}} ?}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02110}02110                     \mbox{\hyperlink{xhci_8h_a634876bb60ba63b046c9bc8d302875e1}{XHCI\_TRB\_TYPE\_NORMAL}} : \mbox{\hyperlink{xhci_8h_afc512c8717943327112525d5c8673a03}{XHCI\_TRB\_TYPE\_DATA\_STAGE}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02111}02111         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02112}02112                 x = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02113}02113                 mult = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02114}02114                 temp.\mbox{\hyperlink{structxhci__std__temp_a0aec911700f80d4c6e75f88e6e38b9e0}{isoc\_delta}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02115}02115                 temp.\mbox{\hyperlink{structxhci__std__temp_aa72c74487f0ca9d8950d8da8ee06ac24}{isoc\_frame}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02116}02116                 temp.\mbox{\hyperlink{structxhci__std__temp_a472beaff68e74d92a131cf96f9ca6980}{trb\_type}} = \mbox{\hyperlink{xhci_8h_a634876bb60ba63b046c9bc8d302875e1}{XHCI\_TRB\_TYPE\_NORMAL}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02117}02117         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02118}02118 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02119}02119         \textcolor{keywordflow}{if} (x != xfer-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02120}02120                 \textcolor{comment}{/* set up page\_cache pointer */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02121}02121                 temp.\mbox{\hyperlink{structxhci__std__temp_a68bcaf0634e7bc8003aba215fbcca3db}{pc}} = xfer-\/>\mbox{\hyperlink{structusb__xfer_a5937368645458023af557e100989c64a}{frbuffers}} + x;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02122}02122                 \textcolor{comment}{/* set endpoint direction */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02123}02123                 temp.\mbox{\hyperlink{structxhci__std__temp_a7ddf0ca9044a87d90f1e2ff9e638b10e}{direction}} = \mbox{\hyperlink{usb_8h_aab65e24c804e6317e033b84730aec8e3}{UE\_GET\_DIR}}(xfer-\/>\mbox{\hyperlink{structusb__xfer_afe9addf10f35e5301cce41ebf42b5db2}{endpointno}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02124}02124         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02125}02125 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02126}02126         \textcolor{keywordflow}{while} (x != xfer-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02127}02127                 \textcolor{comment}{/* DATA0 / DATA1 message */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02128}02128 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02129}02129                 temp.\mbox{\hyperlink{structxhci__std__temp_add6b0d8ed853586f60e64b9459fd1e26}{len}} = xfer-\/>\mbox{\hyperlink{structusb__xfer_a04bfeb929b15a30d355f94eb7ff2a586}{frlengths}}[x];}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02130}02130                 temp.\mbox{\hyperlink{structxhci__std__temp_a81162b8d3cdd84242fab306cf671199d}{step\_td}} = ((xfer-\/>\mbox{\hyperlink{structusb__xfer_afe9addf10f35e5301cce41ebf42b5db2}{endpointno}} \& \mbox{\hyperlink{usb_8h_a72bb077a860132c175c166f344c75893}{UE\_DIR\_IN}}) \&\&}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02131}02131                     x != 0 \&\& temp.\mbox{\hyperlink{structxhci__std__temp_a8073e2d949efe0ab7c52c4699b0816d9}{multishort}} == 0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02132}02132 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02133}02133                 x++;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02134}02134 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02135}02135                 \textcolor{keywordflow}{if} (x == xfer-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02136}02136                         \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a777cf7dd18178f84b0d6e0a086f72a7a}{control\_xfr}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02137}02137                                 \textcolor{comment}{/* no STATUS stage yet, DATA is last */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02138}02138                                 \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a100da5a86a7ab85605683dc51d48ef86}{control\_act}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02139}02139                                         temp.\mbox{\hyperlink{structxhci__std__temp_a3443c5aa093ec654f4eba646894fad0b}{last\_frame}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02140}02140                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02141}02141                                 temp.\mbox{\hyperlink{structxhci__std__temp_a3443c5aa093ec654f4eba646894fad0b}{last\_frame}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02142}02142                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02143}02143                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02144}02144                 \textcolor{keywordflow}{if} (temp.\mbox{\hyperlink{structxhci__std__temp_add6b0d8ed853586f60e64b9459fd1e26}{len}} == 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02145}02145                         \textcolor{comment}{/* make sure that we send an USB packet */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02146}02146 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02147}02147                         temp.\mbox{\hyperlink{structxhci__std__temp_ae4c55d20a4f917c6f912e5c19d3eeea7}{shortpkt}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02148}02148 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02149}02149                         temp.\mbox{\hyperlink{structxhci__std__temp_a940c8282c529ed2045cf59f23baf6d19}{tbc}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02150}02150                         temp.\mbox{\hyperlink{structxhci__std__temp_a6d1e95771a382f5a768300fa1d31f42b}{tlbpc}} = mult -\/ 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02151}02151 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02152}02152                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a5367e64daae30f55ec887872d577fa80}{isochronous\_xfr}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02153}02153                         uint8\_t tdpc;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02154}02154 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02155}02155                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02156}02156 \textcolor{comment}{                         * Isochronous transfers don't have short}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02157}02157 \textcolor{comment}{                         * packet termination:}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02158}02158 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02159}02159 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02160}02160                         temp.\mbox{\hyperlink{structxhci__std__temp_ae4c55d20a4f917c6f912e5c19d3eeea7}{shortpkt}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02161}02161 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02162}02162                         \textcolor{comment}{/* isochronous transfers have a transfer limit */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02163}02163 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02164}02164                         \textcolor{keywordflow}{if} (temp.\mbox{\hyperlink{structxhci__std__temp_add6b0d8ed853586f60e64b9459fd1e26}{len}} > xfer-\/>\mbox{\hyperlink{structusb__xfer_ae115ce000f084f7d5f8c005fa88d2703}{max\_frame\_size}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02165}02165                                 temp.\mbox{\hyperlink{structxhci__std__temp_add6b0d8ed853586f60e64b9459fd1e26}{len}} = xfer-\/>\mbox{\hyperlink{structusb__xfer_ae115ce000f084f7d5f8c005fa88d2703}{max\_frame\_size}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02166}02166 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02167}02167                         \textcolor{comment}{/* compute TD packet count */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02168}02168                         tdpc = howmany(temp.\mbox{\hyperlink{structxhci__std__temp_add6b0d8ed853586f60e64b9459fd1e26}{len}}, xfer-\/>\mbox{\hyperlink{structusb__xfer_aefcde8a630b7adefe68cc72e7e7a5bb5}{max\_packet\_size}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02169}02169 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02170}02170                         temp.\mbox{\hyperlink{structxhci__std__temp_a940c8282c529ed2045cf59f23baf6d19}{tbc}} = howmany(tdpc, mult) -\/ 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02171}02171                         temp.\mbox{\hyperlink{structxhci__std__temp_a6d1e95771a382f5a768300fa1d31f42b}{tlbpc}} = (tdpc \% mult);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02172}02172 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02173}02173                         \textcolor{keywordflow}{if} (temp.\mbox{\hyperlink{structxhci__std__temp_a6d1e95771a382f5a768300fa1d31f42b}{tlbpc}} == 0)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02174}02174                                 temp.\mbox{\hyperlink{structxhci__std__temp_a6d1e95771a382f5a768300fa1d31f42b}{tlbpc}} = mult -\/ 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02175}02175                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02176}02176                                 temp.\mbox{\hyperlink{structxhci__std__temp_a6d1e95771a382f5a768300fa1d31f42b}{tlbpc}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02177}02177                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02178}02178                         \textcolor{comment}{/* regular data transfer */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02179}02179 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02180}02180                         temp.\mbox{\hyperlink{structxhci__std__temp_ae4c55d20a4f917c6f912e5c19d3eeea7}{shortpkt}} = xfer-\/>\mbox{\hyperlink{structusb__xfer_aa251db061296120bb15fd562088a1d9d}{flags}}.\mbox{\hyperlink{structusb__xfer__flags_a76816b701c58c22a9a78904b109c2e95}{force\_short\_xfer}} ? 0 : 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02181}02181                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02182}02182 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02183}02183                 \mbox{\hyperlink{xhci_8c_a89f9417bcfe9c8c03ed60726ae113390}{xhci\_setup\_generic\_chain\_sub}}(\&temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02184}02184 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02185}02185                 \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a5367e64daae30f55ec887872d577fa80}{isochronous\_xfr}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02186}02186                         temp.\mbox{\hyperlink{structxhci__std__temp_a55123af6322a622c819cfb61594134cc}{offset}} += xfer-\/>\mbox{\hyperlink{structusb__xfer_a04bfeb929b15a30d355f94eb7ff2a586}{frlengths}}[x -\/ 1];}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02187}02187                         temp.\mbox{\hyperlink{structxhci__std__temp_aa72c74487f0ca9d8950d8da8ee06ac24}{isoc\_frame}} += temp.\mbox{\hyperlink{structxhci__std__temp_a0aec911700f80d4c6e75f88e6e38b9e0}{isoc\_delta}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02188}02188                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02189}02189                         \textcolor{comment}{/* get next Page Cache pointer */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02190}02190                         temp.\mbox{\hyperlink{structxhci__std__temp_a68bcaf0634e7bc8003aba215fbcca3db}{pc}} = xfer-\/>\mbox{\hyperlink{structusb__xfer_a5937368645458023af557e100989c64a}{frbuffers}} + x;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02191}02191                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02192}02192         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02193}02193 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02194}02194         \textcolor{comment}{/* check if we should append a status stage */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02195}02195 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02196}02196         \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a777cf7dd18178f84b0d6e0a086f72a7a}{control\_xfr}} \&\&}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02197}02197             !xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a100da5a86a7ab85605683dc51d48ef86}{control\_act}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02198}02198                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02199}02199 \textcolor{comment}{                 * Send a DATA1 message and invert the current}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02200}02200 \textcolor{comment}{                 * endpoint direction.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02201}02201 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02202}02202                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{xhci_8c_aa8d8bbfd8f26cc1854c765de6ab341b0}{xhcictlstep}} || temp.\mbox{\hyperlink{structxhci__std__temp_a3c5f08c10a5b2a98578c1343a2d1d453}{sc}}-\/>\mbox{\hyperlink{structxhci__softc_a24f42ca0c013824ce4874e10886b2d73}{sc\_ctlstep}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02203}02203                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02204}02204 \textcolor{comment}{                         * Some XHCI controllers will not delay the}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02205}02205 \textcolor{comment}{                         * status stage until the next SOF. Force this}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02206}02206 \textcolor{comment}{                         * behaviour to avoid failed control}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02207}02207 \textcolor{comment}{                         * transfers.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02208}02208 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02209}02209                         temp.\mbox{\hyperlink{structxhci__std__temp_a81162b8d3cdd84242fab306cf671199d}{step\_td}} = (xfer-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}} != 0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02210}02210                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02211}02211                         temp.\mbox{\hyperlink{structxhci__std__temp_a81162b8d3cdd84242fab306cf671199d}{step\_td}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02212}02212                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02213}02213                 temp.\mbox{\hyperlink{structxhci__std__temp_a7ddf0ca9044a87d90f1e2ff9e638b10e}{direction}} = \mbox{\hyperlink{usb_8h_aab65e24c804e6317e033b84730aec8e3}{UE\_GET\_DIR}}(xfer-\/>\mbox{\hyperlink{structusb__xfer_afe9addf10f35e5301cce41ebf42b5db2}{endpointno}}) \string^ \mbox{\hyperlink{usb_8h_a72bb077a860132c175c166f344c75893}{UE\_DIR\_IN}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02214}02214                 temp.\mbox{\hyperlink{structxhci__std__temp_add6b0d8ed853586f60e64b9459fd1e26}{len}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02215}02215                 temp.\mbox{\hyperlink{structxhci__std__temp_a68bcaf0634e7bc8003aba215fbcca3db}{pc}} = NULL;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02216}02216                 temp.\mbox{\hyperlink{structxhci__std__temp_ae4c55d20a4f917c6f912e5c19d3eeea7}{shortpkt}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02217}02217                 temp.\mbox{\hyperlink{structxhci__std__temp_a3443c5aa093ec654f4eba646894fad0b}{last\_frame}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02218}02218                 temp.\mbox{\hyperlink{structxhci__std__temp_a472beaff68e74d92a131cf96f9ca6980}{trb\_type}} = \mbox{\hyperlink{xhci_8h_aa4fd9d06964d91c25cd512fea639a184}{XHCI\_TRB\_TYPE\_STATUS\_STAGE}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02219}02219 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02220}02220                 \mbox{\hyperlink{xhci_8c_a89f9417bcfe9c8c03ed60726ae113390}{xhci\_setup\_generic\_chain\_sub}}(\&temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02221}02221         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02222}02222 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02223}02223         td = temp.\mbox{\hyperlink{structxhci__std__temp_a97640b5f307d3e536d453c14a4affd77}{td}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02224}02224 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02225}02225         \textcolor{comment}{/* must have at least one frame! */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02226}02226 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02227}02227         xfer-\/>\mbox{\hyperlink{structusb__xfer_ae74733ea0d49027c19477ea63a223f26}{td\_transfer\_last}} = td;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02228}02228 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02229}02229         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}first=\%p last=\%p\(\backslash\)n"{}}, xfer-\/>\mbox{\hyperlink{structusb__xfer_ae7adef379254c2ca0c87f265c59f5f5c}{td\_transfer\_first}}, td);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02230}02230 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02231}02231 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02232}02232 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02233}\mbox{\hyperlink{xhci_8c_a8b25d51a6768cd99f0412cbfd52bc968}{02233}} \mbox{\hyperlink{xhci_8c_a8b25d51a6768cd99f0412cbfd52bc968}{xhci\_set\_slot\_pointer}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc, uint8\_t index, uint64\_t dev\_addr)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02234}02234 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02235}02235         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__search}{usb\_page\_search}} buf\_res;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02236}02236         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__dev__ctx__addr}{xhci\_dev\_ctx\_addr}} *pdctxa;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02237}02237 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02238}02238         \mbox{\hyperlink{usb__busdma_8c_ab4f9d07714be540b6d002b44b3716bb2}{usbd\_get\_page}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a03fea6135fac6428bcd31c9b80b5969c}{ctx\_pc}}, 0, \&buf\_res);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02239}02239 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02240}02240         pdctxa = buf\_res.\mbox{\hyperlink{structusb__page__search_a60cd5ce1bbfbf2d2dec7677b1ba9b01a}{buffer}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02241}02241 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02242}02242         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}addr[\%u]=0x\%016llx\(\backslash\)n"{}}, index, (\textcolor{keywordtype}{long} \textcolor{keywordtype}{long})dev\_addr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02243}02243 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02244}02244         pdctxa-\/>\mbox{\hyperlink{structxhci__dev__ctx__addr_a06164d244d319322739083a40f0fe486}{qwBaaDevCtxAddr}}[index] = htole64(dev\_addr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02245}02245 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02246}02246         \mbox{\hyperlink{usb__busdma_8h_a988a5299f521e8a8d94a68a03015bd77}{usb\_pc\_cpu\_flush}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a03fea6135fac6428bcd31c9b80b5969c}{ctx\_pc}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02247}02247 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02248}02248 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02249}02249 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02250}\mbox{\hyperlink{xhci_8c_a2b5fcb1981b6791181beb8c1f7710b10}{02250}} \mbox{\hyperlink{xhci_8c_a2b5fcb1981b6791181beb8c1f7710b10}{xhci\_configure\_mask}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev, uint32\_t mask, uint8\_t drop)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02251}02251 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02252}02252         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02253}02253         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__search}{usb\_page\_search}} buf\_inp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02254}02254         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__input__ctx}{xhci\_input\_ctx}} *input;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02255}02255         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__slot__ctx}{xhci\_slot\_ctx}} *slot;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02256}02256         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02257}02257         uint8\_t index;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02258}02258         uint8\_t x;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02259}02259 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02260}02260         index = udev-\/>\mbox{\hyperlink{structusb__device_a9f275ef5fb35734f8174c9b01a855973}{controller\_slot\_id}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02261}02261 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02262}02262         \mbox{\hyperlink{usb__busdma_8c_ab4f9d07714be540b6d002b44b3716bb2}{usbd\_get\_page}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_ac3b7a1fbfd567e6b9c3cdcbc58bcd40e}{input\_pc}}, 0, \&buf\_inp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02263}02263 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02264}02264         input = \mbox{\hyperlink{xhci_8c_a7282cd159e63bc916b5f3d5b828ff61f}{XHCI\_GET\_CTX}}(sc, \mbox{\hyperlink{structxhci__input__dev__ctx}{xhci\_input\_dev\_ctx}}, ctx\_input,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02265}02265             buf\_inp.\mbox{\hyperlink{structusb__page__search_a60cd5ce1bbfbf2d2dec7677b1ba9b01a}{buffer}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02266}02266         slot = \mbox{\hyperlink{xhci_8c_a7282cd159e63bc916b5f3d5b828ff61f}{XHCI\_GET\_CTX}}(sc, \mbox{\hyperlink{structxhci__input__dev__ctx}{xhci\_input\_dev\_ctx}}, \mbox{\hyperlink{xhci_8h_a102d058fa213774dd6a3aa079747d54f}{ctx\_slot}}, buf\_inp.\mbox{\hyperlink{structusb__page__search_a60cd5ce1bbfbf2d2dec7677b1ba9b01a}{buffer}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02267}02267 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02268}02268         \textcolor{keywordflow}{if} (drop) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02269}02269                 mask \&= \mbox{\hyperlink{xhci_8h_ad7974fe61602ef2c56b712912c83f12a}{XHCI\_INCTX\_NON\_CTRL\_MASK}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02270}02270                 input-\/>\mbox{\hyperlink{structxhci__input__ctx_a5c60fcdf2b4c9aa296b7a540e804a214}{dwInCtx0}} = htole32(mask);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02271}02271                 input-\/>\mbox{\hyperlink{structxhci__input__ctx_a930854a4cb8ca897baf691052183b993}{dwInCtx1}} = htole32(0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02272}02272         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02273}02273                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02274}02274 \textcolor{comment}{                 * Some hardware requires that we drop the endpoint}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02275}02275 \textcolor{comment}{                 * context before adding it again:}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02276}02276 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02277}02277                 input-\/>\mbox{\hyperlink{structxhci__input__ctx_a5c60fcdf2b4c9aa296b7a540e804a214}{dwInCtx0}} = htole32(mask \& \mbox{\hyperlink{xhci_8h_ad7974fe61602ef2c56b712912c83f12a}{XHCI\_INCTX\_NON\_CTRL\_MASK}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02278}02278 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02279}02279                 \textcolor{comment}{/* Add new endpoint context */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02280}02280                 input-\/>\mbox{\hyperlink{structxhci__input__ctx_a930854a4cb8ca897baf691052183b993}{dwInCtx1}} = htole32(mask);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02281}02281 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02282}02282                 \textcolor{comment}{/* find most significant set bit */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02283}02283                 \textcolor{keywordflow}{for} (x = 31; x != 1; x-\/-\/) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02284}02284                         \textcolor{keywordflow}{if} (mask \& (1 << x))}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02285}02285                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02286}02286                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02287}02287 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02288}02288                 \textcolor{comment}{/* adjust */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02289}02289                 x-\/-\/;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02290}02290 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02291}02291                 \textcolor{comment}{/* figure out the maximum number of contexts */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02292}02292                 \textcolor{keywordflow}{if} (x > sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_ac58a50329968674eeb31b05b7d5a099f}{context\_num}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02293}02293                         sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_ac58a50329968674eeb31b05b7d5a099f}{context\_num}} = x;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02294}02294                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02295}02295                         x = sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_ac58a50329968674eeb31b05b7d5a099f}{context\_num}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02296}02296 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02297}02297                 \textcolor{comment}{/* update number of contexts */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02298}02298                 temp = le32toh(slot-\/>dwSctx0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02299}02299                 temp \&= \string~XHCI\_SCTX\_0\_CTX\_NUM\_SET(31);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02300}02300                 temp |= \mbox{\hyperlink{xhci_8h_a232b50503d463cb948f7c1a34144487d}{XHCI\_SCTX\_0\_CTX\_NUM\_SET}}(x + 1);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02301}02301                 slot-\/>dwSctx0 = htole32(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02302}02302         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02303}02303         \mbox{\hyperlink{usb__busdma_8h_a988a5299f521e8a8d94a68a03015bd77}{usb\_pc\_cpu\_flush}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_ac3b7a1fbfd567e6b9c3cdcbc58bcd40e}{input\_pc}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02304}02304         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02305}02305 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02306}02306 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02307}02307 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02308}\mbox{\hyperlink{xhci_8c_a256565a843bbdd01a3cc34cddaae615d}{02308}} \mbox{\hyperlink{xhci_8c_a256565a843bbdd01a3cc34cddaae615d}{xhci\_configure\_endpoint}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02309}02309     \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__endpoint__descriptor}{usb\_endpoint\_descriptor}} *edesc, \textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__endpoint__ext}{xhci\_endpoint\_ext}} *pepext,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02310}02310     uint16\_t interval, uint8\_t max\_packet\_count,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02311}02311     uint8\_t mult, uint8\_t fps\_shift, uint16\_t max\_packet\_size,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02312}02312     uint16\_t max\_frame\_size, uint8\_t ep\_mode)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02313}02313 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02314}02314         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__search}{usb\_page\_search}} buf\_inp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02315}02315         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02316}02316         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__endp__ctx}{xhci\_endp\_ctx}} *endp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02317}02317         uint64\_t ring\_addr = pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a248d4709aba68f9c9c685d0b5e6770e7}{physaddr}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02318}02318         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02319}02319         uint8\_t index;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02320}02320         uint8\_t epno;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02321}02321         uint8\_t type;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02322}02322 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02323}02323         index = udev-\/>\mbox{\hyperlink{structusb__device_a9f275ef5fb35734f8174c9b01a855973}{controller\_slot\_id}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02324}02324 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02325}02325         \mbox{\hyperlink{usb__busdma_8c_ab4f9d07714be540b6d002b44b3716bb2}{usbd\_get\_page}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_ac3b7a1fbfd567e6b9c3cdcbc58bcd40e}{input\_pc}}, 0, \&buf\_inp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02326}02326 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02327}02327         epno = edesc-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_a3d0a0ab41c53023055a242d66a437a2d}{bEndpointAddress}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02328}02328         type = edesc-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_aff28dcc97802a405b31baccd33c2bf8f}{bmAttributes}} \& \mbox{\hyperlink{usb_8h_a8badd3504359a0aed83ac575a46a67b4}{UE\_XFERTYPE}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02329}02329 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02330}02330         \textcolor{keywordflow}{if} (type == \mbox{\hyperlink{usb_8h_ace49b7adb24ebcb0a0b17110c26aa63a}{UE\_CONTROL}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02331}02331                 epno |= \mbox{\hyperlink{usb_8h_a72bb077a860132c175c166f344c75893}{UE\_DIR\_IN}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02332}02332 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02333}02333         epno = \mbox{\hyperlink{xhci_8h_a8a803affdc78579a2e78adb894751b3d}{XHCI\_EPNO2EPID}}(epno);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02334}02334 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02335}02335         \textcolor{keywordflow}{if} (epno == 0)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02336}02336                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945aa2d5591274807d976378f663ce37773e}{USB\_ERR\_NO\_PIPE}});                \textcolor{comment}{/* invalid */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02337}02337 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02338}02338         \textcolor{keywordflow}{if} (max\_packet\_count == 0)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02339}02339                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abc64140f8c4eace931b45c7d8191bd8d}{USB\_ERR\_BAD\_BUFSIZE}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02340}02340 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02341}02341         max\_packet\_count-\/-\/;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02342}02342 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02343}02343         \textcolor{keywordflow}{if} (mult == 0)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02344}02344                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abc64140f8c4eace931b45c7d8191bd8d}{USB\_ERR\_BAD\_BUFSIZE}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02345}02345 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02346}02346         endp = \mbox{\hyperlink{xhci_8c_a7282cd159e63bc916b5f3d5b828ff61f}{XHCI\_GET\_CTX}}(sc, \mbox{\hyperlink{structxhci__input__dev__ctx}{xhci\_input\_dev\_ctx}}, \mbox{\hyperlink{xhci_8h_a39aa21a7bdbb2e80e1d37a3013173ed9}{ctx\_ep}}[epno -\/ 1],}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02347}02347             buf\_inp.\mbox{\hyperlink{structusb__page__search_a60cd5ce1bbfbf2d2dec7677b1ba9b01a}{buffer}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02348}02348 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02349}02349         \textcolor{comment}{/* store endpoint mode */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02350}02350         pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_aea5b33a29ac8208a4e58aaddc503e49c}{trb\_ep\_mode}} = ep\_mode;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02351}02351         \textcolor{comment}{/* store bMaxPacketSize for control endpoints */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02352}02352         pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_add6f180db324ddeb15351299208f162e}{trb\_ep\_maxp}} = edesc-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_af5ba49fb2ee7353335dc33e38d89aed5}{wMaxPacketSize}}[0];}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02353}02353         \mbox{\hyperlink{usb__busdma_8h_a988a5299f521e8a8d94a68a03015bd77}{usb\_pc\_cpu\_flush}}(pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a5e31d0a5d5dd1dfd30b1afafaa3588f1}{page\_cache}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02354}02354 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02355}02355         \textcolor{keywordflow}{if} (ep\_mode == \mbox{\hyperlink{usb_8h_aa37eb5438eb0251d10367fc72a76e2b8a6517fbedeae183c025bdb38abc2f1733}{USB\_EP\_MODE\_STREAMS}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02356}02356                 temp = \mbox{\hyperlink{xhci_8h_a7c0fe0fc2afe3ed25fb9cd560b72da11}{XHCI\_EPCTX\_0\_EPSTATE\_SET}}(0) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02357}02357                     \mbox{\hyperlink{xhci_8h_a521283e402f3ad40c9880f23564d90d2}{XHCI\_EPCTX\_0\_MAXP\_STREAMS\_SET}}(XHCI\_MAX\_STREAMS\_LOG -\/ 1) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02358}02358                     \mbox{\hyperlink{xhci_8h_a01eaa47fb39c5b420927b3e440a5e884}{XHCI\_EPCTX\_0\_LSA\_SET}}(1);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02359}02359 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02360}02360                 ring\_addr += \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__trb}{xhci\_trb}}) *}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02361}02361                     \mbox{\hyperlink{xhci_8h_ad65c5c3edb879e07bba8237211cf64c5}{XHCI\_MAX\_TRANSFERS}} * XHCI\_MAX\_STREAMS;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02362}02362         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02363}02363                 temp = \mbox{\hyperlink{xhci_8h_a7c0fe0fc2afe3ed25fb9cd560b72da11}{XHCI\_EPCTX\_0\_EPSTATE\_SET}}(0) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02364}02364                     \mbox{\hyperlink{xhci_8h_a521283e402f3ad40c9880f23564d90d2}{XHCI\_EPCTX\_0\_MAXP\_STREAMS\_SET}}(0) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02365}02365                     \mbox{\hyperlink{xhci_8h_a01eaa47fb39c5b420927b3e440a5e884}{XHCI\_EPCTX\_0\_LSA\_SET}}(0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02366}02366 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02367}02367                 ring\_addr |= \mbox{\hyperlink{xhci_8h_ad397fa9b91adf8c53283f19bbce8fe26}{XHCI\_EPCTX\_2\_DCS\_SET}}(1);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02368}02368         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02369}02369 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02370}02370         \textcolor{keywordflow}{switch} (udev-\/>\mbox{\hyperlink{structusb__device_a1fc02abd43bd33f295493ed23debd852}{speed}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02371}02371         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a97e7c882fa8cd21898173a29471616ffa0f17d0b9928086c6114fea73e08f1780}{USB\_SPEED\_FULL}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02372}02372         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a97e7c882fa8cd21898173a29471616ffa0ec4f8f66feaf7ee8f2ee618302e9470}{USB\_SPEED\_LOW}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02373}02373                 \textcolor{comment}{/* 1ms -\/> 125us */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02374}02374                 fps\_shift += 3;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02375}02375                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02376}02376         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02377}02377                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02378}02378         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02379}02379 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02380}02380         \textcolor{keywordflow}{switch} (type) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02381}02381         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a01e28e87ad16f6dfffefc6ccab08baed}{UE\_INTERRUPT}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02382}02382                 \textcolor{keywordflow}{if} (fps\_shift > 3)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02383}02383                         fps\_shift-\/-\/;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02384}02384                 temp |= \mbox{\hyperlink{xhci_8h_aad1d1c2c35843989a7c31efe4a272004}{XHCI\_EPCTX\_0\_IVAL\_SET}}(fps\_shift);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02385}02385                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02386}02386         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_aecbab40f64cd5ffe365b73f7360ea2a3}{UE\_ISOCHRONOUS}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02387}02387                 temp |= \mbox{\hyperlink{xhci_8h_aad1d1c2c35843989a7c31efe4a272004}{XHCI\_EPCTX\_0\_IVAL\_SET}}(fps\_shift);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02388}02388 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02389}02389                 \textcolor{keywordflow}{switch} (udev-\/>\mbox{\hyperlink{structusb__device_a1fc02abd43bd33f295493ed23debd852}{speed}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02390}02390                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a97e7c882fa8cd21898173a29471616ffafeaa1573d94f4b3f0c4a4caa423eb81e}{USB\_SPEED\_SUPER}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02391}02391                         \textcolor{keywordflow}{if} (mult > 3)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02392}02392                                 mult = 3;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02393}02393                         temp |= \mbox{\hyperlink{xhci_8h_a46fee34951b43d92e9a61cb2ed6ea88d}{XHCI\_EPCTX\_0\_MULT\_SET}}(mult -\/ 1);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02394}02394                         max\_packet\_count /= mult;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02395}02395                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02396}02396                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02397}02397                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02398}02398                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02399}02399                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02400}02400         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02401}02401                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02402}02402         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02403}02403 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02404}02404         endp-\/>\mbox{\hyperlink{structxhci__endp__ctx_a129e6f08dff2bafd7de6e7288c564f9d}{dwEpCtx0}} = htole32(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02405}02405 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02406}02406         temp =}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02407}02407             \mbox{\hyperlink{xhci_8h_ae20fa027dbe95ac0a6cf1e4d68171472}{XHCI\_EPCTX\_1\_HID\_SET}}(0) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02408}02408             \mbox{\hyperlink{xhci_8h_ae6a9f216f1995454110aa0a81b5718df}{XHCI\_EPCTX\_1\_MAXB\_SET}}(max\_packet\_count) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02409}02409             \mbox{\hyperlink{xhci_8h_aecf3649fb5e12937cee45a158e2f42f3}{XHCI\_EPCTX\_1\_MAXP\_SIZE\_SET}}(max\_packet\_size);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02410}02410 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02411}02411         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02412}02412 \textcolor{comment}{         * Always enable the "{}three strikes and you are gone"{} feature}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02413}02413 \textcolor{comment}{         * except for ISOCHRONOUS endpoints. This is suggested by}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02414}02414 \textcolor{comment}{         * section 4.3.3 in the XHCI specification about device slot}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02415}02415 \textcolor{comment}{         * initialisation.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02416}02416 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02417}02417         \textcolor{keywordflow}{if} (type != \mbox{\hyperlink{usb_8h_aecbab40f64cd5ffe365b73f7360ea2a3}{UE\_ISOCHRONOUS}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02418}02418                 temp |= \mbox{\hyperlink{xhci_8h_abb2712cd3b12d36d9d6a0bc07bbd4110}{XHCI\_EPCTX\_1\_CERR\_SET}}(3);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02419}02419 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02420}02420         \textcolor{keywordflow}{switch} (type) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02421}02421         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_ace49b7adb24ebcb0a0b17110c26aa63a}{UE\_CONTROL}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02422}02422                 temp |= \mbox{\hyperlink{xhci_8h_a192b70abf1aeb6c9d2bf91f8da0ac57a}{XHCI\_EPCTX\_1\_EPTYPE\_SET}}(4);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02423}02423                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02424}02424         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_aecbab40f64cd5ffe365b73f7360ea2a3}{UE\_ISOCHRONOUS}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02425}02425                 temp |= \mbox{\hyperlink{xhci_8h_a192b70abf1aeb6c9d2bf91f8da0ac57a}{XHCI\_EPCTX\_1\_EPTYPE\_SET}}(1);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02426}02426                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02427}02427         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a25240fc009aa67bb7a2b635d2e9401e4}{UE\_BULK}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02428}02428                 temp |= \mbox{\hyperlink{xhci_8h_a192b70abf1aeb6c9d2bf91f8da0ac57a}{XHCI\_EPCTX\_1\_EPTYPE\_SET}}(2);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02429}02429                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02430}02430         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02431}02431                 temp |= \mbox{\hyperlink{xhci_8h_a192b70abf1aeb6c9d2bf91f8da0ac57a}{XHCI\_EPCTX\_1\_EPTYPE\_SET}}(3);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02432}02432                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02433}02433         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02434}02434 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02435}02435         \textcolor{comment}{/* check for IN direction */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02436}02436         \textcolor{keywordflow}{if} (epno \& 1)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02437}02437                 temp |= \mbox{\hyperlink{xhci_8h_a192b70abf1aeb6c9d2bf91f8da0ac57a}{XHCI\_EPCTX\_1\_EPTYPE\_SET}}(4);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02438}02438 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02439}02439         endp-\/>\mbox{\hyperlink{structxhci__endp__ctx_aeb8495dd7099cce78c165adfe6106420}{dwEpCtx1}} = htole32(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02440}02440         endp-\/>\mbox{\hyperlink{structxhci__endp__ctx_a4df6879017927395713c29dc8630b231}{qwEpCtx2}} = htole64(ring\_addr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02441}02441 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02442}02442         \textcolor{keywordflow}{switch} (edesc-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_aff28dcc97802a405b31baccd33c2bf8f}{bmAttributes}} \& \mbox{\hyperlink{usb_8h_a8badd3504359a0aed83ac575a46a67b4}{UE\_XFERTYPE}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02443}02443         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a01e28e87ad16f6dfffefc6ccab08baed}{UE\_INTERRUPT}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02444}02444         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_aecbab40f64cd5ffe365b73f7360ea2a3}{UE\_ISOCHRONOUS}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02445}02445                 temp = \mbox{\hyperlink{xhci_8h_abbcfd01cfc28d7b3195b6ea9ef26c4d4}{XHCI\_EPCTX\_4\_MAX\_ESIT\_PAYLOAD\_SET}}(max\_frame\_size) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02446}02446                     \mbox{\hyperlink{xhci_8h_a2d8a9be8a1c830dc8965032a2b1a0157}{XHCI\_EPCTX\_4\_AVG\_TRB\_LEN\_SET}}(MIN(\mbox{\hyperlink{xhci_8h_ad30aefaae2d4403c5082da7a10c54d21}{XHCI\_PAGE\_SIZE}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02447}02447                     max\_frame\_size));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02448}02448                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02449}02449         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_ace49b7adb24ebcb0a0b17110c26aa63a}{UE\_CONTROL}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02450}02450                 temp = \mbox{\hyperlink{xhci_8h_a2d8a9be8a1c830dc8965032a2b1a0157}{XHCI\_EPCTX\_4\_AVG\_TRB\_LEN\_SET}}(8);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02451}02451                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02452}02452         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02453}02453                 temp = \mbox{\hyperlink{xhci_8h_a2d8a9be8a1c830dc8965032a2b1a0157}{XHCI\_EPCTX\_4\_AVG\_TRB\_LEN\_SET}}(\mbox{\hyperlink{xhci_8h_ad30aefaae2d4403c5082da7a10c54d21}{XHCI\_PAGE\_SIZE}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02454}02454                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02455}02455         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02456}02456 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02457}02457         endp-\/>\mbox{\hyperlink{structxhci__endp__ctx_ad5be17592f4c3aa83bbc9c86c01fcb1e}{dwEpCtx4}} = htole32(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02458}02458 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02459}02459 \textcolor{preprocessor}{\#ifdef USB\_DEBUG}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02460}02460         xhci\_dump\_endpoint(endp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02461}02461 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02462}02462         \mbox{\hyperlink{usb__busdma_8h_a988a5299f521e8a8d94a68a03015bd77}{usb\_pc\_cpu\_flush}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_ac3b7a1fbfd567e6b9c3cdcbc58bcd40e}{input\_pc}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02463}02463 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02464}02464         \textcolor{keywordflow}{return} (0);             \textcolor{comment}{/* success */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02465}02465 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02466}02466 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02467}02467 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02468}\mbox{\hyperlink{xhci_8c_a159a9b0bf4c42b6d6682fd7272543dc3}{02468}} \mbox{\hyperlink{xhci_8c_a159a9b0bf4c42b6d6682fd7272543dc3}{xhci\_configure\_endpoint\_by\_xfer}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02469}02469 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02470}02470         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__endpoint__ext}{xhci\_endpoint\_ext}} *pepext;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02471}02471         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__endpoint__ss__comp__descriptor}{usb\_endpoint\_ss\_comp\_descriptor}} *ecomp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02472}02472         \mbox{\hyperlink{usb__freebsd_8h_a3f3a2ea5069eca21eab610b65c30c173}{usb\_stream\_t}} x;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02473}02473 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02474}02474         pepext = \mbox{\hyperlink{xhci_8c_af1c3f8bc816768b3a290ad69aafa7af0}{xhci\_get\_endpoint\_ext}}(xfer-\/>\mbox{\hyperlink{structusb__xfer_ad188b4cd79900e1cd04aba6c140e9ab3}{xroot}}-\/>\mbox{\hyperlink{structusb__xfer__root_ad636fcdafa42c174cdf281bb144b1e67}{udev}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02475}02475             xfer-\/>\mbox{\hyperlink{structusb__xfer_a8de3fd948d496c7901b307b13a1c6e99}{endpoint}}-\/>\mbox{\hyperlink{structusb__endpoint_af3b96b9fe1e612b303833c2e2d0365e1}{edesc}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02476}02476 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02477}02477         ecomp = xfer-\/>\mbox{\hyperlink{structusb__xfer_a8de3fd948d496c7901b307b13a1c6e99}{endpoint}}-\/>\mbox{\hyperlink{structusb__endpoint_a702da1f344a591607260d638613a43ff}{ecomp}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02478}02478 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02479}02479         \textcolor{keywordflow}{for} (x = 0; x != XHCI\_MAX\_STREAMS; x++) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02480}02480                 uint64\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02481}02481 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02482}02482                 \textcolor{comment}{/* halt any transfers */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02483}02483                 pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a0606813689084e8c7bc08cd9269b8a77}{trb}}[x * \mbox{\hyperlink{xhci_8h_ad65c5c3edb879e07bba8237211cf64c5}{XHCI\_MAX\_TRANSFERS}}].\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02484}02484 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02485}02485                 \textcolor{comment}{/* compute start of TRB ring for stream "{}x"{} */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02486}02486                 temp = pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a248d4709aba68f9c9c685d0b5e6770e7}{physaddr}} +}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02487}02487                     (x * \mbox{\hyperlink{xhci_8h_ad65c5c3edb879e07bba8237211cf64c5}{XHCI\_MAX\_TRANSFERS}} * \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__trb}{xhci\_trb}})) +}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02488}02488                     \mbox{\hyperlink{xhci_8h_a23a5c0e17d2dd9cd5b64a518aec4ca34}{XHCI\_SCTX\_0\_SCT\_SEC\_TR\_RING}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02489}02489 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02490}02490                 \textcolor{comment}{/* make tree structure */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02491}02491                 pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a0606813689084e8c7bc08cd9269b8a77}{trb}}[(\mbox{\hyperlink{xhci_8h_ad65c5c3edb879e07bba8237211cf64c5}{XHCI\_MAX\_TRANSFERS}} *}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02492}02492                     XHCI\_MAX\_STREAMS) + x].\mbox{\hyperlink{xhci_8h_ab1421e9c0e85d42b26d4cba221b5e6e6}{qwTrb0}} = htole64(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02493}02493 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02494}02494                 \textcolor{comment}{/* reserved fields */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02495}02495                 pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a0606813689084e8c7bc08cd9269b8a77}{trb}}[(\mbox{\hyperlink{xhci_8h_ad65c5c3edb879e07bba8237211cf64c5}{XHCI\_MAX\_TRANSFERS}} *}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02496}02496                     XHCI\_MAX\_STREAMS) + x].\mbox{\hyperlink{xhci_8h_a06a7a5457fdb271db9129951cb0adf37}{dwTrb2}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02497}02497                 pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a0606813689084e8c7bc08cd9269b8a77}{trb}}[(\mbox{\hyperlink{xhci_8h_ad65c5c3edb879e07bba8237211cf64c5}{XHCI\_MAX\_TRANSFERS}} *}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02498}02498                     XHCI\_MAX\_STREAMS) + x].\mbox{\hyperlink{xhci_8h_a0dede182b879aed1b0ac576de9b7d8d6}{dwTrb3}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02499}02499         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02500}02500         \mbox{\hyperlink{usb__busdma_8h_a988a5299f521e8a8d94a68a03015bd77}{usb\_pc\_cpu\_flush}}(pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a5e31d0a5d5dd1dfd30b1afafaa3588f1}{page\_cache}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02501}02501 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02502}02502         \textcolor{keywordflow}{return} (\mbox{\hyperlink{xhci_8c_a256565a843bbdd01a3cc34cddaae615d}{xhci\_configure\_endpoint}}(xfer-\/>\mbox{\hyperlink{structusb__xfer_ad188b4cd79900e1cd04aba6c140e9ab3}{xroot}}-\/>\mbox{\hyperlink{structusb__xfer__root_ad636fcdafa42c174cdf281bb144b1e67}{udev}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02503}02503             xfer-\/>\mbox{\hyperlink{structusb__xfer_a8de3fd948d496c7901b307b13a1c6e99}{endpoint}}-\/>\mbox{\hyperlink{structusb__endpoint_af3b96b9fe1e612b303833c2e2d0365e1}{edesc}}, pepext,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02504}02504             xfer-\/>\mbox{\hyperlink{structusb__xfer_adefe203b8c753d8828c4b8dcec099ffc}{interval}}, xfer-\/>\mbox{\hyperlink{structusb__xfer_a68da814bcdf59aaa6975cfd931a3f97f}{max\_packet\_count}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02505}02505             (ecomp != NULL) ? \mbox{\hyperlink{usb_8h_ae54fa22265bd721ecfb464b6369c36ef}{UE\_GET\_SS\_ISO\_MULT}}(ecomp-\/>\mbox{\hyperlink{structusb__endpoint__ss__comp__descriptor_a86c44b415c00a6225bda0e34313336d1}{bmAttributes}}) + 1 : 1,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02506}02506             \mbox{\hyperlink{usb__transfer_8c_a479907ed14a6a7e05e1409a19562b8c2}{usbd\_xfer\_get\_fps\_shift}}(xfer), xfer-\/>\mbox{\hyperlink{structusb__xfer_aefcde8a630b7adefe68cc72e7e7a5bb5}{max\_packet\_size}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02507}02507             xfer-\/>\mbox{\hyperlink{structusb__xfer_ae115ce000f084f7d5f8c005fa88d2703}{max\_frame\_size}}, xfer-\/>\mbox{\hyperlink{structusb__xfer_a8de3fd948d496c7901b307b13a1c6e99}{endpoint}}-\/>\mbox{\hyperlink{structusb__endpoint_aa0d71bd1ddc4591f448a88a33d1eaff2}{ep\_mode}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02508}02508 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02509}02509 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02510}02510 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02511}\mbox{\hyperlink{xhci_8c_a3d9f016a4907ccb7c68fb3742c93a0c2}{02511}} \mbox{\hyperlink{xhci_8c_a3d9f016a4907ccb7c68fb3742c93a0c2}{xhci\_configure\_device}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02512}02512 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02513}02513         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02514}02514         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__search}{usb\_page\_search}} buf\_inp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02515}02515         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__cache}{usb\_page\_cache}} *pcinp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02516}02516         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__slot__ctx}{xhci\_slot\_ctx}} *slot;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02517}02517         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device}{usb\_device}} *hubdev;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02518}02518         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02519}02519         uint32\_t route;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02520}02520         uint32\_t rh\_port;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02521}02521         uint8\_t is\_hub;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02522}02522         uint8\_t index;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02523}02523         uint8\_t \mbox{\hyperlink{structusb__device_a4235127b6b2a4b50982007e31280a9c4}{depth}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02524}02524 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02525}02525         index = udev-\/>\mbox{\hyperlink{structusb__device_a9f275ef5fb35734f8174c9b01a855973}{controller\_slot\_id}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02526}02526 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02527}02527         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}index=\%u\(\backslash\)n"{}}, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02528}02528 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02529}02529         pcinp = \&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_ac3b7a1fbfd567e6b9c3cdcbc58bcd40e}{input\_pc}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02530}02530 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02531}02531         \mbox{\hyperlink{usb__busdma_8c_ab4f9d07714be540b6d002b44b3716bb2}{usbd\_get\_page}}(pcinp, 0, \&buf\_inp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02532}02532 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02533}02533         slot = \mbox{\hyperlink{xhci_8c_a7282cd159e63bc916b5f3d5b828ff61f}{XHCI\_GET\_CTX}}(sc, \mbox{\hyperlink{structxhci__input__dev__ctx}{xhci\_input\_dev\_ctx}}, \mbox{\hyperlink{xhci_8h_a102d058fa213774dd6a3aa079747d54f}{ctx\_slot}}, buf\_inp.\mbox{\hyperlink{structusb__page__search_a60cd5ce1bbfbf2d2dec7677b1ba9b01a}{buffer}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02534}02534 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02535}02535         rh\_port = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02536}02536         route = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02537}02537 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02538}02538         \textcolor{comment}{/* figure out route string and root HUB port number */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02539}02539 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02540}02540         \textcolor{keywordflow}{for} (hubdev = udev; hubdev != NULL; hubdev = hubdev-\/>\mbox{\hyperlink{structusb__device_aa35d4d1b88f22abb34d30e9762153e0b}{parent\_hub}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02541}02541                 \textcolor{keywordflow}{if} (hubdev-\/>\mbox{\hyperlink{structusb__device_aa35d4d1b88f22abb34d30e9762153e0b}{parent\_hub}} == NULL)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02542}02542                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02543}02543 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02544}02544                 \mbox{\hyperlink{structusb__device_a4235127b6b2a4b50982007e31280a9c4}{depth}} = hubdev-\/>\mbox{\hyperlink{structusb__device_aa35d4d1b88f22abb34d30e9762153e0b}{parent\_hub}}-\/>\mbox{\hyperlink{structusb__device_a4235127b6b2a4b50982007e31280a9c4}{depth}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02545}02545 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02546}02546                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02547}02547 \textcolor{comment}{                 * NOTE: HS/FS/LS devices and the SS root HUB can have}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02548}02548 \textcolor{comment}{                 * more than 15 ports}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02549}02549 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02550}02550 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02551}02551                 rh\_port = hubdev-\/>\mbox{\hyperlink{structusb__device_aad1b7bf74888da46b818db23b4f6adfb}{port\_no}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02552}02552 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02553}02553                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structusb__device_a4235127b6b2a4b50982007e31280a9c4}{depth}} == 0)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02554}02554                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02555}02555 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02556}02556                 \textcolor{keywordflow}{if} (rh\_port > 15)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02557}02557                         rh\_port = 15;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02558}02558 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02559}02559                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structusb__device_a4235127b6b2a4b50982007e31280a9c4}{depth}} < 6)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02560}02560                         route |= rh\_port << (4 * (\mbox{\hyperlink{structusb__device_a4235127b6b2a4b50982007e31280a9c4}{depth}} -\/ 1));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02561}02561         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02562}02562 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02563}02563         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Route=0x\%08x\(\backslash\)n"{}}, route);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02564}02564 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02565}02565         temp = \mbox{\hyperlink{xhci_8h_a44fa8bfd45c3862fff924f1eb53532e1}{XHCI\_SCTX\_0\_ROUTE\_SET}}(route) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02566}02566             \mbox{\hyperlink{xhci_8h_a232b50503d463cb948f7c1a34144487d}{XHCI\_SCTX\_0\_CTX\_NUM\_SET}}(}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02567}02567             sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_ac58a50329968674eeb31b05b7d5a099f}{context\_num}} + 1);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02568}02568 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02569}02569         \textcolor{keywordflow}{switch} (udev-\/>\mbox{\hyperlink{structusb__device_a1fc02abd43bd33f295493ed23debd852}{speed}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02570}02570         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a97e7c882fa8cd21898173a29471616ffa0ec4f8f66feaf7ee8f2ee618302e9470}{USB\_SPEED\_LOW}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02571}02571                 temp |= \mbox{\hyperlink{xhci_8h_a0c9ac1049ea6dabea09342e2012e400c}{XHCI\_SCTX\_0\_SPEED\_SET}}(2);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02572}02572                 \textcolor{keywordflow}{if} (udev-\/>\mbox{\hyperlink{structusb__device_a1d9147ffd9af6572cbfff03475f5a5e9}{parent\_hs\_hub}} != NULL \&\&}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02573}02573                     udev-\/>\mbox{\hyperlink{structusb__device_a1d9147ffd9af6572cbfff03475f5a5e9}{parent\_hs\_hub}}-\/>\mbox{\hyperlink{structusb__device_a6fa6ffff7bff082394d16b2b05d66cdf}{ddesc}}.\mbox{\hyperlink{structusb__device__descriptor_a94d6e194217a19638b354bf1c02c2d45}{bDeviceProtocol}} ==}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02574}02574                     \mbox{\hyperlink{usb_8h_a2163a87fddf61ae0eab644eef84209e3}{UDPROTO\_HSHUBMTT}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02575}02575                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Device inherits MTT\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02576}02576                         temp |= \mbox{\hyperlink{xhci_8h_a0a039a451bf5795d2c44cce44f6a06e7}{XHCI\_SCTX\_0\_MTT\_SET}}(1);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02577}02577                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02578}02578                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02579}02579         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a97e7c882fa8cd21898173a29471616ffa57eeede6d769b09c01ac9c9c62fef8c9}{USB\_SPEED\_HIGH}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02580}02580                 temp |= \mbox{\hyperlink{xhci_8h_a0c9ac1049ea6dabea09342e2012e400c}{XHCI\_SCTX\_0\_SPEED\_SET}}(3);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02581}02581                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_af258285183b81da3ce3f5a25acab4de6}{nports}} != 0 \&\&}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02582}02582                     udev-\/>\mbox{\hyperlink{structusb__device_a6fa6ffff7bff082394d16b2b05d66cdf}{ddesc}}.\mbox{\hyperlink{structusb__device__descriptor_a94d6e194217a19638b354bf1c02c2d45}{bDeviceProtocol}} == \mbox{\hyperlink{usb_8h_a2163a87fddf61ae0eab644eef84209e3}{UDPROTO\_HSHUBMTT}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02583}02583                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}HUB supports MTT\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02584}02584                         temp |= \mbox{\hyperlink{xhci_8h_a0a039a451bf5795d2c44cce44f6a06e7}{XHCI\_SCTX\_0\_MTT\_SET}}(1);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02585}02585                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02586}02586                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02587}02587         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a97e7c882fa8cd21898173a29471616ffa0f17d0b9928086c6114fea73e08f1780}{USB\_SPEED\_FULL}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02588}02588                 temp |= \mbox{\hyperlink{xhci_8h_a0c9ac1049ea6dabea09342e2012e400c}{XHCI\_SCTX\_0\_SPEED\_SET}}(1);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02589}02589                 \textcolor{keywordflow}{if} (udev-\/>\mbox{\hyperlink{structusb__device_a1d9147ffd9af6572cbfff03475f5a5e9}{parent\_hs\_hub}} != NULL \&\&}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02590}02590                     udev-\/>\mbox{\hyperlink{structusb__device_a1d9147ffd9af6572cbfff03475f5a5e9}{parent\_hs\_hub}}-\/>\mbox{\hyperlink{structusb__device_a6fa6ffff7bff082394d16b2b05d66cdf}{ddesc}}.\mbox{\hyperlink{structusb__device__descriptor_a94d6e194217a19638b354bf1c02c2d45}{bDeviceProtocol}} ==}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02591}02591                     \mbox{\hyperlink{usb_8h_a2163a87fddf61ae0eab644eef84209e3}{UDPROTO\_HSHUBMTT}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02592}02592                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Device inherits MTT\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02593}02593                         temp |= \mbox{\hyperlink{xhci_8h_a0a039a451bf5795d2c44cce44f6a06e7}{XHCI\_SCTX\_0\_MTT\_SET}}(1);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02594}02594                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02595}02595                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02596}02596         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02597}02597                 temp |= \mbox{\hyperlink{xhci_8h_a0c9ac1049ea6dabea09342e2012e400c}{XHCI\_SCTX\_0\_SPEED\_SET}}(4);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02598}02598                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02599}02599         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02600}02600 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02601}02601         is\_hub = sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_af258285183b81da3ce3f5a25acab4de6}{nports}} != 0 \&\&}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02602}02602             (udev-\/>\mbox{\hyperlink{structusb__device_a1fc02abd43bd33f295493ed23debd852}{speed}} == \mbox{\hyperlink{usb_8h_a97e7c882fa8cd21898173a29471616ffafeaa1573d94f4b3f0c4a4caa423eb81e}{USB\_SPEED\_SUPER}} ||}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02603}02603             udev-\/>\mbox{\hyperlink{structusb__device_a1fc02abd43bd33f295493ed23debd852}{speed}} == \mbox{\hyperlink{usb_8h_a97e7c882fa8cd21898173a29471616ffa57eeede6d769b09c01ac9c9c62fef8c9}{USB\_SPEED\_HIGH}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02604}02604 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02605}02605         \textcolor{keywordflow}{if} (is\_hub)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02606}02606                 temp |= \mbox{\hyperlink{xhci_8h_a20324172b064220bf6fb23166bf6b38e}{XHCI\_SCTX\_0\_HUB\_SET}}(1);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02607}02607 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02608}02608         slot-\/>dwSctx0 = htole32(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02609}02609 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02610}02610         temp = \mbox{\hyperlink{xhci_8h_aaad950f3c290b166f94d31a3d977d39e}{XHCI\_SCTX\_1\_RH\_PORT\_SET}}(rh\_port);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02611}02611 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02612}02612         \textcolor{keywordflow}{if} (is\_hub) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02613}02613                 temp |= \mbox{\hyperlink{xhci_8h_a088fb103d3086038d66b2992945bf584}{XHCI\_SCTX\_1\_NUM\_PORTS\_SET}}(}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02614}02614                     sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_af258285183b81da3ce3f5a25acab4de6}{nports}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02615}02615         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02616}02616 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02617}02617         slot-\/>dwSctx1 = htole32(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02618}02618 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02619}02619         temp = \mbox{\hyperlink{xhci_8h_af0c8376f38c9fc2f38890bdd6fa375cb}{XHCI\_SCTX\_2\_IRQ\_TARGET\_SET}}(0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02620}02620 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02621}02621         \textcolor{keywordflow}{if} (is\_hub) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02622}02622                 temp |= \mbox{\hyperlink{xhci_8h_a2bb60dbb8c90055f411c9d7501ccd552}{XHCI\_SCTX\_2\_TT\_THINK\_TIME\_SET}}(}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02623}02623                     sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_a96114fe8301fe31ef3ce2ec264e90ac2}{tt}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02624}02624         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02625}02625 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02626}02626         hubdev = udev-\/>\mbox{\hyperlink{structusb__device_a1d9147ffd9af6572cbfff03475f5a5e9}{parent\_hs\_hub}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02627}02627 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02628}02628         \textcolor{comment}{/* check if we should activate the transaction translator */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02629}02629         \textcolor{keywordflow}{switch} (udev-\/>\mbox{\hyperlink{structusb__device_a1fc02abd43bd33f295493ed23debd852}{speed}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02630}02630         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a97e7c882fa8cd21898173a29471616ffa0f17d0b9928086c6114fea73e08f1780}{USB\_SPEED\_FULL}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02631}02631         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a97e7c882fa8cd21898173a29471616ffa0ec4f8f66feaf7ee8f2ee618302e9470}{USB\_SPEED\_LOW}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02632}02632                 \textcolor{keywordflow}{if} (hubdev != NULL) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02633}02633                         temp |= \mbox{\hyperlink{xhci_8h_ab876f9ae6a4f86db884b30f9147e9040}{XHCI\_SCTX\_2\_TT\_HUB\_SID\_SET}}(}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02634}02634                             hubdev-\/>\mbox{\hyperlink{structusb__device_a9f275ef5fb35734f8174c9b01a855973}{controller\_slot\_id}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02635}02635                         temp |= \mbox{\hyperlink{xhci_8h_ad1c30649c8b7d508b636f79da6397c56}{XHCI\_SCTX\_2\_TT\_PORT\_NUM\_SET}}(}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02636}02636                             udev-\/>\mbox{\hyperlink{structusb__device_a3820f24eaa233e432b724fd1914f34a0}{hs\_port\_no}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02637}02637                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02638}02638                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02639}02639         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02640}02640                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02641}02641         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02642}02642 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02643}02643         slot-\/>dwSctx2 = htole32(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02644}02644 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02645}02645         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02646}02646 \textcolor{comment}{         * These fields should be initialized to zero, according to}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02647}02647 \textcolor{comment}{         * XHCI section 6.2.2 -\/ slot context:}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02648}02648 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02649}02649         temp = \mbox{\hyperlink{xhci_8h_a7e8dd47cd2c350b29b88ccb30f8aeec0}{XHCI\_SCTX\_3\_DEV\_ADDR\_SET}}(0) |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02650}02650             \mbox{\hyperlink{xhci_8h_a31cdf1bb0edff2ad7ab9fc4ad49c4591}{XHCI\_SCTX\_3\_SLOT\_STATE\_SET}}(0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02651}02651 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02652}02652         slot-\/>dwSctx3 = htole32(temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02653}02653 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02654}02654 \textcolor{preprocessor}{\#ifdef USB\_DEBUG}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02655}02655         xhci\_dump\_device(slot);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02656}02656 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02657}02657         \mbox{\hyperlink{usb__busdma_8h_a988a5299f521e8a8d94a68a03015bd77}{usb\_pc\_cpu\_flush}}(pcinp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02658}02658 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02659}02659         \textcolor{keywordflow}{return} (0);             \textcolor{comment}{/* success */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02660}02660 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02661}02661 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02662}02662 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02663}\mbox{\hyperlink{xhci_8c_afafde0f0dc9a3884bd4793a3931424e8}{02663}} \mbox{\hyperlink{xhci_8c_afafde0f0dc9a3884bd4793a3931424e8}{xhci\_alloc\_device\_ext}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02664}02664 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02665}02665         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02666}02666         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__search}{usb\_page\_search}} buf\_dev;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02667}02667         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__search}{usb\_page\_search}} buf\_ep;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02668}02668         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__trb}{xhci\_trb}} *trb;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02669}02669         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__cache}{usb\_page\_cache}} *pc;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02670}02670         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page}{usb\_page}} *pg;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02671}02671         uint64\_t addr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02672}02672         uint8\_t index;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02673}02673         uint8\_t i;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02674}02674 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02675}02675         index = udev-\/>\mbox{\hyperlink{structusb__device_a9f275ef5fb35734f8174c9b01a855973}{controller\_slot\_id}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02676}02676 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02677}02677         pc = \&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_a58b4c8a6356c9035a0b83599b8f8579b}{device\_pc}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02678}02678         pg = \&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_a5cbd7f8dee17e0f677f8e86b35a58323}{device\_pg}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02679}02679 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02680}02680         \textcolor{comment}{/* need to initialize the page cache */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02681}02681         pc-\/>\mbox{\hyperlink{structusb__page__cache_a7663bc380dc8f03d66b09cb845e309a6}{tag\_parent}} = sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.dma\_parent\_tag;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02682}02682 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02683}02683         \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__busdma_8h_aded9f2a61863d5d619acdb1e5094848a}{usb\_pc\_alloc\_mem}}(pc, pg, sc-\/>\mbox{\hyperlink{structxhci__softc_abfa50efdcd8dcd891372a6bafb5e5615}{sc\_ctx\_is\_64\_byte}} ?}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02684}02684             \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__dev__ctx64}{xhci\_dev\_ctx64}}) :}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02685}02685             \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__dev__ctx}{xhci\_dev\_ctx}}), \mbox{\hyperlink{xhci_8h_ad30aefaae2d4403c5082da7a10c54d21}{XHCI\_PAGE\_SIZE}}))}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02686}02686                 \textcolor{keywordflow}{goto} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02687}02687 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02688}02688         \mbox{\hyperlink{usb__busdma_8c_ab4f9d07714be540b6d002b44b3716bb2}{usbd\_get\_page}}(pc, 0, \&buf\_dev);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02689}02689 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02690}02690         pc = \&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_ac3b7a1fbfd567e6b9c3cdcbc58bcd40e}{input\_pc}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02691}02691         pg = \&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_aff5c10c87b572998df1130a2a03093b3}{input\_pg}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02692}02692 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02693}02693         \textcolor{comment}{/* need to initialize the page cache */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02694}02694         pc-\/>\mbox{\hyperlink{structusb__page__cache_a7663bc380dc8f03d66b09cb845e309a6}{tag\_parent}} = sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.dma\_parent\_tag;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02695}02695 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02696}02696         \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__busdma_8h_aded9f2a61863d5d619acdb1e5094848a}{usb\_pc\_alloc\_mem}}(pc, pg, sc-\/>\mbox{\hyperlink{structxhci__softc_abfa50efdcd8dcd891372a6bafb5e5615}{sc\_ctx\_is\_64\_byte}} ?}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02697}02697             \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__input__dev__ctx64}{xhci\_input\_dev\_ctx64}}) :}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02698}02698             \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__input__dev__ctx}{xhci\_input\_dev\_ctx}}), \mbox{\hyperlink{xhci_8h_ad30aefaae2d4403c5082da7a10c54d21}{XHCI\_PAGE\_SIZE}})) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02699}02699                 \textcolor{keywordflow}{goto} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02700}02700         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02701}02701 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02702}02702         \textcolor{comment}{/* initialize all endpoint LINK TRBs */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02703}02703 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02704}02704         \textcolor{keywordflow}{for} (i = 0; i != \mbox{\hyperlink{xhci_8h_a1f646fdf1c9542e107d082158bcb1411}{XHCI\_MAX\_ENDPOINTS}}; i++) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02705}02705                 pc = \&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_a7b4ccf1cad2b4e9d6e1930fc29ca2159}{endpoint\_pc}}[i];}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02706}02706                 pg = \&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_ac16b155df2ff17aef15a23dc2e8e703f}{endpoint\_pg}}[i];}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02707}02707 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02708}02708                 \textcolor{comment}{/* need to initialize the page cache */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02709}02709                 pc-\/>\mbox{\hyperlink{structusb__page__cache_a7663bc380dc8f03d66b09cb845e309a6}{tag\_parent}} = sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.dma\_parent\_tag;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02710}02710 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02711}02711                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__busdma_8h_aded9f2a61863d5d619acdb1e5094848a}{usb\_pc\_alloc\_mem}}(pc, pg,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02712}02712                     \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__dev__endpoint__trbs}{xhci\_dev\_endpoint\_trbs}}), \mbox{\hyperlink{xhci_8h_a4e88798b99ffb7b774c5718a5c577d71}{XHCI\_TRB\_ALIGN}})) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02713}02713                         \textcolor{keywordflow}{goto} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02714}02714                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02715}02715 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02716}02716                 \textcolor{comment}{/* lookup endpoint TRB ring */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02717}02717                 \mbox{\hyperlink{usb__busdma_8c_ab4f9d07714be540b6d002b44b3716bb2}{usbd\_get\_page}}(pc, 0, \&buf\_ep);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02718}02718 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02719}02719                 \textcolor{comment}{/* get TRB pointer */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02720}02720                 trb = buf\_ep.\mbox{\hyperlink{structusb__page__search_a60cd5ce1bbfbf2d2dec7677b1ba9b01a}{buffer}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02721}02721                 trb += \mbox{\hyperlink{xhci_8h_ad65c5c3edb879e07bba8237211cf64c5}{XHCI\_MAX\_TRANSFERS}} -\/ 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02722}02722 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02723}02723                 \textcolor{comment}{/* get TRB start address */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02724}02724                 addr = buf\_ep.physaddr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02725}02725 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02726}02726                 \textcolor{comment}{/* create LINK TRB */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02727}02727                 trb-\/>\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}} = htole64(addr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02728}02728                 trb-\/>\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}} = htole32(\mbox{\hyperlink{xhci_8h_a71fea2699e725eecdaabc99bcd675fb5}{XHCI\_TRB\_2\_IRQ\_SET}}(0));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02729}02729                 trb-\/>\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} = htole32(\mbox{\hyperlink{xhci_8h_aa99a6646570c85221b01f657524071ed}{XHCI\_TRB\_3\_CYCLE\_BIT}} |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02730}02730                     \mbox{\hyperlink{xhci_8h_a414401db438c92fd85d7d5179712c75e}{XHCI\_TRB\_3\_TYPE\_SET}}(\mbox{\hyperlink{xhci_8h_ad488af824032c353f8b7630f7f8abc7f}{XHCI\_TRB\_TYPE\_LINK}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02731}02731 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02732}02732                 \mbox{\hyperlink{usb__busdma_8h_a988a5299f521e8a8d94a68a03015bd77}{usb\_pc\_cpu\_flush}}(pc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02733}02733         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02734}02734 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02735}02735         \mbox{\hyperlink{xhci_8c_a8b25d51a6768cd99f0412cbfd52bc968}{xhci\_set\_slot\_pointer}}(sc, index, buf\_dev.physaddr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02736}02736 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02737}02737         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02738}02738 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02739}02739 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02740}02740         \mbox{\hyperlink{xhci_8c_a4dc0e10a8aa2b401fa2d24ea6ce12e05}{xhci\_free\_device\_ext}}(udev);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02741}02741 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02742}02742         \textcolor{keywordflow}{return} (\mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945ab676f37fd789593cd476f746210170cf}{USB\_ERR\_NOMEM}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02743}02743 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02744}02744 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02745}02745 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02746}\mbox{\hyperlink{xhci_8c_a4dc0e10a8aa2b401fa2d24ea6ce12e05}{02746}} \mbox{\hyperlink{xhci_8c_a4dc0e10a8aa2b401fa2d24ea6ce12e05}{xhci\_free\_device\_ext}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02747}02747 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02748}02748         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02749}02749         uint8\_t index;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02750}02750         uint8\_t i;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02751}02751 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02752}02752         index = udev-\/>\mbox{\hyperlink{structusb__device_a9f275ef5fb35734f8174c9b01a855973}{controller\_slot\_id}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02753}02753         \mbox{\hyperlink{xhci_8c_a8b25d51a6768cd99f0412cbfd52bc968}{xhci\_set\_slot\_pointer}}(sc, index, 0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02754}02754 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02755}02755         \mbox{\hyperlink{usb__busdma_8h_a43ad85a548118cf8d9e3cbc97dd7106f}{usb\_pc\_free\_mem}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_a58b4c8a6356c9035a0b83599b8f8579b}{device\_pc}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02756}02756         \mbox{\hyperlink{usb__busdma_8h_a43ad85a548118cf8d9e3cbc97dd7106f}{usb\_pc\_free\_mem}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_ac3b7a1fbfd567e6b9c3cdcbc58bcd40e}{input\_pc}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02757}02757         \textcolor{keywordflow}{for} (i = 0; i != \mbox{\hyperlink{xhci_8h_a1f646fdf1c9542e107d082158bcb1411}{XHCI\_MAX\_ENDPOINTS}}; i++)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02758}02758                 \mbox{\hyperlink{usb__busdma_8h_a43ad85a548118cf8d9e3cbc97dd7106f}{usb\_pc\_free\_mem}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_a7b4ccf1cad2b4e9d6e1930fc29ca2159}{endpoint\_pc}}[i]);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02759}02759 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02760}02760 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02761}02761 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__endpoint__ext}{xhci\_endpoint\_ext}} *}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02762}\mbox{\hyperlink{xhci_8c_af1c3f8bc816768b3a290ad69aafa7af0}{02762}} \mbox{\hyperlink{xhci_8c_af1c3f8bc816768b3a290ad69aafa7af0}{xhci\_get\_endpoint\_ext}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev, \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__endpoint__descriptor}{usb\_endpoint\_descriptor}} *edesc)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02763}02763 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02764}02764         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02765}02765         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__endpoint__ext}{xhci\_endpoint\_ext}} *pepext;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02766}02766         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__cache}{usb\_page\_cache}} *pc;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02767}02767         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__search}{usb\_page\_search}} buf\_ep;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02768}02768         uint8\_t epno;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02769}02769         uint8\_t index;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02770}02770 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02771}02771         epno = edesc-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_a3d0a0ab41c53023055a242d66a437a2d}{bEndpointAddress}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02772}02772         \textcolor{keywordflow}{if} ((edesc-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_aff28dcc97802a405b31baccd33c2bf8f}{bmAttributes}} \& \mbox{\hyperlink{usb_8h_a8badd3504359a0aed83ac575a46a67b4}{UE\_XFERTYPE}}) == \mbox{\hyperlink{usb_8h_ace49b7adb24ebcb0a0b17110c26aa63a}{UE\_CONTROL}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02773}02773                 epno |= \mbox{\hyperlink{usb_8h_a72bb077a860132c175c166f344c75893}{UE\_DIR\_IN}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02774}02774 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02775}02775         epno = \mbox{\hyperlink{xhci_8h_a8a803affdc78579a2e78adb894751b3d}{XHCI\_EPNO2EPID}}(epno);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02776}02776 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02777}02777         index = udev-\/>\mbox{\hyperlink{structusb__device_a9f275ef5fb35734f8174c9b01a855973}{controller\_slot\_id}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02778}02778 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02779}02779         pc = \&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_a7b4ccf1cad2b4e9d6e1930fc29ca2159}{endpoint\_pc}}[epno];}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02780}02780 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02781}02781         \mbox{\hyperlink{usb__busdma_8c_ab4f9d07714be540b6d002b44b3716bb2}{usbd\_get\_page}}(pc, 0, \&buf\_ep);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02782}02782 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02783}02783         pepext = \&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_aeb24a0d226849fb00f40e331f9a7b434}{endp}}[epno];}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02784}02784         pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a5e31d0a5d5dd1dfd30b1afafaa3588f1}{page\_cache}} = pc;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02785}02785         pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a0606813689084e8c7bc08cd9269b8a77}{trb}} = buf\_ep.\mbox{\hyperlink{structusb__page__search_a60cd5ce1bbfbf2d2dec7677b1ba9b01a}{buffer}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02786}02786         pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a248d4709aba68f9c9c685d0b5e6770e7}{physaddr}} = buf\_ep.physaddr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02787}02787 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02788}02788         \textcolor{keywordflow}{return} (pepext);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02789}02789 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02790}02790 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02791}02791 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02792}\mbox{\hyperlink{xhci_8c_aabc890bb66c8517ca8b7475cf04a1a18}{02792}} \mbox{\hyperlink{xhci_8c_aabc890bb66c8517ca8b7475cf04a1a18}{xhci\_endpoint\_doorbell}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02793}02793 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02794}02794         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(xfer-\/>\mbox{\hyperlink{structusb__xfer_ad188b4cd79900e1cd04aba6c140e9ab3}{xroot}}-\/>\mbox{\hyperlink{structusb__xfer__root_a870218d57253f00f1e9baa19401c9b0c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02795}02795         uint8\_t epno;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02796}02796         uint8\_t index;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02797}02797 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02798}02798         epno = xfer-\/>\mbox{\hyperlink{structusb__xfer_afe9addf10f35e5301cce41ebf42b5db2}{endpointno}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02799}02799         \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a777cf7dd18178f84b0d6e0a086f72a7a}{control\_xfr}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02800}02800                 epno |= \mbox{\hyperlink{usb_8h_a72bb077a860132c175c166f344c75893}{UE\_DIR\_IN}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02801}02801 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02802}02802         epno = \mbox{\hyperlink{xhci_8h_a8a803affdc78579a2e78adb894751b3d}{XHCI\_EPNO2EPID}}(epno);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02803}02803         index = xfer-\/>\mbox{\hyperlink{structusb__xfer_ad188b4cd79900e1cd04aba6c140e9ab3}{xroot}}-\/>\mbox{\hyperlink{structusb__xfer__root_ad636fcdafa42c174cdf281bb144b1e67}{udev}}-\/>\mbox{\hyperlink{structusb__device_a9f275ef5fb35734f8174c9b01a855973}{controller\_slot\_id}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02804}02804 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02805}02805         \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_ad188b4cd79900e1cd04aba6c140e9ab3}{xroot}}-\/>\mbox{\hyperlink{structusb__xfer__root_ad636fcdafa42c174cdf281bb144b1e67}{udev}}-\/>\mbox{\hyperlink{structusb__device_ae7b27fdcae02d49bee5c2f0a9130b633}{flags}}.\mbox{\hyperlink{structusb__device__flags_a9d1323e73bf72fdb6a0e60b36401faae}{self\_suspended}} == 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02806}02806                 \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, door, \mbox{\hyperlink{xhcireg_8h_a6b426074e34edc0a6aef5a1d32ac445b}{XHCI\_DOORBELL}}(index),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02807}02807                     epno | \mbox{\hyperlink{xhcireg_8h_acb878531e6b4ccaa0cb904370d8d2ab5}{XHCI\_DB\_SID\_SET}}(xfer-\/>\mbox{\hyperlink{structusb__xfer_a042262c8b77567b6588d0ba01446deb9}{stream\_id}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02808}02808         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02809}02809 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02810}02810 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02811}02811 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02812}\mbox{\hyperlink{xhci_8c_a009f7f03bbfe6563c79d30c8ca2b49ea}{02812}} \mbox{\hyperlink{xhci_8c_a009f7f03bbfe6563c79d30c8ca2b49ea}{xhci\_transfer\_remove}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02813}02813 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02814}02814         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__endpoint__ext}{xhci\_endpoint\_ext}} *pepext;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02815}02815 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02816}02816         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structxhci__endpoint__ext_a950f74c7e80c49fd46b528c6ab9c78ad}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_ae68dc5b28a589268a7b7e461ba7659c5}{bandwidth\_reclaimed}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02817}02817                 \mbox{\hyperlink{structxhci__endpoint__ext_a950f74c7e80c49fd46b528c6ab9c78ad}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_ae68dc5b28a589268a7b7e461ba7659c5}{bandwidth\_reclaimed}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02818}02818 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02819}02819                 pepext = \mbox{\hyperlink{xhci_8c_af1c3f8bc816768b3a290ad69aafa7af0}{xhci\_get\_endpoint\_ext}}(\mbox{\hyperlink{structxhci__endpoint__ext_a950f74c7e80c49fd46b528c6ab9c78ad}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_ad188b4cd79900e1cd04aba6c140e9ab3}{xroot}}-\/>\mbox{\hyperlink{structusb__xfer__root_ad636fcdafa42c174cdf281bb144b1e67}{udev}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02820}02820                     \mbox{\hyperlink{structxhci__endpoint__ext_a950f74c7e80c49fd46b528c6ab9c78ad}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a8de3fd948d496c7901b307b13a1c6e99}{endpoint}}-\/>\mbox{\hyperlink{structusb__endpoint_af3b96b9fe1e612b303833c2e2d0365e1}{edesc}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02821}02821 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02822}02822                 pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a12cb80725516698b1ca06c74a8fec312}{trb\_used}}[\mbox{\hyperlink{structxhci__endpoint__ext_a950f74c7e80c49fd46b528c6ab9c78ad}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a042262c8b77567b6588d0ba01446deb9}{stream\_id}}]-\/-\/;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02823}02823 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02824}02824                 pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a950f74c7e80c49fd46b528c6ab9c78ad}{xfer}}[\mbox{\hyperlink{structxhci__endpoint__ext_a950f74c7e80c49fd46b528c6ab9c78ad}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a4dcb22bb91c18dba08366792900c01c9}{qh\_pos}}] = NULL;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02825}02825 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02826}02826                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} \&\& pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_ac3b4c115bbc8f9df3b922c27036ea47c}{trb\_running}} != 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02827}02827                         pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a3e583572d83c2276b0cc995d08574f1d}{trb\_halted}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02828}02828                         pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_ac3b4c115bbc8f9df3b922c27036ea47c}{trb\_running}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02829}02829                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02830}02830         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02831}02831 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02832}02832 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02833}02833 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02834}\mbox{\hyperlink{xhci_8c_a807ea787807af2759762bdca7e362171}{02834}} \mbox{\hyperlink{xhci_8c_a807ea787807af2759762bdca7e362171}{xhci\_transfer\_insert}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *\mbox{\hyperlink{structxhci__endpoint__ext_a950f74c7e80c49fd46b528c6ab9c78ad}{xfer}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02835}02835 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02836}02836         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__td}{xhci\_td}} *td\_first;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02837}02837         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__td}{xhci\_td}} *td\_last;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02838}02838         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__trb}{xhci\_trb}} *trb\_link;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02839}02839         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__endpoint__ext}{xhci\_endpoint\_ext}} *pepext;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02840}02840         uint64\_t addr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02841}02841         \mbox{\hyperlink{usb__freebsd_8h_a3f3a2ea5069eca21eab610b65c30c173}{usb\_stream\_t}} \mbox{\hyperlink{if__usievar_8h_a1e6927fa1486224044e568f9c370519b}{id}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02842}02842         uint8\_t i;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02843}02843         uint8\_t inext;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02844}02844         uint8\_t trb\_limit;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02845}02845 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02846}02846         DPRINTFN(8, \textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02847}02847 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02848}02848         \textcolor{keywordtype}{id} = \mbox{\hyperlink{structxhci__endpoint__ext_a950f74c7e80c49fd46b528c6ab9c78ad}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a042262c8b77567b6588d0ba01446deb9}{stream\_id}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02849}02849 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02850}02850         \textcolor{comment}{/* check if already inserted */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02851}02851         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structxhci__endpoint__ext_a950f74c7e80c49fd46b528c6ab9c78ad}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_ae68dc5b28a589268a7b7e461ba7659c5}{bandwidth\_reclaimed}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02852}02852                 DPRINTFN(8, \textcolor{stringliteral}{"{}Already in schedule\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02853}02853                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02854}02854         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02855}02855 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02856}02856         pepext = \mbox{\hyperlink{xhci_8c_af1c3f8bc816768b3a290ad69aafa7af0}{xhci\_get\_endpoint\_ext}}(\mbox{\hyperlink{structxhci__endpoint__ext_a950f74c7e80c49fd46b528c6ab9c78ad}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_ad188b4cd79900e1cd04aba6c140e9ab3}{xroot}}-\/>\mbox{\hyperlink{structusb__xfer__root_ad636fcdafa42c174cdf281bb144b1e67}{udev}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02857}02857             \mbox{\hyperlink{structxhci__endpoint__ext_a950f74c7e80c49fd46b528c6ab9c78ad}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a8de3fd948d496c7901b307b13a1c6e99}{endpoint}}-\/>\mbox{\hyperlink{structusb__endpoint_af3b96b9fe1e612b303833c2e2d0365e1}{edesc}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02858}02858 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02859}02859         td\_first = \mbox{\hyperlink{structxhci__endpoint__ext_a950f74c7e80c49fd46b528c6ab9c78ad}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_ae7adef379254c2ca0c87f265c59f5f5c}{td\_transfer\_first}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02860}02860         td\_last = \mbox{\hyperlink{structxhci__endpoint__ext_a950f74c7e80c49fd46b528c6ab9c78ad}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_ae74733ea0d49027c19477ea63a223f26}{td\_transfer\_last}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02861}02861         addr = pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a248d4709aba68f9c9c685d0b5e6770e7}{physaddr}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02862}02862 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02863}02863         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{structxhci__endpoint__ext_a950f74c7e80c49fd46b528c6ab9c78ad}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a8de3fd948d496c7901b307b13a1c6e99}{endpoint}}-\/>\mbox{\hyperlink{structusb__endpoint_af3b96b9fe1e612b303833c2e2d0365e1}{edesc}}-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_aff28dcc97802a405b31baccd33c2bf8f}{bmAttributes}} \& \mbox{\hyperlink{usb_8h_a8badd3504359a0aed83ac575a46a67b4}{UE\_XFERTYPE}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02864}02864         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_ace49b7adb24ebcb0a0b17110c26aa63a}{UE\_CONTROL}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02865}02865         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a01e28e87ad16f6dfffefc6ccab08baed}{UE\_INTERRUPT}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02866}02866                 \textcolor{comment}{/* single buffered */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02867}02867                 trb\_limit = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02868}02868                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02869}02869         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02870}02870                 \textcolor{comment}{/* multi buffered */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02871}02871                 trb\_limit = (\mbox{\hyperlink{xhci_8h_ad65c5c3edb879e07bba8237211cf64c5}{XHCI\_MAX\_TRANSFERS}} -\/ 2);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02872}02872                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02873}02873         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02874}02874 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02875}02875         \textcolor{keywordflow}{if} (pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a12cb80725516698b1ca06c74a8fec312}{trb\_used}}[\textcolor{keywordtype}{id}] >= trb\_limit) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02876}02876                 DPRINTFN(8, \textcolor{stringliteral}{"{}Too many TDs queued.\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02877}02877                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945ab676f37fd789593cd476f746210170cf}{USB\_ERR\_NOMEM}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02878}02878         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02879}02879 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02880}02880         \textcolor{comment}{/* check if bMaxPacketSize changed */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02881}02881         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structxhci__endpoint__ext_a950f74c7e80c49fd46b528c6ab9c78ad}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a777cf7dd18178f84b0d6e0a086f72a7a}{control\_xfr}} != 0 \&\&}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02882}02882             pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_add6f180db324ddeb15351299208f162e}{trb\_ep\_maxp}} != \mbox{\hyperlink{structxhci__endpoint__ext_a950f74c7e80c49fd46b528c6ab9c78ad}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a8de3fd948d496c7901b307b13a1c6e99}{endpoint}}-\/>\mbox{\hyperlink{structusb__endpoint_af3b96b9fe1e612b303833c2e2d0365e1}{edesc}}-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_af5ba49fb2ee7353335dc33e38d89aed5}{wMaxPacketSize}}[0]) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02883}02883                 DPRINTFN(8, \textcolor{stringliteral}{"{}Reconfigure control endpoint\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02884}02884 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02885}02885                 \textcolor{comment}{/* force driver to reconfigure endpoint */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02886}02886                 pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a3e583572d83c2276b0cc995d08574f1d}{trb\_halted}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02887}02887                 pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_ac3b4c115bbc8f9df3b922c27036ea47c}{trb\_running}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02888}02888         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02889}02889 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02890}02890         \textcolor{comment}{/* check for stopped condition, after putting transfer on interrupt queue */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02891}02891         \textcolor{keywordflow}{if} (pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_ac3b4c115bbc8f9df3b922c27036ea47c}{trb\_running}} == 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02892}02892                 \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(xfer-\/>\mbox{\hyperlink{structusb__xfer_ad188b4cd79900e1cd04aba6c140e9ab3}{xroot}}-\/>\mbox{\hyperlink{structusb__xfer__root_a870218d57253f00f1e9baa19401c9b0c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02893}02893 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02894}02894                 DPRINTFN(8, \textcolor{stringliteral}{"{}Not running\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02895}02895 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02896}02896                 \textcolor{comment}{/* start configuration */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02897}02897                 (void)\mbox{\hyperlink{usb__process_8c_a9815bfac5c88a8f483a16eebe010bfc7}{usb\_proc\_msignal}}(USB\_BUS\_CONTROL\_XFER\_PROC(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02898}02898                     \&sc-\/>\mbox{\hyperlink{structxhci__softc_a713afcfe3bcc8d061211f946ec6b36cc}{sc\_config\_msg}}[0], \&sc-\/>\mbox{\hyperlink{structxhci__softc_a713afcfe3bcc8d061211f946ec6b36cc}{sc\_config\_msg}}[1]);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02899}02899                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02900}02900         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02901}02901 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02902}02902         pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a12cb80725516698b1ca06c74a8fec312}{trb\_used}}[\mbox{\hyperlink{if__usievar_8h_a1e6927fa1486224044e568f9c370519b}{id}}]++;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02903}02903 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02904}02904         \textcolor{comment}{/* get current TRB index */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02905}02905         i = pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_aaf51ba70017bf6e833df9c5ddf06bfbc}{trb\_index}}[\mbox{\hyperlink{if__usievar_8h_a1e6927fa1486224044e568f9c370519b}{id}}];}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02906}02906 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02907}02907         \textcolor{comment}{/* get next TRB index */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02908}02908         inext = (i + 1);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02909}02909 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02910}02910         \textcolor{comment}{/* the last entry of the ring is a hardcoded link TRB */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02911}02911         \textcolor{keywordflow}{if} (inext >= (\mbox{\hyperlink{xhci_8h_ad65c5c3edb879e07bba8237211cf64c5}{XHCI\_MAX\_TRANSFERS}} -\/ 1))}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02912}02912                 inext = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02913}02913 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02914}02914         \textcolor{comment}{/* store next TRB index, before stream ID offset is added */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02915}02915         pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_aaf51ba70017bf6e833df9c5ddf06bfbc}{trb\_index}}[\mbox{\hyperlink{if__usievar_8h_a1e6927fa1486224044e568f9c370519b}{id}}] = inext;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02916}02916 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02917}02917         \textcolor{comment}{/* offset for stream */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02918}02918         i += \textcolor{keywordtype}{id} * \mbox{\hyperlink{xhci_8h_ad65c5c3edb879e07bba8237211cf64c5}{XHCI\_MAX\_TRANSFERS}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02919}02919         inext += \textcolor{keywordtype}{id} * \mbox{\hyperlink{xhci_8h_ad65c5c3edb879e07bba8237211cf64c5}{XHCI\_MAX\_TRANSFERS}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02920}02920 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02921}02921         \textcolor{comment}{/* compute terminating return address */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02922}02922         addr += (inext * \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__trb}{xhci\_trb}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02923}02923 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02924}02924         \textcolor{comment}{/* compute link TRB pointer */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02925}02925         trb\_link = td\_last-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}} + td\_last-\/>\mbox{\hyperlink{structxhci__td_a8d57ed1abb0a3eaf8f5695c4ae4db737}{ntrb}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02926}02926 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02927}02927         \textcolor{comment}{/* update next pointer of last link TRB */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02928}02928         trb\_link-\/>\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}} = htole64(addr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02929}02929         trb\_link-\/>\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}} = htole32(\mbox{\hyperlink{xhci_8h_a71fea2699e725eecdaabc99bcd675fb5}{XHCI\_TRB\_2\_IRQ\_SET}}(0));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02930}02930         trb\_link-\/>\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} = htole32(\mbox{\hyperlink{xhci_8h_a0e23ab21bb123ac78940cde5c5398809}{XHCI\_TRB\_3\_IOC\_BIT}} |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02931}02931             \mbox{\hyperlink{xhci_8h_aa99a6646570c85221b01f657524071ed}{XHCI\_TRB\_3\_CYCLE\_BIT}} |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02932}02932             \mbox{\hyperlink{xhci_8h_a414401db438c92fd85d7d5179712c75e}{XHCI\_TRB\_3\_TYPE\_SET}}(\mbox{\hyperlink{xhci_8h_ad488af824032c353f8b7630f7f8abc7f}{XHCI\_TRB\_TYPE\_LINK}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02933}02933 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02934}02934 \textcolor{preprocessor}{\#ifdef USB\_DEBUG}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02935}02935         xhci\_dump\_trb(\&td\_last-\/>\mbox{\hyperlink{structxhci__td_af222f89f760ac622352d256d88907c35}{td\_trb}}[td\_last-\/>\mbox{\hyperlink{structxhci__td_a8d57ed1abb0a3eaf8f5695c4ae4db737}{ntrb}}]);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02936}02936 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02937}02937         \mbox{\hyperlink{usb__busdma_8h_a988a5299f521e8a8d94a68a03015bd77}{usb\_pc\_cpu\_flush}}(td\_last-\/>\mbox{\hyperlink{structxhci__td_a933fec23ad2794824d084b5a78397a87}{page\_cache}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02938}02938 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02939}02939         \textcolor{comment}{/* write ahead chain end marker */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02940}02940 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02941}02941         pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a0606813689084e8c7bc08cd9269b8a77}{trb}}[inext].\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02942}02942         pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a0606813689084e8c7bc08cd9269b8a77}{trb}}[inext].\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02943}02943         pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a0606813689084e8c7bc08cd9269b8a77}{trb}}[inext].\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02944}02944 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02945}02945         \textcolor{comment}{/* update next pointer of link TRB */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02946}02946 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02947}02947         pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a0606813689084e8c7bc08cd9269b8a77}{trb}}[i].\mbox{\hyperlink{structxhci__trb_a841b2c5a28c0ad8c284b3df765c312e4}{qwTrb0}} = htole64((uint64\_t)td\_first-\/>\mbox{\hyperlink{structxhci__td_a7d6a15b4a2d6e680a794e420a42d6124}{td\_self}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02948}02948         pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a0606813689084e8c7bc08cd9269b8a77}{trb}}[i].\mbox{\hyperlink{structxhci__trb_a2f59ab9112f25774b98748c2834ccbe9}{dwTrb2}} = htole32(\mbox{\hyperlink{xhci_8h_a71fea2699e725eecdaabc99bcd675fb5}{XHCI\_TRB\_2\_IRQ\_SET}}(0));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02949}02949 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02950}02950 \textcolor{preprocessor}{\#ifdef USB\_DEBUG}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02951}02951         xhci\_dump\_trb(\&pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a0606813689084e8c7bc08cd9269b8a77}{trb}}[i]);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02952}02952 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02953}02953         \mbox{\hyperlink{usb__busdma_8h_a988a5299f521e8a8d94a68a03015bd77}{usb\_pc\_cpu\_flush}}(pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a5e31d0a5d5dd1dfd30b1afafaa3588f1}{page\_cache}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02954}02954 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02955}02955         \textcolor{comment}{/* toggle cycle bit which activates the transfer chain */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02956}02956 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02957}02957         pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a0606813689084e8c7bc08cd9269b8a77}{trb}}[i].\mbox{\hyperlink{structxhci__trb_aa1842dbf95fb14dece65263ebb8eef21}{dwTrb3}} = htole32(\mbox{\hyperlink{xhci_8h_aa99a6646570c85221b01f657524071ed}{XHCI\_TRB\_3\_CYCLE\_BIT}} |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02958}02958             \mbox{\hyperlink{xhci_8h_a414401db438c92fd85d7d5179712c75e}{XHCI\_TRB\_3\_TYPE\_SET}}(\mbox{\hyperlink{xhci_8h_ad488af824032c353f8b7630f7f8abc7f}{XHCI\_TRB\_TYPE\_LINK}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02959}02959 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02960}02960         \mbox{\hyperlink{usb__busdma_8h_a988a5299f521e8a8d94a68a03015bd77}{usb\_pc\_cpu\_flush}}(pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a5e31d0a5d5dd1dfd30b1afafaa3588f1}{page\_cache}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02961}02961 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02962}02962         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}qh\_pos = \%u\(\backslash\)n"{}}, i);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02963}02963 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02964}02964         pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a950f74c7e80c49fd46b528c6ab9c78ad}{xfer}}[i] = xfer;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02965}02965 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02966}02966         xfer-\/>\mbox{\hyperlink{structusb__xfer_a4dcb22bb91c18dba08366792900c01c9}{qh\_pos}} = i;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02967}02967 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02968}02968         xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_ae68dc5b28a589268a7b7e461ba7659c5}{bandwidth\_reclaimed}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02969}02969 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02970}02970         \mbox{\hyperlink{xhci_8c_aabc890bb66c8517ca8b7475cf04a1a18}{xhci\_endpoint\_doorbell}}(xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02971}02971 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02972}02972         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02973}02973 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02974}02974 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02975}02975 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02976}\mbox{\hyperlink{xhci_8c_a31e9863c6b47913bfde367b708bdca5d}{02976}} \mbox{\hyperlink{xhci_8c_a31e9863c6b47913bfde367b708bdca5d}{xhci\_root\_intr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02977}02977 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02978}02978         uint16\_t i;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02979}02979 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02980}02980         \mbox{\hyperlink{usb__core_8h_adf78e1178dd30ec4a8a53087fe6c7e02}{USB\_BUS\_LOCK\_ASSERT}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02981}02981 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02982}02982         \textcolor{comment}{/* clear any old interrupt data */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02983}02983         memset(sc-\/>\mbox{\hyperlink{structxhci__softc_ac85ace38a8ef7f530dac560ce6c69a41}{sc\_hub\_idata}}, 0, \textcolor{keyword}{sizeof}(sc-\/>\mbox{\hyperlink{structxhci__softc_ac85ace38a8ef7f530dac560ce6c69a41}{sc\_hub\_idata}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02984}02984 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02985}02985         \textcolor{keywordflow}{for} (i = 1; i <= sc-\/>\mbox{\hyperlink{structxhci__softc_aee3ef1fdb126d4c5e6f41099fc63c5ea}{sc\_noport}}; i++) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02986}02986                 \textcolor{comment}{/* pick out CHANGE bits from the status register */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02987}02987                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_a5fc3a868a2a89aeff110dfd0a3701462}{XHCI\_PORTSC}}(i)) \& (}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02988}02988                     \mbox{\hyperlink{xhcireg_8h_a17a5d2da7a53516b1080d05b5de5815f}{XHCI\_PS\_CSC}} | \mbox{\hyperlink{xhcireg_8h_af7838a7c635af332a70ac27d8b807699}{XHCI\_PS\_PEC}} |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02989}02989                     \mbox{\hyperlink{xhcireg_8h_aef5d06e0627757c9dbebfcf78e9c0eed}{XHCI\_PS\_OCC}} | \mbox{\hyperlink{xhcireg_8h_ab89f476faf605c56e35c335c988cb55c}{XHCI\_PS\_WRC}} |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02990}02990                     \mbox{\hyperlink{xhcireg_8h_a33181810d4b2c123bfe4d6dd8dd7907b}{XHCI\_PS\_PRC}} | \mbox{\hyperlink{xhcireg_8h_ac35f426018cce1012c24a61820eff33f}{XHCI\_PS\_PLC}} |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02991}02991                     \mbox{\hyperlink{xhcireg_8h_af6cc46aff4d9355dba9d4a6e9559be84}{XHCI\_PS\_CEC}})) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02992}02992                         sc-\/>\mbox{\hyperlink{structxhci__softc_ac85ace38a8ef7f530dac560ce6c69a41}{sc\_hub\_idata}}[i / 8] |= 1 << (i \% 8);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02993}02993                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}port \%d changed\(\backslash\)n"{}}, i);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02994}02994                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02995}02995         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02996}02996         \mbox{\hyperlink{usb__hub_8c_a5d4ec35789c119dd1afa44df46d4b8ed}{uhub\_root\_intr}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}, sc-\/>\mbox{\hyperlink{structxhci__softc_ac85ace38a8ef7f530dac560ce6c69a41}{sc\_hub\_idata}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02997}02997             \textcolor{keyword}{sizeof}(sc-\/>\mbox{\hyperlink{structxhci__softc_ac85ace38a8ef7f530dac560ce6c69a41}{sc\_hub\_idata}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02998}02998 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l02999}02999 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03000}03000 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03001}03001 \textcolor{comment}{ *      xhci\_device\_done -\/ XHCI done handler}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03002}03002 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03003}03003 \textcolor{comment}{ * NOTE: This function can be called two times in a row on}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03004}03004 \textcolor{comment}{ * the same USB transfer. From close and from interrupt.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03005}03005 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03006}03006 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03007}\mbox{\hyperlink{xhci_8c_a599f5f1237516bdefbf20695b1f8400c}{03007}} \mbox{\hyperlink{xhci_8c_a599f5f1237516bdefbf20695b1f8400c}{xhci\_device\_done}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03008}03008 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03009}03009         DPRINTFN(2, \textcolor{stringliteral}{"{}xfer=\%p, endpoint=\%p, error=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03010}03010             xfer, xfer-\/>\mbox{\hyperlink{structusb__xfer_a8de3fd948d496c7901b307b13a1c6e99}{endpoint}}, \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03011}03011 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03012}03012         \textcolor{comment}{/* remove transfer from HW queue */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03013}03013         \mbox{\hyperlink{xhci_8c_a009f7f03bbfe6563c79d30c8ca2b49ea}{xhci\_transfer\_remove}}(xfer, \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03014}03014 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03015}03015         \textcolor{comment}{/* dequeue transfer and start next transfer */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03016}03016         \mbox{\hyperlink{usb__transfer_8c_a3141421f88316987bbc9b10e36715faf}{usbd\_transfer\_done}}(xfer, \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03017}03017 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03018}03018 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03019}03019 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03020}03020 \textcolor{comment}{ * XHCI data transfer support (generic type)}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03021}03021 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03022}03022 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03023}\mbox{\hyperlink{xhci_8c_acfdca3b75c6eba306e1f702a0d836558}{03023}} \mbox{\hyperlink{xhci_8c_acfdca3b75c6eba306e1f702a0d836558}{xhci\_device\_generic\_open}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03024}03024 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03025}03025         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03026}03026 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03027}03027 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03028}03028 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03029}\mbox{\hyperlink{xhci_8c_a5d4d7fa6440073d47c28651572889141}{03029}} \mbox{\hyperlink{xhci_8c_a5d4d7fa6440073d47c28651572889141}{xhci\_device\_generic\_close}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03030}03030 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03031}03031         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03032}03032 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03033}03033         \mbox{\hyperlink{xhci_8c_a599f5f1237516bdefbf20695b1f8400c}{xhci\_device\_done}}(xfer, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03034}03034 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03035}03035 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03036}03036 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03037}\mbox{\hyperlink{xhci_8c_ad869b0a87995f55c632ec381a18c5abf}{03037}} \mbox{\hyperlink{xhci_8c_ad869b0a87995f55c632ec381a18c5abf}{xhci\_device\_generic\_multi\_enter}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__endpoint}{usb\_endpoint}} *ep,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03038}03038     \mbox{\hyperlink{usb__freebsd_8h_a3f3a2ea5069eca21eab610b65c30c173}{usb\_stream\_t}} stream\_id, \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *enter\_xfer)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03039}03039 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03040}03040         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03041}03041 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03042}03042         \textcolor{comment}{/* check if there is a current transfer */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03043}03043         xfer = ep-\/>\mbox{\hyperlink{structusb__endpoint_a8c6530aca08e1e74ed95341bed82b12f}{endpoint\_q}}[\mbox{\hyperlink{structusb__xfer_a042262c8b77567b6588d0ba01446deb9}{stream\_id}}].\mbox{\hyperlink{structusb__xfer__queue_a335a8109524426b694f58cceeced3ee3}{curr}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03044}03044         \textcolor{keywordflow}{if} (xfer == NULL)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03045}03045                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03046}03046 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03047}03047         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03048}03048 \textcolor{comment}{         * Check if the current transfer is started and then pickup}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03049}03049 \textcolor{comment}{         * the next one, if any. Else wait for next start event due to}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03050}03050 \textcolor{comment}{         * block on failure feature.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03051}03051 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03052}03052         \textcolor{keywordflow}{if} (!xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_ae68dc5b28a589268a7b7e461ba7659c5}{bandwidth\_reclaimed}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03053}03053                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03054}03054 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03055}03055         xfer = TAILQ\_FIRST(\&ep-\/>\mbox{\hyperlink{structusb__endpoint_a8c6530aca08e1e74ed95341bed82b12f}{endpoint\_q}}[\mbox{\hyperlink{structusb__xfer_a042262c8b77567b6588d0ba01446deb9}{stream\_id}}].head);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03056}03056         \textcolor{keywordflow}{if} (xfer == NULL) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03057}03057                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03058}03058 \textcolor{comment}{                 * In case of enter we have to consider that the}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03059}03059 \textcolor{comment}{                 * transfer is queued by the USB core after the enter}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03060}03060 \textcolor{comment}{                 * method is called.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03061}03061 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03062}03062                 xfer = enter\_xfer;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03063}03063 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03064}03064                 \textcolor{keywordflow}{if} (xfer == NULL)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03065}03065                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03066}03066         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03067}03067 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03068}03068         \textcolor{comment}{/* try to multi buffer */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03069}03069         \mbox{\hyperlink{xhci_8c_a807ea787807af2759762bdca7e362171}{xhci\_transfer\_insert}}(xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03070}03070 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03071}03071 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03072}03072 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03073}\mbox{\hyperlink{xhci_8c_aac5236d55d415fcfeb469bfd70c305ce}{03073}} \mbox{\hyperlink{xhci_8c_aac5236d55d415fcfeb469bfd70c305ce}{xhci\_device\_generic\_enter}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03074}03074 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03075}03075         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03076}03076 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03077}03077         \textcolor{comment}{/* set up TD's and QH */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03078}03078         \mbox{\hyperlink{xhci_8c_a952ecf0f25dda140516aa09999937a5a}{xhci\_setup\_generic\_chain}}(xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03079}03079 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03080}03080         \mbox{\hyperlink{xhci_8c_ad869b0a87995f55c632ec381a18c5abf}{xhci\_device\_generic\_multi\_enter}}(xfer-\/>\mbox{\hyperlink{structusb__xfer_a8de3fd948d496c7901b307b13a1c6e99}{endpoint}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03081}03081             xfer-\/>\mbox{\hyperlink{structusb__xfer_a042262c8b77567b6588d0ba01446deb9}{stream\_id}}, xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03082}03082 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03083}03083 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03084}03084 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03085}\mbox{\hyperlink{xhci_8c_ad0fe6a28137c476b889d18f63d6d72a6}{03085}} \mbox{\hyperlink{xhci_8c_ad0fe6a28137c476b889d18f63d6d72a6}{xhci\_device\_generic\_start}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03086}03086 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03087}03087         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03088}03088 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03089}03089         \textcolor{comment}{/* try to insert xfer on HW queue */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03090}03090         \mbox{\hyperlink{xhci_8c_a807ea787807af2759762bdca7e362171}{xhci\_transfer\_insert}}(xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03091}03091 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03092}03092         \textcolor{comment}{/* try to multi buffer */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03093}03093         \mbox{\hyperlink{xhci_8c_ad869b0a87995f55c632ec381a18c5abf}{xhci\_device\_generic\_multi\_enter}}(xfer-\/>\mbox{\hyperlink{structusb__xfer_a8de3fd948d496c7901b307b13a1c6e99}{endpoint}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03094}03094             xfer-\/>\mbox{\hyperlink{structusb__xfer_a042262c8b77567b6588d0ba01446deb9}{stream\_id}}, NULL);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03095}03095 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03096}03096         \textcolor{comment}{/* add transfer last on interrupt queue */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03097}03097         \mbox{\hyperlink{usb__transfer_8c_abfdcc46256df403f3f4d1b02db7ccb16}{usbd\_transfer\_enqueue}}(\&xfer-\/>\mbox{\hyperlink{structusb__xfer_ad188b4cd79900e1cd04aba6c140e9ab3}{xroot}}-\/>\mbox{\hyperlink{structusb__xfer__root_a870218d57253f00f1e9baa19401c9b0c}{bus}}-\/>\mbox{\hyperlink{structusb__bus_afe87bf7e25fe7284a87d14ca231bc818}{intr\_q}}, xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03098}03098 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03099}03099         \textcolor{comment}{/* start timeout, if any */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03100}03100         \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a766f3db3d34b816ff819212c11f27ad3}{timeout}} != 0)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03101}03101                 \mbox{\hyperlink{usb__transfer_8c_ad2a08e4791c74765a0ecc20d5894ab36}{usbd\_transfer\_timeout\_ms}}(xfer, \&\mbox{\hyperlink{xhci_8c_a35999b36530a5835ab3a475b358c2a76}{xhci\_timeout}}, xfer-\/>\mbox{\hyperlink{structusb__xfer_a766f3db3d34b816ff819212c11f27ad3}{timeout}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03102}03102 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03103}03103 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03104}\mbox{\hyperlink{xhci_8c_ae77cd8d6fda41960a2f01337561a7469}{03104}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__pipe__methods}{usb\_pipe\_methods}} \mbox{\hyperlink{xhci_8c_ae77cd8d6fda41960a2f01337561a7469}{xhci\_device\_generic\_methods}} =}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03105}03105 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03106}03106         .\mbox{\hyperlink{structusb__pipe__methods_a9745134b3e58cdaff56836b57ac15d52}{open}} = \mbox{\hyperlink{xhci_8c_acfdca3b75c6eba306e1f702a0d836558}{xhci\_device\_generic\_open}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03107}03107         .close = \mbox{\hyperlink{xhci_8c_a5d4d7fa6440073d47c28651572889141}{xhci\_device\_generic\_close}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03108}03108         .enter = \mbox{\hyperlink{xhci_8c_aac5236d55d415fcfeb469bfd70c305ce}{xhci\_device\_generic\_enter}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03109}03109         .start = \mbox{\hyperlink{xhci_8c_ad0fe6a28137c476b889d18f63d6d72a6}{xhci\_device\_generic\_start}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03110}03110 \};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03111}03111 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03112}03112 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03113}03113 \textcolor{comment}{ * xhci root HUB support}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03114}03114 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03115}03115 \textcolor{comment}{ * Simulate a hardware HUB by handling all the necessary requests.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03116}03116 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03117}\mbox{\hyperlink{xhci_8c_ac65fb39fbba36a16524a7f501cd169a3}{03117}} \textcolor{preprocessor}{\#define HSETW(ptr, val) ptr = \{ (uint8\_t)(val), (uint8\_t)((val) >> 8) \}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03118}03118 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03119}03119 \textcolor{keyword}{static} \textcolor{keyword}{const}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03120}\mbox{\hyperlink{xhci_8c_acd1bd49a190ad3390b185a4dd6e36496}{03120}} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__descriptor}{usb\_device\_descriptor}} \mbox{\hyperlink{xhci_8c_acd1bd49a190ad3390b185a4dd6e36496}{xhci\_devd}} =}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03121}03121 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03122}03122         .\mbox{\hyperlink{structusb__device__descriptor_a5123036bdc67e99a87a1f5dbf13975be}{bLength}} = \textcolor{keyword}{sizeof}(\mbox{\hyperlink{xhci_8c_acd1bd49a190ad3390b185a4dd6e36496}{xhci\_devd}}),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03123}03123         .\mbox{\hyperlink{structusb__device__descriptor_a5335f6d2de0050e61da6f979d71e2f67}{bDescriptorType}} = \mbox{\hyperlink{usb_8h_a91e8696a051fcdd76cd797fa128938a2}{UDESC\_DEVICE}},     \textcolor{comment}{/* type */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03124}03124         \mbox{\hyperlink{xhci_8c_ac65fb39fbba36a16524a7f501cd169a3}{HSETW}}(.\mbox{\hyperlink{structusb__device__descriptor_a765e1af336552e7da5f60829910c67e7}{bcdUSB}}, 0x0300),                      \textcolor{comment}{/* USB version */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03125}03125         .bDeviceClass = \mbox{\hyperlink{usb_8h_a3c5e5fca25f06d3b8ddc5ec932116178}{UDCLASS\_HUB}},         \textcolor{comment}{/* class */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03126}03126         .bDeviceSubClass = \mbox{\hyperlink{usb_8h_a0ce87986a681a89bcb413e066e007785}{UDSUBCLASS\_HUB}},        \textcolor{comment}{/* subclass */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03127}03127         .bDeviceProtocol = \mbox{\hyperlink{usb_8h_a3d9c01e7f9634c0f18e7be392a428c10}{UDPROTO\_SSHUB}},  \textcolor{comment}{/* protocol */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03128}03128         .bMaxPacketSize = 9,                    \textcolor{comment}{/* max packet size */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03129}03129         \mbox{\hyperlink{xhci_8c_ac65fb39fbba36a16524a7f501cd169a3}{HSETW}}(.\mbox{\hyperlink{usbdi_8h_ab393e07556e3858fed36ed2e260d4b4c}{idVendor}}, 0x0000),          \textcolor{comment}{/* vendor */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03130}03130         \mbox{\hyperlink{xhci_8c_ac65fb39fbba36a16524a7f501cd169a3}{HSETW}}(.\mbox{\hyperlink{usbdi_8h_a2cf29745398a958349d784b1911c6b2b}{idProduct}}, 0x0000),                \textcolor{comment}{/* product */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03131}03131         \mbox{\hyperlink{xhci_8c_ac65fb39fbba36a16524a7f501cd169a3}{HSETW}}(.\mbox{\hyperlink{structusb__device__descriptor_a47583f19747579599678e8543fd652f8}{bcdDevice}}, 0x0100),                \textcolor{comment}{/* device version */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03132}03132         .iManufacturer = 1,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03133}03133         .iProduct = 2,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03134}03134         .iSerialNumber = 0,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03135}03135         .bNumConfigurations = 1,                \textcolor{comment}{/* \# of configurations */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03136}03136 \};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03137}03137 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03138}03138 \textcolor{keyword}{static} \textcolor{keyword}{const}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03139}\mbox{\hyperlink{xhci_8c_ad425cb526800f94f56b2c8311b4f721c}{03139}} \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__bos__desc}{xhci\_bos\_desc}} \mbox{\hyperlink{xhci_8c_ad425cb526800f94f56b2c8311b4f721c}{xhci\_bosd}} = \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03140}03140         .\mbox{\hyperlink{structxhci__bos__desc_a6af865efcc762e630eabb7774edd5792}{bosd}} = \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03141}03141                 .\mbox{\hyperlink{structusb__bos__descriptor_a3c30fd9c15d05cf159ea9308f6f5b811}{bLength}} = \textcolor{keyword}{sizeof}(\mbox{\hyperlink{xhci_8c_ad425cb526800f94f56b2c8311b4f721c}{xhci\_bosd}}.\mbox{\hyperlink{structxhci__bos__desc_a6af865efcc762e630eabb7774edd5792}{bosd}}),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03142}03142                 .bDescriptorType = \mbox{\hyperlink{usb_8h_a79728fd73379e9fd68ca42654f3499c8}{UDESC\_BOS}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03143}03143                 \mbox{\hyperlink{xhci_8c_ac65fb39fbba36a16524a7f501cd169a3}{HSETW}}(.wTotalLength, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{xhci_8c_ad425cb526800f94f56b2c8311b4f721c}{xhci\_bosd}})),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03144}03144                 .bNumDeviceCaps = 3,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03145}03145         \},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03146}03146         .usb2extd = \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03147}03147                 .bLength = \textcolor{keyword}{sizeof}(\mbox{\hyperlink{xhci_8c_ad425cb526800f94f56b2c8311b4f721c}{xhci\_bosd}}.\mbox{\hyperlink{structxhci__bos__desc_af8bb329f86d99959f1b5bdf56a2ed1c0}{usb2extd}}),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03148}03148                 .bDescriptorType = 1,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03149}03149                 .bDevCapabilityType = 2,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03150}03150                 .bmAttributes[0] = 2,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03151}03151         \},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03152}03152         .usbdcd = \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03153}03153                 .bLength = \textcolor{keyword}{sizeof}(\mbox{\hyperlink{xhci_8c_ad425cb526800f94f56b2c8311b4f721c}{xhci\_bosd}}.\mbox{\hyperlink{structxhci__bos__desc_af17ae53bbd5aa1a245fc309c93ff8c65}{usbdcd}}),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03154}03154                 .bDescriptorType = \mbox{\hyperlink{usb_8h_a3b0382140ec1b5bdf4e9b92d506500fa}{UDESC\_DEVICE\_CAPABILITY}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03155}03155                 .bDevCapabilityType = 3,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03156}03156                 .bmAttributes = 0, \textcolor{comment}{/* XXX */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03157}03157                 \mbox{\hyperlink{xhci_8c_ac65fb39fbba36a16524a7f501cd169a3}{HSETW}}(.wSpeedsSupported, 0x000C),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03158}03158                 .bFunctionalitySupport = 8,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03159}03159                 .bU1DevExitLat = 255,   \textcolor{comment}{/* dummy -\/ not used */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03160}03160                 .wU2DevExitLat = \{ 0x00, 0x08 \},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03161}03161         \},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03162}03162         .cidd = \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03163}03163                 .bLength = \textcolor{keyword}{sizeof}(\mbox{\hyperlink{xhci_8c_ad425cb526800f94f56b2c8311b4f721c}{xhci\_bosd}}.\mbox{\hyperlink{structxhci__bos__desc_ae665044e0a5016546a331d082ab6bee9}{cidd}}),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03164}03164                 .bDescriptorType = 1,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03165}03165                 .bDevCapabilityType = 4,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03166}03166                 .bReserved = 0,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03167}03167                 .bContainerID = 0, \textcolor{comment}{/* XXX */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03168}03168         \},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03169}03169 \};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03170}03170 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03171}03171 \textcolor{keyword}{static} \textcolor{keyword}{const}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03172}\mbox{\hyperlink{xhci_8c_a3ed3f70dafd3428f753d7f5efbdcbcd0}{03172}} \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__config__desc}{xhci\_config\_desc}} \mbox{\hyperlink{xhci_8c_a3ed3f70dafd3428f753d7f5efbdcbcd0}{xhci\_confd}} = \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03173}03173         .\mbox{\hyperlink{structxhci__config__desc_a6adf82770b055be92a4a56ac0ea473ee}{confd}} = \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03174}03174                 .\mbox{\hyperlink{structusb__config__descriptor_ab93f48211c037d6431326d0d46db44b3}{bLength}} = \textcolor{keyword}{sizeof}(\mbox{\hyperlink{xhci_8c_a3ed3f70dafd3428f753d7f5efbdcbcd0}{xhci\_confd}}.\mbox{\hyperlink{structxhci__config__desc_a6adf82770b055be92a4a56ac0ea473ee}{confd}}),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03175}03175                 .bDescriptorType = \mbox{\hyperlink{usb_8h_a35d8259be2f4b9d3b278e889898a697a}{UDESC\_CONFIG}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03176}03176                 .wTotalLength[0] = \textcolor{keyword}{sizeof}(\mbox{\hyperlink{xhci_8c_a3ed3f70dafd3428f753d7f5efbdcbcd0}{xhci\_confd}}),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03177}03177                 .bNumInterface = 1,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03178}03178                 .bConfigurationValue = 1,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03179}03179                 .iConfiguration = 0,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03180}03180                 .bmAttributes = \mbox{\hyperlink{usb_8h_a1a9a7ef4724e86785942f8ca612cd661}{UC\_SELF\_POWERED}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03181}03181                 .bMaxPower = 0          \textcolor{comment}{/* max power */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03182}03182         \},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03183}03183         .ifcd = \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03184}03184                 .bLength = \textcolor{keyword}{sizeof}(\mbox{\hyperlink{xhci_8c_a3ed3f70dafd3428f753d7f5efbdcbcd0}{xhci\_confd}}.\mbox{\hyperlink{structxhci__config__desc_a4356723e7d9dc0c70e6da9fd0822ac6c}{ifcd}}),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03185}03185                 .bDescriptorType = \mbox{\hyperlink{usb_8h_a93c15218c1fed26b097fb0b53a3ce4f7}{UDESC\_INTERFACE}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03186}03186                 .bNumEndpoints = 1,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03187}03187                 .\mbox{\hyperlink{usbdi_8h_ae899427763e325f03241afc69a6e1ea0}{bInterfaceClass}} = \mbox{\hyperlink{usb_8h_a9087453dd0a77bb9091c9ee62a3c87cc}{UICLASS\_HUB}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03188}03188                 .\mbox{\hyperlink{usbdi_8h_a3b3919d1203cd42550d77287f7585595}{bInterfaceSubClass}} = \mbox{\hyperlink{usb_8h_a2b2ea572877c6b2bb5d2238be6554fa0}{UISUBCLASS\_HUB}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03189}03189                 .\mbox{\hyperlink{usbdi_8h_a6872c4ec51fd061e2955f84d97bea2a7}{bInterfaceProtocol}} = 0,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03190}03190         \},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03191}03191         .endpd = \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03192}03192                 .bLength = \textcolor{keyword}{sizeof}(\mbox{\hyperlink{xhci_8c_a3ed3f70dafd3428f753d7f5efbdcbcd0}{xhci\_confd}}.\mbox{\hyperlink{structxhci__config__desc_a199abaa2dbf24f5a5dd51234569fd3d1}{endpd}}),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03193}03193                 .bDescriptorType = \mbox{\hyperlink{usb_8h_a4b8e0317b094aec02ff237d9b4f7a202}{UDESC\_ENDPOINT}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03194}03194                 .bEndpointAddress = \mbox{\hyperlink{usb_8h_a72bb077a860132c175c166f344c75893}{UE\_DIR\_IN}} | \mbox{\hyperlink{xhci_8c_aace92486baf2b1ea89acbbd4208458d2}{XHCI\_INTR\_ENDPT}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03195}03195                 .bmAttributes = \mbox{\hyperlink{usb_8h_a01e28e87ad16f6dfffefc6ccab08baed}{UE\_INTERRUPT}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03196}03196                 .wMaxPacketSize[0] = 2,         \textcolor{comment}{/* max 15 ports */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03197}03197                 .bInterval = 255,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03198}03198         \},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03199}03199         .endpcd = \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03200}03200                 .bLength = \textcolor{keyword}{sizeof}(\mbox{\hyperlink{xhci_8c_a3ed3f70dafd3428f753d7f5efbdcbcd0}{xhci\_confd}}.\mbox{\hyperlink{structxhci__config__desc_a44a86d86b33789b345d6160ad8c85673}{endpcd}}),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03201}03201                 .bDescriptorType = \mbox{\hyperlink{usb_8h_a58a919bb1baa8738f6d89c4ff37fdfa8}{UDESC\_ENDPOINT\_SS\_COMP}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03202}03202                 .bMaxBurst = 0,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03203}03203                 .bmAttributes = 0,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03204}03204         \},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03205}03205 \};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03206}03206 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03207}03207 \textcolor{keyword}{static} \textcolor{keyword}{const}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03208}\mbox{\hyperlink{xhci_8c_a2115873bc93f265bee39f9b4e795eaf0}{03208}} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__hub__ss__descriptor}{usb\_hub\_ss\_descriptor}} \mbox{\hyperlink{xhci_8c_a2115873bc93f265bee39f9b4e795eaf0}{xhci\_hubd}} = \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03209}03209         .\mbox{\hyperlink{structusb__hub__ss__descriptor_ade162e0ee90d856ec8afa2d10d16af1e}{bLength}} = \textcolor{keyword}{sizeof}(\mbox{\hyperlink{xhci_8c_a2115873bc93f265bee39f9b4e795eaf0}{xhci\_hubd}}),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03210}03210         .\mbox{\hyperlink{structusb__hub__ss__descriptor_a07ea6a40b5ea58bd6da6bdcbe5b9ea21}{bDescriptorType}} = \mbox{\hyperlink{usb_8h_acabfe66d8640235aa1dd2776a7ac2fb8}{UDESC\_SS\_HUB}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03211}03211 \};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03212}03212 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03213}03213 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03214}\mbox{\hyperlink{xhci_8c_a74ae60ad1a285b243ab5c8553a9757c7}{03214}} \mbox{\hyperlink{xhci_8c_a74ae60ad1a285b243ab5c8553a9757c7}{xhci\_roothub\_exec}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03215}03215     \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device__request}{usb\_device\_request}} *\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}, \textcolor{keyword}{const} \textcolor{keywordtype}{void} **\mbox{\hyperlink{usb__if_8m_a074c17a419327b41805af2dd7cb152e7}{pptr}}, uint16\_t *plength)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03216}03216 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03217}03217         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03218}03218         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *str\_ptr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03219}03219         \textcolor{keyword}{const} \textcolor{keywordtype}{void} *ptr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03220}03220         uint32\_t port;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03221}03221         uint32\_t v;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03222}03222         uint16\_t \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03223}03223         uint16\_t i;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03224}03224         uint16\_t value;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03225}03225         uint16\_t index;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03226}03226         uint8\_t j;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03227}03227         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03228}03228 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03229}03229         \mbox{\hyperlink{usb__core_8h_adf78e1178dd30ec4a8a53087fe6c7e02}{USB\_BUS\_LOCK\_ASSERT}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03230}03230 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03231}03231         \textcolor{comment}{/* buffer reset */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03232}03232         ptr = (\textcolor{keyword}{const} \textcolor{keywordtype}{void} *)\&sc-\/>\mbox{\hyperlink{structxhci__softc_a6a52740a11a9cbed60e0d8931b455aa1}{sc\_hub\_desc}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03233}03233         \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03234}03234         err = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03235}03235 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03236}03236         value = \mbox{\hyperlink{usb__endian_8h_aa3860f9452db3a5d865cc943e2f01829}{UGETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}-\/>wValue);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03237}03237         index = \mbox{\hyperlink{usb__endian_8h_aa3860f9452db3a5d865cc943e2f01829}{UGETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}-\/>wIndex);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03238}03238 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03239}03239         DPRINTFN(3, \textcolor{stringliteral}{"{}type=0x\%02x request=0x\%02x wLen=0x\%04x "{}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03240}03240             \textcolor{stringliteral}{"{}wValue=0x\%04x wIndex=0x\%04x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03241}03241             \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}-\/>bmRequestType, \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}-\/>bRequest,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03242}03242             \mbox{\hyperlink{usb__endian_8h_aa3860f9452db3a5d865cc943e2f01829}{UGETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}-\/>wLength), value, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03243}03243 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03244}03244 \textcolor{preprocessor}{\#define C(x,y) ((x) | ((y) << 8))}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03245}03245         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}-\/>bRequest, \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}-\/>bmRequestType)) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03246}03246         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_a49bd676481c413d1ec4a527664ac02a9}{UR\_CLEAR\_FEATURE}}, \mbox{\hyperlink{usb_8h_a33c2db425d10f85e7b405035bc015d32}{UT\_WRITE\_DEVICE}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03247}03247         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_a49bd676481c413d1ec4a527664ac02a9}{UR\_CLEAR\_FEATURE}}, \mbox{\hyperlink{usb_8h_a1c18aa69d1e986a87fcdbfbb624c954f}{UT\_WRITE\_INTERFACE}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03248}03248         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_a49bd676481c413d1ec4a527664ac02a9}{UR\_CLEAR\_FEATURE}}, \mbox{\hyperlink{usb_8h_ab592eead7baaa45331e0e4768c0259dd}{UT\_WRITE\_ENDPOINT}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03249}03249                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03250}03250 \textcolor{comment}{                 * DEVICE\_REMOTE\_WAKEUP and ENDPOINT\_HALT are no-\/ops}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03251}03251 \textcolor{comment}{                 * for the integrated root hub.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03252}03252 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03253}03253                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03254}03254         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_a27856773c79338192e9fc272942ffb2a}{UR\_GET\_CONFIG}}, \mbox{\hyperlink{usb_8h_a760afaa5e388cb04e742b564e4c509f3}{UT\_READ\_DEVICE}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03255}03255                 \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03256}03256                 sc-\/>\mbox{\hyperlink{structxhci__softc_a6a52740a11a9cbed60e0d8931b455aa1}{sc\_hub\_desc}}.\mbox{\hyperlink{unionxhci__hub__desc_af2ed16f1af3c505bad44e76b67f064e1}{temp}}[0] = sc-\/>\mbox{\hyperlink{structxhci__softc_a04d0177f3ccd725141f81e26fb2a4562}{sc\_conf}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03257}03257                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03258}03258         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_afe0147b1f88f094b26142d372647bd01}{UR\_GET\_DESCRIPTOR}}, \mbox{\hyperlink{usb_8h_a760afaa5e388cb04e742b564e4c509f3}{UT\_READ\_DEVICE}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03259}03259                 \textcolor{keywordflow}{switch} (value >> 8) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03260}03260                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a91e8696a051fcdd76cd797fa128938a2}{UDESC\_DEVICE}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03261}03261                         \textcolor{keywordflow}{if} ((value \& 0xff) != 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03262}03262                                 err = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03263}03263                                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03264}03264                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03265}03265                         \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} = \textcolor{keyword}{sizeof}(\mbox{\hyperlink{xhci_8c_acd1bd49a190ad3390b185a4dd6e36496}{xhci\_devd}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03266}03266                         ptr = (\textcolor{keyword}{const} \textcolor{keywordtype}{void} *)\&\mbox{\hyperlink{xhci_8c_acd1bd49a190ad3390b185a4dd6e36496}{xhci\_devd}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03267}03267                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03268}03268 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03269}03269                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a79728fd73379e9fd68ca42654f3499c8}{UDESC\_BOS}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03270}03270                         \textcolor{keywordflow}{if} ((value \& 0xff) != 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03271}03271                                 err = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03272}03272                                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03273}03273                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03274}03274                         \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} = \textcolor{keyword}{sizeof}(\mbox{\hyperlink{xhci_8c_ad425cb526800f94f56b2c8311b4f721c}{xhci\_bosd}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03275}03275                         ptr = (\textcolor{keyword}{const} \textcolor{keywordtype}{void} *)\&\mbox{\hyperlink{xhci_8c_ad425cb526800f94f56b2c8311b4f721c}{xhci\_bosd}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03276}03276                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03277}03277 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03278}03278                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a35d8259be2f4b9d3b278e889898a697a}{UDESC\_CONFIG}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03279}03279                         \textcolor{keywordflow}{if} ((value \& 0xff) != 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03280}03280                                 err = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03281}03281                                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03282}03282                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03283}03283                         \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} = \textcolor{keyword}{sizeof}(\mbox{\hyperlink{xhci_8c_a3ed3f70dafd3428f753d7f5efbdcbcd0}{xhci\_confd}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03284}03284                         ptr = (\textcolor{keyword}{const} \textcolor{keywordtype}{void} *)\&\mbox{\hyperlink{xhci_8c_a3ed3f70dafd3428f753d7f5efbdcbcd0}{xhci\_confd}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03285}03285                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03286}03286 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03287}03287                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a6b58bb576493debe416ae239bb38267c}{UDESC\_STRING}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03288}03288                         \textcolor{keywordflow}{switch} (value \& 0xff) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03289}03289                         \textcolor{keywordflow}{case} 0: \textcolor{comment}{/* Language table */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03290}03290                                 str\_ptr = \textcolor{stringliteral}{"{}\(\backslash\)001"{}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03291}03291                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03292}03292 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03293}03293                         \textcolor{keywordflow}{case} 1: \textcolor{comment}{/* Vendor */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03294}03294                                 str\_ptr = sc-\/>\mbox{\hyperlink{structxhci__softc_a029579af296025d5bbcfead3d3848a17}{sc\_vendor}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03295}03295                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03296}03296 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03297}03297                         \textcolor{keywordflow}{case} 2: \textcolor{comment}{/* Product */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03298}03298                                 str\_ptr = \textcolor{stringliteral}{"{}XHCI root HUB"{}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03299}03299                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03300}03300 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03301}03301                         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03302}03302                                 str\_ptr = \textcolor{stringliteral}{"{}"{}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03303}03303                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03304}03304                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03305}03305 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03306}03306                         \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} = \mbox{\hyperlink{usb__util_8c_a7e0b76fa91e891e0439d03afad4fc889}{usb\_make\_str\_desc}}(}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03307}03307                             sc-\/>\mbox{\hyperlink{structxhci__softc_a6a52740a11a9cbed60e0d8931b455aa1}{sc\_hub\_desc}}.\mbox{\hyperlink{unionxhci__hub__desc_af2ed16f1af3c505bad44e76b67f064e1}{temp}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03308}03308                             \textcolor{keyword}{sizeof}(sc-\/>\mbox{\hyperlink{structxhci__softc_a6a52740a11a9cbed60e0d8931b455aa1}{sc\_hub\_desc}}.\mbox{\hyperlink{unionxhci__hub__desc_af2ed16f1af3c505bad44e76b67f064e1}{temp}}),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03309}03309                             str\_ptr);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03310}03310                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03311}03311 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03312}03312                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03313}03313                         err = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03314}03314                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03315}03315                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03316}03316                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03317}03317         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_a3654eeeab796d0863e7527e3aac772fe}{UR\_GET\_INTERFACE}}, \mbox{\hyperlink{usb_8h_afc6a17fce8bdb62291274b83223eea65}{UT\_READ\_INTERFACE}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03318}03318                 \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03319}03319                 sc-\/>\mbox{\hyperlink{structxhci__softc_a6a52740a11a9cbed60e0d8931b455aa1}{sc\_hub\_desc}}.\mbox{\hyperlink{unionxhci__hub__desc_af2ed16f1af3c505bad44e76b67f064e1}{temp}}[0] = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03320}03320                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03321}03321         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_a473195030530e26d522d795311db634d}{UR\_GET\_STATUS}}, \mbox{\hyperlink{usb_8h_a760afaa5e388cb04e742b564e4c509f3}{UT\_READ\_DEVICE}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03322}03322                 \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} = 2;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03323}03323                 \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(sc-\/>\mbox{\hyperlink{structxhci__softc_a6a52740a11a9cbed60e0d8931b455aa1}{sc\_hub\_desc}}.\mbox{\hyperlink{unionxhci__hub__desc_ab4108f377ef31bcbb45b80052b2011de}{stat}}.\mbox{\hyperlink{structusb__status_aa56f46e2ca05aa6427ed3e02b07225ff}{wStatus}}, \mbox{\hyperlink{usb_8h_a5df434c22d261f2fcdf9c54080ad0f48}{UDS\_SELF\_POWERED}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03324}03324                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03325}03325         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_a473195030530e26d522d795311db634d}{UR\_GET\_STATUS}}, \mbox{\hyperlink{usb_8h_afc6a17fce8bdb62291274b83223eea65}{UT\_READ\_INTERFACE}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03326}03326         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_a473195030530e26d522d795311db634d}{UR\_GET\_STATUS}}, \mbox{\hyperlink{usb_8h_acfdcbf0400459ac3c17c15f1ccc3794d}{UT\_READ\_ENDPOINT}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03327}03327                 \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} = 2;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03328}03328                 \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(sc-\/>\mbox{\hyperlink{structxhci__softc_a6a52740a11a9cbed60e0d8931b455aa1}{sc\_hub\_desc}}.\mbox{\hyperlink{unionxhci__hub__desc_ab4108f377ef31bcbb45b80052b2011de}{stat}}.\mbox{\hyperlink{structusb__status_aa56f46e2ca05aa6427ed3e02b07225ff}{wStatus}}, 0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03329}03329                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03330}03330         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_a2e5fb48757cb795a44b99af832d6cd7d}{UR\_SET\_ADDRESS}}, \mbox{\hyperlink{usb_8h_a33c2db425d10f85e7b405035bc015d32}{UT\_WRITE\_DEVICE}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03331}03331                 \textcolor{keywordflow}{if} (value >= \mbox{\hyperlink{xhci_8h_a2b2516e724c30cdbc16fcb8e16e92228}{XHCI\_MAX\_DEVICES}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03332}03332                         err = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03333}03333                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03334}03334                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03335}03335                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03336}03336         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_a03842765b1d21adb3eb41b3d706ec1aa}{UR\_SET\_CONFIG}}, \mbox{\hyperlink{usb_8h_a33c2db425d10f85e7b405035bc015d32}{UT\_WRITE\_DEVICE}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03337}03337                 \textcolor{keywordflow}{if} (value != 0 \&\& value != 1) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03338}03338                         err = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03339}03339                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03340}03340                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03341}03341                 sc-\/>\mbox{\hyperlink{structxhci__softc_a04d0177f3ccd725141f81e26fb2a4562}{sc\_conf}} = value;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03342}03342                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03343}03343         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_a1e9409609a7c66d1d575c53d5b2b39d9}{UR\_SET\_DESCRIPTOR}}, \mbox{\hyperlink{usb_8h_a33c2db425d10f85e7b405035bc015d32}{UT\_WRITE\_DEVICE}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03344}03344                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03345}03345         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_af3188459f8546e34ce2d89aa28bc85f1}{UR\_SET\_FEATURE}}, \mbox{\hyperlink{usb_8h_a33c2db425d10f85e7b405035bc015d32}{UT\_WRITE\_DEVICE}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03346}03346         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_af3188459f8546e34ce2d89aa28bc85f1}{UR\_SET\_FEATURE}}, \mbox{\hyperlink{usb_8h_a1c18aa69d1e986a87fcdbfbb624c954f}{UT\_WRITE\_INTERFACE}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03347}03347         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_af3188459f8546e34ce2d89aa28bc85f1}{UR\_SET\_FEATURE}}, \mbox{\hyperlink{usb_8h_ab592eead7baaa45331e0e4768c0259dd}{UT\_WRITE\_ENDPOINT}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03348}03348                 err = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03349}03349                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03350}03350         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_ac158866f6b7f31946ace0216225b79cb}{UR\_SET\_INTERFACE}}, \mbox{\hyperlink{usb_8h_a1c18aa69d1e986a87fcdbfbb624c954f}{UT\_WRITE\_INTERFACE}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03351}03351                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03352}03352         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_a744ab8acdd49be39deee38a2e4c61fae}{UR\_SYNCH\_FRAME}}, \mbox{\hyperlink{usb_8h_ab592eead7baaa45331e0e4768c0259dd}{UT\_WRITE\_ENDPOINT}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03353}03353                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03354}03354                 \textcolor{comment}{/* Hub requests */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03355}03355         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_a49bd676481c413d1ec4a527664ac02a9}{UR\_CLEAR\_FEATURE}}, \mbox{\hyperlink{usb_8h_a2e2f4f55979f2bd987385ecca0deb448}{UT\_WRITE\_CLASS\_DEVICE}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03356}03356                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03357}03357         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_a49bd676481c413d1ec4a527664ac02a9}{UR\_CLEAR\_FEATURE}}, \mbox{\hyperlink{usb_8h_a2b0da1f1f369841fec9c55cf4df6888b}{UT\_WRITE\_CLASS\_OTHER}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03358}03358                 DPRINTFN(9, \textcolor{stringliteral}{"{}UR\_CLEAR\_PORT\_FEATURE\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03359}03359 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03360}03360                 \textcolor{keywordflow}{if} ((index < 1) ||}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03361}03361                     (index > sc-\/>\mbox{\hyperlink{structxhci__softc_aee3ef1fdb126d4c5e6f41099fc63c5ea}{sc\_noport}})) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03362}03362                         err = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03363}03363                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03364}03364                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03365}03365                 port = \mbox{\hyperlink{xhcireg_8h_a5fc3a868a2a89aeff110dfd0a3701462}{XHCI\_PORTSC}}(index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03366}03366 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03367}03367                 v = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, oper, port);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03368}03368                 i = \mbox{\hyperlink{xhcireg_8h_a70fd4582c7ebb2d536a133ad4b784fd0}{XHCI\_PS\_PLS\_GET}}(v);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03369}03369                 v \&= \string~XHCI\_PS\_CLEAR;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03370}03370 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03371}03371                 \textcolor{keywordflow}{switch} (value) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03372}03372                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_af2d5503ebebddbea87cf988a0aff8ad1}{UHF\_C\_BH\_PORT\_RESET}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03373}03373                         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, port, v | \mbox{\hyperlink{xhcireg_8h_ab89f476faf605c56e35c335c988cb55c}{XHCI\_PS\_WRC}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03374}03374                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03375}03375                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_abc0e03b4158d02601ac458e06c2aabe9}{UHF\_C\_PORT\_CONFIG\_ERROR}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03376}03376                         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, port, v | \mbox{\hyperlink{xhcireg_8h_af6cc46aff4d9355dba9d4a6e9559be84}{XHCI\_PS\_CEC}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03377}03377                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03378}03378                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a495feecc17b28cb813521e342360d414}{UHF\_C\_PORT\_SUSPEND}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03379}03379                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_ae05fa8d4a2d8280f791b61aa8daccd1e}{UHF\_C\_PORT\_LINK\_STATE}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03380}03380                         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, port, v | \mbox{\hyperlink{xhcireg_8h_ac35f426018cce1012c24a61820eff33f}{XHCI\_PS\_PLC}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03381}03381                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03382}03382                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_afe4efdc37762fbdffef921a8ae17e975}{UHF\_C\_PORT\_CONNECTION}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03383}03383                         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, port, v | \mbox{\hyperlink{xhcireg_8h_a17a5d2da7a53516b1080d05b5de5815f}{XHCI\_PS\_CSC}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03384}03384                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03385}03385                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_aed1a43dc5a9b1f893ef9b7a4ce0ed279}{UHF\_C\_PORT\_ENABLE}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03386}03386                         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, port, v | \mbox{\hyperlink{xhcireg_8h_af7838a7c635af332a70ac27d8b807699}{XHCI\_PS\_PEC}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03387}03387                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03388}03388                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a6df63ab5c3f9e5715c428f42e7309595}{UHF\_C\_PORT\_OVER\_CURRENT}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03389}03389                         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, port, v | \mbox{\hyperlink{xhcireg_8h_aef5d06e0627757c9dbebfcf78e9c0eed}{XHCI\_PS\_OCC}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03390}03390                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03391}03391                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_ad0f9e88acdd8f7a6e466e9d3ede9b392}{UHF\_C\_PORT\_RESET}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03392}03392                         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, port, v | \mbox{\hyperlink{xhcireg_8h_a33181810d4b2c123bfe4d6dd8dd7907b}{XHCI\_PS\_PRC}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03393}03393                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03394}03394                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a8fa7a9a0c538b3c5c683f530f58d7b11}{UHF\_PORT\_ENABLE}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03395}03395                         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, port, v | \mbox{\hyperlink{xhcireg_8h_abcf46fc8d27d31c752337d88d238ecc5}{XHCI\_PS\_PED}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03396}03396                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03397}03397                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a25f7d33df63b7439eb79041effad57f8}{UHF\_PORT\_POWER}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03398}03398                         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, port, v \& \string~\mbox{\hyperlink{xhcireg_8h_a6f8e3305290f7380ed49c8ffdc10de22}{XHCI\_PS\_PP}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03399}03399                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03400}03400                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_acef0673348b3a416db2e1c3c514b79cb}{UHF\_PORT\_INDICATOR}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03401}03401                         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, port, v \& \string~\mbox{\hyperlink{xhcireg_8h_ab8d620c38a10a1e5d685459e9f297e5d}{XHCI\_PS\_PIC\_SET}}(3));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03402}03402                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03403}03403                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a6df9599557522c7163bdcb13c9f4095c}{UHF\_PORT\_SUSPEND}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03404}03404 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03405}03405                         \textcolor{comment}{/* U3 -\/> U15 */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03406}03406                         \textcolor{keywordflow}{if} (i == 3) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03407}03407                                 \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, port, v |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03408}03408                                     \mbox{\hyperlink{xhcireg_8h_a864063c0c5ed3fc3d21ce3f09bb9c2c6}{XHCI\_PS\_PLS\_SET}}(0xF) | \mbox{\hyperlink{xhcireg_8h_a8b027493adc99dc41a73f72c349870e9}{XHCI\_PS\_LWS}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03409}03409                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03410}03410 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03411}03411                         \textcolor{comment}{/* wait 20ms for resume sequence to complete */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03412}03412                         \mbox{\hyperlink{usb__util_8c_a7ad9fc3660f5ecf96d72e499cdfeb963}{usb\_pause\_mtx}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a7355d01a9b05ad01972eccabe5747edf}{bus\_mtx}}, hz / 50);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03413}03413 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03414}03414                         \textcolor{comment}{/* U0 */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03415}03415                         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, port, v |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03416}03416                             \mbox{\hyperlink{xhcireg_8h_a864063c0c5ed3fc3d21ce3f09bb9c2c6}{XHCI\_PS\_PLS\_SET}}(0) | \mbox{\hyperlink{xhcireg_8h_a8b027493adc99dc41a73f72c349870e9}{XHCI\_PS\_LWS}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03417}03417                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03418}03418                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03419}03419                         err = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03420}03420                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03421}03421                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03422}03422                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03423}03423 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03424}03424         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_afe0147b1f88f094b26142d372647bd01}{UR\_GET\_DESCRIPTOR}}, \mbox{\hyperlink{usb_8h_ab6456f1ff04af01cc72ae7aa754cd45f}{UT\_READ\_CLASS\_DEVICE}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03425}03425                 \textcolor{keywordflow}{if} ((value \& 0xff) != 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03426}03426                         err = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03427}03427                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03428}03428                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03429}03429 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03430}03430                 v = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, capa, \mbox{\hyperlink{xhcireg_8h_a4dc5731fb089b7c91cfa13cf3c62c6b5}{XHCI\_HCSPARAMS0}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03431}03431 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03432}03432                 sc-\/>\mbox{\hyperlink{structxhci__softc_a6a52740a11a9cbed60e0d8931b455aa1}{sc\_hub\_desc}}.\mbox{\hyperlink{unionxhci__hub__desc_a2b6d6f4c8d204f8c271271da0e188078}{hubd}} = \mbox{\hyperlink{xhci_8c_a2115873bc93f265bee39f9b4e795eaf0}{xhci\_hubd}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03433}03433 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03434}03434                 sc-\/>\mbox{\hyperlink{structxhci__softc_a6a52740a11a9cbed60e0d8931b455aa1}{sc\_hub\_desc}}.\mbox{\hyperlink{unionxhci__hub__desc_a2b6d6f4c8d204f8c271271da0e188078}{hubd}}.\mbox{\hyperlink{structusb__hub__ss__descriptor_a7d6572d168f200e51064dc10692d5a3b}{bNbrPorts}} = sc-\/>\mbox{\hyperlink{structxhci__softc_aee3ef1fdb126d4c5e6f41099fc63c5ea}{sc\_noport}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03435}03435 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03436}03436                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{xhcireg_8h_ae9303dcf9dce3f1c7c1fcbb8b9033789}{XHCI\_HCS0\_PPC}}(v))}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03437}03437                         i = \mbox{\hyperlink{usb_8h_a0c6c49f6a5c7cefac02b1cfff17e30a8}{UHD\_PWR\_INDIVIDUAL}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03438}03438                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03439}03439                         i = \mbox{\hyperlink{usb_8h_a1b73c33106083146d9b6422737da35d8}{UHD\_PWR\_GANGED}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03440}03440 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03441}03441                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{xhcireg_8h_a011ef15f56ad4483ef709e436a0d371d}{XHCI\_HCS0\_PIND}}(v))}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03442}03442                         i |= \mbox{\hyperlink{usb_8h_ae48ece4a49b4d6d81356c01ee9c793c3}{UHD\_PORT\_IND}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03443}03443 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03444}03444                 i |= \mbox{\hyperlink{usb_8h_aac0dd7ff049f3c4d14a3da361d35ec21}{UHD\_OC\_INDIVIDUAL}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03445}03445 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03446}03446                 \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(sc-\/>\mbox{\hyperlink{structxhci__softc_a6a52740a11a9cbed60e0d8931b455aa1}{sc\_hub\_desc}}.\mbox{\hyperlink{unionxhci__hub__desc_a2b6d6f4c8d204f8c271271da0e188078}{hubd}}.\mbox{\hyperlink{structusb__hub__ss__descriptor_a0cb432785dd2e92d1eed0e5d4fbbae80}{wHubCharacteristics}}, i);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03447}03447 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03448}03448                 \textcolor{comment}{/* see XHCI section 5.4.9: */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03449}03449                 sc-\/>\mbox{\hyperlink{structxhci__softc_a6a52740a11a9cbed60e0d8931b455aa1}{sc\_hub\_desc}}.\mbox{\hyperlink{unionxhci__hub__desc_a2b6d6f4c8d204f8c271271da0e188078}{hubd}}.\mbox{\hyperlink{structusb__hub__ss__descriptor_ab6de17938fa8096a161933ac4827956b}{bPwrOn2PwrGood}} = 10;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03450}03450 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03451}03451                 \textcolor{keywordflow}{for} (j = 1; j <= sc-\/>\mbox{\hyperlink{structxhci__softc_aee3ef1fdb126d4c5e6f41099fc63c5ea}{sc\_noport}}; j++) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03452}03452                         v = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_a5fc3a868a2a89aeff110dfd0a3701462}{XHCI\_PORTSC}}(j));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03453}03453                         \textcolor{keywordflow}{if} (v \& \mbox{\hyperlink{xhcireg_8h_ad3e1e83f73638cc6e37b4cb583c00c16}{XHCI\_PS\_DR}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03454}03454                                 sc-\/>\mbox{\hyperlink{structxhci__softc_a6a52740a11a9cbed60e0d8931b455aa1}{sc\_hub\_desc}}.\mbox{\hyperlink{unionxhci__hub__desc_a2b6d6f4c8d204f8c271271da0e188078}{hubd}}.}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03455}03455                                     DeviceRemovable[j / 8] |= 1U << (j \% 8);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03456}03456                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03457}03457                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03458}03458                 \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} = sc-\/>\mbox{\hyperlink{structxhci__softc_a6a52740a11a9cbed60e0d8931b455aa1}{sc\_hub\_desc}}.\mbox{\hyperlink{unionxhci__hub__desc_a2b6d6f4c8d204f8c271271da0e188078}{hubd}}.\mbox{\hyperlink{structusb__hub__ss__descriptor_ade162e0ee90d856ec8afa2d10d16af1e}{bLength}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03459}03459                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03460}03460 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03461}03461         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_a473195030530e26d522d795311db634d}{UR\_GET\_STATUS}}, \mbox{\hyperlink{usb_8h_ab6456f1ff04af01cc72ae7aa754cd45f}{UT\_READ\_CLASS\_DEVICE}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03462}03462                 \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} = 16;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03463}03463                 memset(sc-\/>\mbox{\hyperlink{structxhci__softc_a6a52740a11a9cbed60e0d8931b455aa1}{sc\_hub\_desc}}.\mbox{\hyperlink{unionxhci__hub__desc_af2ed16f1af3c505bad44e76b67f064e1}{temp}}, 0, 16);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03464}03464                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03465}03465 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03466}03466         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_a473195030530e26d522d795311db634d}{UR\_GET\_STATUS}}, \mbox{\hyperlink{usb_8h_ac619fe4cc188166d4001c4b75365154c}{UT\_READ\_CLASS\_OTHER}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03467}03467                 DPRINTFN(9, \textcolor{stringliteral}{"{}UR\_GET\_STATUS i=\%d\(\backslash\)n"{}}, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03468}03468 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03469}03469                 \textcolor{keywordflow}{if} ((index < 1) ||}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03470}03470                     (index > sc-\/>\mbox{\hyperlink{structxhci__softc_aee3ef1fdb126d4c5e6f41099fc63c5ea}{sc\_noport}})) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03471}03471                         err = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03472}03472                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03473}03473                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03474}03474 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03475}03475                 v = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, oper, \mbox{\hyperlink{xhcireg_8h_a5fc3a868a2a89aeff110dfd0a3701462}{XHCI\_PORTSC}}(index));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03476}03476 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03477}03477                 DPRINTFN(9, \textcolor{stringliteral}{"{}port status=0x\%08x\(\backslash\)n"{}}, v);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03478}03478 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03479}03479                 i = \mbox{\hyperlink{usb_8h_a5b18dfd2f13846b5a3e481a4517fa3d7}{UPS\_PORT\_LINK\_STATE\_SET}}(\mbox{\hyperlink{xhcireg_8h_a70fd4582c7ebb2d536a133ad4b784fd0}{XHCI\_PS\_PLS\_GET}}(v));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03480}03480 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03481}03481                 \textcolor{keywordflow}{switch} (\mbox{\hyperlink{xhcireg_8h_a72a77f2aa51f668b5e1bcc3d8452058d}{XHCI\_PS\_SPEED\_GET}}(v)) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03482}03482                 \textcolor{keywordflow}{case} 3:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03483}03483                         i |= \mbox{\hyperlink{usb_8h_a97ca7a7e2da62abe5d0257e822b0a649}{UPS\_HIGH\_SPEED}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03484}03484                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03485}03485                 \textcolor{keywordflow}{case} 2:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03486}03486                         i |= \mbox{\hyperlink{usb_8h_a4f5a2b9be2d8cddf4b83879211db69b9}{UPS\_LOW\_SPEED}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03487}03487                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03488}03488                 \textcolor{keywordflow}{case} 1:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03489}03489                         \textcolor{comment}{/* FULL speed */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03490}03490                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03491}03491                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03492}03492                         i |= \mbox{\hyperlink{usb_8h_abd655173209b88551ac9305f6cf6afca}{UPS\_OTHER\_SPEED}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03493}03493                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03494}03494                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03495}03495 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03496}03496                 \textcolor{keywordflow}{if} (v \& \mbox{\hyperlink{xhcireg_8h_af5f2331f90bf150e8dd3d55a7f0b8326}{XHCI\_PS\_CCS}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03497}03497                         i |= \mbox{\hyperlink{usb_8h_ae763504258270b68d4bfe033088208a5}{UPS\_CURRENT\_CONNECT\_STATUS}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03498}03498                 \textcolor{keywordflow}{if} (v \& \mbox{\hyperlink{xhcireg_8h_abcf46fc8d27d31c752337d88d238ecc5}{XHCI\_PS\_PED}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03499}03499                         i |= \mbox{\hyperlink{usb_8h_aade8d9406d7a4acd137a942f3c830a23}{UPS\_PORT\_ENABLED}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03500}03500                 \textcolor{keywordflow}{if} (v \& \mbox{\hyperlink{xhcireg_8h_a8e994aee0193a17887e44944607b7b99}{XHCI\_PS\_OCA}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03501}03501                         i |= \mbox{\hyperlink{usb_8h_af92351302f2c9bf0e72f370df430c9b3}{UPS\_OVERCURRENT\_INDICATOR}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03502}03502                 \textcolor{keywordflow}{if} (v \& \mbox{\hyperlink{xhcireg_8h_ae71ce2c23b38dbe05c74020238f8647f}{XHCI\_PS\_PR}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03503}03503                         i |= \mbox{\hyperlink{usb_8h_afeb64657e3f788cb3671cf851cba2ee0}{UPS\_RESET}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03504}03504 \textcolor{preprocessor}{\#if 0}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03505}03505                 \textcolor{keywordflow}{if} (v \& \mbox{\hyperlink{xhcireg_8h_a6f8e3305290f7380ed49c8ffdc10de22}{XHCI\_PS\_PP}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03506}03506                         \textcolor{comment}{/* XXX undefined */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03507}03507 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03508}03508                 \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(sc-\/>\mbox{\hyperlink{structxhci__softc_a6a52740a11a9cbed60e0d8931b455aa1}{sc\_hub\_desc}}.\mbox{\hyperlink{unionxhci__hub__desc_a5be9515cd6eb753320172e3f721d8ec9}{ps}}.\mbox{\hyperlink{structusb__port__status_a2b6feb27a59da0abd9e91a4ca8f55866}{wPortStatus}}, i);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03509}03509 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03510}03510                 i = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03511}03511                 \textcolor{keywordflow}{if} (v \& \mbox{\hyperlink{xhcireg_8h_a17a5d2da7a53516b1080d05b5de5815f}{XHCI\_PS\_CSC}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03512}03512                         i |= \mbox{\hyperlink{usb_8h_ae67d894f69d3af508dc6696e73b980ee}{UPS\_C\_CONNECT\_STATUS}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03513}03513                 \textcolor{keywordflow}{if} (v \& \mbox{\hyperlink{xhcireg_8h_af7838a7c635af332a70ac27d8b807699}{XHCI\_PS\_PEC}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03514}03514                         i |= \mbox{\hyperlink{usb_8h_a2f330019ba8dba665520e7f7986f090a}{UPS\_C\_PORT\_ENABLED}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03515}03515                 \textcolor{keywordflow}{if} (v \& \mbox{\hyperlink{xhcireg_8h_aef5d06e0627757c9dbebfcf78e9c0eed}{XHCI\_PS\_OCC}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03516}03516                         i |= \mbox{\hyperlink{usb_8h_a3c0d918475bac92ae0874f094d964d34}{UPS\_C\_OVERCURRENT\_INDICATOR}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03517}03517                 \textcolor{keywordflow}{if} (v \& \mbox{\hyperlink{xhcireg_8h_ab89f476faf605c56e35c335c988cb55c}{XHCI\_PS\_WRC}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03518}03518                         i |= \mbox{\hyperlink{usb_8h_a1c17526d1223d8c6d757da2572bdc0fb}{UPS\_C\_BH\_PORT\_RESET}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03519}03519                 \textcolor{keywordflow}{if} (v \& \mbox{\hyperlink{xhcireg_8h_a33181810d4b2c123bfe4d6dd8dd7907b}{XHCI\_PS\_PRC}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03520}03520                         i |= \mbox{\hyperlink{usb_8h_a0a8fde772b3e3ae01fb3be9c998e3c3a}{UPS\_C\_PORT\_RESET}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03521}03521                 \textcolor{keywordflow}{if} (v \& \mbox{\hyperlink{xhcireg_8h_ac35f426018cce1012c24a61820eff33f}{XHCI\_PS\_PLC}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03522}03522                         i |= \mbox{\hyperlink{usb_8h_a955b88ca67e98c78ae7c050e689f5c1f}{UPS\_C\_PORT\_LINK\_STATE}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03523}03523                 \textcolor{keywordflow}{if} (v \& \mbox{\hyperlink{xhcireg_8h_af6cc46aff4d9355dba9d4a6e9559be84}{XHCI\_PS\_CEC}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03524}03524                         i |= \mbox{\hyperlink{usb_8h_a79f3ea7f5eb43a8220eb19d59d5ba6e4}{UPS\_C\_PORT\_CONFIG\_ERROR}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03525}03525 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03526}03526                 \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(sc-\/>\mbox{\hyperlink{structxhci__softc_a6a52740a11a9cbed60e0d8931b455aa1}{sc\_hub\_desc}}.\mbox{\hyperlink{unionxhci__hub__desc_a5be9515cd6eb753320172e3f721d8ec9}{ps}}.\mbox{\hyperlink{structusb__port__status_a5651385a11bdb3346496b276d1053de8}{wPortChange}}, i);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03527}03527                 \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} = \textcolor{keyword}{sizeof}(sc-\/>\mbox{\hyperlink{structxhci__softc_a6a52740a11a9cbed60e0d8931b455aa1}{sc\_hub\_desc}}.\mbox{\hyperlink{unionxhci__hub__desc_a5be9515cd6eb753320172e3f721d8ec9}{ps}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03528}03528                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03529}03529 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03530}03530         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_a1e9409609a7c66d1d575c53d5b2b39d9}{UR\_SET\_DESCRIPTOR}}, \mbox{\hyperlink{usb_8h_a2e2f4f55979f2bd987385ecca0deb448}{UT\_WRITE\_CLASS\_DEVICE}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03531}03531                 err = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03532}03532                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03533}03533 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03534}03534         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_af3188459f8546e34ce2d89aa28bc85f1}{UR\_SET\_FEATURE}}, \mbox{\hyperlink{usb_8h_a2e2f4f55979f2bd987385ecca0deb448}{UT\_WRITE\_CLASS\_DEVICE}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03535}03535                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03536}03536 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03537}03537         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_af3188459f8546e34ce2d89aa28bc85f1}{UR\_SET\_FEATURE}}, \mbox{\hyperlink{usb_8h_a2b0da1f1f369841fec9c55cf4df6888b}{UT\_WRITE\_CLASS\_OTHER}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03538}03538 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03539}03539                 i = index >> 8;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03540}03540                 index \&= 0x00FF;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03541}03541 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03542}03542                 \textcolor{keywordflow}{if} ((index < 1) ||}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03543}03543                     (index > sc-\/>\mbox{\hyperlink{structxhci__softc_aee3ef1fdb126d4c5e6f41099fc63c5ea}{sc\_noport}})) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03544}03544                         err = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03545}03545                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03546}03546                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03547}03547 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03548}03548                 port = \mbox{\hyperlink{xhcireg_8h_a5fc3a868a2a89aeff110dfd0a3701462}{XHCI\_PORTSC}}(index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03549}03549                 v = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, oper, port) \& \string~XHCI\_PS\_CLEAR;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03550}03550 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03551}03551                 \textcolor{keywordflow}{switch} (value) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03552}03552                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a58f719d989809022f563bd22f53c8e35}{UHF\_PORT\_U1\_TIMEOUT}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03553}03553                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{xhcireg_8h_a72a77f2aa51f668b5e1bcc3d8452058d}{XHCI\_PS\_SPEED\_GET}}(v) != 4) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03554}03554                                 err = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03555}03555                                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03556}03556                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03557}03557                         port = \mbox{\hyperlink{xhcireg_8h_a8ea3a8fe30e63f4ba4134a40f2ec2f29}{XHCI\_PORTPMSC}}(index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03558}03558                         v = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, oper, port);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03559}03559                         v \&= \string~XHCI\_PM3\_U1TO\_SET(0xFF);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03560}03560                         v |= \mbox{\hyperlink{xhcireg_8h_a0c553b01ae022e25ffe86ffb789971ab}{XHCI\_PM3\_U1TO\_SET}}(i);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03561}03561                         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, port, v);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03562}03562                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03563}03563                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_afff16f6e9014777e727be2f36bdfc1b2}{UHF\_PORT\_U2\_TIMEOUT}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03564}03564                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{xhcireg_8h_a72a77f2aa51f668b5e1bcc3d8452058d}{XHCI\_PS\_SPEED\_GET}}(v) != 4) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03565}03565                                 err = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03566}03566                                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03567}03567                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03568}03568                         port = \mbox{\hyperlink{xhcireg_8h_a8ea3a8fe30e63f4ba4134a40f2ec2f29}{XHCI\_PORTPMSC}}(index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03569}03569                         v = \mbox{\hyperlink{xhcireg_8h_ab6a4f3983e8f6624ad909c5ed8df4b70}{XREAD4}}(sc, oper, port);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03570}03570                         v \&= \string~XHCI\_PM3\_U2TO\_SET(0xFF);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03571}03571                         v |= \mbox{\hyperlink{xhcireg_8h_a56b97bf2761f8c8bf92e26ae3f7b5e24}{XHCI\_PM3\_U2TO\_SET}}(i);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03572}03572                         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, port, v);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03573}03573                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03574}03574                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a45744926d908b9e635a813c4b4470c46}{UHF\_BH\_PORT\_RESET}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03575}03575                         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, port, v | \mbox{\hyperlink{xhcireg_8h_a64f300f02a831268c4317515d0be17bc}{XHCI\_PS\_WPR}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03576}03576                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03577}03577                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a4214cc5f48c711ff293ab777a67d5a3f}{UHF\_PORT\_LINK\_STATE}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03578}03578                         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, port, v |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03579}03579                             \mbox{\hyperlink{xhcireg_8h_a864063c0c5ed3fc3d21ce3f09bb9c2c6}{XHCI\_PS\_PLS\_SET}}(i) | \mbox{\hyperlink{xhcireg_8h_a8b027493adc99dc41a73f72c349870e9}{XHCI\_PS\_LWS}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03580}03580                         \textcolor{comment}{/* 4ms settle time */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03581}03581                         \mbox{\hyperlink{usb__util_8c_a7ad9fc3660f5ecf96d72e499cdfeb963}{usb\_pause\_mtx}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_a7355d01a9b05ad01972eccabe5747edf}{bus\_mtx}}, hz / 250);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03582}03582                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03583}03583                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a8fa7a9a0c538b3c5c683f530f58d7b11}{UHF\_PORT\_ENABLE}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03584}03584                         DPRINTFN(3, \textcolor{stringliteral}{"{}set port enable \%d\(\backslash\)n"{}}, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03585}03585                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03586}03586                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a6df9599557522c7163bdcb13c9f4095c}{UHF\_PORT\_SUSPEND}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03587}03587                         DPRINTFN(6, \textcolor{stringliteral}{"{}suspend port \%u (LPM=\%u)\(\backslash\)n"{}}, index, i);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03588}03588                         j = \mbox{\hyperlink{xhcireg_8h_a72a77f2aa51f668b5e1bcc3d8452058d}{XHCI\_PS\_SPEED\_GET}}(v);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03589}03589                         \textcolor{keywordflow}{if} ((j < 1) || (j > 3)) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03590}03590                                 \textcolor{comment}{/* non-\/supported speed */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03591}03591                                 err = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03592}03592                                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03593}03593                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03594}03594                         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, port, v |}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03595}03595                             \mbox{\hyperlink{xhcireg_8h_a864063c0c5ed3fc3d21ce3f09bb9c2c6}{XHCI\_PS\_PLS\_SET}}(i ? 2 \textcolor{comment}{/* LPM */} : 3) | \mbox{\hyperlink{xhcireg_8h_a8b027493adc99dc41a73f72c349870e9}{XHCI\_PS\_LWS}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03596}03596                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03597}03597                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_ab7d2ba22c960f8009974c75a79739380}{UHF\_PORT\_RESET}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03598}03598                         DPRINTFN(6, \textcolor{stringliteral}{"{}reset port \%d\(\backslash\)n"{}}, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03599}03599                         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, port, v | \mbox{\hyperlink{xhcireg_8h_ae71ce2c23b38dbe05c74020238f8647f}{XHCI\_PS\_PR}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03600}03600                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03601}03601                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a25f7d33df63b7439eb79041effad57f8}{UHF\_PORT\_POWER}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03602}03602                         DPRINTFN(3, \textcolor{stringliteral}{"{}set port power \%d\(\backslash\)n"{}}, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03603}03603                         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, port, v | \mbox{\hyperlink{xhcireg_8h_a6f8e3305290f7380ed49c8ffdc10de22}{XHCI\_PS\_PP}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03604}03604                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03605}03605                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a6027a0c92cd4a7619825f6924b44b3fd}{UHF\_PORT\_TEST}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03606}03606                         DPRINTFN(3, \textcolor{stringliteral}{"{}set port test \%d\(\backslash\)n"{}}, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03607}03607                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03608}03608                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_acef0673348b3a416db2e1c3c514b79cb}{UHF\_PORT\_INDICATOR}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03609}03609                         DPRINTFN(3, \textcolor{stringliteral}{"{}set port indicator \%d\(\backslash\)n"{}}, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03610}03610 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03611}03611                         v \&= \string~XHCI\_PS\_PIC\_SET(3);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03612}03612                         v |= \mbox{\hyperlink{xhcireg_8h_ab8d620c38a10a1e5d685459e9f297e5d}{XHCI\_PS\_PIC\_SET}}(1);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03613}03613 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03614}03614                         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, oper, port, v);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03615}03615                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03616}03616                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03617}03617                         err = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03618}03618                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03619}03619                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03620}03620                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03621}03621 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03622}03622         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_a44d4b0ff5d9dfa1f511a77a5c02d3d45}{UR\_CLEAR\_TT\_BUFFER}}, \mbox{\hyperlink{usb_8h_a2b0da1f1f369841fec9c55cf4df6888b}{UT\_WRITE\_CLASS\_OTHER}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03623}03623         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_a98706aa73be778406ec64d7a2c3f2c68}{UR\_RESET\_TT}}, \mbox{\hyperlink{usb_8h_a2b0da1f1f369841fec9c55cf4df6888b}{UT\_WRITE\_CLASS\_OTHER}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03624}03624         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_a82661d7f0b0812c9668c22cf1905b940}{UR\_GET\_TT\_STATE}}, \mbox{\hyperlink{usb_8h_ac619fe4cc188166d4001c4b75365154c}{UT\_READ\_CLASS\_OTHER}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03625}03625         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8c_a5d447be7aadd1d1130c01a26a9dafa6a}{C}}(\mbox{\hyperlink{usb_8h_a6e4e96fd45ca7b0afd0ea2ea63daae2c}{UR\_STOP\_TT}}, \mbox{\hyperlink{usb_8h_a2b0da1f1f369841fec9c55cf4df6888b}{UT\_WRITE\_CLASS\_OTHER}}):}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03626}03626                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03627}03627         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03628}03628                 err = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a91e19b8efd2de831078be0a8d2a030ed}{USB\_ERR\_IOERROR}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03629}03629                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03630}03630         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03631}03631 done:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03632}03632         *plength = \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03633}03633         *\mbox{\hyperlink{usb__if_8m_a074c17a419327b41805af2dd7cb152e7}{pptr}} = ptr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03634}03634         \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03635}03635 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03636}03636 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03637}03637 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03638}\mbox{\hyperlink{xhci_8c_aa4823f184a783811da904354c16cb118}{03638}} \mbox{\hyperlink{xhci_8c_aa4823f184a783811da904354c16cb118}{xhci\_xfer\_setup}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__setup__params}{usb\_setup\_params}} *parm)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03639}03639 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03640}03640         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__search}{usb\_page\_search}} page\_info;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03641}03641         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__cache}{usb\_page\_cache}} *pc;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03642}03642         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03643}03643         \textcolor{keywordtype}{void} *last\_obj;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03644}03644         uint32\_t ntd;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03645}03645         uint32\_t \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03646}03646 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03647}03647         xfer = parm-\/>\mbox{\hyperlink{structusb__setup__params_aa8ed6ed21704b223bdfa97a3ab0d4c0a}{curr\_xfer}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03648}03648 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03649}03649         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03650}03650 \textcolor{comment}{         * The proof for the "{}ntd"{} formula is illustrated like this:}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03651}03651 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03652}03652 \textcolor{comment}{         * +-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03653}03653 \textcolor{comment}{         * |                                    |}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03654}03654 \textcolor{comment}{         * |         |remainder -\/>              |}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03655}03655 \textcolor{comment}{         * |   +-\/-\/-\/-\/-\/+-\/-\/-\/+                      |}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03656}03656 \textcolor{comment}{         * |   | xxx | x | frm 0                |}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03657}03657 \textcolor{comment}{         * |   +-\/-\/-\/-\/-\/+-\/-\/-\/++                     |}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03658}03658 \textcolor{comment}{         * |   | xxx | xx | frm 1               |}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03659}03659 \textcolor{comment}{         * |   +-\/-\/-\/-\/-\/+-\/-\/-\/-\/+                     |}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03660}03660 \textcolor{comment}{         * |            ...                     |}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03661}03661 \textcolor{comment}{         * +-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/+}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03662}03662 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03663}03663 \textcolor{comment}{         * "{}xxx"{} means a completely full USB transfer descriptor}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03664}03664 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03665}03665 \textcolor{comment}{         * "{}x"{} and "{}xx"{} means a short USB packet}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03666}03666 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03667}03667 \textcolor{comment}{         * For the remainder of an USB transfer modulo}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03668}03668 \textcolor{comment}{         * "{}max\_data\_length"{} we need two USB transfer descriptors.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03669}03669 \textcolor{comment}{         * One to transfer the remaining data and one to finalise with}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03670}03670 \textcolor{comment}{         * a zero length packet in case the "{}force\_short\_xfer"{} flag is}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03671}03671 \textcolor{comment}{         * set. We only need two USB transfer descriptors in the case}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03672}03672 \textcolor{comment}{         * where the transfer length of the first one is a factor of}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03673}03673 \textcolor{comment}{         * "{}max\_frame\_size"{}. The rest of the needed USB transfer}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03674}03674 \textcolor{comment}{         * descriptors is given by the buffer size divided by the}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03675}03675 \textcolor{comment}{         * maximum data payload.}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03676}03676 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03677}03677         parm-\/>\mbox{\hyperlink{structusb__setup__params_acc9d7b0e32de80b152fb807fba90257c}{hc\_max\_packet\_size}} = 0x400;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03678}03678         parm-\/>\mbox{\hyperlink{structusb__setup__params_a82adfb05fee2d6583bce27791144139d}{hc\_max\_packet\_count}} = 16 * 3;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03679}03679         parm-\/>\mbox{\hyperlink{structusb__setup__params_a1a5b54ff6d8638ae7a0acb0b10020155}{hc\_max\_frame\_size}} = \mbox{\hyperlink{xhci_8h_ae0072f012698d29183cd3e54316c4325}{XHCI\_TD\_PAYLOAD\_MAX}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03680}03680 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03681}03681         xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.bdma\_enable = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03682}03682 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03683}03683         \mbox{\hyperlink{usb__transfer_8c_a26ac79fd0805b2add1b1dac2cf327a4e}{usbd\_transfer\_setup\_sub}}(parm);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03684}03684 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03685}03685         \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a5367e64daae30f55ec887872d577fa80}{isochronous\_xfr}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03686}03686                 ntd = ((1 * xfer-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03687}03687                     + (xfer-\/>\mbox{\hyperlink{structusb__xfer_a3ece1de738e7c3ca20f0bfdbd827fd16}{max\_data\_length}} / xfer-\/>\mbox{\hyperlink{structusb__xfer_ad26ff9271d8a65e58ecec095be9cc78d}{max\_hc\_frame\_size}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03688}03688         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a777cf7dd18178f84b0d6e0a086f72a7a}{control\_xfr}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03689}03689                 ntd = ((2 * xfer-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}}) + 1   \textcolor{comment}{/* STATUS */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03690}03690                     + (xfer-\/>\mbox{\hyperlink{structusb__xfer_a3ece1de738e7c3ca20f0bfdbd827fd16}{max\_data\_length}} / xfer-\/>\mbox{\hyperlink{structusb__xfer_ad26ff9271d8a65e58ecec095be9cc78d}{max\_hc\_frame\_size}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03691}03691         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03692}03692                 ntd = ((2 * xfer-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03693}03693                     + (xfer-\/>\mbox{\hyperlink{structusb__xfer_a3ece1de738e7c3ca20f0bfdbd827fd16}{max\_data\_length}} / xfer-\/>\mbox{\hyperlink{structusb__xfer_ad26ff9271d8a65e58ecec095be9cc78d}{max\_hc\_frame\_size}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03694}03694         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03695}03695 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03696}03696 alloc\_dma\_set:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03697}03697 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03698}03698         \textcolor{keywordflow}{if} (parm-\/>\mbox{\hyperlink{structusb__setup__params_ad2543ebaa3709e178a7ad9e56de498e0}{err}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03699}03699                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03700}03700 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03701}03701         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03702}03702 \textcolor{comment}{         * Allocate queue heads and transfer descriptors}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03703}03703 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03704}03704         last\_obj = NULL;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03705}03705 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03706}03706         \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__transfer_8h_a340073210a5be29d27fd51f0c0a87b3d}{usbd\_transfer\_setup\_sub\_malloc}}(}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03707}03707             parm, \&pc, \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__td}{xhci\_td}}),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03708}03708             \mbox{\hyperlink{xhci_8h_aaa6870c78d5b8955948864cdbb29be08}{XHCI\_TD\_ALIGN}}, ntd)) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03709}03709                 parm-\/>\mbox{\hyperlink{structusb__setup__params_ad2543ebaa3709e178a7ad9e56de498e0}{err}} = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945ab676f37fd789593cd476f746210170cf}{USB\_ERR\_NOMEM}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03710}03710                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03711}03711         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03712}03712         \textcolor{keywordflow}{if} (parm-\/>\mbox{\hyperlink{structusb__setup__params_a3a54a1ffd5caf3ab8718c91cbe78b639}{buf}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03713}03713                 \textcolor{keywordflow}{for} (\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} = 0; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} != ntd; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}++) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03714}03714                         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__td}{xhci\_td}} *td;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03715}03715 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03716}03716                         \mbox{\hyperlink{usb__busdma_8c_ab4f9d07714be540b6d002b44b3716bb2}{usbd\_get\_page}}(pc + \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}, 0, \&page\_info);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03717}03717 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03718}03718                         td = page\_info.\mbox{\hyperlink{structusb__page__search_a60cd5ce1bbfbf2d2dec7677b1ba9b01a}{buffer}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03719}03719 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03720}03720                         \textcolor{comment}{/* init TD */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03721}03721                         td-\/>\mbox{\hyperlink{structxhci__td_a7d6a15b4a2d6e680a794e420a42d6124}{td\_self}} = page\_info.physaddr;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03722}03722                         td-\/>\mbox{\hyperlink{structxhci__td_aaf4e303e8091c679002bb91a2203f7ad}{obj\_next}} = last\_obj;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03723}03723                         td-\/>\mbox{\hyperlink{structxhci__td_a933fec23ad2794824d084b5a78397a87}{page\_cache}} = pc + \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03724}03724 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03725}03725                         last\_obj = td;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03726}03726 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03727}03727                         \mbox{\hyperlink{usb__busdma_8h_a988a5299f521e8a8d94a68a03015bd77}{usb\_pc\_cpu\_flush}}(pc + \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03728}03728                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03729}03729         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03730}03730         xfer-\/>\mbox{\hyperlink{structusb__xfer_a68f3cea7860d801fe4e03b3301c9381d}{td\_start}}[xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a7574b7503818fc7c9e8f08fb5919a373}{curr\_dma\_set}}] = last\_obj;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03731}03731 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03732}03732         \textcolor{keywordflow}{if} (!xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a7574b7503818fc7c9e8f08fb5919a373}{curr\_dma\_set}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03733}03733                 xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a7574b7503818fc7c9e8f08fb5919a373}{curr\_dma\_set}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03734}03734                 \textcolor{keywordflow}{goto} alloc\_dma\_set;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03735}03735         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03736}03736 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03737}03737 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03738}03738 \textcolor{keyword}{static} uint8\_t}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03739}\mbox{\hyperlink{xhci_8c_a36cfdff30cf6f21fd6d2f9ddb66f007c}{03739}} \mbox{\hyperlink{xhci_8c_a36cfdff30cf6f21fd6d2f9ddb66f007c}{xhci\_get\_endpoint\_state}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev, uint8\_t epno)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03740}03740 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03741}03741         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03742}03742         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__search}{usb\_page\_search}} buf\_dev;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03743}03743         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__hw__dev}{xhci\_hw\_dev}} *hdev;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03744}03744         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__endp__ctx}{xhci\_endp\_ctx}} *endp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03745}03745         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03746}03746 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03747}03747         MPASS(epno != 0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03748}03748 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03749}03749         hdev =  \&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[udev-\/>\mbox{\hyperlink{structusb__device_a9f275ef5fb35734f8174c9b01a855973}{controller\_slot\_id}}];}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03750}03750 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03751}03751         \mbox{\hyperlink{usb__busdma_8c_ab4f9d07714be540b6d002b44b3716bb2}{usbd\_get\_page}}(\&hdev-\/>\mbox{\hyperlink{structxhci__hw__dev_a58b4c8a6356c9035a0b83599b8f8579b}{device\_pc}}, 0, \&buf\_dev);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03752}03752         endp = \mbox{\hyperlink{xhci_8c_a7282cd159e63bc916b5f3d5b828ff61f}{XHCI\_GET\_CTX}}(sc, \mbox{\hyperlink{structxhci__dev__ctx}{xhci\_dev\_ctx}}, \mbox{\hyperlink{xhci_8h_a39aa21a7bdbb2e80e1d37a3013173ed9}{ctx\_ep}}[epno -\/ 1],}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03753}03753             buf\_dev.\mbox{\hyperlink{structusb__page__search_a60cd5ce1bbfbf2d2dec7677b1ba9b01a}{buffer}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03754}03754         \mbox{\hyperlink{usb__busdma_8h_a8752e7de57d1aa5d26c2cd8209162f69}{usb\_pc\_cpu\_invalidate}}(\&hdev-\/>\mbox{\hyperlink{structxhci__hw__dev_a58b4c8a6356c9035a0b83599b8f8579b}{device\_pc}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03755}03755 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03756}03756         temp = le32toh(endp-\/>\mbox{\hyperlink{structxhci__endp__ctx_a129e6f08dff2bafd7de6e7288c564f9d}{dwEpCtx0}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03757}03757 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03758}03758         \textcolor{keywordflow}{return} (\mbox{\hyperlink{xhci_8h_a934c9a707a18e75a09d485dabfa3b674}{XHCI\_EPCTX\_0\_EPSTATE\_GET}}(temp));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03759}03759 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03760}03760 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03761}03761 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03762}\mbox{\hyperlink{xhci_8c_a697ae5064910a5f1c02c6f956a11950f}{03762}} \mbox{\hyperlink{xhci_8c_a697ae5064910a5f1c02c6f956a11950f}{xhci\_configure\_reset\_endpoint}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03763}03763 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03764}03764         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(xfer-\/>\mbox{\hyperlink{structusb__xfer_ad188b4cd79900e1cd04aba6c140e9ab3}{xroot}}-\/>\mbox{\hyperlink{structusb__xfer__root_a870218d57253f00f1e9baa19401c9b0c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03765}03765         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__search}{usb\_page\_search}} buf\_inp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03766}03766         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device}{usb\_device}} *udev;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03767}03767         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__endpoint__ext}{xhci\_endpoint\_ext}} *pepext;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03768}03768         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__endpoint__descriptor}{usb\_endpoint\_descriptor}} *edesc;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03769}03769         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__cache}{usb\_page\_cache}} *pcinp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03770}03770         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03771}03771         \mbox{\hyperlink{usb__freebsd_8h_a3f3a2ea5069eca21eab610b65c30c173}{usb\_stream\_t}} stream\_id;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03772}03772         uint32\_t mask;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03773}03773         uint8\_t index;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03774}03774         uint8\_t epno;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03775}03775 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03776}03776         pepext = \mbox{\hyperlink{xhci_8c_af1c3f8bc816768b3a290ad69aafa7af0}{xhci\_get\_endpoint\_ext}}(xfer-\/>\mbox{\hyperlink{structusb__xfer_ad188b4cd79900e1cd04aba6c140e9ab3}{xroot}}-\/>\mbox{\hyperlink{structusb__xfer__root_ad636fcdafa42c174cdf281bb144b1e67}{udev}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03777}03777             xfer-\/>\mbox{\hyperlink{structusb__xfer_a8de3fd948d496c7901b307b13a1c6e99}{endpoint}}-\/>\mbox{\hyperlink{structusb__endpoint_af3b96b9fe1e612b303833c2e2d0365e1}{edesc}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03778}03778 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03779}03779         udev = xfer-\/>\mbox{\hyperlink{structusb__xfer_ad188b4cd79900e1cd04aba6c140e9ab3}{xroot}}-\/>\mbox{\hyperlink{structusb__xfer__root_ad636fcdafa42c174cdf281bb144b1e67}{udev}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03780}03780         index = udev-\/>\mbox{\hyperlink{structusb__device_a9f275ef5fb35734f8174c9b01a855973}{controller\_slot\_id}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03781}03781 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03782}03782         pcinp = \&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_ac3b7a1fbfd567e6b9c3cdcbc58bcd40e}{input\_pc}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03783}03783 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03784}03784         \mbox{\hyperlink{usb__busdma_8c_ab4f9d07714be540b6d002b44b3716bb2}{usbd\_get\_page}}(pcinp, 0, \&buf\_inp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03785}03785 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03786}03786         edesc = xfer-\/>\mbox{\hyperlink{structusb__xfer_a8de3fd948d496c7901b307b13a1c6e99}{endpoint}}-\/>\mbox{\hyperlink{structusb__endpoint_af3b96b9fe1e612b303833c2e2d0365e1}{edesc}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03787}03787 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03788}03788         epno = edesc-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_a3d0a0ab41c53023055a242d66a437a2d}{bEndpointAddress}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03789}03789         stream\_id = xfer-\/>\mbox{\hyperlink{structusb__xfer_a042262c8b77567b6588d0ba01446deb9}{stream\_id}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03790}03790 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03791}03791         \textcolor{keywordflow}{if} ((edesc-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_aff28dcc97802a405b31baccd33c2bf8f}{bmAttributes}} \& \mbox{\hyperlink{usb_8h_a8badd3504359a0aed83ac575a46a67b4}{UE\_XFERTYPE}}) == \mbox{\hyperlink{usb_8h_ace49b7adb24ebcb0a0b17110c26aa63a}{UE\_CONTROL}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03792}03792                 epno |= \mbox{\hyperlink{usb_8h_a72bb077a860132c175c166f344c75893}{UE\_DIR\_IN}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03793}03793 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03794}03794         epno = \mbox{\hyperlink{xhci_8h_a8a803affdc78579a2e78adb894751b3d}{XHCI\_EPNO2EPID}}(epno);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03795}03795 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03796}03796         \textcolor{keywordflow}{if} (epno == 0)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03797}03797                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945aa2d5591274807d976378f663ce37773e}{USB\_ERR\_NO\_PIPE}});                \textcolor{comment}{/* invalid */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03798}03798 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03799}03799         \mbox{\hyperlink{xhci_8h_a8f5a32cd58a3c26992ea354dfe7b0956}{XHCI\_CMD\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03800}03800 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03801}03801         \textcolor{comment}{/* configure endpoint */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03802}03802 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03803}03803         err = \mbox{\hyperlink{xhci_8c_a159a9b0bf4c42b6d6682fd7272543dc3}{xhci\_configure\_endpoint\_by\_xfer}}(xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03804}03804 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03805}03805         \textcolor{keywordflow}{if} (err != 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03806}03806                 \mbox{\hyperlink{xhci_8h_a338ae22d11f2b1dbc1a2fc8b9ef50c8a}{XHCI\_CMD\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03807}03807                 \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03808}03808         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03809}03809 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03810}03810         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03811}03811 \textcolor{comment}{         * Get the endpoint into the stopped state according to the}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03812}03812 \textcolor{comment}{         * endpoint context state diagram in the XHCI specification:}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03813}03813 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03814}03814         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{xhci_8c_a36cfdff30cf6f21fd6d2f9ddb66f007c}{xhci\_get\_endpoint\_state}}(udev, epno)) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03815}03815         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8h_aebd3e4e44e4689505558446c5ad89006}{XHCI\_EPCTX\_0\_EPSTATE\_DISABLED}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03816}03816                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03817}03817         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8h_aa8ca1431a58c685b6e86a59be9602143}{XHCI\_EPCTX\_0\_EPSTATE\_STOPPED}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03818}03818                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03819}03819         \textcolor{keywordflow}{case} \mbox{\hyperlink{xhci_8h_a92155e5c3e3bb16f87b3bfe8e1d5574e}{XHCI\_EPCTX\_0\_EPSTATE\_HALTED}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03820}03820                 err = \mbox{\hyperlink{xhci_8c_a5f90610f10451590e1430e509a42ebfc}{xhci\_cmd\_reset\_ep}}(sc, 0, epno, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03821}03821                 \textcolor{keywordflow}{if} (err != 0)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03822}03822                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Could not reset endpoint \%u\(\backslash\)n"{}}, epno);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03823}03823                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03824}03824         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03825}03825                 err = \mbox{\hyperlink{xhci_8c_a7b2c3df0830d4cd7171b2a6f4fe351f3}{xhci\_cmd\_stop\_ep}}(sc, 0, epno, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03826}03826                 \textcolor{keywordflow}{if} (err != 0)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03827}03827                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Could not stop endpoint \%u\(\backslash\)n"{}}, epno);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03828}03828                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03829}03829         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03830}03830 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03831}03831         err = \mbox{\hyperlink{xhci_8c_a202ffeab386ad0b2b4f34e9a4e0ba3c5}{xhci\_cmd\_set\_tr\_dequeue\_ptr}}(sc,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03832}03832             (pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a248d4709aba68f9c9c685d0b5e6770e7}{physaddr}} + (stream\_id * \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structxhci__trb}{xhci\_trb}}) *}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03833}03833             \mbox{\hyperlink{xhci_8h_ad65c5c3edb879e07bba8237211cf64c5}{XHCI\_MAX\_TRANSFERS}})) | \mbox{\hyperlink{xhci_8h_ad397fa9b91adf8c53283f19bbce8fe26}{XHCI\_EPCTX\_2\_DCS\_SET}}(1),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03834}03834             stream\_id, epno, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03835}03835 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03836}03836         \textcolor{keywordflow}{if} (err != 0)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03837}03837                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Could not set dequeue ptr for endpoint \%u\(\backslash\)n"{}}, epno);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03838}03838 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03839}03839         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03840}03840 \textcolor{comment}{         * Get the endpoint into the running state according to the}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03841}03841 \textcolor{comment}{         * endpoint context state diagram in the XHCI specification:}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03842}03842 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03843}03843 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03844}03844         mask = (1U << epno);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03845}03845         \mbox{\hyperlink{xhci_8c_a2b5fcb1981b6791181beb8c1f7710b10}{xhci\_configure\_mask}}(udev, mask | 1U, 0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03846}03846 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03847}03847         \textcolor{keywordflow}{if} (!(sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_a28e47e5ee9c2960324201a7f76453294}{ep\_configured}} \& mask)) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03848}03848                 sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_a28e47e5ee9c2960324201a7f76453294}{ep\_configured}} |= mask;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03849}03849                 err = \mbox{\hyperlink{xhci_8c_a16bb129b4a583fc8ed747de71aee1f4e}{xhci\_cmd\_configure\_ep}}(sc, buf\_inp.physaddr, 0, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03850}03850         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03851}03851                 err = \mbox{\hyperlink{xhci_8c_ab64f4e8f1f9b93086b3453647cd7b8c4}{xhci\_cmd\_evaluate\_ctx}}(sc, buf\_inp.physaddr, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03852}03852         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03853}03853 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03854}03854         \textcolor{keywordflow}{if} (err != 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03855}03855                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Could not configure "{}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03856}03856                     \textcolor{stringliteral}{"{}endpoint \%u at slot \%u.\(\backslash\)n"{}}, epno, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03857}03857         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03858}03858         \mbox{\hyperlink{xhci_8h_a338ae22d11f2b1dbc1a2fc8b9ef50c8a}{XHCI\_CMD\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03859}03859 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03860}03860         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03861}03861 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03862}03862 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03863}03863 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03864}\mbox{\hyperlink{xhci_8c_a75fb9bff5b49799b84bacd2dde5276ff}{03864}} \mbox{\hyperlink{xhci_8c_a75fb9bff5b49799b84bacd2dde5276ff}{xhci\_xfer\_unsetup}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03865}03865 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03866}03866         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03867}03867 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03868}03868 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03869}03869 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03870}\mbox{\hyperlink{xhci_8c_af58185d9b997b5f617bd0ec3582dbe54}{03870}} \mbox{\hyperlink{xhci_8c_af58185d9b997b5f617bd0ec3582dbe54}{xhci\_start\_dma\_delay}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03871}03871 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03872}03872         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(xfer-\/>\mbox{\hyperlink{structusb__xfer_ad188b4cd79900e1cd04aba6c140e9ab3}{xroot}}-\/>\mbox{\hyperlink{structusb__xfer__root_a870218d57253f00f1e9baa19401c9b0c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03873}03873 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03874}03874         \textcolor{comment}{/* put transfer on interrupt queue (again) */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03875}03875         \mbox{\hyperlink{usb__transfer_8c_abfdcc46256df403f3f4d1b02db7ccb16}{usbd\_transfer\_enqueue}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_afe87bf7e25fe7284a87d14ca231bc818}{intr\_q}}, xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03876}03876 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03877}03877         (void)\mbox{\hyperlink{usb__process_8c_a9815bfac5c88a8f483a16eebe010bfc7}{usb\_proc\_msignal}}(USB\_BUS\_CONTROL\_XFER\_PROC(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03878}03878             \&sc-\/>\mbox{\hyperlink{structxhci__softc_a713afcfe3bcc8d061211f946ec6b36cc}{sc\_config\_msg}}[0], \&sc-\/>\mbox{\hyperlink{structxhci__softc_a713afcfe3bcc8d061211f946ec6b36cc}{sc\_config\_msg}}[1]);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03879}03879 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03880}03880 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03881}03881 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03882}\mbox{\hyperlink{xhci_8c_a97a972ba0f0ddda1417dc8541e26d6c4}{03882}} \mbox{\hyperlink{xhci_8c_a78c5be35a2941f280b4fc373247c2bc4}{xhci\_configure\_msg}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__proc__msg}{usb\_proc\_msg}} *pm)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03883}03883 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03884}03884         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03885}03885         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__endpoint__ext}{xhci\_endpoint\_ext}} *pepext;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03886}03886         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03887}03887 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03888}03888         sc = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(((\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__bus__msg}{usb\_bus\_msg}} *)pm)-\/>bus);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03889}03889 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03890}03890 restart:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03891}03891         TAILQ\_FOREACH(xfer, \&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_afe87bf7e25fe7284a87d14ca231bc818}{intr\_q}}.head, wait\_entry) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03892}03892                 pepext = \mbox{\hyperlink{xhci_8c_af1c3f8bc816768b3a290ad69aafa7af0}{xhci\_get\_endpoint\_ext}}(xfer-\/>\mbox{\hyperlink{structusb__xfer_ad188b4cd79900e1cd04aba6c140e9ab3}{xroot}}-\/>\mbox{\hyperlink{structusb__xfer__root_ad636fcdafa42c174cdf281bb144b1e67}{udev}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03893}03893                     xfer-\/>\mbox{\hyperlink{structusb__xfer_a8de3fd948d496c7901b307b13a1c6e99}{endpoint}}-\/>\mbox{\hyperlink{structusb__endpoint_af3b96b9fe1e612b303833c2e2d0365e1}{edesc}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03894}03894 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03895}03895                 \textcolor{keywordflow}{if} ((pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a3e583572d83c2276b0cc995d08574f1d}{trb\_halted}} != 0) ||}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03896}03896                     (pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_ac3b4c115bbc8f9df3b922c27036ea47c}{trb\_running}} == 0)) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03897}03897                         uint16\_t i;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03898}03898 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03899}03899                         \textcolor{comment}{/* clear halted and running */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03900}03900                         pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a3e583572d83c2276b0cc995d08574f1d}{trb\_halted}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03901}03901                         pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_ac3b4c115bbc8f9df3b922c27036ea47c}{trb\_running}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03902}03902 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03903}03903                         \textcolor{comment}{/* nuke remaining buffered transfers */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03904}03904 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03905}03905                         \textcolor{keywordflow}{for} (i = 0; i != (\mbox{\hyperlink{xhci_8h_ad65c5c3edb879e07bba8237211cf64c5}{XHCI\_MAX\_TRANSFERS}} *}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03906}03906                             XHCI\_MAX\_STREAMS); i++) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03907}03907                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03908}03908 \textcolor{comment}{                                 * NOTE: We need to use the timeout}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03909}03909 \textcolor{comment}{                                 * error code here else existing}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03910}03910 \textcolor{comment}{                                 * isochronous clients can get}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03911}03911 \textcolor{comment}{                                 * confused:}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03912}03912 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03913}03913                                 \textcolor{keywordflow}{if} (pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a950f74c7e80c49fd46b528c6ab9c78ad}{xfer}}[i] != NULL) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03914}03914                                         \mbox{\hyperlink{xhci_8c_a599f5f1237516bdefbf20695b1f8400c}{xhci\_device\_done}}(pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a950f74c7e80c49fd46b528c6ab9c78ad}{xfer}}[i],}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03915}03915                                             \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945aeb31baaa7bf416e200f2a0d4ece60820}{USB\_ERR\_TIMEOUT}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03916}03916                                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03917}03917                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03918}03918 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03919}03919                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03920}03920 \textcolor{comment}{                         * NOTE: The USB transfer cannot vanish in}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03921}03921 \textcolor{comment}{                         * this state!}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03922}03922 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03923}03923 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03924}03924                         \mbox{\hyperlink{usb__core_8h_aadb0c32f6333b8a0715929ace5f550b2}{USB\_BUS\_UNLOCK}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03925}03925 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03926}03926                         \mbox{\hyperlink{xhci_8c_a697ae5064910a5f1c02c6f956a11950f}{xhci\_configure\_reset\_endpoint}}(xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03927}03927 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03928}03928                         \mbox{\hyperlink{usb__core_8h_a21dab1de8f52baf9fbf7617c6b1ec033}{USB\_BUS\_LOCK}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03929}03929 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03930}03930                         \textcolor{comment}{/* check if halted is still cleared */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03931}03931                         \textcolor{keywordflow}{if} (pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a3e583572d83c2276b0cc995d08574f1d}{trb\_halted}} == 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03932}03932                                 pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_ac3b4c115bbc8f9df3b922c27036ea47c}{trb\_running}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03933}03933                                 memset(pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_aaf51ba70017bf6e833df9c5ddf06bfbc}{trb\_index}}, 0,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03934}03934                                     \textcolor{keyword}{sizeof}(pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_aaf51ba70017bf6e833df9c5ddf06bfbc}{trb\_index}}));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03935}03935                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03936}03936                         \textcolor{keywordflow}{goto} restart;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03937}03937                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03938}03938 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03939}03939                 \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a89ad1514784afb61bc49621bcc5d8b3e}{did\_dma\_delay}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03940}03940                         \textcolor{comment}{/* remove transfer from interrupt queue (again) */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03941}03941                         \mbox{\hyperlink{usb__transfer_8c_a8ae226e60d0a46334139efe0d9f304c1}{usbd\_transfer\_dequeue}}(xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03942}03942 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03943}03943                         \textcolor{comment}{/* we are finally done */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03944}03944                         \mbox{\hyperlink{usb__transfer_8c_a7adbc7aadc7b24fc28fea9ff049ac1ad}{usb\_dma\_delay\_done\_cb}}(xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03945}03945 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03946}03946                         \textcolor{comment}{/* queue changed -\/ restart */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03947}03947                         \textcolor{keywordflow}{goto} restart;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03948}03948                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03949}03949         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03950}03950 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03951}03951         TAILQ\_FOREACH(xfer, \&sc-\/>\mbox{\hyperlink{structxhci__softc_a27f214d236e96482b0ccf5d04779593b}{sc\_bus}}.\mbox{\hyperlink{structusb__bus_afe87bf7e25fe7284a87d14ca231bc818}{intr\_q}}.head, wait\_entry) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03952}03952                 \textcolor{comment}{/* try to insert xfer on HW queue */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03953}03953                 \mbox{\hyperlink{xhci_8c_a807ea787807af2759762bdca7e362171}{xhci\_transfer\_insert}}(xfer);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03954}03954 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03955}03955                 \textcolor{comment}{/* try to multi buffer */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03956}03956                 \mbox{\hyperlink{xhci_8c_ad869b0a87995f55c632ec381a18c5abf}{xhci\_device\_generic\_multi\_enter}}(xfer-\/>\mbox{\hyperlink{structusb__xfer_a8de3fd948d496c7901b307b13a1c6e99}{endpoint}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03957}03957                     xfer-\/>\mbox{\hyperlink{structusb__xfer_a042262c8b77567b6588d0ba01446deb9}{stream\_id}}, NULL);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03958}03958         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03959}03959 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03960}03960 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03961}03961 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03962}\mbox{\hyperlink{xhci_8c_af5106e510b12b5e4b4c1a12ce1f1b9f6}{03962}} \mbox{\hyperlink{xhci_8c_af5106e510b12b5e4b4c1a12ce1f1b9f6}{xhci\_ep\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev, \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__endpoint__descriptor}{usb\_endpoint\_descriptor}} *edesc,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03963}03963     \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__endpoint}{usb\_endpoint}} *ep)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03964}03964 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03965}03965         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__endpoint__ext}{xhci\_endpoint\_ext}} *pepext;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03966}03966         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03967}03967         uint8\_t index;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03968}03968         uint8\_t epno;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03969}03969 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03970}03970         DPRINTFN(2, \textcolor{stringliteral}{"{}endpoint=\%p, addr=\%d, endpt=\%d, mode=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03971}03971             ep, udev-\/>\mbox{\hyperlink{structusb__device_ab9873df4422a53f4fa2d7c17460b11a1}{address}}, edesc-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_a3d0a0ab41c53023055a242d66a437a2d}{bEndpointAddress}}, udev-\/>\mbox{\hyperlink{structusb__device_ae7b27fdcae02d49bee5c2f0a9130b633}{flags}}.\mbox{\hyperlink{structusb__device__flags_ad686103f845c7d070e25fa7a26c34694}{usb\_mode}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03972}03972 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03973}03973         \textcolor{keywordflow}{if} (udev-\/>\mbox{\hyperlink{structusb__device_aa35d4d1b88f22abb34d30e9762153e0b}{parent\_hub}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03974}03974                 \textcolor{comment}{/* root HUB has special endpoint handling */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03975}03975                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03976}03976         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03977}03977 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03978}03978         ep-\/>\mbox{\hyperlink{structusb__endpoint_ab31775284691ffc7392330fea7924f18}{methods}} = \&\mbox{\hyperlink{xhci_8c_ae77cd8d6fda41960a2f01337561a7469}{xhci\_device\_generic\_methods}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03979}03979 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03980}03980         pepext = \mbox{\hyperlink{xhci_8c_af1c3f8bc816768b3a290ad69aafa7af0}{xhci\_get\_endpoint\_ext}}(udev, edesc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03981}03981 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03982}03982         \mbox{\hyperlink{usb__core_8h_a21dab1de8f52baf9fbf7617c6b1ec033}{USB\_BUS\_LOCK}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03983}03983         pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a3e583572d83c2276b0cc995d08574f1d}{trb\_halted}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03984}03984         pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_ac3b4c115bbc8f9df3b922c27036ea47c}{trb\_running}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03985}03985 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03986}03986         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03987}03987 \textcolor{comment}{         * When doing an alternate setting, except for control}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03988}03988 \textcolor{comment}{         * endpoints, we need to re-\/configure the XHCI endpoint}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03989}03989 \textcolor{comment}{         * context:}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03990}03990 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03991}03991         \textcolor{keywordflow}{if} ((edesc-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_a3d0a0ab41c53023055a242d66a437a2d}{bEndpointAddress}} \& \mbox{\hyperlink{usb_8h_a227db1f194f105a22faae81401d3e18e}{UE\_ADDR}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03992}03992                 sc = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03993}03993                 index = udev-\/>\mbox{\hyperlink{structusb__device_a9f275ef5fb35734f8174c9b01a855973}{controller\_slot\_id}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03994}03994                 epno = \mbox{\hyperlink{xhci_8h_a8a803affdc78579a2e78adb894751b3d}{XHCI\_EPNO2EPID}}(edesc-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_a3d0a0ab41c53023055a242d66a437a2d}{bEndpointAddress}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03995}03995                 sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_a28e47e5ee9c2960324201a7f76453294}{ep\_configured}} \&= \string~(1U << epno);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03996}03996         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03997}03997         \mbox{\hyperlink{usb__core_8h_aadb0c32f6333b8a0715929ace5f550b2}{USB\_BUS\_UNLOCK}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03998}03998 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l03999}03999 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04000}04000 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04001}\mbox{\hyperlink{xhci_8c_aa6d079f9ceeab400c36df709e97e623a}{04001}} \mbox{\hyperlink{xhci_8c_aa6d079f9ceeab400c36df709e97e623a}{xhci\_ep\_uninit}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev, \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__endpoint}{usb\_endpoint}} *ep)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04002}04002 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04003}04003 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04004}04004 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04005}04005 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04006}04006 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04007}\mbox{\hyperlink{xhci_8c_a5618134255b74de75f7dba6cea745bbf}{04007}} \mbox{\hyperlink{xhci_8c_a5618134255b74de75f7dba6cea745bbf}{xhci\_ep\_clear\_stall}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev, \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__endpoint}{usb\_endpoint}} *ep)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04008}04008 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04009}04009         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__endpoint__ext}{xhci\_endpoint\_ext}} *pepext;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04010}04010 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04011}04011         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04012}04012 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04013}04013         \textcolor{keywordflow}{if} (udev-\/>\mbox{\hyperlink{structusb__device_ae7b27fdcae02d49bee5c2f0a9130b633}{flags}}.\mbox{\hyperlink{structusb__device__flags_ad686103f845c7d070e25fa7a26c34694}{usb\_mode}} != \mbox{\hyperlink{usb_8h_a9bc559812598988121896dceb483806ba1c7091216cfa9c9f4a252b0825ed32cb}{USB\_MODE\_HOST}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04014}04014                 \textcolor{comment}{/* not supported */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04015}04015                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04016}04016         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04017}04017         \textcolor{keywordflow}{if} (udev-\/>\mbox{\hyperlink{structusb__device_aa35d4d1b88f22abb34d30e9762153e0b}{parent\_hub}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04018}04018                 \textcolor{comment}{/* root HUB has special endpoint handling */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04019}04019                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04020}04020         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04021}04021 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04022}04022         pepext = \mbox{\hyperlink{xhci_8c_af1c3f8bc816768b3a290ad69aafa7af0}{xhci\_get\_endpoint\_ext}}(udev, ep-\/>\mbox{\hyperlink{structusb__endpoint_af3b96b9fe1e612b303833c2e2d0365e1}{edesc}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04023}04023 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04024}04024         \mbox{\hyperlink{usb__core_8h_a21dab1de8f52baf9fbf7617c6b1ec033}{USB\_BUS\_LOCK}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04025}04025         pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_a3e583572d83c2276b0cc995d08574f1d}{trb\_halted}} = 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04026}04026         pepext-\/>\mbox{\hyperlink{structxhci__endpoint__ext_ac3b4c115bbc8f9df3b922c27036ea47c}{trb\_running}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04027}04027         \mbox{\hyperlink{usb__core_8h_aadb0c32f6333b8a0715929ace5f550b2}{USB\_BUS\_UNLOCK}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04028}04028 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04029}04029 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04030}04030 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04031}\mbox{\hyperlink{xhci_8c_a3c786ec1fa80c0e2a32242c4a407c17c}{04031}} \mbox{\hyperlink{xhci_8c_a3c786ec1fa80c0e2a32242c4a407c17c}{xhci\_device\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04032}04032 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04033}04033         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04034}04034         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04035}04035         uint8\_t temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04036}04036 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04037}04037         \textcolor{comment}{/* no init for root HUB */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04038}04038         \textcolor{keywordflow}{if} (udev-\/>\mbox{\hyperlink{structusb__device_aa35d4d1b88f22abb34d30e9762153e0b}{parent\_hub}} == NULL)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04039}04039                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04040}04040 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04041}04041         \mbox{\hyperlink{xhci_8h_a8f5a32cd58a3c26992ea354dfe7b0956}{XHCI\_CMD\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04042}04042 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04043}04043         \textcolor{comment}{/* set invalid default */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04044}04044 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04045}04045         udev-\/>\mbox{\hyperlink{structusb__device_a9f275ef5fb35734f8174c9b01a855973}{controller\_slot\_id}} = sc-\/>\mbox{\hyperlink{structxhci__softc_a3f2b7f637e15b8e6f00eacfea6ab2c97}{sc\_noslot}} + 1;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04046}04046 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04047}04047         \textcolor{comment}{/* try to get a new slot ID from the XHCI */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04048}04048 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04049}04049         err = \mbox{\hyperlink{xhci_8c_a4b932ee0f04df09946cfd99dd76efc8c}{xhci\_cmd\_enable\_slot}}(sc, \&temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04050}04050 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04051}04051         \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04052}04052                 \mbox{\hyperlink{xhci_8h_a338ae22d11f2b1dbc1a2fc8b9ef50c8a}{XHCI\_CMD\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04053}04053                 \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04054}04054         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04055}04055 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04056}04056         \textcolor{keywordflow}{if} (temp > sc-\/>\mbox{\hyperlink{structxhci__softc_a3f2b7f637e15b8e6f00eacfea6ab2c97}{sc\_noslot}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04057}04057                 \mbox{\hyperlink{xhci_8h_a338ae22d11f2b1dbc1a2fc8b9ef50c8a}{XHCI\_CMD\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04058}04058                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a19bf8b26629f475d94ae7c0dbfaf26bd}{USB\_ERR\_BAD\_ADDRESS}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04059}04059         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04060}04060 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04061}04061         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[temp].\mbox{\hyperlink{structxhci__hw__dev_a7f2e54fe3e374be4e1d6bf9a39a5872d}{state}} != \mbox{\hyperlink{xhci_8h_a06fc87d81c62e9abb8790b6e5713c55ba1027dbb335ba8f565c2c55bbbb5ef770}{XHCI\_ST\_DISABLED}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04062}04062                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}slot \%u already allocated.\(\backslash\)n"{}}, temp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04063}04063                 \mbox{\hyperlink{xhci_8h_a338ae22d11f2b1dbc1a2fc8b9ef50c8a}{XHCI\_CMD\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04064}04064                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a19bf8b26629f475d94ae7c0dbfaf26bd}{USB\_ERR\_BAD\_ADDRESS}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04065}04065         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04066}04066 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04067}04067         \textcolor{comment}{/* store slot ID for later reference */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04068}04068 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04069}04069         udev-\/>\mbox{\hyperlink{structusb__device_a9f275ef5fb35734f8174c9b01a855973}{controller\_slot\_id}} = temp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04070}04070 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04071}04071         \textcolor{comment}{/* reset data structure */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04072}04072 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04073}04073         memset(\&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[temp], 0, \textcolor{keyword}{sizeof}(sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[0]));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04074}04074 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04075}04075         \textcolor{comment}{/* set mark slot allocated */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04076}04076 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04077}04077         sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[temp].\mbox{\hyperlink{structxhci__hw__dev_a7f2e54fe3e374be4e1d6bf9a39a5872d}{state}} = \mbox{\hyperlink{xhci_8h_a06fc87d81c62e9abb8790b6e5713c55bad10e3bda83ffdc25738f3a60bc6750dc}{XHCI\_ST\_ENABLED}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04078}04078 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04079}04079         err = \mbox{\hyperlink{xhci_8c_afafde0f0dc9a3884bd4793a3931424e8}{xhci\_alloc\_device\_ext}}(udev);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04080}04080 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04081}04081         \mbox{\hyperlink{xhci_8h_a338ae22d11f2b1dbc1a2fc8b9ef50c8a}{XHCI\_CMD\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04082}04082 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04083}04083         \textcolor{comment}{/* get device into default state */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04084}04084 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04085}04085         \textcolor{keywordflow}{if} (err == 0)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04086}04086                 err = \mbox{\hyperlink{xhci_8c_ab7465de65dd12d049b64457d366a78f6}{xhci\_set\_address}}(udev, NULL, 0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04087}04087 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04088}04088         \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04089}04089 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04090}04090 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04091}04091 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04092}\mbox{\hyperlink{xhci_8c_abcdd9b266c461e02aa8b03d00af2a9a0}{04092}} \mbox{\hyperlink{xhci_8c_abcdd9b266c461e02aa8b03d00af2a9a0}{xhci\_device\_uninit}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04093}04093 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04094}04094         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04095}04095         uint8\_t index;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04096}04096 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04097}04097         \textcolor{comment}{/* no init for root HUB */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04098}04098         \textcolor{keywordflow}{if} (udev-\/>\mbox{\hyperlink{structusb__device_aa35d4d1b88f22abb34d30e9762153e0b}{parent\_hub}} == NULL)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04099}04099                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04100}04100 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04101}04101         \mbox{\hyperlink{xhci_8h_a8f5a32cd58a3c26992ea354dfe7b0956}{XHCI\_CMD\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04102}04102 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04103}04103         index = udev-\/>\mbox{\hyperlink{structusb__device_a9f275ef5fb35734f8174c9b01a855973}{controller\_slot\_id}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04104}04104 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04105}04105         \textcolor{keywordflow}{if} (index <= sc-\/>\mbox{\hyperlink{structxhci__softc_a3f2b7f637e15b8e6f00eacfea6ab2c97}{sc\_noslot}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04106}04106                 \mbox{\hyperlink{xhci_8c_aa95cb7c051f87708cd47681e9c046b3f}{xhci\_cmd\_disable\_slot}}(sc, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04107}04107                 sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_a7f2e54fe3e374be4e1d6bf9a39a5872d}{state}} = \mbox{\hyperlink{xhci_8h_a06fc87d81c62e9abb8790b6e5713c55ba1027dbb335ba8f565c2c55bbbb5ef770}{XHCI\_ST\_DISABLED}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04108}04108 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04109}04109                 \textcolor{comment}{/* free device extension */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04110}04110                 \mbox{\hyperlink{xhci_8c_a4dc0e10a8aa2b401fa2d24ea6ce12e05}{xhci\_free\_device\_ext}}(udev);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04111}04111         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04112}04112 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04113}04113         \mbox{\hyperlink{xhci_8h_a338ae22d11f2b1dbc1a2fc8b9ef50c8a}{XHCI\_CMD\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04114}04114 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04115}04115 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04116}04116 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04117}\mbox{\hyperlink{xhci_8c_a466944ca2776152326c9dc7199a7d1a8}{04117}} \mbox{\hyperlink{xhci_8c_a466944ca2776152326c9dc7199a7d1a8}{xhci\_get\_dma\_delay}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev, uint32\_t *pus)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04118}04118 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04119}04119         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04120}04120 \textcolor{comment}{         * Wait until the hardware has finished any possible use of}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04121}04121 \textcolor{comment}{         * the transfer descriptor(s)}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04122}04122 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04123}04123         *pus = 2048;                    \textcolor{comment}{/* microseconds */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04124}04124 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04125}04125 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04126}04126 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04127}\mbox{\hyperlink{xhci_8c_aff25de50930dd0eb1c37b9bb3771e191}{04127}} \mbox{\hyperlink{xhci_8c_aff25de50930dd0eb1c37b9bb3771e191}{xhci\_device\_resume}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04128}04128 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04129}04129         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04130}04130         uint8\_t index;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04131}04131         uint8\_t \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04132}04132         uint8\_t p;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04133}04133 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04134}04134         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04135}04135 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04136}04136         \textcolor{comment}{/* check for root HUB */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04137}04137         \textcolor{keywordflow}{if} (udev-\/>\mbox{\hyperlink{structusb__device_aa35d4d1b88f22abb34d30e9762153e0b}{parent\_hub}} == NULL)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04138}04138                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04139}04139 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04140}04140         index = udev-\/>\mbox{\hyperlink{structusb__device_a9f275ef5fb35734f8174c9b01a855973}{controller\_slot\_id}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04141}04141 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04142}04142         \mbox{\hyperlink{xhci_8h_a8f5a32cd58a3c26992ea354dfe7b0956}{XHCI\_CMD\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04143}04143 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04144}04144         \textcolor{comment}{/* blindly resume all endpoints */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04145}04145 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04146}04146         \mbox{\hyperlink{usb__core_8h_a21dab1de8f52baf9fbf7617c6b1ec033}{USB\_BUS\_LOCK}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04147}04147 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04148}04148         \textcolor{keywordflow}{for} (\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} = 1; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} != \mbox{\hyperlink{xhci_8h_a1f646fdf1c9542e107d082158bcb1411}{XHCI\_MAX\_ENDPOINTS}}; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}++) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04149}04149                 \textcolor{keywordflow}{for} (p = 0; p != XHCI\_MAX\_STREAMS; p++) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04150}04150                         \mbox{\hyperlink{xhcireg_8h_a20ca65605ae6b2d03c8af13fd1014bad}{XWRITE4}}(sc, door, \mbox{\hyperlink{xhcireg_8h_a6b426074e34edc0a6aef5a1d32ac445b}{XHCI\_DOORBELL}}(index),}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04151}04151                             \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} | \mbox{\hyperlink{xhcireg_8h_acb878531e6b4ccaa0cb904370d8d2ab5}{XHCI\_DB\_SID\_SET}}(p));}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04152}04152                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04153}04153         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04154}04154 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04155}04155         \mbox{\hyperlink{usb__core_8h_aadb0c32f6333b8a0715929ace5f550b2}{USB\_BUS\_UNLOCK}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04156}04156 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04157}04157         \mbox{\hyperlink{xhci_8h_a338ae22d11f2b1dbc1a2fc8b9ef50c8a}{XHCI\_CMD\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04158}04158 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04159}04159 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04160}04160 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04161}\mbox{\hyperlink{xhci_8c_a0de612a6d4b8899179e2723ae3f76873}{04161}} \mbox{\hyperlink{xhci_8c_a0de612a6d4b8899179e2723ae3f76873}{xhci\_device\_suspend}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04162}04162 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04163}04163         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04164}04164         uint8\_t index;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04165}04165         uint8\_t \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04166}04166         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04167}04167 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04168}04168         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04169}04169 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04170}04170         \textcolor{comment}{/* check for root HUB */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04171}04171         \textcolor{keywordflow}{if} (udev-\/>\mbox{\hyperlink{structusb__device_aa35d4d1b88f22abb34d30e9762153e0b}{parent\_hub}} == NULL)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04172}04172                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04173}04173 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04174}04174         index = udev-\/>\mbox{\hyperlink{structusb__device_a9f275ef5fb35734f8174c9b01a855973}{controller\_slot\_id}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04175}04175 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04176}04176         \mbox{\hyperlink{xhci_8h_a8f5a32cd58a3c26992ea354dfe7b0956}{XHCI\_CMD\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04177}04177 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04178}04178         \textcolor{comment}{/* blindly suspend all endpoints */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04179}04179 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04180}04180         \textcolor{keywordflow}{for} (\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} = 1; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} != \mbox{\hyperlink{xhci_8h_a1f646fdf1c9542e107d082158bcb1411}{XHCI\_MAX\_ENDPOINTS}}; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}++) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04181}04181                 err = \mbox{\hyperlink{xhci_8c_a7b2c3df0830d4cd7171b2a6f4fe351f3}{xhci\_cmd\_stop\_ep}}(sc, 1, \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04182}04182                 \textcolor{keywordflow}{if} (err != 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04183}04183                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Failed to suspend endpoint "{}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04184}04184                             \textcolor{stringliteral}{"{}\%u on slot \%u (ignored).\(\backslash\)n"{}}, \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04185}04185                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04186}04186         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04187}04187 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04188}04188         \mbox{\hyperlink{xhci_8h_a338ae22d11f2b1dbc1a2fc8b9ef50c8a}{XHCI\_CMD\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04189}04189 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04190}04190 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04191}04191 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04192}\mbox{\hyperlink{xhci_8c_a4269ac05b00a0da508228b048dc82592}{04192}} \mbox{\hyperlink{xhci_8c_a4269ac05b00a0da508228b048dc82592}{xhci\_set\_hw\_power}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__bus}{usb\_bus}} *bus)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04193}04193 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04194}04194         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04195}04195 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04196}04196 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04197}04197 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04198}\mbox{\hyperlink{xhci_8c_a83a2f41372db7a485908f5636edd7446}{04198}} \mbox{\hyperlink{xhci_8c_a83a2f41372db7a485908f5636edd7446}{xhci\_device\_state\_change}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04199}04199 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04200}04200         \textcolor{keyword}{struct }\mbox{\hyperlink{structxhci__softc}{xhci\_softc}} *sc = \mbox{\hyperlink{xhci_8c_acb535a72b5ba6263fe97f7b32f548f7e}{XHCI\_BUS2SC}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04201}04201         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__search}{usb\_page\_search}} buf\_inp;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04202}04202         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04203}04203         uint8\_t index;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04204}04204 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04205}04205         \textcolor{comment}{/* check for root HUB */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04206}04206         \textcolor{keywordflow}{if} (udev-\/>\mbox{\hyperlink{structusb__device_aa35d4d1b88f22abb34d30e9762153e0b}{parent\_hub}} == NULL)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04207}04207                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04208}04208 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04209}04209         index = udev-\/>\mbox{\hyperlink{structusb__device_a9f275ef5fb35734f8174c9b01a855973}{controller\_slot\_id}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04210}04210 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04211}04211         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04212}04212 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04213}04213         \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__device_8c_aec1c751bb0d11f304158889d8cac1e3a}{usb\_get\_device\_state}}(udev) == \mbox{\hyperlink{usb_8h_a46de2594e26ca8923b051993c88ccf21a6566e87fb6d54f2da5b7564743df7a47}{USB\_STATE\_CONFIGURED}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04214}04214                 err = \mbox{\hyperlink{usb__hub_8c_ab365cfa90423fab2fcc36cfb1868eb6a}{uhub\_query\_info}}(udev, \&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_af258285183b81da3ce3f5a25acab4de6}{nports}}, }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04215}04215                     \&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_a96114fe8301fe31ef3ce2ec264e90ac2}{tt}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04216}04216                 \textcolor{keywordflow}{if} (err != 0)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04217}04217                         sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_af258285183b81da3ce3f5a25acab4de6}{nports}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04218}04218         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04219}04219 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04220}04220         \mbox{\hyperlink{xhci_8h_a8f5a32cd58a3c26992ea354dfe7b0956}{XHCI\_CMD\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04221}04221 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04222}04222         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usb__device_8c_aec1c751bb0d11f304158889d8cac1e3a}{usb\_get\_device\_state}}(udev)) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04223}04223         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a46de2594e26ca8923b051993c88ccf21a25b72bb35524040c703e9474ad03cf38}{USB\_STATE\_POWERED}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04224}04224                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_a7f2e54fe3e374be4e1d6bf9a39a5872d}{state}} == \mbox{\hyperlink{xhci_8h_a06fc87d81c62e9abb8790b6e5713c55bafc3382fbc4a702a9a5819ca84840d05f}{XHCI\_ST\_DEFAULT}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04225}04225                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04226}04226 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04227}04227                 \textcolor{comment}{/* set default state */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04228}04228                 sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_a7f2e54fe3e374be4e1d6bf9a39a5872d}{state}} = \mbox{\hyperlink{xhci_8h_a06fc87d81c62e9abb8790b6e5713c55bafc3382fbc4a702a9a5819ca84840d05f}{XHCI\_ST\_DEFAULT}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04229}04229                 sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_a28e47e5ee9c2960324201a7f76453294}{ep\_configured}} = 3U;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04230}04230 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04231}04231                 \textcolor{comment}{/* reset number of contexts */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04232}04232                 sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_ac58a50329968674eeb31b05b7d5a099f}{context\_num}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04233}04233 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04234}04234                 err = \mbox{\hyperlink{xhci_8c_ad369bf26b8730d48408bf25bf367f468}{xhci\_cmd\_reset\_dev}}(sc, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04235}04235 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04236}04236                 \textcolor{keywordflow}{if} (err != 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04237}04237                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Device reset failed "{}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04238}04238                             \textcolor{stringliteral}{"{}for slot \%u.\(\backslash\)n"{}}, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04239}04239                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04240}04240                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04241}04241 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04242}04242         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a46de2594e26ca8923b051993c88ccf21ad7f0841a21d3179c13f19d3ae8a8e3b6}{USB\_STATE\_ADDRESSED}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04243}04243                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_a7f2e54fe3e374be4e1d6bf9a39a5872d}{state}} == \mbox{\hyperlink{xhci_8h_a06fc87d81c62e9abb8790b6e5713c55ba771247684dda3a43baaf50c3ed07e0f4}{XHCI\_ST\_ADDRESSED}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04244}04244                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04245}04245 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04246}04246                 sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_a7f2e54fe3e374be4e1d6bf9a39a5872d}{state}} = \mbox{\hyperlink{xhci_8h_a06fc87d81c62e9abb8790b6e5713c55ba771247684dda3a43baaf50c3ed07e0f4}{XHCI\_ST\_ADDRESSED}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04247}04247                 sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_a28e47e5ee9c2960324201a7f76453294}{ep\_configured}} = 3U;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04248}04248 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04249}04249                 \textcolor{comment}{/* set configure mask to slot only */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04250}04250                 \mbox{\hyperlink{xhci_8c_a2b5fcb1981b6791181beb8c1f7710b10}{xhci\_configure\_mask}}(udev, 1, 0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04251}04251 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04252}04252                 \textcolor{comment}{/* deconfigure all endpoints, except EP0 */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04253}04253                 err = \mbox{\hyperlink{xhci_8c_a16bb129b4a583fc8ed747de71aee1f4e}{xhci\_cmd\_configure\_ep}}(sc, 0, 1, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04254}04254 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04255}04255                 \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04256}04256                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Failed to deconfigure "{}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04257}04257                             \textcolor{stringliteral}{"{}slot \%u.\(\backslash\)n"{}}, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04258}04258                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04259}04259                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04260}04260 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04261}04261         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a46de2594e26ca8923b051993c88ccf21a6566e87fb6d54f2da5b7564743df7a47}{USB\_STATE\_CONFIGURED}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04262}04262                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_a7f2e54fe3e374be4e1d6bf9a39a5872d}{state}} == \mbox{\hyperlink{xhci_8h_a06fc87d81c62e9abb8790b6e5713c55baf68357243ed3c040a43a9bb4acb2eed8}{XHCI\_ST\_CONFIGURED}}) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04263}04263                         \textcolor{comment}{/* deconfigure all endpoints, except EP0 */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04264}04264                         err = \mbox{\hyperlink{xhci_8c_a16bb129b4a583fc8ed747de71aee1f4e}{xhci\_cmd\_configure\_ep}}(sc, 0, 1, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04265}04265 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04266}04266                         \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04267}04267                                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Failed to deconfigure "{}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04268}04268                                     \textcolor{stringliteral}{"{}slot \%u.\(\backslash\)n"{}}, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04269}04269                         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04270}04270                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04271}04271 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04272}04272                 \textcolor{comment}{/* set configured state */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04273}04273                 sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_a7f2e54fe3e374be4e1d6bf9a39a5872d}{state}} = \mbox{\hyperlink{xhci_8h_a06fc87d81c62e9abb8790b6e5713c55baf68357243ed3c040a43a9bb4acb2eed8}{XHCI\_ST\_CONFIGURED}};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04274}04274                 sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_a28e47e5ee9c2960324201a7f76453294}{ep\_configured}} = 3U;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04275}04275 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04276}04276                 \textcolor{comment}{/* reset number of contexts */}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04277}04277                 sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_ac58a50329968674eeb31b05b7d5a099f}{context\_num}} = 0;}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04278}04278 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04279}04279                 \mbox{\hyperlink{usb__busdma_8c_ab4f9d07714be540b6d002b44b3716bb2}{usbd\_get\_page}}(\&sc-\/>\mbox{\hyperlink{structxhci__softc_abb29c43c866dc3e2a6ab1f5d95bace51}{sc\_hw}}.\mbox{\hyperlink{structxhci__hw__softc_a9921304ff892b298bc914dc832d2d524}{devs}}[index].\mbox{\hyperlink{structxhci__hw__dev_ac3b7a1fbfd567e6b9c3cdcbc58bcd40e}{input\_pc}}, 0, \&buf\_inp);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04280}04280 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04281}04281                 \mbox{\hyperlink{xhci_8c_a2b5fcb1981b6791181beb8c1f7710b10}{xhci\_configure\_mask}}(udev, 3, 0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04282}04282 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04283}04283                 err = \mbox{\hyperlink{xhci_8c_a3d9f016a4907ccb7c68fb3742c93a0c2}{xhci\_configure\_device}}(udev);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04284}04284                 \textcolor{keywordflow}{if} (err != 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04285}04285                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Could not configure device "{}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04286}04286                             \textcolor{stringliteral}{"{}at slot \%u.\(\backslash\)n"{}}, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04287}04287                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04288}04288 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04289}04289                 err = \mbox{\hyperlink{xhci_8c_ab64f4e8f1f9b93086b3453647cd7b8c4}{xhci\_cmd\_evaluate\_ctx}}(sc, buf\_inp.physaddr, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04290}04290                 \textcolor{keywordflow}{if} (err != 0) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04291}04291                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Could not evaluate device "{}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04292}04292                             \textcolor{stringliteral}{"{}context at slot \%u.\(\backslash\)n"{}}, index);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04293}04293                 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04294}04294                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04295}04295 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04296}04296         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04297}04297                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04298}04298         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04299}04299         \mbox{\hyperlink{xhci_8h_a338ae22d11f2b1dbc1a2fc8b9ef50c8a}{XHCI\_CMD\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04300}04300 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04301}04301 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04302}04302 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04303}\mbox{\hyperlink{xhci_8c_a8d266f9014eb7258f37b204b35dc03ed}{04303}} \mbox{\hyperlink{xhci_8c_a8d266f9014eb7258f37b204b35dc03ed}{xhci\_set\_endpoint\_mode}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev, \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__endpoint}{usb\_endpoint}} *ep,}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04304}04304     uint8\_t ep\_mode)}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04305}04305 \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04306}04306         \textcolor{keywordflow}{switch} (ep\_mode) \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04307}04307         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_aa37eb5438eb0251d10367fc72a76e2b8a2c6c87a8b2f969b4b79e01861720675e}{USB\_EP\_MODE\_DEFAULT}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04308}04308                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04309}04309         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_aa37eb5438eb0251d10367fc72a76e2b8a6517fbedeae183c025bdb38abc2f1733}{USB\_EP\_MODE\_STREAMS}}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04310}04310                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{xhci_8c_af1d95c2ebda02042f9804bb1d9601ac6}{xhcistreams}} == 0 || }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04311}04311                     (ep-\/>\mbox{\hyperlink{structusb__endpoint_af3b96b9fe1e612b303833c2e2d0365e1}{edesc}}-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_aff28dcc97802a405b31baccd33c2bf8f}{bmAttributes}} \& \mbox{\hyperlink{usb_8h_a8badd3504359a0aed83ac575a46a67b4}{UE\_XFERTYPE}}) != \mbox{\hyperlink{usb_8h_a25240fc009aa67bb7a2b635d2e9401e4}{UE\_BULK}} ||}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04312}04312                     udev-\/>\mbox{\hyperlink{structusb__device_a1fc02abd43bd33f295493ed23debd852}{speed}} != \mbox{\hyperlink{usb_8h_a97e7c882fa8cd21898173a29471616ffafeaa1573d94f4b3f0c4a4caa423eb81e}{USB\_SPEED\_SUPER}})}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04313}04313                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945ac568d752239d287fca75588222df1bdf}{USB\_ERR\_INVAL}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04314}04314                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04315}04315         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04316}04316                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945ac568d752239d287fca75588222df1bdf}{USB\_ERR\_INVAL}});}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04317}04317         \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04318}04318 \}}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04319}04319 }
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04320}04320 \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__bus__methods}{usb\_bus\_methods}} \mbox{\hyperlink{xhci_8c_a51381416e71fbaba56583085b8387582}{xhci\_bus\_methods}} = \{}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04321}04321         .\mbox{\hyperlink{structusb__bus__methods_ae9169cdc4fe46a61286ad14aa59c3a31}{endpoint\_init}} = \mbox{\hyperlink{xhci_8c_af5106e510b12b5e4b4c1a12ce1f1b9f6}{xhci\_ep\_init}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04322}04322         .endpoint\_uninit = \mbox{\hyperlink{xhci_8c_aa6d079f9ceeab400c36df709e97e623a}{xhci\_ep\_uninit}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04323}04323         .xfer\_setup = \mbox{\hyperlink{xhci_8c_aa4823f184a783811da904354c16cb118}{xhci\_xfer\_setup}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04324}04324         .xfer\_unsetup = \mbox{\hyperlink{xhci_8c_a75fb9bff5b49799b84bacd2dde5276ff}{xhci\_xfer\_unsetup}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04325}04325         .get\_dma\_delay = \mbox{\hyperlink{xhci_8c_a466944ca2776152326c9dc7199a7d1a8}{xhci\_get\_dma\_delay}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04326}04326         .device\_init = \mbox{\hyperlink{xhci_8c_a3c786ec1fa80c0e2a32242c4a407c17c}{xhci\_device\_init}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04327}04327         .device\_uninit = \mbox{\hyperlink{xhci_8c_abcdd9b266c461e02aa8b03d00af2a9a0}{xhci\_device\_uninit}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04328}04328         .device\_resume = \mbox{\hyperlink{xhci_8c_aff25de50930dd0eb1c37b9bb3771e191}{xhci\_device\_resume}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04329}04329         .device\_suspend = \mbox{\hyperlink{xhci_8c_a0de612a6d4b8899179e2723ae3f76873}{xhci\_device\_suspend}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04330}04330         .set\_hw\_power = \mbox{\hyperlink{xhci_8c_a4269ac05b00a0da508228b048dc82592}{xhci\_set\_hw\_power}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04331}04331         .roothub\_exec = \mbox{\hyperlink{xhci_8c_a74ae60ad1a285b243ab5c8553a9757c7}{xhci\_roothub\_exec}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04332}04332         .xfer\_poll = \mbox{\hyperlink{xhci_8c_aa22a4e89f235d46a713288b1f0dc0257}{xhci\_do\_poll}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04333}04333         .start\_dma\_delay = \mbox{\hyperlink{xhci_8c_af58185d9b997b5f617bd0ec3582dbe54}{xhci\_start\_dma\_delay}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04334}04334         .set\_address = \mbox{\hyperlink{xhci_8c_ab7465de65dd12d049b64457d366a78f6}{xhci\_set\_address}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04335}04335         .clear\_stall = \mbox{\hyperlink{xhci_8c_a5618134255b74de75f7dba6cea745bbf}{xhci\_ep\_clear\_stall}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04336}04336         .device\_state\_change = \mbox{\hyperlink{xhci_8c_a83a2f41372db7a485908f5636edd7446}{xhci\_device\_state\_change}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04337}04337         .set\_hw\_power\_sleep = \mbox{\hyperlink{xhci_8c_a4a434aa128f347b0f879c4067f7cb1c6}{xhci\_set\_hw\_power\_sleep}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04338}04338         .set\_endpoint\_mode = \mbox{\hyperlink{xhci_8c_a8d266f9014eb7258f37b204b35dc03ed}{xhci\_set\_endpoint\_mode}},}
\DoxyCodeLine{\Hypertarget{xhci_8c_source_l04339}04339 \};}

\end{DoxyCode}
