\hypertarget{ubser_8c_source}{}\doxysection{ubser.\+c}
\label{ubser_8c_source}\index{dev/usb/serial/ubser.c@{dev/usb/serial/ubser.c}}
\mbox{\hyperlink{ubser_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2004 Bernd Walter <ticso@FreeBSD.org>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00004}00004 \textcolor{comment}{ * \$URL: https://devel.bwct.de/svn/projects/ubser/ubser.c \$}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00005}00005 \textcolor{comment}{ * \$Date: 2004-\/02-\/29 01:53:10 +0100 (Sun, 29 Feb 2004) \$}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00006}00006 \textcolor{comment}{ * \$Author: ticso \$}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00007}00007 \textcolor{comment}{ * \$Rev: 1127 \$}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00008}00008 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00009}00009 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00010}00010 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00011}00011 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD AND BSD-\/2-\/Clause-\/NetBSD}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00012}00012 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00013}00013 \textcolor{comment}{ * Copyright (c) 2001-\/2002, Shunsuke Akiyama <akiyama@jp.FreeBSD.org>.}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00014}00014 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00015}00015 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00016}00016 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00017}00017 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00018}00018 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00019}00019 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00020}00020 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00021}00021 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00022}00022 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00023}00023 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00024}00024 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00025}00025 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00026}00026 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00027}00027 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00028}00028 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00029}00029 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00030}00030 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00031}00031 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00032}00032 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00033}00033 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00034}00034 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00035}00035 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00036}00036 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00037}00037 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00038}00038 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00039}00039 \textcolor{comment}{ * Copyright (c) 2000 The NetBSD Foundation, Inc.}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00040}00040 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00041}00041 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00042}00042 \textcolor{comment}{ * This code is derived from software contributed to The NetBSD Foundation}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00043}00043 \textcolor{comment}{ * by Lennart Augustsson (lennart@augustsson.net).}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00044}00044 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00045}00045 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00046}00046 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00047}00047 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00048}00048 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00049}00049 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00050}00050 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00051}00051 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00052}00052 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00053}00053 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00054}00054 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00055}00055 \textcolor{comment}{ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00056}00056 \textcolor{comment}{ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00057}00057 \textcolor{comment}{ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00058}00058 \textcolor{comment}{ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00059}00059 \textcolor{comment}{ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00060}00060 \textcolor{comment}{ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00061}00061 \textcolor{comment}{ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00062}00062 \textcolor{comment}{ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00063}00063 \textcolor{comment}{ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00064}00064 \textcolor{comment}{ * POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00065}00065 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00066}00066 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00067}00067 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00068}\mbox{\hyperlink{ubser_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00068}} \mbox{\hyperlink{ubser_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00069}00069 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00070}00070 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00071}00071 \textcolor{comment}{ * BWCT serial adapter driver}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00072}00072 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00073}00073 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00074}00074 \textcolor{preprocessor}{\#include <sys/stdint.h>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00075}00075 \textcolor{preprocessor}{\#include <sys/stddef.h>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00076}00076 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00077}00077 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00078}00078 \textcolor{preprocessor}{\#include <sys/types.h>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00079}00079 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00080}00080 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00081}00081 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00082}00082 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00083}00083 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00084}00084 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00085}00085 \textcolor{preprocessor}{\#include <sys/condvar.h>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00086}00086 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00087}00087 \textcolor{preprocessor}{\#include <sys/sx.h>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00088}00088 \textcolor{preprocessor}{\#include <sys/unistd.h>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00089}00089 \textcolor{preprocessor}{\#include <sys/callout.h>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00090}00090 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00091}00091 \textcolor{preprocessor}{\#include <sys/priv.h>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00092}00092 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00093}00093 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb_8h}{dev/usb/usb.h}}>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00094}00094 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usbdi_8h}{dev/usb/usbdi.h}}>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00095}00095 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usbdi__util_8h}{dev/usb/usbdi\_util.h}}>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00096}00096 \textcolor{preprocessor}{\#include "{}usbdevs.h"{}}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00097}00097 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00098}\mbox{\hyperlink{ubser_8c_a927dd6f59caf10a2991dfb564bcbb1e1}{00098}} \textcolor{preprocessor}{\#define USB\_DEBUG\_VAR ubser\_debug}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00099}00099 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__debug_8h}{dev/usb/usb\_debug.h}}>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00100}00100 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__process_8h}{dev/usb/usb\_process.h}}>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00101}00101 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00102}00102 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__serial_8h}{dev/usb/serial/usb\_serial.h}}>}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00103}00103 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00104}\mbox{\hyperlink{ubser_8c_a7df7b15d22568dbae87c600ee858fff9}{00104}} \textcolor{preprocessor}{\#define UBSER\_UNIT\_MAX  32}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00105}00105 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00106}00106 \textcolor{comment}{/* Vendor Interface Requests */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00107}\mbox{\hyperlink{ubser_8c_a0f0aece1e33965151786c93ce155d147}{00107}} \textcolor{preprocessor}{\#define VENDOR\_GET\_NUMSER               0x01}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00108}\mbox{\hyperlink{ubser_8c_a82d34dd8683a4d0d9a9826db03962bdb}{00108}} \textcolor{preprocessor}{\#define VENDOR\_SET\_BREAK                0x02}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00109}\mbox{\hyperlink{ubser_8c_ac5979787f47be010bac95a3bfe86ea6d}{00109}} \textcolor{preprocessor}{\#define VENDOR\_CLEAR\_BREAK              0x03}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00110}00110 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00111}00111 \textcolor{preprocessor}{\#ifdef USB\_DEBUG}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00112}00112 \textcolor{keyword}{static} \textcolor{keywordtype}{int} ubser\_debug = 0;}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00113}00113 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00114}00114 \textcolor{keyword}{static} \mbox{\hyperlink{dwc__otg_8c_a58e125bcf985ce2333baef42f97b33b3}{SYSCTL\_NODE}}(\_hw\_usb, OID\_AUTO, ubser, CTLFLAG\_RW | CTLFLAG\_MPSAFE, 0,}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00115}00115     \textcolor{stringliteral}{"{}USB ubser"{}});}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00116}00116 \mbox{\hyperlink{dwc__otg_8c_a83d020f0b15dc2783f3f1a6966c75e36}{SYSCTL\_INT}}(\_hw\_usb\_ubser, OID\_AUTO, \mbox{\hyperlink{cfumass_8c_ac3e1795766a80ec63b157951b4b9a7d4}{debug}}, CTLFLAG\_RWTUN,}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00117}00117     \&ubser\_debug, 0, \textcolor{stringliteral}{"{}ubser debug level"{}});}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00118}00118 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00119}00119 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00120}00120 \textcolor{keyword}{enum} \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00121}\mbox{\hyperlink{ubser_8c_af715e26dfffd1f8de1c18449e2770cffa42000528f8eb77a08fdaf0d64cdc583b}{00121}}         \mbox{\hyperlink{ubser_8c_af715e26dfffd1f8de1c18449e2770cffa42000528f8eb77a08fdaf0d64cdc583b}{UBSER\_BULK\_DT\_WR}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00122}\mbox{\hyperlink{ubser_8c_af715e26dfffd1f8de1c18449e2770cffaf3fcc0fb50c295d6721305c0858bc8a3}{00122}}         \mbox{\hyperlink{ubser_8c_af715e26dfffd1f8de1c18449e2770cffaf3fcc0fb50c295d6721305c0858bc8a3}{UBSER\_BULK\_DT\_RD}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00123}\mbox{\hyperlink{ubser_8c_af715e26dfffd1f8de1c18449e2770cffa702fa8a9cbf2d31370b325a93fc60264}{00123}}         \mbox{\hyperlink{ubser_8c_af715e26dfffd1f8de1c18449e2770cffa702fa8a9cbf2d31370b325a93fc60264}{UBSER\_N\_TRANSFER}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00124}00124 \};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00125}00125 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00126}\mbox{\hyperlink{structubser__softc}{00126}} \textcolor{keyword}{struct }\mbox{\hyperlink{structubser__softc}{ubser\_softc}} \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00127}\mbox{\hyperlink{structubser__softc_ab0ea62d1992f0fd48f4ab04bea60b1a6}{00127}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structucom__super__softc}{ucom\_super\_softc}} \mbox{\hyperlink{structubser__softc_ab0ea62d1992f0fd48f4ab04bea60b1a6}{sc\_super\_ucom}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00128}\mbox{\hyperlink{structubser__softc_ac73431eb7bec35ec2a9801aaf4636f0d}{00128}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structucom__softc}{ucom\_softc}} \mbox{\hyperlink{structubser__softc_ac73431eb7bec35ec2a9801aaf4636f0d}{sc\_ucom}}[\mbox{\hyperlink{ubser_8c_a7df7b15d22568dbae87c600ee858fff9}{UBSER\_UNIT\_MAX}}];}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00129}00129 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00130}\mbox{\hyperlink{structubser__softc_ae0ec8a8f9c2a5dd9091817286dca2203}{00130}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *\mbox{\hyperlink{structubser__softc_ae0ec8a8f9c2a5dd9091817286dca2203}{sc\_xfer}}[\mbox{\hyperlink{ubser_8c_af715e26dfffd1f8de1c18449e2770cffa702fa8a9cbf2d31370b325a93fc60264}{UBSER\_N\_TRANSFER}}];}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00131}\mbox{\hyperlink{structubser__softc_a3be54dfe59c015a8276c5203537eb618}{00131}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device}{usb\_device}} *\mbox{\hyperlink{structubser__softc_a3be54dfe59c015a8276c5203537eb618}{sc\_udev}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00132}\mbox{\hyperlink{structubser__softc_a79fbadb094641e608f76c1a194b34934}{00132}}         \textcolor{keyword}{struct }mtx \mbox{\hyperlink{structubser__softc_a79fbadb094641e608f76c1a194b34934}{sc\_mtx}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00133}00133 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00134}\mbox{\hyperlink{structubser__softc_a98e332fd9c54187fd576ee5ea16a4000}{00134}}         uint16\_t \mbox{\hyperlink{structubser__softc_a98e332fd9c54187fd576ee5ea16a4000}{sc\_tx\_size}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00135}00135 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00136}\mbox{\hyperlink{structubser__softc_aaedc7496e313f54313057de996c77075}{00136}}         uint8\_t \mbox{\hyperlink{structubser__softc_aaedc7496e313f54313057de996c77075}{sc\_numser}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00137}\mbox{\hyperlink{structubser__softc_a5802406b036d40b38db3a8562320439d}{00137}}         uint8\_t \mbox{\hyperlink{structubser__softc_a5802406b036d40b38db3a8562320439d}{sc\_iface\_no}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00138}\mbox{\hyperlink{structubser__softc_abdb63b7993b909999359a597a6fa7407}{00138}}         uint8\_t \mbox{\hyperlink{structubser__softc_abdb63b7993b909999359a597a6fa7407}{sc\_iface\_index}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00139}\mbox{\hyperlink{structubser__softc_adaa495d5e3c081713c189561044d2470}{00139}}         uint8\_t \mbox{\hyperlink{structubser__softc_adaa495d5e3c081713c189561044d2470}{sc\_curr\_tx\_unit}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00140}00140 \};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00141}00141 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00142}00142 \textcolor{comment}{/* prototypes */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00143}00143 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00144}\mbox{\hyperlink{ubser_8c_a304b49fd69488c5daa43fd67111f6d4c}{00144}} \textcolor{keyword}{static} device\_probe\_t \mbox{\hyperlink{ubser_8c_a304b49fd69488c5daa43fd67111f6d4c}{ubser\_probe}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00145}\mbox{\hyperlink{ubser_8c_accce7ef2eff85390433f71e2bccc31a2}{00145}} \textcolor{keyword}{static} device\_attach\_t \mbox{\hyperlink{ubser_8c_accce7ef2eff85390433f71e2bccc31a2}{ubser\_attach}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00146}\mbox{\hyperlink{ubser_8c_ad2be6a917e5f15bb4bfaaabf54083477}{00146}} \textcolor{keyword}{static} device\_detach\_t \mbox{\hyperlink{ubser_8c_ad2be6a917e5f15bb4bfaaabf54083477}{ubser\_detach}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00147}00147 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{ubser_8c_a4229a21b564f18c0c2bd77b2f6ccbac8}{ubser\_free\_softc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structubser__softc}{ubser\_softc}} *);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00148}00148 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00149}\mbox{\hyperlink{ubser_8c_ad730f9bcb7b5a15efefb1f87b5d9d32c}{00149}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{ubser_8c_ad730f9bcb7b5a15efefb1f87b5d9d32c}{ubser\_write\_callback}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00150}\mbox{\hyperlink{ubser_8c_af6909d0fd802c805443743940caa9a82}{00150}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{ubser_8c_af6909d0fd802c805443743940caa9a82}{ubser\_read\_callback}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00151}00151 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00152}00152 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{ubser_8c_a5e289f29598a640f648cf95086752529}{ubser\_free}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00153}00153 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      \mbox{\hyperlink{ubser_8c_a8093250e1902006da3f9135d13a04d62}{ubser\_pre\_param}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *, \textcolor{keyword}{struct} termios *);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00154}00154 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{ubser_8c_a32ab6ceaaab7b070f1143f2c33281328}{ubser\_cfg\_set\_break}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *, uint8\_t);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00155}00155 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{ubser_8c_a9be34c76e3a9f396013fa02ca79b2ccc}{ubser\_cfg\_get\_status}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *, uint8\_t *,}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00156}00156                     uint8\_t *);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00157}00157 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{ubser_8c_acab0b329b3142dcae9fc6ba8f5fc6a77}{ubser\_start\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00158}00158 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{ubser_8c_a1a4f89d1e342bbd54197599c2330fd55}{ubser\_stop\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00159}00159 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{ubser_8c_a62ff0c5afbc162cc11a3a8c82b0de7e0}{ubser\_start\_write}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00160}00160 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{ubser_8c_a89f931fea27e8f377de04d8a73275afb}{ubser\_stop\_write}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00161}00161 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{ubser_8c_ad8ce61aaa92b9080172d209b657d5fb3}{ubser\_poll}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00162}00162 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00163}\mbox{\hyperlink{ubser_8c_a8ae6122892c22d3eb526b9f6a361aa40}{00163}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__config}{usb\_config}} \mbox{\hyperlink{ubser_8c_a8ae6122892c22d3eb526b9f6a361aa40}{ubser\_config}}[\mbox{\hyperlink{ubser_8c_af715e26dfffd1f8de1c18449e2770cffa702fa8a9cbf2d31370b325a93fc60264}{UBSER\_N\_TRANSFER}}] = \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00164}00164         [\mbox{\hyperlink{ubser_8c_af715e26dfffd1f8de1c18449e2770cffa42000528f8eb77a08fdaf0d64cdc583b}{UBSER\_BULK\_DT\_WR}}] = \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00165}00165                 .\mbox{\hyperlink{structusb__config_a5bd5d569870291a54d9bed8377ed8b10}{type}} = \mbox{\hyperlink{usb_8h_a25240fc009aa67bb7a2b635d2e9401e4}{UE\_BULK}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00166}00166                 .endpoint = \mbox{\hyperlink{usb_8h_a1e8d1f402536e634471569b83f603197}{UE\_ADDR\_ANY}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00167}00167                 .direction = \mbox{\hyperlink{usb_8h_a9a98e1bc9388db2ab5213e9d6496e851}{UE\_DIR\_OUT}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00168}00168                 .bufsize = 0,   \textcolor{comment}{/* use wMaxPacketSize */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00169}00169                 .flags = \{.pipe\_bof = 1,.force\_short\_xfer = 1,\},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00170}00170                 .callback = \&\mbox{\hyperlink{ubser_8c_ad730f9bcb7b5a15efefb1f87b5d9d32c}{ubser\_write\_callback}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00171}00171         \},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00172}00172 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00173}00173         [\mbox{\hyperlink{ubser_8c_af715e26dfffd1f8de1c18449e2770cffaf3fcc0fb50c295d6721305c0858bc8a3}{UBSER\_BULK\_DT\_RD}}] = \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00174}00174                 .type = \mbox{\hyperlink{usb_8h_a25240fc009aa67bb7a2b635d2e9401e4}{UE\_BULK}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00175}00175                 .endpoint = \mbox{\hyperlink{usb_8h_a1e8d1f402536e634471569b83f603197}{UE\_ADDR\_ANY}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00176}00176                 .direction = \mbox{\hyperlink{usb_8h_a72bb077a860132c175c166f344c75893}{UE\_DIR\_IN}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00177}00177                 .bufsize = 0,   \textcolor{comment}{/* use wMaxPacketSize */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00178}00178                 .flags = \{.pipe\_bof = 1,.short\_xfer\_ok = 1,\},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00179}00179                 .callback = \&\mbox{\hyperlink{ubser_8c_af6909d0fd802c805443743940caa9a82}{ubser\_read\_callback}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00180}00180         \},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00181}00181 \};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00182}00182 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00183}\mbox{\hyperlink{ubser_8c_a35b6b8ccf3b0e1bb9b56cbd0d26df1c2}{00183}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structucom__callback}{ucom\_callback}} \mbox{\hyperlink{ubser_8c_a35b6b8ccf3b0e1bb9b56cbd0d26df1c2}{ubser\_callback}} = \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00184}00184         .\mbox{\hyperlink{structucom__callback_a5e3b4fe887dd47bb203c4df13144cc9e}{ucom\_cfg\_set\_break}} = \&\mbox{\hyperlink{ubser_8c_a32ab6ceaaab7b070f1143f2c33281328}{ubser\_cfg\_set\_break}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00185}00185         .ucom\_cfg\_get\_status = \&\mbox{\hyperlink{ubser_8c_a9be34c76e3a9f396013fa02ca79b2ccc}{ubser\_cfg\_get\_status}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00186}00186         .ucom\_pre\_param = \&\mbox{\hyperlink{ubser_8c_a8093250e1902006da3f9135d13a04d62}{ubser\_pre\_param}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00187}00187         .ucom\_start\_read = \&\mbox{\hyperlink{ubser_8c_acab0b329b3142dcae9fc6ba8f5fc6a77}{ubser\_start\_read}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00188}00188         .ucom\_stop\_read = \&\mbox{\hyperlink{ubser_8c_a1a4f89d1e342bbd54197599c2330fd55}{ubser\_stop\_read}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00189}00189         .ucom\_start\_write = \&\mbox{\hyperlink{ubser_8c_a62ff0c5afbc162cc11a3a8c82b0de7e0}{ubser\_start\_write}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00190}00190         .ucom\_stop\_write = \&\mbox{\hyperlink{ubser_8c_a89f931fea27e8f377de04d8a73275afb}{ubser\_stop\_write}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00191}00191         .ucom\_poll = \&\mbox{\hyperlink{ubser_8c_ad8ce61aaa92b9080172d209b657d5fb3}{ubser\_poll}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00192}00192         .ucom\_free = \&\mbox{\hyperlink{ubser_8c_a5e289f29598a640f648cf95086752529}{ubser\_free}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00193}00193 \};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00194}00194 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00195}\mbox{\hyperlink{ubser_8c_a3e8f5d6718137b251fb1be7110a740a0}{00195}} \textcolor{keyword}{static} device\_method\_t \mbox{\hyperlink{ubser_8c_a3e8f5d6718137b251fb1be7110a740a0}{ubser\_methods}}[] = \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00196}00196         DEVMETHOD(device\_probe, \mbox{\hyperlink{ubser_8c_a304b49fd69488c5daa43fd67111f6d4c}{ubser\_probe}}),}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00197}00197         DEVMETHOD(device\_attach, \mbox{\hyperlink{ubser_8c_accce7ef2eff85390433f71e2bccc31a2}{ubser\_attach}}),}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00198}00198         DEVMETHOD(device\_detach, \mbox{\hyperlink{ubser_8c_ad2be6a917e5f15bb4bfaaabf54083477}{ubser\_detach}}),}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00199}00199         DEVMETHOD\_END}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00200}00200 \};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00201}00201 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00202}\mbox{\hyperlink{ubser_8c_adbaf2f02a5276f25285e9f766fab5cd1}{00202}} \textcolor{keyword}{static} devclass\_t \mbox{\hyperlink{ubser_8c_adbaf2f02a5276f25285e9f766fab5cd1}{ubser\_devclass}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00203}00203 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00204}\mbox{\hyperlink{ubser_8c_ae796d5c6482c19079bd04abb2eae39f9}{00204}} \textcolor{keyword}{static} driver\_t \mbox{\hyperlink{ubser_8c_ae796d5c6482c19079bd04abb2eae39f9}{ubser\_driver}} = \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00205}00205         .name = \textcolor{stringliteral}{"{}ubser"{}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00206}00206         .methods = \mbox{\hyperlink{ubser_8c_a3e8f5d6718137b251fb1be7110a740a0}{ubser\_methods}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00207}00207         .size = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structubser__softc}{ubser\_softc}}),}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00208}00208 \};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00209}00209 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00210}\mbox{\hyperlink{ubser_8c_a007abcd6b7ca27cadd98c214cac75d94}{00210}} \mbox{\hyperlink{ubser_8c_a007abcd6b7ca27cadd98c214cac75d94}{DRIVER\_MODULE}}(ubser, uhub, \mbox{\hyperlink{ubser_8c_ae796d5c6482c19079bd04abb2eae39f9}{ubser\_driver}}, \mbox{\hyperlink{ubser_8c_adbaf2f02a5276f25285e9f766fab5cd1}{ubser\_devclass}}, NULL, 0);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00211}\mbox{\hyperlink{ubser_8c_ac51cefbc47dbfcd9bf08dc78898a0389}{00211}} \mbox{\hyperlink{ubser_8c_ac51cefbc47dbfcd9bf08dc78898a0389}{MODULE\_DEPEND}}(ubser, ucom, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00212}\mbox{\hyperlink{ubser_8c_a30dad18c00fd79073ec899bbf38935d3}{00212}} \mbox{\hyperlink{ubser_8c_ac51cefbc47dbfcd9bf08dc78898a0389}{MODULE\_DEPEND}}(ubser, \mbox{\hyperlink{usb__if_8m_adfa3f6da9c4881e494b180c4ebb06470}{usb}}, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00213}\mbox{\hyperlink{ubser_8c_a01b890d8302240b8b28ac9f47eef86d3}{00213}} \mbox{\hyperlink{ubser_8c_a01b890d8302240b8b28ac9f47eef86d3}{MODULE\_VERSION}}(ubser, 1);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00214}00214 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00215}00215 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00216}\mbox{\hyperlink{ubser_8c_a048345dd820d954cf1daae36ac2b79f1}{00216}} \mbox{\hyperlink{ubser_8c_a304b49fd69488c5daa43fd67111f6d4c}{ubser\_probe}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00217}00217 \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00218}00218         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__attach__arg}{usb\_attach\_arg}} *uaa = device\_get\_ivars(dev);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00219}00219 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00220}00220         \textcolor{keywordflow}{if} (uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a246691e99681281d3113d63e81b7e4f0}{usb\_mode}} != \mbox{\hyperlink{usb_8h_a9bc559812598988121896dceb483806ba1c7091216cfa9c9f4a252b0825ed32cb}{USB\_MODE\_HOST}}) \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00221}00221                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00222}00222         \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00223}00223         \textcolor{comment}{/* check if this is a BWCT vendor specific ubser interface */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00224}00224         \textcolor{keywordflow}{if} ((strcmp(\mbox{\hyperlink{usb__device_8c_ae772361c7c976e3bfc4388a07517e233}{usb\_get\_manufacturer}}(uaa-\/>\mbox{\hyperlink{structusb__attach__arg_ac86557d3eaf77874d436ce38648b0276}{device}}), \textcolor{stringliteral}{"{}BWCT"{}}) == 0) \&\&}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00225}00225             (uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a66c2afc71fce73cc432f7d58593e1f26}{info}}.\mbox{\hyperlink{structusbd__lookup__info_ab0d02dc59a6a042d2de8c12708afc8b3}{bInterfaceClass}} == 0xff) \&\&}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00226}00226             (uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a66c2afc71fce73cc432f7d58593e1f26}{info}}.\mbox{\hyperlink{structusbd__lookup__info_aa8ed5421fc671dcbd1fefb09180b604c}{bInterfaceSubClass}} == 0x00))}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00227}00227                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00228}00228 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00229}00229         \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00230}00230 \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00231}00231 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00232}00232 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00233}\mbox{\hyperlink{ubser_8c_a3baa45ec58ec144b6b32471df10bca8d}{00233}} \mbox{\hyperlink{ubser_8c_accce7ef2eff85390433f71e2bccc31a2}{ubser\_attach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00234}00234 \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00235}00235         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__attach__arg}{usb\_attach\_arg}} *uaa = device\_get\_ivars(dev);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00236}00236         \textcolor{keyword}{struct }\mbox{\hyperlink{structubser__softc}{ubser\_softc}} *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00237}00237         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}} \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00238}00238         uint8\_t \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00239}00239         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00240}00240 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00241}00241         \mbox{\hyperlink{usb__util_8c_a2f65a197990caa1a69a16691ce4dc66a}{device\_set\_usb\_desc}}(dev);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00242}00242         mtx\_init(\&sc-\/>\mbox{\hyperlink{structubser__softc_a79fbadb094641e608f76c1a194b34934}{sc\_mtx}}, \textcolor{stringliteral}{"{}ubser"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00243}00243         \mbox{\hyperlink{usb__serial_8c_a3533648e606891c90d0267b21b3ba59e}{ucom\_ref}}(\&sc-\/>\mbox{\hyperlink{structubser__softc_ab0ea62d1992f0fd48f4ab04bea60b1a6}{sc\_super\_ucom}});}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00244}00244 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00245}00245         sc-\/>\mbox{\hyperlink{structubser__softc_a5802406b036d40b38db3a8562320439d}{sc\_iface\_no}} = uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a66c2afc71fce73cc432f7d58593e1f26}{info}}.\mbox{\hyperlink{structusbd__lookup__info_a268433f99f7bfcc278a619418e3c44fa}{bIfaceNum}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00246}00246         sc-\/>\mbox{\hyperlink{structubser__softc_abdb63b7993b909999359a597a6fa7407}{sc\_iface\_index}} = uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a66c2afc71fce73cc432f7d58593e1f26}{info}}.\mbox{\hyperlink{structusbd__lookup__info_a50a68740a4c82f1a9b999d4a7994b550}{bIfaceIndex}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00247}00247         sc-\/>\mbox{\hyperlink{structubser__softc_a3be54dfe59c015a8276c5203537eb618}{sc\_udev}} = uaa-\/>\mbox{\hyperlink{structusb__attach__arg_ac86557d3eaf77874d436ce38648b0276}{device}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00248}00248 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00249}00249         \textcolor{comment}{/* get number of serials */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00250}00250         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bmRequestType = \mbox{\hyperlink{usb_8h_a64932f42cb743ef1af70fe9434f0e71f}{UT\_READ\_VENDOR\_INTERFACE}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00251}00251         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bRequest = \mbox{\hyperlink{ubser_8c_a0f0aece1e33965151786c93ce155d147}{VENDOR\_GET\_NUMSER}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00252}00252         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wValue, 0);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00253}00253         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wIndex[0] = sc-\/>\mbox{\hyperlink{structubser__softc_a5802406b036d40b38db3a8562320439d}{sc\_iface\_no}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00254}00254         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wIndex[1] = 0;}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00255}00255         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wLength, 1);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00256}00256         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usb__request_8c_ae914a46bd63666caf7f4d8c182fa5e71}{usbd\_do\_request\_flags}}(uaa-\/>\mbox{\hyperlink{structusb__attach__arg_ac86557d3eaf77874d436ce38648b0276}{device}}, NULL,}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00257}00257             \&\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}, \&sc-\/>\mbox{\hyperlink{structubser__softc_aaedc7496e313f54313057de996c77075}{sc\_numser}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00258}00258             0, NULL, \mbox{\hyperlink{usbdi_8h_a07bf0b2ba580cae69a6c567c40d64b1c}{USB\_DEFAULT\_TIMEOUT}});}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00259}00259 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00260}00260         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} || (sc-\/>\mbox{\hyperlink{structubser__softc_aaedc7496e313f54313057de996c77075}{sc\_numser}} == 0)) \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00261}00261                 device\_printf(dev, \textcolor{stringliteral}{"{}failed to get number "{}}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00262}00262                     \textcolor{stringliteral}{"{}of serial ports: \%s\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00263}00263                     \mbox{\hyperlink{usb__error_8c_a2391eb446dce3e4368cacf781857774e}{usbd\_errstr}}(\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}));}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00264}00264                 \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00265}00265         \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00266}00266         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structubser__softc_aaedc7496e313f54313057de996c77075}{sc\_numser}} > \mbox{\hyperlink{ubser_8c_a7df7b15d22568dbae87c600ee858fff9}{UBSER\_UNIT\_MAX}})}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00267}00267                 sc-\/>\mbox{\hyperlink{structubser__softc_aaedc7496e313f54313057de996c77075}{sc\_numser}} = \mbox{\hyperlink{ubser_8c_a7df7b15d22568dbae87c600ee858fff9}{UBSER\_UNIT\_MAX}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00268}00268 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00269}00269         device\_printf(dev, \textcolor{stringliteral}{"{}found \%i serials\(\backslash\)n"{}}, sc-\/>\mbox{\hyperlink{structubser__softc_aaedc7496e313f54313057de996c77075}{sc\_numser}});}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00270}00270 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00271}00271         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usb__transfer_8c_a7494c04fae5c5e7ef1af436308670a21}{usbd\_transfer\_setup}}(uaa-\/>\mbox{\hyperlink{structusb__attach__arg_ac86557d3eaf77874d436ce38648b0276}{device}}, \&sc-\/>\mbox{\hyperlink{structubser__softc_abdb63b7993b909999359a597a6fa7407}{sc\_iface\_index}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00272}00272             sc-\/>\mbox{\hyperlink{structubser__softc_ae0ec8a8f9c2a5dd9091817286dca2203}{sc\_xfer}}, \mbox{\hyperlink{ubser_8c_a8ae6122892c22d3eb526b9f6a361aa40}{ubser\_config}}, \mbox{\hyperlink{ubser_8c_af715e26dfffd1f8de1c18449e2770cffa702fa8a9cbf2d31370b325a93fc60264}{UBSER\_N\_TRANSFER}}, sc, \&sc-\/>\mbox{\hyperlink{structubser__softc_a79fbadb094641e608f76c1a194b34934}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00273}00273         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00274}00274                 \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00275}00275         \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00276}00276         sc-\/>\mbox{\hyperlink{structubser__softc_a98e332fd9c54187fd576ee5ea16a4000}{sc\_tx\_size}} = \mbox{\hyperlink{usb__transfer_8c_ae34a7cc2f01c6dfb68bca6fd0b72647e}{usbd\_xfer\_max\_len}}(sc-\/>\mbox{\hyperlink{structubser__softc_ae0ec8a8f9c2a5dd9091817286dca2203}{sc\_xfer}}[\mbox{\hyperlink{ubser_8c_af715e26dfffd1f8de1c18449e2770cffa42000528f8eb77a08fdaf0d64cdc583b}{UBSER\_BULK\_DT\_WR}}]);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00277}00277 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00278}00278         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structubser__softc_a98e332fd9c54187fd576ee5ea16a4000}{sc\_tx\_size}} == 0) \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00279}00279                 DPRINTFN(0, \textcolor{stringliteral}{"{}invalid tx\_size\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00280}00280                 \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00281}00281         \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00282}00282         \textcolor{comment}{/* initialize port numbers */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00283}00283 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00284}00284         \textcolor{keywordflow}{for} (\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} = 0; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} < sc-\/>\mbox{\hyperlink{structubser__softc_aaedc7496e313f54313057de996c77075}{sc\_numser}}; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}++) \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00285}00285                 sc-\/>\mbox{\hyperlink{structubser__softc_ac73431eb7bec35ec2a9801aaf4636f0d}{sc\_ucom}}[\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}].\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}} = \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00286}00286         \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00287}00287 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00288}00288         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usb__serial_8c_a1a14cc63123395507acee783de212d75}{ucom\_attach}}(\&sc-\/>\mbox{\hyperlink{structubser__softc_ab0ea62d1992f0fd48f4ab04bea60b1a6}{sc\_super\_ucom}}, sc-\/>\mbox{\hyperlink{structubser__softc_ac73431eb7bec35ec2a9801aaf4636f0d}{sc\_ucom}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00289}00289             sc-\/>\mbox{\hyperlink{structubser__softc_aaedc7496e313f54313057de996c77075}{sc\_numser}}, sc, \&\mbox{\hyperlink{ubser_8c_a35b6b8ccf3b0e1bb9b56cbd0d26df1c2}{ubser\_callback}}, \&sc-\/>\mbox{\hyperlink{structubser__softc_a79fbadb094641e608f76c1a194b34934}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00290}00290         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00291}00291                 \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00292}00292         \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00293}00293         \mbox{\hyperlink{usb__serial_8c_a5fd441bb430a68061e8c933443f1d14f}{ucom\_set\_pnpinfo\_usb}}(\&sc-\/>\mbox{\hyperlink{structubser__softc_ab0ea62d1992f0fd48f4ab04bea60b1a6}{sc\_super\_ucom}}, dev);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00294}00294 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00295}00295         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structubser__softc_a79fbadb094641e608f76c1a194b34934}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00296}00296         \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(sc-\/>\mbox{\hyperlink{structubser__softc_ae0ec8a8f9c2a5dd9091817286dca2203}{sc\_xfer}}[\mbox{\hyperlink{ubser_8c_af715e26dfffd1f8de1c18449e2770cffa42000528f8eb77a08fdaf0d64cdc583b}{UBSER\_BULK\_DT\_WR}}]);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00297}00297         \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(sc-\/>\mbox{\hyperlink{structubser__softc_ae0ec8a8f9c2a5dd9091817286dca2203}{sc\_xfer}}[\mbox{\hyperlink{ubser_8c_af715e26dfffd1f8de1c18449e2770cffaf3fcc0fb50c295d6721305c0858bc8a3}{UBSER\_BULK\_DT\_RD}}]);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00298}00298         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(sc-\/>\mbox{\hyperlink{structubser__softc_ae0ec8a8f9c2a5dd9091817286dca2203}{sc\_xfer}}[\mbox{\hyperlink{ubser_8c_af715e26dfffd1f8de1c18449e2770cffaf3fcc0fb50c295d6721305c0858bc8a3}{UBSER\_BULK\_DT\_RD}}]);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00299}00299         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structubser__softc_a79fbadb094641e608f76c1a194b34934}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00300}00300 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00301}00301         \textcolor{keywordflow}{return} (0);                     \textcolor{comment}{/* success */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00302}00302 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00303}00303 detach:}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00304}00304         \mbox{\hyperlink{ubser_8c_ad2be6a917e5f15bb4bfaaabf54083477}{ubser\_detach}}(dev);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00305}00305         \textcolor{keywordflow}{return} (ENXIO);                 \textcolor{comment}{/* failure */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00306}00306 \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00307}00307 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00308}00308 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00309}\mbox{\hyperlink{ubser_8c_aaf8f2627ae30678e401909c23f60a271}{00309}} \mbox{\hyperlink{ubser_8c_ad2be6a917e5f15bb4bfaaabf54083477}{ubser\_detach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00310}00310 \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00311}00311         \textcolor{keyword}{struct }\mbox{\hyperlink{structubser__softc}{ubser\_softc}} *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00312}00312 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00313}00313         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00314}00314 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00315}00315         \mbox{\hyperlink{usb__serial_8c_abcceb7ddf05b758da5f3ada77a962ad1}{ucom\_detach}}(\&sc-\/>\mbox{\hyperlink{structubser__softc_ab0ea62d1992f0fd48f4ab04bea60b1a6}{sc\_super\_ucom}}, sc-\/>\mbox{\hyperlink{structubser__softc_ac73431eb7bec35ec2a9801aaf4636f0d}{sc\_ucom}});}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00316}00316         \mbox{\hyperlink{usb__transfer_8c_a2f5ab55bfe7f356bb7a7505ff35c9741}{usbd\_transfer\_unsetup}}(sc-\/>\mbox{\hyperlink{structubser__softc_ae0ec8a8f9c2a5dd9091817286dca2203}{sc\_xfer}}, \mbox{\hyperlink{ubser_8c_af715e26dfffd1f8de1c18449e2770cffa702fa8a9cbf2d31370b325a93fc60264}{UBSER\_N\_TRANSFER}});}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00317}00317 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00318}00318         device\_claim\_softc(dev);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00319}00319 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00320}00320         \mbox{\hyperlink{ubser_8c_a4229a21b564f18c0c2bd77b2f6ccbac8}{ubser\_free\_softc}}(sc);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00321}00321 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00322}00322         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00323}00323 \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00324}00324 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00325}\mbox{\hyperlink{ubser_8c_a9d57aced9d0b756720bae23384beabb8}{00325}} \mbox{\hyperlink{ubser_8c_a9d57aced9d0b756720bae23384beabb8}{UCOM\_UNLOAD\_DRAIN}}(ubser);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00326}00326 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00327}00327 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00328}\mbox{\hyperlink{ubser_8c_a4229a21b564f18c0c2bd77b2f6ccbac8}{00328}} \mbox{\hyperlink{ubser_8c_a4229a21b564f18c0c2bd77b2f6ccbac8}{ubser\_free\_softc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structubser__softc}{ubser\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00329}00329 \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00330}00330         \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__serial_8c_a27ca652272693169923a38646505d083}{ucom\_unref}}(\&sc-\/>\mbox{\hyperlink{structubser__softc_ab0ea62d1992f0fd48f4ab04bea60b1a6}{sc\_super\_ucom}})) \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00331}00331                 mtx\_destroy(\&sc-\/>\mbox{\hyperlink{structubser__softc_a79fbadb094641e608f76c1a194b34934}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00332}00332                 device\_free\_softc(sc);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00333}00333         \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00334}00334 \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00335}00335 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00336}00336 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00337}\mbox{\hyperlink{ubser_8c_a5e289f29598a640f648cf95086752529}{00337}} \mbox{\hyperlink{ubser_8c_a5e289f29598a640f648cf95086752529}{ubser\_free}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom)}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00338}00338 \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00339}00339         \mbox{\hyperlink{ubser_8c_a4229a21b564f18c0c2bd77b2f6ccbac8}{ubser\_free\_softc}}(ucom-\/>\mbox{\hyperlink{structucom__softc_a4ebbc8663d0291bf6e0ffb93cc2dc70e}{sc\_parent}});}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00340}00340 \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00341}00341 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00342}00342 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00343}\mbox{\hyperlink{ubser_8c_a8093250e1902006da3f9135d13a04d62}{00343}} \mbox{\hyperlink{ubser_8c_a8093250e1902006da3f9135d13a04d62}{ubser\_pre\_param}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom, \textcolor{keyword}{struct} termios *t)}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00344}00344 \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00345}00345         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00346}00346 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00347}00347         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00348}00348 \textcolor{comment}{         * The firmware on our devices can only do 8n1@9600bps}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00349}00349 \textcolor{comment}{         * without handshake.}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00350}00350 \textcolor{comment}{         * We refuse to accept other configurations.}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00351}00351 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00352}00352 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00353}00353         \textcolor{comment}{/* ensure 9600bps */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00354}00354         \textcolor{keywordflow}{switch} (t-\/>c\_ospeed) \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00355}00355         \textcolor{keywordflow}{case} 9600:}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00356}00356                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00357}00357         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00358}00358                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00359}00359         \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00360}00360 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00361}00361         \textcolor{comment}{/* 2 stop bits not possible */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00362}00362         \textcolor{keywordflow}{if} (t-\/>c\_cflag \& CSTOPB)}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00363}00363                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00364}00364 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00365}00365         \textcolor{comment}{/* XXX parity handling not possible with current firmware */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00366}00366         \textcolor{keywordflow}{if} (t-\/>c\_cflag \& PARENB)}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00367}00367                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00368}00368 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00369}00369         \textcolor{comment}{/* we can only do 8 data bits */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00370}00370         \textcolor{keywordflow}{switch} (t-\/>c\_cflag \& CSIZE) \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00371}00371         \textcolor{keywordflow}{case} CS8:}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00372}00372                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00373}00373         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00374}00374                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00375}00375         \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00376}00376 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00377}00377         \textcolor{comment}{/* we can't do any kind of hardware handshaking */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00378}00378         \textcolor{keywordflow}{if} ((t-\/>c\_cflag \&}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00379}00379             (CRTS\_IFLOW | CDTR\_IFLOW | CDSR\_OFLOW | CCAR\_OFLOW)) != 0)}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00380}00380                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00381}00381 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00382}00382         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00383}00383 \textcolor{comment}{         * XXX xon/xoff not supported by the firmware!}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00384}00384 \textcolor{comment}{         * This is handled within FreeBSD only and may overflow buffers}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00385}00385 \textcolor{comment}{         * because of delayed reaction due to device buffering.}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00386}00386 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00387}00387 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00388}00388         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00389}00389 \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00390}00390 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00391}00391 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00392}\mbox{\hyperlink{ubser_8c_a5d2fdcdcc2b4763de24f5205b5da310d}{00392}} \mbox{\hyperlink{ubser_8c_a5d2fdcdcc2b4763de24f5205b5da310d}{ubser\_inc\_tx\_unit}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structubser__softc}{ubser\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00393}00393 \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00394}00394         sc-\/>\mbox{\hyperlink{structubser__softc_adaa495d5e3c081713c189561044d2470}{sc\_curr\_tx\_unit}}++;}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00395}00395         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structubser__softc_adaa495d5e3c081713c189561044d2470}{sc\_curr\_tx\_unit}} >= sc-\/>\mbox{\hyperlink{structubser__softc_aaedc7496e313f54313057de996c77075}{sc\_numser}}) \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00396}00396                 sc-\/>\mbox{\hyperlink{structubser__softc_adaa495d5e3c081713c189561044d2470}{sc\_curr\_tx\_unit}} = 0;}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00397}00397         \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00398}00398 \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00399}00399 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00400}00400 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00401}\mbox{\hyperlink{ubser_8c_a12cb344e2c41b10b9f72c798ae972311}{00401}} \mbox{\hyperlink{ubser_8c_ad730f9bcb7b5a15efefb1f87b5d9d32c}{ubser\_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{ubser_8c_source_l00402}00402 \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00403}00403         \textcolor{keyword}{struct }\mbox{\hyperlink{structubser__softc}{ubser\_softc}} *sc = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(xfer);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00404}00404         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__cache}{usb\_page\_cache}} *pc;}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00405}00405         uint8\_t buf[1];}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00406}00406         uint8\_t first\_unit = sc-\/>\mbox{\hyperlink{structubser__softc_adaa495d5e3c081713c189561044d2470}{sc\_curr\_tx\_unit}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00407}00407         uint32\_t actlen;}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00408}00408 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00409}00409         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00410}00410         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00411}00411         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00412}00412 tr\_setup:}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00413}00413                 pc = \mbox{\hyperlink{usb__transfer_8c_a6e66695b916f0770a259bed959c21555}{usbd\_xfer\_get\_frame}}(xfer, 0);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00414}00414                 \textcolor{keywordflow}{do} \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00415}00415                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__serial_8c_a014a131e1bce5fb84d1788e48a69733f}{ucom\_get\_data}}(sc-\/>\mbox{\hyperlink{structubser__softc_ac73431eb7bec35ec2a9801aaf4636f0d}{sc\_ucom}} + sc-\/>\mbox{\hyperlink{structubser__softc_adaa495d5e3c081713c189561044d2470}{sc\_curr\_tx\_unit}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00416}00416                             pc, 1, sc-\/>\mbox{\hyperlink{structubser__softc_a98e332fd9c54187fd576ee5ea16a4000}{sc\_tx\_size}} -\/ 1,}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00417}00417                             \&actlen)) \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00418}00418                                 buf[0] = sc-\/>\mbox{\hyperlink{structubser__softc_adaa495d5e3c081713c189561044d2470}{sc\_curr\_tx\_unit}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00419}00419 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00420}00420                                 \mbox{\hyperlink{usb__busdma_8c_accb7cd85c3477e50c1ba1b1489226d09}{usbd\_copy\_in}}(pc, 0, buf, 1);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00421}00421 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00422}00422                                 \mbox{\hyperlink{usb__transfer_8c_a31786497f0f4222203b1e993d52af753}{usbd\_xfer\_set\_frame\_len}}(xfer, 0, actlen + 1);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00423}00423                                 \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(xfer);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00424}00424 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00425}00425                                 \mbox{\hyperlink{ubser_8c_a5d2fdcdcc2b4763de24f5205b5da310d}{ubser\_inc\_tx\_unit}}(sc); \textcolor{comment}{/* round robin */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00426}00426 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00427}00427                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00428}00428                         \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00429}00429                         \mbox{\hyperlink{ubser_8c_a5d2fdcdcc2b4763de24f5205b5da310d}{ubser\_inc\_tx\_unit}}(sc);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00430}00430 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00431}00431                 \} \textcolor{keywordflow}{while} (sc-\/>\mbox{\hyperlink{structubser__softc_adaa495d5e3c081713c189561044d2470}{sc\_curr\_tx\_unit}} != first\_unit);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00432}00432 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00433}00433                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00434}00434 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00435}00435         \textcolor{keywordflow}{default}:                        \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00436}00436                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}}) \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00437}00437                         \textcolor{comment}{/* try to clear stall first */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00438}00438                         \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(xfer);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00439}00439                         \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00440}00440                 \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00441}00441                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00442}00442         \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00443}00443 \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00444}00444 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00445}00445 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00446}\mbox{\hyperlink{ubser_8c_aecbb5d6c08e100cd24727c6f6327128d}{00446}} \mbox{\hyperlink{ubser_8c_af6909d0fd802c805443743940caa9a82}{ubser\_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{ubser_8c_source_l00447}00447 \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00448}00448         \textcolor{keyword}{struct }\mbox{\hyperlink{structubser__softc}{ubser\_softc}} *sc = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(xfer);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00449}00449         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__cache}{usb\_page\_cache}} *pc;}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00450}00450         uint8\_t buf[1];}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00451}00451         \textcolor{keywordtype}{int} actlen;}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00452}00452 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00453}00453         \mbox{\hyperlink{usb__transfer_8c_ac0c68320222f26c2a3eba47b46c47899}{usbd\_xfer\_status}}(xfer, \&actlen, NULL, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00454}00454 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00455}00455         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00456}00456         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00457}00457                 \textcolor{keywordflow}{if} (actlen < 1) \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00458}00458                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}invalid actlen=0!\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00459}00459                         \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00460}00460                 \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00461}00461                 pc = \mbox{\hyperlink{usb__transfer_8c_a6e66695b916f0770a259bed959c21555}{usbd\_xfer\_get\_frame}}(xfer, 0);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00462}00462                 \mbox{\hyperlink{usb__busdma_8c_af52eece45b7868dbf58386f4c9e4eb9a}{usbd\_copy\_out}}(pc, 0, buf, 1);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00463}00463 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00464}00464                 \textcolor{keywordflow}{if} (buf[0] >= sc-\/>\mbox{\hyperlink{structubser__softc_aaedc7496e313f54313057de996c77075}{sc\_numser}}) \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00465}00465                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}invalid serial number!\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00466}00466                         \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00467}00467                 \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00468}00468                 \mbox{\hyperlink{usb__serial_8c_af96494685ba012ad6a1c2e18b783e185}{ucom\_put\_data}}(sc-\/>\mbox{\hyperlink{structubser__softc_ac73431eb7bec35ec2a9801aaf4636f0d}{sc\_ucom}} + buf[0], pc, 1, actlen -\/ 1);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00469}00469 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00470}00470         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00471}00471 tr\_setup:}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00472}00472                 \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{ubser_8c_source_l00473}00473                 \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(xfer);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00474}00474                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00475}00475 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00476}00476         \textcolor{keywordflow}{default}:                        \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00477}00477                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}}) \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00478}00478                         \textcolor{comment}{/* try to clear stall first */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00479}00479                         \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(xfer);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00480}00480                         \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00481}00481                 \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00482}00482                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00483}00483         \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00484}00484 \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00485}00485 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00486}00486 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00487}\mbox{\hyperlink{ubser_8c_a32ab6ceaaab7b070f1143f2c33281328}{00487}} \mbox{\hyperlink{ubser_8c_a32ab6ceaaab7b070f1143f2c33281328}{ubser\_cfg\_set\_break}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom, uint8\_t onoff)}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00488}00488 \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00489}00489         \textcolor{keyword}{struct }\mbox{\hyperlink{structubser__softc}{ubser\_softc}} *sc = ucom-\/>\mbox{\hyperlink{structucom__softc_a4ebbc8663d0291bf6e0ffb93cc2dc70e}{sc\_parent}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00490}00490         uint8\_t x = ucom-\/>\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00491}00491         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}} \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00492}00492         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err;}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00493}00493 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00494}00494         \textcolor{keywordflow}{if} (onoff) \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00495}00495                 \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bmRequestType = \mbox{\hyperlink{usb_8h_a64932f42cb743ef1af70fe9434f0e71f}{UT\_READ\_VENDOR\_INTERFACE}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00496}00496                 \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bRequest = \mbox{\hyperlink{ubser_8c_a82d34dd8683a4d0d9a9826db03962bdb}{VENDOR\_SET\_BREAK}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00497}00497                 \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wValue[0] = x;}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00498}00498                 \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wValue[1] = 0;}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00499}00499                 \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wIndex[0] = sc-\/>\mbox{\hyperlink{structubser__softc_a5802406b036d40b38db3a8562320439d}{sc\_iface\_no}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00500}00500                 \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wIndex[1] = 0;}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00501}00501                 \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wLength, 0);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00502}00502 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00503}00503                 err = \mbox{\hyperlink{usb__serial_8h_aef1b97ecbf82451d6b353c561648b24f}{ucom\_cfg\_do\_request}}(sc-\/>\mbox{\hyperlink{structubser__softc_a3be54dfe59c015a8276c5203537eb618}{sc\_udev}}, ucom, }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00504}00504                     \&\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}, NULL, 0, 1000);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00505}00505                 \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00506}00506                         DPRINTFN(0, \textcolor{stringliteral}{"{}send break failed, error=\%s\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00507}00507                             \mbox{\hyperlink{usb__error_8c_a2391eb446dce3e4368cacf781857774e}{usbd\_errstr}}(err));}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00508}00508                 \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00509}00509         \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00510}00510 \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00511}00511 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00512}00512 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00513}\mbox{\hyperlink{ubser_8c_a9be34c76e3a9f396013fa02ca79b2ccc}{00513}} \mbox{\hyperlink{ubser_8c_a9be34c76e3a9f396013fa02ca79b2ccc}{ubser\_cfg\_get\_status}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom, uint8\_t *lsr, uint8\_t *msr)}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00514}00514 \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00515}00515         \textcolor{comment}{/* fake status bits */}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00516}00516         *lsr = 0;}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00517}00517         *msr = SER\_DCD;}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00518}00518 \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00519}00519 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00520}00520 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00521}\mbox{\hyperlink{ubser_8c_acab0b329b3142dcae9fc6ba8f5fc6a77}{00521}} \mbox{\hyperlink{ubser_8c_acab0b329b3142dcae9fc6ba8f5fc6a77}{ubser\_start\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom)}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00522}00522 \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00523}00523         \textcolor{keyword}{struct }\mbox{\hyperlink{structubser__softc}{ubser\_softc}} *sc = ucom-\/>\mbox{\hyperlink{structucom__softc_a4ebbc8663d0291bf6e0ffb93cc2dc70e}{sc\_parent}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00524}00524 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00525}00525         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(sc-\/>\mbox{\hyperlink{structubser__softc_ae0ec8a8f9c2a5dd9091817286dca2203}{sc\_xfer}}[\mbox{\hyperlink{ubser_8c_af715e26dfffd1f8de1c18449e2770cffaf3fcc0fb50c295d6721305c0858bc8a3}{UBSER\_BULK\_DT\_RD}}]);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00526}00526 \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00527}00527 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00528}00528 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00529}\mbox{\hyperlink{ubser_8c_a1a4f89d1e342bbd54197599c2330fd55}{00529}} \mbox{\hyperlink{ubser_8c_a1a4f89d1e342bbd54197599c2330fd55}{ubser\_stop\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom)}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00530}00530 \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00531}00531         \textcolor{keyword}{struct }\mbox{\hyperlink{structubser__softc}{ubser\_softc}} *sc = ucom-\/>\mbox{\hyperlink{structucom__softc_a4ebbc8663d0291bf6e0ffb93cc2dc70e}{sc\_parent}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00532}00532 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00533}00533         \mbox{\hyperlink{usb__transfer_8c_abe245d973df0cfd6fb96b884d33ebce3}{usbd\_transfer\_stop}}(sc-\/>\mbox{\hyperlink{structubser__softc_ae0ec8a8f9c2a5dd9091817286dca2203}{sc\_xfer}}[\mbox{\hyperlink{ubser_8c_af715e26dfffd1f8de1c18449e2770cffaf3fcc0fb50c295d6721305c0858bc8a3}{UBSER\_BULK\_DT\_RD}}]);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00534}00534 \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00535}00535 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00536}00536 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00537}\mbox{\hyperlink{ubser_8c_a62ff0c5afbc162cc11a3a8c82b0de7e0}{00537}} \mbox{\hyperlink{ubser_8c_a62ff0c5afbc162cc11a3a8c82b0de7e0}{ubser\_start\_write}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom)}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00538}00538 \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00539}00539         \textcolor{keyword}{struct }\mbox{\hyperlink{structubser__softc}{ubser\_softc}} *sc = ucom-\/>\mbox{\hyperlink{structucom__softc_a4ebbc8663d0291bf6e0ffb93cc2dc70e}{sc\_parent}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00540}00540 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00541}00541         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(sc-\/>\mbox{\hyperlink{structubser__softc_ae0ec8a8f9c2a5dd9091817286dca2203}{sc\_xfer}}[\mbox{\hyperlink{ubser_8c_af715e26dfffd1f8de1c18449e2770cffa42000528f8eb77a08fdaf0d64cdc583b}{UBSER\_BULK\_DT\_WR}}]);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00542}00542 \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00543}00543 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00544}00544 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00545}\mbox{\hyperlink{ubser_8c_a89f931fea27e8f377de04d8a73275afb}{00545}} \mbox{\hyperlink{ubser_8c_a89f931fea27e8f377de04d8a73275afb}{ubser\_stop\_write}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom)}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00546}00546 \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00547}00547         \textcolor{keyword}{struct }\mbox{\hyperlink{structubser__softc}{ubser\_softc}} *sc = ucom-\/>\mbox{\hyperlink{structucom__softc_a4ebbc8663d0291bf6e0ffb93cc2dc70e}{sc\_parent}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00548}00548 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00549}00549         \mbox{\hyperlink{usb__transfer_8c_abe245d973df0cfd6fb96b884d33ebce3}{usbd\_transfer\_stop}}(sc-\/>\mbox{\hyperlink{structubser__softc_ae0ec8a8f9c2a5dd9091817286dca2203}{sc\_xfer}}[\mbox{\hyperlink{ubser_8c_af715e26dfffd1f8de1c18449e2770cffa42000528f8eb77a08fdaf0d64cdc583b}{UBSER\_BULK\_DT\_WR}}]);}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00550}00550 \}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00551}00551 }
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00552}00552 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00553}\mbox{\hyperlink{ubser_8c_ad8ce61aaa92b9080172d209b657d5fb3}{00553}} \mbox{\hyperlink{ubser_8c_ad8ce61aaa92b9080172d209b657d5fb3}{ubser\_poll}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom)}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00554}00554 \{}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00555}00555         \textcolor{keyword}{struct }\mbox{\hyperlink{structubser__softc}{ubser\_softc}} *sc = ucom-\/>\mbox{\hyperlink{structucom__softc_a4ebbc8663d0291bf6e0ffb93cc2dc70e}{sc\_parent}};}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00556}00556         \mbox{\hyperlink{usb__transfer_8c_ab2036eadf83fca25cf0d8cdec16d7227}{usbd\_transfer\_poll}}(sc-\/>\mbox{\hyperlink{structubser__softc_ae0ec8a8f9c2a5dd9091817286dca2203}{sc\_xfer}}, \mbox{\hyperlink{ubser_8c_af715e26dfffd1f8de1c18449e2770cffa702fa8a9cbf2d31370b325a93fc60264}{UBSER\_N\_TRANSFER}});}
\DoxyCodeLine{\Hypertarget{ubser_8c_source_l00557}00557 \}}

\end{DoxyCode}
