\hypertarget{uhid__snes_8c_source}{}\doxysection{uhid\+\_\+snes.\+c}
\label{uhid__snes_8c_source}\index{dev/usb/input/uhid\_snes.c@{dev/usb/input/uhid\_snes.c}}
\mbox{\hyperlink{uhid__snes_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00004}00004 \textcolor{comment}{ * Copyright 2013, Michael Terrell <vashisnotatree@gmail.com>}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00005}00005 \textcolor{comment}{ * Copyright 2018, Johannes Lundberg <johalun0@gmail.com>}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00006}00006 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00007}00007 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00008}00008 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00009}00009 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00010}00010 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00011}00011 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00012}00012 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00013}00013 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00014}00014 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00015}00015 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00016}00016 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00017}00017 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00018}00018 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00019}00019 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00020}00020 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00021}00021 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00022}00022 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00023}00023 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00024}00024 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00025}00025 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00026}00026 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00027}00027 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00028}00028 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00029}00029 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00030}00030 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00031}00031 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00036}00036 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/conf.h>}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/syslog.h>}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <sys/fcntl.h>}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00043}00043 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb_8h}{dev/usb/usb.h}}>}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usbdi_8h}{dev/usb/usbdi.h}}>}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usbdi__util_8h}{dev/usb/usbdi\_util.h}}>}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00047}00047 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usbhid_8h}{dev/usb/usbhid.h}}>}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__ioctl_8h}{dev/usb/usb\_ioctl.h}}>}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00050}00050 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00051}00051 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{usb__rdesc_8h}{usb\_rdesc.h}}"{}}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00052}00052 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00053}\mbox{\hyperlink{uhid__snes_8c_ad14216bcc8924974535ca9c0a904b297}{00053}} \textcolor{preprocessor}{\#define UHID\_SNES\_IFQ\_MAX\_LEN 8}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00054}00054 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00055}\mbox{\hyperlink{uhid__snes_8c_aa319f866a1bd353a045b9ac4fe64c1c2}{00055}} \textcolor{preprocessor}{\#define UREQ\_GET\_PORT\_STATUS 0x01}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00056}\mbox{\hyperlink{uhid__snes_8c_a754dcfd3280d5f8710292d6f84f6a331}{00056}} \textcolor{preprocessor}{\#define UREQ\_SOFT\_RESET      0x02}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00057}00057 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00058}\mbox{\hyperlink{uhid__snes_8c_a1965eaca47dbf3f87acdafc2208f04eb}{00058}} \textcolor{preprocessor}{\#define UP      0x7f00}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00059}\mbox{\hyperlink{uhid__snes_8c_a4193cd1c8c2e6ebd0e056fa2364a663f}{00059}} \textcolor{preprocessor}{\#define DOWN    0x7fff}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00060}\mbox{\hyperlink{uhid__snes_8c_a437ef08681e7210d6678427030446a54}{00060}} \textcolor{preprocessor}{\#define LEFT    0x00ff}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00061}\mbox{\hyperlink{uhid__snes_8c_a80fb826a684cf3f0d306b22aa100ddac}{00061}} \textcolor{preprocessor}{\#define RIGHT   0xff7f}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00062}\mbox{\hyperlink{uhid__snes_8c_a207fd5507206d307cd63f95374fcd00d}{00062}} \textcolor{preprocessor}{\#define X       0x1f}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00063}\mbox{\hyperlink{uhid__snes_8c_a798e4073d613ca5ba9618e1b3253df14}{00063}} \textcolor{preprocessor}{\#define Y       0x8f}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00064}\mbox{\hyperlink{uhid__snes_8c_a955f504eccf76b4eb2489c0adab03121}{00064}} \textcolor{preprocessor}{\#define A       0x2f}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00065}\mbox{\hyperlink{uhid__snes_8c_a111da81ae5883147168bbb8366377b10}{00065}} \textcolor{preprocessor}{\#define B       0x4f}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00066}\mbox{\hyperlink{uhid__snes_8c_a53dc4af00adc7b3b4d12eafb71596dfc}{00066}} \textcolor{preprocessor}{\#define SELECT  0x10}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00067}\mbox{\hyperlink{uhid__snes_8c_a3018c7600b7bb9866400596a56a57af7}{00067}} \textcolor{preprocessor}{\#define START   0x20}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00068}\mbox{\hyperlink{uhid__snes_8c_a92ff133ff34ec693bb1f95c570006d4d}{00068}} \textcolor{preprocessor}{\#define LEFT\_T  0x01}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00069}\mbox{\hyperlink{uhid__snes_8c_a64bb95bb4559bc325bf32e4d076aff5c}{00069}} \textcolor{preprocessor}{\#define RIGHT\_T 0x02}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00070}00070 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00071}\mbox{\hyperlink{uhid__snes_8c_adbdca8f59336a9b5c77557041707e687}{00071}} \textcolor{keyword}{static} \textcolor{keyword}{const} uint8\_t \mbox{\hyperlink{uhid__snes_8c_adbdca8f59336a9b5c77557041707e687}{uhid\_snes\_report\_descr}}[] = \{ \mbox{\hyperlink{usb__rdesc_8h_a0a62ac06d82aed7fc23302c4a02d605f}{UHID\_SNES\_REPORT\_DESCR}}() \};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00072}\mbox{\hyperlink{uhid__snes_8c_aaaa2dbd7c55c8c5c62a360a0b46c1588}{00072}} \textcolor{preprocessor}{\#define SNES\_DEV(v,p,i) \{ USB\_VPI(v,p,i) \}}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00073}00073 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00074}\mbox{\hyperlink{uhid__snes_8c_af4f2ec6b5e4d36cf82b79e2be0d19a27}{00074}} \textcolor{keyword}{static} \textcolor{keyword}{const} \mbox{\hyperlink{usbdi_8h_acf836fd8d6349b66a31f45420728da8d}{STRUCT\_USB\_HOST\_ID}} \mbox{\hyperlink{uhid__snes_8c_af4f2ec6b5e4d36cf82b79e2be0d19a27}{snes\_devs}}[] = \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00075}00075         \mbox{\hyperlink{uhid__snes_8c_aaaa2dbd7c55c8c5c62a360a0b46c1588}{SNES\_DEV}}(0x0810, 0xe501, 0), \textcolor{comment}{/* GeeekPi K-\/0161 */}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00076}00076         \mbox{\hyperlink{uhid__snes_8c_aaaa2dbd7c55c8c5c62a360a0b46c1588}{SNES\_DEV}}(0x0079, 0x0011, 0)  \textcolor{comment}{/* Dragonrise */}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00077}00077 \};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00078}00078 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00079}00079 \textcolor{keyword}{enum} \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00080}\mbox{\hyperlink{uhid__snes_8c_a385c44f6fb256e5716a2302a5b940388a7eae6b6a584ad81be77c22c3ef6b6fe6}{00080}}         \mbox{\hyperlink{uhid__snes_8c_a385c44f6fb256e5716a2302a5b940388a7eae6b6a584ad81be77c22c3ef6b6fe6}{UHID\_SNES\_INTR\_DT\_RD}},}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00081}\mbox{\hyperlink{uhid__snes_8c_a385c44f6fb256e5716a2302a5b940388a85fd1b0c7df61ac10774470c1406bf3c}{00081}}         \mbox{\hyperlink{uhid__snes_8c_a385c44f6fb256e5716a2302a5b940388a85fd1b0c7df61ac10774470c1406bf3c}{UHID\_SNES\_STATUS\_DT\_RD}},}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00082}00082         \mbox{\hyperlink{uhid__snes_8c_a385c44f6fb256e5716a2302a5b940388a7e69955448044c8a03733776b1438915}{UHID\_SNES\_N\_TRANSFER}}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00083}\mbox{\hyperlink{uhid__snes_8c_a385c44f6fb256e5716a2302a5b940388a7e69955448044c8a03733776b1438915}{00083}} \};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00084}00084 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00085}\mbox{\hyperlink{structuhid__snes__softc}{00085}} \textcolor{keyword}{struct }\mbox{\hyperlink{structuhid__snes__softc}{uhid\_snes\_softc}} \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00086}\mbox{\hyperlink{structuhid__snes__softc_a6f99724880058599565c69a28a3f1222}{00086}}         device\_t \mbox{\hyperlink{structuhid__snes__softc_a6f99724880058599565c69a28a3f1222}{sc\_dev}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00087}\mbox{\hyperlink{structuhid__snes__softc_ab5cecc74b89f2605219d48a7d35c5d44}{00087}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device}{usb\_device}} *\mbox{\hyperlink{structuhid__snes__softc_ab5cecc74b89f2605219d48a7d35c5d44}{sc\_usb\_device}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00088}\mbox{\hyperlink{structuhid__snes__softc_ad7384916ca37d13b1bb5e3fea14e5c2e}{00088}}         \textcolor{keyword}{struct }mtx \mbox{\hyperlink{structuhid__snes__softc_ad7384916ca37d13b1bb5e3fea14e5c2e}{sc\_mutex}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00089}\mbox{\hyperlink{structuhid__snes__softc_a88f2ec13d3cf817ef859e8ca044c4b64}{00089}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__callout}{usb\_callout}} \mbox{\hyperlink{structuhid__snes__softc_a88f2ec13d3cf817ef859e8ca044c4b64}{sc\_watchdog}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00090}\mbox{\hyperlink{structuhid__snes__softc_ac1bb53aeaacc0fce1cd60fcfe3e59f17}{00090}}         uint8\_t \mbox{\hyperlink{structuhid__snes__softc_ac1bb53aeaacc0fce1cd60fcfe3e59f17}{sc\_iface\_num}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00091}\mbox{\hyperlink{structuhid__snes__softc_ad02fa10cdf5b99dc41910ee5de80c302}{00091}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *\mbox{\hyperlink{structuhid__snes__softc_ad02fa10cdf5b99dc41910ee5de80c302}{sc\_transfer}}[\mbox{\hyperlink{uhid__snes_8c_a385c44f6fb256e5716a2302a5b940388a7e69955448044c8a03733776b1438915}{UHID\_SNES\_N\_TRANSFER}}];}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00092}\mbox{\hyperlink{structuhid__snes__softc_a9615a48723581cd529dd9dd141c87354}{00092}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fifo__sc}{usb\_fifo\_sc}} \mbox{\hyperlink{structuhid__snes__softc_a9615a48723581cd529dd9dd141c87354}{sc\_fifo}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00093}\mbox{\hyperlink{structuhid__snes__softc_a1fe274652ad23ec6208913fe5097d2af}{00093}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fifo__sc}{usb\_fifo\_sc}} \mbox{\hyperlink{structuhid__snes__softc_a1fe274652ad23ec6208913fe5097d2af}{sc\_fifo\_no\_reset}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00094}\mbox{\hyperlink{structuhid__snes__softc_a286ceb2e2be600bcc1c147328c554cf5}{00094}}         \textcolor{keywordtype}{int} \mbox{\hyperlink{structuhid__snes__softc_a286ceb2e2be600bcc1c147328c554cf5}{sc\_fflags}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00095}\mbox{\hyperlink{structuhid__snes__softc_a5981a0fbb3753a355d7c374f04a50960}{00095}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *\mbox{\hyperlink{structuhid__snes__softc_a5981a0fbb3753a355d7c374f04a50960}{sc\_fifo\_open}}[2];}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00096}\mbox{\hyperlink{structuhid__snes__softc_a09ee35ccf62aeee74039dd9a9fb589b0}{00096}}         uint8\_t \mbox{\hyperlink{structuhid__snes__softc_a09ee35ccf62aeee74039dd9a9fb589b0}{sc\_zero\_length\_packets}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00097}\mbox{\hyperlink{structuhid__snes__softc_af8bd6e37dd6e8e81bf1aee8569bccdec}{00097}}         uint8\_t \mbox{\hyperlink{structuhid__snes__softc_af8bd6e37dd6e8e81bf1aee8569bccdec}{sc\_previous\_status}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00098}\mbox{\hyperlink{structuhid__snes__softc_af05cbdbb9467e92cf2b32be0e49be32e}{00098}}         uint8\_t \mbox{\hyperlink{structuhid__snes__softc_af05cbdbb9467e92cf2b32be0e49be32e}{sc\_iid}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00099}\mbox{\hyperlink{structuhid__snes__softc_a7b7a26e65fb04ca4ddaa8dd580b12c7f}{00099}}         uint8\_t \mbox{\hyperlink{structuhid__snes__softc_a7b7a26e65fb04ca4ddaa8dd580b12c7f}{sc\_oid}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00100}\mbox{\hyperlink{structuhid__snes__softc_aaa1789fe6d26960a031ca1e9ac10e36f}{00100}}         uint8\_t \mbox{\hyperlink{structuhid__snes__softc_aaa1789fe6d26960a031ca1e9ac10e36f}{sc\_fid}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00101}\mbox{\hyperlink{structuhid__snes__softc_ac22686a7c6b64c349d4c75e69b979585}{00101}}         uint8\_t \mbox{\hyperlink{structuhid__snes__softc_ac22686a7c6b64c349d4c75e69b979585}{sc\_iface\_index}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00102}00102 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00103}\mbox{\hyperlink{structuhid__snes__softc_a86832da2c069da36426ceee3fabb8603}{00103}}         uint32\_t \mbox{\hyperlink{structuhid__snes__softc_a86832da2c069da36426ceee3fabb8603}{sc\_isize}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00104}\mbox{\hyperlink{structuhid__snes__softc_a7b8bb7fa8ae78f49704be84c90dba7a8}{00104}}         uint32\_t \mbox{\hyperlink{structuhid__snes__softc_a7b8bb7fa8ae78f49704be84c90dba7a8}{sc\_osize}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00105}\mbox{\hyperlink{structuhid__snes__softc_a1081b3653c931dcc015a531dc28e5f2b}{00105}}         uint32\_t \mbox{\hyperlink{structuhid__snes__softc_a1081b3653c931dcc015a531dc28e5f2b}{sc\_fsize}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00106}00106 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00107}\mbox{\hyperlink{structuhid__snes__softc_afebf383fd23becb0da0422f8a7d738ce}{00107}}         \textcolor{keywordtype}{void} *\mbox{\hyperlink{structuhid__snes__softc_afebf383fd23becb0da0422f8a7d738ce}{sc\_repdesc\_ptr}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00108}00108 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00109}\mbox{\hyperlink{structuhid__snes__softc_a6719441e955014a290dcc01fd410d897}{00109}}         uint16\_t \mbox{\hyperlink{structuhid__snes__softc_a6719441e955014a290dcc01fd410d897}{sc\_repdesc\_size}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00110}00110 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00111}\mbox{\hyperlink{structuhid__snes__softc_aec25ae36ca5754c4e1887b85f563f08d}{00111}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device}{usb\_device}} *\mbox{\hyperlink{structuhid__snes__softc_aec25ae36ca5754c4e1887b85f563f08d}{sc\_udev}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00112}\mbox{\hyperlink{uhid__snes_8c_a1e6186d15148511ed79729a8e68bb324}{00112}} \textcolor{preprocessor}{\#define UHID\_FLAG\_IMMED        0x01     }\textcolor{comment}{/* set if read should be immediate */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00113}00113 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00114}00114 \};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00115}00115 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00116}\mbox{\hyperlink{uhid__snes_8c_a3a57892c0f2e3aabe9c98e1eb1719674}{00116}} \textcolor{keyword}{static} device\_probe\_t \mbox{\hyperlink{uhid__snes_8c_a3a57892c0f2e3aabe9c98e1eb1719674}{uhid\_snes\_probe}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00117}\mbox{\hyperlink{uhid__snes_8c_a47d5c764aee8480c3d6bc711440ad3db}{00117}} \textcolor{keyword}{static} device\_attach\_t \mbox{\hyperlink{uhid__snes_8c_a47d5c764aee8480c3d6bc711440ad3db}{uhid\_snes\_attach}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00118}\mbox{\hyperlink{uhid__snes_8c_a7571c539573c897ce5d7c18031c2f2b3}{00118}} \textcolor{keyword}{static} device\_detach\_t \mbox{\hyperlink{uhid__snes_8c_a7571c539573c897ce5d7c18031c2f2b3}{uhid\_snes\_detach}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00119}00119 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00120}\mbox{\hyperlink{uhid__snes_8c_ae72b24c987b7acfc379f4ac746ac52b6}{00120}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_abf627b9df5961890963bce30a2cf9e1d}{usb\_fifo\_open\_t}} \mbox{\hyperlink{uhid__snes_8c_ae72b24c987b7acfc379f4ac746ac52b6}{uhid\_snes\_open}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00121}\mbox{\hyperlink{uhid__snes_8c_a2c1cd5036db52f4b145863c77eb9961f}{00121}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a1f11bee0038616aab627d2eb67a544b5}{usb\_fifo\_close\_t}} \mbox{\hyperlink{uhid__snes_8c_a2c1cd5036db52f4b145863c77eb9961f}{uhid\_snes\_close}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00122}\mbox{\hyperlink{uhid__snes_8c_afa85e66703fe9ad3b173fa76d452f741}{00122}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a1216ed6c6a9a63cba57811e6fe1f7fea}{usb\_fifo\_ioctl\_t}} \mbox{\hyperlink{uhid__snes_8c_afa85e66703fe9ad3b173fa76d452f741}{uhid\_snes\_ioctl}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00123}\mbox{\hyperlink{uhid__snes_8c_afa160861f16bf600887172ea04c2d2a5}{00123}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a615dd3e847b9bb98800455c172df26a7}{usb\_fifo\_cmd\_t}} \mbox{\hyperlink{uhid__snes_8c_afa160861f16bf600887172ea04c2d2a5}{uhid\_snes\_start\_read}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00124}\mbox{\hyperlink{uhid__snes_8c_ae04367f2c51787451ca6e789958482bb}{00124}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a615dd3e847b9bb98800455c172df26a7}{usb\_fifo\_cmd\_t}} \mbox{\hyperlink{uhid__snes_8c_ae04367f2c51787451ca6e789958482bb}{uhid\_snes\_stop\_read}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00125}00125 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00126}00126 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{uhid__snes_8c_a94fd0c51404f665e0b916efa8a37ef47}{uhid\_snes\_reset}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structuhid__snes__softc}{uhid\_snes\_softc}} *);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00127}00127 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{uhid__snes_8c_a672e20e49642cd382258896a3b988486}{uhid\_snes\_watchdog}}(\textcolor{keywordtype}{void} *);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00128}00128 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00129}\mbox{\hyperlink{uhid__snes_8c_a5afe580c77761ebfcf87e897fa315ce6}{00129}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{uhid__snes_8c_a5afe580c77761ebfcf87e897fa315ce6}{uhid\_snes\_read\_callback}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00130}\mbox{\hyperlink{uhid__snes_8c_abf8c1947a26ab96f0c2499178820f0ee}{00130}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{uhid__snes_8c_abf8c1947a26ab96f0c2499178820f0ee}{uhid\_snes\_status\_callback}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00131}00131 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00132}\mbox{\hyperlink{uhid__snes_8c_a93443e095e01e2cfb8642fda23c402d3}{00132}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fifo__methods}{usb\_fifo\_methods}} \mbox{\hyperlink{uhid__snes_8c_a93443e095e01e2cfb8642fda23c402d3}{uhid\_snes\_fifo\_methods}} = \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00133}00133         .\mbox{\hyperlink{structusb__fifo__methods_ab412e16bde144a591c8ca291876506a2}{f\_open}} = \&\mbox{\hyperlink{uhid__snes_8c_ae72b24c987b7acfc379f4ac746ac52b6}{uhid\_snes\_open}},}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00134}00134         .f\_close = \&\mbox{\hyperlink{uhid__snes_8c_a2c1cd5036db52f4b145863c77eb9961f}{uhid\_snes\_close}},}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00135}00135         .f\_ioctl = \&\mbox{\hyperlink{uhid__snes_8c_afa85e66703fe9ad3b173fa76d452f741}{uhid\_snes\_ioctl}},}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00136}00136         .f\_start\_read = \&\mbox{\hyperlink{uhid__snes_8c_afa160861f16bf600887172ea04c2d2a5}{uhid\_snes\_start\_read}},}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00137}00137         .f\_stop\_read = \&\mbox{\hyperlink{uhid__snes_8c_ae04367f2c51787451ca6e789958482bb}{uhid\_snes\_stop\_read}},}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00138}00138         .basename[0] = \textcolor{stringliteral}{"{}uhid\_snes"{}}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00139}00139 \};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00140}00140 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00141}\mbox{\hyperlink{uhid__snes_8c_a3ddee7f97f73ade7c9044eb847aa3e40}{00141}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__config}{usb\_config}} \mbox{\hyperlink{uhid__snes_8c_a3ddee7f97f73ade7c9044eb847aa3e40}{uhid\_snes\_config}}[\mbox{\hyperlink{uhid__snes_8c_a385c44f6fb256e5716a2302a5b940388a7e69955448044c8a03733776b1438915}{UHID\_SNES\_N\_TRANSFER}}] = \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00142}00142         [\mbox{\hyperlink{uhid__snes_8c_a385c44f6fb256e5716a2302a5b940388a7eae6b6a584ad81be77c22c3ef6b6fe6}{UHID\_SNES\_INTR\_DT\_RD}}] = \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00143}00143                 .\mbox{\hyperlink{structusb__config_ad6cf53d455b808964f881c91074d2696}{callback}} = \&\mbox{\hyperlink{uhid__snes_8c_a5afe580c77761ebfcf87e897fa315ce6}{uhid\_snes\_read\_callback}},}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00144}00144                 .bufsize = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}}) +1,}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00145}00145                 .flags = \{.short\_xfer\_ok = 1, .short\_frames\_ok = 1,}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00146}00146                           .pipe\_bof =1, .proxy\_buffer =1\},}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00147}00147                 .type = \mbox{\hyperlink{usb_8h_a01e28e87ad16f6dfffefc6ccab08baed}{UE\_INTERRUPT}},}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00148}00148                 .endpoint = 0x81,}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00149}00149                 .direction = \mbox{\hyperlink{usb_8h_a72bb077a860132c175c166f344c75893}{UE\_DIR\_IN}}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00150}00150         \},}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00151}00151         [\mbox{\hyperlink{uhid__snes_8c_a385c44f6fb256e5716a2302a5b940388a85fd1b0c7df61ac10774470c1406bf3c}{UHID\_SNES\_STATUS\_DT\_RD}}] = \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00152}00152                 .callback = \&\mbox{\hyperlink{uhid__snes_8c_abf8c1947a26ab96f0c2499178820f0ee}{uhid\_snes\_status\_callback}},}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00153}00153                 .bufsize = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}}) + 1,}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00154}00154                 .timeout = 1000,}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00155}00155                 .type = \mbox{\hyperlink{usb_8h_ace49b7adb24ebcb0a0b17110c26aa63a}{UE\_CONTROL}},}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00156}00156                 .endpoint = 0x00,}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00157}00157                 .direction = \mbox{\hyperlink{usb_8h_a0b305068483ac39f5d34f848bcb95c11}{UE\_DIR\_ANY}}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00158}00158         \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00159}00159 \};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00160}00160 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00161}00161 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00162}\mbox{\hyperlink{uhid__snes_8c_a3a1de98f8993f46574b6d6863e747f66}{00162}} \mbox{\hyperlink{uhid__snes_8c_a3a1de98f8993f46574b6d6863e747f66}{uhid\_get\_report}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structuhid__snes__softc}{uhid\_snes\_softc}} *sc, uint8\_t type,}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00163}00163     uint8\_t \textcolor{keywordtype}{id}, \textcolor{keywordtype}{void} *kern\_data, \textcolor{keywordtype}{void} *user\_data, uint16\_t \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}})}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00164}00164 \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00165}00165         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00166}00166         uint8\_t free\_data = 0;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00167}00167 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00168}00168         \textcolor{keywordflow}{if} (kern\_data == NULL) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00169}00169                 kern\_data = malloc(\mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}}, M\_USBDEV, M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00170}00170                 free\_data = 1;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00171}00171         \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00172}00172         err = \mbox{\hyperlink{usb__request_8c_ac0b19f45e28e829a7bb513957171bbe7}{usbd\_req\_get\_report}}(sc-\/>\mbox{\hyperlink{structuhid__snes__softc_aec25ae36ca5754c4e1887b85f563f08d}{sc\_udev}}, NULL, kern\_data,}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00173}00173             \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}}, sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ac22686a7c6b64c349d4c75e69b979585}{sc\_iface\_index}}, type, \textcolor{keywordtype}{id});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00174}00174         \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00175}00175                 err = ENXIO;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00176}00176                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00177}00177         \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00178}00178         \textcolor{keywordflow}{if} (user\_data) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00179}00179                 \textcolor{comment}{/* dummy buffer */}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00180}00180                 err = copyout(kern\_data, user\_data, \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00181}00181                 \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00182}00182                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00183}00183                 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00184}00184         \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00185}00185 done:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00186}00186         \textcolor{keywordflow}{if} (free\_data) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00187}00187                 free(kern\_data, M\_USBDEV);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00188}00188         \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00189}00189         \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00190}00190 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00191}00191 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00192}00192 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00193}\mbox{\hyperlink{uhid__snes_8c_abac00ce667cb7096c4fa315160b62d7c}{00193}} \mbox{\hyperlink{uhid__snes_8c_abac00ce667cb7096c4fa315160b62d7c}{uhid\_set\_report}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structuhid__snes__softc}{uhid\_snes\_softc}} *sc, uint8\_t type,}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00194}00194     uint8\_t \textcolor{keywordtype}{id}, \textcolor{keywordtype}{void} *kern\_data, \textcolor{keywordtype}{void} *user\_data, uint16\_t \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}})}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00195}00195 \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00196}00196         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00197}00197         uint8\_t free\_data = 0;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00198}00198 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00199}00199         \textcolor{keywordflow}{if} (kern\_data == NULL) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00200}00200                 kern\_data = malloc(\mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}}, M\_USBDEV, M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00201}00201                 free\_data = 1;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00202}00202                 err = copyin(user\_data, kern\_data, \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00203}00203                 \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00204}00204                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00205}00205                 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00206}00206         \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00207}00207         err = \mbox{\hyperlink{usb__request_8c_aa80da0d45171e70f02698c8adaf8e96e}{usbd\_req\_set\_report}}(sc-\/>\mbox{\hyperlink{structuhid__snes__softc_aec25ae36ca5754c4e1887b85f563f08d}{sc\_udev}}, NULL, kern\_data,}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00208}00208             \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}}, sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ac22686a7c6b64c349d4c75e69b979585}{sc\_iface\_index}}, type, \textcolor{keywordtype}{id});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00209}00209         \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00210}00210                 err = ENXIO;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00211}00211                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00212}00212         \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00213}00213 done:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00214}00214         \textcolor{keywordflow}{if} (free\_data) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00215}00215                 free(kern\_data, M\_USBDEV);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00216}00216         \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00217}00217         \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00218}00218 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00219}00219 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00220}00220 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00221}\mbox{\hyperlink{uhid__snes_8c_a9223c84c661906a1177fc382caa83023}{00221}} \mbox{\hyperlink{uhid__snes_8c_ae72b24c987b7acfc379f4ac746ac52b6}{uhid\_snes\_open}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *fifo, \textcolor{keywordtype}{int} fflags)}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00222}00222 \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00223}00223         \textcolor{keyword}{struct }\mbox{\hyperlink{structuhid__snes__softc}{uhid\_snes\_softc}} *sc = \mbox{\hyperlink{usbdi_8h_a1686d97012d48512200abd8ad0d86d1e}{usb\_fifo\_softc}}(fifo);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00224}00224         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00225}00225 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00226}00226         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a286ceb2e2be600bcc1c147328c554cf5}{sc\_fflags}} \& fflags) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00227}00227                 \mbox{\hyperlink{uhid__snes_8c_a94fd0c51404f665e0b916efa8a37ef47}{uhid\_snes\_reset}}(sc);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00228}00228                 \textcolor{keywordflow}{return} (EBUSY);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00229}00229         \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00230}00230 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00231}00231         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad7384916ca37d13b1bb5e3fea14e5c2e}{sc\_mutex}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00232}00232         \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad02fa10cdf5b99dc41910ee5de80c302}{sc\_transfer}}[\mbox{\hyperlink{uhid__snes_8c_a385c44f6fb256e5716a2302a5b940388a7eae6b6a584ad81be77c22c3ef6b6fe6}{UHID\_SNES\_INTR\_DT\_RD}}]);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00233}00233         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad7384916ca37d13b1bb5e3fea14e5c2e}{sc\_mutex}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00234}00234 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00235}00235         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usbdi_8h_a05da54c8f6953ece429c6bb534ef9677}{usb\_fifo\_alloc\_buffer}}(fifo,}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00236}00236             \mbox{\hyperlink{usb__transfer_8c_ae34a7cc2f01c6dfb68bca6fd0b72647e}{usbd\_xfer\_max\_len}}(sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad02fa10cdf5b99dc41910ee5de80c302}{sc\_transfer}}[\mbox{\hyperlink{uhid__snes_8c_a385c44f6fb256e5716a2302a5b940388a7eae6b6a584ad81be77c22c3ef6b6fe6}{UHID\_SNES\_INTR\_DT\_RD}}]),}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00237}00237             \mbox{\hyperlink{uhid__snes_8c_ad14216bcc8924974535ca9c0a904b297}{UHID\_SNES\_IFQ\_MAX\_LEN}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00238}00238         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00239}00239                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00240}00240 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00241}00241         sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a5981a0fbb3753a355d7c374f04a50960}{sc\_fifo\_open}}[\mbox{\hyperlink{usbdi_8h_aa4759b44daa392a7b438d6fba784f30a}{USB\_FIFO\_RX}}] = fifo;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00242}00242 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00243}00243         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00244}00244 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00245}00245 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00246}00246 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00247}\mbox{\hyperlink{uhid__snes_8c_a94fd0c51404f665e0b916efa8a37ef47}{00247}} \mbox{\hyperlink{uhid__snes_8c_a94fd0c51404f665e0b916efa8a37ef47}{uhid\_snes\_reset}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structuhid__snes__softc}{uhid\_snes\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00248}00248 \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00249}00249         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}} \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00250}00250         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00251}00251 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00252}00252         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bRequest = \mbox{\hyperlink{uhid__snes_8c_a754dcfd3280d5f8710292d6f84f6a331}{UREQ\_SOFT\_RESET}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00253}00253         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wValue, 0);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00254}00254         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wIndex, sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ac1bb53aeaacc0fce1cd60fcfe3e59f17}{sc\_iface\_num}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00255}00255         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wLength, 0);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00256}00256 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00257}00257         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad7384916ca37d13b1bb5e3fea14e5c2e}{sc\_mutex}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00258}00258 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00259}00259         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usb__request_8c_ae914a46bd63666caf7f4d8c182fa5e71}{usbd\_do\_request\_flags}}(sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ab5cecc74b89f2605219d48a7d35c5d44}{sc\_usb\_device}}, \&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad7384916ca37d13b1bb5e3fea14e5c2e}{sc\_mutex}},}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00260}00260             \&\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}, NULL, 0, NULL, 2 * \mbox{\hyperlink{usbdi_8h_a0fc95562f7d27b59ac234342414e3a81}{USB\_MS\_HZ}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00261}00261 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00262}00262         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00263}00263                 \mbox{\hyperlink{usb__request_8c_ae914a46bd63666caf7f4d8c182fa5e71}{usbd\_do\_request\_flags}}(sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ab5cecc74b89f2605219d48a7d35c5d44}{sc\_usb\_device}}, \&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad7384916ca37d13b1bb5e3fea14e5c2e}{sc\_mutex}},}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00264}00264                     \&\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}, NULL, 0, NULL, 2 * \mbox{\hyperlink{usbdi_8h_a0fc95562f7d27b59ac234342414e3a81}{USB\_MS\_HZ}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00265}00265         \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00266}00266 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00267}00267         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad7384916ca37d13b1bb5e3fea14e5c2e}{sc\_mutex}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00268}00268 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00269}00269 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00270}00270 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00271}\mbox{\hyperlink{uhid__snes_8c_aa067d0834c3c7a90b952dbef6891cc89}{00271}} \mbox{\hyperlink{uhid__snes_8c_a2c1cd5036db52f4b145863c77eb9961f}{uhid\_snes\_close}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *fifo, \textcolor{keywordtype}{int} fflags)}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00272}00272 \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00273}00273         \textcolor{keyword}{struct }\mbox{\hyperlink{structuhid__snes__softc}{uhid\_snes\_softc}} *sc = \mbox{\hyperlink{usbdi_8h_a1686d97012d48512200abd8ad0d86d1e}{usb\_fifo\_softc}}(fifo);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00274}00274 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00275}00275         sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a286ceb2e2be600bcc1c147328c554cf5}{sc\_fflags}} \&= \string~(fflags \& FREAD);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00276}00276         \mbox{\hyperlink{usbdi_8h_a6434b2c65d370a12bdd87cec8863f1ff}{usb\_fifo\_free\_buffer}}(fifo);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00277}00277 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00278}00278 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00279}00279 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00280}\mbox{\hyperlink{uhid__snes_8c_a029a10be6eace81bf3dc6138d0a116cb}{00280}} \mbox{\hyperlink{uhid__snes_8c_afa85e66703fe9ad3b173fa76d452f741}{uhid\_snes\_ioctl}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *fifo, u\_long cmd, \textcolor{keywordtype}{void} *data, \textcolor{keywordtype}{int} fflags)}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00281}00281 \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00282}00282         \textcolor{keyword}{struct }\mbox{\hyperlink{structuhid__snes__softc}{uhid\_snes\_softc}} *sc = \mbox{\hyperlink{usbdi_8h_a1686d97012d48512200abd8ad0d86d1e}{usb\_fifo\_softc}}(fifo);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00283}00283         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__gen__descriptor}{usb\_gen\_descriptor}} *ugd;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00284}00284 \textcolor{preprocessor}{\#ifdef COMPAT\_FREEBSD32}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00285}00285         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__gen__descriptor}{usb\_gen\_descriptor}} local\_ugd;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00286}00286         \textcolor{keyword}{struct }usb\_gen\_descriptor32 *ugd32 = NULL;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00287}00287 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00288}00288         uint32\_t \mbox{\hyperlink{if__axge_8c_ae5dc6ffcd9b7605c7787791e40cc6bb0}{size}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00289}00289         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = 0;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00290}00290         uint8\_t \mbox{\hyperlink{if__usievar_8h_a1e6927fa1486224044e568f9c370519b}{id}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00291}00291 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00292}00292         ugd = data;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00293}00293 \textcolor{preprocessor}{\#ifdef COMPAT\_FREEBSD32}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00294}00294         \textcolor{keywordflow}{switch} (cmd) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00295}00295         \textcolor{keywordflow}{case} USB\_GET\_REPORT\_DESC32:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00296}00296         \textcolor{keywordflow}{case} USB\_GET\_REPORT32:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00297}00297         \textcolor{keywordflow}{case} USB\_SET\_REPORT32:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00298}00298                 ugd32 = data;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00299}00299                 ugd = \&local\_ugd;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00300}00300                 usb\_gen\_descriptor\_from32(ugd, ugd32);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00301}00301                 cmd = \_IOC\_NEWTYPE(cmd, \textcolor{keyword}{struct} \mbox{\hyperlink{structusb__gen__descriptor}{usb\_gen\_descriptor}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00302}00302                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00303}00303         \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00304}00304 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00305}00305 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00306}00306         \textcolor{keywordflow}{switch} (cmd) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00307}00307         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a6516f04c57405906b9e74b52b487d014}{USB\_GET\_REPORT\_DESC}}:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00308}00308                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a6719441e955014a290dcc01fd410d897}{sc\_repdesc\_size}} > ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a75415963b6fd4b8d06ba8b1854782191}{ugd\_maxlen}}) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00309}00309                         \mbox{\hyperlink{if__axge_8c_ae5dc6ffcd9b7605c7787791e40cc6bb0}{size}} = ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a75415963b6fd4b8d06ba8b1854782191}{ugd\_maxlen}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00310}00310                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00311}00311                         \mbox{\hyperlink{if__axge_8c_ae5dc6ffcd9b7605c7787791e40cc6bb0}{size}} = sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a6719441e955014a290dcc01fd410d897}{sc\_repdesc\_size}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00312}00312                 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00313}00313 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00314}00314                 ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a02eed3e0cb21a0a296293ceffdfce587}{ugd\_actlen}} = \mbox{\hyperlink{if__axge_8c_ae5dc6ffcd9b7605c7787791e40cc6bb0}{size}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00315}00315                 \textcolor{keywordflow}{if} (ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a2f1268f5a3352086e6edbe3d381b216b}{ugd\_data}} == NULL)}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00316}00316                         \textcolor{keywordflow}{break}; \textcolor{comment}{/* descriptor length only*/}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00317}00317                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = copyout(sc-\/>\mbox{\hyperlink{structuhid__snes__softc_afebf383fd23becb0da0422f8a7d738ce}{sc\_repdesc\_ptr}}, ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a2f1268f5a3352086e6edbe3d381b216b}{ugd\_data}}, \mbox{\hyperlink{if__axge_8c_ae5dc6ffcd9b7605c7787791e40cc6bb0}{size}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00318}00318                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00319}00319 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00320}00320         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_afdb152b39a50eeda95d1c2092fd5d21a}{USB\_SET\_IMMED}}:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00321}00321                 \textcolor{keywordflow}{if} (!(fflags \& FREAD)) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00322}00322                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EPERM;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00323}00323                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00324}00324                 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00325}00325 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00326}00326                 \textcolor{keywordflow}{if} (*(\textcolor{keywordtype}{int} *)data) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00327}00327                         \textcolor{comment}{/* do a test read */}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00328}00328                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{uhid__snes_8c_a3a1de98f8993f46574b6d6863e747f66}{uhid\_get\_report}}(sc, \mbox{\hyperlink{usbhid_8h_af540f9821ac4f3dad99b6e42024df6c1}{UHID\_INPUT\_REPORT}},}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00329}00329                             sc-\/>\mbox{\hyperlink{structuhid__snes__softc_af05cbdbb9467e92cf2b32be0e49be32e}{sc\_iid}}, NULL, NULL, sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a86832da2c069da36426ceee3fabb8603}{sc\_isize}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00330}00330                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00331}00331                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00332}00332                         \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00333}00333                         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad7384916ca37d13b1bb5e3fea14e5c2e}{sc\_mutex}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00334}00334                         sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a286ceb2e2be600bcc1c147328c554cf5}{sc\_fflags}} |= \mbox{\hyperlink{uhid__snes_8c_a1e6186d15148511ed79729a8e68bb324}{UHID\_FLAG\_IMMED}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00335}00335                         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad7384916ca37d13b1bb5e3fea14e5c2e}{sc\_mutex}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00336}00336                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00337}00337                         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad7384916ca37d13b1bb5e3fea14e5c2e}{sc\_mutex}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00338}00338                         sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a286ceb2e2be600bcc1c147328c554cf5}{sc\_fflags}} \&= \string~UHID\_FLAG\_IMMED;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00339}00339                         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad7384916ca37d13b1bb5e3fea14e5c2e}{sc\_mutex}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00340}00340                 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00341}00341                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00342}00342 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00343}00343         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a45ad378d00fb9863e4f17b9c0e919da6}{USB\_GET\_REPORT}}:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00344}00344                 \textcolor{keywordflow}{if} (!(fflags \& FREAD)) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00345}00345                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EPERM;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00346}00346                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00347}00347                 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00348}00348                 \textcolor{keywordflow}{switch} (ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a0eda19ece6251a8404541390a3b401cc}{ugd\_report\_type}}) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00349}00349                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usbhid_8h_af540f9821ac4f3dad99b6e42024df6c1}{UHID\_INPUT\_REPORT}}:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00350}00350                         \mbox{\hyperlink{if__axge_8c_ae5dc6ffcd9b7605c7787791e40cc6bb0}{size}} = sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a86832da2c069da36426ceee3fabb8603}{sc\_isize}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00351}00351                         \textcolor{keywordtype}{id} = sc-\/>\mbox{\hyperlink{structuhid__snes__softc_af05cbdbb9467e92cf2b32be0e49be32e}{sc\_iid}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00352}00352                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00353}00353                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usbhid_8h_a6c15a5eb7d96339faf19c4ac50a5c79b}{UHID\_OUTPUT\_REPORT}}:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00354}00354                         \mbox{\hyperlink{if__axge_8c_ae5dc6ffcd9b7605c7787791e40cc6bb0}{size}} = sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a7b8bb7fa8ae78f49704be84c90dba7a8}{sc\_osize}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00355}00355                         \textcolor{keywordtype}{id} = sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a7b7a26e65fb04ca4ddaa8dd580b12c7f}{sc\_oid}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00356}00356                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00357}00357                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usbhid_8h_a2b39f0f97bf832c66dad0c7dc051b314}{UHID\_FEATURE\_REPORT}}:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00358}00358                         \mbox{\hyperlink{if__axge_8c_ae5dc6ffcd9b7605c7787791e40cc6bb0}{size}} = sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a1081b3653c931dcc015a531dc28e5f2b}{sc\_fsize}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00359}00359                         \textcolor{keywordtype}{id} = sc-\/>\mbox{\hyperlink{structuhid__snes__softc_aaa1789fe6d26960a031ca1e9ac10e36f}{sc\_fid}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00360}00360                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00361}00361                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00362}00362                         \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00363}00363                 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00364}00364                 \textcolor{keywordflow}{if} (\textcolor{keywordtype}{id} != 0)}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00365}00365                         copyin(ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a2f1268f5a3352086e6edbe3d381b216b}{ugd\_data}}, \&\textcolor{keywordtype}{id}, 1);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00366}00366                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{uhid__snes_8c_a3a1de98f8993f46574b6d6863e747f66}{uhid\_get\_report}}(sc, ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a0eda19ece6251a8404541390a3b401cc}{ugd\_report\_type}}, \textcolor{keywordtype}{id},}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00367}00367                     NULL, ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a2f1268f5a3352086e6edbe3d381b216b}{ugd\_data}}, imin(ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a75415963b6fd4b8d06ba8b1854782191}{ugd\_maxlen}}, \mbox{\hyperlink{if__axge_8c_ae5dc6ffcd9b7605c7787791e40cc6bb0}{size}}));}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00368}00368                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00369}00369 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00370}00370         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a203c14e9764cd53075f21bb5ba649506}{USB\_SET\_REPORT}}:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00371}00371                 \textcolor{keywordflow}{if} (!(fflags \& FWRITE)) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00372}00372                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EPERM;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00373}00373                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00374}00374                 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00375}00375                 \textcolor{keywordflow}{switch} (ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a0eda19ece6251a8404541390a3b401cc}{ugd\_report\_type}}) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00376}00376                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usbhid_8h_af540f9821ac4f3dad99b6e42024df6c1}{UHID\_INPUT\_REPORT}}:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00377}00377                         \mbox{\hyperlink{if__axge_8c_ae5dc6ffcd9b7605c7787791e40cc6bb0}{size}} = sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a86832da2c069da36426ceee3fabb8603}{sc\_isize}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00378}00378                         \textcolor{keywordtype}{id} = sc-\/>\mbox{\hyperlink{structuhid__snes__softc_af05cbdbb9467e92cf2b32be0e49be32e}{sc\_iid}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00379}00379                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00380}00380                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usbhid_8h_a6c15a5eb7d96339faf19c4ac50a5c79b}{UHID\_OUTPUT\_REPORT}}:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00381}00381                         \mbox{\hyperlink{if__axge_8c_ae5dc6ffcd9b7605c7787791e40cc6bb0}{size}} = sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a7b8bb7fa8ae78f49704be84c90dba7a8}{sc\_osize}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00382}00382                         \textcolor{keywordtype}{id} = sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a7b7a26e65fb04ca4ddaa8dd580b12c7f}{sc\_oid}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00383}00383                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00384}00384                 \textcolor{keywordflow}{case} \mbox{\hyperlink{usbhid_8h_a2b39f0f97bf832c66dad0c7dc051b314}{UHID\_FEATURE\_REPORT}}:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00385}00385                         \mbox{\hyperlink{if__axge_8c_ae5dc6ffcd9b7605c7787791e40cc6bb0}{size}} = sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a1081b3653c931dcc015a531dc28e5f2b}{sc\_fsize}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00386}00386                         \textcolor{keywordtype}{id} = sc-\/>\mbox{\hyperlink{structuhid__snes__softc_aaa1789fe6d26960a031ca1e9ac10e36f}{sc\_fid}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00387}00387                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00388}00388                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00389}00389                         \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00390}00390                 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00391}00391                 \textcolor{keywordflow}{if} (\textcolor{keywordtype}{id} != 0)}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00392}00392                         copyin(ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a2f1268f5a3352086e6edbe3d381b216b}{ugd\_data}}, \&\textcolor{keywordtype}{id}, 1);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00393}00393                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{uhid__snes_8c_abac00ce667cb7096c4fa315160b62d7c}{uhid\_set\_report}}(sc, ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a0eda19ece6251a8404541390a3b401cc}{ugd\_report\_type}}, \textcolor{keywordtype}{id},}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00394}00394                     NULL, ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a2f1268f5a3352086e6edbe3d381b216b}{ugd\_data}}, imin(ugd-\/>\mbox{\hyperlink{structusb__gen__descriptor_a75415963b6fd4b8d06ba8b1854782191}{ugd\_maxlen}}, \mbox{\hyperlink{if__axge_8c_ae5dc6ffcd9b7605c7787791e40cc6bb0}{size}}));}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00395}00395                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00396}00396 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00397}00397         \textcolor{keywordflow}{case} \mbox{\hyperlink{usb__ioctl_8h_a0ba2801013c9ea115060ac7f6042aabb}{USB\_GET\_REPORT\_ID}}:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00398}00398                 \textcolor{comment}{/* XXX: we only support reportid 0? */}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00399}00399                 *(\textcolor{keywordtype}{int} *)data = 0;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00400}00400                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00401}00401 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00402}00402         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00403}00403                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00404}00404                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00405}00405         \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00406}00406 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00407}00407 \textcolor{preprocessor}{\#ifdef COMPAT\_FREEBSD32}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00408}00408         \textcolor{keywordflow}{if} (ugd32 != NULL)}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00409}00409                 update\_usb\_gen\_descriptor32(ugd32, ugd);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00410}00410 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00411}00411         \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00412}00412 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00413}00413 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00414}00414 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00415}\mbox{\hyperlink{uhid__snes_8c_a672e20e49642cd382258896a3b988486}{00415}} \mbox{\hyperlink{uhid__snes_8c_a672e20e49642cd382258896a3b988486}{uhid\_snes\_watchdog}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00416}00416 \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00417}00417         \textcolor{keyword}{struct }\mbox{\hyperlink{structuhid__snes__softc}{uhid\_snes\_softc}} *sc = arg;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00418}00418 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00419}00419         mtx\_assert(\&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad7384916ca37d13b1bb5e3fea14e5c2e}{sc\_mutex}}, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00420}00420 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00421}00421         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a286ceb2e2be600bcc1c147328c554cf5}{sc\_fflags}} == 0)}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00422}00422                 \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad02fa10cdf5b99dc41910ee5de80c302}{sc\_transfer}}[\mbox{\hyperlink{uhid__snes_8c_a385c44f6fb256e5716a2302a5b940388a85fd1b0c7df61ac10774470c1406bf3c}{UHID\_SNES\_STATUS\_DT\_RD}}]);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00423}00423 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00424}00424         \mbox{\hyperlink{usbdi_8h_a5ba556ca3595eb8006822a123ac9d54f}{usb\_callout\_reset}}(\&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a88f2ec13d3cf817ef859e8ca044c4b64}{sc\_watchdog}}, hz, \&\mbox{\hyperlink{uhid__snes_8c_a672e20e49642cd382258896a3b988486}{uhid\_snes\_watchdog}}, sc);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00425}00425 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00426}00426 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00427}00427 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00428}\mbox{\hyperlink{uhid__snes_8c_ab823265ce2edab559e8f2e3e8bf5fe43}{00428}} \mbox{\hyperlink{uhid__snes_8c_afa160861f16bf600887172ea04c2d2a5}{uhid\_snes\_start\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *fifo)}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00429}00429 \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00430}00430         \textcolor{keyword}{struct }\mbox{\hyperlink{structuhid__snes__softc}{uhid\_snes\_softc}} *sc = \mbox{\hyperlink{usbdi_8h_a1686d97012d48512200abd8ad0d86d1e}{usb\_fifo\_softc}}(fifo);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00431}00431 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00432}00432         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad02fa10cdf5b99dc41910ee5de80c302}{sc\_transfer}}[\mbox{\hyperlink{uhid__snes_8c_a385c44f6fb256e5716a2302a5b940388a7eae6b6a584ad81be77c22c3ef6b6fe6}{UHID\_SNES\_INTR\_DT\_RD}}]);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00433}00433 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00434}00434 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00435}00435 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00436}\mbox{\hyperlink{uhid__snes_8c_a6c68f0a0c7f645feff270b11bee97c0e}{00436}} \mbox{\hyperlink{uhid__snes_8c_ae04367f2c51787451ca6e789958482bb}{uhid\_snes\_stop\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *fifo)}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00437}00437 \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00438}00438         \textcolor{keyword}{struct }\mbox{\hyperlink{structuhid__snes__softc}{uhid\_snes\_softc}} *sc = \mbox{\hyperlink{usbdi_8h_a1686d97012d48512200abd8ad0d86d1e}{usb\_fifo\_softc}}(fifo);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00439}00439 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00440}00440         \mbox{\hyperlink{usb__transfer_8c_abe245d973df0cfd6fb96b884d33ebce3}{usbd\_transfer\_stop}}(sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad02fa10cdf5b99dc41910ee5de80c302}{sc\_transfer}}[\mbox{\hyperlink{uhid__snes_8c_a385c44f6fb256e5716a2302a5b940388a7eae6b6a584ad81be77c22c3ef6b6fe6}{UHID\_SNES\_INTR\_DT\_RD}}]);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00441}00441 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00442}00442 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00443}00443 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00444}\mbox{\hyperlink{uhid__snes_8c_aacd3c25ce080a5120639a3b77c380ef1}{00444}} \mbox{\hyperlink{uhid__snes_8c_a5afe580c77761ebfcf87e897fa315ce6}{uhid\_snes\_read\_callback}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *transfer, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00445}00445 \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00446}00446         \textcolor{keyword}{struct }\mbox{\hyperlink{structuhid__snes__softc}{uhid\_snes\_softc}} *sc = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(transfer);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00447}00447         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *fifo = sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a5981a0fbb3753a355d7c374f04a50960}{sc\_fifo\_open}}[\mbox{\hyperlink{usbdi_8h_aa4759b44daa392a7b438d6fba784f30a}{USB\_FIFO\_RX}}];}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00448}00448         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__cache}{usb\_page\_cache}} *pc;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00449}00449         \textcolor{keywordtype}{int} actual, max;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00450}00450 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00451}00451         \mbox{\hyperlink{usb__transfer_8c_ac0c68320222f26c2a3eba47b46c47899}{usbd\_xfer\_status}}(transfer, \&actual, NULL, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00452}00452         \textcolor{keywordflow}{if} (fifo == NULL)}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00453}00453                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00454}00454 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00455}00455         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(transfer)) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00456}00456         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00457}00457                 \textcolor{keywordflow}{if} (actual == 0) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00458}00458                         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a09ee35ccf62aeee74039dd9a9fb589b0}{sc\_zero\_length\_packets}} == 4)}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00459}00459                                 \textcolor{comment}{/* Throttle transfers. */}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00460}00460                                 \mbox{\hyperlink{usb__transfer_8c_abb9eced73c15f8c188ea09e378c09c03}{usbd\_xfer\_set\_interval}}(transfer, 500);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00461}00461                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00462}00462                                 sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a09ee35ccf62aeee74039dd9a9fb589b0}{sc\_zero\_length\_packets}}++;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00463}00463 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00464}00464                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00465}00465                         \textcolor{comment}{/* disable throttling. */}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00466}00466                         \mbox{\hyperlink{usb__transfer_8c_abb9eced73c15f8c188ea09e378c09c03}{usbd\_xfer\_set\_interval}}(transfer, 0);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00467}00467                         sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a09ee35ccf62aeee74039dd9a9fb589b0}{sc\_zero\_length\_packets}} = 0;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00468}00468                 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00469}00469                 pc = \mbox{\hyperlink{usb__transfer_8c_a6e66695b916f0770a259bed959c21555}{usbd\_xfer\_get\_frame}}(transfer, 0);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00470}00470                 \mbox{\hyperlink{usbdi_8h_a444304a04a6daab49a4d9ee6483f5415}{usb\_fifo\_put\_data}}(fifo, pc, 0, actual, 1);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00471}00471                 \textcolor{comment}{/* Fall through */}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00472}00472         setup:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00473}00473         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00474}00474                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{usbdi_8h_ae1674780bb74ed9a3bc64923b8515f1f}{usb\_fifo\_put\_bytes\_max}}(fifo) != 0) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00475}00475                         max = \mbox{\hyperlink{usb__transfer_8c_ae34a7cc2f01c6dfb68bca6fd0b72647e}{usbd\_xfer\_max\_len}}(transfer);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00476}00476                         \mbox{\hyperlink{usb__transfer_8c_a31786497f0f4222203b1e993d52af753}{usbd\_xfer\_set\_frame\_len}}(transfer, 0, max);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00477}00477                         \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(transfer);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00478}00478                 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00479}00479                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00480}00480 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00481}00481         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00482}00482                 \textcolor{comment}{/*disable throttling. */}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00483}00483                 \mbox{\hyperlink{usb__transfer_8c_abb9eced73c15f8c188ea09e378c09c03}{usbd\_xfer\_set\_interval}}(transfer, 0);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00484}00484                 sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a09ee35ccf62aeee74039dd9a9fb589b0}{sc\_zero\_length\_packets}} = 0;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00485}00485 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00486}00486                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}}) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00487}00487                         \textcolor{comment}{/* Issue a clear-\/stall request. */}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00488}00488                         \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(transfer);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00489}00489                         \textcolor{keywordflow}{goto} setup;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00490}00490                 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00491}00491                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00492}00492         \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00493}00493 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00494}00494 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00495}00495 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00496}\mbox{\hyperlink{uhid__snes_8c_acc24bccb43dbae9d6d4f929ddb404118}{00496}} \mbox{\hyperlink{uhid__snes_8c_abf8c1947a26ab96f0c2499178820f0ee}{uhid\_snes\_status\_callback}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *transfer, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00497}00497 \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00498}00498         \textcolor{keyword}{struct }\mbox{\hyperlink{structuhid__snes__softc}{uhid\_snes\_softc}} *sc = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(transfer);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00499}00499         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}} \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00500}00500         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__cache}{usb\_page\_cache}} *pc;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00501}00501         uint8\_t current\_status, new\_status;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00502}00502 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00503}00503         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(transfer)) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00504}00504         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00505}00505                 \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bmRequestType = \mbox{\hyperlink{usb_8h_a4f2e0216ffe1d8145cd1385e42c9a707}{UT\_READ\_CLASS\_INTERFACE}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00506}00506                 \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bRequest = \mbox{\hyperlink{uhid__snes_8c_aa319f866a1bd353a045b9ac4fe64c1c2}{UREQ\_GET\_PORT\_STATUS}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00507}00507                 \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wValue, 0);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00508}00508                 \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wIndex[0] = sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ac1bb53aeaacc0fce1cd60fcfe3e59f17}{sc\_iface\_num}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00509}00509                 \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wIndex[1] = 0;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00510}00510                 \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wLength, 1);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00511}00511 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00512}00512                 pc = \mbox{\hyperlink{usb__transfer_8c_a6e66695b916f0770a259bed959c21555}{usbd\_xfer\_get\_frame}}(transfer, 0);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00513}00513                 \mbox{\hyperlink{usb__busdma_8c_accb7cd85c3477e50c1ba1b1489226d09}{usbd\_copy\_in}}(pc, 0, \&\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}));}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00514}00514                 \mbox{\hyperlink{usb__transfer_8c_a31786497f0f4222203b1e993d52af753}{usbd\_xfer\_set\_frame\_len}}(transfer, 0, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}));}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00515}00515                 \mbox{\hyperlink{usb__transfer_8c_a31786497f0f4222203b1e993d52af753}{usbd\_xfer\_set\_frame\_len}}(transfer, 1, 1);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00516}00516                 \mbox{\hyperlink{usb__transfer_8c_a10f82b008c3a5311e5210e44beaca014}{usbd\_xfer\_set\_frames}}(transfer, 2);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00517}00517                 \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(transfer);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00518}00518                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00519}00519 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00520}00520         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00521}00521                 pc = \mbox{\hyperlink{usb__transfer_8c_a6e66695b916f0770a259bed959c21555}{usbd\_xfer\_get\_frame}}(transfer, 1);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00522}00522                 \mbox{\hyperlink{usb__busdma_8c_af52eece45b7868dbf58386f4c9e4eb9a}{usbd\_copy\_out}}(pc, 0, \&current\_status, 1);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00523}00523                 new\_status = current\_status \& \string~sc-\/>sc\_previous\_status;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00524}00524                 sc-\/>\mbox{\hyperlink{structuhid__snes__softc_af8bd6e37dd6e8e81bf1aee8569bccdec}{sc\_previous\_status}} = current\_status;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00525}00525                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00526}00526 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00527}00527         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00528}00528                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00529}00529         \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00530}00530 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00531}00531 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00532}00532 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00533}00533 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00534}\mbox{\hyperlink{uhid__snes_8c_abbbf702abf6c1ce9cae35570e5bdc8e6}{00534}} \mbox{\hyperlink{uhid__snes_8c_a3a57892c0f2e3aabe9c98e1eb1719674}{uhid\_snes\_probe}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00535}00535 \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00536}00536         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__attach__arg}{usb\_attach\_arg}} *uaa = device\_get\_ivars(dev);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00537}00537 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00538}00538         \textcolor{keywordflow}{if} (uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a246691e99681281d3113d63e81b7e4f0}{usb\_mode}} != \mbox{\hyperlink{usb_8h_a9bc559812598988121896dceb483806ba1c7091216cfa9c9f4a252b0825ed32cb}{USB\_MODE\_HOST}})}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00539}00539                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00540}00540 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00541}00541         \textcolor{keywordflow}{return} (\mbox{\hyperlink{usb__lookup_8c_aa691ad42d532498716f358cb1c994fb2}{usbd\_lookup\_id\_by\_uaa}}(\mbox{\hyperlink{uhid__snes_8c_af4f2ec6b5e4d36cf82b79e2be0d19a27}{snes\_devs}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{uhid__snes_8c_af4f2ec6b5e4d36cf82b79e2be0d19a27}{snes\_devs}}), uaa));}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00542}00542 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00543}00543 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00544}00544 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00545}\mbox{\hyperlink{uhid__snes_8c_a079d7049bb3e828b18cf4de2583e7ce9}{00545}} \mbox{\hyperlink{uhid__snes_8c_a47d5c764aee8480c3d6bc711440ad3db}{uhid\_snes\_attach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00546}00546 \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00547}00547         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__attach__arg}{usb\_attach\_arg}} *uaa = device\_get\_ivars(dev);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00548}00548         \textcolor{keyword}{struct }\mbox{\hyperlink{structuhid__snes__softc}{uhid\_snes\_softc}} *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00549}00549         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__interface__descriptor}{usb\_interface\_descriptor}} *idesc;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00550}00550         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__config__descriptor}{usb\_config\_descriptor}} *cdesc;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00551}00551         uint8\_t alt\_index, iface\_index = uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a66c2afc71fce73cc432f7d58593e1f26}{info}}.\mbox{\hyperlink{structusbd__lookup__info_a50a68740a4c82f1a9b999d4a7994b550}{bIfaceIndex}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00552}00552         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}},unit = device\_get\_unit(dev);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00553}00553 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00554}00554         sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a6f99724880058599565c69a28a3f1222}{sc\_dev}} = dev;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00555}00555         sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ab5cecc74b89f2605219d48a7d35c5d44}{sc\_usb\_device}} = uaa-\/>\mbox{\hyperlink{structusb__attach__arg_ac86557d3eaf77874d436ce38648b0276}{device}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00556}00556         \mbox{\hyperlink{usb__util_8c_a2f65a197990caa1a69a16691ce4dc66a}{device\_set\_usb\_desc}}(dev);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00557}00557         mtx\_init(\&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad7384916ca37d13b1bb5e3fea14e5c2e}{sc\_mutex}}, \textcolor{stringliteral}{"{}uhid\_snes"{}}, NULL, MTX\_DEF | MTX\_RECURSE);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00558}00558         \mbox{\hyperlink{usbdi_8h_a1f241362056f1ed3d4c4b5cfb63ce8e5}{usb\_callout\_init\_mtx}}(\&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a88f2ec13d3cf817ef859e8ca044c4b64}{sc\_watchdog}}, \&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad7384916ca37d13b1bb5e3fea14e5c2e}{sc\_mutex}}, 0);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00559}00559 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00560}00560         idesc = \mbox{\hyperlink{usb__device_8c_a4b209681fa34e4570ab0544d0ae9002f}{usbd\_get\_interface\_descriptor}}(uaa-\/>\mbox{\hyperlink{structusb__attach__arg_aaf4432c55ec34c0e4eb0cb3ddfb08ffd}{iface}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00561}00561         alt\_index = -\/1;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00562}00562         \textcolor{keywordflow}{for}(;;) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00563}00563                 \textcolor{keywordflow}{if} (idesc == NULL)}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00564}00564                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00565}00565 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00566}00566                 \textcolor{keywordflow}{if} ((idesc-\/>\mbox{\hyperlink{structusb__interface__descriptor_ad4f7914ce2bc3d8830d6463a7f2989d6}{bDescriptorType}} == \mbox{\hyperlink{usb_8h_a93c15218c1fed26b097fb0b53a3ce4f7}{UDESC\_INTERFACE}}) \&\&}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00567}00567                      (idesc-\/>\mbox{\hyperlink{structusb__interface__descriptor_a76bf355cc203292de381bb13639f480b}{bLength}} >= \textcolor{keyword}{sizeof}(*idesc))) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00568}00568                         \textcolor{keywordflow}{if} (idesc-\/>\mbox{\hyperlink{structusb__interface__descriptor_a2a677edcb9663fd7c6cf904d1b40bbd1}{bInterfaceNumber}} != uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a66c2afc71fce73cc432f7d58593e1f26}{info}}.\mbox{\hyperlink{structusbd__lookup__info_a268433f99f7bfcc278a619418e3c44fa}{bIfaceNum}}) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00569}00569                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00570}00570                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00571}00571                                 alt\_index++;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00572}00572                                 \textcolor{keywordflow}{if} (idesc-\/>\mbox{\hyperlink{structusb__interface__descriptor_ac644f443f8945e0a1ef300edec7b5641}{bInterfaceClass}} == \mbox{\hyperlink{usb_8h_a77eca6d49a1f0f93fb31aad0ef2f33b4}{UICLASS\_HID}})}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00573}00573                                         \textcolor{keywordflow}{goto} found;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00574}00574                         \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00575}00575                 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00576}00576 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00577}00577                 cdesc = \mbox{\hyperlink{usb__device_8c_a5833d02ea7d69fb84106d7b97391431a}{usbd\_get\_config\_descriptor}}(uaa-\/>\mbox{\hyperlink{structusb__attach__arg_ac86557d3eaf77874d436ce38648b0276}{device}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00578}00578                 idesc = (\textcolor{keywordtype}{void} *)\mbox{\hyperlink{usb__parse_8c_ad481250bba6a8950a17f0ae325ff27d5}{usb\_desc\_foreach}}(cdesc, (\textcolor{keywordtype}{void} *)idesc);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00579}00579                 \textcolor{keywordflow}{goto} found;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00580}00580         \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00581}00581         \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00582}00582 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00583}00583 found:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00584}00584         \textcolor{keywordflow}{if} (alt\_index) \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00585}00585                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usb__device_8c_a04693d160af658ae93ddddeac41e6ef2}{usbd\_set\_alt\_interface\_index}}(uaa-\/>\mbox{\hyperlink{structusb__attach__arg_ac86557d3eaf77874d436ce38648b0276}{device}}, iface\_index, alt\_index);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00586}00586                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00587}00587                         \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00588}00588         \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00589}00589 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00590}00590         sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ac1bb53aeaacc0fce1cd60fcfe3e59f17}{sc\_iface\_num}} = idesc-\/>\mbox{\hyperlink{structusb__interface__descriptor_a2a677edcb9663fd7c6cf904d1b40bbd1}{bInterfaceNumber}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00591}00591 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00592}00592         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usb__transfer_8c_a7494c04fae5c5e7ef1af436308670a21}{usbd\_transfer\_setup}}(uaa-\/>\mbox{\hyperlink{structusb__attach__arg_ac86557d3eaf77874d436ce38648b0276}{device}}, \&iface\_index,}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00593}00593             sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad02fa10cdf5b99dc41910ee5de80c302}{sc\_transfer}}, \mbox{\hyperlink{uhid__snes_8c_a3ddee7f97f73ade7c9044eb847aa3e40}{uhid\_snes\_config}}, \mbox{\hyperlink{uhid__snes_8c_a385c44f6fb256e5716a2302a5b940388a7e69955448044c8a03733776b1438915}{UHID\_SNES\_N\_TRANSFER}}, sc,}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00594}00594             \&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad7384916ca37d13b1bb5e3fea14e5c2e}{sc\_mutex}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00595}00595 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00596}00596         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00597}00597                 \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00598}00598 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00599}00599         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usbdi_8h_a5371ea3e610eb1aab81d81494838ab3e}{usb\_fifo\_attach}}(uaa-\/>\mbox{\hyperlink{structusb__attach__arg_ac86557d3eaf77874d436ce38648b0276}{device}}, sc, \&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad7384916ca37d13b1bb5e3fea14e5c2e}{sc\_mutex}},}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00600}00600             \&\mbox{\hyperlink{uhid__snes_8c_a93443e095e01e2cfb8642fda23c402d3}{uhid\_snes\_fifo\_methods}}, \&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a9615a48723581cd529dd9dd141c87354}{sc\_fifo}}, unit, -\/1,}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00601}00601             iface\_index, UID\_ROOT, GID\_OPERATOR, 0644);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00602}00602         sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a6719441e955014a290dcc01fd410d897}{sc\_repdesc\_size}} = \textcolor{keyword}{sizeof}(\mbox{\hyperlink{uhid__snes_8c_adbdca8f59336a9b5c77557041707e687}{uhid\_snes\_report\_descr}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00603}00603         sc-\/>\mbox{\hyperlink{structuhid__snes__softc_afebf383fd23becb0da0422f8a7d738ce}{sc\_repdesc\_ptr}} = \_\_DECONST(\textcolor{keywordtype}{void}*, \&\mbox{\hyperlink{uhid__snes_8c_adbdca8f59336a9b5c77557041707e687}{uhid\_snes\_report\_descr}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00604}00604 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00605}00605         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00606}00606                 \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00607}00607 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00608}00608         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad7384916ca37d13b1bb5e3fea14e5c2e}{sc\_mutex}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00609}00609         \mbox{\hyperlink{uhid__snes_8c_a672e20e49642cd382258896a3b988486}{uhid\_snes\_watchdog}}(sc);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00610}00610         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad7384916ca37d13b1bb5e3fea14e5c2e}{sc\_mutex}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00611}00611         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00612}00612 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00613}00613 detach:}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00614}00614         \mbox{\hyperlink{uhid__snes_8c_a7571c539573c897ce5d7c18031c2f2b3}{uhid\_snes\_detach}}(dev);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00615}00615         \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00616}00616 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00617}00617 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00618}00618 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00619}\mbox{\hyperlink{uhid__snes_8c_abae80ecb94a5d79bac4e59766a96205a}{00619}} \mbox{\hyperlink{uhid__snes_8c_a7571c539573c897ce5d7c18031c2f2b3}{uhid\_snes\_detach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00620}00620 \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00621}00621         \textcolor{keyword}{struct }\mbox{\hyperlink{structuhid__snes__softc}{uhid\_snes\_softc}} *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00622}00622 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00623}00623         \mbox{\hyperlink{usbdi_8h_a383e94e216e88e5dd62e6cfe8888ccf9}{usb\_fifo\_detach}}(\&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a9615a48723581cd529dd9dd141c87354}{sc\_fifo}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00624}00624         \mbox{\hyperlink{usbdi_8h_a383e94e216e88e5dd62e6cfe8888ccf9}{usb\_fifo\_detach}}(\&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a1fe274652ad23ec6208913fe5097d2af}{sc\_fifo\_no\_reset}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00625}00625 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00626}00626         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad7384916ca37d13b1bb5e3fea14e5c2e}{sc\_mutex}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00627}00627         \mbox{\hyperlink{usbdi_8h_ad74dd2f25febf2ba5083574711e4101a}{usb\_callout\_stop}}(\&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a88f2ec13d3cf817ef859e8ca044c4b64}{sc\_watchdog}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00628}00628         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad7384916ca37d13b1bb5e3fea14e5c2e}{sc\_mutex}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00629}00629 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00630}00630         \mbox{\hyperlink{usb__transfer_8c_a2f5ab55bfe7f356bb7a7505ff35c9741}{usbd\_transfer\_unsetup}}(sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad02fa10cdf5b99dc41910ee5de80c302}{sc\_transfer}}, \mbox{\hyperlink{uhid__snes_8c_a385c44f6fb256e5716a2302a5b940388a7e69955448044c8a03733776b1438915}{UHID\_SNES\_N\_TRANSFER}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00631}00631         \mbox{\hyperlink{usbdi_8h_a828c4d79b0d9b11c8dcb77899a2bffda}{usb\_callout\_drain}}(\&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_a88f2ec13d3cf817ef859e8ca044c4b64}{sc\_watchdog}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00632}00632         mtx\_destroy(\&sc-\/>\mbox{\hyperlink{structuhid__snes__softc_ad7384916ca37d13b1bb5e3fea14e5c2e}{sc\_mutex}});}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00633}00633 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00634}00634         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00635}00635 \}}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00636}00636 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00637}\mbox{\hyperlink{uhid__snes_8c_af718aa1f730ef29697f48a0afa457ad3}{00637}} \textcolor{keyword}{static} device\_method\_t \mbox{\hyperlink{uhid__snes_8c_af718aa1f730ef29697f48a0afa457ad3}{uhid\_snes\_methods}}[] = \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00638}00638         DEVMETHOD(device\_probe, \mbox{\hyperlink{uhid__snes_8c_a3a57892c0f2e3aabe9c98e1eb1719674}{uhid\_snes\_probe}}),}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00639}00639         DEVMETHOD(device\_attach, \mbox{\hyperlink{uhid__snes_8c_a47d5c764aee8480c3d6bc711440ad3db}{uhid\_snes\_attach}}),}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00640}00640         DEVMETHOD(device\_detach, \mbox{\hyperlink{uhid__snes_8c_a7571c539573c897ce5d7c18031c2f2b3}{uhid\_snes\_detach}}),}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00641}00641         DEVMETHOD\_END}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00642}00642 \};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00643}00643 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00644}\mbox{\hyperlink{uhid__snes_8c_a86bc67ee937ab34d1a62b53265ddaae1}{00644}} \textcolor{keyword}{static} driver\_t \mbox{\hyperlink{uhid__snes_8c_a86bc67ee937ab34d1a62b53265ddaae1}{uhid\_snes\_driver}} = \{}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00645}00645         \textcolor{stringliteral}{"{}uhid\_snes"{}},}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00646}00646         \mbox{\hyperlink{uhid__snes_8c_af718aa1f730ef29697f48a0afa457ad3}{uhid\_snes\_methods}},}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00647}00647         \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structuhid__snes__softc}{uhid\_snes\_softc}})}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00648}00648 \};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00649}00649 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00650}\mbox{\hyperlink{uhid__snes_8c_a4e9acdbd7549d2f94c87c9d3b6d35332}{00650}} \textcolor{keyword}{static} devclass\_t \mbox{\hyperlink{uhid__snes_8c_a4e9acdbd7549d2f94c87c9d3b6d35332}{uhid\_snes\_devclass}};}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00651}00651 }
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00652}\mbox{\hyperlink{uhid__snes_8c_a0631cc84e2cb4887604af9488df298c5}{00652}} \mbox{\hyperlink{uhid__snes_8c_a0631cc84e2cb4887604af9488df298c5}{DRIVER\_MODULE}}(uhid\_snes, uhub, \mbox{\hyperlink{uhid__snes_8c_a86bc67ee937ab34d1a62b53265ddaae1}{uhid\_snes\_driver}}, \mbox{\hyperlink{uhid__snes_8c_a4e9acdbd7549d2f94c87c9d3b6d35332}{uhid\_snes\_devclass}}, NULL, 0);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00653}\mbox{\hyperlink{uhid__snes_8c_a17aa02b6c84b5a2edc45754de89d61ea}{00653}} \mbox{\hyperlink{uhid__snes_8c_a17aa02b6c84b5a2edc45754de89d61ea}{MODULE\_DEPEND}}(uhid\_snes, \mbox{\hyperlink{usb__if_8m_adfa3f6da9c4881e494b180c4ebb06470}{usb}}, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{uhid__snes_8c_source_l00654}\mbox{\hyperlink{uhid__snes_8c_a33b20d7c3581c2d9c0e4178d81e90444}{00654}} \mbox{\hyperlink{uhid__snes_8c_a33b20d7c3581c2d9c0e4178d81e90444}{USB\_PNP\_HOST\_INFO}}(\mbox{\hyperlink{uhid__snes_8c_af4f2ec6b5e4d36cf82b79e2be0d19a27}{snes\_devs}});}

\end{DoxyCode}
