\hypertarget{if__mos_8c_source}{}\doxysection{if\+\_\+mos.\+c}
\label{if__mos_8c_source}\index{dev/usb/net/if\_mos.c@{dev/usb/net/if\_mos.c}}
\mbox{\hyperlink{if__mos_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: (BSD-\/1-\/Clause AND BSD-\/4-\/Clause)}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2011 Rick van der Zwet <info@rickvanderzwet.nl>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00005}00005 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00006}00006 \textcolor{comment}{ * Permission to use, copy, modify, and distribute this software for any}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00007}00007 \textcolor{comment}{ * purpose with or without fee is hereby granted, provided that the above}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00008}00008 \textcolor{comment}{ * copyright notice and this permission notice appear in all copies.}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00009}00009 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00010}00010 \textcolor{comment}{ * THE SOFTWARE IS PROVIDED "{}AS IS"{} AND THE AUTHOR DISCLAIMS ALL WARRANTIES}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00011}00011 \textcolor{comment}{ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00012}00012 \textcolor{comment}{ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00013}00013 \textcolor{comment}{ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00014}00014 \textcolor{comment}{ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00015}00015 \textcolor{comment}{ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00016}00016 \textcolor{comment}{ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00017}00017 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00018}00018 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00019}00019 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00020}00020 \textcolor{comment}{ * Copyright (c) 2008 Johann Christian Rode <jcrode@gmx.net>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00021}00021 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00022}00022 \textcolor{comment}{ * Permission to use, copy, modify, and distribute this software for any}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00023}00023 \textcolor{comment}{ * purpose with or without fee is hereby granted, provided that the above}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00024}00024 \textcolor{comment}{ * copyright notice and this permission notice appear in all copies.}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00025}00025 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00026}00026 \textcolor{comment}{ * THE SOFTWARE IS PROVIDED "{}AS IS"{} AND THE AUTHOR DISCLAIMS ALL WARRANTIES}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00027}00027 \textcolor{comment}{ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00028}00028 \textcolor{comment}{ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00029}00029 \textcolor{comment}{ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00030}00030 \textcolor{comment}{ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00031}00031 \textcolor{comment}{ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00032}00032 \textcolor{comment}{ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00033}00033 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00034}00034 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00035}00035 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00036}00036 \textcolor{comment}{ * Copyright (c) 2005, 2006, 2007 Jonathan Gray <jsg@openbsd.org>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00037}00037 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00038}00038 \textcolor{comment}{ * Permission to use, copy, modify, and distribute this software for any}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00039}00039 \textcolor{comment}{ * purpose with or without fee is hereby granted, provided that the above}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00040}00040 \textcolor{comment}{ * copyright notice and this permission notice appear in all copies.}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00041}00041 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00042}00042 \textcolor{comment}{ * THE SOFTWARE IS PROVIDED "{}AS IS"{} AND THE AUTHOR DISCLAIMS ALL WARRANTIES}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00043}00043 \textcolor{comment}{ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00044}00044 \textcolor{comment}{ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00045}00045 \textcolor{comment}{ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00046}00046 \textcolor{comment}{ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00047}00047 \textcolor{comment}{ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00048}00048 \textcolor{comment}{ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00049}00049 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00050}00050 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00051}00051 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00052}00052 \textcolor{comment}{ * Copyright (c) 1997, 1998, 1999, 2000-\/2003}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00053}00053 \textcolor{comment}{ *      Bill Paul <wpaul@windriver.com>.  All rights reserved.}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00054}00054 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00055}00055 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00056}00056 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00057}00057 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00058}00058 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00059}00059 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00060}00060 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00061}00061 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00062}00062 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00063}00063 \textcolor{comment}{ * 3. All advertising materials mentioning features or use of this software}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00064}00064 \textcolor{comment}{ *    must display the following acknowledgement:}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00065}00065 \textcolor{comment}{ *      This product includes software developed by Bill Paul.}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00066}00066 \textcolor{comment}{ * 4. Neither the name of the author nor the names of any co-\/contributors}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00067}00067 \textcolor{comment}{ *    may be used to endorse or promote products derived from this software}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00068}00068 \textcolor{comment}{ *    without specific prior written permission.}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00069}00069 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00070}00070 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00071}00071 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00072}00072 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00073}00073 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00074}00074 \textcolor{comment}{ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00075}00075 \textcolor{comment}{ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00076}00076 \textcolor{comment}{ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00077}00077 \textcolor{comment}{ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00078}00078 \textcolor{comment}{ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00079}00079 \textcolor{comment}{ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00080}00080 \textcolor{comment}{ * THE POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00081}00081 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00082}00082 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00083}00083 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00084}\mbox{\hyperlink{if__mos_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00084}} \mbox{\hyperlink{if__mos_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00085}00085 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00086}00086 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00087}00087 \textcolor{comment}{ * Moschip MCS7730/MCS7830/MCS7832 USB to Ethernet controller}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00088}00088 \textcolor{comment}{ * The datasheet is available at the following URL:}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00089}00089 \textcolor{comment}{ * http://www.moschip.com/data/products/MCS7830/Data\%20Sheet\_7830.pdf}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00090}00090 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00091}00091 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00092}00092 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00093}00093 \textcolor{comment}{ * The FreeBSD if\_mos.c driver is based on various different sources:}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00094}00094 \textcolor{comment}{ * The vendor provided driver at the following URL:}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00095}00095 \textcolor{comment}{ * http://www.moschip.com/data/products/MCS7830/Driver\_FreeBSD\_7830.tar.gz}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00096}00096 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00097}00097 \textcolor{comment}{ * Mixed together with the OpenBSD if\_mos.c driver for validation and checking}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00098}00098 \textcolor{comment}{ * and the FreeBSD if\_reu.c as reference for the USB Ethernet framework.}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00099}00099 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00100}00100 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00101}00101 \textcolor{preprocessor}{\#include <sys/stdint.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00102}00102 \textcolor{preprocessor}{\#include <sys/stddef.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00103}00103 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00104}00104 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00105}00105 \textcolor{preprocessor}{\#include <sys/types.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00106}00106 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00107}00107 \textcolor{preprocessor}{\#include <sys/socket.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00108}00108 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00109}00109 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00110}00110 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00111}00111 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00112}00112 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00113}00113 \textcolor{preprocessor}{\#include <sys/condvar.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00114}00114 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00115}00115 \textcolor{preprocessor}{\#include <sys/sx.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00116}00116 \textcolor{preprocessor}{\#include <sys/unistd.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00117}00117 \textcolor{preprocessor}{\#include <sys/callout.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00118}00118 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00119}00119 \textcolor{preprocessor}{\#include <sys/priv.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00120}00120 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00121}00121 \textcolor{preprocessor}{\#include <net/if.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00122}00122 \textcolor{preprocessor}{\#include <net/if\_var.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00123}00123 \textcolor{preprocessor}{\#include <net/if\_media.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00124}00124 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00125}00125 \textcolor{preprocessor}{\#include <dev/mii/mii.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00126}00126 \textcolor{preprocessor}{\#include <dev/mii/miivar.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00127}00127 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00128}00128 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb_8h}{dev/usb/usb.h}}>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00129}00129 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usbdi_8h}{dev/usb/usbdi.h}}>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00130}00130 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usbdi__util_8h}{dev/usb/usbdi\_util.h}}>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00131}00131 \textcolor{preprocessor}{\#include "{}usbdevs.h"{}}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00132}00132 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00133}\mbox{\hyperlink{if__mos_8c_a927dd6f59caf10a2991dfb564bcbb1e1}{00133}} \textcolor{preprocessor}{\#define USB\_DEBUG\_VAR mos\_debug}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00134}00134 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__debug_8h}{dev/usb/usb\_debug.h}}>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00135}00135 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__process_8h}{dev/usb/usb\_process.h}}>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00136}00136 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00137}00137 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__ethernet_8h}{dev/usb/net/usb\_ethernet.h}}>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00138}00138 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00139}00139 \textcolor{preprocessor}{\#include "{}miibus\_if.h"{}}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00140}00140 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00141}00141 \textcolor{comment}{//\#include <dev/usb/net/if\_mosreg.h>}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00142}00142 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{if__mosreg_8h}{if\_mosreg.h}}"{}}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00143}00143 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00144}00144 \textcolor{preprocessor}{\#ifdef USB\_DEBUG}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00145}00145 \textcolor{keyword}{static} \textcolor{keywordtype}{int} mos\_debug = 0;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00146}00146 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00147}00147 \textcolor{keyword}{static} \mbox{\hyperlink{dwc__otg_8c_a58e125bcf985ce2333baef42f97b33b3}{SYSCTL\_NODE}}(\_hw\_usb, OID\_AUTO, mos, CTLFLAG\_RW | CTLFLAG\_MPSAFE, 0,}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00148}00148     \textcolor{stringliteral}{"{}USB mos"{}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00149}00149 \mbox{\hyperlink{dwc__otg_8c_a83d020f0b15dc2783f3f1a6966c75e36}{SYSCTL\_INT}}(\_hw\_usb\_mos, OID\_AUTO, \mbox{\hyperlink{cfumass_8c_ac3e1795766a80ec63b157951b4b9a7d4}{debug}}, CTLFLAG\_RWTUN, \&mos\_debug, 0,}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00150}00150     \textcolor{stringliteral}{"{}Debug level"{}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00151}00151 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00152}00152 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00153}\mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{00153}} \textcolor{preprocessor}{\#define MOS\_DPRINTFN(fmt,...) \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00154}00154 \textcolor{preprocessor}{  DPRINTF("{}mos: \%s: "{}} fmt "{}\(\backslash\)n"{},\_\_FUNCTION\_\_,\#\# \_\_VA\_ARGS\_\_)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00155}00155 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00156}\mbox{\hyperlink{if__mos_8c_a00ab059cdfc9316747494286818e8fd3}{00156}} \textcolor{preprocessor}{\#define USB\_PRODUCT\_MOSCHIP\_MCS7730     0x7730}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00157}\mbox{\hyperlink{if__mos_8c_aec8dc453fbde2716955056b890aefff9}{00157}} \textcolor{preprocessor}{\#define USB\_PRODUCT\_SITECOMEU\_LN030     0x0021}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00158}00158 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00159}00159 \textcolor{comment}{/* Various supported device vendors/products. */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00160}\mbox{\hyperlink{if__mos_8c_a789393d758f48b24dce4329172836447}{00160}} \textcolor{keyword}{static} \textcolor{keyword}{const} \mbox{\hyperlink{usbdi_8h_acf836fd8d6349b66a31f45420728da8d}{STRUCT\_USB\_HOST\_ID}} \mbox{\hyperlink{if__mos_8c_a789393d758f48b24dce4329172836447}{mos\_devs}}[] = \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00161}00161         \{\mbox{\hyperlink{usbdi_8h_acdab3edd999014815e8baeb9b33e9071}{USB\_VPI}}(USB\_VENDOR\_MOSCHIP, \mbox{\hyperlink{if__mos_8c_a00ab059cdfc9316747494286818e8fd3}{USB\_PRODUCT\_MOSCHIP\_MCS7730}}, \mbox{\hyperlink{if__mosreg_8h_a24def44e21e30c8ce4ec259b56df4575}{MCS7730}})\},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00162}00162         \{\mbox{\hyperlink{usbdi_8h_acdab3edd999014815e8baeb9b33e9071}{USB\_VPI}}(USB\_VENDOR\_MOSCHIP, USB\_PRODUCT\_MOSCHIP\_MCS7830, \mbox{\hyperlink{if__mosreg_8h_aac65bd247ca9dd888c5d8785741f5357}{MCS7830}})\},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00163}00163         \{\mbox{\hyperlink{usbdi_8h_acdab3edd999014815e8baeb9b33e9071}{USB\_VPI}}(USB\_VENDOR\_MOSCHIP, USB\_PRODUCT\_MOSCHIP\_MCS7832, \mbox{\hyperlink{if__mosreg_8h_a172f8ce19cbc87d3ba1c3c00b043d8fb}{MCS7832}})\},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00164}00164         \{\mbox{\hyperlink{usbdi_8h_acdab3edd999014815e8baeb9b33e9071}{USB\_VPI}}(USB\_VENDOR\_SITECOMEU, \mbox{\hyperlink{if__mos_8c_aec8dc453fbde2716955056b890aefff9}{USB\_PRODUCT\_SITECOMEU\_LN030}}, \mbox{\hyperlink{if__mosreg_8h_aac65bd247ca9dd888c5d8785741f5357}{MCS7830}})\},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00165}00165 \};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00166}00166 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00167}00167 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__mos_8c_a0d2387e15170bb0d3558902187601b87}{mos\_probe}}(device\_t dev);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00168}00168 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__mos_8c_a820606620dc062c8e38ce39ab6738d3a}{mos\_attach}}(device\_t dev);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00169}00169 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__mos_8c_a1fd211bc25e218516ad5325d866b01dc}{mos\_attach\_post}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__ether}{usb\_ether}} *ue);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00170}00170 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__mos_8c_a43f1289e5b53ace9fe72bd28a32fa1a3}{mos\_detach}}(device\_t dev);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00171}00171 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00172}00172 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__mos_8c_a17a6d378c0fafb48ac338e653a045eab}{mos\_bulk\_read\_callback}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00173}00173 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__mos_8c_ae6f4c54b933ad3a332a9723076c3fe5d}{mos\_bulk\_write\_callback}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00174}00174 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__mos_8c_aff9ba65ac87295ba58e30a851a1ebd66}{mos\_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{if__mos_8c_source_l00175}00175 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__mos_8c_a691f9b2e00d6eccbf010e6abc6c3508f}{mos\_tick}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__ether}{usb\_ether}} *);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00176}00176 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__mos_8c_a8abaa9a2d666cc000f6ceffd338fc046}{mos\_start}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__ether}{usb\_ether}} *);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00177}00177 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__mos_8c_aa6aeb1a1c4b7d8b985f13ce39555b291}{mos\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__ether}{usb\_ether}} *);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00178}00178 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__mos_8c_aad76ec8a8a252012bdb0d269d5b202de}{mos\_chip\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmos__softc}{mos\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00179}00179 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__mos_8c_acc15408bcee8b3a75796e00ae40b7efb}{mos\_stop}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__ether}{usb\_ether}} *);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00180}00180 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__mos_8c_a6e5ce8426f160e02ed488a234b24fff8}{mos\_miibus\_readreg}}(device\_t, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00181}00181 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__mos_8c_a0f638455cd13d9e04fb3aad00295c3d7}{mos\_miibus\_writereg}}(device\_t, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00182}00182 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__mos_8c_add45a6e5a81982db63a1585089bf6874}{mos\_miibus\_statchg}}(device\_t);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00183}00183 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__mos_8c_a94f8e614c1067e6c0c0031d5fe71afc2}{mos\_ifmedia\_upd}}(\textcolor{keyword}{struct} ifnet *);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00184}00184 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__mos_8c_a65305ce0aa1aae77b48d22c9141e5527}{mos\_ifmedia\_sts}}(\textcolor{keyword}{struct} ifnet *, \textcolor{keyword}{struct} ifmediareq *);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00185}00185 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__mos_8c_a0128369d4b3b60d5d65a95f0f7e7f7b0}{mos\_reset}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00186}00186 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00187}00187 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__mos_8c_a9598bc22a9ec25b5dce4c568cfba9389}{mos\_reg\_read\_1}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmos__softc}{mos\_softc}} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00188}00188 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__mos_8c_a028d1e991e51a759d57f41d2520c9908}{mos\_reg\_read\_2}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmos__softc}{mos\_softc}} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00189}00189 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__mos_8c_aae5b990aa12060d75d401e0c535b9a22}{mos\_reg\_write\_1}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmos__softc}{mos\_softc}} *, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00190}00190 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__mos_8c_a519f10b135df8ed69daa17c51d1345f5}{mos\_reg\_write\_2}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmos__softc}{mos\_softc}} *, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00191}\mbox{\hyperlink{if__mos_8c_a3ca27168d11064b67f8e3ee9edffe909}{00191}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__mos_8c_a3ca27168d11064b67f8e3ee9edffe909}{mos\_readmac}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmos__softc}{mos\_softc}} *, uint8\_t *);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00192}00192 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__mos_8c_ab1dba016357a5953996518b2d2b63aa5}{mos\_writemac}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmos__softc}{mos\_softc}} *, uint8\_t *);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00193}00193 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__mos_8c_ab2df70dbb4f4938db43ecc556fe28701}{mos\_write\_mcast}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmos__softc}{mos\_softc}} *, u\_char *);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00194}00194 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00195}00195 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__mos_8c_a6c68d52ef474f58c2ce76a9a69419178}{mos\_setmulti}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__ether}{usb\_ether}} *);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00196}00196 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__mos_8c_a6f4e9058f06079fc33ac703060700be5}{mos\_setpromisc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__ether}{usb\_ether}} *);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00197}00197 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00198}\mbox{\hyperlink{if__mos_8c_acbc81a65a531f2be142a4e6effe6215f}{00198}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__config}{usb\_config}} \mbox{\hyperlink{if__mos_8c_acbc81a65a531f2be142a4e6effe6215f}{mos\_config}}[\mbox{\hyperlink{if__mosreg_8h_ade4ff7f0aa619097019a2a3f629be166}{MOS\_ENDPT\_MAX}}] = \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00199}00199         [\mbox{\hyperlink{if__mosreg_8h_a29abfbd927463b69f55448cf96ef26a2}{MOS\_ENDPT\_TX}}] = \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00200}00200                 .\mbox{\hyperlink{structusb__config_a5bd5d569870291a54d9bed8377ed8b10}{type}} = \mbox{\hyperlink{usb_8h_a25240fc009aa67bb7a2b635d2e9401e4}{UE\_BULK}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00201}00201                 .endpoint = \mbox{\hyperlink{usb_8h_a1e8d1f402536e634471569b83f603197}{UE\_ADDR\_ANY}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00202}00202                 .direction = \mbox{\hyperlink{usb_8h_a9a98e1bc9388db2ab5213e9d6496e851}{UE\_DIR\_OUT}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00203}00203                 .bufsize = (MCLBYTES + 2),}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00204}00204                 .\mbox{\hyperlink{structusb__config_a0e7feb3ff903ed490f21c1e5b128fc71}{flags}} = \{.\mbox{\hyperlink{structusb__xfer__flags_a1d8753add0a6492b5dc13e1fba50106c}{pipe\_bof}} = 1,.force\_short\_xfer = 1,\},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00205}00205                 .callback = \mbox{\hyperlink{if__mos_8c_ae6f4c54b933ad3a332a9723076c3fe5d}{mos\_bulk\_write\_callback}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00206}00206                 .timeout = 10000,}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00207}00207         \},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00208}00208 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00209}00209         [\mbox{\hyperlink{if__mosreg_8h_aef4173612503f9dd300a2102d84d970e}{MOS\_ENDPT\_RX}}] = \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00210}00210                 .type = \mbox{\hyperlink{usb_8h_a25240fc009aa67bb7a2b635d2e9401e4}{UE\_BULK}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00211}00211                 .endpoint = \mbox{\hyperlink{usb_8h_a1e8d1f402536e634471569b83f603197}{UE\_ADDR\_ANY}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00212}00212                 .direction = \mbox{\hyperlink{usb_8h_a72bb077a860132c175c166f344c75893}{UE\_DIR\_IN}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00213}00213                 .bufsize = (MCLBYTES + 4 + ETHER\_CRC\_LEN),}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00214}00214                 .\mbox{\hyperlink{structusb__config_a0e7feb3ff903ed490f21c1e5b128fc71}{flags}} = \{.\mbox{\hyperlink{structusb__xfer__flags_a1d8753add0a6492b5dc13e1fba50106c}{pipe\_bof}} = 1,.short\_xfer\_ok = 1,\},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00215}00215                 .callback = \mbox{\hyperlink{if__mos_8c_a17a6d378c0fafb48ac338e653a045eab}{mos\_bulk\_read\_callback}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00216}00216         \},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00217}00217 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00218}00218         [\mbox{\hyperlink{if__mosreg_8h_afa11e637cbf6219bf2328c48ebea43c8}{MOS\_ENDPT\_INTR}}] = \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00219}00219                 .type = \mbox{\hyperlink{usb_8h_a01e28e87ad16f6dfffefc6ccab08baed}{UE\_INTERRUPT}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00220}00220                 .endpoint = \mbox{\hyperlink{usb_8h_a1e8d1f402536e634471569b83f603197}{UE\_ADDR\_ANY}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00221}00221                 .direction = \mbox{\hyperlink{usb_8h_a72bb077a860132c175c166f344c75893}{UE\_DIR\_IN}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00222}00222                 .flags = \{.pipe\_bof = 1,.short\_xfer\_ok = 1,\},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00223}00223                 .bufsize = 0,}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00224}00224                 .callback = \mbox{\hyperlink{if__mos_8c_aff9ba65ac87295ba58e30a851a1ebd66}{mos\_intr\_callback}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00225}00225         \},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00226}00226 \};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00227}00227 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00228}\mbox{\hyperlink{if__mos_8c_ae3371fe0296ff25b00f4cdc71b029b05}{00228}} \textcolor{keyword}{static} device\_method\_t \mbox{\hyperlink{if__mos_8c_ae3371fe0296ff25b00f4cdc71b029b05}{mos\_methods}}[] = \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00229}00229         \textcolor{comment}{/* Device interface */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00230}00230         DEVMETHOD(device\_probe, \mbox{\hyperlink{if__mos_8c_a0d2387e15170bb0d3558902187601b87}{mos\_probe}}),}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00231}00231         DEVMETHOD(device\_attach, \mbox{\hyperlink{if__mos_8c_a820606620dc062c8e38ce39ab6738d3a}{mos\_attach}}),}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00232}00232         DEVMETHOD(device\_detach, \mbox{\hyperlink{if__mos_8c_a43f1289e5b53ace9fe72bd28a32fa1a3}{mos\_detach}}),}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00233}00233 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00234}00234         \textcolor{comment}{/* MII interface */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00235}00235         DEVMETHOD(miibus\_readreg, \mbox{\hyperlink{if__mos_8c_a6e5ce8426f160e02ed488a234b24fff8}{mos\_miibus\_readreg}}),}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00236}00236         DEVMETHOD(miibus\_writereg, \mbox{\hyperlink{if__mos_8c_a0f638455cd13d9e04fb3aad00295c3d7}{mos\_miibus\_writereg}}),}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00237}00237         DEVMETHOD(miibus\_statchg, \mbox{\hyperlink{if__mos_8c_add45a6e5a81982db63a1585089bf6874}{mos\_miibus\_statchg}}),}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00238}00238 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00239}00239         DEVMETHOD\_END}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00240}00240 \};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00241}00241 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00242}\mbox{\hyperlink{if__mos_8c_a6e802bc1f396b6eec2f460b8535436e0}{00242}} \textcolor{keyword}{static} driver\_t \mbox{\hyperlink{if__mos_8c_a6e802bc1f396b6eec2f460b8535436e0}{mos\_driver}} = \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00243}00243         .name = \textcolor{stringliteral}{"{}mos"{}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00244}00244         .methods = \mbox{\hyperlink{if__mos_8c_ae3371fe0296ff25b00f4cdc71b029b05}{mos\_methods}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00245}00245         .size = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structmos__softc}{mos\_softc}})}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00246}00246 \};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00247}00247 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00248}\mbox{\hyperlink{if__mos_8c_a75071c183ece87ebf3764d8810ebf53a}{00248}} \textcolor{keyword}{static} devclass\_t \mbox{\hyperlink{if__mos_8c_a75071c183ece87ebf3764d8810ebf53a}{mos\_devclass}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00249}00249 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00250}\mbox{\hyperlink{if__mos_8c_a600a62bc5468edba36c3efd553ab03c2}{00250}} \mbox{\hyperlink{if__mos_8c_a600a62bc5468edba36c3efd553ab03c2}{DRIVER\_MODULE}}(mos, uhub, \mbox{\hyperlink{if__mos_8c_a6e802bc1f396b6eec2f460b8535436e0}{mos\_driver}}, \mbox{\hyperlink{if__mos_8c_a75071c183ece87ebf3764d8810ebf53a}{mos\_devclass}}, NULL, 0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00251}\mbox{\hyperlink{if__mos_8c_a5f67ce70a471a2f99a255d2b3eac78c2}{00251}} \mbox{\hyperlink{if__mos_8c_a600a62bc5468edba36c3efd553ab03c2}{DRIVER\_MODULE}}(miibus, mos, miibus\_driver, miibus\_devclass, 0, 0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00252}\mbox{\hyperlink{if__mos_8c_a6a6bcc0d702f62619ca78e7f4ca9f351}{00252}} \mbox{\hyperlink{if__mos_8c_a6a6bcc0d702f62619ca78e7f4ca9f351}{MODULE\_DEPEND}}(mos, uether, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00253}\mbox{\hyperlink{if__mos_8c_a80fbb0c425981b952b3ccb4b4fa2670d}{00253}} \mbox{\hyperlink{if__mos_8c_a6a6bcc0d702f62619ca78e7f4ca9f351}{MODULE\_DEPEND}}(mos, \mbox{\hyperlink{usb__if_8m_adfa3f6da9c4881e494b180c4ebb06470}{usb}}, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00254}\mbox{\hyperlink{if__mos_8c_a67b151d2deb45b6d5085f49df3f8082a}{00254}} \mbox{\hyperlink{if__mos_8c_a6a6bcc0d702f62619ca78e7f4ca9f351}{MODULE\_DEPEND}}(mos, ether, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00255}\mbox{\hyperlink{if__mos_8c_a10d981f9cbfb643f12ef860389c7b130}{00255}} \mbox{\hyperlink{if__mos_8c_a6a6bcc0d702f62619ca78e7f4ca9f351}{MODULE\_DEPEND}}(mos, miibus, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00256}\mbox{\hyperlink{if__mos_8c_a355e4ed377fe32f867bf8bc613e2eba0}{00256}} \mbox{\hyperlink{if__mos_8c_a355e4ed377fe32f867bf8bc613e2eba0}{USB\_PNP\_HOST\_INFO}}(\mbox{\hyperlink{if__mos_8c_a789393d758f48b24dce4329172836447}{mos\_devs}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00257}00257 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00258}\mbox{\hyperlink{if__mos_8c_aed9b2a92bf32da3b5de5d20a154b8dbb}{00258}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__ether__methods}{usb\_ether\_methods}} \mbox{\hyperlink{if__mos_8c_aed9b2a92bf32da3b5de5d20a154b8dbb}{mos\_ue\_methods}} = \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00259}00259         .\mbox{\hyperlink{structusb__ether__methods_a9568a90d86c68824b84eb6e5ccc7ebfc}{ue\_attach\_post}} = \mbox{\hyperlink{if__mos_8c_a1fd211bc25e218516ad5325d866b01dc}{mos\_attach\_post}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00260}00260         .ue\_start = \mbox{\hyperlink{if__mos_8c_a8abaa9a2d666cc000f6ceffd338fc046}{mos\_start}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00261}00261         .ue\_init = \mbox{\hyperlink{if__mos_8c_aa6aeb1a1c4b7d8b985f13ce39555b291}{mos\_init}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00262}00262         .ue\_stop = \mbox{\hyperlink{if__mos_8c_acc15408bcee8b3a75796e00ae40b7efb}{mos\_stop}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00263}00263         .ue\_tick = \mbox{\hyperlink{if__mos_8c_a691f9b2e00d6eccbf010e6abc6c3508f}{mos\_tick}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00264}00264         .ue\_setmulti = \mbox{\hyperlink{if__mos_8c_a6c68d52ef474f58c2ce76a9a69419178}{mos\_setmulti}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00265}00265         .ue\_setpromisc = \mbox{\hyperlink{if__mos_8c_a6f4e9058f06079fc33ac703060700be5}{mos\_setpromisc}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00266}00266         .ue\_mii\_upd = \mbox{\hyperlink{if__mos_8c_a94f8e614c1067e6c0c0031d5fe71afc2}{mos\_ifmedia\_upd}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00267}00267         .ue\_mii\_sts = \mbox{\hyperlink{if__mos_8c_a65305ce0aa1aae77b48d22c9141e5527}{mos\_ifmedia\_sts}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00268}00268 \};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00269}00269 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00270}00270 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00271}\mbox{\hyperlink{if__mos_8c_a9598bc22a9ec25b5dce4c568cfba9389}{00271}} \mbox{\hyperlink{if__mos_8c_a9598bc22a9ec25b5dce4c568cfba9389}{mos\_reg\_read\_1}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc, \textcolor{keywordtype}{int} \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}})}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00272}00272 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00273}00273         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}} \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00274}00274         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00275}00275         \mbox{\hyperlink{usb__endian_8h_a4dea376b5cd0c5d694660473f5e7a459}{uByte}} \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} = 0;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00276}00276 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00277}00277         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bmRequestType = \mbox{\hyperlink{usb_8h_a6da49500e864a3c33c9eed3dd49d3e59}{UT\_READ\_VENDOR\_DEVICE}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00278}00278         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bRequest = \mbox{\hyperlink{if__mosreg_8h_a48740abde7e8fda842c0743f4c01a6e1}{MOS\_UR\_READREG}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00279}00279         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wValue, 0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00280}00280         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wIndex, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00281}00281         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wLength, 1);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00282}00282 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00283}00283         err = \mbox{\hyperlink{usb__ethernet_8h_a273a1683cef752bf3069d84f08f1925d}{uether\_do\_request}}(\&sc-\/>\mbox{\hyperlink{structmos__softc_a50b6d2c15a9cfe33126529cdf0ac3f16}{sc\_ue}}, \&\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}, \&\mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}}, 1000);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00284}00284 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00285}00285         \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00286}00286                 \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}mos\_reg\_read\_1 error, reg: \%d\(\backslash\)n"{}}, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00287}00287                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00288}00288         \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00289}00289         \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00290}00290 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00291}00291 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00292}00292 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00293}\mbox{\hyperlink{if__mos_8c_a028d1e991e51a759d57f41d2520c9908}{00293}} \mbox{\hyperlink{if__mos_8c_a028d1e991e51a759d57f41d2520c9908}{mos\_reg\_read\_2}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc, \textcolor{keywordtype}{int} \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}})}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00294}00294 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00295}00295         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}} \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00296}00296         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00297}00297         \mbox{\hyperlink{usb__endian_8h_ad3086c1130ab6b88c53220166e3b5129}{uWord}} \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00298}00298 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00299}00299         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}}, 0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00300}00300 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00301}00301         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bmRequestType = \mbox{\hyperlink{usb_8h_a6da49500e864a3c33c9eed3dd49d3e59}{UT\_READ\_VENDOR\_DEVICE}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00302}00302         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bRequest = \mbox{\hyperlink{if__mosreg_8h_a48740abde7e8fda842c0743f4c01a6e1}{MOS\_UR\_READREG}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00303}00303         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wValue, 0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00304}00304         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wIndex, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00305}00305         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wLength, 2);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00306}00306 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00307}00307         err = \mbox{\hyperlink{usb__ethernet_8h_a273a1683cef752bf3069d84f08f1925d}{uether\_do\_request}}(\&sc-\/>\mbox{\hyperlink{structmos__softc_a50b6d2c15a9cfe33126529cdf0ac3f16}{sc\_ue}}, \&\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}, \&\mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}}, 1000);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00308}00308 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00309}00309         \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00310}00310                 \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}mos\_reg\_read\_2 error, reg: \%d"{}}, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00311}00311                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00312}00312         \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00313}00313         \textcolor{keywordflow}{return} (\mbox{\hyperlink{usb__endian_8h_aa3860f9452db3a5d865cc943e2f01829}{UGETW}}(\mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}}));}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00314}00314 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00315}00315 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00316}00316 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00317}\mbox{\hyperlink{if__mos_8c_aae5b990aa12060d75d401e0c535b9a22}{00317}} \mbox{\hyperlink{if__mos_8c_aae5b990aa12060d75d401e0c535b9a22}{mos\_reg\_write\_1}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc, \textcolor{keywordtype}{int} \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}}, \textcolor{keywordtype}{int} aval)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00318}00318 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00319}00319         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}} \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00320}00320         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00321}00321         \mbox{\hyperlink{usb__endian_8h_a4dea376b5cd0c5d694660473f5e7a459}{uByte}} \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00322}00322         \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} = aval;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00323}00323 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00324}00324         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bmRequestType = \mbox{\hyperlink{usb_8h_a6aafebff48631e00449299005c4a858c}{UT\_WRITE\_VENDOR\_DEVICE}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00325}00325         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bRequest = \mbox{\hyperlink{if__mosreg_8h_aba22096fb2fccf6f0f7f0f7d5493ea35}{MOS\_UR\_WRITEREG}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00326}00326         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wValue, 0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00327}00327         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wIndex, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00328}00328         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wLength, 1);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00329}00329 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00330}00330         err = \mbox{\hyperlink{usb__ethernet_8h_a273a1683cef752bf3069d84f08f1925d}{uether\_do\_request}}(\&sc-\/>\mbox{\hyperlink{structmos__softc_a50b6d2c15a9cfe33126529cdf0ac3f16}{sc\_ue}}, \&\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}, \&\mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}}, 1000);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00331}00331 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00332}00332         \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00333}00333                 \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}mos\_reg\_write\_1 error, reg: \%d"{}}, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00334}00334                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00335}00335         \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00336}00336         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00337}00337 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00338}00338 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00339}00339 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00340}\mbox{\hyperlink{if__mos_8c_a519f10b135df8ed69daa17c51d1345f5}{00340}} \mbox{\hyperlink{if__mos_8c_a519f10b135df8ed69daa17c51d1345f5}{mos\_reg\_write\_2}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc, \textcolor{keywordtype}{int} \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}}, \textcolor{keywordtype}{int} aval)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00341}00341 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00342}00342         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}} \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00343}00343         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00344}00344         \mbox{\hyperlink{usb__endian_8h_ad3086c1130ab6b88c53220166e3b5129}{uWord}} \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00345}00345 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00346}00346         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}}, aval);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00347}00347 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00348}00348         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bmRequestType = \mbox{\hyperlink{usb_8h_a6aafebff48631e00449299005c4a858c}{UT\_WRITE\_VENDOR\_DEVICE}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00349}00349         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bRequest = \mbox{\hyperlink{if__mosreg_8h_aba22096fb2fccf6f0f7f0f7d5493ea35}{MOS\_UR\_WRITEREG}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00350}00350         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wValue, 0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00351}00351         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wIndex, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00352}00352         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wLength, 2);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00353}00353 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00354}00354         err = \mbox{\hyperlink{usb__ethernet_8h_a273a1683cef752bf3069d84f08f1925d}{uether\_do\_request}}(\&sc-\/>\mbox{\hyperlink{structmos__softc_a50b6d2c15a9cfe33126529cdf0ac3f16}{sc\_ue}}, \&\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}, \&\mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}}, 1000);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00355}00355 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00356}00356         \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00357}00357                 \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}mos\_reg\_write\_2 error, reg: \%d"{}}, \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00358}00358                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00359}00359         \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00360}00360         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00361}00361 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00362}00362 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00363}00363 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00364}\mbox{\hyperlink{if__mos_8c_abeddef957e0f28d8384fa3c19a168cb9}{00364}} \mbox{\hyperlink{if__mos_8c_a3ca27168d11064b67f8e3ee9edffe909}{mos\_readmac}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc, u\_char *mac)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00365}00365 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00366}00366         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}} \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00367}00367         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00368}00368 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00369}00369         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bmRequestType = \mbox{\hyperlink{usb_8h_a6da49500e864a3c33c9eed3dd49d3e59}{UT\_READ\_VENDOR\_DEVICE}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00370}00370         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bRequest = \mbox{\hyperlink{if__mosreg_8h_a48740abde7e8fda842c0743f4c01a6e1}{MOS\_UR\_READREG}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00371}00371         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wValue, 0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00372}00372         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wIndex, \mbox{\hyperlink{if__mosreg_8h_a0e9447d9d33e504176d4a7be17535eea}{MOS\_MAC}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00373}00373         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wLength, ETHER\_ADDR\_LEN);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00374}00374 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00375}00375         err = \mbox{\hyperlink{usb__ethernet_8h_a273a1683cef752bf3069d84f08f1925d}{uether\_do\_request}}(\&sc-\/>\mbox{\hyperlink{structmos__softc_a50b6d2c15a9cfe33126529cdf0ac3f16}{sc\_ue}}, \&\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}, mac, 1000);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00376}00376 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00377}00377         \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00378}00378                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00379}00379         \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00380}00380         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00381}00381 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00382}00382 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00383}00383 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00384}\mbox{\hyperlink{if__mos_8c_ab1dba016357a5953996518b2d2b63aa5}{00384}} \mbox{\hyperlink{if__mos_8c_ab1dba016357a5953996518b2d2b63aa5}{mos\_writemac}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc, uint8\_t *mac)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00385}00385 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00386}00386         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}} \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00387}00387         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00388}00388 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00389}00389         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bmRequestType = \mbox{\hyperlink{usb_8h_a6aafebff48631e00449299005c4a858c}{UT\_WRITE\_VENDOR\_DEVICE}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00390}00390         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bRequest = \mbox{\hyperlink{if__mosreg_8h_aba22096fb2fccf6f0f7f0f7d5493ea35}{MOS\_UR\_WRITEREG}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00391}00391         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wValue, 0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00392}00392         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wIndex, \mbox{\hyperlink{if__mosreg_8h_a0e9447d9d33e504176d4a7be17535eea}{MOS\_MAC}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00393}00393         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wLength, ETHER\_ADDR\_LEN);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00394}00394 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00395}00395         err = \mbox{\hyperlink{usb__ethernet_8h_a273a1683cef752bf3069d84f08f1925d}{uether\_do\_request}}(\&sc-\/>\mbox{\hyperlink{structmos__softc_a50b6d2c15a9cfe33126529cdf0ac3f16}{sc\_ue}}, \&\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}, mac, 1000);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00396}00396 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00397}00397         \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00398}00398                 \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}mos\_writemac error"{}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00399}00399                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00400}00400         \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00401}00401         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00402}00402 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00403}00403 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00404}00404 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00405}\mbox{\hyperlink{if__mos_8c_ab2df70dbb4f4938db43ecc556fe28701}{00405}} \mbox{\hyperlink{if__mos_8c_ab2df70dbb4f4938db43ecc556fe28701}{mos\_write\_mcast}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc, u\_char *hashtbl)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00406}00406 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00407}00407         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}} \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00408}00408         \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} err;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00409}00409 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00410}00410         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bmRequestType = \mbox{\hyperlink{usb_8h_a6aafebff48631e00449299005c4a858c}{UT\_WRITE\_VENDOR\_DEVICE}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00411}00411         \mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.bRequest = \mbox{\hyperlink{if__mosreg_8h_aba22096fb2fccf6f0f7f0f7d5493ea35}{MOS\_UR\_WRITEREG}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00412}00412         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wValue, 0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00413}00413         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wIndex, \mbox{\hyperlink{if__mosreg_8h_ac44591e6c3fa5fad639eda10a328e001}{MOS\_MCAST\_TABLE}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00414}00414         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}.wLength, 8);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00415}00415 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00416}00416         err = \mbox{\hyperlink{usb__ethernet_8h_a273a1683cef752bf3069d84f08f1925d}{uether\_do\_request}}(\&sc-\/>\mbox{\hyperlink{structmos__softc_a50b6d2c15a9cfe33126529cdf0ac3f16}{sc\_ue}}, \&\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}, hashtbl, 1000);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00417}00417 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00418}00418         \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00419}00419                 \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}mos\_reg\_mcast error"{}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00420}00420                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00421}00421         \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00422}00422         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00423}00423 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00424}00424 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00425}00425 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00426}\mbox{\hyperlink{if__mos_8c_a6e5ce8426f160e02ed488a234b24fff8}{00426}} \mbox{\hyperlink{if__mos_8c_a6e5ce8426f160e02ed488a234b24fff8}{mos\_miibus\_readreg}}(device\_t dev, \textcolor{keywordtype}{int} phy, \textcolor{keywordtype}{int} \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}})}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00427}00427 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00428}00428         \textcolor{keyword}{struct }\mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00429}00429         \mbox{\hyperlink{usb__endian_8h_ad3086c1130ab6b88c53220166e3b5129}{uWord}} \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00430}00430         \textcolor{keywordtype}{int} i, res, locked;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00431}00431 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00432}00432         \mbox{\hyperlink{usb__endian_8h_a69f5ba903a605cb9dc7eed2ad905f2dc}{USETW}}(\mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}}, 0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00433}00433 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00434}00434         locked = mtx\_owned(\&sc-\/>\mbox{\hyperlink{structmos__softc_a7c2fce1535e676bf9c5a4eeb95424a6a}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00435}00435         \textcolor{keywordflow}{if} (!locked)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00436}00436                 \mbox{\hyperlink{if__mosreg_8h_ae48c800df32d1036fe032256cb37cf1f}{MOS\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00437}00437 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00438}00438         \mbox{\hyperlink{if__mos_8c_a519f10b135df8ed69daa17c51d1345f5}{mos\_reg\_write\_2}}(sc, \mbox{\hyperlink{if__mosreg_8h_a92694b88b436a5d803c16b0685c730cf}{MOS\_PHY\_DATA}}, 0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00439}00439         \mbox{\hyperlink{if__mos_8c_aae5b990aa12060d75d401e0c535b9a22}{mos\_reg\_write\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_a60aef8ae2928b72ea7dc5a4716031073}{MOS\_PHY\_CTL}}, (phy \& \mbox{\hyperlink{if__mosreg_8h_ad37c1d540e630742417faf2be1b7de8a}{MOS\_PHYCTL\_PHYADDR}}) |}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00440}00440             \mbox{\hyperlink{if__mosreg_8h_a31186e964feffa86710f1ae0431ca983}{MOS\_PHYCTL\_READ}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00441}00441         \mbox{\hyperlink{if__mos_8c_aae5b990aa12060d75d401e0c535b9a22}{mos\_reg\_write\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_ae60454ff2a3f903aa1209543c44e0b6e}{MOS\_PHY\_STS}}, (\mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} \& \mbox{\hyperlink{if__mosreg_8h_a062791d70c72cb962ab3666125acb7e2}{MOS\_PHYSTS\_PHYREG}}) |}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00442}00442             \mbox{\hyperlink{if__mosreg_8h_aea9feee6e502541817c81a7db9c57f2f}{MOS\_PHYSTS\_PENDING}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00443}00443 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00444}00444         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__mosreg_8h_aff365c105ebad26d1a1380c63ae7862a}{MOS\_TIMEOUT}}; i++) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00445}00445                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__mos_8c_a9598bc22a9ec25b5dce4c568cfba9389}{mos\_reg\_read\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_ae60454ff2a3f903aa1209543c44e0b6e}{MOS\_PHY\_STS}}) \& \mbox{\hyperlink{if__mosreg_8h_a5305356e55254b791d4f3e4251d84635}{MOS\_PHYSTS\_READY}})}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00446}00446                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00447}00447         \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00448}00448         \textcolor{keywordflow}{if} (i == \mbox{\hyperlink{if__mosreg_8h_aff365c105ebad26d1a1380c63ae7862a}{MOS\_TIMEOUT}}) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00449}00449                 \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}MII read timeout"{}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00450}00450         \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00451}00451         res = \mbox{\hyperlink{if__mos_8c_a028d1e991e51a759d57f41d2520c9908}{mos\_reg\_read\_2}}(sc, \mbox{\hyperlink{if__mosreg_8h_a92694b88b436a5d803c16b0685c730cf}{MOS\_PHY\_DATA}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00452}00452 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00453}00453         \textcolor{keywordflow}{if} (!locked)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00454}00454                 \mbox{\hyperlink{if__mosreg_8h_a12b5ab009d85ba855c5b885466b95f8c}{MOS\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00455}00455         \textcolor{keywordflow}{return} (res);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00456}00456 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00457}00457 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00458}00458 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00459}\mbox{\hyperlink{if__mos_8c_a0f638455cd13d9e04fb3aad00295c3d7}{00459}} \mbox{\hyperlink{if__mos_8c_a0f638455cd13d9e04fb3aad00295c3d7}{mos\_miibus\_writereg}}(device\_t dev, \textcolor{keywordtype}{int} phy, \textcolor{keywordtype}{int} \mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}}, \textcolor{keywordtype}{int} \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}})}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00460}00460 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00461}00461         \textcolor{keyword}{struct }\mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00462}00462         \textcolor{keywordtype}{int} i, locked;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00463}00463 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00464}00464         locked = mtx\_owned(\&sc-\/>\mbox{\hyperlink{structmos__softc_a7c2fce1535e676bf9c5a4eeb95424a6a}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00465}00465         \textcolor{keywordflow}{if} (!locked)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00466}00466                 \mbox{\hyperlink{if__mosreg_8h_ae48c800df32d1036fe032256cb37cf1f}{MOS\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00467}00467 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00468}00468         \mbox{\hyperlink{if__mos_8c_a519f10b135df8ed69daa17c51d1345f5}{mos\_reg\_write\_2}}(sc, \mbox{\hyperlink{if__mosreg_8h_a92694b88b436a5d803c16b0685c730cf}{MOS\_PHY\_DATA}}, \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00469}00469         \mbox{\hyperlink{if__mos_8c_aae5b990aa12060d75d401e0c535b9a22}{mos\_reg\_write\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_a60aef8ae2928b72ea7dc5a4716031073}{MOS\_PHY\_CTL}}, (phy \& \mbox{\hyperlink{if__mosreg_8h_ad37c1d540e630742417faf2be1b7de8a}{MOS\_PHYCTL\_PHYADDR}}) |}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00470}00470             \mbox{\hyperlink{if__mosreg_8h_ae14cc77710576a6e4c9a89b35cac4653}{MOS\_PHYCTL\_WRITE}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00471}00471         \mbox{\hyperlink{if__mos_8c_aae5b990aa12060d75d401e0c535b9a22}{mos\_reg\_write\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_ae60454ff2a3f903aa1209543c44e0b6e}{MOS\_PHY\_STS}}, (\mbox{\hyperlink{if__rum_8c_a9428adc9af4653a2050e2536b55dec8d}{reg}} \& \mbox{\hyperlink{if__mosreg_8h_a062791d70c72cb962ab3666125acb7e2}{MOS\_PHYSTS\_PHYREG}}) |}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00472}00472             \mbox{\hyperlink{if__mosreg_8h_aea9feee6e502541817c81a7db9c57f2f}{MOS\_PHYSTS\_PENDING}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00473}00473 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00474}00474         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__mosreg_8h_aff365c105ebad26d1a1380c63ae7862a}{MOS\_TIMEOUT}}; i++) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00475}00475                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__mos_8c_a9598bc22a9ec25b5dce4c568cfba9389}{mos\_reg\_read\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_ae60454ff2a3f903aa1209543c44e0b6e}{MOS\_PHY\_STS}}) \& \mbox{\hyperlink{if__mosreg_8h_a5305356e55254b791d4f3e4251d84635}{MOS\_PHYSTS\_READY}})}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00476}00476                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00477}00477         \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00478}00478         \textcolor{keywordflow}{if} (i == \mbox{\hyperlink{if__mosreg_8h_aff365c105ebad26d1a1380c63ae7862a}{MOS\_TIMEOUT}})}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00479}00479                 \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}MII write timeout"{}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00480}00480 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00481}00481         \textcolor{keywordflow}{if} (!locked)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00482}00482                 \mbox{\hyperlink{if__mosreg_8h_a12b5ab009d85ba855c5b885466b95f8c}{MOS\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00483}00483         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00484}00484 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00485}00485 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00486}00486 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00487}\mbox{\hyperlink{if__mos_8c_add45a6e5a81982db63a1585089bf6874}{00487}} \mbox{\hyperlink{if__mos_8c_add45a6e5a81982db63a1585089bf6874}{mos\_miibus\_statchg}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00488}00488 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00489}00489         \textcolor{keyword}{struct }\mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00490}00490         \textcolor{keyword}{struct }mii\_data *mii = \mbox{\hyperlink{if__auereg_8h_adb491f9d26e8663f329b26e167f5edde}{GET\_MII}}(sc);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00491}00491         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}}, err, locked;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00492}00492 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00493}00493         locked = mtx\_owned(\&sc-\/>\mbox{\hyperlink{structmos__softc_a7c2fce1535e676bf9c5a4eeb95424a6a}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00494}00494         \textcolor{keywordflow}{if} (!locked)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00495}00495                 \mbox{\hyperlink{if__mosreg_8h_ae48c800df32d1036fe032256cb37cf1f}{MOS\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00496}00496 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00497}00497         \textcolor{comment}{/* disable RX, TX prior to changing FDX, SPEEDSEL */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00498}00498         \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} = \mbox{\hyperlink{if__mos_8c_a9598bc22a9ec25b5dce4c568cfba9389}{mos\_reg\_read\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_ad16ee6d56fd85364747dd7ea6bb98974}{MOS\_CTL}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00499}00499         \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} \&= \string~(\mbox{\hyperlink{if__mosreg_8h_a92776f6edb8cee06a60cae78b3022588}{MOS\_CTL\_TX\_ENB}} | \mbox{\hyperlink{if__mosreg_8h_a1d445aeac686bcbcbf785f7e3450ec12}{MOS\_CTL\_RX\_ENB}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00500}00500         \mbox{\hyperlink{if__mos_8c_aae5b990aa12060d75d401e0c535b9a22}{mos\_reg\_write\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_ad16ee6d56fd85364747dd7ea6bb98974}{MOS\_CTL}}, \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00501}00501 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00502}00502         \textcolor{comment}{/* reset register which counts dropped frames */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00503}00503         \mbox{\hyperlink{if__mos_8c_aae5b990aa12060d75d401e0c535b9a22}{mos\_reg\_write\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_a08ae103ddb98aac933c8855ef93051d5}{MOS\_FRAME\_DROP\_CNT}}, 0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00504}00504 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00505}00505         \textcolor{keywordflow}{if} ((mii-\/>mii\_media\_active \& IFM\_GMASK) == IFM\_FDX)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00506}00506                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{if__mosreg_8h_aa8b7c063a0a581ad1d4b91c569834e84}{MOS\_CTL\_FDX\_ENB}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00507}00507         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00508}00508                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} \&= \string~(\mbox{\hyperlink{if__mosreg_8h_aa8b7c063a0a581ad1d4b91c569834e84}{MOS\_CTL\_FDX\_ENB}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00509}00509 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00510}00510         \textcolor{keywordflow}{switch} (IFM\_SUBTYPE(mii-\/>mii\_media\_active)) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00511}00511         \textcolor{keywordflow}{case} IFM\_100\_TX:}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00512}00512                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= \mbox{\hyperlink{if__mosreg_8h_aa40b8b8f04fbe0d9526bbefa52c1af4d}{MOS\_CTL\_SPEEDSEL}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00513}00513                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00514}00514         \textcolor{keywordflow}{case} IFM\_10\_T:}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00515}00515                 \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} \&= \string~(\mbox{\hyperlink{if__mosreg_8h_aa40b8b8f04fbe0d9526bbefa52c1af4d}{MOS\_CTL\_SPEEDSEL}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00516}00516                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00517}00517         \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00518}00518 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00519}00519         \textcolor{comment}{/* re-\/enable TX, RX */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00520}00520         \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} |= (\mbox{\hyperlink{if__mosreg_8h_a92776f6edb8cee06a60cae78b3022588}{MOS\_CTL\_TX\_ENB}} | \mbox{\hyperlink{if__mosreg_8h_a1d445aeac686bcbcbf785f7e3450ec12}{MOS\_CTL\_RX\_ENB}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00521}00521         err = \mbox{\hyperlink{if__mos_8c_aae5b990aa12060d75d401e0c535b9a22}{mos\_reg\_write\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_ad16ee6d56fd85364747dd7ea6bb98974}{MOS\_CTL}}, \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00522}00522 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00523}00523         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00524}00524                 \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}media change failed"{}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00525}00525 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00526}00526         \textcolor{keywordflow}{if} (!locked)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00527}00527                 \mbox{\hyperlink{if__mosreg_8h_a12b5ab009d85ba855c5b885466b95f8c}{MOS\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00528}00528 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00529}00529 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00530}00530 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00531}00531 \textcolor{comment}{ * Set media options.}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00532}00532 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00533}00533 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00534}\mbox{\hyperlink{if__mos_8c_a94f8e614c1067e6c0c0031d5fe71afc2}{00534}} \mbox{\hyperlink{if__mos_8c_a94f8e614c1067e6c0c0031d5fe71afc2}{mos\_ifmedia\_upd}}(\textcolor{keyword}{struct} ifnet *ifp)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00535}00535 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00536}00536         \textcolor{keyword}{struct }\mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc = \mbox{\hyperlink{structmos__softc_a1ea13507f41650027aa05ef2ce7bcc8b}{ifp}}-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00537}00537         \textcolor{keyword}{struct }mii\_data *mii = \mbox{\hyperlink{if__auereg_8h_adb491f9d26e8663f329b26e167f5edde}{GET\_MII}}(sc);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00538}00538         \textcolor{keyword}{struct }mii\_softc *miisc;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00539}00539         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00540}00540 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00541}00541         \mbox{\hyperlink{if__mosreg_8h_a568145ced886f0e06eb0cd32fd466af0}{MOS\_LOCK\_ASSERT}}(sc, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00542}00542 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00543}00543         sc-\/>\mbox{\hyperlink{structmos__softc_a0ceefff7744138fecb63a3cde0e0360b}{mos\_link}} = 0;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00544}00544         LIST\_FOREACH(miisc, \&mii-\/>mii\_phys, mii\_list)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00545}00545                 PHY\_RESET(miisc);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00546}00546         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = mii\_mediachg(mii);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00547}00547         \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00548}00548 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00549}00549 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00550}00550 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00551}00551 \textcolor{comment}{ * Report current media status.}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00552}00552 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00553}00553 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00554}\mbox{\hyperlink{if__mos_8c_a65305ce0aa1aae77b48d22c9141e5527}{00554}} \mbox{\hyperlink{if__mos_8c_a65305ce0aa1aae77b48d22c9141e5527}{mos\_ifmedia\_sts}}(\textcolor{keyword}{struct} ifnet *ifp, \textcolor{keyword}{struct} ifmediareq *ifmr)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00555}00555 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00556}00556         \textcolor{keyword}{struct }\mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc = \mbox{\hyperlink{structmos__softc_a1ea13507f41650027aa05ef2ce7bcc8b}{ifp}}-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00557}00557         \textcolor{keyword}{struct }mii\_data *mii = \mbox{\hyperlink{if__auereg_8h_adb491f9d26e8663f329b26e167f5edde}{GET\_MII}}(sc);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00558}00558 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00559}00559         \mbox{\hyperlink{if__mosreg_8h_ae48c800df32d1036fe032256cb37cf1f}{MOS\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00560}00560         mii\_pollstat(mii);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00561}00561 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00562}00562         ifmr-\/>ifm\_active = mii-\/>mii\_media\_active;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00563}00563         ifmr-\/>ifm\_status = mii-\/>mii\_media\_status;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00564}00564         \mbox{\hyperlink{if__mosreg_8h_a12b5ab009d85ba855c5b885466b95f8c}{MOS\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00565}00565 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00566}00566 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00567}00567 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00568}\mbox{\hyperlink{if__mos_8c_a6f4e9058f06079fc33ac703060700be5}{00568}} \mbox{\hyperlink{if__mos_8c_a6f4e9058f06079fc33ac703060700be5}{mos\_setpromisc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__ether}{usb\_ether}} *ue)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00569}00569 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00570}00570         \textcolor{keyword}{struct }\mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc = \mbox{\hyperlink{usb__ethernet_8c_a2909b68b692c9927da7458ac0fe8c987}{uether\_getsc}}(ue);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00571}00571         \textcolor{keyword}{struct }ifnet *ifp = \mbox{\hyperlink{usb__ethernet_8c_a577186dbc54db90bca2eb053432d932d}{uether\_getifp}}(ue);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00572}00572 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00573}00573         uint8\_t rxmode;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00574}00574 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00575}00575         \mbox{\hyperlink{if__mosreg_8h_a568145ced886f0e06eb0cd32fd466af0}{MOS\_LOCK\_ASSERT}}(sc, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00576}00576 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00577}00577         rxmode = \mbox{\hyperlink{if__mos_8c_a9598bc22a9ec25b5dce4c568cfba9389}{mos\_reg\_read\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_ad16ee6d56fd85364747dd7ea6bb98974}{MOS\_CTL}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00578}00578 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00579}00579         \textcolor{comment}{/* If we want promiscuous mode, set the allframes bit. */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00580}00580         \textcolor{keywordflow}{if} (ifp-\/>if\_flags \& IFF\_PROMISC) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00581}00581                 rxmode |= \mbox{\hyperlink{if__mosreg_8h_aee775f61a07d806101859c02a045cd1d}{MOS\_CTL\_RX\_PROMISC}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00582}00582         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00583}00583                 rxmode \&= \string~MOS\_CTL\_RX\_PROMISC;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00584}00584         \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00585}00585 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00586}00586         \mbox{\hyperlink{if__mos_8c_aae5b990aa12060d75d401e0c535b9a22}{mos\_reg\_write\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_ad16ee6d56fd85364747dd7ea6bb98974}{MOS\_CTL}}, rxmode);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00587}00587 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00588}00588 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00589}00589 \textcolor{keyword}{static} u\_int}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00590}\mbox{\hyperlink{if__mos_8c_aaac2788c6fa2f94e388c9935bf76fd64}{00590}} \mbox{\hyperlink{if__mos_8c_aaac2788c6fa2f94e388c9935bf76fd64}{mos\_hash\_maddr}}(\textcolor{keywordtype}{void} *arg, \textcolor{keyword}{struct} sockaddr\_dl *sdl, u\_int cnt)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00591}00591 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00592}00592         uint8\_t *hashtbl = arg;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00593}00593         uint32\_t h;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00594}00594 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00595}00595         h = ether\_crc32\_be(LLADDR(sdl), ETHER\_ADDR\_LEN) >> 26;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00596}00596         hashtbl[h / 8] |= 1 << (h \% 8);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00597}00597 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00598}00598         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00599}00599 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00600}00600 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00601}00601 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00602}\mbox{\hyperlink{if__mos_8c_a6c68d52ef474f58c2ce76a9a69419178}{00602}} \mbox{\hyperlink{if__mos_8c_a6c68d52ef474f58c2ce76a9a69419178}{mos\_setmulti}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__ether}{usb\_ether}} *ue)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00603}00603 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00604}00604         \textcolor{keyword}{struct }\mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc = \mbox{\hyperlink{usb__ethernet_8c_a2909b68b692c9927da7458ac0fe8c987}{uether\_getsc}}(ue);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00605}00605         \textcolor{keyword}{struct }ifnet *ifp = \mbox{\hyperlink{usb__ethernet_8c_a577186dbc54db90bca2eb053432d932d}{uether\_getifp}}(ue);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00606}00606         uint8\_t rxmode;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00607}00607         uint8\_t hashtbl[8] = \{0, 0, 0, 0, 0, 0, 0, 0\};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00608}00608         \textcolor{keywordtype}{int} allmulti = 0;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00609}00609 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00610}00610         \mbox{\hyperlink{if__mosreg_8h_a568145ced886f0e06eb0cd32fd466af0}{MOS\_LOCK\_ASSERT}}(sc, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00611}00611 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00612}00612         rxmode = \mbox{\hyperlink{if__mos_8c_a9598bc22a9ec25b5dce4c568cfba9389}{mos\_reg\_read\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_ad16ee6d56fd85364747dd7ea6bb98974}{MOS\_CTL}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00613}00613 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00614}00614         \textcolor{keywordflow}{if} (ifp-\/>if\_flags \& IFF\_ALLMULTI || ifp-\/>if\_flags \& IFF\_PROMISC)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00615}00615                 allmulti = 1;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00616}00616 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00617}00617         \textcolor{comment}{/* get all new ones */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00618}00618         if\_foreach\_llmaddr(ifp, \mbox{\hyperlink{if__mos_8c_aaac2788c6fa2f94e388c9935bf76fd64}{mos\_hash\_maddr}}, \&hashtbl);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00619}00619 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00620}00620         \textcolor{comment}{/* now program new ones */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00621}00621         \textcolor{keywordflow}{if} (allmulti == 1) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00622}00622                 rxmode |= \mbox{\hyperlink{if__mosreg_8h_abc317ff8f8cea4cd4abbffc74050b4da}{MOS\_CTL\_ALLMULTI}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00623}00623                 \mbox{\hyperlink{if__mos_8c_aae5b990aa12060d75d401e0c535b9a22}{mos\_reg\_write\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_ad16ee6d56fd85364747dd7ea6bb98974}{MOS\_CTL}}, rxmode);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00624}00624         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00625}00625                 rxmode \&= \string~MOS\_CTL\_ALLMULTI;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00626}00626                 \mbox{\hyperlink{if__mos_8c_ab2df70dbb4f4938db43ecc556fe28701}{mos\_write\_mcast}}(sc, (\textcolor{keywordtype}{void} *)\&hashtbl);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00627}00627                 \mbox{\hyperlink{if__mos_8c_aae5b990aa12060d75d401e0c535b9a22}{mos\_reg\_write\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_ad16ee6d56fd85364747dd7ea6bb98974}{MOS\_CTL}}, rxmode);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00628}00628         \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00629}00629 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00630}00630 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00631}00631 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00632}\mbox{\hyperlink{if__mos_8c_a0128369d4b3b60d5d65a95f0f7e7f7b0}{00632}} \mbox{\hyperlink{if__mos_8c_a0128369d4b3b60d5d65a95f0f7e7f7b0}{mos\_reset}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00633}00633 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00634}00634         uint8\_t ctl;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00635}00635 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00636}00636         ctl = \mbox{\hyperlink{if__mos_8c_a9598bc22a9ec25b5dce4c568cfba9389}{mos\_reg\_read\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_ad16ee6d56fd85364747dd7ea6bb98974}{MOS\_CTL}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00637}00637         ctl \&= \string~(\mbox{\hyperlink{if__mosreg_8h_aee775f61a07d806101859c02a045cd1d}{MOS\_CTL\_RX\_PROMISC}} | \mbox{\hyperlink{if__mosreg_8h_abc317ff8f8cea4cd4abbffc74050b4da}{MOS\_CTL\_ALLMULTI}} | \mbox{\hyperlink{if__mosreg_8h_a92776f6edb8cee06a60cae78b3022588}{MOS\_CTL\_TX\_ENB}} |}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00638}00638             \mbox{\hyperlink{if__mosreg_8h_a1d445aeac686bcbcbf785f7e3450ec12}{MOS\_CTL\_RX\_ENB}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00639}00639         \textcolor{comment}{/* Disable RX, TX, promiscuous and allmulticast mode */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00640}00640         \mbox{\hyperlink{if__mos_8c_aae5b990aa12060d75d401e0c535b9a22}{mos\_reg\_write\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_ad16ee6d56fd85364747dd7ea6bb98974}{MOS\_CTL}}, ctl);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00641}00641 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00642}00642         \textcolor{comment}{/* Reset frame drop counter register to zero */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00643}00643         \mbox{\hyperlink{if__mos_8c_aae5b990aa12060d75d401e0c535b9a22}{mos\_reg\_write\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_a08ae103ddb98aac933c8855ef93051d5}{MOS\_FRAME\_DROP\_CNT}}, 0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00644}00644 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00645}00645         \textcolor{comment}{/* Wait a little while for the chip to get its brains in order. */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00646}00646         \mbox{\hyperlink{usb__util_8c_a7ad9fc3660f5ecf96d72e499cdfeb963}{usb\_pause\_mtx}}(\&sc-\/>\mbox{\hyperlink{structmos__softc_a7c2fce1535e676bf9c5a4eeb95424a6a}{sc\_mtx}}, hz / 128);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00647}00647         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00648}00648 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00649}00649 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00650}00650 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00651}\mbox{\hyperlink{if__mos_8c_aad76ec8a8a252012bdb0d269d5b202de}{00651}} \mbox{\hyperlink{if__mos_8c_aad76ec8a8a252012bdb0d269d5b202de}{mos\_chip\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00652}00652 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00653}00653         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00654}00654 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00655}00655         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00656}00656 \textcolor{comment}{         * Rev.C devices have a pause threshold register which needs to be set}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00657}00657 \textcolor{comment}{         * at startup.}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00658}00658 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00659}00659         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__mos_8c_a9598bc22a9ec25b5dce4c568cfba9389}{mos\_reg\_read\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_a3122ac107f0a878977ea64dcb25eda32}{MOS\_PAUSE\_TRHD}}) != -\/1) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00660}00660                 \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__mosreg_8h_a628f52dce098041a167021d98538c0ca}{MOS\_PAUSE\_REWRITES}}; i++)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00661}00661                         \mbox{\hyperlink{if__mos_8c_aae5b990aa12060d75d401e0c535b9a22}{mos\_reg\_write\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_a3122ac107f0a878977ea64dcb25eda32}{MOS\_PAUSE\_TRHD}}, 0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00662}00662         \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00663}00663         sc-\/>\mbox{\hyperlink{structmos__softc_a915b3aa55dc281475f215abf7dbd3583}{mos\_phyaddrs}}[0] = 1;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00664}00664         sc-\/>\mbox{\hyperlink{structmos__softc_a915b3aa55dc281475f215abf7dbd3583}{mos\_phyaddrs}}[1] = 0xFF;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00665}00665 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00666}00666 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00667}00667 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00668}00668 \textcolor{comment}{ * Probe for a MCS7x30 chip.}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00669}00669 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00670}00670 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00671}\mbox{\hyperlink{if__mos_8c_a0d2387e15170bb0d3558902187601b87}{00671}} \mbox{\hyperlink{if__mos_8c_a0d2387e15170bb0d3558902187601b87}{mos\_probe}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00672}00672 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00673}00673         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__attach__arg}{usb\_attach\_arg}} *uaa = device\_get\_ivars(dev);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00674}00674         \textcolor{keywordtype}{int} retval;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00675}00675 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00676}00676         \textcolor{keywordflow}{if} (uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a246691e99681281d3113d63e81b7e4f0}{usb\_mode}} != \mbox{\hyperlink{usb_8h_a9bc559812598988121896dceb483806ba1c7091216cfa9c9f4a252b0825ed32cb}{USB\_MODE\_HOST}})}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00677}00677                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00678}00678         \textcolor{keywordflow}{if} (uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a66c2afc71fce73cc432f7d58593e1f26}{info}}.\mbox{\hyperlink{structusbd__lookup__info_a9e2af2c9a58f0df11559c7679185b0e8}{bConfigIndex}} != \mbox{\hyperlink{if__mosreg_8h_ae947f5fa3a1b2611104234bb03e30828}{MOS\_CONFIG\_IDX}})}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00679}00679                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00680}00680         \textcolor{keywordflow}{if} (uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a66c2afc71fce73cc432f7d58593e1f26}{info}}.\mbox{\hyperlink{structusbd__lookup__info_a50a68740a4c82f1a9b999d4a7994b550}{bIfaceIndex}} != \mbox{\hyperlink{if__mosreg_8h_aa9e713f46970a9d214727f641b4fca71}{MOS\_IFACE\_IDX}})}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00681}00681                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00682}00682 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00683}00683         retval = \mbox{\hyperlink{usb__lookup_8c_aa691ad42d532498716f358cb1c994fb2}{usbd\_lookup\_id\_by\_uaa}}(\mbox{\hyperlink{if__mos_8c_a789393d758f48b24dce4329172836447}{mos\_devs}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{if__mos_8c_a789393d758f48b24dce4329172836447}{mos\_devs}}), uaa);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00684}00684         \textcolor{keywordflow}{return} (retval);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00685}00685 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00686}00686 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00687}00687 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00688}00688 \textcolor{comment}{ * Attach the interface. Allocate softc structures, do ifmedia}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00689}00689 \textcolor{comment}{ * setup and ethernet/BPF attach.}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00690}00690 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00691}00691 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00692}\mbox{\hyperlink{if__mos_8c_a820606620dc062c8e38ce39ab6738d3a}{00692}} \mbox{\hyperlink{if__mos_8c_a820606620dc062c8e38ce39ab6738d3a}{mos\_attach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00693}00693 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00694}00694         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__attach__arg}{usb\_attach\_arg}} *uaa = device\_get\_ivars(dev);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00695}00695         \textcolor{keyword}{struct }\mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00696}00696         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__ether}{usb\_ether}} *ue = \&sc-\/>\mbox{\hyperlink{structmos__softc_a50b6d2c15a9cfe33126529cdf0ac3f16}{sc\_ue}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00697}00697         uint8\_t iface\_index;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00698}00698         \textcolor{keywordtype}{int} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00699}00699 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00700}00700         sc-\/>\mbox{\hyperlink{structmos__softc_a0b32f256a1de250ad65ce6409a5f9a6d}{mos\_flags}} = \mbox{\hyperlink{usbdi_8h_ad61be4846786fb86de5691968d1e9b66}{USB\_GET\_DRIVER\_INFO}}(uaa);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00701}00701 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00702}00702         \mbox{\hyperlink{usb__util_8c_a2f65a197990caa1a69a16691ce4dc66a}{device\_set\_usb\_desc}}(dev);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00703}00703         mtx\_init(\&sc-\/>\mbox{\hyperlink{structmos__softc_a7c2fce1535e676bf9c5a4eeb95424a6a}{sc\_mtx}}, device\_get\_nameunit(dev), NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00704}00704 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00705}00705         iface\_index = \mbox{\hyperlink{if__mosreg_8h_aa9e713f46970a9d214727f641b4fca71}{MOS\_IFACE\_IDX}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00706}00706         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usb__transfer_8c_a7494c04fae5c5e7ef1af436308670a21}{usbd\_transfer\_setup}}(uaa-\/>\mbox{\hyperlink{structusb__attach__arg_ac86557d3eaf77874d436ce38648b0276}{device}}, \&iface\_index,}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00707}00707             sc-\/>\mbox{\hyperlink{structmos__softc_a8dc41bb288a918362d5c8c78f553b058}{sc\_xfer}}, \mbox{\hyperlink{if__mos_8c_acbc81a65a531f2be142a4e6effe6215f}{mos\_config}}, \mbox{\hyperlink{if__mosreg_8h_ade4ff7f0aa619097019a2a3f629be166}{MOS\_ENDPT\_MAX}},}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00708}00708             sc, \&sc-\/>\mbox{\hyperlink{structmos__softc_a7c2fce1535e676bf9c5a4eeb95424a6a}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00709}00709 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00710}00710         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00711}00711                 device\_printf(dev, \textcolor{stringliteral}{"{}allocating USB transfers failed\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00712}00712                 \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00713}00713         \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00714}00714         ue-\/>\mbox{\hyperlink{structusb__ether_af979047fbf844a27c7f2266c87fd03a4}{ue\_sc}} = sc;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00715}00715         ue-\/>\mbox{\hyperlink{structusb__ether_ade8818fa2f6daf9addc42c3e39027515}{ue\_dev}} = dev;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00716}00716         ue-\/>\mbox{\hyperlink{structusb__ether_a9038cbb427aa5dfd094db8d183f909cc}{ue\_udev}} = uaa-\/>\mbox{\hyperlink{structusb__attach__arg_ac86557d3eaf77874d436ce38648b0276}{device}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00717}00717         ue-\/>\mbox{\hyperlink{structusb__ether_af390d8b75a7bd2d9f347f808f0c15a4f}{ue\_mtx}} = \&sc-\/>\mbox{\hyperlink{structmos__softc_a7c2fce1535e676bf9c5a4eeb95424a6a}{sc\_mtx}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00718}00718         ue-\/>\mbox{\hyperlink{structusb__ether_a2b787f8aab7c5db729211c3a1c3bc141}{ue\_methods}} = \&\mbox{\hyperlink{if__mos_8c_aed9b2a92bf32da3b5de5d20a154b8dbb}{mos\_ue\_methods}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00719}00719 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00720}00720         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structmos__softc_a0b32f256a1de250ad65ce6409a5f9a6d}{mos\_flags}} \& \mbox{\hyperlink{if__mosreg_8h_a24def44e21e30c8ce4ec259b56df4575}{MCS7730}}) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00721}00721                 \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}model: MCS7730"{}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00722}00722         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structmos__softc_a0b32f256a1de250ad65ce6409a5f9a6d}{mos\_flags}} \& \mbox{\hyperlink{if__mosreg_8h_aac65bd247ca9dd888c5d8785741f5357}{MCS7830}}) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00723}00723                 \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}model: MCS7830"{}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00724}00724         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structmos__softc_a0b32f256a1de250ad65ce6409a5f9a6d}{mos\_flags}} \& \mbox{\hyperlink{if__mosreg_8h_a172f8ce19cbc87d3ba1c3c00b043d8fb}{MCS7832}}) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00725}00725                 \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}model: MCS7832"{}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00726}00726         \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00727}00727         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{usb__ethernet_8c_ad75ada74935d33849a41ff3448d1f291}{uether\_ifattach}}(ue);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00728}00728         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00729}00729                 device\_printf(dev, \textcolor{stringliteral}{"{}could not attach interface\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00730}00730                 \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00731}00731         \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00732}00732         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00733}00733 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00734}00734 detach:}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00735}00735         \mbox{\hyperlink{if__mos_8c_a43f1289e5b53ace9fe72bd28a32fa1a3}{mos\_detach}}(dev);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00736}00736         \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00737}00737 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00738}00738 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00739}00739 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00740}\mbox{\hyperlink{if__mos_8c_a1fd211bc25e218516ad5325d866b01dc}{00740}} \mbox{\hyperlink{if__mos_8c_a1fd211bc25e218516ad5325d866b01dc}{mos\_attach\_post}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__ether}{usb\_ether}} *ue)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00741}00741 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00742}00742         \textcolor{keyword}{struct }\mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc = \mbox{\hyperlink{usb__ethernet_8c_a2909b68b692c9927da7458ac0fe8c987}{uether\_getsc}}(ue);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00743}00743         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00744}00744 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00745}00745         \textcolor{comment}{/* Read MAC address, inform the world. */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00746}00746         err = \mbox{\hyperlink{if__mos_8c_a3ca27168d11064b67f8e3ee9edffe909}{mos\_readmac}}(sc, ue-\/>\mbox{\hyperlink{structusb__ether_ad1e7ad3609b27b7adab9d6086a20059a}{ue\_eaddr}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00747}00747 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00748}00748         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00749}00749           \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}couldn't get MAC address"{}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00750}00750 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00751}00751         \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}address: \%s"{}}, ether\_sprintf(ue-\/>\mbox{\hyperlink{structusb__ether_ad1e7ad3609b27b7adab9d6086a20059a}{ue\_eaddr}}));}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00752}00752 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00753}00753         \mbox{\hyperlink{if__mos_8c_aad76ec8a8a252012bdb0d269d5b202de}{mos\_chip\_init}}(sc);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00754}00754 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00755}00755 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00756}00756 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00757}\mbox{\hyperlink{if__mos_8c_a43f1289e5b53ace9fe72bd28a32fa1a3}{00757}} \mbox{\hyperlink{if__mos_8c_a43f1289e5b53ace9fe72bd28a32fa1a3}{mos\_detach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00758}00758 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00759}00759         \textcolor{keyword}{struct }\mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00760}00760         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__ether}{usb\_ether}} *ue = \&sc-\/>\mbox{\hyperlink{structmos__softc_a50b6d2c15a9cfe33126529cdf0ac3f16}{sc\_ue}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00761}00761 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00762}00762         \mbox{\hyperlink{usb__transfer_8c_a2f5ab55bfe7f356bb7a7505ff35c9741}{usbd\_transfer\_unsetup}}(sc-\/>\mbox{\hyperlink{structmos__softc_a8dc41bb288a918362d5c8c78f553b058}{sc\_xfer}}, \mbox{\hyperlink{if__mosreg_8h_ade4ff7f0aa619097019a2a3f629be166}{MOS\_ENDPT\_MAX}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00763}00763         \mbox{\hyperlink{usb__ethernet_8c_a15f91b3474535af40e16b2c05d023e99}{uether\_ifdetach}}(ue);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00764}00764         mtx\_destroy(\&sc-\/>\mbox{\hyperlink{structmos__softc_a7c2fce1535e676bf9c5a4eeb95424a6a}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00765}00765 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00766}00766         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00767}00767 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00768}00768 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00769}00769 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00770}00770 \textcolor{comment}{ * A frame has been uploaded: pass the resulting mbuf chain up to}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00771}00771 \textcolor{comment}{ * the higher level protocols.}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00772}00772 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00773}00773 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00774}\mbox{\hyperlink{if__mos_8c_a17a6d378c0fafb48ac338e653a045eab}{00774}} \mbox{\hyperlink{if__mos_8c_a17a6d378c0fafb48ac338e653a045eab}{mos\_bulk\_read\_callback}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00775}00775 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00776}00776         \textcolor{keyword}{struct }\mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(xfer);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00777}00777         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__ether}{usb\_ether}} *ue = \&sc-\/>\mbox{\hyperlink{structmos__softc_a50b6d2c15a9cfe33126529cdf0ac3f16}{sc\_ue}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00778}00778         \textcolor{keyword}{struct }ifnet *ifp = \mbox{\hyperlink{usb__ethernet_8c_a577186dbc54db90bca2eb053432d932d}{uether\_getifp}}(ue);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00779}00779 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00780}00780         uint8\_t rxstat = 0;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00781}00781         uint32\_t actlen;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00782}00782         uint16\_t pktlen = 0;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00783}00783         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__cache}{usb\_page\_cache}} *pc;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00784}00784 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00785}00785         \mbox{\hyperlink{usb__transfer_8c_ac0c68320222f26c2a3eba47b46c47899}{usbd\_xfer\_status}}(xfer, \&actlen, NULL, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00786}00786         pc = \mbox{\hyperlink{usb__transfer_8c_a6e66695b916f0770a259bed959c21555}{usbd\_xfer\_get\_frame}}(xfer, 0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00787}00787 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00788}00788         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00789}00789         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00790}00790                 \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}actlen : \%d"{}}, actlen);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00791}00791                 \textcolor{keywordflow}{if} (actlen <= 1) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00792}00792                         if\_inc\_counter(ifp, IFCOUNTER\_IERRORS, 1);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00793}00793                         \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00794}00794                 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00795}00795                 \textcolor{comment}{/* evaluate status byte at the end */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00796}00796                 \mbox{\hyperlink{usb__busdma_8c_af52eece45b7868dbf58386f4c9e4eb9a}{usbd\_copy\_out}}(pc, actlen -\/ \textcolor{keyword}{sizeof}(rxstat), \&rxstat,}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00797}00797                     \textcolor{keyword}{sizeof}(rxstat));}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00798}00798 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00799}00799                 \textcolor{keywordflow}{if} (rxstat != \mbox{\hyperlink{if__mosreg_8h_a249f948cadf98a7ed98ac8e33027380b}{MOS\_RXSTS\_VALID}}) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00800}00800                         \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}erroneous frame received"{}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00801}00801                         \textcolor{keywordflow}{if} (rxstat \& \mbox{\hyperlink{if__mosreg_8h_a84542b4d32e5a4a630dba38817523698}{MOS\_RXSTS\_SHORT\_FRAME}})}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00802}00802                                 \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}frame size less than 64 bytes"{}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00803}00803                         \textcolor{keywordflow}{if} (rxstat \& \mbox{\hyperlink{if__mosreg_8h_ab9d5edbd6134c5411570021fa3f36474}{MOS\_RXSTS\_LARGE\_FRAME}}) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00804}00804                                 \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}frame size larger than "{}}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00805}00805                                     \textcolor{stringliteral}{"{}1532 bytes"{}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00806}00806                         \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00807}00807                         \textcolor{keywordflow}{if} (rxstat \& \mbox{\hyperlink{if__mosreg_8h_ab1f6dc8f287911e19d98b9f2bbd12efb}{MOS\_RXSTS\_CRC\_ERROR}})}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00808}00808                                 \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}CRC error"{}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00809}00809                         \textcolor{keywordflow}{if} (rxstat \& \mbox{\hyperlink{if__mosreg_8h_aafe2f35184380e76ba4359cd472a1152}{MOS\_RXSTS\_ALIGN\_ERROR}})}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00810}00810                                 \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}alignment error"{}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00811}00811                         if\_inc\_counter(ifp, IFCOUNTER\_IERRORS, 1);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00812}00812                         \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00813}00813                 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00814}00814                 \textcolor{comment}{/* Remember the last byte was used for the status fields */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00815}00815                 pktlen = actlen -\/ 1;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00816}00816                 \textcolor{keywordflow}{if} (pktlen < \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} ether\_header)) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00817}00817                         \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}error: pktlen \%d is smaller "{}}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00818}00818                             \textcolor{stringliteral}{"{}than ether\_header \%zd"{}}, pktlen,}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00819}00819                             \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} ether\_header));}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00820}00820                         if\_inc\_counter(ifp, IFCOUNTER\_IERRORS, 1);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00821}00821                         \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00822}00822                 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00823}00823                 \mbox{\hyperlink{usb__ethernet_8c_a5604159981a8d90f457c503a8123072d}{uether\_rxbuf}}(ue, pc, 0, actlen);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00824}00824                 \textcolor{comment}{/* FALLTHROUGH */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00825}00825         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00826}00826 tr\_setup:}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00827}00827                 \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{if__mos_8c_source_l00828}00828                 \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(xfer);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00829}00829                 \mbox{\hyperlink{usb__ethernet_8c_a007aff306fb41573661e03ac71e45966}{uether\_rxflush}}(ue);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00830}00830                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00831}00831         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00832}00832                 \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}bulk read error, \%s"{}}, \mbox{\hyperlink{usb__error_8c_a2391eb446dce3e4368cacf781857774e}{usbd\_errstr}}(\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}));}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00833}00833                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}}) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00834}00834                         \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(xfer);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00835}00835                         \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00836}00836                 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00837}00837                 \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}start rx \%i"{}}, \mbox{\hyperlink{usb__transfer_8c_ae34a7cc2f01c6dfb68bca6fd0b72647e}{usbd\_xfer\_max\_len}}(xfer));}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00838}00838                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00839}00839         \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00840}00840 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00841}00841 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00842}00842 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00843}00843 \textcolor{comment}{ * A frame was downloaded to the chip. It's safe for us to clean up}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00844}00844 \textcolor{comment}{ * the list buffers.}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00845}00845 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00846}00846 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00847}\mbox{\hyperlink{if__mos_8c_ae6f4c54b933ad3a332a9723076c3fe5d}{00847}} \mbox{\hyperlink{if__mos_8c_ae6f4c54b933ad3a332a9723076c3fe5d}{mos\_bulk\_write\_callback}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00848}00848 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00849}00849         \textcolor{keyword}{struct }\mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(xfer);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00850}00850         \textcolor{keyword}{struct }ifnet *ifp = \mbox{\hyperlink{usb__ethernet_8c_a577186dbc54db90bca2eb053432d932d}{uether\_getifp}}(\&sc-\/>\mbox{\hyperlink{structmos__softc_a50b6d2c15a9cfe33126529cdf0ac3f16}{sc\_ue}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00851}00851         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__cache}{usb\_page\_cache}} *pc;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00852}00852         \textcolor{keyword}{struct }mbuf *m;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00853}00853 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00854}00854         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00855}00855         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00856}00856                 \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}transfer of complete"{}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00857}00857                 if\_inc\_counter(ifp, IFCOUNTER\_OPACKETS, 1);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00858}00858                 \textcolor{comment}{/* FALLTHROUGH */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00859}00859         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00860}00860 tr\_setup:}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00861}00861                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00862}00862 \textcolor{comment}{                 * XXX: don't send anything if there is no link?}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00863}00863 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00864}00864                 IFQ\_DRV\_DEQUEUE(\&ifp-\/>if\_snd, m);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00865}00865                 \textcolor{keywordflow}{if} (m == NULL)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00866}00866                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00867}00867 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00868}00868                 pc = \mbox{\hyperlink{usb__transfer_8c_a6e66695b916f0770a259bed959c21555}{usbd\_xfer\_get\_frame}}(xfer, 0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00869}00869                 \mbox{\hyperlink{usbdi_8h_a9696aa8bcb25b1adcf45e8387a13897a}{usbd\_m\_copy\_in}}(pc, 0, m, 0, m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00870}00870 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00871}00871                 \mbox{\hyperlink{usb__transfer_8c_a31786497f0f4222203b1e993d52af753}{usbd\_xfer\_set\_frame\_len}}(xfer, 0, m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00872}00872 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00873}00873                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00874}00874 \textcolor{comment}{                 * if there's a BPF listener, bounce a copy}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00875}00875 \textcolor{comment}{                 * of this frame to him:}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00876}00876 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00877}00877                 BPF\_MTAP(ifp, m);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00878}00878 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00879}00879                 m\_freem(m);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00880}00880 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00881}00881                 \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(xfer);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00882}00882 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00883}00883                 if\_inc\_counter(ifp, IFCOUNTER\_OPACKETS, 1);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00884}00884                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00885}00885         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00886}00886                 \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}usb error on tx: \%s\(\backslash\)n"{}}, \mbox{\hyperlink{usb__error_8c_a2391eb446dce3e4368cacf781857774e}{usbd\_errstr}}(\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}));}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00887}00887                 if\_inc\_counter(ifp, IFCOUNTER\_OERRORS, 1);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00888}00888                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}}) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00889}00889                         \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(xfer);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00890}00890                         \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00891}00891                 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00892}00892                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00893}00893         \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00894}00894 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00895}00895 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00896}00896 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00897}\mbox{\hyperlink{if__mos_8c_a691f9b2e00d6eccbf010e6abc6c3508f}{00897}} \mbox{\hyperlink{if__mos_8c_a691f9b2e00d6eccbf010e6abc6c3508f}{mos\_tick}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__ether}{usb\_ether}} *ue)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00898}00898 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00899}00899         \textcolor{keyword}{struct }\mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc = \mbox{\hyperlink{usb__ethernet_8c_a2909b68b692c9927da7458ac0fe8c987}{uether\_getsc}}(ue);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00900}00900         \textcolor{keyword}{struct }mii\_data *mii = \mbox{\hyperlink{if__auereg_8h_adb491f9d26e8663f329b26e167f5edde}{GET\_MII}}(sc);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00901}00901 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00902}00902         \mbox{\hyperlink{if__mosreg_8h_a568145ced886f0e06eb0cd32fd466af0}{MOS\_LOCK\_ASSERT}}(sc, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00903}00903 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00904}00904         mii\_tick(mii);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00905}00905         \textcolor{keywordflow}{if} (!sc-\/>\mbox{\hyperlink{structmos__softc_a0ceefff7744138fecb63a3cde0e0360b}{mos\_link}} \&\& mii-\/>mii\_media\_status \& IFM\_ACTIVE \&\&}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00906}00906             IFM\_SUBTYPE(mii-\/>mii\_media\_active) != IFM\_NONE) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00907}00907                 \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}got link"{}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00908}00908                 sc-\/>\mbox{\hyperlink{structmos__softc_a0ceefff7744138fecb63a3cde0e0360b}{mos\_link}}++;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00909}00909                 \mbox{\hyperlink{if__mos_8c_a8abaa9a2d666cc000f6ceffd338fc046}{mos\_start}}(ue);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00910}00910         \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00911}00911 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00912}00912 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00913}00913 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00914}\mbox{\hyperlink{if__mos_8c_a8abaa9a2d666cc000f6ceffd338fc046}{00914}} \mbox{\hyperlink{if__mos_8c_a8abaa9a2d666cc000f6ceffd338fc046}{mos\_start}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__ether}{usb\_ether}} *ue)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00915}00915 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00916}00916         \textcolor{keyword}{struct }\mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc = \mbox{\hyperlink{usb__ethernet_8c_a2909b68b692c9927da7458ac0fe8c987}{uether\_getsc}}(ue);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00917}00917 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00918}00918         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00919}00919 \textcolor{comment}{         * start the USB transfers, if not already started:}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00920}00920 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00921}00921         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(sc-\/>\mbox{\hyperlink{structmos__softc_a8dc41bb288a918362d5c8c78f553b058}{sc\_xfer}}[\mbox{\hyperlink{if__mosreg_8h_a29abfbd927463b69f55448cf96ef26a2}{MOS\_ENDPT\_TX}}]);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00922}00922         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(sc-\/>\mbox{\hyperlink{structmos__softc_a8dc41bb288a918362d5c8c78f553b058}{sc\_xfer}}[\mbox{\hyperlink{if__mosreg_8h_aef4173612503f9dd300a2102d84d970e}{MOS\_ENDPT\_RX}}]);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00923}00923         \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(sc-\/>\mbox{\hyperlink{structmos__softc_a8dc41bb288a918362d5c8c78f553b058}{sc\_xfer}}[\mbox{\hyperlink{if__mosreg_8h_afa11e637cbf6219bf2328c48ebea43c8}{MOS\_ENDPT\_INTR}}]);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00924}00924 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00925}00925 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00926}00926 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00927}\mbox{\hyperlink{if__mos_8c_aa6aeb1a1c4b7d8b985f13ce39555b291}{00927}} \mbox{\hyperlink{if__mos_8c_aa6aeb1a1c4b7d8b985f13ce39555b291}{mos\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__ether}{usb\_ether}} *ue)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00928}00928 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00929}00929         \textcolor{keyword}{struct }\mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc = \mbox{\hyperlink{usb__ethernet_8c_a2909b68b692c9927da7458ac0fe8c987}{uether\_getsc}}(ue);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00930}00930         \textcolor{keyword}{struct }ifnet *ifp = \mbox{\hyperlink{usb__ethernet_8c_a577186dbc54db90bca2eb053432d932d}{uether\_getifp}}(ue);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00931}00931         uint8\_t rxmode;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00932}00932 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00933}00933         \mbox{\hyperlink{if__mosreg_8h_a568145ced886f0e06eb0cd32fd466af0}{MOS\_LOCK\_ASSERT}}(sc, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00934}00934 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00935}00935         \textcolor{comment}{/* Cancel pending I/O and free all RX/TX buffers. */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00936}00936         \mbox{\hyperlink{if__mos_8c_a0128369d4b3b60d5d65a95f0f7e7f7b0}{mos\_reset}}(sc);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00937}00937 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00938}00938         \textcolor{comment}{/* Write MAC address */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00939}00939         \mbox{\hyperlink{if__mos_8c_ab1dba016357a5953996518b2d2b63aa5}{mos\_writemac}}(sc, IF\_LLADDR(ifp));}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00940}00940 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00941}00941         \textcolor{comment}{/* Read and set transmitter IPG values */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00942}00942         sc-\/>\mbox{\hyperlink{structmos__softc_a964283fc00b651a0fb3856a22635e5b7}{mos\_ipgs}}[0] = \mbox{\hyperlink{if__mos_8c_a9598bc22a9ec25b5dce4c568cfba9389}{mos\_reg\_read\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_a29adfbabdc992c5fc3a5ed9c6d749de3}{MOS\_IPG0}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00943}00943         sc-\/>\mbox{\hyperlink{structmos__softc_a964283fc00b651a0fb3856a22635e5b7}{mos\_ipgs}}[1] = \mbox{\hyperlink{if__mos_8c_a9598bc22a9ec25b5dce4c568cfba9389}{mos\_reg\_read\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_a29f2869026f99402a137a1c7ec1c2a41}{MOS\_IPG1}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00944}00944         \mbox{\hyperlink{if__mos_8c_aae5b990aa12060d75d401e0c535b9a22}{mos\_reg\_write\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_a29adfbabdc992c5fc3a5ed9c6d749de3}{MOS\_IPG0}}, sc-\/>\mbox{\hyperlink{structmos__softc_a964283fc00b651a0fb3856a22635e5b7}{mos\_ipgs}}[0]);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00945}00945         \mbox{\hyperlink{if__mos_8c_aae5b990aa12060d75d401e0c535b9a22}{mos\_reg\_write\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_a29f2869026f99402a137a1c7ec1c2a41}{MOS\_IPG1}}, sc-\/>\mbox{\hyperlink{structmos__softc_a964283fc00b651a0fb3856a22635e5b7}{mos\_ipgs}}[1]);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00946}00946 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00947}00947         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00948}00948 \textcolor{comment}{         * Enable receiver and transmitter, bridge controls speed/duplex}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00949}00949 \textcolor{comment}{         * mode}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00950}00950 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00951}00951         rxmode = \mbox{\hyperlink{if__mos_8c_a9598bc22a9ec25b5dce4c568cfba9389}{mos\_reg\_read\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_ad16ee6d56fd85364747dd7ea6bb98974}{MOS\_CTL}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00952}00952         rxmode |= \mbox{\hyperlink{if__mosreg_8h_a1d445aeac686bcbcbf785f7e3450ec12}{MOS\_CTL\_RX\_ENB}} | \mbox{\hyperlink{if__mosreg_8h_a92776f6edb8cee06a60cae78b3022588}{MOS\_CTL\_TX\_ENB}} | \mbox{\hyperlink{if__mosreg_8h_aa41cff1f87a850508323d0fbf0d57e2c}{MOS\_CTL\_BS\_ENB}};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00953}00953         rxmode \&= \string~(\mbox{\hyperlink{if__mosreg_8h_a579c6e686f19f6b1cce1837c677a7191}{MOS\_CTL\_SLEEP}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00954}00954 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00955}00955         \mbox{\hyperlink{if__mos_8c_a6f4e9058f06079fc33ac703060700be5}{mos\_setpromisc}}(ue);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00956}00956 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00957}00957         \textcolor{comment}{/* XXX: broadcast mode? */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00958}00958         \mbox{\hyperlink{if__mos_8c_aae5b990aa12060d75d401e0c535b9a22}{mos\_reg\_write\_1}}(sc, \mbox{\hyperlink{if__mosreg_8h_ad16ee6d56fd85364747dd7ea6bb98974}{MOS\_CTL}}, rxmode);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00959}00959 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00960}00960         \textcolor{comment}{/* Load the multicast filter. */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00961}00961         \mbox{\hyperlink{if__mos_8c_a6c68d52ef474f58c2ce76a9a69419178}{mos\_setmulti}}(ue);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00962}00962 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00963}00963         ifp-\/>if\_drv\_flags |= IFF\_DRV\_RUNNING;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00964}00964         \mbox{\hyperlink{if__mos_8c_a8abaa9a2d666cc000f6ceffd338fc046}{mos\_start}}(ue);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00965}00965 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00966}00966 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00967}00967 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00968}\mbox{\hyperlink{if__mos_8c_aff9ba65ac87295ba58e30a851a1ebd66}{00968}} \mbox{\hyperlink{if__mos_8c_aff9ba65ac87295ba58e30a851a1ebd66}{mos\_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{if__mos_8c_source_l00969}00969 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00970}00970         \textcolor{keyword}{struct }\mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(xfer);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00971}00971         \textcolor{keyword}{struct }ifnet *ifp = \mbox{\hyperlink{usb__ethernet_8c_a577186dbc54db90bca2eb053432d932d}{uether\_getifp}}(\&sc-\/>\mbox{\hyperlink{structmos__softc_a50b6d2c15a9cfe33126529cdf0ac3f16}{sc\_ue}});}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00972}00972         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__page__cache}{usb\_page\_cache}} *pc;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00973}00973         uint32\_t pkt;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00974}00974         \textcolor{keywordtype}{int} actlen;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00975}00975 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00976}00976         if\_inc\_counter(ifp, IFCOUNTER\_OERRORS, 1);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00977}00977 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00978}00978         \mbox{\hyperlink{usb__transfer_8c_ac0c68320222f26c2a3eba47b46c47899}{usbd\_xfer\_status}}(xfer, \&actlen, NULL, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00979}00979         \mbox{\hyperlink{if__mos_8c_aa1dfbdddde21f5d536c8b2e1c22b9562}{MOS\_DPRINTFN}}(\textcolor{stringliteral}{"{}actlen \%i"{}}, actlen);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00980}00980 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00981}00981         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00982}00982         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00983}00983 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00984}00984                 pc = \mbox{\hyperlink{usb__transfer_8c_a6e66695b916f0770a259bed959c21555}{usbd\_xfer\_get\_frame}}(xfer, 0);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00985}00985                 \mbox{\hyperlink{usb__busdma_8c_af52eece45b7868dbf58386f4c9e4eb9a}{usbd\_copy\_out}}(pc, 0, \&pkt, \textcolor{keyword}{sizeof}(pkt));}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00986}00986                 \textcolor{comment}{/* FALLTHROUGH */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00987}00987         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00988}00988 tr\_setup:}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00989}00989                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00990}00990         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00991}00991                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} != \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}}) \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00992}00992                         \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(xfer);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00993}00993                         \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00994}00994                 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00995}00995                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00996}00996         \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00997}00997 \}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00998}00998 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l00999}00999 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l01000}01000 \textcolor{comment}{ * Stop the adapter and free any mbufs allocated to the}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l01001}01001 \textcolor{comment}{ * RX and TX lists.}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l01002}01002 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l01003}01003 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l01004}\mbox{\hyperlink{if__mos_8c_acc15408bcee8b3a75796e00ae40b7efb}{01004}} \mbox{\hyperlink{if__mos_8c_acc15408bcee8b3a75796e00ae40b7efb}{mos\_stop}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__ether}{usb\_ether}} *ue)}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l01005}01005 \{}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l01006}01006         \textcolor{keyword}{struct }\mbox{\hyperlink{structmos__softc}{mos\_softc}} *sc = \mbox{\hyperlink{usb__ethernet_8c_a2909b68b692c9927da7458ac0fe8c987}{uether\_getsc}}(ue);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l01007}01007         \textcolor{keyword}{struct }ifnet *ifp = \mbox{\hyperlink{usb__ethernet_8c_a577186dbc54db90bca2eb053432d932d}{uether\_getifp}}(ue);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l01008}01008 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l01009}01009         \mbox{\hyperlink{if__mos_8c_a0128369d4b3b60d5d65a95f0f7e7f7b0}{mos\_reset}}(sc);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l01010}01010 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l01011}01011         \mbox{\hyperlink{if__mosreg_8h_a568145ced886f0e06eb0cd32fd466af0}{MOS\_LOCK\_ASSERT}}(sc, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l01012}01012         ifp-\/>if\_drv\_flags \&= \string~IFF\_DRV\_RUNNING;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l01013}01013 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l01014}01014         \textcolor{comment}{/* stop all the transfers, if not already stopped */}}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l01015}01015         \mbox{\hyperlink{usb__transfer_8c_abe245d973df0cfd6fb96b884d33ebce3}{usbd\_transfer\_stop}}(sc-\/>\mbox{\hyperlink{structmos__softc_a8dc41bb288a918362d5c8c78f553b058}{sc\_xfer}}[\mbox{\hyperlink{if__mosreg_8h_a29abfbd927463b69f55448cf96ef26a2}{MOS\_ENDPT\_TX}}]);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l01016}01016         \mbox{\hyperlink{usb__transfer_8c_abe245d973df0cfd6fb96b884d33ebce3}{usbd\_transfer\_stop}}(sc-\/>\mbox{\hyperlink{structmos__softc_a8dc41bb288a918362d5c8c78f553b058}{sc\_xfer}}[\mbox{\hyperlink{if__mosreg_8h_aef4173612503f9dd300a2102d84d970e}{MOS\_ENDPT\_RX}}]);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l01017}01017         \mbox{\hyperlink{usb__transfer_8c_abe245d973df0cfd6fb96b884d33ebce3}{usbd\_transfer\_stop}}(sc-\/>\mbox{\hyperlink{structmos__softc_a8dc41bb288a918362d5c8c78f553b058}{sc\_xfer}}[\mbox{\hyperlink{if__mosreg_8h_afa11e637cbf6219bf2328c48ebea43c8}{MOS\_ENDPT\_INTR}}]);}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l01018}01018 }
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l01019}01019         sc-\/>\mbox{\hyperlink{structmos__softc_a0ceefff7744138fecb63a3cde0e0360b}{mos\_link}} = 0;}
\DoxyCodeLine{\Hypertarget{if__mos_8c_source_l01020}01020 \}}

\end{DoxyCode}
