\hypertarget{usb__pf_8c_source}{}\doxysection{usb\+\_\+pf.\+c}
\label{usb__pf_8c_source}\index{dev/usb/usb\_pf.c@{dev/usb/usb\_pf.c}}
\mbox{\hyperlink{usb__pf_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00001}00001 \textcolor{comment}{/* \$FreeBSD\$ */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00002}00002 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00003}00003 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/3-\/Clause}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00004}00004 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 1990, 1991, 1993}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00006}00006 \textcolor{comment}{ *      The Regents of the University of California.  All rights reserved.}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00007}00007 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00008}00008 \textcolor{comment}{ * This code is derived from the Stanford/CMU enet packet filter,}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00009}00009 \textcolor{comment}{ * (net/enet.c) distributed as part of 4.3BSD, and code contributed}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00010}00010 \textcolor{comment}{ * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00011}00011 \textcolor{comment}{ * Berkeley Laboratory.}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00012}00012 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00013}00013 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00014}00014 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00015}00015 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00016}00016 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00017}00017 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00018}00018 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00019}00019 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00020}00020 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00021}00021 \textcolor{comment}{ * 3. Neither the name of the University nor the names of its contributors}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00022}00022 \textcolor{comment}{ *    may be used to endorse or promote products derived from this software}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00023}00023 \textcolor{comment}{ *    without specific prior written permission.}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00024}00024 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00025}00025 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00026}00026 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00027}00027 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00028}00028 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00029}00029 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00030}00030 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00031}00031 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00032}00032 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00033}00033 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00034}00034 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00035}00035 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00036}00036 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00037}00037 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00038}00038 \textcolor{preprocessor}{\#ifdef USB\_GLOBAL\_INCLUDE\_FILE}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00039}00039 \textcolor{preprocessor}{\#include USB\_GLOBAL\_INCLUDE\_FILE}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00040}00040 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <sys/fcntl.h>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <sys/proc.h>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <sys/socket.h>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <sys/sockio.h>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <net/if.h>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <net/if\_var.h>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <net/if\_types.h>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00052}00052 \textcolor{preprocessor}{\#include <net/if\_clone.h>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <net/bpf.h>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00054}00054 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00055}00055 \textcolor{preprocessor}{\#include <net/route.h>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00056}00056 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00057}00057 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb_8h}{dev/usb/usb.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00058}00058 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usbdi_8h}{dev/usb/usbdi.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00059}00059 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__busdma_8h}{dev/usb/usb\_busdma.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00060}00060 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__controller_8h}{dev/usb/usb\_controller.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00061}00061 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__core_8h}{dev/usb/usb\_core.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00062}00062 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__process_8h}{dev/usb/usb\_process.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00063}00063 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__device_8h}{dev/usb/usb\_device.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00064}00064 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__bus_8h}{dev/usb/usb\_bus.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00065}00065 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__pf_8h}{dev/usb/usb\_pf.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00066}00066 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__transfer_8h}{dev/usb/usb\_transfer.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00067}00067 \textcolor{preprocessor}{\#endif                  }\textcolor{comment}{/* USB\_GLOBAL\_INCLUDE\_FILE */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00068}00068 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00069}00069 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{usb__pf_8c_ab718cd2552c91d6e13c87b3aafa80124}{usbpf\_init}}(\textcolor{keywordtype}{void} *);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00070}00070 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{usb__pf_8c_a24a514b19fe9fdc5461a6fc902e7e841}{usbpf\_uninit}}(\textcolor{keywordtype}{void} *);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00071}00071 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{usb__pf_8c_ad4743b63aa2fd288e24a52a0e72d0071}{usbpf\_ioctl}}(\textcolor{keyword}{struct} ifnet *, u\_long, caddr\_t);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00072}00072 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{usb__pf_8c_ae2f15f4bc039ca23d6456e20a547ae3c}{usbpf\_clone\_match}}(\textcolor{keyword}{struct} if\_clone *, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00073}00073 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{usb__pf_8c_aacdf759b058a0dc78a84e1cdb84e05e7}{usbpf\_clone\_create}}(\textcolor{keyword}{struct} if\_clone *, \textcolor{keywordtype}{char} *, \textcolor{keywordtype}{size\_t}, caddr\_t);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00074}00074 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{usb__pf_8c_adcea488e13192278ce63d323983b3d18}{usbpf\_clone\_destroy}}(\textcolor{keyword}{struct} if\_clone *, \textcolor{keyword}{struct} ifnet *);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00075}00075 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__bus}{usb\_bus}} *\mbox{\hyperlink{usb__pf_8c_a0aa3707af1d94230dcfc7391ce1dd393}{usbpf\_ifname2ubus}}(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00076}00076 \textcolor{keyword}{static} uint32\_t \mbox{\hyperlink{usb__pf_8c_a7e60fe397320b30d25474fc87337c053}{usbpf\_aggregate\_xferflags}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer__flags}{usb\_xfer\_flags}} *);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00077}00077 \textcolor{keyword}{static} uint32\_t \mbox{\hyperlink{usb__pf_8c_afb957fa313afb0a21e9dcf4ffa157cf7}{usbpf\_aggregate\_status}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer__flags__int}{usb\_xfer\_flags\_int}} *);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00078}00078 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{usb__pf_8c_a3de6486d9d75abdf7c9a567627ecee1a}{usbpf\_xfer\_frame\_is\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *, uint32\_t);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00079}00079 \textcolor{keyword}{static} uint32\_t \mbox{\hyperlink{usb__pf_8c_a37aa33c1f5331360e5439d7df5b346eb}{usbpf\_xfer\_precompute\_size}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00080}00080 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00081}\mbox{\hyperlink{usb__pf_8c_a38a31e725b1610bd9dbb46d56ed4874b}{00081}} \textcolor{keyword}{static} \textcolor{keyword}{struct }if\_clone *\mbox{\hyperlink{usb__pf_8c_a38a31e725b1610bd9dbb46d56ed4874b}{usbpf\_cloner}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00082}\mbox{\hyperlink{usb__pf_8c_a24f86dcc36c250cb7c00297036145eeb}{00082}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} \mbox{\hyperlink{usb__pf_8c_a24f86dcc36c250cb7c00297036145eeb}{usbusname}}[] = \textcolor{stringliteral}{"{}usbus"{}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00083}00083 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00084}\mbox{\hyperlink{usb__pf_8c_aeb3a15203a187ea4f8c2ca0a5d6e77b6}{00084}} \mbox{\hyperlink{usb__pf_8c_aeb3a15203a187ea4f8c2ca0a5d6e77b6}{SYSINIT}}(\mbox{\hyperlink{usb__pf_8c_ab718cd2552c91d6e13c87b3aafa80124}{usbpf\_init}}, SI\_SUB\_PSEUDO, SI\_ORDER\_MIDDLE, \mbox{\hyperlink{usb__pf_8c_ab718cd2552c91d6e13c87b3aafa80124}{usbpf\_init}}, NULL);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00085}\mbox{\hyperlink{usb__pf_8c_a89362c93d6726f4c64285cd0cfab7365}{00085}} \mbox{\hyperlink{usb__pf_8c_a89362c93d6726f4c64285cd0cfab7365}{SYSUNINIT}}(\mbox{\hyperlink{usb__pf_8c_a24a514b19fe9fdc5461a6fc902e7e841}{usbpf\_uninit}}, SI\_SUB\_PSEUDO, SI\_ORDER\_MIDDLE, \mbox{\hyperlink{usb__pf_8c_a24a514b19fe9fdc5461a6fc902e7e841}{usbpf\_uninit}}, NULL);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00086}00086 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00087}00087 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00088}\mbox{\hyperlink{usb__pf_8c_ab718cd2552c91d6e13c87b3aafa80124}{00088}} \mbox{\hyperlink{usb__pf_8c_ab718cd2552c91d6e13c87b3aafa80124}{usbpf\_init}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00089}00089 \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00090}00090 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00091}00091         \mbox{\hyperlink{usb__pf_8c_a38a31e725b1610bd9dbb46d56ed4874b}{usbpf\_cloner}} = if\_clone\_advanced(\mbox{\hyperlink{usb__pf_8c_a24f86dcc36c250cb7c00297036145eeb}{usbusname}}, 0, \mbox{\hyperlink{usb__pf_8c_ae2f15f4bc039ca23d6456e20a547ae3c}{usbpf\_clone\_match}},}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00092}00092             \mbox{\hyperlink{usb__pf_8c_aacdf759b058a0dc78a84e1cdb84e05e7}{usbpf\_clone\_create}}, \mbox{\hyperlink{usb__pf_8c_adcea488e13192278ce63d323983b3d18}{usbpf\_clone\_destroy}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00093}00093 \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00094}00094 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00095}00095 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00096}\mbox{\hyperlink{usb__pf_8c_a24a514b19fe9fdc5461a6fc902e7e841}{00096}} \mbox{\hyperlink{usb__pf_8c_a24a514b19fe9fdc5461a6fc902e7e841}{usbpf\_uninit}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00097}00097 \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00098}00098         \textcolor{keywordtype}{int} devlcnt;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00099}00099         device\_t *devlp;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00100}00100         devclass\_t dc;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00101}00101         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__bus}{usb\_bus}} *ubus;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00102}00102         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00103}00103         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00104}00104 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00105}00105         if\_clone\_detach(\mbox{\hyperlink{usb__pf_8c_a38a31e725b1610bd9dbb46d56ed4874b}{usbpf\_cloner}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00106}00106 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00107}00107         dc = devclass\_find(\mbox{\hyperlink{usb__pf_8c_a24f86dcc36c250cb7c00297036145eeb}{usbusname}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00108}00108         \textcolor{keywordflow}{if} (dc == NULL)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00109}00109                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00110}00110         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = devclass\_get\_devices(dc, \&devlp, \&devlcnt);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00111}00111         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00112}00112                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00113}00113         \textcolor{keywordflow}{for} (i = 0; i < devlcnt; i++) \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00114}00114                 ubus = device\_get\_softc(devlp[i]);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00115}00115                 \textcolor{keywordflow}{if} (ubus != NULL \&\& ubus-\/>\mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}} != NULL)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00116}00116                         \mbox{\hyperlink{usb__pf_8c_adcea488e13192278ce63d323983b3d18}{usbpf\_clone\_destroy}}(\mbox{\hyperlink{usb__pf_8c_a38a31e725b1610bd9dbb46d56ed4874b}{usbpf\_cloner}}, ubus-\/>\mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00117}00117         \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00118}00118         free(devlp, M\_TEMP);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00119}00119 \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00120}00120 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00121}00121 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00122}\mbox{\hyperlink{usb__pf_8c_ad4743b63aa2fd288e24a52a0e72d0071}{00122}} \mbox{\hyperlink{usb__pf_8c_ad4743b63aa2fd288e24a52a0e72d0071}{usbpf\_ioctl}}(\textcolor{keyword}{struct} ifnet *\mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}}, u\_long cmd, caddr\_t data)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00123}00123 \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00124}00124 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00125}00125         \textcolor{comment}{/* No configuration allowed. */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00126}00126         \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00127}00127 \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00128}00128 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00129}00129 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__bus}{usb\_bus}} *}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00130}\mbox{\hyperlink{usb__pf_8c_a0aa3707af1d94230dcfc7391ce1dd393}{00130}} \mbox{\hyperlink{usb__pf_8c_a0aa3707af1d94230dcfc7391ce1dd393}{usbpf\_ifname2ubus}}(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *ifname)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00131}00131 \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00132}00132         device\_t dev;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00133}00133         devclass\_t dc;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00134}00134         \textcolor{keywordtype}{int} unit;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00135}00135         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00136}00136 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00137}00137         \textcolor{keywordflow}{if} (strncmp(ifname, \mbox{\hyperlink{usb__pf_8c_a24f86dcc36c250cb7c00297036145eeb}{usbusname}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{usb__pf_8c_a24f86dcc36c250cb7c00297036145eeb}{usbusname}}) -\/ 1) != 0)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00138}00138                 \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00139}00139         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ifc\_name2unit(ifname, \&unit);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00140}00140         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} || unit < 0)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00141}00141                 \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00142}00142         dc = devclass\_find(\mbox{\hyperlink{usb__pf_8c_a24f86dcc36c250cb7c00297036145eeb}{usbusname}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00143}00143         \textcolor{keywordflow}{if} (dc == NULL)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00144}00144                 \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00145}00145         dev = devclass\_get\_device(dc, unit);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00146}00146         \textcolor{keywordflow}{if} (dev == NULL)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00147}00147                 \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00148}00148 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00149}00149         \textcolor{keywordflow}{return} (device\_get\_softc(dev));}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00150}00150 \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00151}00151 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00152}00152 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00153}\mbox{\hyperlink{usb__pf_8c_ae2f15f4bc039ca23d6456e20a547ae3c}{00153}} \mbox{\hyperlink{usb__pf_8c_ae2f15f4bc039ca23d6456e20a547ae3c}{usbpf\_clone\_match}}(\textcolor{keyword}{struct} if\_clone *ifc, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00154}00154 \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00155}00155         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__bus}{usb\_bus}} *ubus;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00156}00156 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00157}00157         ubus = \mbox{\hyperlink{usb__pf_8c_a0aa3707af1d94230dcfc7391ce1dd393}{usbpf\_ifname2ubus}}(name);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00158}00158         \textcolor{keywordflow}{if} (ubus == NULL)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00159}00159                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00160}00160         \textcolor{keywordflow}{if} (ubus-\/>\mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}} != NULL)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00161}00161                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00162}00162 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00163}00163         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00164}00164 \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00165}00165 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00166}00166 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00167}\mbox{\hyperlink{usb__pf_8c_aacdf759b058a0dc78a84e1cdb84e05e7}{00167}} \mbox{\hyperlink{usb__pf_8c_aacdf759b058a0dc78a84e1cdb84e05e7}{usbpf\_clone\_create}}(\textcolor{keyword}{struct} if\_clone *ifc, \textcolor{keywordtype}{char} *name, \textcolor{keywordtype}{size\_t} \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}}, caddr\_t params)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00168}00168 \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00169}00169         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00170}00170         \textcolor{keywordtype}{int} unit;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00171}00171         \textcolor{keyword}{struct }ifnet *ifp;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00172}00172         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__bus}{usb\_bus}} *ubus;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00173}00173 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00174}00174         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ifc\_name2unit(name, \&unit);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00175}00175         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00176}00176                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00177}00177         \textcolor{keywordflow}{if} (unit < 0)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00178}00178                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00179}00179 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00180}00180         ubus = \mbox{\hyperlink{usb__pf_8c_a0aa3707af1d94230dcfc7391ce1dd393}{usbpf\_ifname2ubus}}(name);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00181}00181         \textcolor{keywordflow}{if} (ubus == NULL)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00182}00182                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00183}00183         \textcolor{keywordflow}{if} (ubus-\/>\mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}} != NULL)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00184}00184                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00185}00185 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00186}00186         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = ifc\_alloc\_unit(ifc, \&unit);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00187}00187         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00188}00188                 device\_printf(ubus-\/>\mbox{\hyperlink{structusb__bus_a7855a7fc5c4b3f5289323c7743c6a975}{parent}}, \textcolor{stringliteral}{"{}usbpf: Could not allocate "{}}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00189}00189                     \textcolor{stringliteral}{"{}instance\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00190}00190                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00191}00191         \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00192}00192         \mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}} = ubus-\/>\mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}} = if\_alloc(IFT\_USB);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00193}00193         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00194}00194                 ifc\_free\_unit(ifc, unit);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00195}00195                 device\_printf(ubus-\/>\mbox{\hyperlink{structusb__bus_a7855a7fc5c4b3f5289323c7743c6a975}{parent}}, \textcolor{stringliteral}{"{}usbpf: Could not allocate "{}}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00196}00196                     \textcolor{stringliteral}{"{}instance\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00197}00197                 \textcolor{keywordflow}{return} (ENOSPC);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00198}00198         \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00199}00199         strlcpy(\mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}}-\/>if\_xname, name, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}}-\/>if\_xname));}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00200}00200         \mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}}-\/>if\_softc = ubus;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00201}00201         \mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}}-\/>if\_dname = \mbox{\hyperlink{usb__pf_8c_a24f86dcc36c250cb7c00297036145eeb}{usbusname}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00202}00202         \mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}}-\/>if\_dunit = unit;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00203}00203         \mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}}-\/>if\_ioctl = \mbox{\hyperlink{usb__pf_8c_ad4743b63aa2fd288e24a52a0e72d0071}{usbpf\_ioctl}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00204}00204         if\_attach(\mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00205}00205         \mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}}-\/>if\_flags |= IFF\_UP;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00206}00206         rt\_ifmsg(\mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00207}00207         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00208}00208 \textcolor{comment}{         * XXX According to the specification of DLT\_USB, it indicates}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00209}00209 \textcolor{comment}{         * packets beginning with USB setup header. But not sure all}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00210}00210 \textcolor{comment}{         * packets would be.}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00211}00211 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00212}00212         bpfattach(\mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}}, DLT\_USB, \mbox{\hyperlink{usb__pf_8h_afe04732911f99a9ab3b5a9a4adc4f7ca}{USBPF\_HDR\_LEN}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00213}00213 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00214}00214         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00215}00215 \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00216}00216 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00217}00217 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00218}\mbox{\hyperlink{usb__pf_8c_adcea488e13192278ce63d323983b3d18}{00218}} \mbox{\hyperlink{usb__pf_8c_adcea488e13192278ce63d323983b3d18}{usbpf\_clone\_destroy}}(\textcolor{keyword}{struct} if\_clone *ifc, \textcolor{keyword}{struct} ifnet *\mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}})}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00219}00219 \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00220}00220         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__bus}{usb\_bus}} *ubus;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00221}00221         \textcolor{keywordtype}{int} unit;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00222}00222 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00223}00223         ubus = \mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}}-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00224}00224         unit = \mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}}-\/>if\_dunit;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00225}00225 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00226}00226         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00227}00227 \textcolor{comment}{         * Lock USB before clearing the "{}ifp"{} pointer, to avoid}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00228}00228 \textcolor{comment}{         * clearing the pointer in the middle of a TAP operation:}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00229}00229 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00230}00230         \mbox{\hyperlink{usb__core_8h_a21dab1de8f52baf9fbf7617c6b1ec033}{USB\_BUS\_LOCK}}(ubus);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00231}00231         ubus-\/>\mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}} = NULL;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00232}00232         \mbox{\hyperlink{usb__core_8h_aadb0c32f6333b8a0715929ace5f550b2}{USB\_BUS\_UNLOCK}}(ubus);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00233}00233         bpfdetach(\mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00234}00234         if\_detach(\mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00235}00235         if\_free(\mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00236}00236         ifc\_free\_unit(ifc, unit);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00237}00237 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00238}00238         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00239}00239 \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00240}00240 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00241}00241 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00242}\mbox{\hyperlink{usb__pf_8c_a04e1e553df5b9c0449db857629816537}{00242}} \mbox{\hyperlink{usb__pf_8c_a04e1e553df5b9c0449db857629816537}{usbpf\_attach}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__bus}{usb\_bus}} *ubus)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00243}00243 \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00244}00244 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00245}00245         \textcolor{keywordflow}{if} (bootverbose)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00246}00246                 device\_printf(ubus-\/>\mbox{\hyperlink{structusb__bus_a7855a7fc5c4b3f5289323c7743c6a975}{parent}}, \textcolor{stringliteral}{"{}usbpf: Attached\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00247}00247 \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00248}00248 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00249}00249 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00250}\mbox{\hyperlink{usb__pf_8c_ab88f337ec1a1838c2a0844884a08f555}{00250}} \mbox{\hyperlink{usb__pf_8c_ab88f337ec1a1838c2a0844884a08f555}{usbpf\_detach}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__bus}{usb\_bus}} *ubus)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00251}00251 \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00252}00252 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00253}00253         \textcolor{keywordflow}{if} (ubus-\/>\mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}} != NULL)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00254}00254                 \mbox{\hyperlink{usb__pf_8c_adcea488e13192278ce63d323983b3d18}{usbpf\_clone\_destroy}}(\mbox{\hyperlink{usb__pf_8c_a38a31e725b1610bd9dbb46d56ed4874b}{usbpf\_cloner}}, ubus-\/>\mbox{\hyperlink{structusb__bus_a7202127281b1e864538025fbb902f36b}{ifp}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00255}00255         \textcolor{keywordflow}{if} (bootverbose)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00256}00256                 device\_printf(ubus-\/>\mbox{\hyperlink{structusb__bus_a7855a7fc5c4b3f5289323c7743c6a975}{parent}}, \textcolor{stringliteral}{"{}usbpf: Detached\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00257}00257 \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00258}00258 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00259}00259 \textcolor{keyword}{static} uint32\_t}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00260}\mbox{\hyperlink{usb__pf_8c_a7e60fe397320b30d25474fc87337c053}{00260}} \mbox{\hyperlink{usb__pf_8c_a7e60fe397320b30d25474fc87337c053}{usbpf\_aggregate\_xferflags}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer__flags}{usb\_xfer\_flags}} *flags)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00261}00261 \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00262}00262         uint32\_t \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00263}00263 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00264}00264         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags_a76816b701c58c22a9a78904b109c2e95}{force\_short\_xfer}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00265}00265                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_a2232289c282d5ac048482c28da65ce4e}{USBPF\_FLAG\_FORCE\_SHORT\_XFER}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00266}00266         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags_a295c379f07c6ff99b213195edc70e3a2}{short\_xfer\_ok}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00267}00267                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_a5bb4c68d36b1d4cdecc77774a9ac1d2d}{USBPF\_FLAG\_SHORT\_XFER\_OK}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00268}00268         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags_a4cebfba0749680b43016090e78773210}{short\_frames\_ok}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00269}00269                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_aa9b7978f8d91dd65a0d00be2ca42c168}{USBPF\_FLAG\_SHORT\_FRAMES\_OK}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00270}00270         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags_a1d8753add0a6492b5dc13e1fba50106c}{pipe\_bof}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00271}00271                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_ad6f8f79ac05c0191acfb285d87e5632f}{USBPF\_FLAG\_PIPE\_BOF}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00272}00272         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags_a0654b9d81007fe4e04eca967e546c4c0}{proxy\_buffer}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00273}00273                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_a853f895ff40c9e9454971b56f3281678}{USBPF\_FLAG\_PROXY\_BUFFER}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00274}00274         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags_ab4d22a745b8cdf7853cb70e4e71ce4b5}{ext\_buffer}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00275}00275                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_ae1b0eaebaed1162d51dfe41bb53dd887}{USBPF\_FLAG\_EXT\_BUFFER}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00276}00276         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags_a2df55489fc97240c42834151d9c8b8d0}{manual\_status}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00277}00277                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_afef786461b16f793ab7c7f6c91c4fcd6}{USBPF\_FLAG\_MANUAL\_STATUS}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00278}00278         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags_a7844c9d23bffec21cfaea8e157217e54}{no\_pipe\_ok}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00279}00279                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_ad7877267381385b348258f3f1cca0c82}{USBPF\_FLAG\_NO\_PIPE\_OK}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00280}00280         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags_a2c12dafab7afc38dc63f7ba2cd359517}{stall\_pipe}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00281}00281                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_adb05ae750aaa6ee0040103c572b70d92}{USBPF\_FLAG\_STALL\_PIPE}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00282}00282         \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00283}00283 \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00284}00284 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00285}00285 \textcolor{keyword}{static} uint32\_t}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00286}\mbox{\hyperlink{usb__pf_8c_afb957fa313afb0a21e9dcf4ffa157cf7}{00286}} \mbox{\hyperlink{usb__pf_8c_afb957fa313afb0a21e9dcf4ffa157cf7}{usbpf\_aggregate\_status}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer__flags__int}{usb\_xfer\_flags\_int}} *flags)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00287}00287 \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00288}00288         uint32\_t \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00289}00289 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00290}00290         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags__int_a5c9960916622384a83180b1fa422a248}{open}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00291}00291                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_afecb8b3adb22a3a4257404c149a7c884}{USBPF\_STATUS\_OPEN}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00292}00292         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags__int_a05b71f22cb3a7cf08474b6ed4f630d14}{transferring}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00293}00293                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_acffcc7a410f9bb17b1c2dddfdb9718f2}{USBPF\_STATUS\_TRANSFERRING}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00294}00294         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags__int_a89ad1514784afb61bc49621bcc5d8b3e}{did\_dma\_delay}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00295}00295                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_a3ab80b4b1fc5f41d93c41ff3cddc23c3}{USBPF\_STATUS\_DID\_DMA\_DELAY}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00296}00296         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags__int_af1bc5d2f2d16e6b62574d4e3cf68cce0}{did\_close}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00297}00297                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_a093f7398f844f6fd904b6de9a27cc269}{USBPF\_STATUS\_DID\_CLOSE}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00298}00298         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags__int_a215eace50c980a122a81c93b3dd91111}{draining}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00299}00299                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_a49cd5d014563e9734beef477c8647fdc}{USBPF\_STATUS\_DRAINING}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00300}00300         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags__int_a94e1972b73c853fafca449c099739ffb}{started}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00301}00301                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_abefbbd8a8a11cb43328db21f7a7cd092}{USBPF\_STATUS\_STARTED}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00302}00302         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags__int_ae68dc5b28a589268a7b7e461ba7659c5}{bandwidth\_reclaimed}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00303}00303                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_a4b5594ad9709bc82f03c6d5b68682e97}{USBPF\_STATUS\_BW\_RECLAIMED}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00304}00304         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags__int_a777cf7dd18178f84b0d6e0a086f72a7a}{control\_xfr}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00305}00305                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_a11183ff9d4eb1346ad3f3a72ea90cb41}{USBPF\_STATUS\_CONTROL\_XFR}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00306}00306         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags__int_a0add2c86d09b768df5f354746b8fe16f}{control\_hdr}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00307}00307                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_ac93a4614c0d3793cbe4579844b384c8f}{USBPF\_STATUS\_CONTROL\_HDR}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00308}00308         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags__int_a100da5a86a7ab85605683dc51d48ef86}{control\_act}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00309}00309                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_a22fcb1b0e7a33fbe89e4ced85253a243}{USBPF\_STATUS\_CONTROL\_ACT}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00310}00310         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags__int_a62d0b716bbeed6d1abd325baf168f145}{control\_stall}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00311}00311                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_a5b513e4e63565d4ba0a89ac7eae24ba5}{USBPF\_STATUS\_CONTROL\_STALL}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00312}00312         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags__int_a1023a81a83c7acfbe3134100363e7fde}{short\_frames\_ok}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00313}00313                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_a2b63d1ce4e728eb2241273f421010a10}{USBPF\_STATUS\_SHORT\_FRAMES\_OK}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00314}00314         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags__int_ad86e9a0e2532320e20bac036b8cf49bc}{short\_xfer\_ok}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00315}00315                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_aa240c4f6378b6d2445d9ec6e9d726033}{USBPF\_STATUS\_SHORT\_XFER\_OK}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00316}00316 \textcolor{preprocessor}{\#if USB\_HAVE\_BUSDMA}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00317}00317         \textcolor{keywordflow}{if} (flags-\/>bdma\_enable == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00318}00318                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_a4ac3f66acdab8438d89cad47fa6d7450}{USBPF\_STATUS\_BDMA\_ENABLE}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00319}00319         \textcolor{keywordflow}{if} (flags-\/>bdma\_no\_post\_sync == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00320}00320                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_ab39e6cfdefe3e70dec31e81ff227e7cf}{USBPF\_STATUS\_BDMA\_NO\_POST\_SYNC}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00321}00321         \textcolor{keywordflow}{if} (flags-\/>bdma\_setup == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00322}00322                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_aabaf89c91b670a7161f06a19bb63fcc7}{USBPF\_STATUS\_BDMA\_SETUP}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00323}00323 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00324}00324         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags__int_a5367e64daae30f55ec887872d577fa80}{isochronous\_xfr}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00325}00325                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_a7983630c31feea7013cb8553dddcd1a0}{USBPF\_STATUS\_ISOCHRONOUS\_XFR}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00326}00326         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags__int_a7574b7503818fc7c9e8f08fb5919a373}{curr\_dma\_set}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00327}00327                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_a40965e53d8c278193600abf0644dfd45}{USBPF\_STATUS\_CURR\_DMA\_SET}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00328}00328         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags__int_a8b3cd041803f3e2018005464ff7a5dcc}{can\_cancel\_immed}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00329}00329                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_a0bb0d228a2c3de99ddd4e39609f80782}{USBPF\_STATUS\_CAN\_CANCEL\_IMMED}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00330}00330         \textcolor{keywordflow}{if} (flags-\/>\mbox{\hyperlink{structusb__xfer__flags__int_a37cbb0ccf85243c43d623a6112072a3e}{doing\_callback}} == 1)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00331}00331                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{usb__pf_8h_a93496ea7cd4c939e6248532eacf091c6}{USBPF\_STATUS\_DOING\_CALLBACK}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00332}00332 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00333}00333         \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00334}00334 \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00335}00335 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00336}00336 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00337}\mbox{\hyperlink{usb__pf_8c_a3de6486d9d75abdf7c9a567627ecee1a}{00337}} \mbox{\hyperlink{usb__pf_8c_a3de6486d9d75abdf7c9a567627ecee1a}{usbpf\_xfer\_frame\_is\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer, uint32\_t frame)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00338}00338 \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00339}00339         \textcolor{keywordtype}{int} isread;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00340}00340 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00341}00341         \textcolor{keywordflow}{if} ((frame == 0) \&\& (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a777cf7dd18178f84b0d6e0a086f72a7a}{control\_xfr}} != 0) \&\&}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00342}00342             (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a0add2c86d09b768df5f354746b8fe16f}{control\_hdr}} != 0)) \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00343}00343                 \textcolor{comment}{/* special case */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00344}00344                 \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a0ea2ef8ef9f5c2c6676e7f609c2a4ada}{usb\_mode}} == \mbox{\hyperlink{usb_8h_a9bc559812598988121896dceb483806bada6c05f1ad342e782a92990170fca2cc}{USB\_MODE\_DEVICE}}) \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00345}00345                         \textcolor{comment}{/* The device controller writes to memory */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00346}00346                         isread = 1;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00347}00347                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00348}00348                         \textcolor{comment}{/* The host controller reads from memory */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00349}00349                         isread = 0;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00350}00350                 \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00351}00351         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00352}00352                 isread = \mbox{\hyperlink{usb__core_8h_a16f75f66a2fd6d118735bc8bc9700883}{USB\_GET\_DATA\_ISREAD}}(xfer);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00353}00353         \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00354}00354         \textcolor{keywordflow}{return} (isread);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00355}00355 \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00356}00356 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00357}00357 \textcolor{keyword}{static} uint32\_t}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00358}\mbox{\hyperlink{usb__pf_8c_a37aa33c1f5331360e5439d7df5b346eb}{00358}} \mbox{\hyperlink{usb__pf_8c_a37aa33c1f5331360e5439d7df5b346eb}{usbpf\_xfer\_precompute\_size}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer, \textcolor{keywordtype}{int} type)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00359}00359 \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00360}00360         uint32\_t totlen;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00361}00361         uint32\_t x;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00362}00362         uint32\_t nframes;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00363}00363 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00364}00364         \textcolor{keywordflow}{if} (type == \mbox{\hyperlink{usb__pf_8h_ac05597be4cba7c22ab64c09edc4d8527}{USBPF\_XFERTAP\_SUBMIT}})}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00365}00365                 nframes = xfer-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00366}00366         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00367}00367                 nframes = xfer-\/>\mbox{\hyperlink{structusb__xfer_a7f58fffa56cac11410055f785c4c5ffa}{aframes}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00368}00368 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00369}00369         totlen = \mbox{\hyperlink{usb__pf_8h_afe04732911f99a9ab3b5a9a4adc4f7ca}{USBPF\_HDR\_LEN}} + (\mbox{\hyperlink{usb__pf_8h_a6fd4248245c1c94f099bf6a8a90432dd}{USBPF\_FRAME\_HDR\_LEN}} * nframes);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00370}00370 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00371}00371         \textcolor{comment}{/* precompute all trace lengths */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00372}00372         \textcolor{keywordflow}{for} (x = 0; x != nframes; x++) \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00373}00373                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__pf_8c_a3de6486d9d75abdf7c9a567627ecee1a}{usbpf\_xfer\_frame\_is\_read}}(xfer, x)) \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00374}00374                         \textcolor{keywordflow}{if} (type != \mbox{\hyperlink{usb__pf_8h_ac05597be4cba7c22ab64c09edc4d8527}{USBPF\_XFERTAP\_SUBMIT}}) \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00375}00375                                 totlen += \mbox{\hyperlink{usb__pf_8h_a1026d881ee1ea465f57fc86fead00a0b}{USBPF\_FRAME\_ALIGN}}(}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00376}00376                                     xfer-\/>\mbox{\hyperlink{structusb__xfer_a04bfeb929b15a30d355f94eb7ff2a586}{frlengths}}[x]);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00377}00377                         \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00378}00378                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00379}00379                         \textcolor{keywordflow}{if} (type == \mbox{\hyperlink{usb__pf_8h_ac05597be4cba7c22ab64c09edc4d8527}{USBPF\_XFERTAP\_SUBMIT}}) \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00380}00380                                 totlen += \mbox{\hyperlink{usb__pf_8h_a1026d881ee1ea465f57fc86fead00a0b}{USBPF\_FRAME\_ALIGN}}(}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00381}00381                                     xfer-\/>\mbox{\hyperlink{structusb__xfer_a04bfeb929b15a30d355f94eb7ff2a586}{frlengths}}[x]);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00382}00382                         \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00383}00383                 \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00384}00384         \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00385}00385         \textcolor{keywordflow}{return} (totlen);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00386}00386 \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00387}00387 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00388}00388 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00389}\mbox{\hyperlink{usb__pf_8c_a2582177a8e03233b03cab24cc336bbfc}{00389}} \mbox{\hyperlink{usb__pf_8c_a2582177a8e03233b03cab24cc336bbfc}{usbpf\_xfertap}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer, \textcolor{keywordtype}{int} type)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00390}00390 \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00391}00391         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__bus}{usb\_bus}} *bus;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00392}00392         \textcolor{keyword}{struct }\mbox{\hyperlink{structusbpf__pkthdr}{usbpf\_pkthdr}} *up;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00393}00393         \textcolor{keyword}{struct }\mbox{\hyperlink{structusbpf__framehdr}{usbpf\_framehdr}} *uf;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00394}00394         \mbox{\hyperlink{usb__freebsd_8h_a66bb6b1869e5e89aff3b693720b39cfb}{usb\_frlength\_t}} \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00395}00395         uint32\_t totlen;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00396}00396         uint32\_t frame;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00397}00397         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00398}00398         uint32\_t nframes;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00399}00399         uint32\_t x;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00400}00400         uint8\_t *buf;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00401}00401         uint8\_t *ptr;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00402}00402 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00403}00403         bus = xfer-\/>\mbox{\hyperlink{structusb__xfer_ad188b4cd79900e1cd04aba6c140e9ab3}{xroot}}-\/>\mbox{\hyperlink{structusb__xfer__root_a870218d57253f00f1e9baa19401c9b0c}{bus}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00404}00404 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00405}00405         \textcolor{comment}{/* sanity checks */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00406}00406         \textcolor{keywordflow}{if} (bus-\/>ifp == NULL || bus-\/>ifp-\/>if\_bpf == NULL)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00407}00407                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00408}00408         \textcolor{keywordflow}{if} (!bpf\_peers\_present(bus-\/>ifp-\/>if\_bpf))}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00409}00409                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00410}00410 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00411}00411         totlen = \mbox{\hyperlink{usb__pf_8c_a37aa33c1f5331360e5439d7df5b346eb}{usbpf\_xfer\_precompute\_size}}(xfer, type);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00412}00412 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00413}00413         \textcolor{keywordflow}{if} (type == \mbox{\hyperlink{usb__pf_8h_ac05597be4cba7c22ab64c09edc4d8527}{USBPF\_XFERTAP\_SUBMIT}})}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00414}00414                 nframes = xfer-\/>\mbox{\hyperlink{structusb__xfer_a0d60b7394e3ea099dc1c466efe87c6e2}{nframes}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00415}00415         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00416}00416                 nframes = xfer-\/>\mbox{\hyperlink{structusb__xfer_a7f58fffa56cac11410055f785c4c5ffa}{aframes}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00417}00417 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00418}00418         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00419}00419 \textcolor{comment}{         * XXX TODO XXX}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00420}00420 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00421}00421 \textcolor{comment}{         * When BPF supports it we could pass a fragmented array of}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00422}00422 \textcolor{comment}{         * buffers avoiding the data copy operation here.}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00423}00423 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00424}00424         buf = ptr = malloc(totlen, M\_TEMP, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00425}00425         \textcolor{keywordflow}{if} (buf == NULL) \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00426}00426                 device\_printf(bus-\/>parent, \textcolor{stringliteral}{"{}usbpf: Out of memory\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00427}00427                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00428}00428         \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00429}00429 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00430}00430         up = (\textcolor{keyword}{struct }\mbox{\hyperlink{structusbpf__pkthdr}{usbpf\_pkthdr}} *)ptr;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00431}00431         ptr += \mbox{\hyperlink{usb__pf_8h_afe04732911f99a9ab3b5a9a4adc4f7ca}{USBPF\_HDR\_LEN}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00432}00432 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00433}00433         \textcolor{comment}{/* fill out header */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00434}00434         temp = device\_get\_unit(bus-\/>bdev);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00435}00435         up-\/>\mbox{\hyperlink{structusbpf__pkthdr_a3902b771ba90378112e90d0a0d797a45}{up\_totlen}} = htole32(totlen);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00436}00436         up-\/>\mbox{\hyperlink{structusbpf__pkthdr_a206852b121b70bf244fa22936e6a09c7}{up\_busunit}} = htole32(temp);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00437}00437         up-\/>\mbox{\hyperlink{structusbpf__pkthdr_a3bcd4569f0d4438831e09b41982d77fb}{up\_address}} = xfer-\/>\mbox{\hyperlink{structusb__xfer_ad188b4cd79900e1cd04aba6c140e9ab3}{xroot}}-\/>\mbox{\hyperlink{structusb__xfer__root_ad636fcdafa42c174cdf281bb144b1e67}{udev}}-\/>\mbox{\hyperlink{structusb__device_a5671e9a7365d48bd470879e2b95ea2e5}{device\_index}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00438}00438         \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a0ea2ef8ef9f5c2c6676e7f609c2a4ada}{usb\_mode}} == \mbox{\hyperlink{usb_8h_a9bc559812598988121896dceb483806bada6c05f1ad342e782a92990170fca2cc}{USB\_MODE\_DEVICE}})}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00439}00439                 up-\/>\mbox{\hyperlink{structusbpf__pkthdr_a042c07dc3666601d85449b40fc462fd3}{up\_mode}} = \mbox{\hyperlink{usb__pf_8h_a6d59654d4ecac09b420bb0960589a727}{USBPF\_MODE\_DEVICE}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00440}00440         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00441}00441                 up-\/>\mbox{\hyperlink{structusbpf__pkthdr_a042c07dc3666601d85449b40fc462fd3}{up\_mode}} = \mbox{\hyperlink{usb__pf_8h_a47884d93ee79d88b856f2c5bcbc3f1a9}{USBPF\_MODE\_HOST}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00442}00442         up-\/>\mbox{\hyperlink{structusbpf__pkthdr_ad6421f8318372be59dd897de17dbbffb}{up\_type}} = type;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00443}00443         up-\/>\mbox{\hyperlink{structusbpf__pkthdr_a306d6f01102e0b47708ba1e6cac03c45}{up\_xfertype}} = xfer-\/>\mbox{\hyperlink{structusb__xfer_a8de3fd948d496c7901b307b13a1c6e99}{endpoint}}-\/>\mbox{\hyperlink{structusb__endpoint_af3b96b9fe1e612b303833c2e2d0365e1}{edesc}}-\/>\mbox{\hyperlink{structusb__endpoint__descriptor_aff28dcc97802a405b31baccd33c2bf8f}{bmAttributes}} \& \mbox{\hyperlink{usb_8h_a8badd3504359a0aed83ac575a46a67b4}{UE\_XFERTYPE}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00444}00444         temp = \mbox{\hyperlink{usb__pf_8c_a7e60fe397320b30d25474fc87337c053}{usbpf\_aggregate\_xferflags}}(\&xfer-\/>\mbox{\hyperlink{structusb__xfer_aa251db061296120bb15fd562088a1d9d}{flags}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00445}00445         up-\/>\mbox{\hyperlink{structusbpf__pkthdr_aa1c03c8048223cd99d7efb390f713f68}{up\_flags}} = htole32(temp);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00446}00446         temp = \mbox{\hyperlink{usb__pf_8c_afb957fa313afb0a21e9dcf4ffa157cf7}{usbpf\_aggregate\_status}}(\&xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00447}00447         up-\/>\mbox{\hyperlink{structusbpf__pkthdr_adc8ad2b54514168a7e9ee4f91b85da18}{up\_status}} = htole32(temp);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00448}00448         temp = xfer-\/>\mbox{\hyperlink{structusb__xfer_a85c5e7431b74a154e8313190f6d1d58f}{error}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00449}00449         up-\/>\mbox{\hyperlink{structusbpf__pkthdr_abc27ecc3aabd726f83c2c653ead9dbef}{up\_error}} = htole32(temp);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00450}00450         temp = xfer-\/>\mbox{\hyperlink{structusb__xfer_adefe203b8c753d8828c4b8dcec099ffc}{interval}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00451}00451         up-\/>\mbox{\hyperlink{structusbpf__pkthdr_a0175ba7e50c391bb076b5cc86712bac1}{up\_interval}} = htole32(temp);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00452}00452         up-\/>\mbox{\hyperlink{structusbpf__pkthdr_a58ec24d943c4097586bd42632fed704c}{up\_frames}} = htole32(nframes);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00453}00453         temp = xfer-\/>\mbox{\hyperlink{structusb__xfer_aefcde8a630b7adefe68cc72e7e7a5bb5}{max\_packet\_size}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00454}00454         up-\/>\mbox{\hyperlink{structusbpf__pkthdr_ab71fc01738374e5cae95e0041014ec25}{up\_packet\_size}} = htole32(temp);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00455}00455         temp = xfer-\/>\mbox{\hyperlink{structusb__xfer_a68da814bcdf59aaa6975cfd931a3f97f}{max\_packet\_count}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00456}00456         up-\/>\mbox{\hyperlink{structusbpf__pkthdr_a64a0eb81ae05e2df6fc71af5b068dd7c}{up\_packet\_count}} = htole32(temp);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00457}00457         temp = xfer-\/>\mbox{\hyperlink{structusb__xfer_afe9addf10f35e5301cce41ebf42b5db2}{endpointno}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00458}00458         up-\/>\mbox{\hyperlink{structusbpf__pkthdr_a7bfe05669d5d046ae349456996659666}{up\_endpoint}} = htole32(temp);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00459}00459         up-\/>\mbox{\hyperlink{structusbpf__pkthdr_a9b5678645a069799a3ef00c6dd546f85}{up\_speed}} = xfer-\/>\mbox{\hyperlink{structusb__xfer_ad188b4cd79900e1cd04aba6c140e9ab3}{xroot}}-\/>\mbox{\hyperlink{structusb__xfer__root_ad636fcdafa42c174cdf281bb144b1e67}{udev}}-\/>\mbox{\hyperlink{structusb__device_a1fc02abd43bd33f295493ed23debd852}{speed}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00460}00460 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00461}00461         \textcolor{comment}{/* clear reserved area */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00462}00462         memset(up-\/>\mbox{\hyperlink{structusbpf__pkthdr_a033266e398a26ef2629711588d989da1}{up\_reserved}}, 0, \textcolor{keyword}{sizeof}(up-\/>\mbox{\hyperlink{structusbpf__pkthdr_a033266e398a26ef2629711588d989da1}{up\_reserved}}));}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00463}00463 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00464}00464         \textcolor{comment}{/* init offset and frame */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00465}00465         \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00466}00466         frame = 0;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00467}00467 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00468}00468         \textcolor{comment}{/* iterate all the USB frames and copy data, if any */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00469}00469         \textcolor{keywordflow}{for} (x = 0; x != nframes; x++) \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00470}00470                 uint32\_t length;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00471}00471                 \textcolor{keywordtype}{int} isread;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00472}00472 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00473}00473                 \textcolor{comment}{/* get length */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00474}00474                 length = xfer-\/>\mbox{\hyperlink{structusb__xfer_a04bfeb929b15a30d355f94eb7ff2a586}{frlengths}}[x];}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00475}00475 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00476}00476                 \textcolor{comment}{/* get frame header pointer */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00477}00477                 uf = (\textcolor{keyword}{struct }\mbox{\hyperlink{structusbpf__framehdr}{usbpf\_framehdr}} *)ptr;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00478}00478                 ptr += \mbox{\hyperlink{usb__pf_8h_a6fd4248245c1c94f099bf6a8a90432dd}{USBPF\_FRAME\_HDR\_LEN}};}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00479}00479 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00480}00480                 \textcolor{comment}{/* fill out packet header */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00481}00481                 uf-\/>\mbox{\hyperlink{structusbpf__framehdr_a9de1f3c032bdfd205be2c0413b796b86}{length}} = htole32(\mbox{\hyperlink{structusbpf__framehdr_a9de1f3c032bdfd205be2c0413b796b86}{length}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00482}00482                 uf-\/>\mbox{\hyperlink{structusbpf__framehdr_a6e108ac306d828d172e2b186dc7e07c9}{flags}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00483}00483 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00484}00484                 \textcolor{comment}{/* get information about data read/write */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00485}00485                 isread = \mbox{\hyperlink{usb__pf_8c_a3de6486d9d75abdf7c9a567627ecee1a}{usbpf\_xfer\_frame\_is\_read}}(xfer, x);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00486}00486 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00487}00487                 \textcolor{comment}{/* check if we need to copy any data */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00488}00488                 \textcolor{keywordflow}{if} (isread) \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00489}00489                         \textcolor{keywordflow}{if} (type == \mbox{\hyperlink{usb__pf_8h_ac05597be4cba7c22ab64c09edc4d8527}{USBPF\_XFERTAP\_SUBMIT}})}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00490}00490                                 \mbox{\hyperlink{structusbpf__framehdr_a9de1f3c032bdfd205be2c0413b796b86}{length}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00491}00491                         \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00492}00492                                 uf-\/>\mbox{\hyperlink{structusbpf__framehdr_a6e108ac306d828d172e2b186dc7e07c9}{flags}} |= htole32(}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00493}00493                                     \mbox{\hyperlink{usb__pf_8h_adbfd6ef3912890cb359f7d2c7b4e53c6}{USBPF\_FRAMEFLAG\_DATA\_FOLLOWS}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00494}00494                         \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00495}00495                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00496}00496                         \textcolor{keywordflow}{if} (type != \mbox{\hyperlink{usb__pf_8h_ac05597be4cba7c22ab64c09edc4d8527}{USBPF\_XFERTAP\_SUBMIT}})}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00497}00497                                 \mbox{\hyperlink{structusbpf__framehdr_a9de1f3c032bdfd205be2c0413b796b86}{length}} = 0;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00498}00498                         \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00499}00499                                 uf-\/>\mbox{\hyperlink{structusbpf__framehdr_a6e108ac306d828d172e2b186dc7e07c9}{flags}} |= htole32(}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00500}00500                                     \mbox{\hyperlink{usb__pf_8h_adbfd6ef3912890cb359f7d2c7b4e53c6}{USBPF\_FRAMEFLAG\_DATA\_FOLLOWS}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00501}00501                         \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00502}00502                 \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00503}00503 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00504}00504                 \textcolor{comment}{/* check if data is read direction */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00505}00505                 \textcolor{keywordflow}{if} (isread)}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00506}00506                         uf-\/>\mbox{\hyperlink{structusbpf__framehdr_a6e108ac306d828d172e2b186dc7e07c9}{flags}} |= htole32(\mbox{\hyperlink{usb__pf_8h_a97c6fe2bfd4b4908285e5b8df3fafd31}{USBPF\_FRAMEFLAG\_READ}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00507}00507 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00508}00508                 \textcolor{comment}{/* copy USB data, if any */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00509}00509                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structusbpf__framehdr_a9de1f3c032bdfd205be2c0413b796b86}{length}} != 0) \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00510}00510                         \textcolor{comment}{/* copy data */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00511}00511                         \mbox{\hyperlink{usb__busdma_8c_af52eece45b7868dbf58386f4c9e4eb9a}{usbd\_copy\_out}}(\&xfer-\/>\mbox{\hyperlink{structusb__xfer_a5937368645458023af557e100989c64a}{frbuffers}}[frame],}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00512}00512                             \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}}, ptr, \mbox{\hyperlink{structusbpf__framehdr_a9de1f3c032bdfd205be2c0413b796b86}{length}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00513}00513 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00514}00514                         \textcolor{comment}{/* align length */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00515}00515                         temp = \mbox{\hyperlink{usb__pf_8h_a1026d881ee1ea465f57fc86fead00a0b}{USBPF\_FRAME\_ALIGN}}(\mbox{\hyperlink{structusbpf__framehdr_a9de1f3c032bdfd205be2c0413b796b86}{length}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00516}00516 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00517}00517                         \textcolor{comment}{/* zero pad */}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00518}00518                         \textcolor{keywordflow}{if} (temp != \mbox{\hyperlink{structusbpf__framehdr_a9de1f3c032bdfd205be2c0413b796b86}{length}})}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00519}00519                                 memset(ptr + \mbox{\hyperlink{structusbpf__framehdr_a9de1f3c032bdfd205be2c0413b796b86}{length}}, 0, temp -\/ \mbox{\hyperlink{structusbpf__framehdr_a9de1f3c032bdfd205be2c0413b796b86}{length}});}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00520}00520 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00521}00521                         ptr += temp;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00522}00522                 \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00523}00523 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00524}00524                 \textcolor{keywordflow}{if} (xfer-\/>\mbox{\hyperlink{structusb__xfer_a8fb7b6b5dbf36063d9b7e5d54d9e15ae}{flags\_int}}.\mbox{\hyperlink{structusb__xfer__flags__int_a5367e64daae30f55ec887872d577fa80}{isochronous\_xfr}}) \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00525}00525                         \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}} += \mbox{\hyperlink{usb__transfer_8c_a4207c2b249f95d68095072c28478675d}{usbd\_xfer\_old\_frame\_length}}(xfer, x);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00526}00526                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00527}00527                         frame ++;}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00528}00528                 \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00529}00529         \}}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00530}00530 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00531}00531         bpf\_tap(bus-\/>ifp-\/>if\_bpf, buf, totlen);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00532}00532 }
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00533}00533         free(buf, M\_TEMP);}
\DoxyCodeLine{\Hypertarget{usb__pf_8c_source_l00534}00534 \}}

\end{DoxyCode}
