\hypertarget{usbdi__util_8h_source}{}\doxysection{usbdi\+\_\+util.\+h}
\label{usbdi__util_8h_source}\index{dev/usb/usbdi\_util.h@{dev/usb/usbdi\_util.h}}
\mbox{\hyperlink{usbdi__util_8h}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2009 Andrew Thompson}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00005}00005 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00006}00006 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00007}00007 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00008}00008 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00009}00009 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00010}00010 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00011}00011 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00012}00012 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00013}00013 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00014}00014 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00015}00015 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00016}00016 \textcolor{comment}{ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00017}00017 \textcolor{comment}{ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00018}00018 \textcolor{comment}{ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00019}00019 \textcolor{comment}{ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00020}00020 \textcolor{comment}{ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00021}00021 \textcolor{comment}{ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00022}00022 \textcolor{comment}{ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00023}00023 \textcolor{comment}{ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00024}00024 \textcolor{comment}{ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00025}00025 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00026}00026 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00027}00027 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00028}00028 \textcolor{preprocessor}{\#ifndef \_USB\_USBDI\_UTIL\_H\_}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00029}00029 \textcolor{preprocessor}{\#define \_USB\_USBDI\_UTIL\_H\_}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00031}00031 \textcolor{keyword}{struct }cv;}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00032}00032 }
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00033}00033 \textcolor{comment}{/* structures */}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00034}00034 }
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00035}\mbox{\hyperlink{structusb__idesc__parse__state}{00035}} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__idesc__parse__state}{usb\_idesc\_parse\_state}} \{}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00036}\mbox{\hyperlink{structusb__idesc__parse__state_a6906388a87609ed6f3a2e5e738f2532f}{00036}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__descriptor}{usb\_descriptor}} *\mbox{\hyperlink{structusb__idesc__parse__state_a6906388a87609ed6f3a2e5e738f2532f}{desc}};}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00037}\mbox{\hyperlink{structusb__idesc__parse__state_a215e06a85790e167c9fad80242c97ef9}{00037}}         uint8\_t \mbox{\hyperlink{structusb__idesc__parse__state_a215e06a85790e167c9fad80242c97ef9}{iface\_index}};         \textcolor{comment}{/* current interface index */}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00038}\mbox{\hyperlink{structusb__idesc__parse__state_a6d185270be1f6295e0ec3df2cd2ce849}{00038}}         uint8\_t \mbox{\hyperlink{structusb__idesc__parse__state_a6d185270be1f6295e0ec3df2cd2ce849}{iface\_no\_last}};}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00039}\mbox{\hyperlink{structusb__idesc__parse__state_aabf582c3cd7078a7d675063945932089}{00039}}         uint8\_t \mbox{\hyperlink{structusb__idesc__parse__state_aabf582c3cd7078a7d675063945932089}{iface\_index\_alt}}; \textcolor{comment}{/* current alternate setting */}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00040}00040 \};}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00041}00041 }
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00042}00042 \textcolor{comment}{/* prototypes */}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00043}00043 }
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00044}00044 \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{usbdi__util_8h_a73f73fb03dfe97412ded971a42984bd8}{usbd\_do\_request\_proc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev, \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__process}{usb\_process}} *pproc,}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00045}00045                     \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device__request}{usb\_device\_request}} *\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}, \textcolor{keywordtype}{void} *data, uint16\_t flags,}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00046}00046                     uint16\_t *actlen, \mbox{\hyperlink{usb__freebsd_8h_ad024d1bfb97f4cb78c73989e05d13176}{usb\_timeout\_t}} timeout);}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00047}00047 }
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00048}00048 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__descriptor}{usb\_descriptor}} *\mbox{\hyperlink{usbdi__util_8h_a24baefbe194d2fedd666ddff033c8d58}{usb\_desc\_foreach}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__config__descriptor}{usb\_config\_descriptor}} *cd,}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00049}00049             \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__descriptor}{usb\_descriptor}} *\mbox{\hyperlink{usb__device_8h_ab3a00cd7fdc532cb4cd4d59733b440bf}{desc}});}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00050}00050 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__interface__descriptor}{usb\_interface\_descriptor}} *\mbox{\hyperlink{usbdi__util_8h_ad7ace023a2e707b760d9d902ff32455f}{usb\_idesc\_foreach}}(}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00051}00051             \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__config__descriptor}{usb\_config\_descriptor}} *cd,}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00052}00052             \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__idesc__parse__state}{usb\_idesc\_parse\_state}} *ps);}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00053}00053 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__endpoint__descriptor}{usb\_endpoint\_descriptor}} *\mbox{\hyperlink{usbdi__util_8h_a5bd3eb5de64976eba68bbfbe668ef6c9}{usb\_edesc\_foreach}}(}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00054}00054             \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__config__descriptor}{usb\_config\_descriptor}} *cd,}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00055}00055             \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__endpoint__descriptor}{usb\_endpoint\_descriptor}} *ped);}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00056}00056 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__endpoint__ss__comp__descriptor}{usb\_endpoint\_ss\_comp\_descriptor}} *\mbox{\hyperlink{usbdi__util_8h_a3fa9b8e9865c72ee4dfbaffd6736382c}{usb\_ed\_comp\_foreach}}(}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00057}00057             \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__config__descriptor}{usb\_config\_descriptor}} *cd,}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00058}00058             \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__endpoint__ss__comp__descriptor}{usb\_endpoint\_ss\_comp\_descriptor}} *ped);}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00059}00059 uint8\_t \mbox{\hyperlink{usbdi__util_8h_a9eda9ac00cb77a482bb8dbbe3a341edd}{usbd\_get\_no\_descriptors}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__config__descriptor}{usb\_config\_descriptor}} *cd,}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00060}00060             uint8\_t type);}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00061}00061 uint8\_t \mbox{\hyperlink{usbdi__util_8h_adc2bb0ce8388580b246c3d82c986cd84}{usbd\_get\_no\_alts}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__config__descriptor}{usb\_config\_descriptor}} *cd,}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00062}00062             \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__interface__descriptor}{usb\_interface\_descriptor}} *\textcolor{keywordtype}{id});}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00063}00063 }
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00064}00064 \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{usbdi__util_8h_ac0b19f45e28e829a7bb513957171bbe7}{usbd\_req\_get\_report}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev, \textcolor{keyword}{struct} mtx *mtx,}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00065}00065                     \textcolor{keywordtype}{void} *data, uint16\_t \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}}, uint8\_t iface\_index, uint8\_t type,}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00066}00066                     uint8\_t \textcolor{keywordtype}{id});}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00067}00067 \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{usbdi__util_8h_a58d170d91203f48ea26476542af74068}{usbd\_req\_get\_report\_descriptor}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev,}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00068}00068                     \textcolor{keyword}{struct} mtx *mtx, \textcolor{keywordtype}{void} *d, uint16\_t \mbox{\hyperlink{if__axge_8c_ae5dc6ffcd9b7605c7787791e40cc6bb0}{size}},}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00069}00069                     uint8\_t iface\_index);}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00070}00070 \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{usbdi__util_8h_a8b4cfbe332afa5e4284428f7819c3e19}{usbd\_req\_get\_string\_any}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev, \textcolor{keyword}{struct} mtx *mtx,}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00071}00071                     \textcolor{keywordtype}{char} *buf, uint16\_t \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}}, uint8\_t string\_index);}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00072}00072 \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{usbdi__util_8h_a6b26fc399b10141dc40b8a9f39f75688}{usbd\_req\_get\_string\_desc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev, \textcolor{keyword}{struct} mtx *mtx,}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00073}00073                     \textcolor{keywordtype}{void} *sdesc, uint16\_t max\_len, uint16\_t lang\_id,}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00074}00074                     uint8\_t string\_index);}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00075}00075 \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{usbdi__util_8h_a41406cc7a17f599c5c3faea9c6b703ff}{usbd\_req\_set\_config}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev, \textcolor{keyword}{struct} mtx *mtx,}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00076}00076                     uint8\_t conf);}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00077}00077 \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{usbdi__util_8h_a563d9bd2a394a163a87ea99239e82dce}{usbd\_req\_set\_alt\_interface\_no}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev,}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00078}00078                     \textcolor{keyword}{struct} mtx *mtx, uint8\_t iface\_index, uint8\_t alt\_no);}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00079}00079 \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{usbdi__util_8h_accd609da95f3845ea881ee7bbc3ef075}{usbd\_req\_set\_idle}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev, \textcolor{keyword}{struct} mtx *mtx,}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00080}00080                     uint8\_t iface\_index, uint8\_t duration, uint8\_t \textcolor{keywordtype}{id});}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00081}00081 \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{usbdi__util_8h_ad7248e7e5a97e3d838f18864bebfdd94}{usbd\_req\_set\_protocol}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev, \textcolor{keyword}{struct} mtx *mtx,}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00082}00082                     uint8\_t iface\_index, uint16\_t report);}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00083}00083 \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{usbdi__util_8h_aa80da0d45171e70f02698c8adaf8e96e}{usbd\_req\_set\_report}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev, \textcolor{keyword}{struct} mtx *mtx,}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00084}00084                     \textcolor{keywordtype}{void} *data, uint16\_t \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}}, uint8\_t iface\_index,}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00085}00085                     uint8\_t type, uint8\_t \textcolor{keywordtype}{id});}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00086}00086 }
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00087}00087 \textcolor{comment}{/* The following functions will not return NULL strings. */}}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00088}00088 }
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00089}00089 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{usbdi__util_8h_a2894988dee4deeb768a3be44ab7a11f4}{usb\_get\_manufacturer}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *);}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00090}00090 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{usbdi__util_8h_aac85b954f6f6ddb8354e0594fce37c46}{usb\_get\_product}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *);}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00091}00091 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{usbdi__util_8h_a095f76323ddc79f1e7a9159185e9360a}{usb\_get\_serial}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *);}
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00092}00092 }
\DoxyCodeLine{\Hypertarget{usbdi__util_8h_source_l00093}00093 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* \_USB\_USBDI\_UTIL\_H\_ */}\textcolor{preprocessor}{}}

\end{DoxyCode}
