\hypertarget{usbhid_8h_source}{}\doxysection{usbhid.\+h}
\label{usbhid_8h_source}\index{dev/usb/usbhid.h@{dev/usb/usbhid.h}}
\mbox{\hyperlink{usbhid_8h}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00001}00001 \textcolor{comment}{/* \$FreeBSD\$ */}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00002}00002 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00003}00003 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/NetBSD}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00004}00004 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00006}00006 \textcolor{comment}{ * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved.}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00007}00007 \textcolor{comment}{ * Copyright (c) 1998 Lennart Augustsson. All rights reserved.}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00008}00008 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00009}00009 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00010}00010 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00011}00011 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00012}00012 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00013}00013 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00014}00014 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00015}00015 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00016}00016 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00017}00017 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00018}00018 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00019}00019 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00020}00020 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00021}00021 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00022}00022 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00023}00023 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00024}00024 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00025}00025 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00026}00026 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00027}00027 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00028}00028 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00029}00029 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00031}00031 \textcolor{preprocessor}{\#ifndef \_USB\_HID\_H\_}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00032}00032 \textcolor{preprocessor}{\#define \_USB\_HID\_H\_}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00033}00033 }
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00034}00034 \textcolor{preprocessor}{\#include <dev/hid/hid.h>}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00035}00035 }
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00036}00036 \textcolor{preprocessor}{\#ifndef USB\_GLOBAL\_INCLUDE\_FILE}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00037}00037 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__endian_8h}{dev/usb/usb\_endian.h}}>}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00038}00038 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00039}00039 }
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00040}\mbox{\hyperlink{usbhid_8h_a5b262b2b12f8e31ca493546a320daa08}{00040}} \textcolor{preprocessor}{\#define UR\_GET\_HID\_DESCRIPTOR   0x06}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00041}\mbox{\hyperlink{usbhid_8h_aa8c85ca020ed93265ee53dd62e7d5895}{00041}} \textcolor{preprocessor}{\#define UDESC\_HID               0x21}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00042}\mbox{\hyperlink{usbhid_8h_af3c65cc2d5c67a6f32cb3c994c44431e}{00042}} \textcolor{preprocessor}{\#define UDESC\_REPORT            0x22}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00043}\mbox{\hyperlink{usbhid_8h_a10ab5c04353fc5900dc99664cb89ad82}{00043}} \textcolor{preprocessor}{\#define UDESC\_PHYSICAL          0x23}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00044}\mbox{\hyperlink{usbhid_8h_aa6da8ad2b79f88be483499a03f7f06cd}{00044}} \textcolor{preprocessor}{\#define UR\_SET\_HID\_DESCRIPTOR   0x07}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00045}\mbox{\hyperlink{usbhid_8h_a83f99fae79e395569281ec5a169b9629}{00045}} \textcolor{preprocessor}{\#define UR\_GET\_REPORT           0x01}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00046}\mbox{\hyperlink{usbhid_8h_a9fc94613b9ef6bb7fcc37deda784c760}{00046}} \textcolor{preprocessor}{\#define UR\_SET\_REPORT           0x09}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00047}\mbox{\hyperlink{usbhid_8h_ae5edb3ed64d0c6389e0d6e1df7c5eb4b}{00047}} \textcolor{preprocessor}{\#define UR\_GET\_IDLE             0x02}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00048}\mbox{\hyperlink{usbhid_8h_adfaea6848ff8bd9a94cc6a059e94b54a}{00048}} \textcolor{preprocessor}{\#define UR\_SET\_IDLE             0x0a}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00049}\mbox{\hyperlink{usbhid_8h_addfb96d0078a00fb1132f42a60cd8961}{00049}} \textcolor{preprocessor}{\#define UR\_GET\_PROTOCOL         0x03}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00050}\mbox{\hyperlink{usbhid_8h_afea159697b5a77d5adf395f95055f6f7}{00050}} \textcolor{preprocessor}{\#define UR\_SET\_PROTOCOL         0x0b}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00051}00051 }
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00052}\mbox{\hyperlink{structusb__hid__descriptor}{00052}} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__hid__descriptor}{usb\_hid\_descriptor}} \{}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00053}\mbox{\hyperlink{structusb__hid__descriptor_a90e0880ed9c2230638939366e1b46314}{00053}}         \mbox{\hyperlink{usb__endian_8h_a4dea376b5cd0c5d694660473f5e7a459}{uByte}}      \mbox{\hyperlink{structusb__hid__descriptor_a90e0880ed9c2230638939366e1b46314}{bLength}};}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00054}\mbox{\hyperlink{structusb__hid__descriptor_ae621f7fbed815c97e1e0c36e1813593e}{00054}}         \mbox{\hyperlink{usb__endian_8h_a4dea376b5cd0c5d694660473f5e7a459}{uByte}}      \mbox{\hyperlink{structusb__hid__descriptor_ae621f7fbed815c97e1e0c36e1813593e}{bDescriptorType}};}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00055}\mbox{\hyperlink{structusb__hid__descriptor_aa11c4f4e7bc54edfdb24780c2baa2d17}{00055}}         \mbox{\hyperlink{usb__endian_8h_ad3086c1130ab6b88c53220166e3b5129}{uWord}}      \mbox{\hyperlink{structusb__hid__descriptor_aa11c4f4e7bc54edfdb24780c2baa2d17}{bcdHID}};}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00056}\mbox{\hyperlink{structusb__hid__descriptor_acdbffb27bded42437a97fbebfa7b3ce1}{00056}}         \mbox{\hyperlink{usb__endian_8h_a4dea376b5cd0c5d694660473f5e7a459}{uByte}}      \mbox{\hyperlink{structusb__hid__descriptor_acdbffb27bded42437a97fbebfa7b3ce1}{bCountryCode}};}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00057}\mbox{\hyperlink{structusb__hid__descriptor_afc2e65edadcf6daed052a44078145851}{00057}}         \mbox{\hyperlink{usb__endian_8h_a4dea376b5cd0c5d694660473f5e7a459}{uByte}}      \mbox{\hyperlink{structusb__hid__descriptor_afc2e65edadcf6daed052a44078145851}{bNumDescriptors}};}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00058}00058         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00059}00059                 \mbox{\hyperlink{usb__endian_8h_a4dea376b5cd0c5d694660473f5e7a459}{uByte}}      \mbox{\hyperlink{structusb__hid__descriptor_ae621f7fbed815c97e1e0c36e1813593e}{bDescriptorType}};}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00060}\mbox{\hyperlink{structusb__hid__descriptor_a73f17cb82c9e27dce67d075f2a40d24a}{00060}}                 \mbox{\hyperlink{usb__endian_8h_ad3086c1130ab6b88c53220166e3b5129}{uWord}}      \mbox{\hyperlink{structusb__hid__descriptor_a73f17cb82c9e27dce67d075f2a40d24a}{wDescriptorLength}};}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00061}\mbox{\hyperlink{structusb__hid__descriptor_af78457da1ac0ea3d421882a0a9b935ac}{00061}}         \}       \mbox{\hyperlink{structusb__hid__descriptor_af78457da1ac0ea3d421882a0a9b935ac}{descrs}}[1];}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00062}\mbox{\hyperlink{usbhid_8h_adedfe11abba0d8b9ed7415df8a72fc7f}{00062}} \} \mbox{\hyperlink{usbhid_8h_adedfe11abba0d8b9ed7415df8a72fc7f}{\_\_packed}};}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00063}00063 }
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00064}\mbox{\hyperlink{usbhid_8h_ae3d23e4a1e4b7a4be2dddc0a8a96a64b}{00064}} \textcolor{preprocessor}{\#define USB\_HID\_DESCRIPTOR\_SIZE(n) (9+((n)*3))}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00065}00065 }
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00066}\mbox{\hyperlink{usbhid_8h_af540f9821ac4f3dad99b6e42024df6c1}{00066}} \textcolor{preprocessor}{\#define UHID\_INPUT\_REPORT       HID\_INPUT\_REPORT}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00067}\mbox{\hyperlink{usbhid_8h_a6c15a5eb7d96339faf19c4ac50a5c79b}{00067}} \textcolor{preprocessor}{\#define UHID\_OUTPUT\_REPORT      HID\_OUTPUT\_REPORT}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00068}\mbox{\hyperlink{usbhid_8h_a2b39f0f97bf832c66dad0c7dc051b314}{00068}} \textcolor{preprocessor}{\#define UHID\_FEATURE\_REPORT     HID\_FEATURE\_REPORT}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00069}00069 }
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00070}00070 \textcolor{preprocessor}{\#if defined(\_KERNEL) || defined(\_STANDALONE)}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00071}00071 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__config__descriptor}{usb\_config\_descriptor}};}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00072}00072 }
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00073}00073 \textcolor{preprocessor}{\#ifdef COMPAT\_USBHID12}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00074}00074 \textcolor{comment}{/* FreeBSD <= 12 compat shims */}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00075}00075 \textcolor{preprocessor}{\#define hid\_report\_size(buf, len, kind, id)     \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00076}00076 \textcolor{preprocessor}{        hid\_report\_size\_max(buf, len, kind, id)}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00077}00077 \textcolor{keyword}{static} \_\_inline uint32\_t}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00078}00078 hid\_get\_data\_unsigned(\textcolor{keyword}{const} uint8\_t *buf, hid\_size\_t \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}},}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00079}00079     \textcolor{keyword}{struct} hid\_location *loc)}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00080}00080 \{}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00081}00081         \textcolor{keywordflow}{return} (hid\_get\_udata(buf, \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}}, loc));}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00082}00082 \}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00083}00083 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00084}00084 hid\_put\_data\_unsigned(uint8\_t *buf, hid\_size\_t \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}}, \textcolor{keyword}{struct} hid\_location *loc,}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00085}00085     \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} value)}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00086}00086 \{}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00087}00087         \textcolor{keywordflow}{return} (hid\_put\_udata(buf, \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}}, loc, value));}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00088}00088 \}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00089}00089 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00090}00090 }
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00091}00091 \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__hid__descriptor}{usb\_hid\_descriptor}} *\mbox{\hyperlink{usbhid_8h_a810b59f743ba0c6f13370406c17f9aaa}{hid\_get\_descriptor\_from\_usb}}(}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00092}00092             \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__config__descriptor}{usb\_config\_descriptor}} *cd,}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00093}00093             \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__interface__descriptor}{usb\_interface\_descriptor}} *\textcolor{keywordtype}{id});}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00094}00094 \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{usbhid_8h_a606298298fcaeada223dd72693f380c7}{usbd\_req\_get\_hid\_desc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__device}{usb\_device}} *udev, \textcolor{keyword}{struct} mtx *mtx,}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00095}00095             \textcolor{keywordtype}{void} **descp, uint16\_t *sizep, \textcolor{keyword}{struct} malloc\_type *mem,}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00096}00096             uint8\_t iface\_index);}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00097}00097 \textcolor{preprocessor}{\#endif  }\textcolor{comment}{/* \_KERNEL || \_STANDALONE */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{usbhid_8h_source_l00098}00098 \textcolor{preprocessor}{\#endif  }\textcolor{comment}{/* \_USB\_HID\_H\_ */}\textcolor{preprocessor}{}}

\end{DoxyCode}
