\hypertarget{usb__generic_8c_source}{}\doxysection{usb\+\_\+generic.\+c}
\label{usb__generic_8c_source}\index{dev/usb/usb\_generic.c@{dev/usb/usb\_generic.c}}
\mbox{\hyperlink{usb__generic_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00001}00001 \textcolor{comment}{/* \$FreeBSD\$ */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00002}00002 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00003}00003 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00004}00004 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 2008-\/2022 Hans Petter Selasky}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00007}00007 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00008}00008 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00009}00009 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00010}00010 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00011}00011 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00012}00012 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00013}00013 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00014}00014 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00015}00015 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00016}00016 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00017}00017 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00018}00018 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00019}00019 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00020}00020 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00021}00021 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00022}00022 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00023}00023 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00024}00024 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00025}00025 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00026}00026 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00027}00027 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00028}00028 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00029}00029 \textcolor{preprocessor}{\#ifdef USB\_GLOBAL\_INCLUDE\_FILE}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00030}00030 \textcolor{preprocessor}{\#include USB\_GLOBAL\_INCLUDE\_FILE}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00031}00031 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00032}00032 \textcolor{preprocessor}{\#ifdef COMPAT\_FREEBSD32}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/abi\_compat.h>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00034}00034 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/stdint.h>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/stddef.h>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/types.h>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <sys/condvar.h>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <sys/sx.h>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <sys/unistd.h>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <sys/callout.h>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00052}00052 \textcolor{preprocessor}{\#include <sys/priv.h>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <sys/conf.h>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00054}00054 \textcolor{preprocessor}{\#include <sys/fcntl.h>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00055}00055 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00056}00056 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb_8h}{dev/usb/usb.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00057}00057 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__ioctl_8h}{dev/usb/usb\_ioctl.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00058}00058 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usbdi_8h}{dev/usb/usbdi.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00059}00059 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usbdi__util_8h}{dev/usb/usbdi\_util.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00060}00060 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00061}\mbox{\hyperlink{usb__generic_8c_a927dd6f59caf10a2991dfb564bcbb1e1}{00061}} \textcolor{preprocessor}{\#define USB\_DEBUG\_VAR ugen\_debug}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00062}00062 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00063}00063 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__core_8h}{dev/usb/usb\_core.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00064}00064 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__dev_8h}{dev/usb/usb\_dev.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00065}00065 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__mbuf_8h}{dev/usb/usb\_mbuf.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00066}00066 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__process_8h}{dev/usb/usb\_process.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00067}00067 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__device_8h}{dev/usb/usb\_device.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00068}00068 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__debug_8h}{dev/usb/usb\_debug.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00069}00069 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__request_8h}{dev/usb/usb\_request.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00070}00070 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__busdma_8h}{dev/usb/usb\_busdma.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00071}00071 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__util_8h}{dev/usb/usb\_util.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00072}00072 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__hub_8h}{dev/usb/usb\_hub.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00073}00073 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__generic_8h}{dev/usb/usb\_generic.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00074}00074 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__transfer_8h}{dev/usb/usb\_transfer.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00075}00075 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00076}00076 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__controller_8h}{dev/usb/usb\_controller.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00077}00077 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__bus_8h}{dev/usb/usb\_bus.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00078}00078 \textcolor{preprocessor}{\#endif                  }\textcolor{comment}{/* USB\_GLOBAL\_INCLUDE\_FILE */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00079}00079 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00080}00080 \textcolor{preprocessor}{\#if USB\_HAVE\_UGEN}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00081}00081 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00082}00082 \textcolor{comment}{/* defines */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00083}00083 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00084}00084 \textcolor{preprocessor}{\#define UGEN\_BULK\_FS\_BUFFER\_SIZE        (64*32) }\textcolor{comment}{/* bytes */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00085}00085 \textcolor{preprocessor}{\#define UGEN\_BULK\_HS\_BUFFER\_SIZE        (1024*32)       }\textcolor{comment}{/* bytes */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00086}00086 \textcolor{preprocessor}{\#define UGEN\_HW\_FRAMES  50              }\textcolor{comment}{/* number of milliseconds per transfer */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00087}00087 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00088}00088 \textcolor{comment}{/* function prototypes */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00089}00089 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00090}00090 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} ugen\_read\_clear\_stall\_callback;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00091}00091 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} ugen\_write\_clear\_stall\_callback;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00092}00092 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} ugen\_ctrl\_read\_callback;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00093}00093 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} ugen\_ctrl\_write\_callback;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00094}00094 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} ugen\_isoc\_read\_callback;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00095}00095 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} ugen\_isoc\_write\_callback;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00096}00096 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} ugen\_ctrl\_fs\_callback;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00097}00097 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00098}00098 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_abf627b9df5961890963bce30a2cf9e1d}{usb\_fifo\_open\_t}} ugen\_open;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00099}00099 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a1f11bee0038616aab627d2eb67a544b5}{usb\_fifo\_close\_t}} ugen\_close;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00100}00100 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a1216ed6c6a9a63cba57811e6fe1f7fea}{usb\_fifo\_ioctl\_t}} ugen\_ioctl;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00101}00101 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a1216ed6c6a9a63cba57811e6fe1f7fea}{usb\_fifo\_ioctl\_t}} ugen\_ioctl\_post;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00102}00102 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a615dd3e847b9bb98800455c172df26a7}{usb\_fifo\_cmd\_t}} ugen\_start\_read;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00103}00103 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a615dd3e847b9bb98800455c172df26a7}{usb\_fifo\_cmd\_t}} ugen\_start\_write;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00104}00104 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a615dd3e847b9bb98800455c172df26a7}{usb\_fifo\_cmd\_t}} ugen\_stop\_io;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00105}00105 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00106}00106 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      ugen\_transfer\_setup(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00107}00107                      \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__config}{usb\_config}} *, uint8\_t);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00108}00108 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      ugen\_open\_pipe\_write(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00109}00109 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      ugen\_open\_pipe\_read(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00110}00110 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      ugen\_set\_config(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *, uint8\_t);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00111}00111 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      ugen\_set\_interface(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *, uint8\_t, uint8\_t);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00112}00112 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      ugen\_get\_cdesc(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__gen__descriptor}{usb\_gen\_descriptor}} *);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00113}00113 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      ugen\_get\_sdesc(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__gen__descriptor}{usb\_gen\_descriptor}} *);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00114}00114 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      ugen\_get\_iface\_driver(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__gen__descriptor}{usb\_gen\_descriptor}} *ugd);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00115}00115 \textcolor{preprocessor}{\#ifdef COMPAT\_FREEBSD32}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00116}00116 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      ugen\_get32(u\_long cmd, \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, \textcolor{keyword}{struct} usb\_gen\_descriptor32 *ugd32);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00117}00117 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00118}00118 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      ugen\_re\_enumerate(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00119}00119 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      ugen\_iface\_ioctl(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *, u\_long, \textcolor{keywordtype}{void} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00120}00120 \textcolor{keyword}{static} uint8\_t  ugen\_fs\_get\_complete(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *, uint8\_t *);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00121}00121 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      ugen\_fs\_uninit(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00122}00122 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      ugen\_fs\_copyin(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *, uint8\_t, \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fs__endpoint}{usb\_fs\_endpoint}}*);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00123}00123 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00124}00124 \textcolor{comment}{/* structures */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00125}00125 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00126}00126 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fifo__methods}{usb\_fifo\_methods}} \mbox{\hyperlink{usb__generic_8h_a35ff03e21c934cd335e03d14a29eb9a3}{usb\_ugen\_methods}} = \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00127}00127         .\mbox{\hyperlink{structusb__fifo__methods_ab412e16bde144a591c8ca291876506a2}{f\_open}} = \&ugen\_open,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00128}00128         .f\_close = \&ugen\_close,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00129}00129         .f\_ioctl = \&ugen\_ioctl,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00130}00130         .f\_ioctl\_post = \&ugen\_ioctl\_post,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00131}00131         .f\_start\_read = \&ugen\_start\_read,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00132}00132         .f\_stop\_read = \&ugen\_stop\_io,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00133}00133         .f\_start\_write = \&ugen\_start\_write,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00134}00134         .f\_stop\_write = \&ugen\_stop\_io,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00135}00135 \};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00136}00136 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00137}00137 \textcolor{preprocessor}{\#ifdef USB\_DEBUG}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00138}00138 \textcolor{keyword}{static} \textcolor{keywordtype}{int} ugen\_debug = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00139}00139 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00140}00140 \textcolor{keyword}{static} \mbox{\hyperlink{dwc__otg_8c_a58e125bcf985ce2333baef42f97b33b3}{SYSCTL\_NODE}}(\_hw\_usb, OID\_AUTO, ugen, CTLFLAG\_RW | CTLFLAG\_MPSAFE, 0,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00141}00141     \textcolor{stringliteral}{"{}USB generic"{}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00142}00142 \mbox{\hyperlink{dwc__otg_8c_a83d020f0b15dc2783f3f1a6966c75e36}{SYSCTL\_INT}}(\_hw\_usb\_ugen, OID\_AUTO, \mbox{\hyperlink{cfumass_8c_ac3e1795766a80ec63b157951b4b9a7d4}{debug}}, CTLFLAG\_RWTUN, \&ugen\_debug,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00143}00143     0, \textcolor{stringliteral}{"{}Debug level"{}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00144}00144 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00145}00145 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00146}00146 \textcolor{comment}{/* prototypes */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00147}00147 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00148}00148 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00149}00149 ugen\_transfer\_setup(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00150}00150     \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__config}{usb\_config}} *setup, uint8\_t n\_setup)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00151}00151 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00152}00152         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__endpoint}{usb\_endpoint}} *ep = \mbox{\hyperlink{usbdi_8h_a1686d97012d48512200abd8ad0d86d1e}{usb\_fifo\_softc}}(f);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00153}00153         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device}{usb\_device}} *udev = f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00154}00154         uint8\_t iface\_index = ep-\/>\mbox{\hyperlink{structusb__endpoint_a580fcd46d189c26accb301203a97bf43}{iface\_index}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00155}00155         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00156}00156 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00157}00157         mtx\_unlock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00158}00158 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00159}00159         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00160}00160 \textcolor{comment}{         * "{}usbd\_transfer\_setup()"{} can sleep so one needs to make a wrapper,}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00161}00161 \textcolor{comment}{         * exiting the mutex and checking things}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00162}00162 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00163}00163         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usb__transfer_8c_a7494c04fae5c5e7ef1af436308670a21}{usbd\_transfer\_setup}}(udev, \&iface\_index, f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}},}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00164}00164             setup, n\_setup, f, f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00165}00165         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} == 0) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00166}00166                 \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[0]-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}} == 1) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00167}00167                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usbdi_8h_a05da54c8f6953ece429c6bb534ef9677}{usb\_fifo\_alloc\_buffer}}(f,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00168}00168                             f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[0]-\/>\mbox{\hyperlink{structusb__xfer_a3ece1de738e7c3ca20f0bfdbd827fd16}{max\_data\_length}}, 2);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00169}00169                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00170}00170                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usbdi_8h_a05da54c8f6953ece429c6bb534ef9677}{usb\_fifo\_alloc\_buffer}}(f,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00171}00171                             f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[0]-\/>\mbox{\hyperlink{structusb__xfer_ae115ce000f084f7d5f8c005fa88d2703}{max\_frame\_size}},}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00172}00172                             2 * f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[0]-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00173}00173                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00174}00174                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00175}00175                         \mbox{\hyperlink{usb__transfer_8c_a2f5ab55bfe7f356bb7a7505ff35c9741}{usbd\_transfer\_unsetup}}(f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}, n\_setup);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00176}00176                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00177}00177         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00178}00178         mtx\_lock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00179}00179 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00180}00180         \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00181}00181 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00182}00182 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00183}00183 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00184}00184 ugen\_open(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, \textcolor{keywordtype}{int} fflags)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00185}00185 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00186}00186         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__endpoint}{usb\_endpoint}} *ep = \mbox{\hyperlink{usbdi_8h_a1686d97012d48512200abd8ad0d86d1e}{usb\_fifo\_softc}}(f);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00187}00187         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__endpoint__descriptor}{usb\_endpoint\_descriptor}} *ed = ep-\/>\mbox{\hyperlink{structusb__endpoint_af3b96b9fe1e612b303833c2e2d0365e1}{edesc}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00188}00188         uint8\_t type;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00189}00189 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00190}00190         DPRINTFN(1, \textcolor{stringliteral}{"{}flag=0x\%x pid=\%d name=\%s\(\backslash\)n"{}}, fflags,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00191}00191             curthread-\/>td\_proc-\/>p\_pid, curthread-\/>td\_proc-\/>p\_comm);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00192}00192 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00193}00193         mtx\_lock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00194}00194         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usb__device_8c_a7aed6ff31c86f304cb29317095a0de1c}{usbd\_get\_speed}}(f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}})) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00195}00195         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a97e7c882fa8cd21898173a29471616ffa0ec4f8f66feaf7ee8f2ee618302e9470}{USB\_SPEED\_LOW}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00196}00196         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a97e7c882fa8cd21898173a29471616ffa0f17d0b9928086c6114fea73e08f1780}{USB\_SPEED\_FULL}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00197}00197                 f-\/>\mbox{\hyperlink{structusb__fifo_afb03048ea6c427d3c1c356cc3c34cc8c}{nframes}} = UGEN\_HW\_FRAMES;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00198}00198                 f-\/>\mbox{\hyperlink{structusb__fifo_a6f41b257bf5b7a4ff66dde269f24aac5}{bufsize}} = UGEN\_BULK\_FS\_BUFFER\_SIZE;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00199}00199                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00200}00200         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00201}00201                 f-\/>\mbox{\hyperlink{structusb__fifo_afb03048ea6c427d3c1c356cc3c34cc8c}{nframes}} = UGEN\_HW\_FRAMES * 8;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00202}00202                 f-\/>\mbox{\hyperlink{structusb__fifo_a6f41b257bf5b7a4ff66dde269f24aac5}{bufsize}} = UGEN\_BULK\_HS\_BUFFER\_SIZE;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00203}00203                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00204}00204         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00205}00205 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00206}00206         type = ed-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_aff28dcc97802a405b31baccd33c2bf8f}{bmAttributes}} \& \mbox{\hyperlink{usb_8h_a8badd3504359a0aed83ac575a46a67b4}{UE\_XFERTYPE}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00207}00207         \textcolor{keywordflow}{if} (type == \mbox{\hyperlink{usb_8h_a01e28e87ad16f6dfffefc6ccab08baed}{UE\_INTERRUPT}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00208}00208                 f-\/>\mbox{\hyperlink{structusb__fifo_a6f41b257bf5b7a4ff66dde269f24aac5}{bufsize}} = 0;          \textcolor{comment}{/* use "{}wMaxPacketSize"{} */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00209}00209         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00210}00210         f-\/>\mbox{\hyperlink{structusb__fifo_aa384f6ccccf0b7fb3700db928bcc737e}{timeout}} = \mbox{\hyperlink{usbdi_8h_aaa4cd217c436ddac03af845241887ddf}{USB\_NO\_TIMEOUT}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00211}00211         f-\/>\mbox{\hyperlink{structusb__fifo_a32b5344167da15bf3f21c4fdff73dc31}{flag\_short}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00212}00212         f-\/>\mbox{\hyperlink{structusb__fifo_ae5300af41530ade103a1b017d63cbf31}{fifo\_zlp}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00213}00213         mtx\_unlock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00214}00214 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00215}00215         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00216}00216 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00217}00217 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00218}00218 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00219}00219 ugen\_close(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, \textcolor{keywordtype}{int} fflags)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00220}00220 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00221}00221 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00222}00222         DPRINTFN(1, \textcolor{stringliteral}{"{}flag=0x\%x pid=\%d name=\%s\(\backslash\)n"{}}, fflags,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00223}00223             curthread-\/>td\_proc-\/>p\_pid, curthread-\/>td\_proc-\/>p\_comm);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00224}00224 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00225}00225         \textcolor{comment}{/* cleanup */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00226}00226 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00227}00227         mtx\_lock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00228}00228         \mbox{\hyperlink{usb__transfer_8c_abe245d973df0cfd6fb96b884d33ebce3}{usbd\_transfer\_stop}}(f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[0]);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00229}00229         \mbox{\hyperlink{usb__transfer_8c_abe245d973df0cfd6fb96b884d33ebce3}{usbd\_transfer\_stop}}(f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[1]);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00230}00230         mtx\_unlock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00231}00231 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00232}00232         \mbox{\hyperlink{usb__transfer_8c_a2f5ab55bfe7f356bb7a7505ff35c9741}{usbd\_transfer\_unsetup}}(f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}, 2);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00233}00233         \mbox{\hyperlink{usbdi_8h_a6434b2c65d370a12bdd87cec8863f1ff}{usb\_fifo\_free\_buffer}}(f);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00234}00234 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00235}00235         \textcolor{keywordflow}{if} (ugen\_fs\_uninit(f)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00236}00236                 \textcolor{comment}{/* ignore any errors -\/ we are closing */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00237}00237                 DPRINTFN(6, \textcolor{stringliteral}{"{}no FIFOs\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00238}00238         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00239}00239 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00240}00240 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00241}00241 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00242}00242 ugen\_open\_pipe\_write(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00243}00243 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00244}00244         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__config}{usb\_config}} \mbox{\hyperlink{structusb__config}{usb\_config}}[2];}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00245}00245         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__endpoint}{usb\_endpoint}} *ep = \mbox{\hyperlink{usbdi_8h_a1686d97012d48512200abd8ad0d86d1e}{usb\_fifo\_softc}}(f);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00246}00246         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__endpoint__descriptor}{usb\_endpoint\_descriptor}} *ed = ep-\/>\mbox{\hyperlink{structusb__endpoint_af3b96b9fe1e612b303833c2e2d0365e1}{edesc}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00247}00247 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00248}00248         \mbox{\hyperlink{usbdi_8h_a107993503e7d0b7e1178eddef27e57a9}{USB\_MTX\_ASSERT}}(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}}, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00249}00249 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00250}00250         \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[0] || f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[1]) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00251}00251                 \textcolor{comment}{/* transfers are already opened */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00252}00252                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00253}00253         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00254}00254         memset(\mbox{\hyperlink{structusb__config}{usb\_config}}, 0, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{structusb__config}{usb\_config}}));}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00255}00255 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00256}00256         \mbox{\hyperlink{structusb__config}{usb\_config}}[1].\mbox{\hyperlink{structusb__config_a5bd5d569870291a54d9bed8377ed8b10}{type}} = \mbox{\hyperlink{usb_8h_ace49b7adb24ebcb0a0b17110c26aa63a}{UE\_CONTROL}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00257}00257         \mbox{\hyperlink{structusb__config}{usb\_config}}[1].\mbox{\hyperlink{structusb__config_a81074abe7ded5be9dabdf9bcfed79317}{endpoint}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00258}00258         \mbox{\hyperlink{structusb__config}{usb\_config}}[1].\mbox{\hyperlink{structusb__config_a7df71cda1db402b095c2eab34e28feab}{direction}} = \mbox{\hyperlink{usb_8h_a0b305068483ac39f5d34f848bcb95c11}{UE\_DIR\_ANY}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00259}00259         \mbox{\hyperlink{structusb__config}{usb\_config}}[1].\mbox{\hyperlink{structusb__config_a80178ca6c609b484f4cd441928940d16}{timeout}} = 1000;  \textcolor{comment}{/* 1 second */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00260}00260         \mbox{\hyperlink{structusb__config}{usb\_config}}[1].\mbox{\hyperlink{structusb__config_adb5ccd473bd3b92d01d005c8faed656d}{interval}} = 50;\textcolor{comment}{/* 50 milliseconds */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00261}00261         \mbox{\hyperlink{structusb__config}{usb\_config}}[1].\mbox{\hyperlink{structusb__config_a730af89f830066662eac76401fc037ff}{bufsize}} = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00262}00262         \mbox{\hyperlink{structusb__config}{usb\_config}}[1].\mbox{\hyperlink{structusb__config_ad6cf53d455b808964f881c91074d2696}{callback}} = \&ugen\_write\_clear\_stall\_callback;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00263}00263         \mbox{\hyperlink{structusb__config}{usb\_config}}[1].\mbox{\hyperlink{structusb__config_a45b9e9ae72187e9854d90fbf8542c2ce}{usb\_mode}} = \mbox{\hyperlink{usb_8h_a9bc559812598988121896dceb483806ba1c7091216cfa9c9f4a252b0825ed32cb}{USB\_MODE\_HOST}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00264}00264 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00265}00265         \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a5bd5d569870291a54d9bed8377ed8b10}{type}} = ed-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_aff28dcc97802a405b31baccd33c2bf8f}{bmAttributes}} \& \mbox{\hyperlink{usb_8h_a8badd3504359a0aed83ac575a46a67b4}{UE\_XFERTYPE}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00266}00266         \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a81074abe7ded5be9dabdf9bcfed79317}{endpoint}} = ed-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_a3d0a0ab41c53023055a242d66a437a2d}{bEndpointAddress}} \& \mbox{\hyperlink{usb_8h_a227db1f194f105a22faae81401d3e18e}{UE\_ADDR}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00267}00267         \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a4129bd12510d8e621af9edf9468e6872}{stream\_id}} = 0; \textcolor{comment}{/* XXX support more stream ID's */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00268}00268         \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a7df71cda1db402b095c2eab34e28feab}{direction}} = \mbox{\hyperlink{usb_8h_aba70c1d0c8b6a6cd3452b304d9a981ba}{UE\_DIR\_TX}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00269}00269         \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_adb5ccd473bd3b92d01d005c8faed656d}{interval}} = \mbox{\hyperlink{usbdi_8h_a230a796257ac99a7977a90c4fc9e1c09}{USB\_DEFAULT\_INTERVAL}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00270}00270         \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a0e7feb3ff903ed490f21c1e5b128fc71}{flags}}.\mbox{\hyperlink{structusb__xfer__flags_a0654b9d81007fe4e04eca967e546c4c0}{proxy\_buffer}} = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00271}00271         \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a45b9e9ae72187e9854d90fbf8542c2ce}{usb\_mode}} = \mbox{\hyperlink{usb_8h_a9bc559812598988121896dceb483806ba19aff234971ad0a6d11fe4be56176106}{USB\_MODE\_DUAL}};  \textcolor{comment}{/* both modes */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00272}00272 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00273}00273         \textcolor{keywordflow}{switch} (ed-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_aff28dcc97802a405b31baccd33c2bf8f}{bmAttributes}} \& \mbox{\hyperlink{usb_8h_a8badd3504359a0aed83ac575a46a67b4}{UE\_XFERTYPE}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00274}00274         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a01e28e87ad16f6dfffefc6ccab08baed}{UE\_INTERRUPT}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00275}00275         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a25240fc009aa67bb7a2b635d2e9401e4}{UE\_BULK}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00276}00276                 \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_a32b5344167da15bf3f21c4fdff73dc31}{flag\_short}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00277}00277                         \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a0e7feb3ff903ed490f21c1e5b128fc71}{flags}}.\mbox{\hyperlink{structusb__xfer__flags_a76816b701c58c22a9a78904b109c2e95}{force\_short\_xfer}} = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00278}00278                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00279}00279                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_ad6cf53d455b808964f881c91074d2696}{callback}} = \&ugen\_ctrl\_write\_callback;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00280}00280                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a80178ca6c609b484f4cd441928940d16}{timeout}} = f-\/>\mbox{\hyperlink{structusb__fifo_aa384f6ccccf0b7fb3700db928bcc737e}{timeout}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00281}00281                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a54ec61088238cb0e3128eecd279aa7f0}{frames}} = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00282}00282                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a730af89f830066662eac76401fc037ff}{bufsize}} = f-\/>\mbox{\hyperlink{structusb__fifo_a6f41b257bf5b7a4ff66dde269f24aac5}{bufsize}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00283}00283                 \textcolor{keywordflow}{if} (ugen\_transfer\_setup(f, \mbox{\hyperlink{structusb__config}{usb\_config}}, 2)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00284}00284                         \textcolor{keywordflow}{return} (EIO);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00285}00285                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00286}00286                 \textcolor{comment}{/* first transfer does not clear stall */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00287}00287                 f-\/>\mbox{\hyperlink{structusb__fifo_a70058c5fdf3bb4fa4e9bdfe26ba5c2f7}{flag\_stall}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00288}00288                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00289}00289 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00290}00290         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_aecbab40f64cd5ffe365b73f7360ea2a3}{UE\_ISOCHRONOUS}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00291}00291                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a0e7feb3ff903ed490f21c1e5b128fc71}{flags}}.\mbox{\hyperlink{structusb__xfer__flags_a295c379f07c6ff99b213195edc70e3a2}{short\_xfer\_ok}} = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00292}00292                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a730af89f830066662eac76401fc037ff}{bufsize}} = 0;     \textcolor{comment}{/* use default */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00293}00293                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a54ec61088238cb0e3128eecd279aa7f0}{frames}} = f-\/>\mbox{\hyperlink{structusb__fifo_afb03048ea6c427d3c1c356cc3c34cc8c}{nframes}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00294}00294                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_ad6cf53d455b808964f881c91074d2696}{callback}} = \&ugen\_isoc\_write\_callback;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00295}00295                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a80178ca6c609b484f4cd441928940d16}{timeout}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00296}00296 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00297}00297                 \textcolor{comment}{/* clone configuration */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00298}00298                 \mbox{\hyperlink{structusb__config}{usb\_config}}[1] = \mbox{\hyperlink{structusb__config}{usb\_config}}[0];}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00299}00299 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00300}00300                 \textcolor{keywordflow}{if} (ugen\_transfer\_setup(f, \mbox{\hyperlink{structusb__config}{usb\_config}}, 2)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00301}00301                         \textcolor{keywordflow}{return} (EIO);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00302}00302                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00303}00303                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00304}00304         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00305}00305                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00306}00306         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00307}00307         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00308}00308 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00309}00309 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00310}00310 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00311}00311 ugen\_open\_pipe\_read(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00312}00312 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00313}00313         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__config}{usb\_config}} \mbox{\hyperlink{structusb__config}{usb\_config}}[2];}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00314}00314         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__endpoint}{usb\_endpoint}} *ep = \mbox{\hyperlink{usbdi_8h_a1686d97012d48512200abd8ad0d86d1e}{usb\_fifo\_softc}}(f);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00315}00315         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__endpoint__descriptor}{usb\_endpoint\_descriptor}} *ed = ep-\/>\mbox{\hyperlink{structusb__endpoint_af3b96b9fe1e612b303833c2e2d0365e1}{edesc}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00316}00316 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00317}00317         \mbox{\hyperlink{usbdi_8h_a107993503e7d0b7e1178eddef27e57a9}{USB\_MTX\_ASSERT}}(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}}, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00318}00318 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00319}00319         \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[0] || f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[1]) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00320}00320                 \textcolor{comment}{/* transfers are already opened */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00321}00321                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00322}00322         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00323}00323         memset(\mbox{\hyperlink{structusb__config}{usb\_config}}, 0, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{structusb__config}{usb\_config}}));}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00324}00324 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00325}00325         \mbox{\hyperlink{structusb__config}{usb\_config}}[1].\mbox{\hyperlink{structusb__config_a5bd5d569870291a54d9bed8377ed8b10}{type}} = \mbox{\hyperlink{usb_8h_ace49b7adb24ebcb0a0b17110c26aa63a}{UE\_CONTROL}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00326}00326         \mbox{\hyperlink{structusb__config}{usb\_config}}[1].\mbox{\hyperlink{structusb__config_a81074abe7ded5be9dabdf9bcfed79317}{endpoint}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00327}00327         \mbox{\hyperlink{structusb__config}{usb\_config}}[1].\mbox{\hyperlink{structusb__config_a7df71cda1db402b095c2eab34e28feab}{direction}} = \mbox{\hyperlink{usb_8h_a0b305068483ac39f5d34f848bcb95c11}{UE\_DIR\_ANY}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00328}00328         \mbox{\hyperlink{structusb__config}{usb\_config}}[1].\mbox{\hyperlink{structusb__config_a80178ca6c609b484f4cd441928940d16}{timeout}} = 1000;  \textcolor{comment}{/* 1 second */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00329}00329         \mbox{\hyperlink{structusb__config}{usb\_config}}[1].\mbox{\hyperlink{structusb__config_adb5ccd473bd3b92d01d005c8faed656d}{interval}} = 50;\textcolor{comment}{/* 50 milliseconds */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00330}00330         \mbox{\hyperlink{structusb__config}{usb\_config}}[1].\mbox{\hyperlink{structusb__config_a730af89f830066662eac76401fc037ff}{bufsize}} = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00331}00331         \mbox{\hyperlink{structusb__config}{usb\_config}}[1].\mbox{\hyperlink{structusb__config_ad6cf53d455b808964f881c91074d2696}{callback}} = \&ugen\_read\_clear\_stall\_callback;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00332}00332         \mbox{\hyperlink{structusb__config}{usb\_config}}[1].\mbox{\hyperlink{structusb__config_a45b9e9ae72187e9854d90fbf8542c2ce}{usb\_mode}} = \mbox{\hyperlink{usb_8h_a9bc559812598988121896dceb483806ba1c7091216cfa9c9f4a252b0825ed32cb}{USB\_MODE\_HOST}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00333}00333 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00334}00334         \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a5bd5d569870291a54d9bed8377ed8b10}{type}} = ed-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_aff28dcc97802a405b31baccd33c2bf8f}{bmAttributes}} \& \mbox{\hyperlink{usb_8h_a8badd3504359a0aed83ac575a46a67b4}{UE\_XFERTYPE}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00335}00335         \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a81074abe7ded5be9dabdf9bcfed79317}{endpoint}} = ed-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_a3d0a0ab41c53023055a242d66a437a2d}{bEndpointAddress}} \& \mbox{\hyperlink{usb_8h_a227db1f194f105a22faae81401d3e18e}{UE\_ADDR}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00336}00336         \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a4129bd12510d8e621af9edf9468e6872}{stream\_id}} = 0; \textcolor{comment}{/* XXX support more stream ID's */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00337}00337         \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a7df71cda1db402b095c2eab34e28feab}{direction}} = \mbox{\hyperlink{usb_8h_a6e0258e8570573ddabdd296569db720e}{UE\_DIR\_RX}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00338}00338         \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_adb5ccd473bd3b92d01d005c8faed656d}{interval}} = \mbox{\hyperlink{usbdi_8h_a230a796257ac99a7977a90c4fc9e1c09}{USB\_DEFAULT\_INTERVAL}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00339}00339         \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a0e7feb3ff903ed490f21c1e5b128fc71}{flags}}.\mbox{\hyperlink{structusb__xfer__flags_a0654b9d81007fe4e04eca967e546c4c0}{proxy\_buffer}} = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00340}00340         \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a45b9e9ae72187e9854d90fbf8542c2ce}{usb\_mode}} = \mbox{\hyperlink{usb_8h_a9bc559812598988121896dceb483806ba19aff234971ad0a6d11fe4be56176106}{USB\_MODE\_DUAL}};  \textcolor{comment}{/* both modes */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00341}00341 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00342}00342         \textcolor{keywordflow}{switch} (ed-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_aff28dcc97802a405b31baccd33c2bf8f}{bmAttributes}} \& \mbox{\hyperlink{usb_8h_a8badd3504359a0aed83ac575a46a67b4}{UE\_XFERTYPE}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00343}00343         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a01e28e87ad16f6dfffefc6ccab08baed}{UE\_INTERRUPT}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00344}00344         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a25240fc009aa67bb7a2b635d2e9401e4}{UE\_BULK}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00345}00345                 \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_a32b5344167da15bf3f21c4fdff73dc31}{flag\_short}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00346}00346                         \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a0e7feb3ff903ed490f21c1e5b128fc71}{flags}}.\mbox{\hyperlink{structusb__xfer__flags_a295c379f07c6ff99b213195edc70e3a2}{short\_xfer\_ok}} = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00347}00347                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00348}00348                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a80178ca6c609b484f4cd441928940d16}{timeout}} = f-\/>\mbox{\hyperlink{structusb__fifo_aa384f6ccccf0b7fb3700db928bcc737e}{timeout}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00349}00349                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a54ec61088238cb0e3128eecd279aa7f0}{frames}} = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00350}00350                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_ad6cf53d455b808964f881c91074d2696}{callback}} = \&ugen\_ctrl\_read\_callback;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00351}00351                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a730af89f830066662eac76401fc037ff}{bufsize}} = f-\/>\mbox{\hyperlink{structusb__fifo_a6f41b257bf5b7a4ff66dde269f24aac5}{bufsize}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00352}00352 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00353}00353                 \textcolor{keywordflow}{if} (ugen\_transfer\_setup(f, \mbox{\hyperlink{structusb__config}{usb\_config}}, 2)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00354}00354                         \textcolor{keywordflow}{return} (EIO);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00355}00355                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00356}00356                 \textcolor{comment}{/* first transfer does not clear stall */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00357}00357                 f-\/>\mbox{\hyperlink{structusb__fifo_a70058c5fdf3bb4fa4e9bdfe26ba5c2f7}{flag\_stall}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00358}00358                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00359}00359 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00360}00360         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_aecbab40f64cd5ffe365b73f7360ea2a3}{UE\_ISOCHRONOUS}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00361}00361                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a0e7feb3ff903ed490f21c1e5b128fc71}{flags}}.\mbox{\hyperlink{structusb__xfer__flags_a295c379f07c6ff99b213195edc70e3a2}{short\_xfer\_ok}} = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00362}00362                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a730af89f830066662eac76401fc037ff}{bufsize}} = 0;     \textcolor{comment}{/* use default */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00363}00363                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a54ec61088238cb0e3128eecd279aa7f0}{frames}} = f-\/>\mbox{\hyperlink{structusb__fifo_afb03048ea6c427d3c1c356cc3c34cc8c}{nframes}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00364}00364                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_ad6cf53d455b808964f881c91074d2696}{callback}} = \&ugen\_isoc\_read\_callback;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00365}00365                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a80178ca6c609b484f4cd441928940d16}{timeout}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00366}00366 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00367}00367                 \textcolor{comment}{/* clone configuration */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00368}00368                 \mbox{\hyperlink{structusb__config}{usb\_config}}[1] = \mbox{\hyperlink{structusb__config}{usb\_config}}[0];}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00369}00369 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00370}00370                 \textcolor{keywordflow}{if} (ugen\_transfer\_setup(f, \mbox{\hyperlink{structusb__config}{usb\_config}}, 2)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00371}00371                         \textcolor{keywordflow}{return} (EIO);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00372}00372                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00373}00373                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00374}00374 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00375}00375         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00376}00376                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00377}00377         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00378}00378         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00379}00379 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00380}00380 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00381}00381 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00382}00382 ugen\_start\_read(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00383}00383 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00384}00384         \textcolor{comment}{/* check that pipes are open */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00385}00385         \textcolor{keywordflow}{if} (ugen\_open\_pipe\_read(f)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00386}00386                 \textcolor{comment}{/* signal error */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00387}00387                 \mbox{\hyperlink{usbdi_8h_a73943b2c8fabf001cfa319d44f28a3ad}{usb\_fifo\_put\_data\_error}}(f);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00388}00388         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00389}00389         \textcolor{comment}{/* start transfers */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00390}00390         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[0]);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00391}00391         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[1]);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00392}00392 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00393}00393 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00394}00394 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00395}00395 ugen\_start\_write(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00396}00396 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00397}00397         \textcolor{comment}{/* check that pipes are open */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00398}00398         \textcolor{keywordflow}{if} (ugen\_open\_pipe\_write(f)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00399}00399                 \textcolor{comment}{/* signal error */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00400}00400                 \mbox{\hyperlink{usbdi_8h_a5118bcefdea5337dcd695e3e1396281f}{usb\_fifo\_get\_data\_error}}(f);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00401}00401         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00402}00402         \textcolor{comment}{/* start transfers */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00403}00403         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[0]);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00404}00404         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[1]);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00405}00405 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00406}00406 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00407}00407 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00408}00408 ugen\_stop\_io(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00409}00409 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00410}00410         \textcolor{comment}{/* stop transfers */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00411}00411         \mbox{\hyperlink{usb__transfer_8c_abe245d973df0cfd6fb96b884d33ebce3}{usbd\_transfer\_stop}}(f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[0]);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00412}00412         \mbox{\hyperlink{usb__transfer_8c_abe245d973df0cfd6fb96b884d33ebce3}{usbd\_transfer\_stop}}(f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[1]);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00413}00413 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00414}00414 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00415}00415 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00416}00416 ugen\_ctrl\_read\_callback(\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{usb__generic_8c_source_l00417}00417 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00418}00418         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00419}00419         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__mbuf}{usb\_mbuf}} *m;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00420}00420 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00421}00421         DPRINTFN(4, \textcolor{stringliteral}{"{}actlen=\%u, aframes=\%u\(\backslash\)n"{}}, xfer-\/>\mbox{\hyperlink{structusb__xfer_a5d4e9e8a914f30cedf64f8771e63e873}{actlen}}, xfer-\/>\mbox{\hyperlink{structusb__xfer_a7f58fffa56cac11410055f785c4c5ffa}{aframes}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00422}00422 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00423}00423         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00424}00424         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00425}00425                 \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a5d4e9e8a914f30cedf64f8771e63e873}{actlen}} == 0) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00426}00426                         \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_ae5300af41530ade103a1b017d63cbf31}{fifo\_zlp}} != 4) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00427}00427                                 f-\/>\mbox{\hyperlink{structusb__fifo_ae5300af41530ade103a1b017d63cbf31}{fifo\_zlp}}++;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00428}00428                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00429}00429                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00430}00430 \textcolor{comment}{                                 * Throttle a little bit we have multiple ZLPs}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00431}00431 \textcolor{comment}{                                 * in a row!}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00432}00432 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00433}00433                                 xfer-\/>\mbox{\hyperlink{structusb__xfer_adefe203b8c753d8828c4b8dcec099ffc}{interval}} = 64;    \textcolor{comment}{/* ms */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00434}00434                         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00435}00435                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00436}00436                         \textcolor{comment}{/* clear throttle */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00437}00437                         xfer-\/>\mbox{\hyperlink{structusb__xfer_adefe203b8c753d8828c4b8dcec099ffc}{interval}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00438}00438                         f-\/>\mbox{\hyperlink{structusb__fifo_ae5300af41530ade103a1b017d63cbf31}{fifo\_zlp}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00439}00439                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00440}00440                 \mbox{\hyperlink{usbdi_8h_a444304a04a6daab49a4d9ee6483f5415}{usb\_fifo\_put\_data}}(f, xfer-\/>\mbox{\hyperlink{structusb__xfer_a5937368645458023af557e100989c64a}{frbuffers}}, 0,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00441}00441                     xfer-\/>\mbox{\hyperlink{structusb__xfer_a5d4e9e8a914f30cedf64f8771e63e873}{actlen}}, 1);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00442}00442 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00443}00443         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00444}00444                 \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_a70058c5fdf3bb4fa4e9bdfe26ba5c2f7}{flag\_stall}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00445}00445                         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[1]);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00446}00446                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00447}00447                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00448}00448                 \mbox{\hyperlink{usb__mbuf_8h_aecac921b8969038d1c59ae2e3f6f85de}{USB\_IF\_POLL}}(\&f-\/>\mbox{\hyperlink{structusb__fifo_a04af4d903f6977ba311144684f6c9740}{free\_q}}, m);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00449}00449                 \textcolor{keywordflow}{if} (m) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00450}00450                         \mbox{\hyperlink{usb__transfer_8c_a31786497f0f4222203b1e993d52af753}{usbd\_xfer\_set\_frame\_len}}(xfer, 0, \mbox{\hyperlink{usb__transfer_8c_ae34a7cc2f01c6dfb68bca6fd0b72647e}{usbd\_xfer\_max\_len}}(xfer));}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00451}00451                         \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(xfer);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00452}00452                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00453}00453                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00454}00454 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00455}00455         \textcolor{keywordflow}{default}:                        \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00456}00456                 \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a85c5e7431b74a154e8313190f6d1d58f}{error}} != \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00457}00457                         \textcolor{comment}{/* send a zero length packet to userland */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00458}00458                         \mbox{\hyperlink{usbdi_8h_a444304a04a6daab49a4d9ee6483f5415}{usb\_fifo\_put\_data}}(f, xfer-\/>\mbox{\hyperlink{structusb__xfer_a5937368645458023af557e100989c64a}{frbuffers}}, 0, 0, 1);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00459}00459                         f-\/>\mbox{\hyperlink{structusb__fifo_a70058c5fdf3bb4fa4e9bdfe26ba5c2f7}{flag\_stall}} = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00460}00460                         f-\/>\mbox{\hyperlink{structusb__fifo_ae5300af41530ade103a1b017d63cbf31}{fifo\_zlp}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00461}00461                         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[1]);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00462}00462                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00463}00463                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00464}00464         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00465}00465 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00466}00466 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00467}00467 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00468}00468 ugen\_ctrl\_write\_callback(\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{usb__generic_8c_source_l00469}00469 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00470}00470         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00471}00471         \mbox{\hyperlink{usb__freebsd_8h_a66bb6b1869e5e89aff3b693720b39cfb}{usb\_frlength\_t}} actlen;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00472}00472 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00473}00473         DPRINTFN(4, \textcolor{stringliteral}{"{}actlen=\%u, aframes=\%u\(\backslash\)n"{}}, \mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a5d4e9e8a914f30cedf64f8771e63e873}{actlen}}, \mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a7f58fffa56cac11410055f785c4c5ffa}{aframes}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00474}00474 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00475}00475         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}})) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00476}00476         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00477}00477         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00478}00478                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00479}00479 \textcolor{comment}{                 * If writing is in stall, just jump to clear stall}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00480}00480 \textcolor{comment}{                 * callback and solve the situation.}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00481}00481 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00482}00482                 \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_a70058c5fdf3bb4fa4e9bdfe26ba5c2f7}{flag\_stall}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00483}00483                         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[1]);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00484}00484                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00485}00485                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00486}00486                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00487}00487 \textcolor{comment}{                 * Write data, setup and perform hardware transfer.}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00488}00488 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00489}00489                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{usbdi_8h_a74c7414859dbebc635199a18f73f545d}{usb\_fifo\_get\_data}}(f, \mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a5937368645458023af557e100989c64a}{frbuffers}}, 0,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00490}00490                     \mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a3ece1de738e7c3ca20f0bfdbd827fd16}{max\_data\_length}}, \&actlen, 0)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00491}00491                         \mbox{\hyperlink{usb__transfer_8c_a31786497f0f4222203b1e993d52af753}{usbd\_xfer\_set\_frame\_len}}(\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}, 0, actlen);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00492}00492                         \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00493}00493                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00494}00494                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00495}00495 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00496}00496         \textcolor{keywordflow}{default}:                        \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00497}00497                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a85c5e7431b74a154e8313190f6d1d58f}{error}} != \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00498}00498                         f-\/>\mbox{\hyperlink{structusb__fifo_a70058c5fdf3bb4fa4e9bdfe26ba5c2f7}{flag\_stall}} = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00499}00499                         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[1]);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00500}00500                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00501}00501                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00502}00502         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00503}00503 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00504}00504 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00505}00505 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00506}00506 ugen\_read\_clear\_stall\_callback(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00507}00507 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00508}00508         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00509}00509         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer\_other = f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[0];}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00510}00510 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00511}00511         \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_a70058c5fdf3bb4fa4e9bdfe26ba5c2f7}{flag\_stall}} == 0) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00512}00512                 \textcolor{comment}{/* nothing to do */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00513}00513                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00514}00514         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00515}00515         \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__transfer_8c_a4088ac29158c7fdb2c7b466ca3473ab9}{usbd\_clear\_stall\_callback}}(xfer, xfer\_other)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00516}00516                 DPRINTFN(5, \textcolor{stringliteral}{"{}f=\%p: stall cleared\(\backslash\)n"{}}, f);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00517}00517                 f-\/>\mbox{\hyperlink{structusb__fifo_a70058c5fdf3bb4fa4e9bdfe26ba5c2f7}{flag\_stall}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00518}00518                 \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(xfer\_other);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00519}00519         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00520}00520 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00521}00521 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00522}00522 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00523}00523 ugen\_write\_clear\_stall\_callback(\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{usb__generic_8c_source_l00524}00524 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00525}00525         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00526}00526         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer\_other = f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[0];}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00527}00527 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00528}00528         \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_a70058c5fdf3bb4fa4e9bdfe26ba5c2f7}{flag\_stall}} == 0) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00529}00529                 \textcolor{comment}{/* nothing to do */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00530}00530                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00531}00531         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00532}00532         \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__transfer_8c_a4088ac29158c7fdb2c7b466ca3473ab9}{usbd\_clear\_stall\_callback}}(xfer, xfer\_other)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00533}00533                 DPRINTFN(5, \textcolor{stringliteral}{"{}f=\%p: stall cleared\(\backslash\)n"{}}, f);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00534}00534                 f-\/>\mbox{\hyperlink{structusb__fifo_a70058c5fdf3bb4fa4e9bdfe26ba5c2f7}{flag\_stall}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00535}00535                 \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(xfer\_other);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00536}00536         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00537}00537 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00538}00538 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00539}00539 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00540}00540 ugen\_isoc\_read\_callback(\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{usb__generic_8c_source_l00541}00541 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00542}00542         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00543}00543         \mbox{\hyperlink{usb__freebsd_8h_a66bb6b1869e5e89aff3b693720b39cfb}{usb\_frlength\_t}} \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00544}00544         \mbox{\hyperlink{usb__freebsd_8h_ace73c4fca228e0d4c98bc32c063b0714}{usb\_frcount\_t}} \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00545}00545 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00546}00546         DPRINTFN(4, \textcolor{stringliteral}{"{}actlen=\%u, aframes=\%u\(\backslash\)n"{}}, \mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a5d4e9e8a914f30cedf64f8771e63e873}{actlen}}, \mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a7f58fffa56cac11410055f785c4c5ffa}{aframes}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00547}00547 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00548}00548         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}})) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00549}00549         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00550}00550 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00551}00551                 DPRINTFN(6, \textcolor{stringliteral}{"{}actlen=\%d\(\backslash\)n"{}}, \mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a5d4e9e8a914f30cedf64f8771e63e873}{actlen}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00552}00552 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00553}00553                 \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00554}00554 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00555}00555                 \textcolor{keywordflow}{for} (\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} = 0; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} != \mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a7f58fffa56cac11410055f785c4c5ffa}{aframes}}; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}++) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00556}00556                         \mbox{\hyperlink{usbdi_8h_a444304a04a6daab49a4d9ee6483f5415}{usb\_fifo\_put\_data}}(f, \mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a5937368645458023af557e100989c64a}{frbuffers}}, \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}},}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00557}00557                             \mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a04bfeb929b15a30d355f94eb7ff2a586}{frlengths}}[\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}], 1);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00558}00558                         \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}} += \mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_ae115ce000f084f7d5f8c005fa88d2703}{max\_frame\_size}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00559}00559                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00560}00560 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00561}00561         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00562}00562 tr\_setup:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00563}00563                 \textcolor{keywordflow}{for} (\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} = 0; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} != \mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}}; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}++) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00564}00564                         \textcolor{comment}{/* setup size for next transfer */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00565}00565                         \mbox{\hyperlink{usb__transfer_8c_a31786497f0f4222203b1e993d52af753}{usbd\_xfer\_set\_frame\_len}}(\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}, \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}, \mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_ae115ce000f084f7d5f8c005fa88d2703}{max\_frame\_size}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00566}00566                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00567}00567                 \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00568}00568                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00569}00569 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00570}00570         \textcolor{keywordflow}{default}:                        \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00571}00571                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a85c5e7431b74a154e8313190f6d1d58f}{error}} == \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00572}00572                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00573}00573                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00574}00574                 \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00575}00575         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00576}00576 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00577}00577 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00578}00578 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00579}00579 ugen\_isoc\_write\_callback(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00580}00580 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00581}00581         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00582}00582         \mbox{\hyperlink{usb__freebsd_8h_a66bb6b1869e5e89aff3b693720b39cfb}{usb\_frlength\_t}} actlen;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00583}00583         \mbox{\hyperlink{usb__freebsd_8h_a66bb6b1869e5e89aff3b693720b39cfb}{usb\_frlength\_t}} \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00584}00584         \mbox{\hyperlink{usb__freebsd_8h_ace73c4fca228e0d4c98bc32c063b0714}{usb\_frcount\_t}} \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00585}00585 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00586}00586         DPRINTFN(4, \textcolor{stringliteral}{"{}actlen=\%u, aframes=\%u\(\backslash\)n"{}}, \mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a5d4e9e8a914f30cedf64f8771e63e873}{actlen}}, \mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a7f58fffa56cac11410055f785c4c5ffa}{aframes}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00587}00587 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00588}00588         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}})) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00589}00589         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00590}00590         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00591}00591 tr\_setup:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00592}00592                 \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00593}00593                 \textcolor{keywordflow}{for} (\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} = 0; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} != \mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}}; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}++) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00594}00594                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{usbdi_8h_a74c7414859dbebc635199a18f73f545d}{usb\_fifo\_get\_data}}(f, \mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a5937368645458023af557e100989c64a}{frbuffers}}, \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}},}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00595}00595                             \mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_ae115ce000f084f7d5f8c005fa88d2703}{max\_frame\_size}}, \&actlen, 1)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00596}00596                                 \mbox{\hyperlink{usb__transfer_8c_a31786497f0f4222203b1e993d52af753}{usbd\_xfer\_set\_frame\_len}}(\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}, \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}, actlen);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00597}00597                                 \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}} += actlen;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00598}00598                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00599}00599                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00600}00600                         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00601}00601                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00602}00602 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00603}00603                 \textcolor{keywordflow}{for} (; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} != \mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}}; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}++) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00604}00604                         \textcolor{comment}{/* fill in zero frames */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00605}00605                         \mbox{\hyperlink{usb__transfer_8c_a31786497f0f4222203b1e993d52af753}{usbd\_xfer\_set\_frame\_len}}(\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}, \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}, 0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00606}00606                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00607}00607                 \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00608}00608                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00609}00609 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00610}00610         \textcolor{keywordflow}{default}:                        \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00611}00611                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}-\/>\mbox{\hyperlink{structusb__xfer_a85c5e7431b74a154e8313190f6d1d58f}{error}} == \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00612}00612                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00613}00613                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00614}00614                 \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00615}00615         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00616}00616 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00617}00617 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00618}00618 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00619}00619 ugen\_set\_config(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, uint8\_t index)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00620}00620 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00621}00621         DPRINTFN(2, \textcolor{stringliteral}{"{}index \%u\(\backslash\)n"{}}, index);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00622}00622 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00623}00623         \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{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{usb__generic_8c_source_l00624}00624                 \textcolor{comment}{/* not possible in device side mode */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00625}00625                 \textcolor{keywordflow}{return} (ENOTTY);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00626}00626         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00627}00627 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00628}00628         \textcolor{comment}{/* make sure all FIFO's are gone */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00629}00629         \textcolor{comment}{/* else there can be a deadlock */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00630}00630         \textcolor{keywordflow}{if} (ugen\_fs\_uninit(f)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00631}00631                 \textcolor{comment}{/* ignore any errors */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00632}00632                 DPRINTFN(6, \textcolor{stringliteral}{"{}no FIFOs\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00633}00633         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00634}00634 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00635}00635         \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__hub_8c_a867f7105cedf7ee30cf3ccd49058cb7b}{usbd\_start\_set\_config}}(f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}, index) != 0)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00636}00636                 \textcolor{keywordflow}{return} (EIO);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00637}00637 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00638}00638         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00639}00639 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00640}00640 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00641}00641 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00642}00642 ugen\_set\_interface(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00643}00643     uint8\_t \mbox{\hyperlink{structusb__fifo_a7e816251b4c56d755f86791bc17b2143}{iface\_index}}, uint8\_t alt\_index)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00644}00644 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00645}00645         DPRINTFN(2, \textcolor{stringliteral}{"{}\%u, \%u\(\backslash\)n"{}}, \mbox{\hyperlink{structusb__fifo_a7e816251b4c56d755f86791bc17b2143}{iface\_index}}, alt\_index);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00646}00646 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00647}00647         \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{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{usb__generic_8c_source_l00648}00648                 \textcolor{comment}{/* not possible in device side mode */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00649}00649                 \textcolor{keywordflow}{return} (ENOTTY);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00650}00650         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00651}00651         \textcolor{comment}{/* make sure all FIFO's are gone */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00652}00652         \textcolor{comment}{/* else there can be a deadlock */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00653}00653         \textcolor{keywordflow}{if} (ugen\_fs\_uninit(f)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00654}00654                 \textcolor{comment}{/* ignore any errors */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00655}00655                 DPRINTFN(6, \textcolor{stringliteral}{"{}no FIFOs\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00656}00656         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00657}00657         \textcolor{comment}{/* change setting -\/ will free generic FIFOs, if any */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00658}00658         \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__device_8c_a04693d160af658ae93ddddeac41e6ef2}{usbd\_set\_alt\_interface\_index}}(f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}, \mbox{\hyperlink{structusb__fifo_a7e816251b4c56d755f86791bc17b2143}{iface\_index}}, alt\_index)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00659}00659                 \textcolor{keywordflow}{return} (EIO);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00660}00660         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00661}00661         \textcolor{comment}{/* probe and attach */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00662}00662         \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__device_8c_a5374feec38ebe0044bc1569bba22a8ab}{usb\_probe\_and\_attach}}(f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}, \mbox{\hyperlink{structusb__fifo_a7e816251b4c56d755f86791bc17b2143}{iface\_index}})) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00663}00663                 \textcolor{keywordflow}{return} (EIO);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00664}00664         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00665}00665         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00666}00666 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00667}00667 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00668}00668 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00669}00669 \textcolor{comment}{ *      ugen\_get\_cdesc}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00670}00670 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00671}00671 \textcolor{comment}{ * This function will retrieve the complete configuration descriptor}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00672}00672 \textcolor{comment}{ * at the given index.}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00673}00673 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00674}00674 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00675}00675 ugen\_get\_cdesc(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__gen__descriptor}{usb\_gen\_descriptor}} *ugd)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00676}00676 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00677}00677         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__config__descriptor}{usb\_config\_descriptor}} *cdesc;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00678}00678         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device}{usb\_device}} *udev = f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00679}00679         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00680}00680         uint16\_t \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00681}00681         uint8\_t free\_data;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00682}00682 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00683}00683         DPRINTFN(6, \textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00684}00684 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00685}00685         \textcolor{keywordflow}{if} (ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a2f1268f5a3352086e6edbe3d381b216b}{ugd\_data}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00686}00686                 \textcolor{comment}{/* userland pointer should not be zero */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00687}00687                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00688}00688         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00689}00689         \textcolor{keywordflow}{if} ((ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_ad943bda18d4fabe130dd75bb09406c25}{ugd\_config\_index}} == \mbox{\hyperlink{usb_8h_a62b706b8392cd51db650b220c9bbb9a0}{USB\_UNCONFIG\_INDEX}}) ||}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00690}00690             (ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_ad943bda18d4fabe130dd75bb09406c25}{ugd\_config\_index}} == udev-\/>\mbox{\hyperlink{structusb__device_a7e42ccaea5ac77b155be2a49aa4d2105}{curr\_config\_index}})) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00691}00691                 \mbox{\hyperlink{structusb__device_a01f45bba85920b182662484ab096f81a}{cdesc}} = \mbox{\hyperlink{usb__device_8c_a5833d02ea7d69fb84106d7b97391431a}{usbd\_get\_config\_descriptor}}(udev);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00692}00692                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structusb__device_a01f45bba85920b182662484ab096f81a}{cdesc}} == NULL)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00693}00693                         \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00694}00694                 free\_data = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00695}00695 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00696}00696         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00697}00697 \textcolor{preprocessor}{\#if (USB\_HAVE\_FIXED\_CONFIG == 0)}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00698}00698                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__request_8c_a6c2daa48d301cb04900e438cbd16bd4d}{usbd\_req\_get\_config\_desc\_full}}(udev,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00699}00699                     NULL, \&\mbox{\hyperlink{structusb__device_a01f45bba85920b182662484ab096f81a}{cdesc}}, ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_ad943bda18d4fabe130dd75bb09406c25}{ugd\_config\_index}})) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00700}00700                         \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00701}00701                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00702}00702                 free\_data = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00703}00703 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00704}00704                 \textcolor{comment}{/* configuration descriptor data is shared */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00705}00705                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00706}00706 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00707}00707         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00708}00708 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00709}00709         \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} = \mbox{\hyperlink{usb__endian_8h_aa3860f9452db3a5d865cc943e2f01829}{UGETW}}(\mbox{\hyperlink{structusb__device_a01f45bba85920b182662484ab096f81a}{cdesc}}-\/>\mbox{\hyperlink{structusb__config__descriptor_a2d8360ac0c5b03cd0ed13158a54cad36}{wTotalLength}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00710}00710         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} > ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a75415963b6fd4b8d06ba8b1854782191}{ugd\_maxlen}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00711}00711                 \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} = ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a75415963b6fd4b8d06ba8b1854782191}{ugd\_maxlen}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00712}00712         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00713}00713         DPRINTFN(6, \textcolor{stringliteral}{"{}len=\%u\(\backslash\)n"{}}, \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00714}00714 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00715}00715         ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a02eed3e0cb21a0a296293ceffdfce587}{ugd\_actlen}} = \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00716}00716         ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a1ff530f5048c7e11d272f8d331879b5a}{ugd\_offset}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00717}00717 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00718}00718         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = copyout(\mbox{\hyperlink{structusb__device_a01f45bba85920b182662484ab096f81a}{cdesc}}, ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a2f1268f5a3352086e6edbe3d381b216b}{ugd\_data}}, \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00719}00719 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00720}00720         \textcolor{keywordflow}{if} (free\_data)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00721}00721                 \mbox{\hyperlink{usb__request_8c_a2bb340b05bdd0e0d97acca6cce349cd7}{usbd\_free\_config\_desc}}(udev, \mbox{\hyperlink{structusb__device_a01f45bba85920b182662484ab096f81a}{cdesc}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00722}00722 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00723}00723         \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00724}00724 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00725}00725 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00726}00726 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00727}00727 ugen\_get\_sdesc(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__gen__descriptor}{usb\_gen\_descriptor}} *ugd)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00728}00728 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00729}00729         \textcolor{keywordtype}{void} *ptr;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00730}00730         uint16\_t \mbox{\hyperlink{if__axge_8c_ae5dc6ffcd9b7605c7787791e40cc6bb0}{size}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00731}00731         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00732}00732         uint8\_t do\_unlock;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00733}00733 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00734}00734         \textcolor{comment}{/* Protect scratch area */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00735}00735         do\_unlock = \mbox{\hyperlink{usb__device_8c_aa56902f627a10ca9708ec8c3f90e0e09}{usbd\_ctrl\_lock}}(f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00736}00736 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00737}00737         ptr = f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}-\/>\mbox{\hyperlink{structusb__device_a2650f60cd06dcbafa53b19d48edbad36}{scratch}}.\mbox{\hyperlink{unionusb__device__scratch_a75e58a628a13e210cf402c16985f8e03}{data}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00738}00738         \mbox{\hyperlink{if__axge_8c_ae5dc6ffcd9b7605c7787791e40cc6bb0}{size}} = \textcolor{keyword}{sizeof}(f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}-\/>\mbox{\hyperlink{structusb__device_a2650f60cd06dcbafa53b19d48edbad36}{scratch}}.\mbox{\hyperlink{unionusb__device__scratch_a75e58a628a13e210cf402c16985f8e03}{data}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00739}00739 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00740}00740         \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__request_8c_a6b26fc399b10141dc40b8a9f39f75688}{usbd\_req\_get\_string\_desc}}(f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}, NULL, ptr,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00741}00741             \mbox{\hyperlink{if__axge_8c_ae5dc6ffcd9b7605c7787791e40cc6bb0}{size}}, ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a775362f4c64868eca3782d8622b36674}{ugd\_lang\_id}}, ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_ae0be0b6d4438a17abcd338003e29ec7e}{ugd\_string\_index}})) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00742}00742                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00743}00743         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00744}00744                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__axge_8c_ae5dc6ffcd9b7605c7787791e40cc6bb0}{size}} > ((uint8\_t *)ptr)[0]) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00745}00745                         \mbox{\hyperlink{if__axge_8c_ae5dc6ffcd9b7605c7787791e40cc6bb0}{size}} = ((uint8\_t *)ptr)[0];}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00746}00746                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00747}00747                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__axge_8c_ae5dc6ffcd9b7605c7787791e40cc6bb0}{size}} > ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a75415963b6fd4b8d06ba8b1854782191}{ugd\_maxlen}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00748}00748                         \mbox{\hyperlink{if__axge_8c_ae5dc6ffcd9b7605c7787791e40cc6bb0}{size}} = ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a75415963b6fd4b8d06ba8b1854782191}{ugd\_maxlen}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00749}00749                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00750}00750                 ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a02eed3e0cb21a0a296293ceffdfce587}{ugd\_actlen}} = \mbox{\hyperlink{if__axge_8c_ae5dc6ffcd9b7605c7787791e40cc6bb0}{size}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00751}00751                 ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a1ff530f5048c7e11d272f8d331879b5a}{ugd\_offset}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00752}00752 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00753}00753                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = copyout(ptr, ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a2f1268f5a3352086e6edbe3d381b216b}{ugd\_data}}, \mbox{\hyperlink{if__axge_8c_ae5dc6ffcd9b7605c7787791e40cc6bb0}{size}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00754}00754         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00755}00755         \textcolor{keywordflow}{if} (do\_unlock)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00756}00756                 \mbox{\hyperlink{usb__device_8c_ab2970a916d37dfc2cf731f4d3b53cb26}{usbd\_ctrl\_unlock}}(f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00757}00757 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00758}00758         \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00759}00759 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00760}00760 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00761}00761 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00762}00762 \textcolor{comment}{ *      ugen\_get\_iface\_driver}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00763}00763 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00764}00764 \textcolor{comment}{ * This function generates an USB interface description for userland.}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00765}00765 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00766}00766 \textcolor{comment}{ * Returns:}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00767}00767 \textcolor{comment}{ *    0: Success}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00768}00768 \textcolor{comment}{ * Else: Failure}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00769}00769 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00770}00770 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00771}00771 ugen\_get\_iface\_driver(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__gen__descriptor}{usb\_gen\_descriptor}} *ugd)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00772}00772 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00773}00773         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device}{usb\_device}} *udev = f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00774}00774         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__interface}{usb\_interface}} *iface;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00775}00775         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *ptr;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00776}00776         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{usb__device_8h_ab3a00cd7fdc532cb4cd4d59733b440bf}{desc}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00777}00777         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00778}00778         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} maxlen;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00779}00779         \textcolor{keywordtype}{char} buf[128];}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00780}00780         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00781}00781 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00782}00782         DPRINTFN(6, \textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00783}00783 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00784}00784         \textcolor{keywordflow}{if} ((ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a2f1268f5a3352086e6edbe3d381b216b}{ugd\_data}} == NULL) || (ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a75415963b6fd4b8d06ba8b1854782191}{ugd\_maxlen}} == 0)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00785}00785                 \textcolor{comment}{/* userland pointer should not be zero */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00786}00786                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00787}00787         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00788}00788 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00789}00789         iface = \mbox{\hyperlink{usb__device_8c_ad241549c2225f6ccb72345851d5b9ed8}{usbd\_get\_iface}}(udev, ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_ad20651a6842f6f0dbec41d4beeef4da8}{ugd\_iface\_index}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00790}00790         \textcolor{keywordflow}{if} ((iface == NULL) || (iface-\/>\mbox{\hyperlink{structusb__interface_aa5cea795ac14467ffdbe70b7f59beaba}{idesc}} == NULL)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00791}00791                 \textcolor{comment}{/* invalid interface index */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00792}00792                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00793}00793         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00794}00794 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00795}00795         \textcolor{comment}{/* read out device nameunit string, if any */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00796}00796         \textcolor{keywordflow}{if} ((iface-\/>\mbox{\hyperlink{structusb__interface_a30771ef505042d5d21771ce48c80e45a}{subdev}} != NULL) \&\&}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00797}00797             device\_is\_attached(iface-\/>\mbox{\hyperlink{structusb__interface_a30771ef505042d5d21771ce48c80e45a}{subdev}}) \&\&}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00798}00798             (ptr = device\_get\_nameunit(iface-\/>\mbox{\hyperlink{structusb__interface_a30771ef505042d5d21771ce48c80e45a}{subdev}})) \&\&}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00799}00799             (\mbox{\hyperlink{usb__device_8h_ab3a00cd7fdc532cb4cd4d59733b440bf}{desc}} = device\_get\_desc(iface-\/>\mbox{\hyperlink{structusb__interface_a30771ef505042d5d21771ce48c80e45a}{subdev}}))) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00800}00800                 \textcolor{comment}{/* print description */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00801}00801                 snprintf(buf, \textcolor{keyword}{sizeof}(buf), \textcolor{stringliteral}{"{}\%s: <\%s>"{}}, ptr, \mbox{\hyperlink{usb__device_8h_ab3a00cd7fdc532cb4cd4d59733b440bf}{desc}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00802}00802 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00803}00803                 \textcolor{comment}{/* range checks */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00804}00804                 maxlen = ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a75415963b6fd4b8d06ba8b1854782191}{ugd\_maxlen}} -\/ 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00805}00805                 \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} = strlen(buf);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00806}00806                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} > maxlen)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00807}00807                         \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} = maxlen;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00808}00808 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00809}00809                 \textcolor{comment}{/* update actual length, including terminating zero */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00810}00810                 ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a02eed3e0cb21a0a296293ceffdfce587}{ugd\_actlen}} = \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} + 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00811}00811 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00812}00812                 \textcolor{comment}{/* copy out interface description */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00813}00813                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = copyout(buf, ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a2f1268f5a3352086e6edbe3d381b216b}{ugd\_data}}, ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a02eed3e0cb21a0a296293ceffdfce587}{ugd\_actlen}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00814}00814         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00815}00815                 \textcolor{comment}{/* zero length string is default */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00816}00816                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = copyout(\textcolor{stringliteral}{"{}"{}}, ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a2f1268f5a3352086e6edbe3d381b216b}{ugd\_data}}, 1);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00817}00817         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00818}00818         \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00819}00819 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00820}00820 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00821}00821 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00822}00822 \textcolor{comment}{ *      ugen\_fill\_deviceinfo}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00823}00823 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00824}00824 \textcolor{comment}{ * This function dumps information about an USB device to the}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00825}00825 \textcolor{comment}{ * structure pointed to by the "{}di"{} argument.}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00826}00826 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00827}00827 \textcolor{comment}{ * Returns:}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00828}00828 \textcolor{comment}{ *    0: Success}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00829}00829 \textcolor{comment}{ * Else: Failure}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00830}00830 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00831}00831 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00832}00832 \mbox{\hyperlink{usb__generic_8h_aab838658e20dbc52546a7422b0630fb4}{ugen\_fill\_deviceinfo}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device__info}{usb\_device\_info}} *di)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00833}00833 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00834}00834         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device}{usb\_device}} *udev;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00835}00835         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device}{usb\_device}} *\mbox{\hyperlink{structusb__device_a4fff6a478d5f92f73df9d6f2b34760a3}{hub}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00836}00836 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00837}00837         udev = f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00838}00838 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00839}00839         bzero(di, \textcolor{keyword}{sizeof}(di[0]));}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00840}00840 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00841}00841         di-\/>\mbox{\hyperlink{structusb__device__info_aef7464726a24b8fe382795378042e1ad}{udi\_bus}} = device\_get\_unit(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}}-\/>\mbox{\hyperlink{structusb__bus_a50629655e638e1f775df1ed160d3c533}{bdev}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00842}00842         di-\/>\mbox{\hyperlink{structusb__device__info_ad60a3027f2ebe507ae317be5033807e6}{udi\_addr}} = udev-\/>\mbox{\hyperlink{structusb__device_ab9873df4422a53f4fa2d7c17460b11a1}{address}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00843}00843         di-\/>\mbox{\hyperlink{structusb__device__info_a308bfc3a9a75d8e880b944616fe2f54c}{udi\_index}} = udev-\/>\mbox{\hyperlink{structusb__device_a5671e9a7365d48bd470879e2b95ea2e5}{device\_index}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00844}00844         strlcpy(di-\/>\mbox{\hyperlink{structusb__device__info_a2ba66f9bd4d002ed92980b34503cc880}{udi\_serial}}, \mbox{\hyperlink{usb__device_8c_a5a41e5bc08f275438c7eb66d9883cd93}{usb\_get\_serial}}(udev), \textcolor{keyword}{sizeof}(di-\/>\mbox{\hyperlink{structusb__device__info_a2ba66f9bd4d002ed92980b34503cc880}{udi\_serial}}));}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00845}00845         strlcpy(di-\/>\mbox{\hyperlink{structusb__device__info_ac9313414589d544bf41dcfbbd1d933ba}{udi\_vendor}}, \mbox{\hyperlink{usb__device_8c_ae772361c7c976e3bfc4388a07517e233}{usb\_get\_manufacturer}}(udev), \textcolor{keyword}{sizeof}(di-\/>\mbox{\hyperlink{structusb__device__info_ac9313414589d544bf41dcfbbd1d933ba}{udi\_vendor}}));}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00846}00846         strlcpy(di-\/>\mbox{\hyperlink{structusb__device__info_a5447bcedf1ca957d43752efd39e62d3e}{udi\_product}}, \mbox{\hyperlink{usb__device_8c_a7cf233913defcbb3e5bb29f7b6565e6a}{usb\_get\_product}}(udev), \textcolor{keyword}{sizeof}(di-\/>\mbox{\hyperlink{structusb__device__info_a5447bcedf1ca957d43752efd39e62d3e}{udi\_product}}));}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00847}00847         \mbox{\hyperlink{usb__util_8c_a9b4958f7f163d307ca471472ca9ca014}{usb\_printbcd}}(di-\/>\mbox{\hyperlink{structusb__device__info_af9120d1d550750f90941a393a8b67198}{udi\_release}}, \textcolor{keyword}{sizeof}(di-\/>\mbox{\hyperlink{structusb__device__info_af9120d1d550750f90941a393a8b67198}{udi\_release}}),}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00848}00848             \mbox{\hyperlink{usb__endian_8h_aa3860f9452db3a5d865cc943e2f01829}{UGETW}}(udev-\/>\mbox{\hyperlink{structusb__device_a6fa6ffff7bff082394d16b2b05d66cdf}{ddesc}}.\mbox{\hyperlink{structusb__device__descriptor_a47583f19747579599678e8543fd652f8}{bcdDevice}}));}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00849}00849         di-\/>\mbox{\hyperlink{structusb__device__info_aea2c72920e583d8eccea1e78ef38c331}{udi\_vendorNo}} = \mbox{\hyperlink{usb__endian_8h_aa3860f9452db3a5d865cc943e2f01829}{UGETW}}(udev-\/>\mbox{\hyperlink{structusb__device_a6fa6ffff7bff082394d16b2b05d66cdf}{ddesc}}.\mbox{\hyperlink{structusb__device__descriptor_ac2a3d9b7e40bde975d26dd83d8350485}{idVendor}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00850}00850         di-\/>\mbox{\hyperlink{structusb__device__info_afdc139427d3b92ba5c424a221aaa7ecc}{udi\_productNo}} = \mbox{\hyperlink{usb__endian_8h_aa3860f9452db3a5d865cc943e2f01829}{UGETW}}(udev-\/>\mbox{\hyperlink{structusb__device_a6fa6ffff7bff082394d16b2b05d66cdf}{ddesc}}.\mbox{\hyperlink{structusb__device__descriptor_a09e74f08b2dc62817b2c3eb6a631883e}{idProduct}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00851}00851         di-\/>\mbox{\hyperlink{structusb__device__info_a813acb31488c0ea7aef563edb448862b}{udi\_releaseNo}} = \mbox{\hyperlink{usb__endian_8h_aa3860f9452db3a5d865cc943e2f01829}{UGETW}}(udev-\/>\mbox{\hyperlink{structusb__device_a6fa6ffff7bff082394d16b2b05d66cdf}{ddesc}}.\mbox{\hyperlink{structusb__device__descriptor_a47583f19747579599678e8543fd652f8}{bcdDevice}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00852}00852         di-\/>\mbox{\hyperlink{structusb__device__info_abbea70540baa9268592d9c124fa34966}{udi\_class}} = udev-\/>\mbox{\hyperlink{structusb__device_a6fa6ffff7bff082394d16b2b05d66cdf}{ddesc}}.\mbox{\hyperlink{structusb__device__descriptor_ad8931b0617dc382a8c26677103bf7f3d}{bDeviceClass}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00853}00853         di-\/>\mbox{\hyperlink{structusb__device__info_a1cd074560c9a613cdefe77ea7475b727}{udi\_subclass}} = udev-\/>\mbox{\hyperlink{structusb__device_a6fa6ffff7bff082394d16b2b05d66cdf}{ddesc}}.\mbox{\hyperlink{structusb__device__descriptor_ac8bc92b5a3d6849954d996c403e27c31}{bDeviceSubClass}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00854}00854         di-\/>\mbox{\hyperlink{structusb__device__info_a91155c67a82fe45b088d9dab1a06d453}{udi\_protocol}} = udev-\/>\mbox{\hyperlink{structusb__device_a6fa6ffff7bff082394d16b2b05d66cdf}{ddesc}}.\mbox{\hyperlink{structusb__device__descriptor_a94d6e194217a19638b354bf1c02c2d45}{bDeviceProtocol}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00855}00855         di-\/>\mbox{\hyperlink{structusb__device__info_ab9971a1ccc9bd100c68562ab37a9b6f1}{udi\_config\_no}} = udev-\/>\mbox{\hyperlink{structusb__device_a2ee59cfa6a9fe9463edb0eb1533f8757}{curr\_config\_no}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00856}00856         di-\/>\mbox{\hyperlink{structusb__device__info_ad04b84f0fd14cb5d49f73dd81a16d960}{udi\_config\_index}} = udev-\/>\mbox{\hyperlink{structusb__device_a7e42ccaea5ac77b155be2a49aa4d2105}{curr\_config\_index}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00857}00857         di-\/>\mbox{\hyperlink{structusb__device__info_a1f10ebe5604b4ebbbea48ada3c944b8d}{udi\_power}} = udev-\/>\mbox{\hyperlink{structusb__device_ae7b27fdcae02d49bee5c2f0a9130b633}{flags}}.\mbox{\hyperlink{structusb__device__flags_a41252dd27c1f941416917504610e0257}{self\_powered}} ? 0 : udev-\/>\mbox{\hyperlink{structusb__device_a928111b85e657beadd61437d701b2843}{power}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00858}00858         di-\/>\mbox{\hyperlink{structusb__device__info_a6f2e73ca63df3bd63a117d3fde6c01b5}{udi\_speed}} = udev-\/>\mbox{\hyperlink{structusb__device_a1fc02abd43bd33f295493ed23debd852}{speed}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00859}00859         di-\/>\mbox{\hyperlink{structusb__device__info_a5e254228f7f392e9615119b3c1595561}{udi\_mode}} = udev-\/>\mbox{\hyperlink{structusb__device_ae7b27fdcae02d49bee5c2f0a9130b633}{flags}}.\mbox{\hyperlink{structusb__device__flags_ad686103f845c7d070e25fa7a26c34694}{usb\_mode}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00860}00860         di-\/>\mbox{\hyperlink{structusb__device__info_ac6a0e59d3b8deb17ad9a675132c4fe61}{udi\_power\_mode}} = udev-\/>\mbox{\hyperlink{structusb__device_a1127e006fe407ceb1f80c3599740c2e8}{power\_mode}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00861}00861         di-\/>\mbox{\hyperlink{structusb__device__info_a7128c423ca0699ccf39902f5a75de169}{udi\_suspended}} = udev-\/>\mbox{\hyperlink{structusb__device_ae7b27fdcae02d49bee5c2f0a9130b633}{flags}}.\mbox{\hyperlink{structusb__device__flags_ac6bb1ecb98920dcf4b6e8b73e49b0701}{peer\_suspended}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00862}00862 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00863}00863         \mbox{\hyperlink{structusb__device_a4fff6a478d5f92f73df9d6f2b34760a3}{hub}} = udev-\/>\mbox{\hyperlink{structusb__device_aa35d4d1b88f22abb34d30e9762153e0b}{parent\_hub}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00864}00864         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structusb__device_a4fff6a478d5f92f73df9d6f2b34760a3}{hub}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00865}00865                 di-\/>\mbox{\hyperlink{structusb__device__info_aab50e8688ac8bea663e05f5bb48b3c1d}{udi\_hubaddr}} = \mbox{\hyperlink{structusb__device_a4fff6a478d5f92f73df9d6f2b34760a3}{hub}}-\/>address;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00866}00866                 di-\/>\mbox{\hyperlink{structusb__device__info_a2f54ae425948a47335e93886da4979a0}{udi\_hubindex}} = \mbox{\hyperlink{structusb__device_a4fff6a478d5f92f73df9d6f2b34760a3}{hub}}-\/>device\_index;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00867}00867                 di-\/>\mbox{\hyperlink{structusb__device__info_a1e400ad134f860c556c70468fff76469}{udi\_hubport}} = udev-\/>\mbox{\hyperlink{structusb__device_aad1b7bf74888da46b818db23b4f6adfb}{port\_no}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00868}00868         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00869}00869         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00870}00870 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00871}00871 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00872}00872 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00873}00873 \mbox{\hyperlink{usb__generic_8h_a9769ea8b5a272e0ec4d638c0f9ada867}{ugen\_do\_request}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__ctl__request}{usb\_ctl\_request}} *ur)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00874}00874 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00875}00875         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00876}00876         uint16\_t \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00877}00877         uint16\_t actlen;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00878}00878 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00879}00879         \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__util_8h_a42e1e1df5311999a79a6eefba78cc5cd}{usb\_check\_request}}(f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}, \&ur-\/>\mbox{\hyperlink{structusb__ctl__request_a5051e39c1f35c2b9b13df649dd7f43fd}{ucr\_request}})) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00880}00880                 \textcolor{keywordflow}{return} (EPERM);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00881}00881         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00882}00882         \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} = \mbox{\hyperlink{usb__endian_8h_aa3860f9452db3a5d865cc943e2f01829}{UGETW}}(ur-\/>\mbox{\hyperlink{structusb__ctl__request_a5051e39c1f35c2b9b13df649dd7f43fd}{ucr\_request}}.\mbox{\hyperlink{structusb__device__request_a7e802a5b9ac45d07409d82fb12cf959f}{wLength}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00883}00883 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00884}00884         \textcolor{comment}{/* check if "{}ucr\_data"{} is valid */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00885}00885         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} != 0) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00886}00886                 \textcolor{keywordflow}{if} (ur-\/>\mbox{\hyperlink{structusb__ctl__request_a3d78f31a3c3c646ff0626bca2795dd95}{ucr\_data}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00887}00887                         \textcolor{keywordflow}{return} (EFAULT);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00888}00888                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00889}00889         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00890}00890         \textcolor{comment}{/* do the USB request */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00891}00891         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usb__request_8c_ae914a46bd63666caf7f4d8c182fa5e71}{usbd\_do\_request\_flags}}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00892}00892             (f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}, NULL, \&ur-\/>\mbox{\hyperlink{structusb__ctl__request_a5051e39c1f35c2b9b13df649dd7f43fd}{ucr\_request}}, ur-\/>\mbox{\hyperlink{structusb__ctl__request_a3d78f31a3c3c646ff0626bca2795dd95}{ucr\_data}},}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00893}00893             (ur-\/>\mbox{\hyperlink{structusb__ctl__request_ad37818e66a656bd2c205cfa3239293b6}{ucr\_flags}} \& \mbox{\hyperlink{usbdi_8h_a7d5cf39b730f3e4d901208079a7340ab}{USB\_SHORT\_XFER\_OK}}) |}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00894}00894             \mbox{\hyperlink{usbdi_8h_a6b85775a39b87933096e26e559f96b82}{USB\_USER\_DATA\_PTR}}, \&actlen,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00895}00895             \mbox{\hyperlink{usbdi_8h_a07bf0b2ba580cae69a6c567c40d64b1c}{USB\_DEFAULT\_TIMEOUT}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00896}00896 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00897}00897         ur-\/>\mbox{\hyperlink{structusb__ctl__request_ad02e296eabf522387ba65abaf4fd38e3}{ucr\_actlen}} = actlen;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00898}00898 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00899}00899         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00900}00900                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EIO;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00901}00901         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00902}00902         \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00903}00903 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00904}00904 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00905}00905 \textcolor{preprocessor}{\#ifdef COMPAT\_FREEBSD32}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00906}00906 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00907}00907 ugen\_do\_request32(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, \textcolor{keyword}{struct} usb\_ctl\_request32 *ur32)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00908}00908 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00909}00909         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__ctl__request}{usb\_ctl\_request}} ur;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00910}00910         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00911}00911 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00912}00912         PTRIN\_CP(*ur32, ur, \mbox{\hyperlink{structusb__ctl__request_a3d78f31a3c3c646ff0626bca2795dd95}{ucr\_data}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00913}00913         CP(*ur32, ur, \mbox{\hyperlink{structusb__ctl__request_ad37818e66a656bd2c205cfa3239293b6}{ucr\_flags}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00914}00914         CP(*ur32, ur, \mbox{\hyperlink{structusb__ctl__request_ad02e296eabf522387ba65abaf4fd38e3}{ucr\_actlen}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00915}00915         CP(*ur32, ur, \mbox{\hyperlink{structusb__ctl__request_afd3032986eac62bcc7a18f98d670e965}{ucr\_addr}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00916}00916         CP(*ur32, ur, \mbox{\hyperlink{structusb__ctl__request_a5051e39c1f35c2b9b13df649dd7f43fd}{ucr\_request}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00917}00917 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00918}00918         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usb__generic_8h_a9769ea8b5a272e0ec4d638c0f9ada867}{ugen\_do\_request}}(f, \&ur);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00919}00919 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00920}00920         \textcolor{comment}{/* Don't update ucr\_data pointer */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00921}00921         CP(ur, *ur32, \mbox{\hyperlink{structusb__ctl__request_ad37818e66a656bd2c205cfa3239293b6}{ucr\_flags}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00922}00922         CP(ur, *ur32, \mbox{\hyperlink{structusb__ctl__request_ad02e296eabf522387ba65abaf4fd38e3}{ucr\_actlen}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00923}00923         CP(ur, *ur32, \mbox{\hyperlink{structusb__ctl__request_afd3032986eac62bcc7a18f98d670e965}{ucr\_addr}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00924}00924         CP(ur, *ur32, \mbox{\hyperlink{structusb__ctl__request_a5051e39c1f35c2b9b13df649dd7f43fd}{ucr\_request}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00925}00925 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00926}00926         \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00927}00927 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00928}00928 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00929}00929 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00930}00930 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00931}00931 \textcolor{comment}{ *      ugen\_re\_enumerate}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00932}00932 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00933}00933 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00934}00934 ugen\_re\_enumerate(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00935}00935 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00936}00936         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device}{usb\_device}} *udev = f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00937}00937         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00938}00938 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00939}00939         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00940}00940 \textcolor{comment}{         * This request can be useful for testing USB drivers:}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00941}00941 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00942}00942         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = priv\_check(curthread, PRIV\_DRIVER);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00943}00943         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00944}00944                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00945}00945         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00946}00946         \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{usb__generic_8c_source_l00947}00947                 \textcolor{comment}{/* not possible in device side mode */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00948}00948                 DPRINTFN(6, \textcolor{stringliteral}{"{}device mode\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00949}00949                 \textcolor{keywordflow}{return} (ENOTTY);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00950}00950         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00951}00951         \textcolor{comment}{/* make sure all FIFO's are gone */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00952}00952         \textcolor{comment}{/* else there can be a deadlock */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00953}00953         \textcolor{keywordflow}{if} (ugen\_fs\_uninit(f)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00954}00954                 \textcolor{comment}{/* ignore any errors */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00955}00955                 DPRINTFN(6, \textcolor{stringliteral}{"{}no FIFOs\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00956}00956         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00957}00957         \textcolor{comment}{/* start re-\/enumeration of device */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00958}00958         \mbox{\hyperlink{usb__hub_8c_ad106034391805ab4957d9e7ed20ed000}{usbd\_start\_re\_enumerate}}(udev);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00959}00959         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00960}00960 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00961}00961 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00962}00962 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00963}00963 ugen\_fs\_uninit(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00964}00964 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00965}00965         \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_abf80654c6961185168581e9634935db2}{fs\_xfer}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00966}00966                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00967}00967         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00968}00968         \mbox{\hyperlink{usb__transfer_8c_a2f5ab55bfe7f356bb7a7505ff35c9741}{usbd\_transfer\_unsetup}}(f-\/>\mbox{\hyperlink{structusb__fifo_abf80654c6961185168581e9634935db2}{fs\_xfer}}, f-\/>\mbox{\hyperlink{structusb__fifo_aa56d107c9e897a1c2602007b3b39c569}{fs\_ep\_max}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00969}00969         free(f-\/>\mbox{\hyperlink{structusb__fifo_abf80654c6961185168581e9634935db2}{fs\_xfer}}, M\_USB);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00970}00970         f-\/>\mbox{\hyperlink{structusb__fifo_abf80654c6961185168581e9634935db2}{fs\_xfer}} = NULL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00971}00971         f-\/>\mbox{\hyperlink{structusb__fifo_aa56d107c9e897a1c2602007b3b39c569}{fs\_ep\_max}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00972}00972         f-\/>\mbox{\hyperlink{structusb__fifo_a2050cdc6bc71c106f9d85ff7a70e9cb2}{fs\_ep\_ptr}} = NULL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00973}00973         f-\/>\mbox{\hyperlink{structusb__fifo_a490f136c888d3a396bc84baa115af935}{flag\_iscomplete}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00974}00974         \mbox{\hyperlink{usbdi_8h_a6434b2c65d370a12bdd87cec8863f1ff}{usb\_fifo\_free\_buffer}}(f);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00975}00975         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00976}00976 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00977}00977 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00978}00978 \textcolor{keyword}{static} uint8\_t}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00979}00979 ugen\_fs\_get\_complete(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, uint8\_t *pindex)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00980}00980 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00981}00981         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__mbuf}{usb\_mbuf}} *m;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00982}00982 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00983}00983         \mbox{\hyperlink{usb__mbuf_8h_a05824e25e4f99a7aa338aac63b791228}{USB\_IF\_DEQUEUE}}(\&f-\/>\mbox{\hyperlink{structusb__fifo_a54af5e958bfac462f2642bb588bcc900}{used\_q}}, m);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00984}00984 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00985}00985         \textcolor{keywordflow}{if} (m) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00986}00986                 *pindex = *((uint8\_t *)(m-\/>\mbox{\hyperlink{structusb__mbuf_a266a505a5ba6191e526bbba0da412836}{cur\_data\_ptr}}));}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00987}00987 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00988}00988                 \mbox{\hyperlink{usb__mbuf_8h_a687851a62f15d69c340d6d93268c6686}{USB\_IF\_ENQUEUE}}(\&f-\/>\mbox{\hyperlink{structusb__fifo_a04af4d903f6977ba311144684f6c9740}{free\_q}}, m);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00989}00989 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00990}00990                 \textcolor{keywordflow}{return} (0);             \textcolor{comment}{/* success */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00991}00991         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00992}00992                 *pindex = 0;            \textcolor{comment}{/* fix compiler warning */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00993}00993 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00994}00994                 f-\/>\mbox{\hyperlink{structusb__fifo_a490f136c888d3a396bc84baa115af935}{flag\_iscomplete}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00995}00995         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00996}00996         \textcolor{keywordflow}{return} (1);                     \textcolor{comment}{/* failure */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00997}00997 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00998}00998 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l00999}00999 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01000}01000 ugen\_fs\_set\_complete(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, uint8\_t index)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01001}01001 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01002}01002         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__mbuf}{usb\_mbuf}} *m;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01003}01003 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01004}01004         \mbox{\hyperlink{usb__mbuf_8h_a05824e25e4f99a7aa338aac63b791228}{USB\_IF\_DEQUEUE}}(\&f-\/>\mbox{\hyperlink{structusb__fifo_a04af4d903f6977ba311144684f6c9740}{free\_q}}, m);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01005}01005 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01006}01006         \textcolor{keywordflow}{if} (m == NULL) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01007}01007                 \textcolor{comment}{/* can happen during close */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01008}01008                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}out of buffers\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01009}01009                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01010}01010         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01011}01011         \mbox{\hyperlink{usb__mbuf_8h_aae21720dd72f4585350149ec7f0b8543}{USB\_MBUF\_RESET}}(m);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01012}01012 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01013}01013         *((uint8\_t *)(m-\/>\mbox{\hyperlink{structusb__mbuf_a266a505a5ba6191e526bbba0da412836}{cur\_data\_ptr}})) = index;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01014}01014 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01015}01015         \mbox{\hyperlink{usb__mbuf_8h_a687851a62f15d69c340d6d93268c6686}{USB\_IF\_ENQUEUE}}(\&f-\/>\mbox{\hyperlink{structusb__fifo_a54af5e958bfac462f2642bb588bcc900}{used\_q}}, m);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01016}01016 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01017}01017         f-\/>\mbox{\hyperlink{structusb__fifo_a490f136c888d3a396bc84baa115af935}{flag\_iscomplete}} = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01018}01018 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01019}01019         \mbox{\hyperlink{usbdi_8h_a3f0b9e46ef9b3efb39684bb1272a051c}{usb\_fifo\_wakeup}}(f);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01020}01020 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01021}01021 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01022}01022 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01023}01023 ugen\_fs\_getbuffer(\textcolor{keywordtype}{void} **uptrp, \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, \textcolor{keywordtype}{void} *buffer,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01024}01024     \mbox{\hyperlink{usb__freebsd_8h_ace73c4fca228e0d4c98bc32c063b0714}{usb\_frcount\_t}} \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}})}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01025}01025 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01026}01026         \textcolor{keyword}{union }\{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01027}01027                 \textcolor{keywordtype}{void} **ppBuffer;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01028}01028 \textcolor{preprocessor}{\#ifdef COMPAT\_FREEBSD32}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01029}01029                 uint32\_t *ppBuffer32;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01030}01030 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01031}01031         \} u;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01032}01032 \textcolor{preprocessor}{\#ifdef COMPAT\_FREEBSD32}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01033}01033         uint32\_t uptr32;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01034}01034 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01035}01035 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01036}01036         u.ppBuffer = buffer;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01037}01037         \textcolor{keywordflow}{switch} (f-\/>\mbox{\hyperlink{structusb__fifo_a182c76abd4ba59545622caee89b66c33}{fs\_ep\_sz}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01038}01038         \textcolor{keywordflow}{case} \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fs__endpoint}{usb\_fs\_endpoint}}):}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01039}01039                 if (fueword(u.ppBuffer + n, (long *)uptrp) != 0)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01040}01040                         return (EFAULT);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01041}01041                 return (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01042}01042 \textcolor{preprocessor}{\#ifdef COMPAT\_FREEBSD32}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01043}01043         case sizeof(struct usb\_fs\_endpoint32):}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01044}01044                 if (fueword32(u.ppBuffer32 + n, \&uptr32) != 0)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01045}01045                         return (EFAULT);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01046}01046                 *uptrp = PTRIN(uptr32);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01047}01047                 return (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01048}01048 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01049}01049         default:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01050}01050                 panic("{}\%s: unhandled fs\_ep\_sz \%\#x"{}, \_\_func\_\_, f-\/>fs\_ep\_sz);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01051}01051         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01052}01052 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01053}01053 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01054}01054 static int}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01055}01055 ugen\_fs\_copy\_in(struct usb\_fifo *f, uint8\_t ep\_index)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01056}01056 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01057}01057         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}} *\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01058}01058         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01059}01059         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fs__endpoint}{usb\_fs\_endpoint}} fs\_ep;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01060}01060         \textcolor{keywordtype}{void} *uaddr;                    \textcolor{comment}{/* userland pointer */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01061}01061         \textcolor{keywordtype}{void} *kaddr;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01062}01062         \mbox{\hyperlink{usb__freebsd_8h_a66bb6b1869e5e89aff3b693720b39cfb}{usb\_frlength\_t}} \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01063}01063         \mbox{\hyperlink{usb__freebsd_8h_a66bb6b1869e5e89aff3b693720b39cfb}{usb\_frlength\_t}} rem;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01064}01064         \mbox{\hyperlink{usb__freebsd_8h_ace73c4fca228e0d4c98bc32c063b0714}{usb\_frcount\_t}} \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01065}01065         uint32\_t length;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01066}01066         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01067}01067         uint8\_t isread;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01068}01068 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01069}01069         \textcolor{keywordflow}{if} (ep\_index >= f-\/>\mbox{\hyperlink{structusb__fifo_aa56d107c9e897a1c2602007b3b39c569}{fs\_ep\_max}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01070}01070                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01071}01071         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01072}01072         xfer = f-\/>\mbox{\hyperlink{structusb__fifo_abf80654c6961185168581e9634935db2}{fs\_xfer}}[ep\_index];}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01073}01073         \textcolor{keywordflow}{if} (xfer == NULL) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01074}01074                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01075}01075         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01076}01076         mtx\_lock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01077}01077         \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__transfer_8c_ae863fcac801fc9fdc00b3f3251e05692}{usbd\_transfer\_pending}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01078}01078                 mtx\_unlock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01079}01079                 \textcolor{keywordflow}{return} (EBUSY);         \textcolor{comment}{/* should not happen */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01080}01080         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01081}01081         mtx\_unlock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01082}01082 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01083}01083         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_fs\_copyin(f, ep\_index, \&fs\_ep);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01084}01084         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01085}01085                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01086}01086         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01087}01087         \textcolor{comment}{/* security checks */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01088}01088 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01089}01089         \textcolor{keywordflow}{if} (fs\_ep.nFrames > xfer-\/>\mbox{\hyperlink{structusb__xfer_ada2ba7a46c83ba43ed1ebdc33a431f0c}{max\_frame\_count}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01090}01090                 xfer-\/>\mbox{\hyperlink{structusb__xfer_a85c5e7431b74a154e8313190f6d1d58f}{error}} = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945ac568d752239d287fca75588222df1bdf}{USB\_ERR\_INVAL}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01091}01091                 \textcolor{keywordflow}{goto} complete;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01092}01092         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01093}01093         \textcolor{keywordflow}{if} (fs\_ep.nFrames == 0) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01094}01094                 xfer-\/>\mbox{\hyperlink{structusb__xfer_a85c5e7431b74a154e8313190f6d1d58f}{error}} = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945ac568d752239d287fca75588222df1bdf}{USB\_ERR\_INVAL}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01095}01095                 \textcolor{keywordflow}{goto} complete;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01096}01096         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01097}01097         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_fs\_getbuffer(\&uaddr, f, fs\_ep.ppBuffer, 0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01098}01098         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01099}01099                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01100}01100         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01101}01101         \textcolor{comment}{/* reset first frame */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01102}01102         \mbox{\hyperlink{usb__transfer_8c_aa9f706e03ede8468e81331de474aebb4}{usbd\_xfer\_set\_frame\_offset}}(xfer, 0, 0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01103}01103 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01104}01104         \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a777cf7dd18178f84b0d6e0a086f72a7a}{control\_xfr}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01105}01105                 \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}} = xfer-\/>\mbox{\hyperlink{structusb__xfer_a5937368645458023af557e100989c64a}{frbuffers}}[0].\mbox{\hyperlink{structusb__page__cache_ac3dfc991ca2375bf28920c34d4e11267}{buffer}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01106}01106 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01107}01107                 \textcolor{keywordflow}{if} (fueword32(fs\_ep.pLength, \&length) != 0) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01108}01108                         \textcolor{keywordflow}{return} (EFAULT);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01109}01109                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01110}01110                 \textcolor{keywordflow}{if} (length != \textcolor{keyword}{sizeof}(*\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}})) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01111}01111                         xfer-\/>\mbox{\hyperlink{structusb__xfer_a85c5e7431b74a154e8313190f6d1d58f}{error}} = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945ac568d752239d287fca75588222df1bdf}{USB\_ERR\_INVAL}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01112}01112                         \textcolor{keywordflow}{goto} complete;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01113}01113                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01114}01114                 \textcolor{keywordflow}{if} (length != 0) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01115}01115                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = copyin(uaddr, \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}, length);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01116}01116                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01117}01117                                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01118}01118                         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01119}01119                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01120}01120                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__util_8h_a42e1e1df5311999a79a6eefba78cc5cd}{usb\_check\_request}}(f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}, \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}})) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01121}01121                         xfer-\/>\mbox{\hyperlink{structusb__xfer_a85c5e7431b74a154e8313190f6d1d58f}{error}} = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945ac568d752239d287fca75588222df1bdf}{USB\_ERR\_INVAL}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01122}01122                         \textcolor{keywordflow}{goto} complete;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01123}01123                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01124}01124                 \mbox{\hyperlink{usb__transfer_8c_a31786497f0f4222203b1e993d52af753}{usbd\_xfer\_set\_frame\_len}}(xfer, 0, length);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01125}01125 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01126}01126                 \textcolor{comment}{/* Host mode only ! */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01127}01127                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}-\/>bmRequestType \&}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01128}01128                     (\mbox{\hyperlink{usb_8h_af5074f22163b18c7987cd3ef324cd4e0}{UT\_READ}} | \mbox{\hyperlink{usb_8h_addb3be0c96c8c26046ee252ea60f790f}{UT\_WRITE}})) == \mbox{\hyperlink{usb_8h_af5074f22163b18c7987cd3ef324cd4e0}{UT\_READ}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01129}01129                         isread = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01130}01130                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01131}01131                         isread = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01132}01132                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01133}01133                 \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01134}01134                 \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}} = \textcolor{keyword}{sizeof}(*req);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01135}01135 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01136}01136         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01137}01137                 \textcolor{comment}{/* Device and Host mode */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01138}01138                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__core_8h_a16f75f66a2fd6d118735bc8bc9700883}{USB\_GET\_DATA\_ISREAD}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01139}01139                         isread = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01140}01140                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01141}01141                         isread = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01142}01142                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01143}01143                 \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01144}01144                 \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01145}01145         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01146}01146 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01147}01147         rem = \mbox{\hyperlink{usb__transfer_8c_ae34a7cc2f01c6dfb68bca6fd0b72647e}{usbd\_xfer\_max\_len}}(xfer);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01148}01148         xfer-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}} = fs\_ep.nFrames;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01149}01149         xfer-\/>\mbox{\hyperlink{structusb__xfer_a766f3db3d34b816ff819212c11f27ad3}{timeout}} = fs\_ep.timeout;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01150}01150         \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a766f3db3d34b816ff819212c11f27ad3}{timeout}} > 65535) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01151}01151                 xfer-\/>\mbox{\hyperlink{structusb__xfer_a766f3db3d34b816ff819212c11f27ad3}{timeout}} = 65535;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01152}01152         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01153}01153         \textcolor{keywordflow}{if} (fs\_ep.flags \& \mbox{\hyperlink{usb__ioctl_8h_ad046ef2e2d24e42c5b2f872ce7f17490}{USB\_FS\_FLAG\_SINGLE\_SHORT\_OK}})}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01154}01154                 xfer-\/>\mbox{\hyperlink{structusb__xfer_aa251db061296120bb15fd562088a1d9d}{flags}}.\mbox{\hyperlink{structusb__xfer__flags_a295c379f07c6ff99b213195edc70e3a2}{short\_xfer\_ok}} = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01155}01155         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01156}01156                 xfer-\/>\mbox{\hyperlink{structusb__xfer_aa251db061296120bb15fd562088a1d9d}{flags}}.\mbox{\hyperlink{structusb__xfer__flags_a295c379f07c6ff99b213195edc70e3a2}{short\_xfer\_ok}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01157}01157 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01158}01158         \textcolor{keywordflow}{if} (fs\_ep.flags \& \mbox{\hyperlink{usb__ioctl_8h_a565687b232a68d9362078f0e3e658f9e}{USB\_FS\_FLAG\_MULTI\_SHORT\_OK}})}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01159}01159                 xfer-\/>\mbox{\hyperlink{structusb__xfer_aa251db061296120bb15fd562088a1d9d}{flags}}.\mbox{\hyperlink{structusb__xfer__flags_a4cebfba0749680b43016090e78773210}{short\_frames\_ok}} = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01160}01160         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01161}01161                 xfer-\/>\mbox{\hyperlink{structusb__xfer_aa251db061296120bb15fd562088a1d9d}{flags}}.\mbox{\hyperlink{structusb__xfer__flags_a4cebfba0749680b43016090e78773210}{short\_frames\_ok}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01162}01162 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01163}01163         \textcolor{keywordflow}{if} (fs\_ep.flags \& \mbox{\hyperlink{usb__ioctl_8h_aa5eaef0594f87ab5984a8effb5e12e19}{USB\_FS\_FLAG\_FORCE\_SHORT}})}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01164}01164                 xfer-\/>\mbox{\hyperlink{structusb__xfer_aa251db061296120bb15fd562088a1d9d}{flags}}.\mbox{\hyperlink{structusb__xfer__flags_a76816b701c58c22a9a78904b109c2e95}{force\_short\_xfer}} = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01165}01165         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01166}01166                 xfer-\/>\mbox{\hyperlink{structusb__xfer_aa251db061296120bb15fd562088a1d9d}{flags}}.\mbox{\hyperlink{structusb__xfer__flags_a76816b701c58c22a9a78904b109c2e95}{force\_short\_xfer}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01167}01167 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01168}01168         \textcolor{keywordflow}{if} (fs\_ep.flags \& \mbox{\hyperlink{usb__ioctl_8h_a13c646664ec87e04193407eb741f488c}{USB\_FS\_FLAG\_CLEAR\_STALL}})}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01169}01169                 \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(xfer);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01170}01170         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01171}01171                 xfer-\/>\mbox{\hyperlink{structusb__xfer_aa251db061296120bb15fd562088a1d9d}{flags}}.\mbox{\hyperlink{structusb__xfer__flags_a2c12dafab7afc38dc63f7ba2cd359517}{stall\_pipe}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01172}01172 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01173}01173         \textcolor{keywordflow}{for} (; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} != xfer-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}}; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}++) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01174}01174                 \textcolor{keywordflow}{if} (fueword32(fs\_ep.pLength + \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}, \&length) != 0) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01175}01175                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01176}01176                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01177}01177                 \mbox{\hyperlink{usb__transfer_8c_a31786497f0f4222203b1e993d52af753}{usbd\_xfer\_set\_frame\_len}}(xfer, \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}, length);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01178}01178 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01179}01179                 \textcolor{keywordflow}{if} (length > rem) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01180}01180                         xfer-\/>\mbox{\hyperlink{structusb__xfer_a85c5e7431b74a154e8313190f6d1d58f}{error}} = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945ac568d752239d287fca75588222df1bdf}{USB\_ERR\_INVAL}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01181}01181                         \textcolor{keywordflow}{goto} complete;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01182}01182                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01183}01183                 rem -\/= length;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01184}01184 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01185}01185                 \textcolor{keywordflow}{if} (!isread) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01186}01186                         \textcolor{comment}{/* we need to know the source buffer */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01187}01187                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_fs\_getbuffer(\&uaddr, f, fs\_ep.ppBuffer, \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01188}01188                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01189}01189                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01190}01190                         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01191}01191                         \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a5367e64daae30f55ec887872d577fa80}{isochronous\_xfr}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01192}01192                                 \textcolor{comment}{/* get kernel buffer address */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01193}01193                                 kaddr = xfer-\/>\mbox{\hyperlink{structusb__xfer_a5937368645458023af557e100989c64a}{frbuffers}}[0].\mbox{\hyperlink{structusb__page__cache_ac3dfc991ca2375bf28920c34d4e11267}{buffer}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01194}01194                                 kaddr = \mbox{\hyperlink{usb__core_8h_a68f3f7f9da01956353655ebb6678d641}{USB\_ADD\_BYTES}}(kaddr, \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01195}01195                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01196}01196                                 \textcolor{comment}{/* set current frame offset */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01197}01197                                 \mbox{\hyperlink{usb__transfer_8c_aa9f706e03ede8468e81331de474aebb4}{usbd\_xfer\_set\_frame\_offset}}(xfer, \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}}, \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01198}01198 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01199}01199                                 \textcolor{comment}{/* get kernel buffer address */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01200}01200                                 kaddr = xfer-\/>\mbox{\hyperlink{structusb__xfer_a5937368645458023af557e100989c64a}{frbuffers}}[\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}].\mbox{\hyperlink{structusb__page__cache_ac3dfc991ca2375bf28920c34d4e11267}{buffer}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01201}01201                         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01202}01202 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01203}01203                         \textcolor{comment}{/* move data */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01204}01204                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = copyin(uaddr, kaddr, length);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01205}01205                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01206}01206                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01207}01207                         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01208}01208                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01209}01209                 \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}} += length;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01210}01210         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01211}01211         \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01212}01212 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01213}01213 complete:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01214}01214         mtx\_lock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01215}01215         ugen\_fs\_set\_complete(f, ep\_index);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01216}01216         mtx\_unlock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01217}01217         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01218}01218 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01219}01219 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01220}01220 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fs__endpoint}{usb\_fs\_endpoint}} *}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01221}01221 ugen\_fs\_ep\_uptr(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, uint8\_t ep\_index)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01222}01222 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01223}01223         \textcolor{keywordflow}{return} ((\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fs__endpoint}{usb\_fs\_endpoint}} *)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01224}01224             ((\textcolor{keywordtype}{char} *)f-\/>\mbox{\hyperlink{structusb__fifo_a2050cdc6bc71c106f9d85ff7a70e9cb2}{fs\_ep\_ptr}} + (ep\_index * f-\/>\mbox{\hyperlink{structusb__fifo_a182c76abd4ba59545622caee89b66c33}{fs\_ep\_sz}})));}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01225}01225 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01226}01226 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01227}01227 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01228}01228 ugen\_fs\_copyin(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, uint8\_t ep\_index,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01229}01229     \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fs__endpoint}{usb\_fs\_endpoint}}* fs\_ep)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01230}01230 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01231}01231 \textcolor{preprocessor}{\#ifdef COMPAT\_FREEBSD32}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01232}01232         \textcolor{keyword}{struct }usb\_fs\_endpoint32 fs\_ep32;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01233}01233 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01234}01234         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01235}01235 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01236}01236         \textcolor{keywordflow}{switch} (f-\/>\mbox{\hyperlink{structusb__fifo_a182c76abd4ba59545622caee89b66c33}{fs\_ep\_sz}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01237}01237         \textcolor{keywordflow}{case} \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fs__endpoint}{usb\_fs\_endpoint}}):}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01238}01238                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = copyin(ugen\_fs\_ep\_uptr(f, ep\_index), fs\_ep,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01239}01239                     f-\/>fs\_ep\_sz);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01240}01240                 if (error != 0)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01241}01241                         return (error);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01242}01242                 break;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01243}01243 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01244}01244 \textcolor{preprocessor}{\#ifdef COMPAT\_FREEBSD32}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01245}01245         case sizeof(struct usb\_fs\_endpoint32):}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01246}01246                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = copyin(ugen\_fs\_ep\_uptr(f, ep\_index), \&fs\_ep32,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01247}01247                     f-\/>fs\_ep\_sz);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01248}01248                 if (error != 0)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01249}01249                         return (error);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01250}01250                 PTRIN\_CP(fs\_ep32, *fs\_ep, ppBuffer);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01251}01251                 PTRIN\_CP(fs\_ep32, *fs\_ep, pLength);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01252}01252                 CP(fs\_ep32, *fs\_ep, nFrames);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01253}01253                 CP(fs\_ep32, *fs\_ep, aFrames);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01254}01254                 CP(fs\_ep32, *fs\_ep, flags);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01255}01255                 CP(fs\_ep32, *fs\_ep, timeout);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01256}01256                 CP(fs\_ep32, *fs\_ep, isoc\_time\_complete);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01257}01257                 CP(fs\_ep32, *fs\_ep, status);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01258}01258                 break;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01259}01259 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01260}01260         default:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01261}01261                 panic("{}\%s: unhandled fs\_ep\_sz \%\#x"{}, \_\_func\_\_, f-\/>fs\_ep\_sz);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01262}01262         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01263}01263 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01264}01264         return (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01265}01265 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01266}01266 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01267}01267 static int}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01268}01268 ugen\_fs\_update(const struct usb\_fs\_endpoint *fs\_ep,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01269}01269     struct usb\_fifo *f, uint8\_t ep\_index)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01270}01270 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01271}01271         \textcolor{keyword}{union }\{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01272}01272                 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fs__endpoint}{usb\_fs\_endpoint}} *fs\_ep\_uptr;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01273}01273 \textcolor{preprocessor}{\#ifdef COMPAT\_FREEBSD32}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01274}01274                 \textcolor{keyword}{struct }usb\_fs\_endpoint32 *fs\_ep\_uptr32;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01275}01275 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01276}01276         \} u;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01277}01277         uint32\_t *aFrames\_uptr;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01278}01278         uint16\_t *isoc\_time\_complete\_uptr;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01279}01279         \textcolor{keywordtype}{int} *status\_uptr;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01280}01280 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01281}01281         \textcolor{keywordflow}{switch} (f-\/>\mbox{\hyperlink{structusb__fifo_a182c76abd4ba59545622caee89b66c33}{fs\_ep\_sz}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01282}01282         \textcolor{keywordflow}{case} \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fs__endpoint}{usb\_fs\_endpoint}}):}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01283}01283                 u.fs\_ep\_uptr = ugen\_fs\_ep\_uptr(f, ep\_index);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01284}01284                 aFrames\_uptr = \&u.fs\_ep\_uptr-\/>\mbox{\hyperlink{structusb__fs__endpoint_a23add8796d9b110cc58ab63e677952a0}{aFrames}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01285}01285                 isoc\_time\_complete\_uptr = \&u.fs\_ep\_uptr-\/>\mbox{\hyperlink{structusb__fs__endpoint_a1d4851566f7d0018321427e0367389e9}{isoc\_time\_complete}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01286}01286                 status\_uptr = \&u.fs\_ep\_uptr-\/>\mbox{\hyperlink{structusb__fs__endpoint_a2249c468ce3f111451619c9e736a8e86}{status}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01287}01287                 break;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01288}01288 \textcolor{preprocessor}{\#ifdef COMPAT\_FREEBSD32}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01289}01289         case sizeof(struct usb\_fs\_endpoint32):}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01290}01290                 u.fs\_ep\_uptr32 = (struct usb\_fs\_endpoint32 *)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01291}01291                     ugen\_fs\_ep\_uptr(f, ep\_index);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01292}01292                 aFrames\_uptr = \&u.fs\_ep\_uptr32-\/>\mbox{\hyperlink{structusb__fs__endpoint_a23add8796d9b110cc58ab63e677952a0}{aFrames}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01293}01293                 isoc\_time\_complete\_uptr = \&u.fs\_ep\_uptr32-\/>\mbox{\hyperlink{structusb__fs__endpoint_a1d4851566f7d0018321427e0367389e9}{isoc\_time\_complete}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01294}01294                 status\_uptr = \&u.fs\_ep\_uptr32-\/>\mbox{\hyperlink{structusb__fs__endpoint_a2249c468ce3f111451619c9e736a8e86}{status}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01295}01295                 break;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01296}01296 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01297}01297         default:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01298}01298                 panic("{}\%s: unhandled fs\_ep\_sz \%\#x"{}, \_\_func\_\_, f-\/>fs\_ep\_sz);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01299}01299         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01300}01300 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01301}01301         \textcolor{comment}{/* update "{}aFrames"{} */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01302}01302         if (suword32(aFrames\_uptr, fs\_ep-\/>aFrames) != 0)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01303}01303                 return (EFAULT);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01304}01304 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01305}01305         \textcolor{comment}{/* update "{}isoc\_time\_complete"{} */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01306}01306         if (suword16(isoc\_time\_complete\_uptr, fs\_ep-\/>isoc\_time\_complete) != 0)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01307}01307                 return (EFAULT);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01308}01308 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01309}01309         \textcolor{comment}{/* update "{}status"{} */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01310}01310         if (suword32(status\_uptr, fs\_ep-\/>status) != 0)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01311}01311                 return (EFAULT);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01312}01312 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01313}01313         return (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01314}01314 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01315}01315 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01316}01316 static int}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01317}01317 ugen\_fs\_copy\_out\_cancelled(struct usb\_fifo *f, uint8\_t ep\_index)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01318}01318 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01319}01319         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fs__endpoint}{usb\_fs\_endpoint}} fs\_ep;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01320}01320         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01321}01321 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01322}01322         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_fs\_copyin(f, ep\_index, \&fs\_ep);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01323}01323         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01324}01324                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01325}01325 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01326}01326         fs\_ep.\mbox{\hyperlink{structusb__fs__endpoint_a2249c468ce3f111451619c9e736a8e86}{status}} = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01327}01327         fs\_ep.\mbox{\hyperlink{structusb__fs__endpoint_a23add8796d9b110cc58ab63e677952a0}{aFrames}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01328}01328         fs\_ep.\mbox{\hyperlink{structusb__fs__endpoint_a1d4851566f7d0018321427e0367389e9}{isoc\_time\_complete}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01329}01329 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01330}01330         \textcolor{keywordflow}{return} (ugen\_fs\_update(\&fs\_ep, f, ep\_index));}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01331}01331 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01332}01332 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01333}01333 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01334}01334 ugen\_fs\_copy\_out(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, uint8\_t ep\_index)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01335}01335 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01336}01336         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}} *\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01337}01337         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01338}01338         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fs__endpoint}{usb\_fs\_endpoint}} fs\_ep;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01339}01339         \textcolor{keywordtype}{void} *uaddr;                    \textcolor{comment}{/* userland ptr */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01340}01340         \textcolor{keywordtype}{void} *kaddr;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01341}01341         \mbox{\hyperlink{usb__freebsd_8h_a66bb6b1869e5e89aff3b693720b39cfb}{usb\_frlength\_t}} \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01342}01342         \mbox{\hyperlink{usb__freebsd_8h_a66bb6b1869e5e89aff3b693720b39cfb}{usb\_frlength\_t}} rem;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01343}01343         \mbox{\hyperlink{usb__freebsd_8h_ace73c4fca228e0d4c98bc32c063b0714}{usb\_frcount\_t}} \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01344}01344         uint32\_t length;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01345}01345         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01346}01346         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01347}01347         uint8\_t isread;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01348}01348 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01349}01349         \textcolor{keywordflow}{if} (ep\_index >= f-\/>\mbox{\hyperlink{structusb__fifo_aa56d107c9e897a1c2602007b3b39c569}{fs\_ep\_max}})}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01350}01350                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01351}01351 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01352}01352         xfer = f-\/>\mbox{\hyperlink{structusb__fifo_abf80654c6961185168581e9634935db2}{fs\_xfer}}[ep\_index];}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01353}01353         \textcolor{keywordflow}{if} (xfer == NULL)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01354}01354                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01355}01355 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01356}01356         mtx\_lock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01357}01357         \textcolor{keywordflow}{if} (!xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a05b71f22cb3a7cf08474b6ed4f630d14}{transferring}} \&\&}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01358}01358             !xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a94e1972b73c853fafca449c099739ffb}{started}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01359}01359                 mtx\_unlock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01360}01360                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Returning fake cancel event\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01361}01361                 \textcolor{keywordflow}{return} (ugen\_fs\_copy\_out\_cancelled(f, ep\_index));}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01362}01362         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__transfer_8c_ae863fcac801fc9fdc00b3f3251e05692}{usbd\_transfer\_pending}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01363}01363                 mtx\_unlock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01364}01364                 \textcolor{keywordflow}{return} (EBUSY);         \textcolor{comment}{/* should not happen */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01365}01365         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01366}01366         mtx\_unlock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01367}01367 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01368}01368         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_fs\_copyin(f, ep\_index, \&fs\_ep);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01369}01369         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01370}01370                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01371}01371         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01372}01372 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01373}01373         fs\_ep.\mbox{\hyperlink{structusb__fs__endpoint_a2249c468ce3f111451619c9e736a8e86}{status}} = xfer-\/>\mbox{\hyperlink{structusb__xfer_a85c5e7431b74a154e8313190f6d1d58f}{error}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01374}01374         fs\_ep.\mbox{\hyperlink{structusb__fs__endpoint_a23add8796d9b110cc58ab63e677952a0}{aFrames}} = xfer-\/>\mbox{\hyperlink{structusb__xfer_a7f58fffa56cac11410055f785c4c5ffa}{aframes}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01375}01375         fs\_ep.\mbox{\hyperlink{structusb__fs__endpoint_a1d4851566f7d0018321427e0367389e9}{isoc\_time\_complete}} = xfer-\/>\mbox{\hyperlink{structusb__xfer_af3b367b4cd09864247d2165a6277eff7}{isoc\_time\_complete}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01376}01376         \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a85c5e7431b74a154e8313190f6d1d58f}{error}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01377}01377                 \textcolor{keywordflow}{goto} complete;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01378}01378         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01379}01379         \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a777cf7dd18178f84b0d6e0a086f72a7a}{control\_xfr}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01380}01380                 \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}} = xfer-\/>\mbox{\hyperlink{structusb__xfer_a5937368645458023af557e100989c64a}{frbuffers}}[0].\mbox{\hyperlink{structusb__page__cache_ac3dfc991ca2375bf28920c34d4e11267}{buffer}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01381}01381 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01382}01382                 \textcolor{comment}{/* Host mode only ! */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01383}01383                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}-\/>bmRequestType \& (\mbox{\hyperlink{usb_8h_af5074f22163b18c7987cd3ef324cd4e0}{UT\_READ}} | \mbox{\hyperlink{usb_8h_addb3be0c96c8c26046ee252ea60f790f}{UT\_WRITE}})) == \mbox{\hyperlink{usb_8h_af5074f22163b18c7987cd3ef324cd4e0}{UT\_READ}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01384}01384                         isread = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01385}01385                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01386}01386                         isread = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01387}01387                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01388}01388                 \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}} == 0)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01389}01389                         \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} = 0;         \textcolor{comment}{/* should never happen */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01390}01390                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01391}01391                         \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01392}01392         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01393}01393                 \textcolor{comment}{/* Device and Host mode */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01394}01394                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__core_8h_a16f75f66a2fd6d118735bc8bc9700883}{USB\_GET\_DATA\_ISREAD}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01395}01395                         isread = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01396}01396                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01397}01397                         isread = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01398}01398                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01399}01399                 \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01400}01400         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01401}01401 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01402}01402         \textcolor{comment}{/* Update lengths and copy out data */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01403}01403 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01404}01404         rem = \mbox{\hyperlink{usb__transfer_8c_ae34a7cc2f01c6dfb68bca6fd0b72647e}{usbd\_xfer\_max\_len}}(xfer);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01405}01405         \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01406}01406 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01407}01407         \textcolor{keywordflow}{for} (; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} != xfer-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}}; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}++) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01408}01408                 \textcolor{comment}{/* get initial length into "{}temp"{} */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01409}01409                 \textcolor{keywordflow}{if} (fueword32(fs\_ep.\mbox{\hyperlink{structusb__fs__endpoint_a539edc5ee7fe296606677af308377f15}{pLength}} + \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}, \&temp) != 0) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01410}01410                         \textcolor{keywordflow}{return} (EFAULT);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01411}01411                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01412}01412                 \textcolor{keywordflow}{if} (temp > rem) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01413}01413                         \textcolor{comment}{/* the userland length has been corrupted */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01414}01414                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}corrupt userland length "{}}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01415}01415                             \textcolor{stringliteral}{"{}\%u > \%u\(\backslash\)n"{}}, temp, rem);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01416}01416                         fs\_ep.\mbox{\hyperlink{structusb__fs__endpoint_a2249c468ce3f111451619c9e736a8e86}{status}} = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945ac568d752239d287fca75588222df1bdf}{USB\_ERR\_INVAL}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01417}01417                         \textcolor{keywordflow}{goto} complete;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01418}01418                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01419}01419                 rem -\/= temp;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01420}01420 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01421}01421                 \textcolor{comment}{/* get actual transfer length */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01422}01422                 length = xfer-\/>\mbox{\hyperlink{structusb__xfer_a04bfeb929b15a30d355f94eb7ff2a586}{frlengths}}[\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}];}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01423}01423                 \textcolor{keywordflow}{if} (length > temp) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01424}01424                         \textcolor{comment}{/* data overflow */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01425}01425                         fs\_ep.\mbox{\hyperlink{structusb__fs__endpoint_a2249c468ce3f111451619c9e736a8e86}{status}} = \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945ac568d752239d287fca75588222df1bdf}{USB\_ERR\_INVAL}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01426}01426                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}data overflow \%u > \%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01427}01427                             length, temp);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01428}01428                         \textcolor{keywordflow}{goto} complete;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01429}01429                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01430}01430                 \textcolor{keywordflow}{if} (isread) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01431}01431                         \textcolor{comment}{/* we need to know the destination buffer */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01432}01432                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_fs\_getbuffer(\&uaddr, f, fs\_ep.\mbox{\hyperlink{structusb__fs__endpoint_ada33b05ce157e4d4e617a4d979f77b10}{ppBuffer}}, \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01433}01433                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01434}01434                                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01435}01435                         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01436}01436                         \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a5367e64daae30f55ec887872d577fa80}{isochronous\_xfr}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01437}01437                                 \textcolor{comment}{/* only one frame buffer */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01438}01438                                 kaddr = \mbox{\hyperlink{usb__core_8h_a68f3f7f9da01956353655ebb6678d641}{USB\_ADD\_BYTES}}(}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01439}01439                                     xfer-\/>\mbox{\hyperlink{structusb__xfer_a5937368645458023af557e100989c64a}{frbuffers}}[0].\mbox{\hyperlink{structusb__page__cache_ac3dfc991ca2375bf28920c34d4e11267}{buffer}}, \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01440}01440                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01441}01441                                 \textcolor{comment}{/* multiple frame buffers */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01442}01442                                 kaddr = xfer-\/>\mbox{\hyperlink{structusb__xfer_a5937368645458023af557e100989c64a}{frbuffers}}[\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}].\mbox{\hyperlink{structusb__page__cache_ac3dfc991ca2375bf28920c34d4e11267}{buffer}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01443}01443                         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01444}01444 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01445}01445                         \textcolor{comment}{/* move data */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01446}01446                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = copyout(kaddr, uaddr, length);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01447}01447                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01448}01448                                 \textcolor{keywordflow}{goto} complete;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01449}01449                         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01450}01450                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01451}01451                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01452}01452 \textcolor{comment}{                 * Update offset according to initial length, which is}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01453}01453 \textcolor{comment}{                 * needed by isochronous transfers!}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01454}01454 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01455}01455                 \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}} += temp;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01456}01456 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01457}01457                 \textcolor{comment}{/* update length */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01458}01458                 \textcolor{keywordflow}{if} (suword32(fs\_ep.\mbox{\hyperlink{structusb__fs__endpoint_a539edc5ee7fe296606677af308377f15}{pLength}} + \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}, length) != 0)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01459}01459                         \textcolor{keywordflow}{goto} complete;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01460}01460         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01461}01461 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01462}01462 complete:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01463}01463         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} == 0)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01464}01464                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_fs\_update(\&fs\_ep, f, ep\_index);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01465}01465         \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01466}01466 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01467}01467 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01468}01468 \textcolor{keyword}{static} uint8\_t}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01469}01469 ugen\_fifo\_in\_use(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, \textcolor{keywordtype}{int} fflags)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01470}01470 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01471}01471         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f\_rx;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01472}01472         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f\_tx;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01473}01473 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01474}01474         f\_rx = f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}-\/>fifo[(f-\/>\mbox{\hyperlink{structusb__fifo_a5cc5a0e8389115de3edfcdae29d1bcc9}{fifo\_index}} \& \string~1) + \mbox{\hyperlink{usbdi_8h_aa4759b44daa392a7b438d6fba784f30a}{USB\_FIFO\_RX}}];}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01475}01475         f\_tx = f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}-\/>fifo[(f-\/>\mbox{\hyperlink{structusb__fifo_a5cc5a0e8389115de3edfcdae29d1bcc9}{fifo\_index}} \& \string~1) + \mbox{\hyperlink{usbdi_8h_ab42694ba7d2dc0d510f4a139fb8cf5d8}{USB\_FIFO\_TX}}];}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01476}01476 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01477}01477         \textcolor{keywordflow}{if} ((fflags \& FREAD) \&\& f\_rx \&\&}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01478}01478             (f\_rx-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[0] || f\_rx-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[1])) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01479}01479                 \textcolor{keywordflow}{return} (1);             \textcolor{comment}{/* RX FIFO in use */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01480}01480         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01481}01481         \textcolor{keywordflow}{if} ((fflags \& FWRITE) \&\& f\_tx \&\&}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01482}01482             (f\_tx-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[0] || f\_tx-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[1])) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01483}01483                 \textcolor{keywordflow}{return} (1);             \textcolor{comment}{/* TX FIFO in use */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01484}01484         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01485}01485         \textcolor{keywordflow}{return} (0);                     \textcolor{comment}{/* not in use */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01486}01486 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01487}01487 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01488}01488 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01489}01489 ugen\_ioctl(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, u\_long cmd, \textcolor{keywordtype}{void} *addr, \textcolor{keywordtype}{int} fflags)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01490}01490 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01491}01491         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__config}{usb\_config}} \mbox{\hyperlink{structusb__config}{usb\_config}}[1];}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01492}01492         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}} \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01493}01493         \textcolor{keyword}{union }\{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01494}01494                 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fs__complete}{usb\_fs\_complete}} *pcomp;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01495}01495                 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fs__start}{usb\_fs\_start}} *pstart;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01496}01496                 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fs__stop}{usb\_fs\_stop}} *pstop;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01497}01497                 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fs__open}{usb\_fs\_open}} *popen;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01498}01498                 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fs__open__stream}{usb\_fs\_open\_stream}} *popen\_stream;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01499}01499                 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fs__close}{usb\_fs\_close}} *pclose;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01500}01500                 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fs__clear__stall__sync}{usb\_fs\_clear\_stall\_sync}} *pstall;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01501}01501                 \textcolor{keywordtype}{void}   *addr;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01502}01502         \}     u;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01503}01503         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__endpoint}{usb\_endpoint}} *ep;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01504}01504         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__endpoint__descriptor}{usb\_endpoint\_descriptor}} *ed;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01505}01505         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01506}01506         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01507}01507         uint8\_t iface\_index;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01508}01508         uint8\_t isread;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01509}01509         uint8\_t ep\_index;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01510}01510         uint8\_t pre\_scale;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01511}01511 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01512}01512         u.addr = addr;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01513}01513 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01514}01514         DPRINTFN(6, \textcolor{stringliteral}{"{}cmd=0x\%08lx\(\backslash\)n"{}}, cmd);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01515}01515 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01516}01516         \textcolor{keywordflow}{switch} (cmd) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01517}01517         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a8f45f823431202729449b71387bb98dd}{USB\_FS\_COMPLETE}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01518}01518                 mtx\_lock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01519}01519                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_fs\_get\_complete(f, \&ep\_index);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01520}01520                 mtx\_unlock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01521}01521 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01522}01522                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01523}01523                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EBUSY;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01524}01524                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01525}01525                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01526}01526                 u.pcomp-\/>ep\_index = ep\_index;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01527}01527                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_fs\_copy\_out(f, u.pcomp-\/>ep\_index);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01528}01528                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01529}01529 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01530}01530         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_acae0e77013820f802fd46d845a29e9a2}{USB\_FS\_START}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01531}01531                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_fs\_copy\_in(f, u.pstart-\/>ep\_index);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01532}01532                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01533}01533                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01534}01534                 mtx\_lock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01535}01535                 xfer = f-\/>\mbox{\hyperlink{structusb__fifo_abf80654c6961185168581e9634935db2}{fs\_xfer}}[u.pstart-\/>ep\_index];}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01536}01536                 \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(xfer);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01537}01537                 mtx\_unlock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01538}01538                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01539}01539 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01540}01540         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a027356e863044b715a93348106c498e2}{USB\_FS\_STOP}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01541}01541                 \textcolor{keywordflow}{if} (u.pstop-\/>ep\_index >= f-\/>\mbox{\hyperlink{structusb__fifo_aa56d107c9e897a1c2602007b3b39c569}{fs\_ep\_max}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01542}01542                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01543}01543                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01544}01544                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01545}01545                 mtx\_lock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01546}01546                 xfer = f-\/>\mbox{\hyperlink{structusb__fifo_abf80654c6961185168581e9634935db2}{fs\_xfer}}[u.pstart-\/>ep\_index];}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01547}01547                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__transfer_8c_ae863fcac801fc9fdc00b3f3251e05692}{usbd\_transfer\_pending}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01548}01548                         \mbox{\hyperlink{usb__transfer_8c_abe245d973df0cfd6fb96b884d33ebce3}{usbd\_transfer\_stop}}(xfer);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01549}01549 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01550}01550                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01551}01551 \textcolor{comment}{                         * Check if the USB transfer was stopped}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01552}01552 \textcolor{comment}{                         * before it was even started and fake a}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01553}01553 \textcolor{comment}{                         * cancel event.}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01554}01554 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01555}01555                         \textcolor{keywordflow}{if} (!xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a05b71f22cb3a7cf08474b6ed4f630d14}{transferring}} \&\&}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01556}01556                             !xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a94e1972b73c853fafca449c099739ffb}{started}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01557}01557                                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Issuing fake completion event\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01558}01558                                 ugen\_fs\_set\_complete(xfer-\/>\mbox{\hyperlink{structusb__xfer_a58505609405c158ae7e2d467cc55b020}{priv\_sc}},}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01559}01559                                     \mbox{\hyperlink{usb__core_8h_a00ef950bac3cbecb8c5eabab123272d5}{USB\_P2U}}(xfer-\/>\mbox{\hyperlink{structusb__xfer_a0c9596757cc98e5aeb893a738dc73a72}{priv\_fifo}}));}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01560}01560                         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01561}01561                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01562}01562                 mtx\_unlock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01563}01563                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01564}01564 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01565}01565         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a0f1df17d4250c1010e672e8a307819be}{USB\_FS\_OPEN}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01566}01566         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a1ac3771664eed6cde058377493c21633}{USB\_FS\_OPEN\_STREAM}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01567}01567                 \textcolor{keywordflow}{if} (u.popen-\/>ep\_index >= f-\/>\mbox{\hyperlink{structusb__fifo_aa56d107c9e897a1c2602007b3b39c569}{fs\_ep\_max}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01568}01568                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01569}01569                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01570}01570                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01571}01571                 \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_abf80654c6961185168581e9634935db2}{fs\_xfer}}[u.popen-\/>ep\_index] != NULL) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01572}01572                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EBUSY;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01573}01573                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01574}01574                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01575}01575                 \textcolor{keywordflow}{if} (u.popen-\/>max\_bufsize > \mbox{\hyperlink{usb__ioctl_8h_ab20c13b0c2c65c6e73cca3462c0f0e8d}{USB\_FS\_MAX\_BUFSIZE}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01576}01576                         u.popen-\/>max\_bufsize = \mbox{\hyperlink{usb__ioctl_8h_ab20c13b0c2c65c6e73cca3462c0f0e8d}{USB\_FS\_MAX\_BUFSIZE}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01577}01577                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01578}01578                 \textcolor{keywordflow}{if} (u.popen-\/>max\_frames \& \mbox{\hyperlink{usb__ioctl_8h_a1b47cbc2cee9a960fed537ae7d7ea1bc}{USB\_FS\_MAX\_FRAMES\_PRE\_SCALE}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01579}01579                         pre\_scale = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01580}01580                         u.popen-\/>max\_frames \&= \string~USB\_FS\_MAX\_FRAMES\_PRE\_SCALE;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01581}01581                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01582}01582                         pre\_scale = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01583}01583                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01584}01584                 \textcolor{keywordflow}{if} (u.popen-\/>max\_frames > \mbox{\hyperlink{usb__ioctl_8h_a1ee8bfb9cc14840372c02c083c7aed10}{USB\_FS\_MAX\_FRAMES}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01585}01585                         u.popen-\/>max\_frames = \mbox{\hyperlink{usb__ioctl_8h_a1ee8bfb9cc14840372c02c083c7aed10}{USB\_FS\_MAX\_FRAMES}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01586}01586                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01587}01587                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01588}01588                 \textcolor{keywordflow}{if} (u.popen-\/>max\_frames == 0) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01589}01589                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01590}01590                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01591}01591                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01592}01592                 ep = \mbox{\hyperlink{usb__device_8c_abb8c67ad52ff01e2b863cc2d7e3c7dbc}{usbd\_get\_ep\_by\_addr}}(f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}, u.popen-\/>ep\_no);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01593}01593                 \textcolor{keywordflow}{if} (ep == NULL) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01594}01594                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01595}01595                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01596}01596                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01597}01597                 ed = ep-\/>\mbox{\hyperlink{structusb__endpoint_af3b96b9fe1e612b303833c2e2d0365e1}{edesc}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01598}01598                 \textcolor{keywordflow}{if} (ed == NULL) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01599}01599                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ENXIO;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01600}01600                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01601}01601                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01602}01602                 iface\_index = ep-\/>\mbox{\hyperlink{structusb__endpoint_a580fcd46d189c26accb301203a97bf43}{iface\_index}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01603}01603 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01604}01604                 memset(\mbox{\hyperlink{structusb__config}{usb\_config}}, 0, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{structusb__config}{usb\_config}}));}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01605}01605 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01606}01606                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a5bd5d569870291a54d9bed8377ed8b10}{type}} = ed-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_aff28dcc97802a405b31baccd33c2bf8f}{bmAttributes}} \& \mbox{\hyperlink{usb_8h_a8badd3504359a0aed83ac575a46a67b4}{UE\_XFERTYPE}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01607}01607                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a81074abe7ded5be9dabdf9bcfed79317}{endpoint}} = ed-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_a3d0a0ab41c53023055a242d66a437a2d}{bEndpointAddress}} \& \mbox{\hyperlink{usb_8h_a227db1f194f105a22faae81401d3e18e}{UE\_ADDR}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01608}01608                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a7df71cda1db402b095c2eab34e28feab}{direction}} = ed-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_a3d0a0ab41c53023055a242d66a437a2d}{bEndpointAddress}} \& (\mbox{\hyperlink{usb_8h_a9a98e1bc9388db2ab5213e9d6496e851}{UE\_DIR\_OUT}} | \mbox{\hyperlink{usb_8h_a72bb077a860132c175c166f344c75893}{UE\_DIR\_IN}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01609}01609                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_adb5ccd473bd3b92d01d005c8faed656d}{interval}} = \mbox{\hyperlink{usbdi_8h_a230a796257ac99a7977a90c4fc9e1c09}{USB\_DEFAULT\_INTERVAL}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01610}01610                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a0e7feb3ff903ed490f21c1e5b128fc71}{flags}}.\mbox{\hyperlink{structusb__xfer__flags_a0654b9d81007fe4e04eca967e546c4c0}{proxy\_buffer}} = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01611}01611                 \textcolor{keywordflow}{if} (pre\_scale != 0)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01612}01612                         \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a0e7feb3ff903ed490f21c1e5b128fc71}{flags}}.\mbox{\hyperlink{structusb__xfer__flags_a98ca1b16485efe9047956752474cfbf3}{pre\_scale\_frames}} = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01613}01613                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_ad6cf53d455b808964f881c91074d2696}{callback}} = \&ugen\_ctrl\_fs\_callback;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01614}01614                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a80178ca6c609b484f4cd441928940d16}{timeout}} = 0;     \textcolor{comment}{/* no timeout */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01615}01615                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a54ec61088238cb0e3128eecd279aa7f0}{frames}} = u.popen-\/>max\_frames;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01616}01616                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a730af89f830066662eac76401fc037ff}{bufsize}} = u.popen-\/>max\_bufsize;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01617}01617                 \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a45b9e9ae72187e9854d90fbf8542c2ce}{usb\_mode}} = \mbox{\hyperlink{usb_8h_a9bc559812598988121896dceb483806ba19aff234971ad0a6d11fe4be56176106}{USB\_MODE\_DUAL}};  \textcolor{comment}{/* both modes */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01618}01618                 \textcolor{keywordflow}{if} (cmd == \mbox{\hyperlink{usb__ioctl_8h_a1ac3771664eed6cde058377493c21633}{USB\_FS\_OPEN\_STREAM}})}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01619}01619                         \mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a4129bd12510d8e621af9edf9468e6872}{stream\_id}} = u.popen\_stream-\/>stream\_id;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01620}01620 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01621}01621                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structusb__config}{usb\_config}}[0].type == \mbox{\hyperlink{usb_8h_ace49b7adb24ebcb0a0b17110c26aa63a}{UE\_CONTROL}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01622}01622                         \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{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{usb__generic_8c_source_l01623}01623                                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01624}01624                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01625}01625                         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01626}01626                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01627}01627                         isread = ((\mbox{\hyperlink{structusb__config}{usb\_config}}[0].\mbox{\hyperlink{structusb__config_a81074abe7ded5be9dabdf9bcfed79317}{endpoint}} \&}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01628}01628                             (\mbox{\hyperlink{usb_8h_a72bb077a860132c175c166f344c75893}{UE\_DIR\_IN}} | \mbox{\hyperlink{usb_8h_a9a98e1bc9388db2ab5213e9d6496e851}{UE\_DIR\_OUT}})) == \mbox{\hyperlink{usb_8h_a72bb077a860132c175c166f344c75893}{UE\_DIR\_IN}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01629}01629 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01630}01630                         \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{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{usb__generic_8c_source_l01631}01631                                 isread = !isread;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01632}01632                         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01633}01633                         \textcolor{comment}{/* check permissions */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01634}01634                         \textcolor{keywordflow}{if} (isread) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01635}01635                                 \textcolor{keywordflow}{if} (!(fflags \& FREAD)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01636}01636                                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EPERM;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01637}01637                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01638}01638                                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01639}01639                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01640}01640                                 \textcolor{keywordflow}{if} (!(fflags \& FWRITE)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01641}01641                                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EPERM;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01642}01642                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01643}01643                                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01644}01644                         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01645}01645                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01646}01646                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usb__transfer_8c_a7494c04fae5c5e7ef1af436308670a21}{usbd\_transfer\_setup}}(f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}, \&iface\_index,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01647}01647                     f-\/>\mbox{\hyperlink{structusb__fifo_abf80654c6961185168581e9634935db2}{fs\_xfer}} + u.popen-\/>ep\_index, \mbox{\hyperlink{structusb__config}{usb\_config}}, 1,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01648}01648                     f, f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01649}01649                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} == 0) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01650}01650                         \textcolor{comment}{/* update maximums */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01651}01651                         u.popen-\/>max\_packet\_length =}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01652}01652                             f-\/>\mbox{\hyperlink{structusb__fifo_abf80654c6961185168581e9634935db2}{fs\_xfer}}[u.popen-\/>ep\_index]-\/>\mbox{\hyperlink{structusb__xfer_ae115ce000f084f7d5f8c005fa88d2703}{max\_frame\_size}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01653}01653                         u.popen-\/>max\_bufsize =}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01654}01654                             f-\/>\mbox{\hyperlink{structusb__fifo_abf80654c6961185168581e9634935db2}{fs\_xfer}}[u.popen-\/>ep\_index]-\/>\mbox{\hyperlink{structusb__xfer_a3ece1de738e7c3ca20f0bfdbd827fd16}{max\_data\_length}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01655}01655                         \textcolor{comment}{/* update number of frames */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01656}01656                         u.popen-\/>max\_frames =}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01657}01657                             f-\/>\mbox{\hyperlink{structusb__fifo_abf80654c6961185168581e9634935db2}{fs\_xfer}}[u.popen-\/>ep\_index]-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01658}01658                         \textcolor{comment}{/* store index of endpoint */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01659}01659                         f-\/>\mbox{\hyperlink{structusb__fifo_abf80654c6961185168581e9634935db2}{fs\_xfer}}[u.popen-\/>ep\_index]-\/>\mbox{\hyperlink{structusb__xfer_a0c9596757cc98e5aeb893a738dc73a72}{priv\_fifo}} =}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01660}01660                             ((uint8\_t *)0) + u.popen-\/>ep\_index;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01661}01661                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01662}01662                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ENOMEM;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01663}01663                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01664}01664                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01665}01665 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01666}01666         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_aaa279e0be9c8ef59ffb8560cc3f610c0}{USB\_FS\_CLOSE}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01667}01667                 \textcolor{keywordflow}{if} (u.pclose-\/>ep\_index >= f-\/>\mbox{\hyperlink{structusb__fifo_aa56d107c9e897a1c2602007b3b39c569}{fs\_ep\_max}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01668}01668                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01669}01669                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01670}01670                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01671}01671                 \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_abf80654c6961185168581e9634935db2}{fs\_xfer}}[u.pclose-\/>ep\_index] == NULL) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01672}01672                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01673}01673                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01674}01674                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01675}01675                 \mbox{\hyperlink{usb__transfer_8c_a2f5ab55bfe7f356bb7a7505ff35c9741}{usbd\_transfer\_unsetup}}(f-\/>\mbox{\hyperlink{structusb__fifo_abf80654c6961185168581e9634935db2}{fs\_xfer}} + u.pclose-\/>ep\_index, 1);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01676}01676                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01677}01677 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01678}01678         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a30b932d9cd52b876c92fcc966141a7e7}{USB\_FS\_CLEAR\_STALL\_SYNC}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01679}01679                 \textcolor{keywordflow}{if} (u.pstall-\/>ep\_index >= f-\/>\mbox{\hyperlink{structusb__fifo_aa56d107c9e897a1c2602007b3b39c569}{fs\_ep\_max}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01680}01680                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01681}01681                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01682}01682                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01683}01683                 \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_abf80654c6961185168581e9634935db2}{fs\_xfer}}[u.pstall-\/>ep\_index] == NULL) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01684}01684                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01685}01685                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01686}01686                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01687}01687                 \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{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{usb__generic_8c_source_l01688}01688                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01689}01689                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01690}01690                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01691}01691                 mtx\_lock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01692}01692                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usb__transfer_8c_ae863fcac801fc9fdc00b3f3251e05692}{usbd\_transfer\_pending}}(f-\/>\mbox{\hyperlink{structusb__fifo_abf80654c6961185168581e9634935db2}{fs\_xfer}}[u.pstall-\/>ep\_index]);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01693}01693                 mtx\_unlock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01694}01694 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01695}01695                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01696}01696                         \textcolor{keywordflow}{return} (EBUSY);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01697}01697                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01698}01698                 ep = f-\/>\mbox{\hyperlink{structusb__fifo_abf80654c6961185168581e9634935db2}{fs\_xfer}}[u.pstall-\/>ep\_index]-\/>\mbox{\hyperlink{structusb__xfer_a8de3fd948d496c7901b307b13a1c6e99}{endpoint}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01699}01699 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01700}01700                 \textcolor{comment}{/* setup a clear-\/stall packet */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01701}01701                 \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bmRequestType = \mbox{\hyperlink{usb_8h_ab592eead7baaa45331e0e4768c0259dd}{UT\_WRITE\_ENDPOINT}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01702}01702                 \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bRequest = \mbox{\hyperlink{usb_8h_a49bd676481c413d1ec4a527664ac02a9}{UR\_CLEAR\_FEATURE}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01703}01703                 \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wValue, \mbox{\hyperlink{usb_8h_a26900a08e106a6bcb220fac754e1b815}{UF\_ENDPOINT\_HALT}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01704}01704                 \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wIndex[0] = ep-\/>\mbox{\hyperlink{structusb__endpoint_af3b96b9fe1e612b303833c2e2d0365e1}{edesc}}-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_a3d0a0ab41c53023055a242d66a437a2d}{bEndpointAddress}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01705}01705                 \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wIndex[1] = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01706}01706                 \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wLength, 0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01707}01707 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01708}01708                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usbdi_8h_adf0c9751da27fa2e6a3b52a9bfd5f7d1}{usbd\_do\_request}}(f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}, NULL, \&\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}, NULL);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01709}01709                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} == 0) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01710}01710                         \mbox{\hyperlink{usb__transfer_8c_af0af41ee8b38c9c06835b49f59c00474}{usbd\_clear\_data\_toggle}}(f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}, ep);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01711}01711                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01712}01712                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ENXIO;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01713}01713                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01714}01714                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01715}01715 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01716}01716         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01717}01717                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ENOIOCTL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01718}01718                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01719}01719         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01720}01720 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01721}01721         DPRINTFN(6, \textcolor{stringliteral}{"{}error=\%d\(\backslash\)n"{}}, \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01722}01722 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01723}01723         \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01724}01724 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01725}01725 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01726}01726 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01727}01727 ugen\_set\_short\_xfer(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, \textcolor{keywordtype}{void} *addr)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01728}01728 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01729}01729         uint8\_t t;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01730}01730 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01731}01731         \textcolor{keywordflow}{if} (*(\textcolor{keywordtype}{int} *)addr)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01732}01732                 t = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01733}01733         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01734}01734                 t = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01735}01735 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01736}01736         \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_a32b5344167da15bf3f21c4fdff73dc31}{flag\_short}} == t) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01737}01737                 \textcolor{comment}{/* same value like before -\/ accept */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01738}01738                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01739}01739         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01740}01740         \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[0] || f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[1]) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01741}01741                 \textcolor{comment}{/* cannot change this during transfer */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01742}01742                 \textcolor{keywordflow}{return} (EBUSY);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01743}01743         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01744}01744         f-\/>\mbox{\hyperlink{structusb__fifo_a32b5344167da15bf3f21c4fdff73dc31}{flag\_short}} = t;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01745}01745         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01746}01746 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01747}01747 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01748}01748 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01749}01749 ugen\_set\_timeout(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, \textcolor{keywordtype}{void} *addr)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01750}01750 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01751}01751         f-\/>\mbox{\hyperlink{structusb__fifo_aa384f6ccccf0b7fb3700db928bcc737e}{timeout}} = *(\textcolor{keywordtype}{int} *)addr;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01752}01752         \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_aa384f6ccccf0b7fb3700db928bcc737e}{timeout}} > 65535) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01753}01753                 \textcolor{comment}{/* limit user input */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01754}01754                 f-\/>\mbox{\hyperlink{structusb__fifo_aa384f6ccccf0b7fb3700db928bcc737e}{timeout}} = 65535;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01755}01755         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01756}01756         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01757}01757 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01758}01758 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01759}01759 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01760}01760 ugen\_get\_frame\_size(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, \textcolor{keywordtype}{void} *addr)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01761}01761 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01762}01762         \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[0]) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01763}01763                 *(\textcolor{keywordtype}{int} *)addr = f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[0]-\/>\mbox{\hyperlink{structusb__xfer_ae115ce000f084f7d5f8c005fa88d2703}{max\_frame\_size}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01764}01764         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01765}01765                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01766}01766         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01767}01767         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01768}01768 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01769}01769 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01770}01770 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01771}01771 ugen\_set\_buffer\_size(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, \textcolor{keywordtype}{void} *addr)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01772}01772 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01773}01773         \mbox{\hyperlink{usb__freebsd_8h_a66bb6b1869e5e89aff3b693720b39cfb}{usb\_frlength\_t}} t;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01774}01774 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01775}01775         \textcolor{keywordflow}{if} (*(\textcolor{keywordtype}{int} *)addr < 0)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01776}01776                 t = 0;          \textcolor{comment}{/* use "{}wMaxPacketSize"{} */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01777}01777         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (*(\textcolor{keywordtype}{int} *)addr < (256 * 1024))}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01778}01778                 t = *(\textcolor{keywordtype}{int} *)addr;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01779}01779         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01780}01780                 t = 256 * 1024;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01781}01781 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01782}01782         \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_a6f41b257bf5b7a4ff66dde269f24aac5}{bufsize}} == t) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01783}01783                 \textcolor{comment}{/* same value like before -\/ accept */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01784}01784                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01785}01785         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01786}01786         \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[0] || f-\/>\mbox{\hyperlink{structusb__fifo_af754b85dc62a60d4552986ba287d581b}{xfer}}[1]) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01787}01787                 \textcolor{comment}{/* cannot change this during transfer */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01788}01788                 \textcolor{keywordflow}{return} (EBUSY);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01789}01789         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01790}01790         f-\/>\mbox{\hyperlink{structusb__fifo_a6f41b257bf5b7a4ff66dde269f24aac5}{bufsize}} = t;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01791}01791         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01792}01792 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01793}01793 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01794}01794 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01795}01795 ugen\_get\_buffer\_size(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, \textcolor{keywordtype}{void} *addr)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01796}01796 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01797}01797         *(\textcolor{keywordtype}{int} *)addr = f-\/>\mbox{\hyperlink{structusb__fifo_a6f41b257bf5b7a4ff66dde269f24aac5}{bufsize}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01798}01798         return (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01799}01799 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01800}01800 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01801}01801 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01802}01802 ugen\_get\_iface\_desc(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01803}01803     \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__interface__descriptor}{usb\_interface\_descriptor}} *idesc)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01804}01804 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01805}01805         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__interface}{usb\_interface}} *iface;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01806}01806 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01807}01807         iface = \mbox{\hyperlink{usb__device_8c_ad241549c2225f6ccb72345851d5b9ed8}{usbd\_get\_iface}}(f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}, f-\/>\mbox{\hyperlink{structusb__fifo_a7e816251b4c56d755f86791bc17b2143}{iface\_index}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01808}01808         \textcolor{keywordflow}{if} (iface \&\& iface-\/>\mbox{\hyperlink{structusb__interface_aa5cea795ac14467ffdbe70b7f59beaba}{idesc}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01809}01809                 *\mbox{\hyperlink{structusb__interface_aa5cea795ac14467ffdbe70b7f59beaba}{idesc}} = *(iface-\/>\mbox{\hyperlink{structusb__interface_aa5cea795ac14467ffdbe70b7f59beaba}{idesc}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01810}01810         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01811}01811                 \textcolor{keywordflow}{return} (EIO);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01812}01812         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01813}01813         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01814}01814 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01815}01815 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01816}01816 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01817}01817 ugen\_get\_endpoint\_desc(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01818}01818     \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__endpoint__descriptor}{usb\_endpoint\_descriptor}} *ed)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01819}01819 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01820}01820         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__endpoint}{usb\_endpoint}} *ep;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01821}01821 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01822}01822         ep = \mbox{\hyperlink{usbdi_8h_a1686d97012d48512200abd8ad0d86d1e}{usb\_fifo\_softc}}(f);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01823}01823 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01824}01824         \textcolor{keywordflow}{if} (ep \&\& ep-\/>\mbox{\hyperlink{structusb__endpoint_af3b96b9fe1e612b303833c2e2d0365e1}{edesc}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01825}01825                 *ed = *ep-\/>\mbox{\hyperlink{structusb__endpoint_af3b96b9fe1e612b303833c2e2d0365e1}{edesc}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01826}01826         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01827}01827                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01828}01828         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01829}01829         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01830}01830 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01831}01831 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01832}01832 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01833}01833 ugen\_set\_power\_mode(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, \textcolor{keywordtype}{int} mode)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01834}01834 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01835}01835         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device}{usb\_device}} *udev = f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01836}01836         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01837}01837         uint8\_t old\_mode;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01838}01838 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01839}01839         \textcolor{keywordflow}{if} ((udev == NULL) ||}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01840}01840             (udev-\/>\mbox{\hyperlink{structusb__device_aa35d4d1b88f22abb34d30e9762153e0b}{parent\_hub}} == NULL)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01841}01841                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01842}01842         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01843}01843         err = priv\_check(curthread, PRIV\_DRIVER);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01844}01844         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01845}01845                 \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01846}01846 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01847}01847         \textcolor{comment}{/* get old power mode */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01848}01848         old\_mode = udev-\/>\mbox{\hyperlink{structusb__device_a1127e006fe407ceb1f80c3599740c2e8}{power\_mode}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01849}01849 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01850}01850         \textcolor{comment}{/* if no change, then just return */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01851}01851         \textcolor{keywordflow}{if} (old\_mode == mode)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01852}01852                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01853}01853 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01854}01854         \textcolor{keywordflow}{switch} (mode) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01855}01855         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_ac1cd855acbb3d85d2219ce4350590eca}{USB\_POWER\_MODE\_OFF}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01856}01856                 \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{usb__generic_8c_source_l01857}01857                     udev-\/>\mbox{\hyperlink{structusb__device_abaeb07090fa5f4d4a0f6658198251704}{re\_enumerate\_wait}} == \mbox{\hyperlink{usb__device_8h_a2e06c9c4bbcce750a03429fd4d9577b2}{USB\_RE\_ENUM\_DONE}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01858}01858                         udev-\/>\mbox{\hyperlink{structusb__device_abaeb07090fa5f4d4a0f6658198251704}{re\_enumerate\_wait}} = \mbox{\hyperlink{usb__device_8h_a943c663e17ebed96409c89550deeeb5a}{USB\_RE\_ENUM\_PWR\_OFF}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01859}01859                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01860}01860                 \textcolor{comment}{/* set power mode will wake up the explore thread */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01861}01861                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01862}01862 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01863}01863         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_abfdef2b11a0b87feace379e0ed66aaaf}{USB\_POWER\_MODE\_ON}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01864}01864         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a79c6b1aa1092c1f425f4159590403382}{USB\_POWER\_MODE\_SAVE}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01865}01865                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01866}01866 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01867}01867         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a15801f93e53768a5e2fbc06e85465bcc}{USB\_POWER\_MODE\_RESUME}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01868}01868 \textcolor{preprocessor}{\#if USB\_HAVE\_POWERD}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01869}01869                 \textcolor{comment}{/* let USB-\/powerd handle resume */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01870}01870                 \mbox{\hyperlink{usb__core_8h_a21dab1de8f52baf9fbf7617c6b1ec033}{USB\_BUS\_LOCK}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01871}01871                 udev-\/>\mbox{\hyperlink{structusb__device_a692b67c34189b2795722455544596214}{pwr\_save}}.\mbox{\hyperlink{structusb__power__save_ad77d356bddc879e20ff741ebf099bb61}{write\_refs}}++;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01872}01872                 udev-\/>\mbox{\hyperlink{structusb__device_a692b67c34189b2795722455544596214}{pwr\_save}}.\mbox{\hyperlink{structusb__power__save_a07a7eaec1abcb60f44a05d39c5246525}{last\_xfer\_time}} = ticks;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01873}01873                 \mbox{\hyperlink{usb__core_8h_aadb0c32f6333b8a0715929ace5f550b2}{USB\_BUS\_UNLOCK}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01874}01874 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01875}01875                 \textcolor{comment}{/* set new power mode */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01876}01876                 \mbox{\hyperlink{usb__hub_8c_a0fe52cb0293b8d1de260b88e4558bd00}{usbd\_set\_power\_mode}}(udev, \mbox{\hyperlink{usb_8h_a79c6b1aa1092c1f425f4159590403382}{USB\_POWER\_MODE\_SAVE}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01877}01877 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01878}01878                 \textcolor{comment}{/* wait for resume to complete */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01879}01879                 \mbox{\hyperlink{usb__util_8c_a7ad9fc3660f5ecf96d72e499cdfeb963}{usb\_pause\_mtx}}(NULL, hz / 4);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01880}01880 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01881}01881                 \textcolor{comment}{/* clear write reference */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01882}01882                 \mbox{\hyperlink{usb__core_8h_a21dab1de8f52baf9fbf7617c6b1ec033}{USB\_BUS\_LOCK}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01883}01883                 udev-\/>\mbox{\hyperlink{structusb__device_a692b67c34189b2795722455544596214}{pwr\_save}}.\mbox{\hyperlink{structusb__power__save_ad77d356bddc879e20ff741ebf099bb61}{write\_refs}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01884}01884                 \mbox{\hyperlink{usb__core_8h_aadb0c32f6333b8a0715929ace5f550b2}{USB\_BUS\_UNLOCK}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01885}01885 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01886}01886                 mode = \mbox{\hyperlink{usb_8h_a79c6b1aa1092c1f425f4159590403382}{USB\_POWER\_MODE\_SAVE}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01887}01887                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01888}01888 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01889}01889         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb_8h_a2a6065c49fbcd8e9998bc45e8d192e4d}{USB\_POWER\_MODE\_SUSPEND}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01890}01890 \textcolor{preprocessor}{\#if USB\_HAVE\_POWERD}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01891}01891                 \textcolor{comment}{/* let USB-\/powerd handle suspend */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01892}01892                 \mbox{\hyperlink{usb__core_8h_a21dab1de8f52baf9fbf7617c6b1ec033}{USB\_BUS\_LOCK}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01893}01893                 udev-\/>\mbox{\hyperlink{structusb__device_a692b67c34189b2795722455544596214}{pwr\_save}}.\mbox{\hyperlink{structusb__power__save_a07a7eaec1abcb60f44a05d39c5246525}{last\_xfer\_time}} = ticks -\/ (256 * hz);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01894}01894                 \mbox{\hyperlink{usb__core_8h_aadb0c32f6333b8a0715929ace5f550b2}{USB\_BUS\_UNLOCK}}(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01895}01895 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01896}01896                 mode = \mbox{\hyperlink{usb_8h_a79c6b1aa1092c1f425f4159590403382}{USB\_POWER\_MODE\_SAVE}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01897}01897                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01898}01898 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01899}01899         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01900}01900                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01901}01901         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01902}01902 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01903}01903         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01904}01904                 \textcolor{keywordflow}{return} (ENXIO);         \textcolor{comment}{/* I/O failure */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01905}01905 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01906}01906         \textcolor{comment}{/* if we are powered off we need to re-\/enumerate first */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01907}01907         \textcolor{keywordflow}{if} (old\_mode == \mbox{\hyperlink{usb_8h_ac1cd855acbb3d85d2219ce4350590eca}{USB\_POWER\_MODE\_OFF}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01908}01908                 \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{usb__generic_8c_source_l01909}01909                     udev-\/>\mbox{\hyperlink{structusb__device_abaeb07090fa5f4d4a0f6658198251704}{re\_enumerate\_wait}} == \mbox{\hyperlink{usb__device_8h_a2e06c9c4bbcce750a03429fd4d9577b2}{USB\_RE\_ENUM\_DONE}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01910}01910                         udev-\/>\mbox{\hyperlink{structusb__device_abaeb07090fa5f4d4a0f6658198251704}{re\_enumerate\_wait}} = \mbox{\hyperlink{usb__device_8h_a03ba15943cfbf3b3da678a1945b520d9}{USB\_RE\_ENUM\_START}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01911}01911                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01912}01912                 \textcolor{comment}{/* set power mode will wake up the explore thread */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01913}01913         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01914}01914 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01915}01915         \textcolor{comment}{/* set new power mode */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01916}01916         \mbox{\hyperlink{usb__hub_8c_a0fe52cb0293b8d1de260b88e4558bd00}{usbd\_set\_power\_mode}}(udev, mode);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01917}01917 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01918}01918         \textcolor{keywordflow}{return} (0);                     \textcolor{comment}{/* success */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01919}01919 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01920}01920 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01921}01921 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01922}01922 ugen\_get\_power\_mode(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01923}01923 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01924}01924         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device}{usb\_device}} *udev = f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01925}01925 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01926}01926         \textcolor{keywordflow}{if} (udev == NULL)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01927}01927                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{usb_8h_abfdef2b11a0b87feace379e0ed66aaaf}{USB\_POWER\_MODE\_ON}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01928}01928 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01929}01929         \textcolor{keywordflow}{return} (udev-\/>\mbox{\hyperlink{structusb__device_a1127e006fe407ceb1f80c3599740c2e8}{power\_mode}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01930}01930 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01931}01931 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01932}01932 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01933}01933 ugen\_get\_port\_path(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device__port__path}{usb\_device\_port\_path}} *dpp)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01934}01934 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01935}01935         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device}{usb\_device}} *udev = f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01936}01936         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device}{usb\_device}} *\mbox{\hyperlink{ehci_8h_a37d1073c5e1d321bdce7cddeaf65a02f}{next}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01937}01937         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} nlevel = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01938}01938 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01939}01939         \textcolor{keywordflow}{if} (udev == NULL)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01940}01940                 \textcolor{keywordflow}{goto} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01941}01941 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01942}01942         dpp-\/>\mbox{\hyperlink{structusb__device__port__path_a3198d4f8a7608c98ed6fd7d249eb37d7}{udp\_bus}} = device\_get\_unit(udev-\/>\mbox{\hyperlink{structusb__device_a532e474ebc2a6bfa9512e6fa1aaedf3c}{bus}}-\/>\mbox{\hyperlink{structusb__bus_a50629655e638e1f775df1ed160d3c533}{bdev}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01943}01943         dpp-\/>\mbox{\hyperlink{structusb__device__port__path_a77a4ceb2fdb8de87d9b139da2f02bdb3}{udp\_index}} = udev-\/>\mbox{\hyperlink{structusb__device_a5671e9a7365d48bd470879e2b95ea2e5}{device\_index}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01944}01944 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01945}01945         \textcolor{comment}{/* count port levels */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01946}01946         \mbox{\hyperlink{ehci_8h_a37d1073c5e1d321bdce7cddeaf65a02f}{next}} = udev;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01947}01947         \textcolor{keywordflow}{while} (\mbox{\hyperlink{ehci_8h_a37d1073c5e1d321bdce7cddeaf65a02f}{next}}-\/>parent\_hub != NULL) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01948}01948                 nlevel++;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01949}01949                 \mbox{\hyperlink{ehci_8h_a37d1073c5e1d321bdce7cddeaf65a02f}{next}} = \mbox{\hyperlink{ehci_8h_a37d1073c5e1d321bdce7cddeaf65a02f}{next}}-\/>parent\_hub;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01950}01950         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01951}01951 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01952}01952         \textcolor{comment}{/* check if too many levels */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01953}01953         \textcolor{keywordflow}{if} (nlevel > \mbox{\hyperlink{usb__ioctl_8h_aa382d864fa4a92b0d2802569064ee960}{USB\_DEVICE\_PORT\_PATH\_MAX}})}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01954}01954                 \textcolor{keywordflow}{goto} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01955}01955 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01956}01956         \textcolor{comment}{/* store total level of ports */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01957}01957         dpp-\/>\mbox{\hyperlink{structusb__device__port__path_a799dda86aada68a6345c1a81dac6d340}{udp\_port\_level}} = nlevel;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01958}01958 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01959}01959         \textcolor{comment}{/* store port index array */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01960}01960         \mbox{\hyperlink{ehci_8h_a37d1073c5e1d321bdce7cddeaf65a02f}{next}} = udev;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01961}01961         \textcolor{keywordflow}{while} (\mbox{\hyperlink{ehci_8h_a37d1073c5e1d321bdce7cddeaf65a02f}{next}}-\/>parent\_hub != NULL) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01962}01962                 dpp-\/>\mbox{\hyperlink{structusb__device__port__path_a9694020510d656c498c65befe54adb7e}{udp\_port\_no}}[-\/-\/nlevel] = \mbox{\hyperlink{ehci_8h_a37d1073c5e1d321bdce7cddeaf65a02f}{next}}-\/>port\_no;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01963}01963                 \mbox{\hyperlink{ehci_8h_a37d1073c5e1d321bdce7cddeaf65a02f}{next}} = \mbox{\hyperlink{ehci_8h_a37d1073c5e1d321bdce7cddeaf65a02f}{next}}-\/>parent\_hub;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01964}01964         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01965}01965         \textcolor{keywordflow}{return} (0);     \textcolor{comment}{/* success */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01966}01966 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01967}01967 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01968}01968         \textcolor{keywordflow}{return} (EINVAL);        \textcolor{comment}{/* failure */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01969}01969 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01970}01970 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01971}01971 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01972}01972 ugen\_get\_power\_usage(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01973}01973 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01974}01974         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device}{usb\_device}} *udev = f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01975}01975 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01976}01976         \textcolor{keywordflow}{if} (udev == NULL)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01977}01977                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01978}01978 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01979}01979         \textcolor{keywordflow}{return} (udev-\/>\mbox{\hyperlink{structusb__device_a928111b85e657beadd61437d701b2843}{power}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01980}01980 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01981}01981 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01982}01982 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01983}01983 ugen\_do\_port\_feature(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, uint8\_t \mbox{\hyperlink{structusb__device_aad1b7bf74888da46b818db23b4f6adfb}{port\_no}},}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01984}01984     uint8\_t set, uint16\_t feature)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01985}01985 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01986}01986         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device}{usb\_device}} *udev = f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01987}01987         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__hub}{usb\_hub}} *hub;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01988}01988         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01989}01989 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01990}01990         err = priv\_check(curthread, PRIV\_DRIVER);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01991}01991         \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01992}01992                 \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01993}01993         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01994}01994         \textcolor{keywordflow}{if} (port\_no == 0) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01995}01995                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01996}01996         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01997}01997         \textcolor{keywordflow}{if} ((udev == NULL) ||}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01998}01998             (udev-\/>\mbox{\hyperlink{structusb__device_a4fff6a478d5f92f73df9d6f2b34760a3}{hub}} == NULL)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l01999}01999                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02000}02000         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02001}02001         hub = udev-\/>\mbox{\hyperlink{structusb__device_a4fff6a478d5f92f73df9d6f2b34760a3}{hub}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02002}02002 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02003}02003         \textcolor{keywordflow}{if} (port\_no > hub-\/>\mbox{\hyperlink{structusb__hub_afa8acde28ca18749a6eb93950617de33}{nports}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02004}02004                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02005}02005         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02006}02006         \textcolor{keywordflow}{if} (set)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02007}02007                 err = \mbox{\hyperlink{usb__request_8c_afad9817c30b015e1a517608c6a226108}{usbd\_req\_set\_port\_feature}}(udev,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02008}02008                     NULL, port\_no, feature);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02009}02009         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02010}02010                 err = \mbox{\hyperlink{usb__request_8c_ac0a63ecde1c077dfda1b8e72385a5342}{usbd\_req\_clear\_port\_feature}}(udev,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02011}02011                     NULL, port\_no, feature);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02012}02012 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02013}02013         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02014}02014                 \textcolor{keywordflow}{return} (ENXIO);         \textcolor{comment}{/* failure */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02015}02015 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02016}02016         \textcolor{keywordflow}{return} (0);                     \textcolor{comment}{/* success */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02017}02017 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02018}02018 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02019}02019 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02020}02020 ugen\_iface\_ioctl(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, u\_long cmd, \textcolor{keywordtype}{void} *addr, \textcolor{keywordtype}{int} fflags)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02021}02021 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02022}02022         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f\_rx;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02023}02023         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f\_tx;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02024}02024         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02025}02025 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02026}02026         f\_rx = f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}-\/>fifo[(f-\/>\mbox{\hyperlink{structusb__fifo_a5cc5a0e8389115de3edfcdae29d1bcc9}{fifo\_index}} \& \string~1) + \mbox{\hyperlink{usbdi_8h_aa4759b44daa392a7b438d6fba784f30a}{USB\_FIFO\_RX}}];}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02027}02027         f\_tx = f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}-\/>fifo[(f-\/>\mbox{\hyperlink{structusb__fifo_a5cc5a0e8389115de3edfcdae29d1bcc9}{fifo\_index}} \& \string~1) + \mbox{\hyperlink{usbdi_8h_ab42694ba7d2dc0d510f4a139fb8cf5d8}{USB\_FIFO\_TX}}];}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02028}02028 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02029}02029         \textcolor{keywordflow}{switch} (cmd) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02030}02030         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a15402283772f1ceac6e33ba8e0416f28}{USB\_SET\_RX\_SHORT\_XFER}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02031}02031                 \textcolor{keywordflow}{if} (fflags \& FREAD) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02032}02032                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_set\_short\_xfer(f\_rx, addr);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02033}02033                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02034}02034                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02035}02035                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02036}02036                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02037}02037 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02038}02038         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a189bd05f149465477dc970c1539542f3}{USB\_SET\_TX\_FORCE\_SHORT}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02039}02039                 \textcolor{keywordflow}{if} (fflags \& FWRITE) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02040}02040                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_set\_short\_xfer(f\_tx, addr);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02041}02041                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02042}02042                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02043}02043                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02044}02044                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02045}02045 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02046}02046         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a238568fd05ca6ed6a812407484f479e1}{USB\_SET\_RX\_TIMEOUT}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02047}02047                 \textcolor{keywordflow}{if} (fflags \& FREAD) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02048}02048                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_set\_timeout(f\_rx, addr);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02049}02049                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02050}02050                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02051}02051                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02052}02052                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02053}02053 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02054}02054         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_aea53f28ee49f9efe699b52a4d0b46275}{USB\_SET\_TX\_TIMEOUT}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02055}02055                 \textcolor{keywordflow}{if} (fflags \& FWRITE) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02056}02056                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_set\_timeout(f\_tx, addr);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02057}02057                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02058}02058                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02059}02059                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02060}02060                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02061}02061 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02062}02062         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a3495ba59ca662ea942ee3eaaed67dce6}{USB\_GET\_RX\_FRAME\_SIZE}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02063}02063                 \textcolor{keywordflow}{if} (fflags \& FREAD) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02064}02064                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_get\_frame\_size(f\_rx, addr);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02065}02065                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02066}02066                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02067}02067                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02068}02068                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02069}02069 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02070}02070         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a797c39ebd3cf7e8ce3bf2e002f81a948}{USB\_GET\_TX\_FRAME\_SIZE}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02071}02071                 \textcolor{keywordflow}{if} (fflags \& FWRITE) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02072}02072                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_get\_frame\_size(f\_tx, addr);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02073}02073                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02074}02074                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02075}02075                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02076}02076                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02077}02077 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02078}02078         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a1d7f16f137e3bc01c1f331cde19ab0c8}{USB\_SET\_RX\_BUFFER\_SIZE}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02079}02079                 \textcolor{keywordflow}{if} (fflags \& FREAD) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02080}02080                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_set\_buffer\_size(f\_rx, addr);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02081}02081                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02082}02082                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02083}02083                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02084}02084                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02085}02085 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02086}02086         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a8e95a1161cffdfb309bef7a3e283f01d}{USB\_SET\_TX\_BUFFER\_SIZE}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02087}02087                 \textcolor{keywordflow}{if} (fflags \& FWRITE) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02088}02088                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_set\_buffer\_size(f\_tx, addr);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02089}02089                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02090}02090                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02091}02091                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02092}02092                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02093}02093 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02094}02094         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_aa8f64c056d91e8e5d0b9bebb9aed0c74}{USB\_GET\_RX\_BUFFER\_SIZE}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02095}02095                 \textcolor{keywordflow}{if} (fflags \& FREAD) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02096}02096                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_get\_buffer\_size(f\_rx, addr);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02097}02097                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02098}02098                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02099}02099                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02100}02100                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02101}02101 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02102}02102         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_aad8d55a665ba9d6de7ef14d20a1d6114}{USB\_GET\_TX\_BUFFER\_SIZE}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02103}02103                 \textcolor{keywordflow}{if} (fflags \& FWRITE) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02104}02104                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_get\_buffer\_size(f\_tx, addr);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02105}02105                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02106}02106                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02107}02107                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02108}02108                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02109}02109 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02110}02110         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a683c9b68ae7d4948be7c021ef2502ea7}{USB\_GET\_RX\_INTERFACE\_DESC}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02111}02111                 \textcolor{keywordflow}{if} (fflags \& FREAD) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02112}02112                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_get\_iface\_desc(f\_rx, addr);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02113}02113                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02114}02114                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02115}02115                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02116}02116                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02117}02117 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02118}02118         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_aec8982589c0f41ef9f9f19e3864c0aed}{USB\_GET\_TX\_INTERFACE\_DESC}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02119}02119                 \textcolor{keywordflow}{if} (fflags \& FWRITE) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02120}02120                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_get\_iface\_desc(f\_tx, addr);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02121}02121                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02122}02122                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02123}02123                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02124}02124                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02125}02125 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02126}02126         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a4b9d594e7f9a2dd0b3d9b571dbffafd6}{USB\_GET\_RX\_ENDPOINT\_DESC}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02127}02127                 \textcolor{keywordflow}{if} (fflags \& FREAD) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02128}02128                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_get\_endpoint\_desc(f\_rx, addr);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02129}02129                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02130}02130                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02131}02131                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02132}02132                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02133}02133 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02134}02134         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_adb808a1ca54525d73f31755a64e5015d}{USB\_GET\_TX\_ENDPOINT\_DESC}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02135}02135                 \textcolor{keywordflow}{if} (fflags \& FWRITE) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02136}02136                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_get\_endpoint\_desc(f\_tx, addr);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02137}02137                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02138}02138                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02139}02139                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02140}02140                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02141}02141 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02142}02142         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a83566b00d1f76617af9cc7ed3bf82309}{USB\_SET\_RX\_STALL\_FLAG}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02143}02143                 \textcolor{keywordflow}{if} ((fflags \& FREAD) \&\& (*(\textcolor{keywordtype}{int} *)addr)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02144}02144                         f\_rx-\/>\mbox{\hyperlink{structusb__fifo_a70058c5fdf3bb4fa4e9bdfe26ba5c2f7}{flag\_stall}} = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02145}02145                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02146}02146                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02147}02147 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02148}02148         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a0fb5f08c222c258209d004017fcec1ed}{USB\_SET\_TX\_STALL\_FLAG}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02149}02149                 \textcolor{keywordflow}{if} ((fflags \& FWRITE) \&\& (*(\textcolor{keywordtype}{int} *)addr)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02150}02150                         f\_tx-\/>\mbox{\hyperlink{structusb__fifo_a70058c5fdf3bb4fa4e9bdfe26ba5c2f7}{flag\_stall}} = 1;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02151}02151                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02152}02152                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02153}02153 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02154}02154         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02155}02155                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ENOIOCTL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02156}02156                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02157}02157         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02158}02158         \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02159}02159 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02160}02160 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02161}02161 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02162}02162 ugen\_ioctl\_post(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, u\_long cmd, \textcolor{keywordtype}{void} *addr, \textcolor{keywordtype}{int} fflags)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02163}02163 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02164}02164 \textcolor{preprocessor}{\#ifdef COMPAT\_FREEBSD32}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02165}02165         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fs__init}{usb\_fs\_init}} local\_pinit;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02166}02166 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02167}02167         \textcolor{keyword}{union }\{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02168}02168                 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__interface__descriptor}{usb\_interface\_descriptor}} *idesc;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02169}02169                 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__alt__interface}{usb\_alt\_interface}} *ai;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02170}02170                 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__descriptor}{usb\_device\_descriptor}} *ddesc;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02171}02171                 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__config__descriptor}{usb\_config\_descriptor}} *cdesc;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02172}02172                 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__stats}{usb\_device\_stats}} *stat;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02173}02173                 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fs__init}{usb\_fs\_init}} *pinit;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02174}02174 \textcolor{preprocessor}{\#ifdef COMPAT\_FREEBSD32}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02175}02175                 \textcolor{keyword}{struct }usb\_fs\_init32 *pinit32;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02176}02176 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02177}02177                 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fs__uninit}{usb\_fs\_uninit}} *puninit;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02178}02178                 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__port__path}{usb\_device\_port\_path}} *dpp;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02179}02179                 uint32\_t *ptime;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02180}02180                 \textcolor{keywordtype}{void}   *addr;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02181}02181                 \textcolor{keywordtype}{int}    *pint;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02182}02182         \}     u;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02183}02183         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__descriptor}{usb\_device\_descriptor}} *dtemp;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02184}02184         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__config__descriptor}{usb\_config\_descriptor}} *ctemp;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02185}02185         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__interface}{usb\_interface}} *iface;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02186}02186         \textcolor{keywordtype}{size\_t} usb\_fs\_endpoint\_sz = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fs__endpoint}{usb\_fs\_endpoint}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02187}02187         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02188}02188         uint8\_t \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02189}02189 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02190}02190         u.addr = addr;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02191}02191 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02192}02192         DPRINTFN(6, \textcolor{stringliteral}{"{}cmd=0x\%08lx\(\backslash\)n"{}}, cmd);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02193}02193 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02194}02194 \textcolor{preprocessor}{\#ifdef COMPAT\_FREEBSD32}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02195}02195         \textcolor{keywordflow}{switch} (cmd) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02196}02196         \textcolor{keywordflow}{case} USB\_FS\_INIT32:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02197}02197                 PTRIN\_CP(*u.pinit32, local\_pinit, pEndpoints);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02198}02198                 CP(*u.pinit32, local\_pinit, ep\_index\_max);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02199}02199                 u.addr = \&local\_pinit;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02200}02200                 cmd = \_IOC\_NEWTYPE(\mbox{\hyperlink{usb__ioctl_8h_a6e2ca65657c072b5ff9529228e3211fa}{USB\_FS\_INIT}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fs__init}{usb\_fs\_init}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02201}02201                 usb\_fs\_endpoint\_sz = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }usb\_fs\_endpoint32);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02202}02202                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02203}02203         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02204}02204 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02205}02205 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02206}02206         \textcolor{keywordflow}{switch} (cmd) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02207}02207         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_aa73482803e0480967d940542aa949a11}{USB\_DISCOVER}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02208}02208                 \mbox{\hyperlink{usb__hub_8c_a9c981d1eea91fae3036ff78fc3659863}{usb\_needs\_explore\_all}}();}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02209}02209                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02210}02210 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02211}02211         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_add9b09bf6802867bb84c641d67d25d54}{USB\_SETDEBUG}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02212}02212                 \textcolor{keywordflow}{if} (!(fflags \& FWRITE)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02213}02213                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EPERM;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02214}02214                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02215}02215                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02216}02216                 \mbox{\hyperlink{usb__debug_8c_ae3f6d70c719c77e228ccc905331d7784}{usb\_debug}} = *(\textcolor{keywordtype}{int} *)addr;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02217}02217                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02218}02218 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02219}02219         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a1ef1bfe061287ab0f387c5f03e68f7c9}{USB\_GET\_CONFIG}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02220}02220                 *(\textcolor{keywordtype}{int} *)addr = f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}-\/>\mbox{\hyperlink{structusb__device_a7e42ccaea5ac77b155be2a49aa4d2105}{curr\_config\_index}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02221}02221                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02222}02222 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02223}02223         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_adc811ef1f1799e8941249da3577a7484}{USB\_SET\_CONFIG}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02224}02224                 if (!(fflags \& FWRITE)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02225}02225                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EPERM;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02226}02226                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02227}02227                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02228}02228                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_set\_config(f, *(\textcolor{keywordtype}{int} *)addr);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02229}02229                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02230}02230 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02231}02231         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_ac50cd7a4e05d8e62d53e89c65cae73fb}{USB\_GET\_ALTINTERFACE}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02232}02232                 iface = \mbox{\hyperlink{usb__device_8c_ad241549c2225f6ccb72345851d5b9ed8}{usbd\_get\_iface}}(f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}},}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02233}02233                     u.ai-\/>uai\_interface\_index);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02234}02234                 \textcolor{keywordflow}{if} (iface \&\& iface-\/>\mbox{\hyperlink{structusb__interface_aa5cea795ac14467ffdbe70b7f59beaba}{idesc}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02235}02235                         u.ai-\/>uai\_alt\_index = iface-\/>\mbox{\hyperlink{structusb__interface_abe6dfd442aa844e892cf38426c0cf75c}{alt\_index}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02236}02236                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02237}02237                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02238}02238                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02239}02239                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02240}02240 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02241}02241         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a77835f3fd294b9ad6c1402848d216141}{USB\_SET\_ALTINTERFACE}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02242}02242                 \textcolor{keywordflow}{if} (!(fflags \& FWRITE)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02243}02243                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EPERM;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02244}02244                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02245}02245                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02246}02246                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_set\_interface(f,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02247}02247                     u.ai-\/>uai\_interface\_index, u.ai-\/>uai\_alt\_index);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02248}02248                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02249}02249 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02250}02250         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_ada423984351c4b0e3506d5c49d811e1b}{USB\_GET\_DEVICE\_DESC}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02251}02251                 dtemp = \mbox{\hyperlink{usb__device_8c_a8f67d00d4e9d051fd220f7a1562654d2}{usbd\_get\_device\_descriptor}}(f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02252}02252                 \textcolor{keywordflow}{if} (!dtemp) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02253}02253                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EIO;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02254}02254                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02255}02255                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02256}02256                 *u.ddesc = *dtemp;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02257}02257                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02258}02258 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02259}02259         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_aff6835aa5bbd5738dbc9d26657d77e8d}{USB\_GET\_CONFIG\_DESC}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02260}02260                 ctemp = \mbox{\hyperlink{usb__device_8c_a5833d02ea7d69fb84106d7b97391431a}{usbd\_get\_config\_descriptor}}(f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02261}02261                 \textcolor{keywordflow}{if} (!ctemp) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02262}02262                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EIO;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02263}02263                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02264}02264                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02265}02265                 *u.cdesc = *ctemp;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02266}02266                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02267}02267 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02268}02268         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_ae88d5326cafd0ab96f6dc09217597bf0}{USB\_GET\_FULL\_DESC}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02269}02269                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_get\_cdesc(f, addr);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02270}02270                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02271}02271 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02272}02272         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a414c7ca41a19ff1adc6c39aa5cbfc6fa}{USB\_GET\_STRING\_DESC}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02273}02273                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_get\_sdesc(f, addr);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02274}02274                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02275}02275 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02276}02276         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_aaa68310fd190e6b9be93e38f7c682953}{USB\_GET\_IFACE\_DRIVER}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02277}02277                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_get\_iface\_driver(f, addr);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02278}02278                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02279}02279 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02280}02280 \textcolor{preprocessor}{\#ifdef COMPAT\_FREEBSD32}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02281}02281         \textcolor{keywordflow}{case} USB\_GET\_FULL\_DESC32:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02282}02282         \textcolor{keywordflow}{case} USB\_GET\_STRING\_DESC32:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02283}02283         \textcolor{keywordflow}{case} USB\_GET\_IFACE\_DRIVER32:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02284}02284                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_get32(cmd, f, addr);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02285}02285                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02286}02286 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02287}02287 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02288}02288         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a0b806afb67c0105bf7d232e2e53ba8d4}{USB\_REQUEST}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02289}02289         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a8344a6867be3d2da5ee39272bbd95a57}{USB\_DO\_REQUEST}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02290}02290                 \textcolor{keywordflow}{if} (!(fflags \& FWRITE)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02291}02291                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EPERM;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02292}02292                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02293}02293                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02294}02294                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usb__generic_8h_a9769ea8b5a272e0ec4d638c0f9ada867}{ugen\_do\_request}}(f, addr);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02295}02295                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02296}02296 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02297}02297 \textcolor{preprocessor}{\#ifdef COMPAT\_FREEBSD32}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02298}02298         \textcolor{keywordflow}{case} USB\_REQUEST32:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02299}02299         \textcolor{keywordflow}{case} USB\_DO\_REQUEST32:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02300}02300                 \textcolor{keywordflow}{if} (!(fflags \& FWRITE)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02301}02301                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EPERM;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02302}02302                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02303}02303                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02304}02304                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_do\_request32(f, addr);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02305}02305                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02306}02306 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02307}02307 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02308}02308         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_aecd298d580cb37ee6598cb2747a9a3e5}{USB\_DEVICEINFO}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02309}02309         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a0fc8de7a0550244a98c0d28eae939d22}{USB\_GET\_DEVICEINFO}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02310}02310                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usb__generic_8h_aab838658e20dbc52546a7422b0630fb4}{ugen\_fill\_deviceinfo}}(f, addr);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02311}02311                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02312}02312 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02313}02313         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_af166d09142e3c0f912053427b33b8077}{USB\_DEVICESTATS}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02314}02314                 \textcolor{keywordflow}{for} (\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} = 0; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} != 4; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}++) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02315}02315                         u.stat-\/>uds\_requests\_fail[\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}] =}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02316}02316                             f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}-\/>\mbox{\hyperlink{structusb__device_a4c3407aff19ea3bcf1c7736bf19cedf2}{stats\_err}}.\mbox{\hyperlink{structusb__device__statistics_a4a6945edb9e1f2def4475405e156ea15}{uds\_requests}}[\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}];}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02317}02317                         u.stat-\/>uds\_requests\_ok[\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}] =}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02318}02318                             f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}-\/>\mbox{\hyperlink{structusb__device_a6d8411888315a90b294606bf66114910}{stats\_ok}}.\mbox{\hyperlink{structusb__device__statistics_a4a6945edb9e1f2def4475405e156ea15}{uds\_requests}}[\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}];}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02319}02319                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02320}02320                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02321}02321 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02322}02322         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_aa81051924cf5549df8a6652d41860856}{USB\_DEVICEENUMERATE}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02323}02323                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_re\_enumerate(f);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02324}02324                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02325}02325 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02326}02326         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a4f936233bb2361f8be0faab13d725944}{USB\_GET\_PLUGTIME}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02327}02327                 *u.ptime = f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}-\/>\mbox{\hyperlink{structusb__device_af5d73485bb5843ec120c01a7235fba56}{plugtime}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02328}02328                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02329}02329 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02330}02330         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_aa535fbfaa11db1148f8343869f4cdb89}{USB\_CLAIM\_INTERFACE}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02331}02331         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a39ec3457257946385e11c973c4e64495}{USB\_RELEASE\_INTERFACE}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02332}02332                 \textcolor{comment}{/* TODO */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02333}02333                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02334}02334 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02335}02335         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_aee61cb2f3d0b2317ff665095c6241acb}{USB\_IFACE\_DRIVER\_ACTIVE}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02336}02336 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02337}02337                 \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} = *u.pint \& 0xFF;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02338}02338 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02339}02339                 iface = \mbox{\hyperlink{usb__device_8c_ad241549c2225f6ccb72345851d5b9ed8}{usbd\_get\_iface}}(f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}, \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02340}02340 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02341}02341                 \textcolor{keywordflow}{if} (iface \&\& iface-\/>\mbox{\hyperlink{structusb__interface_a30771ef505042d5d21771ce48c80e45a}{subdev}})}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02342}02342                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02343}02343                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02344}02344                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ENXIO;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02345}02345                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02346}02346 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02347}02347         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a36500b5714fc6431f0ad05187fb425fd}{USB\_IFACE\_DRIVER\_DETACH}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02348}02348 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02349}02349                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = priv\_check(curthread, PRIV\_DRIVER);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02350}02350 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02351}02351                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02352}02352                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02353}02353 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02354}02354                 \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} = *u.pint \& 0xFF;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02355}02355 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02356}02356                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} == \mbox{\hyperlink{usb_8h_a9636572ac5c1c52650546f843150aa29}{USB\_IFACE\_INDEX\_ANY}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02357}02357                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02358}02358                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02359}02359                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02360}02360 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02361}02361                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02362}02362 \textcolor{comment}{                 * Detach the currently attached driver.}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02363}02363 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02364}02364                 \mbox{\hyperlink{usb__device_8c_ac3766422c80dcf0714b3e1c5c6124ac1}{usb\_detach\_device}}(f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}, \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}, 0);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02365}02365 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02366}02366                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02367}02367 \textcolor{comment}{                 * Set parent to self, this should keep attach away}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02368}02368 \textcolor{comment}{                 * until the next set configuration event.}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02369}02369 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02370}02370                 \mbox{\hyperlink{usb__device_8c_a6aef4e9889e1a62a17d7c7ac8f0d2bfa}{usbd\_set\_parent\_iface}}(f-\/>\mbox{\hyperlink{structusb__fifo_a240f1a09a462cd543c7f6340780fac2b}{udev}}, \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}, \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02371}02371                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02372}02372 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02373}02373         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a41638f5ef4ea7aa8e2821d2bcc14b039}{USB\_SET\_POWER\_MODE}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02374}02374                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_set\_power\_mode(f, *u.pint);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02375}02375                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02376}02376 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02377}02377         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a93ea791484e1ccb8e5c36dcc8aa8cae1}{USB\_GET\_POWER\_MODE}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02378}02378                 *u.pint = ugen\_get\_power\_mode(f);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02379}02379                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02380}02380 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02381}02381         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a1e64d7b08e8395bb819a111a8bf60c93}{USB\_GET\_DEV\_PORT\_PATH}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02382}02382                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_get\_port\_path(f, u.dpp);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02383}02383                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02384}02384 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02385}02385         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a45c582fe4d06c8d38ebccec0cafe8335}{USB\_GET\_POWER\_USAGE}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02386}02386                 *u.pint = ugen\_get\_power\_usage(f);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02387}02387                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02388}02388 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02389}02389         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_aa08a0b3be93aff74435278ee0a760d62}{USB\_SET\_PORT\_ENABLE}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02390}02390                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_do\_port\_feature(f,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02391}02391                     *u.pint, 1, \mbox{\hyperlink{usb_8h_a8fa7a9a0c538b3c5c683f530f58d7b11}{UHF\_PORT\_ENABLE}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02392}02392                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02393}02393 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02394}02394         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a3f0715219221d94dfcd8e27e779a2359}{USB\_SET\_PORT\_DISABLE}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02395}02395                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_do\_port\_feature(f,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02396}02396                     *u.pint, 0, \mbox{\hyperlink{usb_8h_a8fa7a9a0c538b3c5c683f530f58d7b11}{UHF\_PORT\_ENABLE}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02397}02397                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02398}02398 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02399}02399         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a6e2ca65657c072b5ff9529228e3211fa}{USB\_FS\_INIT}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02400}02400                 \textcolor{comment}{/* verify input parameters */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02401}02401                 \textcolor{keywordflow}{if} (u.pinit-\/>pEndpoints == NULL) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02402}02402                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02403}02403                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02404}02404                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02405}02405                 \textcolor{keywordflow}{if} (u.pinit-\/>ep\_index\_max > 127) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02406}02406                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02407}02407                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02408}02408                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02409}02409                 \textcolor{keywordflow}{if} (u.pinit-\/>ep\_index\_max == 0) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02410}02410                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02411}02411                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02412}02412                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02413}02413                 \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_abf80654c6961185168581e9634935db2}{fs\_xfer}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02414}02414                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EBUSY;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02415}02415                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02416}02416                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02417}02417                 \textcolor{keywordflow}{if} (f-\/>\mbox{\hyperlink{structusb__fifo_a64c7e7c396364c6c59cc0f154623ce91}{dev\_ep\_index}} != 0) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02418}02418                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02419}02419                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02420}02420                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02421}02421                 \textcolor{keywordflow}{if} (ugen\_fifo\_in\_use(f, fflags)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02422}02422                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EBUSY;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02423}02423                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02424}02424                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02425}02425                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usbdi_8h_a05da54c8f6953ece429c6bb534ef9677}{usb\_fifo\_alloc\_buffer}}(f, 1, u.pinit-\/>ep\_index\_max);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02426}02426                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02427}02427                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02428}02428                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02429}02429                 f-\/>\mbox{\hyperlink{structusb__fifo_abf80654c6961185168581e9634935db2}{fs\_xfer}} = malloc(\textcolor{keyword}{sizeof}(f-\/>\mbox{\hyperlink{structusb__fifo_abf80654c6961185168581e9634935db2}{fs\_xfer}}[0]) *}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02430}02430                     u.pinit-\/>ep\_index\_max, M\_USB, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02431}02431                 f-\/>\mbox{\hyperlink{structusb__fifo_aa56d107c9e897a1c2602007b3b39c569}{fs\_ep\_max}} = u.pinit-\/>ep\_index\_max;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02432}02432                 f-\/>\mbox{\hyperlink{structusb__fifo_a2050cdc6bc71c106f9d85ff7a70e9cb2}{fs\_ep\_ptr}} = u.pinit-\/>pEndpoints;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02433}02433                 f-\/>\mbox{\hyperlink{structusb__fifo_a182c76abd4ba59545622caee89b66c33}{fs\_ep\_sz}} = usb\_fs\_endpoint\_sz;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02434}02434                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02435}02435 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02436}02436         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a433bc6bd2976cef2defd0bd6e8867fd8}{USB\_FS\_UNINIT}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02437}02437                 \textcolor{keywordflow}{if} (u.puninit-\/>dummy != 0) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02438}02438                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02439}02439                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02440}02440                 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02441}02441                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_fs\_uninit(f);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02442}02442                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02443}02443 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02444}02444         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02445}02445                 mtx\_lock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02446}02446                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_iface\_ioctl(f, cmd, addr, fflags);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02447}02447                 mtx\_unlock(f-\/>\mbox{\hyperlink{structusb__fifo_a8c158ccd56fe34bcc55b5affa86d39ca}{priv\_mtx}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02448}02448                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02449}02449         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02450}02450         DPRINTFN(6, \textcolor{stringliteral}{"{}error=\%d\(\backslash\)n"{}}, \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02451}02451         \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02452}02452 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02453}02453 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02454}02454 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02455}02455 ugen\_ctrl\_fs\_callback(\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{usb__generic_8c_source_l02456}02456 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02457}02457         ;                               \textcolor{comment}{/* workaround for a bug in "{}indent"{} */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02458}02458 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02459}02459         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}st=\%u alen=\%u aframes=\%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02460}02460             \mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(xfer), xfer-\/>\mbox{\hyperlink{structusb__xfer_a5d4e9e8a914f30cedf64f8771e63e873}{actlen}}, xfer-\/>\mbox{\hyperlink{structusb__xfer_a7f58fffa56cac11410055f785c4c5ffa}{aframes}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02461}02461 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02462}02462         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02463}02463         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02464}02464                 \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(xfer);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02465}02465                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02466}02466         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02467}02467                 ugen\_fs\_set\_complete(xfer-\/>\mbox{\hyperlink{structusb__xfer_a58505609405c158ae7e2d467cc55b020}{priv\_sc}}, \mbox{\hyperlink{usb__core_8h_a00ef950bac3cbecb8c5eabab123272d5}{USB\_P2U}}(xfer-\/>\mbox{\hyperlink{structusb__xfer_a0c9596757cc98e5aeb893a738dc73a72}{priv\_fifo}}));}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02468}02468                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02469}02469         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02470}02470 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02471}02471 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02472}02472 \textcolor{preprocessor}{\#ifdef COMPAT\_FREEBSD32}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02473}02473 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02474}02474 usb\_gen\_descriptor\_from32(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__gen__descriptor}{usb\_gen\_descriptor}} *ugd,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02475}02475     \textcolor{keyword}{const} \textcolor{keyword}{struct} usb\_gen\_descriptor32 *ugd32)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02476}02476 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02477}02477         PTRIN\_CP(*ugd32, *ugd, ugd\_data);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02478}02478         CP(*ugd32, *ugd, ugd\_lang\_id);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02479}02479         CP(*ugd32, *ugd, ugd\_maxlen);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02480}02480         CP(*ugd32, *ugd, ugd\_actlen);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02481}02481         CP(*ugd32, *ugd, ugd\_offset);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02482}02482         CP(*ugd32, *ugd, ugd\_config\_index);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02483}02483         CP(*ugd32, *ugd, ugd\_string\_index);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02484}02484         CP(*ugd32, *ugd, ugd\_iface\_index);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02485}02485         CP(*ugd32, *ugd, ugd\_altif\_index);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02486}02486         CP(*ugd32, *ugd, ugd\_endpt\_index);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02487}02487         CP(*ugd32, *ugd, ugd\_report\_type);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02488}02488         \textcolor{comment}{/* Don't copy reserved */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02489}02489 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02490}02490 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02491}02491 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02492}02492 update\_usb\_gen\_descriptor32(\textcolor{keyword}{struct} usb\_gen\_descriptor32 *ugd32,}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02493}02493     \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__gen__descriptor}{usb\_gen\_descriptor}} *ugd)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02494}02494 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02495}02495         \textcolor{comment}{/* Don't update ugd\_data pointer */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02496}02496         CP(*ugd32, *ugd, ugd\_lang\_id);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02497}02497         CP(*ugd32, *ugd, ugd\_maxlen);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02498}02498         CP(*ugd32, *ugd, ugd\_actlen);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02499}02499         CP(*ugd32, *ugd, ugd\_offset);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02500}02500         CP(*ugd32, *ugd, ugd\_config\_index);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02501}02501         CP(*ugd32, *ugd, ugd\_string\_index);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02502}02502         CP(*ugd32, *ugd, ugd\_iface\_index);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02503}02503         CP(*ugd32, *ugd, ugd\_altif\_index);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02504}02504         CP(*ugd32, *ugd, ugd\_endpt\_index);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02505}02505         CP(*ugd32, *ugd, ugd\_report\_type);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02506}02506         \textcolor{comment}{/* Don't update reserved */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02507}02507 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02508}02508 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02509}02509 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02510}02510 ugen\_get32(u\_long cmd, \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f, \textcolor{keyword}{struct} usb\_gen\_descriptor32 *ugd32)}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02511}02511 \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02512}02512         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__gen__descriptor}{usb\_gen\_descriptor}} ugd;}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02513}02513         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02514}02514 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02515}02515         usb\_gen\_descriptor\_from32(\&ugd, ugd32);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02516}02516         \textcolor{keywordflow}{switch} (cmd) \{}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02517}02517         \textcolor{keywordflow}{case} USB\_GET\_FULL\_DESC32:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02518}02518                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_get\_cdesc(f, \&ugd);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02519}02519                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02520}02520 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02521}02521         \textcolor{keywordflow}{case} USB\_GET\_STRING\_DESC32:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02522}02522                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_get\_sdesc(f, \&ugd);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02523}02523                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02524}02524 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02525}02525         \textcolor{keywordflow}{case} USB\_GET\_IFACE\_DRIVER32:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02526}02526                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ugen\_get\_iface\_driver(f, \&ugd);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02527}02527                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02528}02528         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02529}02529                 \textcolor{comment}{/* Can't happen except by programmer error */}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02530}02530                 panic(\textcolor{stringliteral}{"{}\%s: called with invalid cmd \%lx"{}}, \_\_func\_\_, cmd);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02531}02531         \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02532}02532         update\_usb\_gen\_descriptor32(ugd32, \&ugd);}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02533}02533 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02534}02534         \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02535}02535 \}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02536}02536 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02537}02537 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* COMPAT\_FREEBSD32 */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02538}02538 }
\DoxyCodeLine{\Hypertarget{usb__generic_8c_source_l02539}02539 \textcolor{preprocessor}{\#endif  }\textcolor{comment}{/* USB\_HAVE\_UGEN */}\textcolor{preprocessor}{}}

\end{DoxyCode}
