\hypertarget{umcs_8c_source}{}\doxysection{umcs.\+c}
\label{umcs_8c_source}\index{dev/usb/serial/umcs.c@{dev/usb/serial/umcs.c}}
\mbox{\hyperlink{umcs_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2010 Lev Serebryakov <lev@FreeBSD.org>.}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00005}00005 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00007}00007 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00008}00008 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00009}00009 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00010}00010 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00011}00011 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00012}00012 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00013}00013 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00014}00014 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00015}00015 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00016}00016 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00017}00017 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00018}00018 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00019}00019 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00020}00020 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00021}00021 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00022}00022 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00023}00023 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00024}00024 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00025}00025 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00026}00026 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00027}00027 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00028}00028 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00029}00029 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00030}00030 \textcolor{comment}{ * This driver supports several multiport USB-\/to-\/RS232 serial adapters driven}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00031}00031 \textcolor{comment}{ * by MosChip mos7820 and mos7840, bridge chips.}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00032}00032 \textcolor{comment}{ * The adapters are sold under many different brand names.}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00033}00033 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00034}00034 \textcolor{comment}{ * Datasheets are available at MosChip www site at}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00035}00035 \textcolor{comment}{ * http://www.moschip.com.  The datasheets don't contain full}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00036}00036 \textcolor{comment}{ * programming information for the chip.}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00037}00037 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00038}00038 \textcolor{comment}{ * It is nornal to have only two enabled ports in devices, based on}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00039}00039 \textcolor{comment}{ * quad-\/port mos7840.}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00040}00040 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00041}00041 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00043}\mbox{\hyperlink{umcs_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00043}} \mbox{\hyperlink{umcs_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00044}00044 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <sys/stdint.h>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <sys/stddef.h>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <sys/types.h>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00052}00052 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <sys/linker\_set.h>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00054}00054 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00055}00055 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00056}00056 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00057}00057 \textcolor{preprocessor}{\#include <sys/condvar.h>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00058}00058 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00059}00059 \textcolor{preprocessor}{\#include <sys/sx.h>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00060}00060 \textcolor{preprocessor}{\#include <sys/unistd.h>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00061}00061 \textcolor{preprocessor}{\#include <sys/callout.h>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00062}00062 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00063}00063 \textcolor{preprocessor}{\#include <sys/priv.h>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00064}00064 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00065}00065 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb_8h}{dev/usb/usb.h}}>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00066}00066 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usbdi_8h}{dev/usb/usbdi.h}}>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00067}00067 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usbdi__util_8h}{dev/usb/usbdi\_util.h}}>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00068}00068 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__cdc_8h}{dev/usb/usb\_cdc.h}}>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00069}00069 \textcolor{preprocessor}{\#include "{}usbdevs.h"{}}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00070}00070 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00071}\mbox{\hyperlink{umcs_8c_a927dd6f59caf10a2991dfb564bcbb1e1}{00071}} \textcolor{preprocessor}{\#define USB\_DEBUG\_VAR umcs\_debug}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00072}00072 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__debug_8h}{dev/usb/usb\_debug.h}}>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00073}00073 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__process_8h}{dev/usb/usb\_process.h}}>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00074}00074 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00075}00075 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__serial_8h}{dev/usb/serial/usb\_serial.h}}>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00076}00076 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00077}00077 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{umcs_8h}{dev/usb/serial/umcs.h}}>}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00078}00078 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00079}\mbox{\hyperlink{umcs_8c_ae9ff9f3559f56643b95e4b421f22dd0f}{00079}} \textcolor{preprocessor}{\#define UMCS7840\_MODVER 1}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00080}00080 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00081}00081 \textcolor{preprocessor}{\#ifdef USB\_DEBUG}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00082}00082 \textcolor{keyword}{static} \textcolor{keywordtype}{int} umcs\_debug = 0;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00083}00083 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00084}00084 \textcolor{keyword}{static} \mbox{\hyperlink{dwc__otg_8c_a58e125bcf985ce2333baef42f97b33b3}{SYSCTL\_NODE}}(\_hw\_usb, OID\_AUTO, umcs, CTLFLAG\_RW | CTLFLAG\_MPSAFE, 0,}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00085}00085     \textcolor{stringliteral}{"{}USB umcs quadport serial adapter"{}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00086}00086 \mbox{\hyperlink{dwc__otg_8c_a83d020f0b15dc2783f3f1a6966c75e36}{SYSCTL\_INT}}(\_hw\_usb\_umcs, OID\_AUTO, \mbox{\hyperlink{cfumass_8c_ac3e1795766a80ec63b157951b4b9a7d4}{debug}}, CTLFLAG\_RWTUN, \&umcs\_debug, 0, \textcolor{stringliteral}{"{}Debug level"{}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00087}00087 \textcolor{preprocessor}{\#endif                                  }\textcolor{comment}{/* USB\_DEBUG */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00088}00088 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00089}00089 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00090}00090 \textcolor{comment}{ * Two-\/port devices (both with 7820 chip and 7840 chip configured as two-\/port)}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00091}00091 \textcolor{comment}{ * have ports 0 and 2, with ports 1 and 3 omitted.}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00092}00092 \textcolor{comment}{ * So,PHYSICAL port numbers (indexes) on two-\/port device will be 0 and 2.}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00093}00093 \textcolor{comment}{ * This driver trys to use physical numbers as much as possible.}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00094}00094 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00095}00095 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00096}00096 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00097}00097 \textcolor{comment}{ * Indexed by PHYSICAL port number.}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00098}00098 \textcolor{comment}{ * Pack non-\/regular registers to array to easier if-\/less access.}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00099}00099 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00100}\mbox{\hyperlink{structumcs7840__port__registers}{00100}} \textcolor{keyword}{struct }\mbox{\hyperlink{structumcs7840__port__registers}{umcs7840\_port\_registers}} \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00101}\mbox{\hyperlink{structumcs7840__port__registers_ae79a8cf23a78c4e4c1a1555b589a85bb}{00101}}         uint8\_t \mbox{\hyperlink{structumcs7840__port__registers_ae79a8cf23a78c4e4c1a1555b589a85bb}{reg\_sp}};                   \textcolor{comment}{/* SP register. */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00102}\mbox{\hyperlink{structumcs7840__port__registers_a136599778033c9a302c17adbc079288a}{00102}}         uint8\_t \mbox{\hyperlink{structumcs7840__port__registers_a136599778033c9a302c17adbc079288a}{reg\_control}};         \textcolor{comment}{/* CONTROL register. */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00103}\mbox{\hyperlink{structumcs7840__port__registers_a9c55bd913a1ff4eca1f0d81285931a45}{00103}}         uint8\_t \mbox{\hyperlink{structumcs7840__port__registers_a9c55bd913a1ff4eca1f0d81285931a45}{reg\_dcr}};         \textcolor{comment}{/* DCR0 register. DCR1 \& DCR2 can be}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00104}00104 \textcolor{comment}{                                         * calculated */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00105}00105 \};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00106}00106 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00107}\mbox{\hyperlink{umcs_8c_af2ce1a7e503d91e913aa37f0cc54512d}{00107}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structumcs7840__port__registers}{umcs7840\_port\_registers}} \mbox{\hyperlink{structumcs7840__port__registers}{umcs7840\_port\_registers}}[\mbox{\hyperlink{umcs_8h_a1892069b9f69847296a48206ef26ae3e}{UMCS7840\_MAX\_PORTS}}] = \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00108}00108         \{.\mbox{\hyperlink{structumcs7840__port__registers_ae79a8cf23a78c4e4c1a1555b589a85bb}{reg\_sp}} = \mbox{\hyperlink{umcs_8h_add6351bf9cb11bd359499111dc0072bc}{MCS7840\_DEV\_REG\_SP1}},.reg\_control = \mbox{\hyperlink{umcs_8h_a2583f5ee288406cc9cd9188edc4080d4}{MCS7840\_DEV\_REG\_CONTROL1}},.reg\_dcr = \mbox{\hyperlink{umcs_8h_adcbe5db2666f522cf3bb2b276549bd84}{MCS7840\_DEV\_REG\_DCR0\_1}}\},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00109}00109         \{.reg\_sp = \mbox{\hyperlink{umcs_8h_a0c1e3ace988a9da694b2a5d4c287bf86}{MCS7840\_DEV\_REG\_SP2}},.reg\_control = \mbox{\hyperlink{umcs_8h_a1a7e8e54063986183655b2b9473d38d3}{MCS7840\_DEV\_REG\_CONTROL2}},.reg\_dcr = \mbox{\hyperlink{umcs_8h_ad04a24f60c1dd52e28705c09b85ba186}{MCS7840\_DEV\_REG\_DCR0\_2}}\},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00110}00110         \{.reg\_sp = \mbox{\hyperlink{umcs_8h_a720d07429ca025f680237ab2068e95a8}{MCS7840\_DEV\_REG\_SP3}},.reg\_control = \mbox{\hyperlink{umcs_8h_aae5bebaf7c26c93a314462ee8d317fdb}{MCS7840\_DEV\_REG\_CONTROL3}},.reg\_dcr = \mbox{\hyperlink{umcs_8h_afe3542bee0ca08c4153e015cb4cb6d13}{MCS7840\_DEV\_REG\_DCR0\_3}}\},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00111}00111         \{.reg\_sp = \mbox{\hyperlink{umcs_8h_ae6abb12c2ece41a3a3aae664dbd35701}{MCS7840\_DEV\_REG\_SP4}},.reg\_control = \mbox{\hyperlink{umcs_8h_a787640be0fa5fbb5a1e7868d61053469}{MCS7840\_DEV\_REG\_CONTROL4}},.reg\_dcr = \mbox{\hyperlink{umcs_8h_ac4a63fa2d9dddc6742d0c175ae4aa2fb}{MCS7840\_DEV\_REG\_DCR0\_4}}\},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00112}00112 \};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00113}00113 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00114}00114 \textcolor{keyword}{enum} \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00115}\mbox{\hyperlink{umcs_8c_a56a0f36da7f9eaaf54bd05cc2bf49173ad56340ed3e7c990aac55cf90a7d3c967}{00115}}         \mbox{\hyperlink{umcs_8c_a56a0f36da7f9eaaf54bd05cc2bf49173ad56340ed3e7c990aac55cf90a7d3c967}{UMCS7840\_BULK\_RD\_EP}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00116}\mbox{\hyperlink{umcs_8c_a56a0f36da7f9eaaf54bd05cc2bf49173a15f948939aac39bf7984b708a90636a9}{00116}}         \mbox{\hyperlink{umcs_8c_a56a0f36da7f9eaaf54bd05cc2bf49173a15f948939aac39bf7984b708a90636a9}{UMCS7840\_BULK\_WR\_EP}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00117}00117         \mbox{\hyperlink{umcs_8c_a56a0f36da7f9eaaf54bd05cc2bf49173aa450eb75b378095c6b1e670d92978927}{UMCS7840\_N\_TRANSFERS}}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00118}\mbox{\hyperlink{umcs_8c_a56a0f36da7f9eaaf54bd05cc2bf49173aa450eb75b378095c6b1e670d92978927}{00118}} \};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00119}00119 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00120}\mbox{\hyperlink{structumcs7840__softc__oneport}{00120}} \textcolor{keyword}{struct }\mbox{\hyperlink{structumcs7840__softc__oneport}{umcs7840\_softc\_oneport}} \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00121}\mbox{\hyperlink{structumcs7840__softc__oneport_a94ccfca49162ec16bb100ea81b43ff7b}{00121}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *\mbox{\hyperlink{structumcs7840__softc__oneport_a94ccfca49162ec16bb100ea81b43ff7b}{sc\_xfer}}[\mbox{\hyperlink{umcs_8c_a56a0f36da7f9eaaf54bd05cc2bf49173aa450eb75b378095c6b1e670d92978927}{UMCS7840\_N\_TRANSFERS}}];      \textcolor{comment}{/* Control structures}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00122}00122 \textcolor{comment}{                                                         * for two transfers */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00123}00123 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00124}\mbox{\hyperlink{structumcs7840__softc__oneport_ac7995722c7aab73779e1d47382b30cae}{00124}}         uint8\_t \mbox{\hyperlink{structumcs7840__softc__oneport_ac7995722c7aab73779e1d47382b30cae}{sc\_lcr}};                   \textcolor{comment}{/* local line control register */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00125}\mbox{\hyperlink{structumcs7840__softc__oneport_adc792df8b3d18fd6afb8ce667f8ef150}{00125}}         uint8\_t \mbox{\hyperlink{structumcs7840__softc__oneport_adc792df8b3d18fd6afb8ce667f8ef150}{sc\_mcr}};                   \textcolor{comment}{/* local modem control register */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00126}00126 \};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00127}00127 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00128}\mbox{\hyperlink{structumcs7840__softc}{00128}} \textcolor{keyword}{struct }\mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00129}\mbox{\hyperlink{structumcs7840__softc_a6ed12cefc798a49b57aadc76ef1a00c8}{00129}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structucom__super__softc}{ucom\_super\_softc}} \mbox{\hyperlink{structumcs7840__softc_a6ed12cefc798a49b57aadc76ef1a00c8}{sc\_super\_ucom}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00130}\mbox{\hyperlink{structumcs7840__softc_ae2a30ea71f818995e1d4d99f416547c3}{00130}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structucom__softc}{ucom\_softc}} \mbox{\hyperlink{structumcs7840__softc_ae2a30ea71f818995e1d4d99f416547c3}{sc\_ucom}}[\mbox{\hyperlink{umcs_8h_a1892069b9f69847296a48206ef26ae3e}{UMCS7840\_MAX\_PORTS}}];       \textcolor{comment}{/* Need to be continuous}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00131}00131 \textcolor{comment}{                                                         * array, so indexed by}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00132}00132 \textcolor{comment}{                                                         * LOGICAL port}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00133}00133 \textcolor{comment}{                                                         * (subunit) number */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00134}00134 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00135}\mbox{\hyperlink{structumcs7840__softc_ad6ddde2165d29e8a14c96a39ebd5c15a}{00135}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *\mbox{\hyperlink{structumcs7840__softc_ad6ddde2165d29e8a14c96a39ebd5c15a}{sc\_intr\_xfer}};      \textcolor{comment}{/* Interrupt endpoint */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00136}00136 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00137}\mbox{\hyperlink{structumcs7840__softc_ae8ad9bab5d6ced9a6ce23dcffc070e16}{00137}}         device\_t \mbox{\hyperlink{structumcs7840__softc_ae8ad9bab5d6ced9a6ce23dcffc070e16}{sc\_dev}};          \textcolor{comment}{/* Device for error prints */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00138}\mbox{\hyperlink{structumcs7840__softc_a92ef69845ae252cb0c563899fd98a133}{00138}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device}{usb\_device}} *\mbox{\hyperlink{structumcs7840__softc_a92ef69845ae252cb0c563899fd98a133}{sc\_udev}};    \textcolor{comment}{/* USB Device for all operations */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00139}\mbox{\hyperlink{structumcs7840__softc_a21668f09c9f17827c9472e7d966e8417}{00139}}         \textcolor{keyword}{struct }mtx \mbox{\hyperlink{structumcs7840__softc_a21668f09c9f17827c9472e7d966e8417}{sc\_mtx}};                \textcolor{comment}{/* ucom requires this */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00140}00140 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00141}\mbox{\hyperlink{structumcs7840__softc_a169e8b51b7934034fe3eb1ac4840020b}{00141}}         uint8\_t \mbox{\hyperlink{structumcs7840__softc_a169e8b51b7934034fe3eb1ac4840020b}{sc\_driver\_done}};           \textcolor{comment}{/* Flag when enumeration is finished */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00142}00142 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00143}\mbox{\hyperlink{structumcs7840__softc_ac83526ca4a29ec551c7dc5525c80e02a}{00143}}         uint8\_t \mbox{\hyperlink{structumcs7840__softc_ac83526ca4a29ec551c7dc5525c80e02a}{sc\_numports}};         \textcolor{comment}{/* Number of ports (subunits) */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00144}\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{00144}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structumcs7840__softc__oneport}{umcs7840\_softc\_oneport}} \mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[\mbox{\hyperlink{umcs_8h_a1892069b9f69847296a48206ef26ae3e}{UMCS7840\_MAX\_PORTS}}];     \textcolor{comment}{/* Indexed by PHYSICAL}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00145}00145 \textcolor{comment}{                                                                         * port number. */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00146}00146 \};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00147}00147 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00148}00148 \textcolor{comment}{/* prototypes */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00149}00149 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{umcs_8c_a47f3cdb539f3ab9b8301169f35bdd09b}{umcs7840\_get\_reg\_sync}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *, uint8\_t, uint8\_t *);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00150}00150 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{umcs_8c_a37440031909237a3039fe64250454a48}{umcs7840\_set\_reg\_sync}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *, uint8\_t, uint8\_t);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00151}00151 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{umcs_8c_acab7a382a4e8a3c3516c192d1abcaa9d}{umcs7840\_get\_UART\_reg\_sync}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *, uint8\_t, uint8\_t, uint8\_t *);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00152}00152 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{umcs_8c_a0fd2adae17a52832d013fbe35ddc5176}{umcs7840\_set\_UART\_reg\_sync}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *, uint8\_t, uint8\_t, uint8\_t);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00153}00153 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00154}00154 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{umcs_8c_a4cf19216511eecba82e88b03f5a3103a}{umcs7840\_set\_baudrate}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *, uint8\_t, uint32\_t);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00155}00155 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{umcs_8c_a700e0b79bb2177a82b2b3a35bee836c6}{umcs7840\_calc\_baudrate}}(uint32\_t rate, uint16\_t *, uint8\_t *);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00156}00156 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00157}00157 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{umcs_8c_afaa6a5bd55aecf517ce4f992737696cc}{umcs7840\_free}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00158}00158 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{umcs_8c_ac3064d4d80782fbf9a9760a3ee8f6f24}{umcs7840\_cfg\_get\_status}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *, uint8\_t *, uint8\_t *);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00159}00159 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{umcs_8c_a390e35caecbc8ed8232d186f49c0b184}{umcs7840\_cfg\_set\_dtr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *, uint8\_t);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00160}00160 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{umcs_8c_addb105bbdd46a747e84f630767ce91a7}{umcs7840\_cfg\_set\_rts}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *, uint8\_t);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00161}00161 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{umcs_8c_a23a6877fd3fac6afdb2a02fbfedae21c}{umcs7840\_cfg\_set\_break}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *, uint8\_t);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00162}00162 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{umcs_8c_a68da9073c49232336a005d55d7966750}{umcs7840\_cfg\_param}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *, \textcolor{keyword}{struct} termios *);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00163}00163 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{umcs_8c_a2a9fbdb2df226e95bf6d7e85e230c3a4}{umcs7840\_cfg\_open}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00164}00164 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{umcs_8c_a565d0ea448d1343b8ff5af0e9affce7a}{umcs7840\_cfg\_close}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00165}00165 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00166}00166 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{umcs_8c_a96e3c2a99523df0227f7362e5eabfeef}{umcs7840\_pre\_param}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *, \textcolor{keyword}{struct} termios *);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00167}00167 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00168}00168 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{umcs_8c_aa1685dadd4a746a2847c8a0446012a75}{umcs7840\_start\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00169}00169 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{umcs_8c_a23c9c2c1729f25ec06b8fcb0951cc359}{umcs7840\_stop\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00170}00170 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00171}00171 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{umcs_8c_a7b1e68b61493beb6541bd5905d404b19}{umcs7840\_start\_write}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00172}00172 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{umcs_8c_a9fc45103858bf8a981c024445ef68583}{umcs7840\_stop\_write}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00173}00173 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00174}00174 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{umcs_8c_af98b5eaa5c90131db3be868dafa014fa}{umcs7840\_poll}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00175}00175 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00176}\mbox{\hyperlink{umcs_8c_acbd1e7cb7662825ffacb78ac95bc64fb}{00176}} \textcolor{keyword}{static} device\_probe\_t \mbox{\hyperlink{umcs_8c_acbd1e7cb7662825ffacb78ac95bc64fb}{umcs7840\_probe}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00177}\mbox{\hyperlink{umcs_8c_af7a5653c90480fe16eac1ed96cec4faf}{00177}} \textcolor{keyword}{static} device\_attach\_t \mbox{\hyperlink{umcs_8c_af7a5653c90480fe16eac1ed96cec4faf}{umcs7840\_attach}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00178}\mbox{\hyperlink{umcs_8c_a1a7b1493b07129e9abfc0955b018cfcd}{00178}} \textcolor{keyword}{static} device\_detach\_t \mbox{\hyperlink{umcs_8c_a1a7b1493b07129e9abfc0955b018cfcd}{umcs7840\_detach}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00179}00179 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{umcs_8c_a6562d72fc0ef33771f46caf925d212d0}{umcs7840\_free\_softc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00180}00180 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00181}\mbox{\hyperlink{umcs_8c_a011fde81829903577c80a6321436f015}{00181}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{umcs_8c_a011fde81829903577c80a6321436f015}{umcs7840\_intr\_callback}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00182}\mbox{\hyperlink{umcs_8c_aad823c6585b1ca71693c6f75c8b74f07}{00182}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{umcs_8c_aad823c6585b1ca71693c6f75c8b74f07}{umcs7840\_read\_callback1}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00183}\mbox{\hyperlink{umcs_8c_a738850a59bbe13cda17b4b3433414f4b}{00183}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{umcs_8c_a738850a59bbe13cda17b4b3433414f4b}{umcs7840\_read\_callback2}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00184}\mbox{\hyperlink{umcs_8c_a8ca636d414d66054b044dc77686ea2f3}{00184}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{umcs_8c_a8ca636d414d66054b044dc77686ea2f3}{umcs7840\_read\_callback3}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00185}\mbox{\hyperlink{umcs_8c_ac6fe0651c8bb488ebdbb8031285f00a3}{00185}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{umcs_8c_ac6fe0651c8bb488ebdbb8031285f00a3}{umcs7840\_read\_callback4}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00186}\mbox{\hyperlink{umcs_8c_a21c4074f3171b295a45267671c90adee}{00186}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{umcs_8c_a21c4074f3171b295a45267671c90adee}{umcs7840\_write\_callback1}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00187}\mbox{\hyperlink{umcs_8c_aa9bc65fdbf0e81142ac59b7c8793788d}{00187}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{umcs_8c_aa9bc65fdbf0e81142ac59b7c8793788d}{umcs7840\_write\_callback2}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00188}\mbox{\hyperlink{umcs_8c_a2a827b20905c56bba68b26c32663e723}{00188}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{umcs_8c_a2a827b20905c56bba68b26c32663e723}{umcs7840\_write\_callback3}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00189}\mbox{\hyperlink{umcs_8c_a89b95854766e8631efd2bf003c3ca160}{00189}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{umcs_8c_a89b95854766e8631efd2bf003c3ca160}{umcs7840\_write\_callback4}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00190}00190 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00191}00191 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{umcs_8c_a02dd467d3550c60b752b3bcd3b16be20}{umcs7840\_read\_callbackN}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}, uint8\_t);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00192}00192 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{umcs_8c_aaa0f97d7d92cfe9c767e62aaabe40f73}{umcs7840\_write\_callbackN}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}, uint8\_t);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00193}00193 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00194}00194 \textcolor{comment}{/* Indexed by LOGICAL port number (subunit), so two-\/port device uses 0 \& 1 */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00195}\mbox{\hyperlink{umcs_8c_a98df4f545592f06bf742ed9a318f1879}{00195}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} *\mbox{\hyperlink{umcs_8c_a98df4f545592f06bf742ed9a318f1879}{umcs7840\_rw\_callbacks}}[\mbox{\hyperlink{umcs_8h_a1892069b9f69847296a48206ef26ae3e}{UMCS7840\_MAX\_PORTS}}][\mbox{\hyperlink{umcs_8c_a56a0f36da7f9eaaf54bd05cc2bf49173aa450eb75b378095c6b1e670d92978927}{UMCS7840\_N\_TRANSFERS}}] = \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00196}00196         \{\&\mbox{\hyperlink{umcs_8c_aad823c6585b1ca71693c6f75c8b74f07}{umcs7840\_read\_callback1}}, \&\mbox{\hyperlink{umcs_8c_a21c4074f3171b295a45267671c90adee}{umcs7840\_write\_callback1}}\},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00197}00197         \{\&\mbox{\hyperlink{umcs_8c_a738850a59bbe13cda17b4b3433414f4b}{umcs7840\_read\_callback2}}, \&\mbox{\hyperlink{umcs_8c_aa9bc65fdbf0e81142ac59b7c8793788d}{umcs7840\_write\_callback2}}\},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00198}00198         \{\&\mbox{\hyperlink{umcs_8c_a8ca636d414d66054b044dc77686ea2f3}{umcs7840\_read\_callback3}}, \&\mbox{\hyperlink{umcs_8c_a2a827b20905c56bba68b26c32663e723}{umcs7840\_write\_callback3}}\},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00199}00199         \{\&\mbox{\hyperlink{umcs_8c_ac6fe0651c8bb488ebdbb8031285f00a3}{umcs7840\_read\_callback4}}, \&\mbox{\hyperlink{umcs_8c_a89b95854766e8631efd2bf003c3ca160}{umcs7840\_write\_callback4}}\},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00200}00200 \};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00201}00201 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00202}\mbox{\hyperlink{umcs_8c_a104ad9fe42f4925f16e28fb46b8cbdbe}{00202}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__config}{usb\_config}} \mbox{\hyperlink{umcs_8c_a104ad9fe42f4925f16e28fb46b8cbdbe}{umcs7840\_bulk\_config\_data}}[\mbox{\hyperlink{umcs_8c_a56a0f36da7f9eaaf54bd05cc2bf49173aa450eb75b378095c6b1e670d92978927}{UMCS7840\_N\_TRANSFERS}}] = \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00203}00203         [\mbox{\hyperlink{umcs_8c_a56a0f36da7f9eaaf54bd05cc2bf49173ad56340ed3e7c990aac55cf90a7d3c967}{UMCS7840\_BULK\_RD\_EP}}] = \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00204}00204                 .\mbox{\hyperlink{structusb__config_a5bd5d569870291a54d9bed8377ed8b10}{type}} = \mbox{\hyperlink{usb_8h_a25240fc009aa67bb7a2b635d2e9401e4}{UE\_BULK}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00205}00205                 .endpoint = 0x01,}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00206}00206                 .direction = \mbox{\hyperlink{usb_8h_a72bb077a860132c175c166f344c75893}{UE\_DIR\_IN}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00207}00207                 .flags = \{.pipe\_bof = 1,.short\_xfer\_ok = 1,\},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00208}00208                 .bufsize = 0,           \textcolor{comment}{/* use wMaxPacketSize */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00209}00209                 .callback = \&\mbox{\hyperlink{umcs_8c_aad823c6585b1ca71693c6f75c8b74f07}{umcs7840\_read\_callback1}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00210}00210                 .if\_index = 0,}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00211}00211         \},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00212}00212 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00213}00213         [\mbox{\hyperlink{umcs_8c_a56a0f36da7f9eaaf54bd05cc2bf49173a15f948939aac39bf7984b708a90636a9}{UMCS7840\_BULK\_WR\_EP}}] = \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00214}00214                 .type = \mbox{\hyperlink{usb_8h_a25240fc009aa67bb7a2b635d2e9401e4}{UE\_BULK}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00215}00215                 .endpoint = 0x02,}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00216}00216                 .direction = \mbox{\hyperlink{usb_8h_a9a98e1bc9388db2ab5213e9d6496e851}{UE\_DIR\_OUT}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00217}00217                 .flags = \{.pipe\_bof = 1,.short\_xfer\_ok = 1,\},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00218}00218                 .bufsize = 0,           \textcolor{comment}{/* use wMaxPacketSize */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00219}00219                 .callback = \&\mbox{\hyperlink{umcs_8c_a21c4074f3171b295a45267671c90adee}{umcs7840\_write\_callback1}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00220}00220                 .if\_index = 0,}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00221}00221         \},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00222}00222 \};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00223}00223 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00224}\mbox{\hyperlink{umcs_8c_ae9df2220ddd1451015859f069341fa08}{00224}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__config}{usb\_config}} \mbox{\hyperlink{umcs_8c_ae9df2220ddd1451015859f069341fa08}{umcs7840\_intr\_config\_data}}[1] = \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00225}00225         [0] = \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00226}00226                 .\mbox{\hyperlink{structusb__config_a5bd5d569870291a54d9bed8377ed8b10}{type}} = \mbox{\hyperlink{usb_8h_a01e28e87ad16f6dfffefc6ccab08baed}{UE\_INTERRUPT}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00227}00227                 .endpoint = 0x09,}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00228}00228                 .direction = \mbox{\hyperlink{usb_8h_a72bb077a860132c175c166f344c75893}{UE\_DIR\_IN}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00229}00229                 .flags = \{.pipe\_bof = 1,.short\_xfer\_ok = 1,\},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00230}00230                 .bufsize = 0,           \textcolor{comment}{/* use wMaxPacketSize */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00231}00231                 .callback = \&\mbox{\hyperlink{umcs_8c_a011fde81829903577c80a6321436f015}{umcs7840\_intr\_callback}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00232}00232                 .if\_index = 0,}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00233}00233         \},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00234}00234 \};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00235}00235 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00236}\mbox{\hyperlink{umcs_8c_a0e99028335acefbb29cb199477b4703e}{00236}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structucom__callback}{ucom\_callback}} \mbox{\hyperlink{umcs_8c_a0e99028335acefbb29cb199477b4703e}{umcs7840\_callback}} = \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00237}00237         .\mbox{\hyperlink{structucom__callback_af543b5023679a91b3ae77ed22f2df40d}{ucom\_cfg\_get\_status}} = \&\mbox{\hyperlink{umcs_8c_ac3064d4d80782fbf9a9760a3ee8f6f24}{umcs7840\_cfg\_get\_status}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00238}00238 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00239}00239         .ucom\_cfg\_set\_dtr = \&\mbox{\hyperlink{umcs_8c_a390e35caecbc8ed8232d186f49c0b184}{umcs7840\_cfg\_set\_dtr}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00240}00240         .ucom\_cfg\_set\_rts = \&\mbox{\hyperlink{umcs_8c_addb105bbdd46a747e84f630767ce91a7}{umcs7840\_cfg\_set\_rts}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00241}00241         .ucom\_cfg\_set\_break = \&\mbox{\hyperlink{umcs_8c_a23a6877fd3fac6afdb2a02fbfedae21c}{umcs7840\_cfg\_set\_break}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00242}00242 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00243}00243         .ucom\_cfg\_param = \&\mbox{\hyperlink{umcs_8c_a68da9073c49232336a005d55d7966750}{umcs7840\_cfg\_param}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00244}00244         .ucom\_cfg\_open = \&\mbox{\hyperlink{umcs_8c_a2a9fbdb2df226e95bf6d7e85e230c3a4}{umcs7840\_cfg\_open}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00245}00245         .ucom\_cfg\_close = \&\mbox{\hyperlink{umcs_8c_a565d0ea448d1343b8ff5af0e9affce7a}{umcs7840\_cfg\_close}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00246}00246 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00247}00247         .ucom\_pre\_param = \&\mbox{\hyperlink{umcs_8c_a96e3c2a99523df0227f7362e5eabfeef}{umcs7840\_pre\_param}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00248}00248 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00249}00249         .ucom\_start\_read = \&\mbox{\hyperlink{umcs_8c_aa1685dadd4a746a2847c8a0446012a75}{umcs7840\_start\_read}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00250}00250         .ucom\_stop\_read = \&\mbox{\hyperlink{umcs_8c_a23c9c2c1729f25ec06b8fcb0951cc359}{umcs7840\_stop\_read}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00251}00251 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00252}00252         .ucom\_start\_write = \&\mbox{\hyperlink{umcs_8c_a7b1e68b61493beb6541bd5905d404b19}{umcs7840\_start\_write}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00253}00253         .ucom\_stop\_write = \&\mbox{\hyperlink{umcs_8c_a9fc45103858bf8a981c024445ef68583}{umcs7840\_stop\_write}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00254}00254 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00255}00255         .ucom\_poll = \&\mbox{\hyperlink{umcs_8c_af98b5eaa5c90131db3be868dafa014fa}{umcs7840\_poll}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00256}00256         .ucom\_free = \&\mbox{\hyperlink{umcs_8c_afaa6a5bd55aecf517ce4f992737696cc}{umcs7840\_free}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00257}00257 \};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00258}00258 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00259}\mbox{\hyperlink{umcs_8c_a532eacbeb47e7b8862cf50c6fbbfb105}{00259}} \textcolor{keyword}{static} \textcolor{keyword}{const} \mbox{\hyperlink{usbdi_8h_acf836fd8d6349b66a31f45420728da8d}{STRUCT\_USB\_HOST\_ID}} \mbox{\hyperlink{umcs_8c_a532eacbeb47e7b8862cf50c6fbbfb105}{umcs7840\_devs}}[] = \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00260}00260         \{\mbox{\hyperlink{usbdi_8h_acdab3edd999014815e8baeb9b33e9071}{USB\_VPI}}(USB\_VENDOR\_MOSCHIP, USB\_PRODUCT\_MOSCHIP\_MCS7820, 0)\},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00261}00261         \{\mbox{\hyperlink{usbdi_8h_acdab3edd999014815e8baeb9b33e9071}{USB\_VPI}}(USB\_VENDOR\_MOSCHIP, USB\_PRODUCT\_MOSCHIP\_MCS7840, 0)\},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00262}00262 \};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00263}00263 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00264}\mbox{\hyperlink{umcs_8c_a97425ab7fa5054baad87901e31e0c22f}{00264}} \textcolor{keyword}{static} device\_method\_t \mbox{\hyperlink{umcs_8c_a97425ab7fa5054baad87901e31e0c22f}{umcs7840\_methods}}[] = \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00265}00265         DEVMETHOD(device\_probe, \mbox{\hyperlink{umcs_8c_acbd1e7cb7662825ffacb78ac95bc64fb}{umcs7840\_probe}}),}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00266}00266         DEVMETHOD(device\_attach, \mbox{\hyperlink{umcs_8c_af7a5653c90480fe16eac1ed96cec4faf}{umcs7840\_attach}}),}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00267}00267         DEVMETHOD(device\_detach, \mbox{\hyperlink{umcs_8c_a1a7b1493b07129e9abfc0955b018cfcd}{umcs7840\_detach}}),}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00268}00268         DEVMETHOD\_END}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00269}00269 \};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00270}00270 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00271}\mbox{\hyperlink{umcs_8c_a784a3002c415e4ad3f0d3b071c072298}{00271}} \textcolor{keyword}{static} devclass\_t \mbox{\hyperlink{umcs_8c_a784a3002c415e4ad3f0d3b071c072298}{umcs7840\_devclass}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00272}00272 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00273}\mbox{\hyperlink{umcs_8c_af7b8664101e58f91780fbc8fbf724024}{00273}} \textcolor{keyword}{static} driver\_t \mbox{\hyperlink{umcs_8c_af7b8664101e58f91780fbc8fbf724024}{umcs7840\_driver}} = \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00274}00274         .name = \textcolor{stringliteral}{"{}umcs7840"{}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00275}00275         .methods = \mbox{\hyperlink{umcs_8c_a97425ab7fa5054baad87901e31e0c22f}{umcs7840\_methods}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00276}00276         .size = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}}),}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00277}00277 \};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00278}00278 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00279}\mbox{\hyperlink{umcs_8c_a2a3770cd91914fbf552dab54d1f8a37d}{00279}} \mbox{\hyperlink{umcs_8c_a2a3770cd91914fbf552dab54d1f8a37d}{DRIVER\_MODULE}}(umcs7840, uhub, \mbox{\hyperlink{umcs_8c_af7b8664101e58f91780fbc8fbf724024}{umcs7840\_driver}}, \mbox{\hyperlink{umcs_8c_a784a3002c415e4ad3f0d3b071c072298}{umcs7840\_devclass}}, 0, 0);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00280}\mbox{\hyperlink{umcs_8c_a5321fca264d0d2a439b2ede33f95bb19}{00280}} \mbox{\hyperlink{umcs_8c_a5321fca264d0d2a439b2ede33f95bb19}{MODULE\_DEPEND}}(umcs7840, ucom, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00281}\mbox{\hyperlink{umcs_8c_ae74b7b9212e8ba463f8417e0f51a2495}{00281}} \mbox{\hyperlink{umcs_8c_a5321fca264d0d2a439b2ede33f95bb19}{MODULE\_DEPEND}}(umcs7840, \mbox{\hyperlink{usb__if_8m_adfa3f6da9c4881e494b180c4ebb06470}{usb}}, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00282}\mbox{\hyperlink{umcs_8c_a517a5668a3e6385300b0d18cbf2030b0}{00282}} \mbox{\hyperlink{umcs_8c_a517a5668a3e6385300b0d18cbf2030b0}{MODULE\_VERSION}}(umcs7840, \mbox{\hyperlink{umcs_8c_ae9ff9f3559f56643b95e4b421f22dd0f}{UMCS7840\_MODVER}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00283}\mbox{\hyperlink{umcs_8c_a7a088682787b08c6a20f368d7e1aca01}{00283}} \mbox{\hyperlink{umcs_8c_a7a088682787b08c6a20f368d7e1aca01}{USB\_PNP\_HOST\_INFO}}(\mbox{\hyperlink{umcs_8c_a532eacbeb47e7b8862cf50c6fbbfb105}{umcs7840\_devs}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00284}00284 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00285}00285 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00286}\mbox{\hyperlink{umcs_8c_acb3a128db36a2b66ed78368ec0c5b8f7}{00286}} \mbox{\hyperlink{umcs_8c_acbd1e7cb7662825ffacb78ac95bc64fb}{umcs7840\_probe}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00287}00287 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00288}00288         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__attach__arg}{usb\_attach\_arg}} *uaa = device\_get\_ivars(dev);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00289}00289 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00290}00290         \textcolor{keywordflow}{if} (uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a246691e99681281d3113d63e81b7e4f0}{usb\_mode}} != \mbox{\hyperlink{usb_8h_a9bc559812598988121896dceb483806ba1c7091216cfa9c9f4a252b0825ed32cb}{USB\_MODE\_HOST}})}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00291}00291                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00292}00292         \textcolor{keywordflow}{if} (uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a66c2afc71fce73cc432f7d58593e1f26}{info}}.\mbox{\hyperlink{structusbd__lookup__info_a9e2af2c9a58f0df11559c7679185b0e8}{bConfigIndex}} != \mbox{\hyperlink{umcs_8h_af92c85c9195269df06fa6a52aee71165}{MCS7840\_CONFIG\_INDEX}})}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00293}00293                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00294}00294         \textcolor{keywordflow}{if} (uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a66c2afc71fce73cc432f7d58593e1f26}{info}}.\mbox{\hyperlink{structusbd__lookup__info_a50a68740a4c82f1a9b999d4a7994b550}{bIfaceIndex}} != \mbox{\hyperlink{umcs_8h_a2a0d92e6d8381e41cfe4368060ab4c50}{MCS7840\_IFACE\_INDEX}})}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00295}00295                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00296}00296         \textcolor{keywordflow}{return} (\mbox{\hyperlink{usb__lookup_8c_aa691ad42d532498716f358cb1c994fb2}{usbd\_lookup\_id\_by\_uaa}}(\mbox{\hyperlink{umcs_8c_a532eacbeb47e7b8862cf50c6fbbfb105}{umcs7840\_devs}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{umcs_8c_a532eacbeb47e7b8862cf50c6fbbfb105}{umcs7840\_devs}}), uaa));}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00297}00297 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00298}00298 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00299}00299 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00300}\mbox{\hyperlink{umcs_8c_acaab96fcdfa56f27aebd3fcd18e7ce8b}{00300}} \mbox{\hyperlink{umcs_8c_af7a5653c90480fe16eac1ed96cec4faf}{umcs7840\_attach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00301}00301 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00302}00302         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__config}{usb\_config}} umcs7840\_config\_tmp[\mbox{\hyperlink{umcs_8c_a56a0f36da7f9eaaf54bd05cc2bf49173aa450eb75b378095c6b1e670d92978927}{UMCS7840\_N\_TRANSFERS}}];}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00303}00303         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__attach__arg}{usb\_attach\_arg}} *uaa = device\_get\_ivars(dev);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00304}00304         \textcolor{keyword}{struct }\mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00305}00305 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00306}00306         uint8\_t iface\_index = \mbox{\hyperlink{umcs_8h_a2a0d92e6d8381e41cfe4368060ab4c50}{MCS7840\_IFACE\_INDEX}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00307}00307         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00308}00308         \textcolor{keywordtype}{int} subunit;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00309}00309         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00310}00310         uint8\_t data;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00311}00311 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00312}00312         \textcolor{keywordflow}{for} (\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} = 0; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} < \mbox{\hyperlink{umcs_8c_a56a0f36da7f9eaaf54bd05cc2bf49173aa450eb75b378095c6b1e670d92978927}{UMCS7840\_N\_TRANSFERS}}; ++\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}})}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00313}00313                 umcs7840\_config\_tmp[\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}] = \mbox{\hyperlink{umcs_8c_a104ad9fe42f4925f16e28fb46b8cbdbe}{umcs7840\_bulk\_config\_data}}[\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}];}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00314}00314 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00315}00315         \mbox{\hyperlink{usb__util_8c_a2f65a197990caa1a69a16691ce4dc66a}{device\_set\_usb\_desc}}(dev);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00316}00316         mtx\_init(\&sc-\/>\mbox{\hyperlink{structumcs7840__softc_a21668f09c9f17827c9472e7d966e8417}{sc\_mtx}}, \textcolor{stringliteral}{"{}umcs7840"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00317}00317         \mbox{\hyperlink{usb__serial_8c_a3533648e606891c90d0267b21b3ba59e}{ucom\_ref}}(\&sc-\/>\mbox{\hyperlink{structumcs7840__softc_a6ed12cefc798a49b57aadc76ef1a00c8}{sc\_super\_ucom}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00318}00318 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00319}00319         sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae8ad9bab5d6ced9a6ce23dcffc070e16}{sc\_dev}} = dev;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00320}00320         sc-\/>\mbox{\hyperlink{structumcs7840__softc_a92ef69845ae252cb0c563899fd98a133}{sc\_udev}} = uaa-\/>\mbox{\hyperlink{structusb__attach__arg_ac86557d3eaf77874d436ce38648b0276}{device}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00321}00321 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00322}00322         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00323}00323 \textcolor{comment}{         * Get number of ports}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00324}00324 \textcolor{comment}{         * Documentation (full datasheet) says, that number of ports is}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00325}00325 \textcolor{comment}{         * set as MCS7840\_DEV\_MODE\_SELECT24S bit in MODE R/Only}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00326}00326 \textcolor{comment}{         * register. But vendor driver uses these undocumented}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00327}00327 \textcolor{comment}{         * register \& bit.}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00328}00328 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00329}00329 \textcolor{comment}{         * Experiments show, that MODE register can have `0'}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00330}00330 \textcolor{comment}{         * (4 ports) bit on 2-\/port device, so use vendor driver's way.}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00331}00331 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00332}00332 \textcolor{comment}{         * Also, see notes in header file for these constants.}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00333}00333 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00334}00334         \mbox{\hyperlink{umcs_8c_a47f3cdb539f3ab9b8301169f35bdd09b}{umcs7840\_get\_reg\_sync}}(sc, \mbox{\hyperlink{umcs_8h_a8a1f73b517b380d532fcdb37e1ebc42f}{MCS7840\_DEV\_REG\_GPIO}}, \&data);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00335}00335         \textcolor{keywordflow}{if} (data \& \mbox{\hyperlink{umcs_8h_ab608391a1a80cda872ec27fe1217324b}{MCS7840\_DEV\_GPIO\_4PORTS}}) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00336}00336                 sc-\/>\mbox{\hyperlink{structumcs7840__softc_ac83526ca4a29ec551c7dc5525c80e02a}{sc\_numports}} = 4;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00337}00337                 \textcolor{comment}{/* Store physical port numbers in sc\_portno */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00338}00338                 sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae2a30ea71f818995e1d4d99f416547c3}{sc\_ucom}}[0].\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}} = 0;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00339}00339                 sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae2a30ea71f818995e1d4d99f416547c3}{sc\_ucom}}[1].\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}} = 1;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00340}00340                 sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae2a30ea71f818995e1d4d99f416547c3}{sc\_ucom}}[2].\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}} = 2;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00341}00341                 sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae2a30ea71f818995e1d4d99f416547c3}{sc\_ucom}}[3].\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}} = 3;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00342}00342         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00343}00343                 sc-\/>\mbox{\hyperlink{structumcs7840__softc_ac83526ca4a29ec551c7dc5525c80e02a}{sc\_numports}} = 2;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00344}00344                 \textcolor{comment}{/* Store physical port numbers in sc\_portno */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00345}00345                 sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae2a30ea71f818995e1d4d99f416547c3}{sc\_ucom}}[0].\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}} = 0;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00346}00346                 sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae2a30ea71f818995e1d4d99f416547c3}{sc\_ucom}}[1].\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}} = 2;   \textcolor{comment}{/* '1' is skipped */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00347}00347         \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00348}00348         device\_printf(dev, \textcolor{stringliteral}{"{}Chip mcs\%04x, found \%d active ports\(\backslash\)n"{}}, uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a66c2afc71fce73cc432f7d58593e1f26}{info}}.\mbox{\hyperlink{structusbd__lookup__info_a4bca08a16ef6b481d70d9eaf6a48f559}{idProduct}}, sc-\/>\mbox{\hyperlink{structumcs7840__softc_ac83526ca4a29ec551c7dc5525c80e02a}{sc\_numports}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00349}00349         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{umcs_8c_a47f3cdb539f3ab9b8301169f35bdd09b}{umcs7840\_get\_reg\_sync}}(sc, \mbox{\hyperlink{umcs_8h_a469718c8b3b7326ff5255b4fe67115fc}{MCS7840\_DEV\_REG\_MODE}}, \&data)) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00350}00350                 device\_printf(dev, \textcolor{stringliteral}{"{}On-\/die confguration: RST: active \%s, HRD: \%s, PLL: \%s, POR: \%s, Ports: \%s, EEPROM write \%s, IrDA is \%savailable\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00351}00351                     (data \& \mbox{\hyperlink{umcs_8h_a6bc53c44a9067dc97093d65123550671}{MCS7840\_DEV\_MODE\_RESET}}) ? \textcolor{stringliteral}{"{}low"{}} : \textcolor{stringliteral}{"{}high"{}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00352}00352                     (data \& \mbox{\hyperlink{umcs_8h_a50b02238caff4778eae9f372566dee4a}{MCS7840\_DEV\_MODE\_SER\_PRSNT}}) ? \textcolor{stringliteral}{"{}yes"{}} : \textcolor{stringliteral}{"{}no"{}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00353}00353                     (data \& \mbox{\hyperlink{umcs_8h_ac07395758eccb85b81dd7d77f46dd07c}{MCS7840\_DEV\_MODE\_PLLBYPASS}}) ? \textcolor{stringliteral}{"{}bypassed"{}} : \textcolor{stringliteral}{"{}avail"{}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00354}00354                     (data \& \mbox{\hyperlink{umcs_8h_adfa9261f0c230697a735272d05fa17db}{MCS7840\_DEV\_MODE\_PORBYPASS}}) ? \textcolor{stringliteral}{"{}bypassed"{}} : \textcolor{stringliteral}{"{}avail"{}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00355}00355                     (data \& \mbox{\hyperlink{umcs_8h_acd56a8342563ddbf5900cabdc3d552d3}{MCS7840\_DEV\_MODE\_SELECT24S}}) ? \textcolor{stringliteral}{"{}2"{}} : \textcolor{stringliteral}{"{}4"{}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00356}00356                     (data \& \mbox{\hyperlink{umcs_8h_a51e05f43f9a3599ad1a9261ec06e2091}{MCS7840\_DEV\_MODE\_EEPROMWR}}) ? \textcolor{stringliteral}{"{}enabled"{}} : \textcolor{stringliteral}{"{}disabled"{}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00357}00357                     (data \& \mbox{\hyperlink{umcs_8h_a45bc42b89eb6108df89635833440e0c2}{MCS7840\_DEV\_MODE\_IRDA}}) ? \textcolor{stringliteral}{"{}"{}} : \textcolor{stringliteral}{"{}not "{}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00358}00358         \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00359}00359         \textcolor{comment}{/* Setup all transfers */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00360}00360         \textcolor{keywordflow}{for} (subunit = 0; subunit < sc-\/>\mbox{\hyperlink{structumcs7840__softc_ac83526ca4a29ec551c7dc5525c80e02a}{sc\_numports}}; ++subunit) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00361}00361                 \textcolor{keywordflow}{for} (\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} = 0; \mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}} < \mbox{\hyperlink{umcs_8c_a56a0f36da7f9eaaf54bd05cc2bf49173aa450eb75b378095c6b1e670d92978927}{UMCS7840\_N\_TRANSFERS}}; ++\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00362}00362                         \textcolor{comment}{/* Set endpoint address */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00363}00363                         umcs7840\_config\_tmp[\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}].\mbox{\hyperlink{structusb__config_a81074abe7ded5be9dabdf9bcfed79317}{endpoint}} = \mbox{\hyperlink{umcs_8c_a104ad9fe42f4925f16e28fb46b8cbdbe}{umcs7840\_bulk\_config\_data}}[\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}].\mbox{\hyperlink{structusb__config_a81074abe7ded5be9dabdf9bcfed79317}{endpoint}} + 2 * sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae2a30ea71f818995e1d4d99f416547c3}{sc\_ucom}}[subunit].\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00364}00364                         umcs7840\_config\_tmp[\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}].\mbox{\hyperlink{structusb__config_ad6cf53d455b808964f881c91074d2696}{callback}} = \mbox{\hyperlink{umcs_8c_a98df4f545592f06bf742ed9a318f1879}{umcs7840\_rw\_callbacks}}[subunit][\mbox{\hyperlink{if__run_8c_a5a648f5ec00c526b0dfa2df7a272c6c0}{n}}];}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00365}00365                 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00366}00366                 \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{umcs_8c_source_l00367}00367                     \&iface\_index, sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae2a30ea71f818995e1d4d99f416547c3}{sc\_ucom}}[subunit].\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}}].\mbox{\hyperlink{structumcs7840__softc__oneport_a94ccfca49162ec16bb100ea81b43ff7b}{sc\_xfer}}, umcs7840\_config\_tmp,}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00368}00368                     \mbox{\hyperlink{umcs_8c_a56a0f36da7f9eaaf54bd05cc2bf49173aa450eb75b378095c6b1e670d92978927}{UMCS7840\_N\_TRANSFERS}}, sc, \&sc-\/>\mbox{\hyperlink{structumcs7840__softc_a21668f09c9f17827c9472e7d966e8417}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00369}00369                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00370}00370                         device\_printf(dev, \textcolor{stringliteral}{"{}allocating USB transfers failed for subunit \%d of \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00371}00371                             subunit + 1, sc-\/>\mbox{\hyperlink{structumcs7840__softc_ac83526ca4a29ec551c7dc5525c80e02a}{sc\_numports}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00372}00372                         \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00373}00373                 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00374}00374         \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00375}00375         \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{umcs_8c_source_l00376}00376             \&iface\_index, \&sc-\/>\mbox{\hyperlink{structumcs7840__softc_ad6ddde2165d29e8a14c96a39ebd5c15a}{sc\_intr\_xfer}}, \mbox{\hyperlink{umcs_8c_ae9df2220ddd1451015859f069341fa08}{umcs7840\_intr\_config\_data}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00377}00377             1, sc, \&sc-\/>\mbox{\hyperlink{structumcs7840__softc_a21668f09c9f17827c9472e7d966e8417}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00378}00378         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00379}00379                 device\_printf(dev, \textcolor{stringliteral}{"{}allocating USB transfers failed for interrupt\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00380}00380                 \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00381}00381         \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00382}00382         \textcolor{comment}{/* clear stall at first run */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00383}00383         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structumcs7840__softc_a21668f09c9f17827c9472e7d966e8417}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00384}00384         \textcolor{keywordflow}{for} (subunit = 0; subunit < sc-\/>\mbox{\hyperlink{structumcs7840__softc_ac83526ca4a29ec551c7dc5525c80e02a}{sc\_numports}}; ++subunit) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00385}00385                 \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae2a30ea71f818995e1d4d99f416547c3}{sc\_ucom}}[subunit].\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}}].\mbox{\hyperlink{structumcs7840__softc__oneport_a94ccfca49162ec16bb100ea81b43ff7b}{sc\_xfer}}[\mbox{\hyperlink{umcs_8c_a56a0f36da7f9eaaf54bd05cc2bf49173ad56340ed3e7c990aac55cf90a7d3c967}{UMCS7840\_BULK\_RD\_EP}}]);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00386}00386                 \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae2a30ea71f818995e1d4d99f416547c3}{sc\_ucom}}[subunit].\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}}].\mbox{\hyperlink{structumcs7840__softc__oneport_a94ccfca49162ec16bb100ea81b43ff7b}{sc\_xfer}}[\mbox{\hyperlink{umcs_8c_a56a0f36da7f9eaaf54bd05cc2bf49173a15f948939aac39bf7984b708a90636a9}{UMCS7840\_BULK\_WR\_EP}}]);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00387}00387         \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00388}00388         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structumcs7840__softc_a21668f09c9f17827c9472e7d966e8417}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00389}00389 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00390}00390         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usb__serial_8c_a1a14cc63123395507acee783de212d75}{ucom\_attach}}(\&sc-\/>\mbox{\hyperlink{structumcs7840__softc_a6ed12cefc798a49b57aadc76ef1a00c8}{sc\_super\_ucom}}, sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae2a30ea71f818995e1d4d99f416547c3}{sc\_ucom}}, sc-\/>\mbox{\hyperlink{structumcs7840__softc_ac83526ca4a29ec551c7dc5525c80e02a}{sc\_numports}}, sc,}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00391}00391             \&\mbox{\hyperlink{umcs_8c_a0e99028335acefbb29cb199477b4703e}{umcs7840\_callback}}, \&sc-\/>\mbox{\hyperlink{structumcs7840__softc_a21668f09c9f17827c9472e7d966e8417}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00392}00392         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00393}00393                 \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00394}00394 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00395}00395         \mbox{\hyperlink{usb__serial_8c_a5fd441bb430a68061e8c933443f1d14f}{ucom\_set\_pnpinfo\_usb}}(\&sc-\/>\mbox{\hyperlink{structumcs7840__softc_a6ed12cefc798a49b57aadc76ef1a00c8}{sc\_super\_ucom}}, dev);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00396}00396 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00397}00397         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00398}00398 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00399}00399 detach:}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00400}00400         \mbox{\hyperlink{umcs_8c_a1a7b1493b07129e9abfc0955b018cfcd}{umcs7840\_detach}}(dev);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00401}00401         \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00402}00402 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00403}00403 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00404}00404 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00405}\mbox{\hyperlink{umcs_8c_ad98d186e21d9380d391a12310660d552}{00405}} \mbox{\hyperlink{umcs_8c_a1a7b1493b07129e9abfc0955b018cfcd}{umcs7840\_detach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00406}00406 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00407}00407         \textcolor{keyword}{struct }\mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00408}00408         \textcolor{keywordtype}{int} subunit;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00409}00409 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00410}00410         \mbox{\hyperlink{usb__serial_8c_abcceb7ddf05b758da5f3ada77a962ad1}{ucom\_detach}}(\&sc-\/>\mbox{\hyperlink{structumcs7840__softc_a6ed12cefc798a49b57aadc76ef1a00c8}{sc\_super\_ucom}}, sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae2a30ea71f818995e1d4d99f416547c3}{sc\_ucom}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00411}00411 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00412}00412         \textcolor{keywordflow}{for} (subunit = 0; subunit < sc-\/>\mbox{\hyperlink{structumcs7840__softc_ac83526ca4a29ec551c7dc5525c80e02a}{sc\_numports}}; ++subunit)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00413}00413                 \mbox{\hyperlink{usb__transfer_8c_a2f5ab55bfe7f356bb7a7505ff35c9741}{usbd\_transfer\_unsetup}}(sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae2a30ea71f818995e1d4d99f416547c3}{sc\_ucom}}[subunit].\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}}].\mbox{\hyperlink{structumcs7840__softc__oneport_a94ccfca49162ec16bb100ea81b43ff7b}{sc\_xfer}}, \mbox{\hyperlink{umcs_8c_a56a0f36da7f9eaaf54bd05cc2bf49173aa450eb75b378095c6b1e670d92978927}{UMCS7840\_N\_TRANSFERS}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00414}00414         \mbox{\hyperlink{usb__transfer_8c_a2f5ab55bfe7f356bb7a7505ff35c9741}{usbd\_transfer\_unsetup}}(\&sc-\/>\mbox{\hyperlink{structumcs7840__softc_ad6ddde2165d29e8a14c96a39ebd5c15a}{sc\_intr\_xfer}}, 1);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00415}00415 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00416}00416         device\_claim\_softc(dev);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00417}00417 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00418}00418         \mbox{\hyperlink{umcs_8c_a6562d72fc0ef33771f46caf925d212d0}{umcs7840\_free\_softc}}(sc);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00419}00419 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00420}00420         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00421}00421 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00422}00422 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00423}\mbox{\hyperlink{umcs_8c_aab5675fc745533a150fed0dd4050afb1}{00423}} \mbox{\hyperlink{umcs_8c_aab5675fc745533a150fed0dd4050afb1}{UCOM\_UNLOAD\_DRAIN}}(umcs7840);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00424}00424 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00425}00425 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00426}\mbox{\hyperlink{umcs_8c_a6562d72fc0ef33771f46caf925d212d0}{00426}} \mbox{\hyperlink{umcs_8c_a6562d72fc0ef33771f46caf925d212d0}{umcs7840\_free\_softc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00427}00427 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00428}00428         \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__serial_8c_a27ca652272693169923a38646505d083}{ucom\_unref}}(\&sc-\/>\mbox{\hyperlink{structumcs7840__softc_a6ed12cefc798a49b57aadc76ef1a00c8}{sc\_super\_ucom}})) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00429}00429                 mtx\_destroy(\&sc-\/>\mbox{\hyperlink{structumcs7840__softc_a21668f09c9f17827c9472e7d966e8417}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00430}00430                 device\_free\_softc(sc);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00431}00431         \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00432}00432 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00433}00433 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00434}00434 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00435}\mbox{\hyperlink{umcs_8c_afaa6a5bd55aecf517ce4f992737696cc}{00435}} \mbox{\hyperlink{umcs_8c_afaa6a5bd55aecf517ce4f992737696cc}{umcs7840\_free}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00436}00436 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00437}00437         \mbox{\hyperlink{umcs_8c_a6562d72fc0ef33771f46caf925d212d0}{umcs7840\_free\_softc}}(ucom-\/>\mbox{\hyperlink{structucom__softc_a4ebbc8663d0291bf6e0ffb93cc2dc70e}{sc\_parent}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00438}00438 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00439}00439 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00440}00440 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00441}\mbox{\hyperlink{umcs_8c_a2a9fbdb2df226e95bf6d7e85e230c3a4}{00441}} \mbox{\hyperlink{umcs_8c_a2a9fbdb2df226e95bf6d7e85e230c3a4}{umcs7840\_cfg\_open}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00442}00442 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00443}00443         \textcolor{keyword}{struct }\mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *sc = ucom-\/>\mbox{\hyperlink{structucom__softc_a4ebbc8663d0291bf6e0ffb93cc2dc70e}{sc\_parent}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00444}00444         uint16\_t pn = ucom-\/>\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00445}00445         uint8\_t data;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00446}00446 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00447}00447         \textcolor{comment}{/* If it very first open, finish global configuration */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00448}00448         \textcolor{keywordflow}{if} (!sc-\/>\mbox{\hyperlink{structumcs7840__softc_a169e8b51b7934034fe3eb1ac4840020b}{sc\_driver\_done}}) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00449}00449                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00450}00450 \textcolor{comment}{                 * USB enumeration is finished, pass internal memory to FIFOs}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00451}00451 \textcolor{comment}{                 * If it is done in the end of "{}attach"{}, kernel panics.}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00452}00452 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00453}00453                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a47f3cdb539f3ab9b8301169f35bdd09b}{umcs7840\_get\_reg\_sync}}(sc, \mbox{\hyperlink{umcs_8h_a2583f5ee288406cc9cd9188edc4080d4}{MCS7840\_DEV\_REG\_CONTROL1}}, \&data))}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00454}00454                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00455}00455                 data |= \mbox{\hyperlink{umcs_8h_a754879aeb3abe042f6effa37ed791cd7}{MCS7840\_DEV\_CONTROL1\_DRIVER\_DONE}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00456}00456                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a37440031909237a3039fe64250454a48}{umcs7840\_set\_reg\_sync}}(sc, \mbox{\hyperlink{umcs_8h_a2583f5ee288406cc9cd9188edc4080d4}{MCS7840\_DEV\_REG\_CONTROL1}}, data))}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00457}00457                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00458}00458                 sc-\/>\mbox{\hyperlink{structumcs7840__softc_a169e8b51b7934034fe3eb1ac4840020b}{sc\_driver\_done}} = 1;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00459}00459         \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00460}00460         \textcolor{comment}{/* Toggle reset bit on-\/off */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00461}00461         \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a47f3cdb539f3ab9b8301169f35bdd09b}{umcs7840\_get\_reg\_sync}}(sc, \mbox{\hyperlink{structumcs7840__port__registers}{umcs7840\_port\_registers}}[pn].reg\_sp, \&data))}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00462}00462                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00463}00463         data |= \mbox{\hyperlink{umcs_8h_a1a80bfac3d71ffc992d73de45d0cc172}{MCS7840\_DEV\_SPx\_UART\_RESET}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00464}00464         \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a37440031909237a3039fe64250454a48}{umcs7840\_set\_reg\_sync}}(sc, \mbox{\hyperlink{structumcs7840__port__registers}{umcs7840\_port\_registers}}[pn].reg\_sp, data))}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00465}00465                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00466}00466         data \&= \string~MCS7840\_DEV\_SPx\_UART\_RESET;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00467}00467         \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a37440031909237a3039fe64250454a48}{umcs7840\_set\_reg\_sync}}(sc, \mbox{\hyperlink{structumcs7840__port__registers}{umcs7840\_port\_registers}}[pn].reg\_sp, data))}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00468}00468                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00469}00469 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00470}00470         \textcolor{comment}{/* Set RS-\/232 mode */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00471}00471         \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a0fd2adae17a52832d013fbe35ddc5176}{umcs7840\_set\_UART\_reg\_sync}}(sc, pn, \mbox{\hyperlink{umcs_8h_ae8527b5b4b6844994146ea43b642ba73}{MCS7840\_UART\_REG\_SCRATCHPAD}}, \mbox{\hyperlink{umcs_8h_aff2402027ea6ff8daaa211c79fc4c104}{MCS7840\_UART\_SCRATCHPAD\_RS232}}))}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00472}00472                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00473}00473 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00474}00474         \textcolor{comment}{/* Disable RX on time of initialization */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00475}00475         \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a47f3cdb539f3ab9b8301169f35bdd09b}{umcs7840\_get\_reg\_sync}}(sc, \mbox{\hyperlink{structumcs7840__port__registers}{umcs7840\_port\_registers}}[pn].reg\_control, \&data))}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00476}00476                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00477}00477         data |= \mbox{\hyperlink{umcs_8h_a3773337e2ad92c7ff85a7ace3c2c14cf}{MCS7840\_DEV\_CONTROLx\_RX\_DISABLE}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00478}00478         \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a37440031909237a3039fe64250454a48}{umcs7840\_set\_reg\_sync}}(sc, \mbox{\hyperlink{structumcs7840__port__registers}{umcs7840\_port\_registers}}[pn].reg\_control, data))}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00479}00479                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00480}00480 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00481}00481         \textcolor{comment}{/* Disable all interrupts */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00482}00482         \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a0fd2adae17a52832d013fbe35ddc5176}{umcs7840\_set\_UART\_reg\_sync}}(sc, pn, \mbox{\hyperlink{umcs_8h_a26d2cca2ff223c6e8e4748b9259f41e5}{MCS7840\_UART\_REG\_IER}}, 0))}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00483}00483                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00484}00484 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00485}00485         \textcolor{comment}{/* Reset FIFO -\/-\/ documented */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00486}00486         \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a0fd2adae17a52832d013fbe35ddc5176}{umcs7840\_set\_UART\_reg\_sync}}(sc, pn, \mbox{\hyperlink{umcs_8h_a19838a976263d89ad5d12e752888ef6b}{MCS7840\_UART\_REG\_FCR}}, 0))}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00487}00487                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00488}00488         \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a0fd2adae17a52832d013fbe35ddc5176}{umcs7840\_set\_UART\_reg\_sync}}(sc, pn, \mbox{\hyperlink{umcs_8h_a19838a976263d89ad5d12e752888ef6b}{MCS7840\_UART\_REG\_FCR}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00489}00489             \mbox{\hyperlink{umcs_8h_a299c126cf03468830e6b479b9fc6d7ec}{MCS7840\_UART\_FCR\_ENABLE}} | \mbox{\hyperlink{umcs_8h_aeb523b080b63eac53dc8e79b96eb1d9a}{MCS7840\_UART\_FCR\_FLUSHRHR}} |}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00490}00490             \mbox{\hyperlink{umcs_8h_a7a8728fb43521388f31ebb54a3639529}{MCS7840\_UART\_FCR\_FLUSHTHR}} | \mbox{\hyperlink{umcs_8h_a1aa347b66f53a49c4b71780d8bd7efee}{MCS7840\_UART\_FCR\_RTL\_1\_14}}))}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00491}00491                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00492}00492 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00493}00493         \textcolor{comment}{/* Set 8 bit, no parity, 1 stop bit -\/-\/ documented */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00494}00494         sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_ac7995722c7aab73779e1d47382b30cae}{sc\_lcr}} = \mbox{\hyperlink{umcs_8h_a7137e6069aa29b2f94ad1ad374bff33a}{MCS7840\_UART\_LCR\_DATALEN8}} | \mbox{\hyperlink{umcs_8h_ac962df4fcad8a251a619d9f925712dd2}{MCS7840\_UART\_LCR\_STOPB1}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00495}00495         \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a0fd2adae17a52832d013fbe35ddc5176}{umcs7840\_set\_UART\_reg\_sync}}(sc, pn, \mbox{\hyperlink{umcs_8h_aa25bf9192b16c25fb9591e23dce18742}{MCS7840\_UART\_REG\_LCR}}, sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_ac7995722c7aab73779e1d47382b30cae}{sc\_lcr}}))}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00496}00496                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00497}00497 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00498}00498         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00499}00499 \textcolor{comment}{         * Enable DTR/RTS on modem control, enable modem interrupts -\/-\/}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00500}00500 \textcolor{comment}{         * documented}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00501}00501 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00502}00502         sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_adc792df8b3d18fd6afb8ce667f8ef150}{sc\_mcr}} = \mbox{\hyperlink{umcs_8h_a3caf39ebff3fe0f9564da5bfca303238}{MCS7840\_UART\_MCR\_IE}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00503}00503         \textcolor{keywordflow}{if} (ucom-\/>\mbox{\hyperlink{structucom__softc_a1ecae27c389ba71f77340fcdde61278f}{sc\_tty}} == NULL || (ucom-\/>\mbox{\hyperlink{structucom__softc_a1ecae27c389ba71f77340fcdde61278f}{sc\_tty}}-\/>t\_termios.c\_cflag \& CNO\_RTSDTR) == 0)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00504}00504                 sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_adc792df8b3d18fd6afb8ce667f8ef150}{sc\_mcr}} |= \mbox{\hyperlink{umcs_8h_a5e2f03822cb8e59fce040dc389a4f6f1}{MCS7840\_UART\_MCR\_DTR}} | \mbox{\hyperlink{umcs_8h_a9763bc41b64af0e0421e5656fd7b2c13}{MCS7840\_UART\_MCR\_RTS}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00505}00505         \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a0fd2adae17a52832d013fbe35ddc5176}{umcs7840\_set\_UART\_reg\_sync}}(sc, pn, \mbox{\hyperlink{umcs_8h_ab230eb0432e60ae619840886f3e7af50}{MCS7840\_UART\_REG\_MCR}}, sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_adc792df8b3d18fd6afb8ce667f8ef150}{sc\_mcr}}))}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00506}00506                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00507}00507 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00508}00508         \textcolor{comment}{/* Clearing Bulkin and Bulkout FIFO */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00509}00509         \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a47f3cdb539f3ab9b8301169f35bdd09b}{umcs7840\_get\_reg\_sync}}(sc, \mbox{\hyperlink{structumcs7840__port__registers}{umcs7840\_port\_registers}}[pn].reg\_sp, \&data))}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00510}00510                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00511}00511         data |= \mbox{\hyperlink{umcs_8h_ad9a8a0216ff670637ca459ec6e933f18}{MCS7840\_DEV\_SPx\_RESET\_OUT\_FIFO}} | \mbox{\hyperlink{umcs_8h_a184d9c4d76db6a6e6f8e09f80020b651}{MCS7840\_DEV\_SPx\_RESET\_IN\_FIFO}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00512}00512         \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a37440031909237a3039fe64250454a48}{umcs7840\_set\_reg\_sync}}(sc, \mbox{\hyperlink{structumcs7840__port__registers}{umcs7840\_port\_registers}}[pn].reg\_sp, data))}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00513}00513                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00514}00514         data \&= \string~(\mbox{\hyperlink{umcs_8h_ad9a8a0216ff670637ca459ec6e933f18}{MCS7840\_DEV\_SPx\_RESET\_OUT\_FIFO}} | \mbox{\hyperlink{umcs_8h_a184d9c4d76db6a6e6f8e09f80020b651}{MCS7840\_DEV\_SPx\_RESET\_IN\_FIFO}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00515}00515         \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a37440031909237a3039fe64250454a48}{umcs7840\_set\_reg\_sync}}(sc, \mbox{\hyperlink{structumcs7840__port__registers}{umcs7840\_port\_registers}}[pn].reg\_sp, data))}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00516}00516                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00517}00517 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00518}00518         \textcolor{comment}{/* Set speed 9600 */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00519}00519         \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a4cf19216511eecba82e88b03f5a3103a}{umcs7840\_set\_baudrate}}(sc, pn, 9600))}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00520}00520                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00521}00521 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00522}00522         \textcolor{comment}{/* Finally enable all interrupts -\/-\/ documented */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00523}00523         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00524}00524 \textcolor{comment}{         * Copied from vendor driver, I don't know why we should read LCR}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00525}00525 \textcolor{comment}{         * here}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00526}00526 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00527}00527         \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_acab7a382a4e8a3c3516c192d1abcaa9d}{umcs7840\_get\_UART\_reg\_sync}}(sc, pn, \mbox{\hyperlink{umcs_8h_aa25bf9192b16c25fb9591e23dce18742}{MCS7840\_UART\_REG\_LCR}}, \&sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_ac7995722c7aab73779e1d47382b30cae}{sc\_lcr}}))}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00528}00528                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00529}00529         \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a0fd2adae17a52832d013fbe35ddc5176}{umcs7840\_set\_UART\_reg\_sync}}(sc, pn, \mbox{\hyperlink{umcs_8h_a26d2cca2ff223c6e8e4748b9259f41e5}{MCS7840\_UART\_REG\_IER}},}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00530}00530             \mbox{\hyperlink{umcs_8h_a31996ca88e612f7d2c3e7768b43fb28a}{MCS7840\_UART\_IER\_RXSTAT}} | \mbox{\hyperlink{umcs_8h_ac56728ad089c912216f41f1af195555a}{MCS7840\_UART\_IER\_MODEM}}))}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00531}00531                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00532}00532 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00533}00533         \textcolor{comment}{/* Enable RX */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00534}00534         \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a47f3cdb539f3ab9b8301169f35bdd09b}{umcs7840\_get\_reg\_sync}}(sc, \mbox{\hyperlink{structumcs7840__port__registers}{umcs7840\_port\_registers}}[pn].reg\_control, \&data))}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00535}00535                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00536}00536         data \&= \string~MCS7840\_DEV\_CONTROLx\_RX\_DISABLE;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00537}00537         \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a37440031909237a3039fe64250454a48}{umcs7840\_set\_reg\_sync}}(sc, \mbox{\hyperlink{structumcs7840__port__registers}{umcs7840\_port\_registers}}[pn].reg\_control, data))}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00538}00538                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00539}00539 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00540}00540         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Port \%d has been opened\(\backslash\)n"{}}, pn);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00541}00541 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00542}00542 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00543}00543 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00544}\mbox{\hyperlink{umcs_8c_a565d0ea448d1343b8ff5af0e9affce7a}{00544}} \mbox{\hyperlink{umcs_8c_a565d0ea448d1343b8ff5af0e9affce7a}{umcs7840\_cfg\_close}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00545}00545 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00546}00546         \textcolor{keyword}{struct }\mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *sc = ucom-\/>\mbox{\hyperlink{structucom__softc_a4ebbc8663d0291bf6e0ffb93cc2dc70e}{sc\_parent}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00547}00547         uint16\_t pn = ucom-\/>\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00548}00548         uint8\_t data;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00549}00549 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00550}00550         \mbox{\hyperlink{umcs_8c_a23c9c2c1729f25ec06b8fcb0951cc359}{umcs7840\_stop\_read}}(ucom);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00551}00551         \mbox{\hyperlink{umcs_8c_a9fc45103858bf8a981c024445ef68583}{umcs7840\_stop\_write}}(ucom);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00552}00552 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00553}00553         \mbox{\hyperlink{umcs_8c_a0fd2adae17a52832d013fbe35ddc5176}{umcs7840\_set\_UART\_reg\_sync}}(sc, pn, \mbox{\hyperlink{umcs_8h_ab230eb0432e60ae619840886f3e7af50}{MCS7840\_UART\_REG\_MCR}}, 0);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00554}00554         \mbox{\hyperlink{umcs_8c_a0fd2adae17a52832d013fbe35ddc5176}{umcs7840\_set\_UART\_reg\_sync}}(sc, pn, \mbox{\hyperlink{umcs_8h_a26d2cca2ff223c6e8e4748b9259f41e5}{MCS7840\_UART\_REG\_IER}}, 0);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00555}00555 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00556}00556         \textcolor{comment}{/* Disable RX */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00557}00557         \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a47f3cdb539f3ab9b8301169f35bdd09b}{umcs7840\_get\_reg\_sync}}(sc, \mbox{\hyperlink{structumcs7840__port__registers}{umcs7840\_port\_registers}}[pn].reg\_control, \&data))}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00558}00558                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00559}00559         data |= \mbox{\hyperlink{umcs_8h_a3773337e2ad92c7ff85a7ace3c2c14cf}{MCS7840\_DEV\_CONTROLx\_RX\_DISABLE}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00560}00560         \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a37440031909237a3039fe64250454a48}{umcs7840\_set\_reg\_sync}}(sc, \mbox{\hyperlink{structumcs7840__port__registers}{umcs7840\_port\_registers}}[pn].reg\_control, data))}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00561}00561                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00562}00562         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Port \%d has been closed\(\backslash\)n"{}}, pn);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00563}00563 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00564}00564 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00565}00565 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00566}\mbox{\hyperlink{umcs_8c_a390e35caecbc8ed8232d186f49c0b184}{00566}} \mbox{\hyperlink{umcs_8c_a390e35caecbc8ed8232d186f49c0b184}{umcs7840\_cfg\_set\_dtr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom, uint8\_t onoff)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00567}00567 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00568}00568         \textcolor{keyword}{struct }\mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *sc = ucom-\/>\mbox{\hyperlink{structucom__softc_a4ebbc8663d0291bf6e0ffb93cc2dc70e}{sc\_parent}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00569}00569         uint8\_t pn = ucom-\/>\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00570}00570 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00571}00571         \textcolor{keywordflow}{if} (onoff)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00572}00572                 sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_adc792df8b3d18fd6afb8ce667f8ef150}{sc\_mcr}} |= \mbox{\hyperlink{umcs_8h_a5e2f03822cb8e59fce040dc389a4f6f1}{MCS7840\_UART\_MCR\_DTR}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00573}00573         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00574}00574                 sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_adc792df8b3d18fd6afb8ce667f8ef150}{sc\_mcr}} \&= \string~MCS7840\_UART\_MCR\_DTR;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00575}00575 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00576}00576         \mbox{\hyperlink{umcs_8c_a0fd2adae17a52832d013fbe35ddc5176}{umcs7840\_set\_UART\_reg\_sync}}(sc, pn, \mbox{\hyperlink{umcs_8h_ab230eb0432e60ae619840886f3e7af50}{MCS7840\_UART\_REG\_MCR}}, sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_adc792df8b3d18fd6afb8ce667f8ef150}{sc\_mcr}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00577}00577         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Port \%d DTR set to: \%s\(\backslash\)n"{}}, pn, onoff ? \textcolor{stringliteral}{"{}on"{}} : \textcolor{stringliteral}{"{}off"{}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00578}00578 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00579}00579 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00580}00580 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00581}\mbox{\hyperlink{umcs_8c_addb105bbdd46a747e84f630767ce91a7}{00581}} \mbox{\hyperlink{umcs_8c_addb105bbdd46a747e84f630767ce91a7}{umcs7840\_cfg\_set\_rts}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom, uint8\_t onoff)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00582}00582 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00583}00583         \textcolor{keyword}{struct }\mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *sc = ucom-\/>\mbox{\hyperlink{structucom__softc_a4ebbc8663d0291bf6e0ffb93cc2dc70e}{sc\_parent}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00584}00584         uint8\_t pn = ucom-\/>\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00585}00585 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00586}00586         \textcolor{keywordflow}{if} (onoff)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00587}00587                 sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_adc792df8b3d18fd6afb8ce667f8ef150}{sc\_mcr}} |= \mbox{\hyperlink{umcs_8h_a9763bc41b64af0e0421e5656fd7b2c13}{MCS7840\_UART\_MCR\_RTS}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00588}00588         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00589}00589                 sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_adc792df8b3d18fd6afb8ce667f8ef150}{sc\_mcr}} \&= \string~MCS7840\_UART\_MCR\_RTS;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00590}00590 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00591}00591         \mbox{\hyperlink{umcs_8c_a0fd2adae17a52832d013fbe35ddc5176}{umcs7840\_set\_UART\_reg\_sync}}(sc, pn, \mbox{\hyperlink{umcs_8h_ab230eb0432e60ae619840886f3e7af50}{MCS7840\_UART\_REG\_MCR}}, sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_adc792df8b3d18fd6afb8ce667f8ef150}{sc\_mcr}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00592}00592         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Port \%d RTS set to: \%s\(\backslash\)n"{}}, pn, onoff ? \textcolor{stringliteral}{"{}on"{}} : \textcolor{stringliteral}{"{}off"{}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00593}00593 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00594}00594 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00595}00595 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00596}\mbox{\hyperlink{umcs_8c_a23a6877fd3fac6afdb2a02fbfedae21c}{00596}} \mbox{\hyperlink{umcs_8c_a23a6877fd3fac6afdb2a02fbfedae21c}{umcs7840\_cfg\_set\_break}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom, uint8\_t onoff)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00597}00597 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00598}00598         \textcolor{keyword}{struct }\mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *sc = ucom-\/>\mbox{\hyperlink{structucom__softc_a4ebbc8663d0291bf6e0ffb93cc2dc70e}{sc\_parent}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00599}00599         uint8\_t pn = ucom-\/>\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00600}00600 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00601}00601         \textcolor{keywordflow}{if} (onoff)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00602}00602                 sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_ac7995722c7aab73779e1d47382b30cae}{sc\_lcr}} |= \mbox{\hyperlink{umcs_8h_a70153415f9d73492f2b264d1fa1fefa6}{MCS7840\_UART\_LCR\_BREAK}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00603}00603         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00604}00604                 sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_ac7995722c7aab73779e1d47382b30cae}{sc\_lcr}} \&= \string~MCS7840\_UART\_LCR\_BREAK;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00605}00605 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00606}00606         \mbox{\hyperlink{umcs_8c_a0fd2adae17a52832d013fbe35ddc5176}{umcs7840\_set\_UART\_reg\_sync}}(sc, pn, \mbox{\hyperlink{umcs_8h_aa25bf9192b16c25fb9591e23dce18742}{MCS7840\_UART\_REG\_LCR}}, sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_ac7995722c7aab73779e1d47382b30cae}{sc\_lcr}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00607}00607         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Port \%d BREAK set to: \%s\(\backslash\)n"{}}, pn, onoff ? \textcolor{stringliteral}{"{}on"{}} : \textcolor{stringliteral}{"{}off"{}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00608}00608 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00609}00609 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00610}00610 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00611}\mbox{\hyperlink{umcs_8c_a68da9073c49232336a005d55d7966750}{00611}} \mbox{\hyperlink{umcs_8c_a68da9073c49232336a005d55d7966750}{umcs7840\_cfg\_param}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom, \textcolor{keyword}{struct} termios *t)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00612}00612 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00613}00613         \textcolor{keyword}{struct }\mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *sc = ucom-\/>\mbox{\hyperlink{structucom__softc_a4ebbc8663d0291bf6e0ffb93cc2dc70e}{sc\_parent}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00614}00614         uint8\_t pn = ucom-\/>\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00615}00615         uint8\_t lcr = sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_ac7995722c7aab73779e1d47382b30cae}{sc\_lcr}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00616}00616         uint8\_t mcr = sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_adc792df8b3d18fd6afb8ce667f8ef150}{sc\_mcr}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00617}00617 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00618}00618         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Port \%d config:\(\backslash\)n"{}}, pn);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00619}00619         \textcolor{keywordflow}{if} (t-\/>c\_cflag \& CSTOPB) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00620}00620                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}  2 stop bits\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00621}00621                 lcr |= \mbox{\hyperlink{umcs_8h_a5c3d1589e78508abe3ba30b7bc9f583b}{MCS7840\_UART\_LCR\_STOPB2}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00622}00622         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00623}00623                 lcr |= \mbox{\hyperlink{umcs_8h_ac962df4fcad8a251a619d9f925712dd2}{MCS7840\_UART\_LCR\_STOPB1}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00624}00624                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}  1 stop bit\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00625}00625         \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00626}00626 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00627}00627         lcr \&= \string~MCS7840\_UART\_LCR\_PARITYMASK;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00628}00628         \textcolor{keywordflow}{if} (t-\/>c\_cflag \& PARENB) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00629}00629                 lcr |= \mbox{\hyperlink{umcs_8h_ab4e3c04a19d14ace346b9d553aa1fcf8}{MCS7840\_UART\_LCR\_PARITYON}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00630}00630                 \textcolor{keywordflow}{if} (t-\/>c\_cflag \& PARODD) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00631}00631                         lcr = \mbox{\hyperlink{umcs_8h_a38b71f9aa753817263a173746ef9c42b}{MCS7840\_UART\_LCR\_PARITYODD}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00632}00632                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}  parity on -\/ odd\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00633}00633                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00634}00634                         lcr = \mbox{\hyperlink{umcs_8h_a0c2e6f8684f6f04e09c45ccf961481d1}{MCS7840\_UART\_LCR\_PARITYEVEN}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00635}00635                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}  parity on -\/ even\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00636}00636                 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00637}00637         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00638}00638                 lcr \&= \string~MCS7840\_UART\_LCR\_PARITYON;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00639}00639                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}  parity off\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00640}00640         \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00641}00641 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00642}00642         lcr \&= \string~MCS7840\_UART\_LCR\_DATALENMASK;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00643}00643         \textcolor{keywordflow}{switch} (t-\/>c\_cflag \& CSIZE) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00644}00644         \textcolor{keywordflow}{case} CS5:}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00645}00645                 lcr |= \mbox{\hyperlink{umcs_8h_ab41ca2470c4f2356478f358926129aa0}{MCS7840\_UART\_LCR\_DATALEN5}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00646}00646                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}  5 bit\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00647}00647                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00648}00648         \textcolor{keywordflow}{case} CS6:}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00649}00649                 lcr |= \mbox{\hyperlink{umcs_8h_a6b174d21557ee389922ab83b6e1ddf02}{MCS7840\_UART\_LCR\_DATALEN6}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00650}00650                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}  6 bit\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00651}00651                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00652}00652         \textcolor{keywordflow}{case} CS7:}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00653}00653                 lcr |= \mbox{\hyperlink{umcs_8h_ac628c7d81e92fb01c633d849f5676f41}{MCS7840\_UART\_LCR\_DATALEN7}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00654}00654                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}  7 bit\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00655}00655                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00656}00656         \textcolor{keywordflow}{case} CS8:}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00657}00657                 lcr |= \mbox{\hyperlink{umcs_8h_a7137e6069aa29b2f94ad1ad374bff33a}{MCS7840\_UART\_LCR\_DATALEN8}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00658}00658                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}  8 bit\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00659}00659                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00660}00660         \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00661}00661 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00662}00662         \textcolor{keywordflow}{if} (t-\/>c\_cflag \& CRTSCTS) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00663}00663                 mcr |= \mbox{\hyperlink{umcs_8h_aa8dc20dfbb8db26b65437bd125af6550}{MCS7840\_UART\_MCR\_CTSRTS}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00664}00664                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}  CTS/RTS\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00665}00665         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00666}00666                 mcr \&= \string~MCS7840\_UART\_MCR\_CTSRTS;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00667}00667 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00668}00668         \textcolor{keywordflow}{if} (t-\/>c\_cflag \& (CDTR\_IFLOW | CDSR\_OFLOW)) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00669}00669                 mcr |= \mbox{\hyperlink{umcs_8h_aa0db8297e1c6218bc7f0fa9fe8ea15e7}{MCS7840\_UART\_MCR\_DTRDSR}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00670}00670                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}  DTR/DSR\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00671}00671         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00672}00672                 mcr \&= \string~MCS7840\_UART\_MCR\_DTRDSR;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00673}00673 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00674}00674         sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_ac7995722c7aab73779e1d47382b30cae}{sc\_lcr}} = lcr;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00675}00675         \mbox{\hyperlink{umcs_8c_a0fd2adae17a52832d013fbe35ddc5176}{umcs7840\_set\_UART\_reg\_sync}}(sc, pn, \mbox{\hyperlink{umcs_8h_aa25bf9192b16c25fb9591e23dce18742}{MCS7840\_UART\_REG\_LCR}}, sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_ac7995722c7aab73779e1d47382b30cae}{sc\_lcr}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00676}00676         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Port \%d LCR=\%02x\(\backslash\)n"{}}, pn, sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_ac7995722c7aab73779e1d47382b30cae}{sc\_lcr}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00677}00677 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00678}00678         sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_adc792df8b3d18fd6afb8ce667f8ef150}{sc\_mcr}} = mcr;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00679}00679         \mbox{\hyperlink{umcs_8c_a0fd2adae17a52832d013fbe35ddc5176}{umcs7840\_set\_UART\_reg\_sync}}(sc, pn, \mbox{\hyperlink{umcs_8h_ab230eb0432e60ae619840886f3e7af50}{MCS7840\_UART\_REG\_MCR}}, sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_adc792df8b3d18fd6afb8ce667f8ef150}{sc\_mcr}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00680}00680         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Port \%d MCR=\%02x\(\backslash\)n"{}}, pn, sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_adc792df8b3d18fd6afb8ce667f8ef150}{sc\_mcr}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00681}00681 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00682}00682         \mbox{\hyperlink{umcs_8c_a4cf19216511eecba82e88b03f5a3103a}{umcs7840\_set\_baudrate}}(sc, pn, t-\/>c\_ospeed);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00683}00683 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00684}00684 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00685}00685 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00686}\mbox{\hyperlink{umcs_8c_a96e3c2a99523df0227f7362e5eabfeef}{00686}} \mbox{\hyperlink{umcs_8c_a96e3c2a99523df0227f7362e5eabfeef}{umcs7840\_pre\_param}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom, \textcolor{keyword}{struct} termios *t)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00687}00687 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00688}00688         uint8\_t clk;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00689}00689         uint16\_t divisor;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00690}00690 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00691}00691         \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a700e0b79bb2177a82b2b3a35bee836c6}{umcs7840\_calc\_baudrate}}(t-\/>c\_ospeed, \&divisor, \&clk) || !divisor)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00692}00692                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00693}00693         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00694}00694 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00695}00695 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00696}00696 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00697}\mbox{\hyperlink{umcs_8c_aa1685dadd4a746a2847c8a0446012a75}{00697}} \mbox{\hyperlink{umcs_8c_aa1685dadd4a746a2847c8a0446012a75}{umcs7840\_start\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00698}00698 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00699}00699         \textcolor{keyword}{struct }\mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *sc = ucom-\/>\mbox{\hyperlink{structucom__softc_a4ebbc8663d0291bf6e0ffb93cc2dc70e}{sc\_parent}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00700}00700         uint8\_t pn = ucom-\/>\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00701}00701 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00702}00702         \textcolor{comment}{/* Start interrupt transfer */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00703}00703         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(sc-\/>\mbox{\hyperlink{structumcs7840__softc_ad6ddde2165d29e8a14c96a39ebd5c15a}{sc\_intr\_xfer}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00704}00704 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00705}00705         \textcolor{comment}{/* Start read transfer */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00706}00706         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_a94ccfca49162ec16bb100ea81b43ff7b}{sc\_xfer}}[\mbox{\hyperlink{umcs_8c_a56a0f36da7f9eaaf54bd05cc2bf49173ad56340ed3e7c990aac55cf90a7d3c967}{UMCS7840\_BULK\_RD\_EP}}]);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00707}00707 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00708}00708 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00709}00709 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00710}\mbox{\hyperlink{umcs_8c_a23c9c2c1729f25ec06b8fcb0951cc359}{00710}} \mbox{\hyperlink{umcs_8c_a23c9c2c1729f25ec06b8fcb0951cc359}{umcs7840\_stop\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00711}00711 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00712}00712         \textcolor{keyword}{struct }\mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *sc = ucom-\/>\mbox{\hyperlink{structucom__softc_a4ebbc8663d0291bf6e0ffb93cc2dc70e}{sc\_parent}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00713}00713         uint8\_t pn = ucom-\/>\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00714}00714 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00715}00715         \textcolor{comment}{/* Stop read transfer */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00716}00716         \mbox{\hyperlink{usb__transfer_8c_abe245d973df0cfd6fb96b884d33ebce3}{usbd\_transfer\_stop}}(sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_a94ccfca49162ec16bb100ea81b43ff7b}{sc\_xfer}}[\mbox{\hyperlink{umcs_8c_a56a0f36da7f9eaaf54bd05cc2bf49173ad56340ed3e7c990aac55cf90a7d3c967}{UMCS7840\_BULK\_RD\_EP}}]);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00717}00717 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00718}00718 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00719}00719 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00720}\mbox{\hyperlink{umcs_8c_a7b1e68b61493beb6541bd5905d404b19}{00720}} \mbox{\hyperlink{umcs_8c_a7b1e68b61493beb6541bd5905d404b19}{umcs7840\_start\_write}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00721}00721 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00722}00722         \textcolor{keyword}{struct }\mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *sc = ucom-\/>\mbox{\hyperlink{structucom__softc_a4ebbc8663d0291bf6e0ffb93cc2dc70e}{sc\_parent}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00723}00723         uint8\_t pn = ucom-\/>\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00724}00724 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00725}00725         \textcolor{comment}{/* Start interrupt transfer */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00726}00726         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(sc-\/>\mbox{\hyperlink{structumcs7840__softc_ad6ddde2165d29e8a14c96a39ebd5c15a}{sc\_intr\_xfer}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00727}00727 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00728}00728         \textcolor{comment}{/* Start write transfer */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00729}00729         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_a94ccfca49162ec16bb100ea81b43ff7b}{sc\_xfer}}[\mbox{\hyperlink{umcs_8c_a56a0f36da7f9eaaf54bd05cc2bf49173a15f948939aac39bf7984b708a90636a9}{UMCS7840\_BULK\_WR\_EP}}]);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00730}00730 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00731}00731 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00732}00732 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00733}\mbox{\hyperlink{umcs_8c_a9fc45103858bf8a981c024445ef68583}{00733}} \mbox{\hyperlink{umcs_8c_a9fc45103858bf8a981c024445ef68583}{umcs7840\_stop\_write}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00734}00734 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00735}00735         \textcolor{keyword}{struct }\mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *sc = ucom-\/>\mbox{\hyperlink{structucom__softc_a4ebbc8663d0291bf6e0ffb93cc2dc70e}{sc\_parent}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00736}00736         uint8\_t pn = ucom-\/>\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00737}00737 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00738}00738         \textcolor{comment}{/* Stop write transfer */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00739}00739         \mbox{\hyperlink{usb__transfer_8c_abe245d973df0cfd6fb96b884d33ebce3}{usbd\_transfer\_stop}}(sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[pn].\mbox{\hyperlink{structumcs7840__softc__oneport_a94ccfca49162ec16bb100ea81b43ff7b}{sc\_xfer}}[\mbox{\hyperlink{umcs_8c_a56a0f36da7f9eaaf54bd05cc2bf49173a15f948939aac39bf7984b708a90636a9}{UMCS7840\_BULK\_WR\_EP}}]);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00740}00740 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00741}00741 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00742}00742 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00743}\mbox{\hyperlink{umcs_8c_ac3064d4d80782fbf9a9760a3ee8f6f24}{00743}} \mbox{\hyperlink{umcs_8c_ac3064d4d80782fbf9a9760a3ee8f6f24}{umcs7840\_cfg\_get\_status}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom, uint8\_t *lsr, uint8\_t *msr)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00744}00744 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00745}00745         \textcolor{keyword}{struct }\mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *sc = ucom-\/>\mbox{\hyperlink{structucom__softc_a4ebbc8663d0291bf6e0ffb93cc2dc70e}{sc\_parent}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00746}00746         uint8\_t pn = ucom-\/>\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00747}00747         uint8\_t hw\_msr = 0;     \textcolor{comment}{/* local modem status register */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00748}00748 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00749}00749         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00750}00750 \textcolor{comment}{         * Read status registers.  MSR bits need translation from ns16550 to}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00751}00751 \textcolor{comment}{         * SER\_* values.  LSR bits are ns16550 in hardware and ucom.}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00752}00752 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00753}00753         \mbox{\hyperlink{umcs_8c_acab7a382a4e8a3c3516c192d1abcaa9d}{umcs7840\_get\_UART\_reg\_sync}}(sc, pn, \mbox{\hyperlink{umcs_8h_a4cd294b2573b677cae882d35f59824a6}{MCS7840\_UART\_REG\_LSR}}, lsr);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00754}00754         \mbox{\hyperlink{umcs_8c_acab7a382a4e8a3c3516c192d1abcaa9d}{umcs7840\_get\_UART\_reg\_sync}}(sc, pn, \mbox{\hyperlink{umcs_8h_a51fbbf2e9eea7c304971be5ba5f6a5ea}{MCS7840\_UART\_REG\_MSR}}, \&hw\_msr);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00755}00755 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00756}00756         \textcolor{keywordflow}{if} (hw\_msr \& \mbox{\hyperlink{umcs_8h_a8411ab985ee8bc36845e97a9fd5106f9}{MCS7840\_UART\_MSR\_NEGCTS}})}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00757}00757                 *msr |= SER\_CTS;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00758}00758 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00759}00759         \textcolor{keywordflow}{if} (hw\_msr \& \mbox{\hyperlink{umcs_8h_a679677e07a6c409fac78bed61cd5325b}{MCS7840\_UART\_MSR\_NEGDCD}})}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00760}00760                 *msr |= SER\_DCD;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00761}00761 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00762}00762         \textcolor{keywordflow}{if} (hw\_msr \& \mbox{\hyperlink{umcs_8h_a6e67624f20b58c83a54ad0360dbcd993}{MCS7840\_UART\_MSR\_NEGRI}})}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00763}00763                 *msr |= SER\_RI;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00764}00764 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00765}00765         \textcolor{keywordflow}{if} (hw\_msr \& \mbox{\hyperlink{umcs_8h_aa94c8c61283ada729d90bd28aa0b3f8c}{MCS7840\_UART\_MSR\_NEGDSR}})}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00766}00766                 *msr |= SER\_DSR;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00767}00767 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00768}00768         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Port \%d status: LSR=\%02x MSR=\%02x\(\backslash\)n"{}}, ucom-\/>\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}}, *lsr, *msr);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00769}00769 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00770}00770 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00771}00771 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00772}\mbox{\hyperlink{umcs_8c_a5f278e494f8a0425896f19cd4aac207c}{00772}} \mbox{\hyperlink{umcs_8c_a011fde81829903577c80a6321436f015}{umcs7840\_intr\_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{umcs_8c_source_l00773}00773 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00774}00774         \textcolor{keyword}{struct }\mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *sc = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(xfer);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00775}00775         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__cache}{usb\_page\_cache}} *pc;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00776}00776         uint8\_t buf[13];}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00777}00777         \textcolor{keywordtype}{int} actlen;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00778}00778         \textcolor{keywordtype}{int} subunit;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00779}00779 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00780}00780         \mbox{\hyperlink{usb__transfer_8c_ac0c68320222f26c2a3eba47b46c47899}{usbd\_xfer\_status}}(xfer, \&actlen, NULL, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00781}00781 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00782}00782         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00783}00783         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00784}00784                 \textcolor{keywordflow}{if} (actlen == 5 || actlen == 13) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00785}00785                         pc = \mbox{\hyperlink{usb__transfer_8c_a6e66695b916f0770a259bed959c21555}{usbd\_xfer\_get\_frame}}(xfer, 0);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00786}00786                         \mbox{\hyperlink{usb__busdma_8c_af52eece45b7868dbf58386f4c9e4eb9a}{usbd\_copy\_out}}(pc, 0, buf, actlen);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00787}00787                         \textcolor{comment}{/* Check status of all ports */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00788}00788                         \textcolor{keywordflow}{for} (subunit = 0; subunit < sc-\/>\mbox{\hyperlink{structumcs7840__softc_ac83526ca4a29ec551c7dc5525c80e02a}{sc\_numports}}; ++subunit) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00789}00789                                 uint8\_t pn = sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae2a30ea71f818995e1d4d99f416547c3}{sc\_ucom}}[subunit].\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00790}00790 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00791}00791                                 \textcolor{keywordflow}{if} (buf[pn] \& \mbox{\hyperlink{umcs_8h_a687a02a28811965ffdf8c4b279d1537e}{MCS7840\_UART\_ISR\_NOPENDING}})}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00792}00792                                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00793}00793                                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Port \%d has pending interrupt: \%02x (FIFO: \%02x)\(\backslash\)n"{}}, pn, buf[pn] \& \mbox{\hyperlink{umcs_8h_a6bcc94b9e8e0846965d32c1bf1f28999}{MCS7840\_UART\_ISR\_INTMASK}}, buf[pn] \& (\string~\mbox{\hyperlink{umcs_8h_a6bcc94b9e8e0846965d32c1bf1f28999}{MCS7840\_UART\_ISR\_INTMASK}}));}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00794}00794                                 \textcolor{keywordflow}{switch} (buf[pn] \& \mbox{\hyperlink{umcs_8h_a6bcc94b9e8e0846965d32c1bf1f28999}{MCS7840\_UART\_ISR\_INTMASK}}) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00795}00795                                 \textcolor{keywordflow}{case} \mbox{\hyperlink{umcs_8h_a9ef5a1a3d57dc47262ef32e435a982b0}{MCS7840\_UART\_ISR\_RXERR}}:}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00796}00796                                 \textcolor{keywordflow}{case} \mbox{\hyperlink{umcs_8h_a92a25b4b0e1ddea5e9169ef65704212a}{MCS7840\_UART\_ISR\_RXHASDATA}}:}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00797}00797                                 \textcolor{keywordflow}{case} \mbox{\hyperlink{umcs_8h_abc4bf5577adefc161297f9a10b7d0eb1}{MCS7840\_UART\_ISR\_RXTIMEOUT}}:}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00798}00798                                 \textcolor{keywordflow}{case} \mbox{\hyperlink{umcs_8h_aeecc6caeb487f5810a1f70baa34e16a0}{MCS7840\_UART\_ISR\_MSCHANGE}}:}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00799}00799                                         \mbox{\hyperlink{usb__serial_8c_a0cb07518ed43ec742a628e47a9d97281}{ucom\_status\_change}}(\&sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae2a30ea71f818995e1d4d99f416547c3}{sc\_ucom}}[subunit]);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00800}00800                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00801}00801                                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00802}00802                                         \textcolor{comment}{/* Do nothing */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00803}00803                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00804}00804                                 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00805}00805                         \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00806}00806                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00807}00807                         device\_printf(sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae8ad9bab5d6ced9a6ce23dcffc070e16}{sc\_dev}}, \textcolor{stringliteral}{"{}Invalid interrupt data length \%d"{}}, actlen);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00808}00808                 \textcolor{comment}{/* FALLTHROUGH */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00809}00809         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00810}00810 tr\_setup:}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00811}00811                 \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{umcs_8c_source_l00812}00812                 \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(xfer);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00813}00813                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00814}00814 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00815}00815         \textcolor{keywordflow}{default}:                        \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00816}00816                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}}) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00817}00817                         \textcolor{comment}{/* try to clear stall first */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00818}00818                         \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(xfer);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00819}00819                         \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00820}00820                 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00821}00821                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00822}00822         \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00823}00823 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00824}00824 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00825}00825 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00826}\mbox{\hyperlink{umcs_8c_a9c3f5fee121ba21a9613f14f67e3a45b}{00826}} \mbox{\hyperlink{umcs_8c_aad823c6585b1ca71693c6f75c8b74f07}{umcs7840\_read\_callback1}}(\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{umcs_8c_source_l00827}00827 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00828}00828         \mbox{\hyperlink{umcs_8c_a02dd467d3550c60b752b3bcd3b16be20}{umcs7840\_read\_callbackN}}(xfer, \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}, 0);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00829}00829 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00830}00830 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00831}00831 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00832}\mbox{\hyperlink{umcs_8c_af325ba23d44583ce1cfb368691e30d6c}{00832}} \mbox{\hyperlink{umcs_8c_a738850a59bbe13cda17b4b3433414f4b}{umcs7840\_read\_callback2}}(\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{umcs_8c_source_l00833}00833 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00834}00834         \mbox{\hyperlink{umcs_8c_a02dd467d3550c60b752b3bcd3b16be20}{umcs7840\_read\_callbackN}}(xfer, \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}, 1);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00835}00835 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00836}00836 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00837}\mbox{\hyperlink{umcs_8c_a8265270fb7b2fde51f215b31909d3fdd}{00837}} \mbox{\hyperlink{umcs_8c_a8ca636d414d66054b044dc77686ea2f3}{umcs7840\_read\_callback3}}(\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{umcs_8c_source_l00838}00838 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00839}00839         \mbox{\hyperlink{umcs_8c_a02dd467d3550c60b752b3bcd3b16be20}{umcs7840\_read\_callbackN}}(xfer, \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}, 2);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00840}00840 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00841}00841 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00842}00842 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00843}\mbox{\hyperlink{umcs_8c_ad0f58dbabe7bc53e2dd74d381365faa5}{00843}} \mbox{\hyperlink{umcs_8c_ac6fe0651c8bb488ebdbb8031285f00a3}{umcs7840\_read\_callback4}}(\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{umcs_8c_source_l00844}00844 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00845}00845         \mbox{\hyperlink{umcs_8c_a02dd467d3550c60b752b3bcd3b16be20}{umcs7840\_read\_callbackN}}(xfer, \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}, 3);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00846}00846 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00847}00847 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00848}00848 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00849}\mbox{\hyperlink{umcs_8c_a02dd467d3550c60b752b3bcd3b16be20}{00849}} \mbox{\hyperlink{umcs_8c_a02dd467d3550c60b752b3bcd3b16be20}{umcs7840\_read\_callbackN}}(\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}}, uint8\_t subunit)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00850}00850 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00851}00851         \textcolor{keyword}{struct }\mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *sc = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(xfer);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00852}00852         \textcolor{keyword}{struct }\mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom = \&sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae2a30ea71f818995e1d4d99f416547c3}{sc\_ucom}}[subunit];}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00853}00853         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__cache}{usb\_page\_cache}} *pc;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00854}00854         \textcolor{keywordtype}{int} actlen;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00855}00855 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00856}00856         \mbox{\hyperlink{usb__transfer_8c_ac0c68320222f26c2a3eba47b46c47899}{usbd\_xfer\_status}}(xfer, \&actlen, NULL, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00857}00857 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00858}00858         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Port \%d read, state = \%d, data length = \%d\(\backslash\)n"{}}, ucom-\/>\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}}, \mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(xfer), actlen);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00859}00859 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00860}00860         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00861}00861         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00862}00862                 pc = \mbox{\hyperlink{usb__transfer_8c_a6e66695b916f0770a259bed959c21555}{usbd\_xfer\_get\_frame}}(xfer, 0);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00863}00863                 \mbox{\hyperlink{usb__serial_8c_af96494685ba012ad6a1c2e18b783e185}{ucom\_put\_data}}(ucom, pc, 0, actlen);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00864}00864                 \textcolor{comment}{/* FALLTHROUGH */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00865}00865         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00866}00866 tr\_setup:}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00867}00867                 \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{umcs_8c_source_l00868}00868                 \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(xfer);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00869}00869                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00870}00870 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00871}00871         \textcolor{keywordflow}{default}:                        \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00872}00872                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}}) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00873}00873                         \textcolor{comment}{/* try to clear stall first */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00874}00874                         \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(xfer);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00875}00875                         \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00876}00876                 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00877}00877                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00878}00878         \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00879}00879 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00880}00880 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00881}00881 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00882}\mbox{\hyperlink{umcs_8c_ad4a32dcbfca33d0ba3d0706c7df28a07}{00882}} \mbox{\hyperlink{umcs_8c_a21c4074f3171b295a45267671c90adee}{umcs7840\_write\_callback1}}(\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{umcs_8c_source_l00883}00883 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00884}00884         \mbox{\hyperlink{umcs_8c_aaa0f97d7d92cfe9c767e62aaabe40f73}{umcs7840\_write\_callbackN}}(xfer, \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}, 0);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00885}00885 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00886}00886 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00887}00887 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00888}\mbox{\hyperlink{umcs_8c_a5ba5d36bc850358f07a9ad89a303197c}{00888}} \mbox{\hyperlink{umcs_8c_aa9bc65fdbf0e81142ac59b7c8793788d}{umcs7840\_write\_callback2}}(\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{umcs_8c_source_l00889}00889 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00890}00890         \mbox{\hyperlink{umcs_8c_aaa0f97d7d92cfe9c767e62aaabe40f73}{umcs7840\_write\_callbackN}}(xfer, \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}, 1);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00891}00891 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00892}00892 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00893}00893 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00894}\mbox{\hyperlink{umcs_8c_ada98127ced2066923e50e25b8fa63914}{00894}} \mbox{\hyperlink{umcs_8c_a2a827b20905c56bba68b26c32663e723}{umcs7840\_write\_callback3}}(\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{umcs_8c_source_l00895}00895 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00896}00896         \mbox{\hyperlink{umcs_8c_aaa0f97d7d92cfe9c767e62aaabe40f73}{umcs7840\_write\_callbackN}}(xfer, \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}, 2);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00897}00897 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00898}00898 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00899}00899 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00900}\mbox{\hyperlink{umcs_8c_a683ccd837c03794d4e83d2888aa330a2}{00900}} \mbox{\hyperlink{umcs_8c_a89b95854766e8631efd2bf003c3ca160}{umcs7840\_write\_callback4}}(\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{umcs_8c_source_l00901}00901 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00902}00902         \mbox{\hyperlink{umcs_8c_aaa0f97d7d92cfe9c767e62aaabe40f73}{umcs7840\_write\_callbackN}}(xfer, \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}, 3);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00903}00903 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00904}00904 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00905}00905 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00906}\mbox{\hyperlink{umcs_8c_aaa0f97d7d92cfe9c767e62aaabe40f73}{00906}} \mbox{\hyperlink{umcs_8c_aaa0f97d7d92cfe9c767e62aaabe40f73}{umcs7840\_write\_callbackN}}(\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}}, uint8\_t subunit)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00907}00907 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00908}00908         \textcolor{keyword}{struct }\mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *sc = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(xfer);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00909}00909         \textcolor{keyword}{struct }\mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom = \&sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae2a30ea71f818995e1d4d99f416547c3}{sc\_ucom}}[subunit];}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00910}00910         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__cache}{usb\_page\_cache}} *pc;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00911}00911         uint32\_t actlen;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00912}00912 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00913}00913         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Port \%d write, state = \%d\(\backslash\)n"{}}, ucom-\/>\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}}, \mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(xfer));}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00914}00914 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00915}00915         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00916}00916         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00917}00917         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00918}00918 tr\_setup:}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00919}00919                 pc = \mbox{\hyperlink{usb__transfer_8c_a6e66695b916f0770a259bed959c21555}{usbd\_xfer\_get\_frame}}(xfer, 0);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00920}00920                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__serial_8c_a014a131e1bce5fb84d1788e48a69733f}{ucom\_get\_data}}(ucom, pc, 0, \mbox{\hyperlink{usb__transfer_8c_ae34a7cc2f01c6dfb68bca6fd0b72647e}{usbd\_xfer\_max\_len}}(xfer), \&actlen)) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00921}00921                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Port \%d write, has \%d bytes\(\backslash\)n"{}}, ucom-\/>\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}}, actlen);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00922}00922                         \mbox{\hyperlink{usb__transfer_8c_a31786497f0f4222203b1e993d52af753}{usbd\_xfer\_set\_frame\_len}}(xfer, 0, actlen);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00923}00923                         \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(xfer);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00924}00924                 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00925}00925                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00926}00926 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00927}00927         \textcolor{keywordflow}{default}:                        \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00928}00928                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}}) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00929}00929                         \textcolor{comment}{/* try to clear stall first */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00930}00930                         \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(xfer);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00931}00931                         \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00932}00932                 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00933}00933                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00934}00934         \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00935}00935 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00936}00936 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00937}00937 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00938}\mbox{\hyperlink{umcs_8c_af98b5eaa5c90131db3be868dafa014fa}{00938}} \mbox{\hyperlink{umcs_8c_af98b5eaa5c90131db3be868dafa014fa}{umcs7840\_poll}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structucom__softc}{ucom\_softc}} *ucom)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00939}00939 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00940}00940         \textcolor{keyword}{struct }\mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *sc = ucom-\/>\mbox{\hyperlink{structucom__softc_a4ebbc8663d0291bf6e0ffb93cc2dc70e}{sc\_parent}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00941}00941 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00942}00942         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Port \%d poll\(\backslash\)n"{}}, ucom-\/>\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00943}00943         \mbox{\hyperlink{usb__transfer_8c_ab2036eadf83fca25cf0d8cdec16d7227}{usbd\_transfer\_poll}}(sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[ucom-\/>\mbox{\hyperlink{structucom__softc_a1d0ce36f176e9cf057a14649f92b105d}{sc\_portno}}].\mbox{\hyperlink{structumcs7840__softc__oneport_a94ccfca49162ec16bb100ea81b43ff7b}{sc\_xfer}}, \mbox{\hyperlink{umcs_8c_a56a0f36da7f9eaaf54bd05cc2bf49173aa450eb75b378095c6b1e670d92978927}{UMCS7840\_N\_TRANSFERS}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00944}00944         \mbox{\hyperlink{usb__transfer_8c_ab2036eadf83fca25cf0d8cdec16d7227}{usbd\_transfer\_poll}}(\&sc-\/>\mbox{\hyperlink{structumcs7840__softc_ad6ddde2165d29e8a14c96a39ebd5c15a}{sc\_intr\_xfer}}, 1);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00945}00945 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00946}00946 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00947}00947 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00948}\mbox{\hyperlink{umcs_8c_a47f3cdb539f3ab9b8301169f35bdd09b}{00948}} \mbox{\hyperlink{umcs_8c_a47f3cdb539f3ab9b8301169f35bdd09b}{umcs7840\_get\_reg\_sync}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *sc, uint8\_t \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}}, uint8\_t *data)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00949}00949 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00950}00950         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}} \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00951}00951         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00952}00952         uint16\_t \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00953}00953 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00954}00954         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bmRequestType = \mbox{\hyperlink{usb_8h_a6da49500e864a3c33c9eed3dd49d3e59}{UT\_READ\_VENDOR\_DEVICE}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00955}00955         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bRequest = \mbox{\hyperlink{umcs_8h_a4e7cd3d68c3d33c830a8a3b3c251693f}{MCS7840\_RDREQ}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00956}00956         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wValue, 0);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00957}00957         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wIndex, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00958}00958         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wLength, \mbox{\hyperlink{umcs_8h_ad4725eebf0467d3e4b1328bc9cf686e0}{UMCS7840\_READ\_LENGTH}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00959}00959 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00960}00960         err = \mbox{\hyperlink{usb__request_8c_a73f73fb03dfe97412ded971a42984bd8}{usbd\_do\_request\_proc}}(sc-\/>\mbox{\hyperlink{structumcs7840__softc_a92ef69845ae252cb0c563899fd98a133}{sc\_udev}}, \&sc-\/>\mbox{\hyperlink{structumcs7840__softc_a6ed12cefc798a49b57aadc76ef1a00c8}{sc\_super\_ucom}}.\mbox{\hyperlink{structucom__super__softc_ad752a6557ba770bd576bdba62a4c1af8}{sc\_tq}}, \&\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}, (\textcolor{keywordtype}{void} *)data, 0, \&\mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}}, \mbox{\hyperlink{umcs_8h_a14ae7b6118f9b7ebeb7f707a10b787f6}{UMCS7840\_CTRL\_TIMEOUT}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00961}00961         \textcolor{keywordflow}{if} (err == \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a01e440e0629669433dd14bc477757c74}{USB\_ERR\_NORMAL\_COMPLETION}} \&\& \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} != 1) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00962}00962                 device\_printf(sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae8ad9bab5d6ced9a6ce23dcffc070e16}{sc\_dev}}, \textcolor{stringliteral}{"{}Reading register \%d failed: invalid length \%d\(\backslash\)n"{}}, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}}, \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00963}00963                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945ac568d752239d287fca75588222df1bdf}{USB\_ERR\_INVAL}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00964}00964         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00965}00965                 device\_printf(sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae8ad9bab5d6ced9a6ce23dcffc070e16}{sc\_dev}}, \textcolor{stringliteral}{"{}Reading register \%d failed: \%s\(\backslash\)n"{}}, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}}, \mbox{\hyperlink{usb__error_8c_a2391eb446dce3e4368cacf781857774e}{usbd\_errstr}}(err));}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00966}00966         \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00967}00967 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00968}00968 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00969}00969 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00970}\mbox{\hyperlink{umcs_8c_a37440031909237a3039fe64250454a48}{00970}} \mbox{\hyperlink{umcs_8c_a37440031909237a3039fe64250454a48}{umcs7840\_set\_reg\_sync}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *sc, uint8\_t \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}}, uint8\_t data)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00971}00971 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00972}00972         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}} \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00973}00973         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00974}00974 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00975}00975         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bmRequestType = \mbox{\hyperlink{usb_8h_a6aafebff48631e00449299005c4a858c}{UT\_WRITE\_VENDOR\_DEVICE}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00976}00976         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bRequest = \mbox{\hyperlink{umcs_8h_a45806fc0d792c93e37d3ce97d325b1af}{MCS7840\_WRREQ}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00977}00977         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wValue, data);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00978}00978         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wIndex, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00979}00979         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wLength, 0);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00980}00980 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00981}00981         err = \mbox{\hyperlink{usb__request_8c_a73f73fb03dfe97412ded971a42984bd8}{usbd\_do\_request\_proc}}(sc-\/>\mbox{\hyperlink{structumcs7840__softc_a92ef69845ae252cb0c563899fd98a133}{sc\_udev}}, \&sc-\/>\mbox{\hyperlink{structumcs7840__softc_a6ed12cefc798a49b57aadc76ef1a00c8}{sc\_super\_ucom}}.\mbox{\hyperlink{structucom__super__softc_ad752a6557ba770bd576bdba62a4c1af8}{sc\_tq}}, \&\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}, NULL, 0, NULL, \mbox{\hyperlink{umcs_8h_a14ae7b6118f9b7ebeb7f707a10b787f6}{UMCS7840\_CTRL\_TIMEOUT}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00982}00982         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00983}00983                 device\_printf(sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae8ad9bab5d6ced9a6ce23dcffc070e16}{sc\_dev}}, \textcolor{stringliteral}{"{}Writing register \%d failed: \%s\(\backslash\)n"{}}, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}}, \mbox{\hyperlink{usb__error_8c_a2391eb446dce3e4368cacf781857774e}{usbd\_errstr}}(err));}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00984}00984 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00985}00985         \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00986}00986 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00987}00987 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00988}00988 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00989}\mbox{\hyperlink{umcs_8c_acab7a382a4e8a3c3516c192d1abcaa9d}{00989}} \mbox{\hyperlink{umcs_8c_acab7a382a4e8a3c3516c192d1abcaa9d}{umcs7840\_get\_UART\_reg\_sync}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *sc, uint8\_t portno, uint8\_t \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}}, uint8\_t *data)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00990}00990 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00991}00991         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}} \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00992}00992         uint16\_t wVal;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00993}00993         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00994}00994         uint16\_t \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00995}00995 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00996}00996         \textcolor{comment}{/* portno is port number */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00997}00997         wVal = ((uint16\_t)(portno + 1)) << 8;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00998}00998 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l00999}00999         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bmRequestType = \mbox{\hyperlink{usb_8h_a6da49500e864a3c33c9eed3dd49d3e59}{UT\_READ\_VENDOR\_DEVICE}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01000}01000         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bRequest = \mbox{\hyperlink{umcs_8h_a4e7cd3d68c3d33c830a8a3b3c251693f}{MCS7840\_RDREQ}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01001}01001         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wValue, wVal);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01002}01002         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wIndex, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01003}01003         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wLength, \mbox{\hyperlink{umcs_8h_ad4725eebf0467d3e4b1328bc9cf686e0}{UMCS7840\_READ\_LENGTH}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01004}01004 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01005}01005         err = \mbox{\hyperlink{usb__request_8c_a73f73fb03dfe97412ded971a42984bd8}{usbd\_do\_request\_proc}}(sc-\/>\mbox{\hyperlink{structumcs7840__softc_a92ef69845ae252cb0c563899fd98a133}{sc\_udev}}, \&sc-\/>\mbox{\hyperlink{structumcs7840__softc_a6ed12cefc798a49b57aadc76ef1a00c8}{sc\_super\_ucom}}.\mbox{\hyperlink{structucom__super__softc_ad752a6557ba770bd576bdba62a4c1af8}{sc\_tq}}, \&\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}, (\textcolor{keywordtype}{void} *)data, 0, \&\mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}}, \mbox{\hyperlink{umcs_8h_a14ae7b6118f9b7ebeb7f707a10b787f6}{UMCS7840\_CTRL\_TIMEOUT}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01006}01006         \textcolor{keywordflow}{if} (err == \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945a01e440e0629669433dd14bc477757c74}{USB\_ERR\_NORMAL\_COMPLETION}} \&\& \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} != 1) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01007}01007                 device\_printf(sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae8ad9bab5d6ced9a6ce23dcffc070e16}{sc\_dev}}, \textcolor{stringliteral}{"{}Reading UART\%d register \%d failed: invalid length \%d\(\backslash\)n"{}}, portno, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}}, \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01008}01008                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945ac568d752239d287fca75588222df1bdf}{USB\_ERR\_INVAL}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01009}01009         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01010}01010                 device\_printf(sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae8ad9bab5d6ced9a6ce23dcffc070e16}{sc\_dev}}, \textcolor{stringliteral}{"{}Reading UART\%d register \%d failed: \%s\(\backslash\)n"{}}, portno, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}}, \mbox{\hyperlink{usb__error_8c_a2391eb446dce3e4368cacf781857774e}{usbd\_errstr}}(err));}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01011}01011         \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01012}01012 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01013}01013 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01014}01014 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01015}\mbox{\hyperlink{umcs_8c_a0fd2adae17a52832d013fbe35ddc5176}{01015}} \mbox{\hyperlink{umcs_8c_a0fd2adae17a52832d013fbe35ddc5176}{umcs7840\_set\_UART\_reg\_sync}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *sc, uint8\_t portno, uint8\_t \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}}, uint8\_t data)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01016}01016 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01017}01017         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}} \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01018}01018         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01019}01019         uint16\_t wVal;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01020}01020 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01021}01021         \textcolor{comment}{/* portno is port number */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01022}01022         wVal = ((uint16\_t)(portno + 1)) << 8 | data;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01023}01023 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01024}01024         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bmRequestType = \mbox{\hyperlink{usb_8h_a6aafebff48631e00449299005c4a858c}{UT\_WRITE\_VENDOR\_DEVICE}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01025}01025         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bRequest = \mbox{\hyperlink{umcs_8h_a45806fc0d792c93e37d3ce97d325b1af}{MCS7840\_WRREQ}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01026}01026         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wValue, wVal);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01027}01027         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wIndex, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01028}01028         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wLength, 0);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01029}01029 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01030}01030         err = \mbox{\hyperlink{usb__request_8c_a73f73fb03dfe97412ded971a42984bd8}{usbd\_do\_request\_proc}}(sc-\/>\mbox{\hyperlink{structumcs7840__softc_a92ef69845ae252cb0c563899fd98a133}{sc\_udev}}, \&sc-\/>\mbox{\hyperlink{structumcs7840__softc_a6ed12cefc798a49b57aadc76ef1a00c8}{sc\_super\_ucom}}.\mbox{\hyperlink{structucom__super__softc_ad752a6557ba770bd576bdba62a4c1af8}{sc\_tq}}, \&\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}, NULL, 0, NULL, \mbox{\hyperlink{umcs_8h_a14ae7b6118f9b7ebeb7f707a10b787f6}{UMCS7840\_CTRL\_TIMEOUT}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01031}01031         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01032}01032                 device\_printf(sc-\/>\mbox{\hyperlink{structumcs7840__softc_ae8ad9bab5d6ced9a6ce23dcffc070e16}{sc\_dev}}, \textcolor{stringliteral}{"{}Writing UART\%d register \%d failed: \%s\(\backslash\)n"{}}, portno, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}}, \mbox{\hyperlink{usb__error_8c_a2391eb446dce3e4368cacf781857774e}{usbd\_errstr}}(err));}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01033}01033         \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01034}01034 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01035}01035 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01036}01036 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01037}\mbox{\hyperlink{umcs_8c_a4cf19216511eecba82e88b03f5a3103a}{01037}} \mbox{\hyperlink{umcs_8c_a4cf19216511eecba82e88b03f5a3103a}{umcs7840\_set\_baudrate}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structumcs7840__softc}{umcs7840\_softc}} *sc, uint8\_t portno, uint32\_t rate)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01038}01038 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01039}01039         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01040}01040         uint16\_t divisor;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01041}01041         uint8\_t clk;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01042}01042         uint8\_t data;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01043}01043 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01044}01044         \textcolor{keywordflow}{if} (\mbox{\hyperlink{umcs_8c_a700e0b79bb2177a82b2b3a35bee836c6}{umcs7840\_calc\_baudrate}}(rate, \&divisor, \&clk)) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01045}01045                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Port \%d bad speed: \%d\(\backslash\)n"{}}, portno, rate);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01046}01046                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01047}01047         \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01048}01048         \textcolor{keywordflow}{if} (divisor == 0 || (clk \& \mbox{\hyperlink{umcs_8h_ae756200b8e3d6f78fa2365f7e84cd6bb}{MCS7840\_DEV\_SPx\_CLOCK\_MASK}}) != clk) \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01049}01049                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Port \%d bad speed calculation: \%d\(\backslash\)n"{}}, portno, rate);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01050}01050                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01051}01051         \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01052}01052         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}Port \%d set speed: \%d (\%02x / \%d)\(\backslash\)n"{}}, portno, rate, clk, divisor);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01053}01053 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01054}01054         \textcolor{comment}{/* Set clock source for standard BAUD frequences */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01055}01055         err = \mbox{\hyperlink{umcs_8c_a47f3cdb539f3ab9b8301169f35bdd09b}{umcs7840\_get\_reg\_sync}}(sc, \mbox{\hyperlink{structumcs7840__port__registers}{umcs7840\_port\_registers}}[portno].reg\_sp, \&data);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01056}01056         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01057}01057                 \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01058}01058         data \&= \mbox{\hyperlink{umcs_8h_ae756200b8e3d6f78fa2365f7e84cd6bb}{MCS7840\_DEV\_SPx\_CLOCK\_MASK}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01059}01059         data |= clk;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01060}01060         err = \mbox{\hyperlink{umcs_8c_a37440031909237a3039fe64250454a48}{umcs7840\_set\_reg\_sync}}(sc, \mbox{\hyperlink{structumcs7840__port__registers}{umcs7840\_port\_registers}}[portno].reg\_sp, data);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01061}01061         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01062}01062                 \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01063}01063 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01064}01064         \textcolor{comment}{/* Set divider */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01065}01065         sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[portno].\mbox{\hyperlink{structumcs7840__softc__oneport_ac7995722c7aab73779e1d47382b30cae}{sc\_lcr}} |= \mbox{\hyperlink{umcs_8h_aad42dc91b5c79916f68f1e870c267bdd}{MCS7840\_UART\_LCR\_DIVISORS}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01066}01066         err = \mbox{\hyperlink{umcs_8c_a0fd2adae17a52832d013fbe35ddc5176}{umcs7840\_set\_UART\_reg\_sync}}(sc, portno, \mbox{\hyperlink{umcs_8h_aa25bf9192b16c25fb9591e23dce18742}{MCS7840\_UART\_REG\_LCR}}, sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[portno].\mbox{\hyperlink{structumcs7840__softc__oneport_ac7995722c7aab73779e1d47382b30cae}{sc\_lcr}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01067}01067         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01068}01068                 \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01069}01069 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01070}01070         err = \mbox{\hyperlink{umcs_8c_a0fd2adae17a52832d013fbe35ddc5176}{umcs7840\_set\_UART\_reg\_sync}}(sc, portno, \mbox{\hyperlink{umcs_8h_a250fe79a3a648b30f144a9872ff49b47}{MCS7840\_UART\_REG\_DLL}}, (uint8\_t)(divisor \& 0xff));}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01071}01071         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01072}01072                 \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01073}01073         err = \mbox{\hyperlink{umcs_8c_a0fd2adae17a52832d013fbe35ddc5176}{umcs7840\_set\_UART\_reg\_sync}}(sc, portno, \mbox{\hyperlink{umcs_8h_af1fc2edb0183b4322a7abf96850ca969}{MCS7840\_UART\_REG\_DLM}}, (uint8\_t)((divisor >> 8) \& 0xff));}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01074}01074         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01075}01075                 \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01076}01076 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01077}01077         \textcolor{comment}{/* Turn off access to DLL/DLM registers of UART */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01078}01078         sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[portno].\mbox{\hyperlink{structumcs7840__softc__oneport_ac7995722c7aab73779e1d47382b30cae}{sc\_lcr}} \&= \string~MCS7840\_UART\_LCR\_DIVISORS;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01079}01079         err = \mbox{\hyperlink{umcs_8c_a0fd2adae17a52832d013fbe35ddc5176}{umcs7840\_set\_UART\_reg\_sync}}(sc, portno, \mbox{\hyperlink{umcs_8h_aa25bf9192b16c25fb9591e23dce18742}{MCS7840\_UART\_REG\_LCR}}, sc-\/>\mbox{\hyperlink{structumcs7840__softc_a9e69e0e71d289cbf6841c3d0654519ca}{sc\_ports}}[portno].\mbox{\hyperlink{structumcs7840__softc__oneport_ac7995722c7aab73779e1d47382b30cae}{sc\_lcr}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01080}01080         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01081}01081                 \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01082}01082         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01083}01083 \}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01084}01084 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01085}01085 \textcolor{comment}{/* Maximum speeds for standard frequences, when PLL is not used */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01086}\mbox{\hyperlink{umcs_8c_a2f6d5ae668df8774cb4df01290c09d01}{01086}} \textcolor{keyword}{static} \textcolor{keyword}{const} uint32\_t \mbox{\hyperlink{umcs_8c_a2f6d5ae668df8774cb4df01290c09d01}{umcs7840\_baudrate\_divisors}}[] = \{0, 115200, 230400, 403200, 460800, 806400, 921600, 1572864, 3145728,\};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01087}\mbox{\hyperlink{umcs_8c_a4271fd6527816839434330c5588df45f}{01087}} \textcolor{keyword}{static} \textcolor{keyword}{const} uint8\_t \mbox{\hyperlink{umcs_8c_a4271fd6527816839434330c5588df45f}{umcs7840\_baudrate\_divisors\_len}} = nitems(\mbox{\hyperlink{umcs_8c_a2f6d5ae668df8774cb4df01290c09d01}{umcs7840\_baudrate\_divisors}});}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01088}01088 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01089}01089 \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01090}\mbox{\hyperlink{umcs_8c_a700e0b79bb2177a82b2b3a35bee836c6}{01090}} \mbox{\hyperlink{umcs_8c_a700e0b79bb2177a82b2b3a35bee836c6}{umcs7840\_calc\_baudrate}}(uint32\_t rate, uint16\_t *divisor, uint8\_t *clk)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01091}01091 \{}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01092}01092         uint8\_t i = 0;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01093}01093 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01094}01094         \textcolor{keywordflow}{if} (rate > \mbox{\hyperlink{umcs_8c_a2f6d5ae668df8774cb4df01290c09d01}{umcs7840\_baudrate\_divisors}}[\mbox{\hyperlink{umcs_8c_a4271fd6527816839434330c5588df45f}{umcs7840\_baudrate\_divisors\_len}} -\/ 1])}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01095}01095                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01096}01096 }
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01097}01097         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{umcs_8c_a4271fd6527816839434330c5588df45f}{umcs7840\_baudrate\_divisors\_len}} -\/ 1 \&\&}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01098}01098             !(rate > \mbox{\hyperlink{umcs_8c_a2f6d5ae668df8774cb4df01290c09d01}{umcs7840\_baudrate\_divisors}}[i] \&\& rate <= \mbox{\hyperlink{umcs_8c_a2f6d5ae668df8774cb4df01290c09d01}{umcs7840\_baudrate\_divisors}}[i + 1]); ++i);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01099}01099         \textcolor{keywordflow}{if} (rate == 0)}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01100}01100                 *divisor = 1;   \textcolor{comment}{/* XXX */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01101}01101         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01102}01102                 *divisor = \mbox{\hyperlink{umcs_8c_a2f6d5ae668df8774cb4df01290c09d01}{umcs7840\_baudrate\_divisors}}[i + 1] / rate;}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01103}01103         \textcolor{comment}{/* 0x00 .. 0x70 */}}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01104}01104         *clk = i << \mbox{\hyperlink{umcs_8h_a09ac9eaf7cd1af89c952a6c3da8dfd07}{MCS7840\_DEV\_SPx\_CLOCK\_SHIFT}};}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01105}01105         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{umcs_8c_source_l01106}01106 \}}

\end{DoxyCode}
