\hypertarget{urio_8c_source}{}\doxysection{urio.\+c}
\label{urio_8c_source}\index{dev/usb/storage/urio.c@{dev/usb/storage/urio.c}}
\mbox{\hyperlink{urio_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2000 Iwasa Kazmi}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00005}00005 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00007}00007 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00008}00008 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00009}00009 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00010}00010 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00011}00011 \textcolor{comment}{ *    notice, this list of conditions, and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00012}00012 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00013}00013 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00014}00014 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00015}00015 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00016}00016 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00017}00017 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00018}00018 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00019}00019 \textcolor{comment}{ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00020}00020 \textcolor{comment}{ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00021}00021 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00022}00022 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00023}00023 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00024}00024 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00025}00025 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00026}00026 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00027}00027 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00028}00028 \textcolor{comment}{ * This code is based on ugen.c and ulpt.c developed by Lennart Augustsson.}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00029}00029 \textcolor{comment}{ * This code includes software developed by the NetBSD Foundation, Inc. and}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00030}00030 \textcolor{comment}{ * its contributors.}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00031}00031 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00032}00032 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00034}\mbox{\hyperlink{urio_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00034}} \mbox{\hyperlink{urio_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00035}00035 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00036}00036 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00037}00037 \textcolor{comment}{ * 2000/3/24  added NetBSD/OpenBSD support (from Alex Nemirovsky)}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00038}00038 \textcolor{comment}{ * 2000/3/07  use two bulk-\/pipe handles for read and write (Dirk)}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00039}00039 \textcolor{comment}{ * 2000/3/06  change major number(143), and copyright header}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00040}00040 \textcolor{comment}{ *            some fix for 4.0 (Dirk)}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00041}00041 \textcolor{comment}{ * 2000/3/05  codes for FreeBSD 4.x -\/ CURRENT (Thanks to Dirk-\/Willem van Gulik)}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00042}00042 \textcolor{comment}{ * 2000/3/01  remove retry code from urioioctl()}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00043}00043 \textcolor{comment}{ *            change method of bulk transfer (no interrupt)}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00044}00044 \textcolor{comment}{ * 2000/2/28  small fixes for new rio\_usb.h}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00045}00045 \textcolor{comment}{ * 2000/2/24  first version.}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00046}00046 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00047}00047 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <sys/stdint.h>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <sys/stddef.h>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00052}00052 \textcolor{preprocessor}{\#include <sys/types.h>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00054}00054 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00055}00055 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00056}00056 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00057}00057 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00058}00058 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00059}00059 \textcolor{preprocessor}{\#include <sys/condvar.h>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00060}00060 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00061}00061 \textcolor{preprocessor}{\#include <sys/sx.h>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00062}00062 \textcolor{preprocessor}{\#include <sys/unistd.h>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00063}00063 \textcolor{preprocessor}{\#include <sys/callout.h>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00064}00064 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00065}00065 \textcolor{preprocessor}{\#include <sys/priv.h>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00066}00066 \textcolor{preprocessor}{\#include <sys/conf.h>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00067}00067 \textcolor{preprocessor}{\#include <sys/fcntl.h>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00068}00068 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00069}00069 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb_8h}{dev/usb/usb.h}}>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00070}00070 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usbdi_8h}{dev/usb/usbdi.h}}>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00071}00071 \textcolor{preprocessor}{\#include "{}usbdevs.h"{}}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00072}00072 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00073}00073 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__ioctl_8h}{dev/usb/usb\_ioctl.h}}>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00074}00074 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__generic_8h}{dev/usb/usb\_generic.h}}>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00075}00075 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00076}\mbox{\hyperlink{urio_8c_a927dd6f59caf10a2991dfb564bcbb1e1}{00076}} \textcolor{preprocessor}{\#define USB\_DEBUG\_VAR urio\_debug}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00077}00077 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__debug_8h}{dev/usb/usb\_debug.h}}>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00078}00078 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00079}00079 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{rio500__usb_8h}{dev/usb/storage/rio500\_usb.h}}>}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00080}00080 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00081}00081 \textcolor{preprocessor}{\#ifdef USB\_DEBUG}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00082}00082 \textcolor{keyword}{static} \textcolor{keywordtype}{int} urio\_debug = 0;}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00083}00083 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00084}00084 \textcolor{keyword}{static} \mbox{\hyperlink{dwc__otg_8c_a58e125bcf985ce2333baef42f97b33b3}{SYSCTL\_NODE}}(\_hw\_usb, OID\_AUTO, urio, CTLFLAG\_RW | CTLFLAG\_MPSAFE, 0,}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00085}00085     \textcolor{stringliteral}{"{}USB urio"{}});}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00086}00086 \mbox{\hyperlink{dwc__otg_8c_a83d020f0b15dc2783f3f1a6966c75e36}{SYSCTL\_INT}}(\_hw\_usb\_urio, OID\_AUTO, \mbox{\hyperlink{cfumass_8c_ac3e1795766a80ec63b157951b4b9a7d4}{debug}}, CTLFLAG\_RWTUN,}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00087}00087     \&urio\_debug, 0, \textcolor{stringliteral}{"{}urio debug level"{}});}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00088}00088 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00089}00089 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00090}\mbox{\hyperlink{urio_8c_a1eec9a9cb3994336eaaf69394611f28b}{00090}} \textcolor{preprocessor}{\#define URIO\_T\_WR     0}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00091}\mbox{\hyperlink{urio_8c_a1af55a5c97c2ccc1d94f69a06f02f6e9}{00091}} \textcolor{preprocessor}{\#define URIO\_T\_RD     1}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00092}\mbox{\hyperlink{urio_8c_aec9b0b3ea0686391adbff4c094e53d0c}{00092}} \textcolor{preprocessor}{\#define URIO\_T\_WR\_CS  2}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00093}\mbox{\hyperlink{urio_8c_aea8961eb666a57a7e21cae37c9072a0c}{00093}} \textcolor{preprocessor}{\#define URIO\_T\_RD\_CS  3}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00094}\mbox{\hyperlink{urio_8c_a35c45d62a8f6f9cfe02258005309d17f}{00094}} \textcolor{preprocessor}{\#define URIO\_T\_MAX    4}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00095}00095 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00096}\mbox{\hyperlink{urio_8c_a6e7650e4d9c80903621b21f85bf501d5}{00096}} \textcolor{preprocessor}{\#define URIO\_BSIZE      (1<<12)         }\textcolor{comment}{/* bytes */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00097}\mbox{\hyperlink{urio_8c_abc09e4351b41da920882e9d14509c090}{00097}} \textcolor{preprocessor}{\#define URIO\_IFQ\_MAXLEN      2          }\textcolor{comment}{/* units */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00098}00098 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00099}\mbox{\hyperlink{structurio__softc}{00099}} \textcolor{keyword}{struct }\mbox{\hyperlink{structurio__softc}{urio\_softc}} \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00100}\mbox{\hyperlink{structurio__softc_a5f52d47bf4f851a2c754bc6084f87a14}{00100}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fifo__sc}{usb\_fifo\_sc}} \mbox{\hyperlink{structurio__softc_a5f52d47bf4f851a2c754bc6084f87a14}{sc\_fifo}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00101}\mbox{\hyperlink{structurio__softc_a852b1fc22a53ae92178b5f2e17e3d9ec}{00101}}         \textcolor{keyword}{struct }mtx \mbox{\hyperlink{structurio__softc_a852b1fc22a53ae92178b5f2e17e3d9ec}{sc\_mtx}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00102}00102 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00103}\mbox{\hyperlink{structurio__softc_aee03a64d457c42729b9dcddc5c9f9051}{00103}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device}{usb\_device}} *\mbox{\hyperlink{structurio__softc_aee03a64d457c42729b9dcddc5c9f9051}{sc\_udev}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00104}\mbox{\hyperlink{structurio__softc_abfbcf8123dead8de7ae42b7dc2db11d3}{00104}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *\mbox{\hyperlink{structurio__softc_abfbcf8123dead8de7ae42b7dc2db11d3}{sc\_xfer}}[\mbox{\hyperlink{urio_8c_a35c45d62a8f6f9cfe02258005309d17f}{URIO\_T\_MAX}}];}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00105}00105 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00106}\mbox{\hyperlink{structurio__softc_a83f75f1337c1de6826106fd42819f04e}{00106}}         uint8\_t \mbox{\hyperlink{structurio__softc_a83f75f1337c1de6826106fd42819f04e}{sc\_flags}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00107}\mbox{\hyperlink{urio_8c_a06cd25d284e7be5ba1a59915f23b1a96}{00107}} \textcolor{preprocessor}{\#define URIO\_FLAG\_READ\_STALL    0x01    }\textcolor{comment}{/* read transfer stalled */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00108}\mbox{\hyperlink{urio_8c_a056ccf9b160fff4fa92ce55144eb6cec}{00108}} \textcolor{preprocessor}{\#define URIO\_FLAG\_WRITE\_STALL   0x02    }\textcolor{comment}{/* write transfer stalled */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00109}00109 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00110}\mbox{\hyperlink{structurio__softc_a413aaff81acba0e1883b5be311e1cfcf}{00110}}         uint8\_t \mbox{\hyperlink{structurio__softc_a413aaff81acba0e1883b5be311e1cfcf}{sc\_name}}[16];}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00111}00111 \};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00112}00112 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00113}00113 \textcolor{comment}{/* prototypes */}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00114}00114 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00115}\mbox{\hyperlink{urio_8c_a428b78455fe4549703302776c4b8bbc3}{00115}} \textcolor{keyword}{static} device\_probe\_t \mbox{\hyperlink{urio_8c_a428b78455fe4549703302776c4b8bbc3}{urio\_probe}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00116}\mbox{\hyperlink{urio_8c_ab8afc84052b658bb46a2f8300bb5e52f}{00116}} \textcolor{keyword}{static} device\_attach\_t \mbox{\hyperlink{urio_8c_ab8afc84052b658bb46a2f8300bb5e52f}{urio\_attach}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00117}\mbox{\hyperlink{urio_8c_aa3c0abb63847acb6e622b7a188720aac}{00117}} \textcolor{keyword}{static} device\_detach\_t \mbox{\hyperlink{urio_8c_aa3c0abb63847acb6e622b7a188720aac}{urio\_detach}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00118}00118 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00119}\mbox{\hyperlink{urio_8c_affa8580ccd0dfe563a40a17287fb5997}{00119}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{urio_8c_affa8580ccd0dfe563a40a17287fb5997}{urio\_write\_callback}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00120}\mbox{\hyperlink{urio_8c_a5f5cc05f8a041de74a6b29d3fb1721fe}{00120}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{urio_8c_a5f5cc05f8a041de74a6b29d3fb1721fe}{urio\_write\_clear\_stall\_callback}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00121}\mbox{\hyperlink{urio_8c_a81f5f3dc211a0a53a88e8099cb2f6fda}{00121}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{urio_8c_a81f5f3dc211a0a53a88e8099cb2f6fda}{urio\_read\_callback}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00122}\mbox{\hyperlink{urio_8c_af351f9aa271542b84762327144b7b4f2}{00122}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{urio_8c_af351f9aa271542b84762327144b7b4f2}{urio\_read\_clear\_stall\_callback}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00123}00123 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00124}\mbox{\hyperlink{urio_8c_aeaf3821fb39a1ef5172773fa7c7bd5a1}{00124}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a1f11bee0038616aab627d2eb67a544b5}{usb\_fifo\_close\_t}} \mbox{\hyperlink{urio_8c_aeaf3821fb39a1ef5172773fa7c7bd5a1}{urio\_close}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00125}\mbox{\hyperlink{urio_8c_ae5884fd168d02cbddd544f8ff59dcfd8}{00125}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a615dd3e847b9bb98800455c172df26a7}{usb\_fifo\_cmd\_t}} \mbox{\hyperlink{urio_8c_ae5884fd168d02cbddd544f8ff59dcfd8}{urio\_start\_read}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00126}\mbox{\hyperlink{urio_8c_a0782787cc97e759ee937ecced62b6801}{00126}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a615dd3e847b9bb98800455c172df26a7}{usb\_fifo\_cmd\_t}} \mbox{\hyperlink{urio_8c_a0782787cc97e759ee937ecced62b6801}{urio\_start\_write}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00127}\mbox{\hyperlink{urio_8c_a56c344e8b1c6e2786ff31fbdf9e9ed39}{00127}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a615dd3e847b9bb98800455c172df26a7}{usb\_fifo\_cmd\_t}} \mbox{\hyperlink{urio_8c_a56c344e8b1c6e2786ff31fbdf9e9ed39}{urio\_stop\_read}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00128}\mbox{\hyperlink{urio_8c_ab1546314db30929e996f8122eab6a508}{00128}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a615dd3e847b9bb98800455c172df26a7}{usb\_fifo\_cmd\_t}} \mbox{\hyperlink{urio_8c_ab1546314db30929e996f8122eab6a508}{urio\_stop\_write}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00129}\mbox{\hyperlink{urio_8c_a57202142be5bcf8355e77c47849ca1e1}{00129}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a1216ed6c6a9a63cba57811e6fe1f7fea}{usb\_fifo\_ioctl\_t}} \mbox{\hyperlink{urio_8c_a57202142be5bcf8355e77c47849ca1e1}{urio\_ioctl}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00130}\mbox{\hyperlink{urio_8c_a297e0f658edbba53ed6d758691d9c4b8}{00130}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_abf627b9df5961890963bce30a2cf9e1d}{usb\_fifo\_open\_t}} \mbox{\hyperlink{urio_8c_a297e0f658edbba53ed6d758691d9c4b8}{urio\_open}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00131}00131 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00132}\mbox{\hyperlink{urio_8c_ad32ed04749acb17564c2c45521071b09}{00132}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fifo__methods}{usb\_fifo\_methods}} \mbox{\hyperlink{urio_8c_ad32ed04749acb17564c2c45521071b09}{urio\_fifo\_methods}} = \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00133}00133         .\mbox{\hyperlink{structusb__fifo__methods_a115a1ddc0fbdaa0d2e462fe6f9568119}{f\_close}} = \&\mbox{\hyperlink{urio_8c_aeaf3821fb39a1ef5172773fa7c7bd5a1}{urio\_close}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00134}00134         .f\_ioctl = \&\mbox{\hyperlink{urio_8c_a57202142be5bcf8355e77c47849ca1e1}{urio\_ioctl}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00135}00135         .f\_open = \&\mbox{\hyperlink{urio_8c_a297e0f658edbba53ed6d758691d9c4b8}{urio\_open}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00136}00136         .f\_start\_read = \&\mbox{\hyperlink{urio_8c_ae5884fd168d02cbddd544f8ff59dcfd8}{urio\_start\_read}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00137}00137         .f\_start\_write = \&\mbox{\hyperlink{urio_8c_a0782787cc97e759ee937ecced62b6801}{urio\_start\_write}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00138}00138         .f\_stop\_read = \&\mbox{\hyperlink{urio_8c_a56c344e8b1c6e2786ff31fbdf9e9ed39}{urio\_stop\_read}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00139}00139         .f\_stop\_write = \&\mbox{\hyperlink{urio_8c_ab1546314db30929e996f8122eab6a508}{urio\_stop\_write}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00140}00140         .basename[0] = \textcolor{stringliteral}{"{}urio"{}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00141}00141 \};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00142}00142 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00143}\mbox{\hyperlink{urio_8c_aae33fb936f68641449afc6f0295d7b99}{00143}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__config}{usb\_config}} \mbox{\hyperlink{urio_8c_aae33fb936f68641449afc6f0295d7b99}{urio\_config}}[\mbox{\hyperlink{urio_8c_a35c45d62a8f6f9cfe02258005309d17f}{URIO\_T\_MAX}}] = \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00144}00144         [\mbox{\hyperlink{urio_8c_a1eec9a9cb3994336eaaf69394611f28b}{URIO\_T\_WR}}] = \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00145}00145                 .\mbox{\hyperlink{structusb__config_a5bd5d569870291a54d9bed8377ed8b10}{type}} = \mbox{\hyperlink{usb_8h_a25240fc009aa67bb7a2b635d2e9401e4}{UE\_BULK}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00146}00146                 .endpoint = \mbox{\hyperlink{usb_8h_a1e8d1f402536e634471569b83f603197}{UE\_ADDR\_ANY}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00147}00147                 .direction = \mbox{\hyperlink{usb_8h_a9a98e1bc9388db2ab5213e9d6496e851}{UE\_DIR\_OUT}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00148}00148                 .bufsize = \mbox{\hyperlink{urio_8c_a6e7650e4d9c80903621b21f85bf501d5}{URIO\_BSIZE}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00149}00149                 .flags = \{.pipe\_bof = 1,.force\_short\_xfer = 1,.proxy\_buffer = 1,\},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00150}00150                 .callback = \&\mbox{\hyperlink{urio_8c_affa8580ccd0dfe563a40a17287fb5997}{urio\_write\_callback}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00151}00151         \},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00152}00152 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00153}00153         [\mbox{\hyperlink{urio_8c_a1af55a5c97c2ccc1d94f69a06f02f6e9}{URIO\_T\_RD}}] = \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00154}00154                 .type = \mbox{\hyperlink{usb_8h_a25240fc009aa67bb7a2b635d2e9401e4}{UE\_BULK}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00155}00155                 .endpoint = \mbox{\hyperlink{usb_8h_a1e8d1f402536e634471569b83f603197}{UE\_ADDR\_ANY}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00156}00156                 .direction = \mbox{\hyperlink{usb_8h_a72bb077a860132c175c166f344c75893}{UE\_DIR\_IN}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00157}00157                 .bufsize = \mbox{\hyperlink{urio_8c_a6e7650e4d9c80903621b21f85bf501d5}{URIO\_BSIZE}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00158}00158                 .flags = \{.pipe\_bof = 1,.short\_xfer\_ok = 1,.proxy\_buffer = 1,\},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00159}00159                 .callback = \&\mbox{\hyperlink{urio_8c_a81f5f3dc211a0a53a88e8099cb2f6fda}{urio\_read\_callback}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00160}00160         \},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00161}00161 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00162}00162         [\mbox{\hyperlink{urio_8c_aec9b0b3ea0686391adbff4c094e53d0c}{URIO\_T\_WR\_CS}}] = \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00163}00163                 .type = \mbox{\hyperlink{usb_8h_ace49b7adb24ebcb0a0b17110c26aa63a}{UE\_CONTROL}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00164}00164                 .endpoint = 0x00,       \textcolor{comment}{/* Control pipe */}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00165}00165                 .direction = \mbox{\hyperlink{usb_8h_a0b305068483ac39f5d34f848bcb95c11}{UE\_DIR\_ANY}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00166}00166                 .bufsize = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}}),}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00167}00167                 .callback = \&\mbox{\hyperlink{urio_8c_a5f5cc05f8a041de74a6b29d3fb1721fe}{urio\_write\_clear\_stall\_callback}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00168}00168                 .timeout = 1000,        \textcolor{comment}{/* 1 second */}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00169}00169                 .interval = 50, \textcolor{comment}{/* 50ms */}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00170}00170         \},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00171}00171 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00172}00172         [\mbox{\hyperlink{urio_8c_aea8961eb666a57a7e21cae37c9072a0c}{URIO\_T\_RD\_CS}}] = \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00173}00173                 .type = \mbox{\hyperlink{usb_8h_ace49b7adb24ebcb0a0b17110c26aa63a}{UE\_CONTROL}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00174}00174                 .endpoint = 0x00,       \textcolor{comment}{/* Control pipe */}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00175}00175                 .direction = \mbox{\hyperlink{usb_8h_a0b305068483ac39f5d34f848bcb95c11}{UE\_DIR\_ANY}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00176}00176                 .bufsize = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}}),}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00177}00177                 .callback = \&\mbox{\hyperlink{urio_8c_af351f9aa271542b84762327144b7b4f2}{urio\_read\_clear\_stall\_callback}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00178}00178                 .timeout = 1000,        \textcolor{comment}{/* 1 second */}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00179}00179                 .interval = 50, \textcolor{comment}{/* 50ms */}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00180}00180         \},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00181}00181 \};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00182}00182 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00183}\mbox{\hyperlink{urio_8c_a3e745c7934ce0f3c6478a7cf5519719d}{00183}} \textcolor{keyword}{static} devclass\_t \mbox{\hyperlink{urio_8c_a3e745c7934ce0f3c6478a7cf5519719d}{urio\_devclass}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00184}00184 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00185}\mbox{\hyperlink{urio_8c_aee67cb04279d8aa2f5cfbd3fcbf49e39}{00185}} \textcolor{keyword}{static} device\_method\_t \mbox{\hyperlink{urio_8c_aee67cb04279d8aa2f5cfbd3fcbf49e39}{urio\_methods}}[] = \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00186}00186         \textcolor{comment}{/* Device interface */}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00187}00187         DEVMETHOD(device\_probe, \mbox{\hyperlink{urio_8c_a428b78455fe4549703302776c4b8bbc3}{urio\_probe}}),}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00188}00188         DEVMETHOD(device\_attach, \mbox{\hyperlink{urio_8c_ab8afc84052b658bb46a2f8300bb5e52f}{urio\_attach}}),}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00189}00189         DEVMETHOD(device\_detach, \mbox{\hyperlink{urio_8c_aa3c0abb63847acb6e622b7a188720aac}{urio\_detach}}),}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00190}00190 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00191}00191         DEVMETHOD\_END}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00192}00192 \};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00193}00193 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00194}\mbox{\hyperlink{urio_8c_a65dbf40e2d3244d9b5010cd69def42b6}{00194}} \textcolor{keyword}{static} driver\_t \mbox{\hyperlink{urio_8c_a65dbf40e2d3244d9b5010cd69def42b6}{urio\_driver}} = \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00195}00195         .name = \textcolor{stringliteral}{"{}urio"{}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00196}00196         .methods = \mbox{\hyperlink{urio_8c_aee67cb04279d8aa2f5cfbd3fcbf49e39}{urio\_methods}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00197}00197         .size = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structurio__softc}{urio\_softc}}),}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00198}00198 \};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00199}00199 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00200}\mbox{\hyperlink{urio_8c_aa6a610cfe1809dd72bf11d2d40d92cbd}{00200}} \textcolor{keyword}{static} \textcolor{keyword}{const} \mbox{\hyperlink{usbdi_8h_acf836fd8d6349b66a31f45420728da8d}{STRUCT\_USB\_HOST\_ID}} \mbox{\hyperlink{urio_8c_aa6a610cfe1809dd72bf11d2d40d92cbd}{urio\_devs}}[] = \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00201}00201         \{\mbox{\hyperlink{usbdi_8h_acdab3edd999014815e8baeb9b33e9071}{USB\_VPI}}(\mbox{\hyperlink{rio500__usb_8h_a564fcb9164370fdd22c2b8a70976fe76}{USB\_VENDOR\_DIAMOND}}, \mbox{\hyperlink{rio500__usb_8h_a4f957596707af9794eb42e04f0a241f5}{USB\_PRODUCT\_DIAMOND\_RIO500USB}}, 0)\},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00202}00202         \{\mbox{\hyperlink{usbdi_8h_acdab3edd999014815e8baeb9b33e9071}{USB\_VPI}}(USB\_VENDOR\_DIAMOND2, USB\_PRODUCT\_DIAMOND2\_RIO600USB, 0)\},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00203}00203         \{\mbox{\hyperlink{usbdi_8h_acdab3edd999014815e8baeb9b33e9071}{USB\_VPI}}(USB\_VENDOR\_DIAMOND2, USB\_PRODUCT\_DIAMOND2\_RIO800USB, 0)\},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00204}00204 \};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00205}00205 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00206}\mbox{\hyperlink{urio_8c_a14b30939c3f4d8756842d5fb210615d6}{00206}} \mbox{\hyperlink{urio_8c_a14b30939c3f4d8756842d5fb210615d6}{DRIVER\_MODULE}}(urio, uhub, \mbox{\hyperlink{urio_8c_a65dbf40e2d3244d9b5010cd69def42b6}{urio\_driver}}, \mbox{\hyperlink{urio_8c_a3e745c7934ce0f3c6478a7cf5519719d}{urio\_devclass}}, NULL, 0);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00207}\mbox{\hyperlink{urio_8c_adc21db40382305eb10fa24c77cca19de}{00207}} \mbox{\hyperlink{urio_8c_adc21db40382305eb10fa24c77cca19de}{MODULE\_DEPEND}}(urio, \mbox{\hyperlink{usb__if_8m_adfa3f6da9c4881e494b180c4ebb06470}{usb}}, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00208}\mbox{\hyperlink{urio_8c_a62150fd1bc7bfa8f9b4b1e7f0644889a}{00208}} \mbox{\hyperlink{urio_8c_a62150fd1bc7bfa8f9b4b1e7f0644889a}{MODULE\_VERSION}}(urio, 1);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00209}\mbox{\hyperlink{urio_8c_ac9543cb08b48f0539bcd5f4f471b147a}{00209}} \mbox{\hyperlink{urio_8c_ac9543cb08b48f0539bcd5f4f471b147a}{USB\_PNP\_HOST\_INFO}}(\mbox{\hyperlink{urio_8c_aa6a610cfe1809dd72bf11d2d40d92cbd}{urio\_devs}});}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00210}00210 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00211}00211 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00212}\mbox{\hyperlink{urio_8c_a0f916bc7e75cbaf4c9dea1fd1e330c23}{00212}} \mbox{\hyperlink{urio_8c_a428b78455fe4549703302776c4b8bbc3}{urio\_probe}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00213}00213 \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00214}00214         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__attach__arg}{usb\_attach\_arg}} *uaa = device\_get\_ivars(dev);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00215}00215 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00216}00216         \textcolor{keywordflow}{if} (uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a246691e99681281d3113d63e81b7e4f0}{usb\_mode}} != \mbox{\hyperlink{usb_8h_a9bc559812598988121896dceb483806ba1c7091216cfa9c9f4a252b0825ed32cb}{USB\_MODE\_HOST}})}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00217}00217                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00218}00218         \textcolor{keywordflow}{if} (uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a66c2afc71fce73cc432f7d58593e1f26}{info}}.\mbox{\hyperlink{structusbd__lookup__info_a9e2af2c9a58f0df11559c7679185b0e8}{bConfigIndex}} != 0)}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00219}00219                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00220}00220         \textcolor{keywordflow}{if} (uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a66c2afc71fce73cc432f7d58593e1f26}{info}}.\mbox{\hyperlink{structusbd__lookup__info_a50a68740a4c82f1a9b999d4a7994b550}{bIfaceIndex}} != 0)}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00221}00221                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00222}00222 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00223}00223         \textcolor{keywordflow}{return} (\mbox{\hyperlink{usb__lookup_8c_aa691ad42d532498716f358cb1c994fb2}{usbd\_lookup\_id\_by\_uaa}}(\mbox{\hyperlink{urio_8c_aa6a610cfe1809dd72bf11d2d40d92cbd}{urio\_devs}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{urio_8c_aa6a610cfe1809dd72bf11d2d40d92cbd}{urio\_devs}}), uaa));}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00224}00224 \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00225}00225 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00226}00226 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00227}\mbox{\hyperlink{urio_8c_aa65e81db605fcbd5f8bd2492332baecf}{00227}} \mbox{\hyperlink{urio_8c_ab8afc84052b658bb46a2f8300bb5e52f}{urio\_attach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00228}00228 \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00229}00229         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__attach__arg}{usb\_attach\_arg}} *uaa = device\_get\_ivars(dev);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00230}00230         \textcolor{keyword}{struct }\mbox{\hyperlink{structurio__softc}{urio\_softc}} *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00231}00231         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00232}00232 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00233}00233         \mbox{\hyperlink{usb__util_8c_a2f65a197990caa1a69a16691ce4dc66a}{device\_set\_usb\_desc}}(dev);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00234}00234 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00235}00235         sc-\/>\mbox{\hyperlink{structurio__softc_aee03a64d457c42729b9dcddc5c9f9051}{sc\_udev}} = uaa-\/>\mbox{\hyperlink{structusb__attach__arg_ac86557d3eaf77874d436ce38648b0276}{device}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00236}00236 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00237}00237         mtx\_init(\&sc-\/>\mbox{\hyperlink{structurio__softc_a852b1fc22a53ae92178b5f2e17e3d9ec}{sc\_mtx}}, \textcolor{stringliteral}{"{}urio lock"{}}, NULL, MTX\_DEF | MTX\_RECURSE);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00238}00238 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00239}00239         snprintf(sc-\/>\mbox{\hyperlink{structurio__softc_a413aaff81acba0e1883b5be311e1cfcf}{sc\_name}}, \textcolor{keyword}{sizeof}(sc-\/>\mbox{\hyperlink{structurio__softc_a413aaff81acba0e1883b5be311e1cfcf}{sc\_name}}),}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00240}00240             \textcolor{stringliteral}{"{}\%s"{}}, device\_get\_nameunit(dev));}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00241}00241 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00242}00242         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usb__transfer_8c_a7494c04fae5c5e7ef1af436308670a21}{usbd\_transfer\_setup}}(uaa-\/>\mbox{\hyperlink{structusb__attach__arg_ac86557d3eaf77874d436ce38648b0276}{device}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00243}00243             \&uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a66c2afc71fce73cc432f7d58593e1f26}{info}}.\mbox{\hyperlink{structusbd__lookup__info_a50a68740a4c82f1a9b999d4a7994b550}{bIfaceIndex}}, sc-\/>\mbox{\hyperlink{structurio__softc_abfbcf8123dead8de7ae42b7dc2db11d3}{sc\_xfer}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00244}00244             \mbox{\hyperlink{urio_8c_aae33fb936f68641449afc6f0295d7b99}{urio\_config}}, \mbox{\hyperlink{urio_8c_a35c45d62a8f6f9cfe02258005309d17f}{URIO\_T\_MAX}}, sc, \&sc-\/>\mbox{\hyperlink{structurio__softc_a852b1fc22a53ae92178b5f2e17e3d9ec}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00245}00245 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00246}00246         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00247}00247                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}error=\%s\(\backslash\)n"{}}, \mbox{\hyperlink{usb__error_8c_a2391eb446dce3e4368cacf781857774e}{usbd\_errstr}}(\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}));}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00248}00248                 \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00249}00249         \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00250}00250 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00251}00251         \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{structurio__softc_a852b1fc22a53ae92178b5f2e17e3d9ec}{sc\_mtx}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00252}00252             \&\mbox{\hyperlink{urio_8c_ad32ed04749acb17564c2c45521071b09}{urio\_fifo\_methods}}, \&sc-\/>\mbox{\hyperlink{structurio__softc_a5f52d47bf4f851a2c754bc6084f87a14}{sc\_fifo}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00253}00253             device\_get\_unit(dev), -\/1, uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a66c2afc71fce73cc432f7d58593e1f26}{info}}.\mbox{\hyperlink{structusbd__lookup__info_a50a68740a4c82f1a9b999d4a7994b550}{bIfaceIndex}},}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00254}00254             UID\_ROOT, GID\_OPERATOR, 0644);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00255}00255         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00256}00256                 \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00257}00257         \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00258}00258         \textcolor{keywordflow}{return} (0);                     \textcolor{comment}{/* success */}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00259}00259 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00260}00260 detach:}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00261}00261         \mbox{\hyperlink{urio_8c_aa3c0abb63847acb6e622b7a188720aac}{urio\_detach}}(dev);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00262}00262         \textcolor{keywordflow}{return} (ENOMEM);                \textcolor{comment}{/* failure */}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00263}00263 \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00264}00264 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00265}00265 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00266}\mbox{\hyperlink{urio_8c_afdbc824b2047cef588323a1017483679}{00266}} \mbox{\hyperlink{urio_8c_affa8580ccd0dfe563a40a17287fb5997}{urio\_write\_callback}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00267}00267 \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00268}00268         \textcolor{keyword}{struct }\mbox{\hyperlink{structurio__softc}{urio\_softc}} *sc = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(xfer);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00269}00269         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f = sc-\/>\mbox{\hyperlink{structurio__softc_a5f52d47bf4f851a2c754bc6084f87a14}{sc\_fifo}}.\mbox{\hyperlink{structusb__fifo__sc_a58c8d2178de01b2acf563667afa688d8}{fp}}[\mbox{\hyperlink{usbdi_8h_ab42694ba7d2dc0d510f4a139fb8cf5d8}{USB\_FIFO\_TX}}];}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00270}00270         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__cache}{usb\_page\_cache}} *pc;}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00271}00271         uint32\_t actlen;}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00272}00272 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00273}00273         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00274}00274         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00275}00275         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00276}00276                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structurio__softc_a83f75f1337c1de6826106fd42819f04e}{sc\_flags}} \& \mbox{\hyperlink{urio_8c_a056ccf9b160fff4fa92ce55144eb6cec}{URIO\_FLAG\_WRITE\_STALL}}) \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00277}00277                         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(sc-\/>\mbox{\hyperlink{structurio__softc_abfbcf8123dead8de7ae42b7dc2db11d3}{sc\_xfer}}[\mbox{\hyperlink{urio_8c_aec9b0b3ea0686391adbff4c094e53d0c}{URIO\_T\_WR\_CS}}]);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00278}00278                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00279}00279                 \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00280}00280                 pc = \mbox{\hyperlink{usb__transfer_8c_a6e66695b916f0770a259bed959c21555}{usbd\_xfer\_get\_frame}}(xfer, 0);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00281}00281                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{usbdi_8h_a74c7414859dbebc635199a18f73f545d}{usb\_fifo\_get\_data}}(f, pc, 0,}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00282}00282                     \mbox{\hyperlink{usb__transfer_8c_ae34a7cc2f01c6dfb68bca6fd0b72647e}{usbd\_xfer\_max\_len}}(xfer), \&actlen, 0)) \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00283}00283                         \mbox{\hyperlink{usb__transfer_8c_a31786497f0f4222203b1e993d52af753}{usbd\_xfer\_set\_frame\_len}}(xfer, 0, actlen);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00284}00284                         \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(xfer);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00285}00285                 \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00286}00286                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00287}00287 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00288}00288         \textcolor{keywordflow}{default}:                        \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00289}00289                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}}) \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00290}00290                         \textcolor{comment}{/* try to clear stall first */}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00291}00291                         sc-\/>\mbox{\hyperlink{structurio__softc_a83f75f1337c1de6826106fd42819f04e}{sc\_flags}} |= \mbox{\hyperlink{urio_8c_a056ccf9b160fff4fa92ce55144eb6cec}{URIO\_FLAG\_WRITE\_STALL}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00292}00292                         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(sc-\/>\mbox{\hyperlink{structurio__softc_abfbcf8123dead8de7ae42b7dc2db11d3}{sc\_xfer}}[\mbox{\hyperlink{urio_8c_aec9b0b3ea0686391adbff4c094e53d0c}{URIO\_T\_WR\_CS}}]);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00293}00293                 \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00294}00294                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00295}00295         \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00296}00296 \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00297}00297 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00298}00298 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00299}\mbox{\hyperlink{urio_8c_ad06dd1294a86092b46d531725b93e17e}{00299}} \mbox{\hyperlink{urio_8c_a5f5cc05f8a041de74a6b29d3fb1721fe}{urio\_write\_clear\_stall\_callback}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00300}00300 \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00301}00301         \textcolor{keyword}{struct }\mbox{\hyperlink{structurio__softc}{urio\_softc}} *sc = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(xfer);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00302}00302         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer\_other = sc-\/>\mbox{\hyperlink{structurio__softc_abfbcf8123dead8de7ae42b7dc2db11d3}{sc\_xfer}}[\mbox{\hyperlink{urio_8c_a1eec9a9cb3994336eaaf69394611f28b}{URIO\_T\_WR}}];}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00303}00303 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00304}00304         \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__transfer_8c_a4088ac29158c7fdb2c7b466ca3473ab9}{usbd\_clear\_stall\_callback}}(xfer, xfer\_other)) \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00305}00305                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}stall cleared\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00306}00306                 sc-\/>\mbox{\hyperlink{structurio__softc_a83f75f1337c1de6826106fd42819f04e}{sc\_flags}} \&= \string~URIO\_FLAG\_WRITE\_STALL;}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00307}00307                 \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(xfer\_other);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00308}00308         \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00309}00309 \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00310}00310 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00311}00311 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00312}\mbox{\hyperlink{urio_8c_aebef210b8b9d3c37af2025bb581c572c}{00312}} \mbox{\hyperlink{urio_8c_a81f5f3dc211a0a53a88e8099cb2f6fda}{urio\_read\_callback}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00313}00313 \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00314}00314         \textcolor{keyword}{struct }\mbox{\hyperlink{structurio__softc}{urio\_softc}} *sc = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(xfer);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00315}00315         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *f = sc-\/>\mbox{\hyperlink{structurio__softc_a5f52d47bf4f851a2c754bc6084f87a14}{sc\_fifo}}.\mbox{\hyperlink{structusb__fifo__sc_a58c8d2178de01b2acf563667afa688d8}{fp}}[\mbox{\hyperlink{usbdi_8h_aa4759b44daa392a7b438d6fba784f30a}{USB\_FIFO\_RX}}];}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00316}00316         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__cache}{usb\_page\_cache}} *pc;}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00317}00317         \textcolor{keywordtype}{int} actlen;}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00318}00318 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00319}00319         \mbox{\hyperlink{usb__transfer_8c_ac0c68320222f26c2a3eba47b46c47899}{usbd\_xfer\_status}}(xfer, \&actlen, NULL, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00320}00320 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00321}00321         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00322}00322         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00323}00323                 pc = \mbox{\hyperlink{usb__transfer_8c_a6e66695b916f0770a259bed959c21555}{usbd\_xfer\_get\_frame}}(xfer, 0);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00324}00324                 \mbox{\hyperlink{usbdi_8h_a444304a04a6daab49a4d9ee6483f5415}{usb\_fifo\_put\_data}}(f, pc, 0, actlen, 1);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00325}00325 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00326}00326         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00327}00327                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structurio__softc_a83f75f1337c1de6826106fd42819f04e}{sc\_flags}} \& \mbox{\hyperlink{urio_8c_a06cd25d284e7be5ba1a59915f23b1a96}{URIO\_FLAG\_READ\_STALL}}) \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00328}00328                         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(sc-\/>\mbox{\hyperlink{structurio__softc_abfbcf8123dead8de7ae42b7dc2db11d3}{sc\_xfer}}[\mbox{\hyperlink{urio_8c_aea8961eb666a57a7e21cae37c9072a0c}{URIO\_T\_RD\_CS}}]);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00329}00329                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00330}00330                 \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00331}00331                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{usbdi_8h_ae1674780bb74ed9a3bc64923b8515f1f}{usb\_fifo\_put\_bytes\_max}}(f) != 0) \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00332}00332                         \mbox{\hyperlink{usb__transfer_8c_a31786497f0f4222203b1e993d52af753}{usbd\_xfer\_set\_frame\_len}}(xfer, 0, \mbox{\hyperlink{usb__transfer_8c_ae34a7cc2f01c6dfb68bca6fd0b72647e}{usbd\_xfer\_max\_len}}(xfer));}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00333}00333                         \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(xfer);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00334}00334                 \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00335}00335                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00336}00336 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00337}00337         \textcolor{keywordflow}{default}:                        \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00338}00338                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}}) \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00339}00339                         \textcolor{comment}{/* try to clear stall first */}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00340}00340                         sc-\/>\mbox{\hyperlink{structurio__softc_a83f75f1337c1de6826106fd42819f04e}{sc\_flags}} |= \mbox{\hyperlink{urio_8c_a06cd25d284e7be5ba1a59915f23b1a96}{URIO\_FLAG\_READ\_STALL}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00341}00341                         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(sc-\/>\mbox{\hyperlink{structurio__softc_abfbcf8123dead8de7ae42b7dc2db11d3}{sc\_xfer}}[\mbox{\hyperlink{urio_8c_aea8961eb666a57a7e21cae37c9072a0c}{URIO\_T\_RD\_CS}}]);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00342}00342                 \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00343}00343                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00344}00344         \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00345}00345 \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00346}00346 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00347}00347 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00348}\mbox{\hyperlink{urio_8c_a6d949a9de21cf471c2a01a860badf5be}{00348}} \mbox{\hyperlink{urio_8c_af351f9aa271542b84762327144b7b4f2}{urio\_read\_clear\_stall\_callback}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00349}00349 \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00350}00350         \textcolor{keyword}{struct }\mbox{\hyperlink{structurio__softc}{urio\_softc}} *sc = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(xfer);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00351}00351         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer\_other = sc-\/>\mbox{\hyperlink{structurio__softc_abfbcf8123dead8de7ae42b7dc2db11d3}{sc\_xfer}}[\mbox{\hyperlink{urio_8c_a1af55a5c97c2ccc1d94f69a06f02f6e9}{URIO\_T\_RD}}];}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00352}00352 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00353}00353         \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__transfer_8c_a4088ac29158c7fdb2c7b466ca3473ab9}{usbd\_clear\_stall\_callback}}(xfer, xfer\_other)) \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00354}00354                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}stall cleared\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00355}00355                 sc-\/>\mbox{\hyperlink{structurio__softc_a83f75f1337c1de6826106fd42819f04e}{sc\_flags}} \&= \string~URIO\_FLAG\_READ\_STALL;}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00356}00356                 \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(xfer\_other);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00357}00357         \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00358}00358 \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00359}00359 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00360}00360 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00361}\mbox{\hyperlink{urio_8c_a361e7fd2c5ed448d80434d2205b031f4}{00361}} \mbox{\hyperlink{urio_8c_ae5884fd168d02cbddd544f8ff59dcfd8}{urio\_start\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *fifo)}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00362}00362 \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00363}00363         \textcolor{keyword}{struct }\mbox{\hyperlink{structurio__softc}{urio\_softc}} *sc = \mbox{\hyperlink{usbdi_8h_a1686d97012d48512200abd8ad0d86d1e}{usb\_fifo\_softc}}(fifo);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00364}00364 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00365}00365         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(sc-\/>\mbox{\hyperlink{structurio__softc_abfbcf8123dead8de7ae42b7dc2db11d3}{sc\_xfer}}[\mbox{\hyperlink{urio_8c_a1af55a5c97c2ccc1d94f69a06f02f6e9}{URIO\_T\_RD}}]);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00366}00366 \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00367}00367 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00368}00368 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00369}\mbox{\hyperlink{urio_8c_a217baa622a5042f20b3dedc579160d7c}{00369}} \mbox{\hyperlink{urio_8c_a56c344e8b1c6e2786ff31fbdf9e9ed39}{urio\_stop\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *fifo)}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00370}00370 \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00371}00371         \textcolor{keyword}{struct }\mbox{\hyperlink{structurio__softc}{urio\_softc}} *sc = \mbox{\hyperlink{usbdi_8h_a1686d97012d48512200abd8ad0d86d1e}{usb\_fifo\_softc}}(fifo);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00372}00372 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00373}00373         \mbox{\hyperlink{usb__transfer_8c_abe245d973df0cfd6fb96b884d33ebce3}{usbd\_transfer\_stop}}(sc-\/>\mbox{\hyperlink{structurio__softc_abfbcf8123dead8de7ae42b7dc2db11d3}{sc\_xfer}}[\mbox{\hyperlink{urio_8c_aea8961eb666a57a7e21cae37c9072a0c}{URIO\_T\_RD\_CS}}]);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00374}00374         \mbox{\hyperlink{usb__transfer_8c_abe245d973df0cfd6fb96b884d33ebce3}{usbd\_transfer\_stop}}(sc-\/>\mbox{\hyperlink{structurio__softc_abfbcf8123dead8de7ae42b7dc2db11d3}{sc\_xfer}}[\mbox{\hyperlink{urio_8c_a1af55a5c97c2ccc1d94f69a06f02f6e9}{URIO\_T\_RD}}]);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00375}00375 \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00376}00376 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00377}00377 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00378}\mbox{\hyperlink{urio_8c_ac75cccf49ddeaa205aa7a1064fab3c22}{00378}} \mbox{\hyperlink{urio_8c_a0782787cc97e759ee937ecced62b6801}{urio\_start\_write}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *fifo)}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00379}00379 \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00380}00380         \textcolor{keyword}{struct }\mbox{\hyperlink{structurio__softc}{urio\_softc}} *sc = \mbox{\hyperlink{usbdi_8h_a1686d97012d48512200abd8ad0d86d1e}{usb\_fifo\_softc}}(fifo);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00381}00381 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00382}00382         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(sc-\/>\mbox{\hyperlink{structurio__softc_abfbcf8123dead8de7ae42b7dc2db11d3}{sc\_xfer}}[\mbox{\hyperlink{urio_8c_a1eec9a9cb3994336eaaf69394611f28b}{URIO\_T\_WR}}]);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00383}00383 \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00384}00384 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00385}00385 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00386}\mbox{\hyperlink{urio_8c_ad6e8145571f4b8c795cef9dd29bbf34e}{00386}} \mbox{\hyperlink{urio_8c_ab1546314db30929e996f8122eab6a508}{urio\_stop\_write}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *fifo)}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00387}00387 \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00388}00388         \textcolor{keyword}{struct }\mbox{\hyperlink{structurio__softc}{urio\_softc}} *sc = \mbox{\hyperlink{usbdi_8h_a1686d97012d48512200abd8ad0d86d1e}{usb\_fifo\_softc}}(fifo);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00389}00389 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00390}00390         \mbox{\hyperlink{usb__transfer_8c_abe245d973df0cfd6fb96b884d33ebce3}{usbd\_transfer\_stop}}(sc-\/>\mbox{\hyperlink{structurio__softc_abfbcf8123dead8de7ae42b7dc2db11d3}{sc\_xfer}}[\mbox{\hyperlink{urio_8c_aec9b0b3ea0686391adbff4c094e53d0c}{URIO\_T\_WR\_CS}}]);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00391}00391         \mbox{\hyperlink{usb__transfer_8c_abe245d973df0cfd6fb96b884d33ebce3}{usbd\_transfer\_stop}}(sc-\/>\mbox{\hyperlink{structurio__softc_abfbcf8123dead8de7ae42b7dc2db11d3}{sc\_xfer}}[\mbox{\hyperlink{urio_8c_a1eec9a9cb3994336eaaf69394611f28b}{URIO\_T\_WR}}]);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00392}00392 \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00393}00393 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00394}00394 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00395}\mbox{\hyperlink{urio_8c_a48a3af217a96b18b5fa6262da2c6b8f5}{00395}} \mbox{\hyperlink{urio_8c_a297e0f658edbba53ed6d758691d9c4b8}{urio\_open}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *fifo, \textcolor{keywordtype}{int} fflags)}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00396}00396 \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00397}00397         \textcolor{keyword}{struct }\mbox{\hyperlink{structurio__softc}{urio\_softc}} *sc = \mbox{\hyperlink{usbdi_8h_a1686d97012d48512200abd8ad0d86d1e}{usb\_fifo\_softc}}(fifo);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00398}00398 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00399}00399         \textcolor{keywordflow}{if} (fflags \& FREAD) \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00400}00400                 \textcolor{comment}{/* clear stall first */}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00401}00401                 mtx\_lock(\&sc-\/>\mbox{\hyperlink{structurio__softc_a852b1fc22a53ae92178b5f2e17e3d9ec}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00402}00402                 sc-\/>\mbox{\hyperlink{structurio__softc_a83f75f1337c1de6826106fd42819f04e}{sc\_flags}} |= \mbox{\hyperlink{urio_8c_a06cd25d284e7be5ba1a59915f23b1a96}{URIO\_FLAG\_READ\_STALL}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00403}00403                 mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structurio__softc_a852b1fc22a53ae92178b5f2e17e3d9ec}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00404}00404 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00405}00405                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{usbdi_8h_a05da54c8f6953ece429c6bb534ef9677}{usb\_fifo\_alloc\_buffer}}(fifo,}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00406}00406                     \mbox{\hyperlink{usb__transfer_8c_ae34a7cc2f01c6dfb68bca6fd0b72647e}{usbd\_xfer\_max\_len}}(sc-\/>\mbox{\hyperlink{structurio__softc_abfbcf8123dead8de7ae42b7dc2db11d3}{sc\_xfer}}[\mbox{\hyperlink{urio_8c_a1af55a5c97c2ccc1d94f69a06f02f6e9}{URIO\_T\_RD}}]),}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00407}00407                     \mbox{\hyperlink{urio_8c_abc09e4351b41da920882e9d14509c090}{URIO\_IFQ\_MAXLEN}})) \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00408}00408                         \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00409}00409                 \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00410}00410         \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00411}00411         \textcolor{keywordflow}{if} (fflags \& FWRITE) \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00412}00412                 \textcolor{comment}{/* clear stall first */}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00413}00413                 sc-\/>\mbox{\hyperlink{structurio__softc_a83f75f1337c1de6826106fd42819f04e}{sc\_flags}} |= \mbox{\hyperlink{urio_8c_a056ccf9b160fff4fa92ce55144eb6cec}{URIO\_FLAG\_WRITE\_STALL}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00414}00414 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00415}00415                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{usbdi_8h_a05da54c8f6953ece429c6bb534ef9677}{usb\_fifo\_alloc\_buffer}}(fifo,}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00416}00416                     \mbox{\hyperlink{usb__transfer_8c_ae34a7cc2f01c6dfb68bca6fd0b72647e}{usbd\_xfer\_max\_len}}(sc-\/>\mbox{\hyperlink{structurio__softc_abfbcf8123dead8de7ae42b7dc2db11d3}{sc\_xfer}}[\mbox{\hyperlink{urio_8c_a1eec9a9cb3994336eaaf69394611f28b}{URIO\_T\_WR}}]),}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00417}00417                     \mbox{\hyperlink{urio_8c_abc09e4351b41da920882e9d14509c090}{URIO\_IFQ\_MAXLEN}})) \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00418}00418                         \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00419}00419                 \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00420}00420         \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00421}00421         \textcolor{keywordflow}{return} (0);                     \textcolor{comment}{/* success */}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00422}00422 \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00423}00423 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00424}00424 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00425}\mbox{\hyperlink{urio_8c_a06337239432d3c660cb54398ea9b631a}{00425}} \mbox{\hyperlink{urio_8c_aeaf3821fb39a1ef5172773fa7c7bd5a1}{urio\_close}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *fifo, \textcolor{keywordtype}{int} fflags)}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00426}00426 \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00427}00427         \textcolor{keywordflow}{if} (fflags \& (FREAD | FWRITE)) \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00428}00428                 \mbox{\hyperlink{usbdi_8h_a6434b2c65d370a12bdd87cec8863f1ff}{usb\_fifo\_free\_buffer}}(fifo);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00429}00429         \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00430}00430 \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00431}00431 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00432}00432 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00433}\mbox{\hyperlink{urio_8c_a99685490f10eb954bf50f8105d695a0c}{00433}} \mbox{\hyperlink{urio_8c_a57202142be5bcf8355e77c47849ca1e1}{urio\_ioctl}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__fifo}{usb\_fifo}} *fifo, u\_long cmd, \textcolor{keywordtype}{void} *addr,}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00434}00434     \textcolor{keywordtype}{int} fflags)}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00435}00435 \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00436}00436         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__ctl__request}{usb\_ctl\_request}} ur;}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00437}00437         \textcolor{keyword}{struct }\mbox{\hyperlink{structRioCommand}{RioCommand}} *rio\_cmd;}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00438}00438         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00439}00439 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00440}00440         \textcolor{keywordflow}{switch} (cmd) \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00441}00441         \textcolor{keywordflow}{case} \mbox{\hyperlink{rio500__usb_8h_a3188519b0a79d51e2016a0b93503ec1a}{RIO\_RECV\_COMMAND}}:}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00442}00442                 \textcolor{keywordflow}{if} (!(fflags \& FWRITE)) \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00443}00443                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EPERM;}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00444}00444                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00445}00445                 \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00446}00446                 memset(\&ur, 0, \textcolor{keyword}{sizeof}(ur));}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00447}00447                 rio\_cmd = addr;}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00448}00448                 ur.\mbox{\hyperlink{structusb__ctl__request_a5051e39c1f35c2b9b13df649dd7f43fd}{ucr\_request}}.\mbox{\hyperlink{structusb__device__request_ae05af572a2294b6ae4ba3725d1bb3d77}{bmRequestType}} =}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00449}00449                     rio\_cmd-\/>\mbox{\hyperlink{structRioCommand_ae5e689992fa8821265c94e232c47cd03}{requesttype}} | \mbox{\hyperlink{usb_8h_a6da49500e864a3c33c9eed3dd49d3e59}{UT\_READ\_VENDOR\_DEVICE}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00450}00450                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00451}00451 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00452}00452         \textcolor{keywordflow}{case} \mbox{\hyperlink{rio500__usb_8h_a6570fb48e8caa1064e717008a62f5e30}{RIO\_SEND\_COMMAND}}:}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00453}00453                 \textcolor{keywordflow}{if} (!(fflags \& FWRITE)) \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00454}00454                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EPERM;}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00455}00455                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00456}00456                 \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00457}00457                 memset(\&ur, 0, \textcolor{keyword}{sizeof}(ur));}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00458}00458                 rio\_cmd = addr;}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00459}00459                 ur.\mbox{\hyperlink{structusb__ctl__request_a5051e39c1f35c2b9b13df649dd7f43fd}{ucr\_request}}.\mbox{\hyperlink{structusb__device__request_ae05af572a2294b6ae4ba3725d1bb3d77}{bmRequestType}} =}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00460}00460                     rio\_cmd-\/>\mbox{\hyperlink{structRioCommand_ae5e689992fa8821265c94e232c47cd03}{requesttype}} | \mbox{\hyperlink{usb_8h_a6aafebff48631e00449299005c4a858c}{UT\_WRITE\_VENDOR\_DEVICE}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00461}00461                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00462}00462 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00463}00463         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00464}00464                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = EINVAL;}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00465}00465                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00466}00466         \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00467}00467 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00468}00468         DPRINTFN(2, \textcolor{stringliteral}{"{}Sending command\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00469}00469 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00470}00470         \textcolor{comment}{/* Send rio control message */}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00471}00471         ur.\mbox{\hyperlink{structusb__ctl__request_a5051e39c1f35c2b9b13df649dd7f43fd}{ucr\_request}}.\mbox{\hyperlink{structusb__device__request_ad92f1e470033c2396782b6b9f0c52d01}{bRequest}} = rio\_cmd-\/>\mbox{\hyperlink{structRioCommand_a59be4d251ae765364d16c96c0c15ebc1}{request}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00472}00472         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(ur.\mbox{\hyperlink{structusb__ctl__request_a5051e39c1f35c2b9b13df649dd7f43fd}{ucr\_request}}.\mbox{\hyperlink{structusb__device__request_ad0edef8fa7a9c3e311e31ee68e928e50}{wValue}}, rio\_cmd-\/>\mbox{\hyperlink{structRioCommand_a7174f8b60cc96ffb5118abd7c22d531c}{value}});}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00473}00473         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(ur.\mbox{\hyperlink{structusb__ctl__request_a5051e39c1f35c2b9b13df649dd7f43fd}{ucr\_request}}.\mbox{\hyperlink{structusb__device__request_acaec4689077fef056acade5ba134054a}{wIndex}}, rio\_cmd-\/>\mbox{\hyperlink{structRioCommand_a200b1a10769880a550b494376dfaf75b}{index}});}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00474}00474         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(ur.\mbox{\hyperlink{structusb__ctl__request_a5051e39c1f35c2b9b13df649dd7f43fd}{ucr\_request}}.\mbox{\hyperlink{structusb__device__request_a7e802a5b9ac45d07409d82fb12cf959f}{wLength}}, rio\_cmd-\/>\mbox{\hyperlink{structRioCommand_a6a970d08da13ce9a4b6ae46958e25d04}{length}});}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00475}00475         ur.\mbox{\hyperlink{structusb__ctl__request_a3d78f31a3c3c646ff0626bca2795dd95}{ucr\_data}} = rio\_cmd-\/>\mbox{\hyperlink{structRioCommand_a694afb193720100b09dd9b29301f16b7}{buffer}};}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00476}00476 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00477}00477         \textcolor{comment}{/* reuse generic USB code */}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00478}00478         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usb__generic_8h_a9769ea8b5a272e0ec4d638c0f9ada867}{ugen\_do\_request}}(fifo, \&ur);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00479}00479 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00480}00480 done:}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00481}00481         \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00482}00482 \}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00483}00483 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00484}00484 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00485}\mbox{\hyperlink{urio_8c_a982a364f6423024f009d2365aa3357ce}{00485}} \mbox{\hyperlink{urio_8c_aa3c0abb63847acb6e622b7a188720aac}{urio\_detach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00486}00486 \{}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00487}00487         \textcolor{keyword}{struct }\mbox{\hyperlink{structurio__softc}{urio\_softc}} *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00488}00488 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00489}00489         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00490}00490 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00491}00491         \mbox{\hyperlink{usbdi_8h_a383e94e216e88e5dd62e6cfe8888ccf9}{usb\_fifo\_detach}}(\&sc-\/>\mbox{\hyperlink{structurio__softc_a5f52d47bf4f851a2c754bc6084f87a14}{sc\_fifo}});}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00492}00492 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00493}00493         \mbox{\hyperlink{usb__transfer_8c_a2f5ab55bfe7f356bb7a7505ff35c9741}{usbd\_transfer\_unsetup}}(sc-\/>\mbox{\hyperlink{structurio__softc_abfbcf8123dead8de7ae42b7dc2db11d3}{sc\_xfer}}, \mbox{\hyperlink{urio_8c_a35c45d62a8f6f9cfe02258005309d17f}{URIO\_T\_MAX}});}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00494}00494 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00495}00495         mtx\_destroy(\&sc-\/>\mbox{\hyperlink{structurio__softc_a852b1fc22a53ae92178b5f2e17e3d9ec}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00496}00496 }
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00497}00497         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{urio_8c_source_l00498}00498 \}}

\end{DoxyCode}
