\hypertarget{usb__lookup_8c_source}{}\doxysection{usb\+\_\+lookup.\+c}
\label{usb__lookup_8c_source}\index{dev/usb/usb\_lookup.c@{dev/usb/usb\_lookup.c}}
\mbox{\hyperlink{usb__lookup_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00001}00001 \textcolor{comment}{/* \$FreeBSD\$ */}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00002}00002 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00003}00003 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00004}00004 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00007}00007 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00008}00008 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00009}00009 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00010}00010 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00011}00011 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00012}00012 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00013}00013 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00014}00014 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00015}00015 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00016}00016 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00017}00017 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00018}00018 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00019}00019 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00020}00020 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00021}00021 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00022}00022 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00023}00023 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00024}00024 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00025}00025 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00026}00026 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00027}00027 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00028}00028 }
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00029}00029 \textcolor{preprocessor}{\#ifdef USB\_GLOBAL\_INCLUDE\_FILE}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00030}00030 \textcolor{preprocessor}{\#include USB\_GLOBAL\_INCLUDE\_FILE}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00031}00031 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <sys/stdint.h>}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/stddef.h>}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/types.h>}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <sys/condvar.h>}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <sys/sx.h>}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <sys/unistd.h>}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <sys/callout.h>}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <sys/priv.h>}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <sys/limits.h>}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <sys/endian.h>}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00052}00052 }
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb_8h}{dev/usb/usb.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00054}00054 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usbdi_8h}{dev/usb/usbdi.h}}>}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00055}00055 \textcolor{preprocessor}{\#endif                  }\textcolor{comment}{/* USB\_GLOBAL\_INCLUDE\_FILE */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00056}00056 }
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00057}00057 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00058}00058 \textcolor{comment}{ *      usbd\_lookup\_id\_by\_info}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00059}00059 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00060}00060 \textcolor{comment}{ * This functions takes an array of "{}struct usb\_device\_id"{} and tries}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00061}00061 \textcolor{comment}{ * to match the entries with the information in "{}struct usbd\_lookup\_info"{}.}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00062}00062 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00063}00063 \textcolor{comment}{ * NOTE: The "{}sizeof\_id"{} parameter must be a multiple of the}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00064}00064 \textcolor{comment}{ * usb\_device\_id structure size. Else the behaviour of this function}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00065}00065 \textcolor{comment}{ * is undefined.}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00066}00066 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00067}00067 \textcolor{comment}{ * Return values:}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00068}00068 \textcolor{comment}{ * NULL: No match found.}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00069}00069 \textcolor{comment}{ * Else: Pointer to matching entry.}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00070}00070 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00071}00071 \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__id}{usb\_device\_id}} *}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00072}\mbox{\hyperlink{usb__lookup_8c_aec7e4e8a210d83fd2ce8b0f34188f974}{00072}} \mbox{\hyperlink{usb__lookup_8c_aec7e4e8a210d83fd2ce8b0f34188f974}{usbd\_lookup\_id\_by\_info}}(\textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device__id}{usb\_device\_id}} *\textcolor{keywordtype}{id}, \mbox{\hyperlink{usb__freebsd_8h_aef76bd5158b84c44681a07bc5f22aff1}{usb\_size\_t}} sizeof\_id,}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00073}00073     \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structusbd__lookup__info}{usbd\_lookup\_info}} *info)}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00074}00074 \{}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00075}00075         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__id}{usb\_device\_id}} *id\_end;}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00076}00076 }
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00077}00077         \textcolor{keywordflow}{if} (\textcolor{keywordtype}{id} == NULL) \{}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00078}00078                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00079}00079         \}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00080}00080         id\_end = (\textcolor{keyword}{const} \textcolor{keywordtype}{void} *)(((\textcolor{keyword}{const} uint8\_t *)\textcolor{keywordtype}{id}) + sizeof\_id);}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00081}00081 }
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00082}00082         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00083}00083 \textcolor{comment}{         * Keep on matching array entries until we find a match or}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00084}00084 \textcolor{comment}{         * until we reach the end of the matching array:}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00085}00085 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00086}00086         \textcolor{keywordflow}{for} (; \textcolor{keywordtype}{id} != id\_end; \textcolor{keywordtype}{id}++) \{}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00087}00087                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{if__usievar_8h_a1e6927fa1486224044e568f9c370519b}{id}}-\/>match\_flag\_vendor) \&\&}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00088}00088                     (\textcolor{keywordtype}{id}-\/>idVendor != info-\/>\mbox{\hyperlink{structusbd__lookup__info_ae7eb209900d63daa0453bfad02b214d2}{idVendor}})) \{}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00089}00089                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00090}00090                 \}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00091}00091                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{if__usievar_8h_a1e6927fa1486224044e568f9c370519b}{id}}-\/>match\_flag\_product) \&\&}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00092}00092                     (\textcolor{keywordtype}{id}-\/>idProduct != info-\/>\mbox{\hyperlink{structusbd__lookup__info_a4bca08a16ef6b481d70d9eaf6a48f559}{idProduct}})) \{}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00093}00093                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00094}00094                 \}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00095}00095                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{if__usievar_8h_a1e6927fa1486224044e568f9c370519b}{id}}-\/>match\_flag\_dev\_lo) \&\&}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00096}00096                     (\textcolor{keywordtype}{id}-\/>bcdDevice\_lo > info-\/>\mbox{\hyperlink{structusbd__lookup__info_afb2ebde174df050730dc83fcb0927582}{bcdDevice}})) \{}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00097}00097                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00098}00098                 \}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00099}00099                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{if__usievar_8h_a1e6927fa1486224044e568f9c370519b}{id}}-\/>match\_flag\_dev\_hi) \&\&}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00100}00100                     (\textcolor{keywordtype}{id}-\/>bcdDevice\_hi < info-\/>\mbox{\hyperlink{structusbd__lookup__info_afb2ebde174df050730dc83fcb0927582}{bcdDevice}})) \{}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00101}00101                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00102}00102                 \}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00103}00103                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{if__usievar_8h_a1e6927fa1486224044e568f9c370519b}{id}}-\/>match\_flag\_dev\_class) \&\&}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00104}00104                     (\textcolor{keywordtype}{id}-\/>bDeviceClass != info-\/>\mbox{\hyperlink{structusbd__lookup__info_a76f8856fd2dc0b921987c8a9719059a9}{bDeviceClass}})) \{}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00105}00105                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00106}00106                 \}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00107}00107                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{if__usievar_8h_a1e6927fa1486224044e568f9c370519b}{id}}-\/>match\_flag\_dev\_subclass) \&\&}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00108}00108                     (\textcolor{keywordtype}{id}-\/>bDeviceSubClass != info-\/>\mbox{\hyperlink{structusbd__lookup__info_a0dbebc3f825f58a41f412cfd6222f937}{bDeviceSubClass}})) \{}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00109}00109                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00110}00110                 \}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00111}00111                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{if__usievar_8h_a1e6927fa1486224044e568f9c370519b}{id}}-\/>match\_flag\_dev\_protocol) \&\&}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00112}00112                     (\textcolor{keywordtype}{id}-\/>bDeviceProtocol != info-\/>\mbox{\hyperlink{structusbd__lookup__info_a606e5da09fb942be125f50a2c23d2d33}{bDeviceProtocol}})) \{}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00113}00113                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00114}00114                 \}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00115}00115                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{if__usievar_8h_a1e6927fa1486224044e568f9c370519b}{id}}-\/>match\_flag\_int\_class) \&\&}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00116}00116                     (\textcolor{keywordtype}{id}-\/>bInterfaceClass != info-\/>\mbox{\hyperlink{structusbd__lookup__info_ab0d02dc59a6a042d2de8c12708afc8b3}{bInterfaceClass}})) \{}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00117}00117                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00118}00118                 \}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00119}00119                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{if__usievar_8h_a1e6927fa1486224044e568f9c370519b}{id}}-\/>match\_flag\_int\_subclass) \&\&}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00120}00120                     (\textcolor{keywordtype}{id}-\/>bInterfaceSubClass != info-\/>\mbox{\hyperlink{structusbd__lookup__info_aa8ed5421fc671dcbd1fefb09180b604c}{bInterfaceSubClass}})) \{}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00121}00121                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00122}00122                 \}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00123}00123                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{if__usievar_8h_a1e6927fa1486224044e568f9c370519b}{id}}-\/>match\_flag\_int\_protocol) \&\&}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00124}00124                     (\textcolor{keywordtype}{id}-\/>bInterfaceProtocol != info-\/>\mbox{\hyperlink{structusbd__lookup__info_ae7cd4aacf13732f19919bf228d2b2ef4}{bInterfaceProtocol}})) \{}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00125}00125                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00126}00126                 \}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00127}00127                 \textcolor{comment}{/* We found a match! */}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00128}00128                 \textcolor{keywordflow}{return} (\textcolor{keywordtype}{id});}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00129}00129         \}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00130}00130 }
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00131}00131 done:}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00132}00132         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00133}00133 \}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00134}00134 }
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00135}00135 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00136}00136 \textcolor{comment}{ *      usbd\_lookup\_id\_by\_uaa -\/ factored out code}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00137}00137 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00138}00138 \textcolor{comment}{ * Return values:}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00139}00139 \textcolor{comment}{ *    0: Success}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00140}00140 \textcolor{comment}{ * Else: Failure}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00141}00141 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00142}00142 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00143}\mbox{\hyperlink{usb__lookup_8c_aa691ad42d532498716f358cb1c994fb2}{00143}} \mbox{\hyperlink{usb__lookup_8c_aa691ad42d532498716f358cb1c994fb2}{usbd\_lookup\_id\_by\_uaa}}(\textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device__id}{usb\_device\_id}} *\textcolor{keywordtype}{id}, \mbox{\hyperlink{usb__freebsd_8h_aef76bd5158b84c44681a07bc5f22aff1}{usb\_size\_t}} sizeof\_id,}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00144}00144     \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__attach__arg}{usb\_attach\_arg}} *uaa)}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00145}00145 \{}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00146}00146         \textcolor{keywordtype}{id} = \mbox{\hyperlink{usb__lookup_8c_aec7e4e8a210d83fd2ce8b0f34188f974}{usbd\_lookup\_id\_by\_info}}(\textcolor{keywordtype}{id}, sizeof\_id, \&uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a66c2afc71fce73cc432f7d58593e1f26}{info}});}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00147}00147         \textcolor{keywordflow}{if} (\textcolor{keywordtype}{id}) \{}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00148}00148                 \textcolor{comment}{/* copy driver info */}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00149}00149                 uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a4d32c1b722effd2adff410595d390e4b}{driver\_info}} = \textcolor{keywordtype}{id}-\/>driver\_info;}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00150}00150                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00151}00151         \}}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00152}00152         \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{usb__lookup_8c_source_l00153}00153 \}}

\end{DoxyCode}
