\hypertarget{if__nge_8c_source}{}\doxysection{if\+\_\+nge.\+c}
\label{if__nge_8c_source}\index{dev/nge/if\_nge.c@{dev/nge/if\_nge.c}}
\mbox{\hyperlink{if__nge_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/4-\/Clause}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2001 Wind River Systems}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 1997, 1998, 1999, 2000, 2001}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00006}00006 \textcolor{comment}{ *      Bill Paul <wpaul@bsdi.com>.  All rights reserved.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00007}00007 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00008}00008 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00009}00009 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00010}00010 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00011}00011 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00012}00012 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00013}00013 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00014}00014 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00015}00015 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00016}00016 \textcolor{comment}{ * 3. All advertising materials mentioning features or use of this software}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00017}00017 \textcolor{comment}{ *    must display the following acknowledgement:}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00018}00018 \textcolor{comment}{ *      This product includes software developed by Bill Paul.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00019}00019 \textcolor{comment}{ * 4. Neither the name of the author nor the names of any co-\/contributors}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00020}00020 \textcolor{comment}{ *    may be used to endorse or promote products derived from this software}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00021}00021 \textcolor{comment}{ *    without specific prior written permission.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00022}00022 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00023}00023 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00024}00024 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00025}00025 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00026}00026 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00027}00027 \textcolor{comment}{ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00028}00028 \textcolor{comment}{ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00029}00029 \textcolor{comment}{ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00030}00030 \textcolor{comment}{ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00031}00031 \textcolor{comment}{ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00032}00032 \textcolor{comment}{ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00033}00033 \textcolor{comment}{ * THE POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00034}00034 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00035}00035 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00037}\mbox{\hyperlink{if__nge_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00037}} \mbox{\hyperlink{if__nge_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00038}00038 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00039}00039 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00040}00040 \textcolor{comment}{ * National Semiconductor DP83820/DP83821 gigabit ethernet driver}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00041}00041 \textcolor{comment}{ * for FreeBSD. Datasheets are available from:}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00042}00042 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00043}00043 \textcolor{comment}{ * http://www.national.com/ds/DP/DP83820.pdf}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00044}00044 \textcolor{comment}{ * http://www.national.com/ds/DP/DP83821.pdf}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00045}00045 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00046}00046 \textcolor{comment}{ * These chips are used on several low cost gigabit ethernet NICs}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00047}00047 \textcolor{comment}{ * sold by D-\/Link, Addtron, SMC and Asante. Both parts are}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00048}00048 \textcolor{comment}{ * virtually the same, except the 83820 is a 64-\/bit/32-\/bit part,}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00049}00049 \textcolor{comment}{ * while the 83821 is 32-\/bit only.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00050}00050 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00051}00051 \textcolor{comment}{ * Many cards also use National gigE transceivers, such as the}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00052}00052 \textcolor{comment}{ * DP83891, DP83861 and DP83862 gigPHYTER parts. The DP83861 datasheet}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00053}00053 \textcolor{comment}{ * contains a full register description that applies to all of these}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00054}00054 \textcolor{comment}{ * components:}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00055}00055 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00056}00056 \textcolor{comment}{ * http://www.national.com/ds/DP/DP83861.pdf}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00057}00057 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00058}00058 \textcolor{comment}{ * Written by Bill Paul <wpaul@bsdi.com>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00059}00059 \textcolor{comment}{ * BSDi Open Source Solutions}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00060}00060 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00061}00061 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00062}00062 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00063}00063 \textcolor{comment}{ * The NatSemi DP83820 and 83821 controllers are enhanced versions}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00064}00064 \textcolor{comment}{ * of the NatSemi MacPHYTER 10/100 devices. They support 10, 100}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00065}00065 \textcolor{comment}{ * and 1000Mbps speeds with 1000baseX (ten bit interface), MII and GMII}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00066}00066 \textcolor{comment}{ * ports. Other features include 8K TX FIFO and 32K RX FIFO, TCP/IP}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00067}00067 \textcolor{comment}{ * hardware checksum offload (IPv4 only), VLAN tagging and filtering,}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00068}00068 \textcolor{comment}{ * priority TX and RX queues, a 2048 bit multicast hash filter, 4 RX pattern}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00069}00069 \textcolor{comment}{ * matching buffers, one perfect address filter buffer and interrupt}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00070}00070 \textcolor{comment}{ * moderation. The 83820 supports both 64-\/bit and 32-\/bit addressing}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00071}00071 \textcolor{comment}{ * and data transfers: the 64-\/bit support can be toggled on or off}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00072}00072 \textcolor{comment}{ * via software. This affects the size of certain fields in the DMA}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00073}00073 \textcolor{comment}{ * descriptors.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00074}00074 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00075}00075 \textcolor{comment}{ * There are two bugs/misfeatures in the 83820/83821 that I have}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00076}00076 \textcolor{comment}{ * discovered so far:}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00077}00077 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00078}00078 \textcolor{comment}{ * -\/ Receive buffers must be aligned on 64-\/bit boundaries, which means}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00079}00079 \textcolor{comment}{ *   you must resort to copying data in order to fix up the payload}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00080}00080 \textcolor{comment}{ *   alignment.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00081}00081 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00082}00082 \textcolor{comment}{ * -\/ In order to transmit jumbo frames larger than 8170 bytes, you have}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00083}00083 \textcolor{comment}{ *   to turn off transmit checksum offloading, because the chip can't}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00084}00084 \textcolor{comment}{ *   compute the checksum on an outgoing frame unless it fits entirely}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00085}00085 \textcolor{comment}{ *   within the TX FIFO, which is only 8192 bytes in size. If you have}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00086}00086 \textcolor{comment}{ *   TX checksum offload enabled and you transmit attempt to transmit a}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00087}00087 \textcolor{comment}{ *   frame larger than 8170 bytes, the transmitter will wedge.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00088}00088 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00089}00089 \textcolor{comment}{ * To work around the latter problem, TX checksum offload is disabled}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00090}00090 \textcolor{comment}{ * if the user selects an MTU larger than 8152 (8170 -\/ 18).}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00091}00091 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00092}00092 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00093}00093 \textcolor{preprocessor}{\#ifdef HAVE\_KERNEL\_OPTION\_HEADERS}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00094}00094 \textcolor{preprocessor}{\#include "{}opt\_device\_polling.h"{}}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00095}00095 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00096}00096 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00097}00097 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00098}00098 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00099}00099 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00100}00100 \textcolor{preprocessor}{\#include <sys/endian.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00101}00101 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00102}00102 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00103}00103 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00104}00104 \textcolor{preprocessor}{\#include <sys/mbuf.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00105}00105 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00106}00106 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00107}00107 \textcolor{preprocessor}{\#include <sys/rman.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00108}00108 \textcolor{preprocessor}{\#include <sys/socket.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00109}00109 \textcolor{preprocessor}{\#include <sys/sockio.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00110}00110 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00111}00111 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00112}00112 \textcolor{preprocessor}{\#include <net/bpf.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00113}00113 \textcolor{preprocessor}{\#include <net/if.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00114}00114 \textcolor{preprocessor}{\#include <net/if\_var.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00115}00115 \textcolor{preprocessor}{\#include <net/if\_arp.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00116}00116 \textcolor{preprocessor}{\#include <net/ethernet.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00117}00117 \textcolor{preprocessor}{\#include <net/if\_dl.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00118}00118 \textcolor{preprocessor}{\#include <net/if\_media.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00119}00119 \textcolor{preprocessor}{\#include <net/if\_types.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00120}00120 \textcolor{preprocessor}{\#include <net/if\_vlan\_var.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00121}00121 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00122}00122 \textcolor{preprocessor}{\#include <dev/mii/mii.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00123}00123 \textcolor{preprocessor}{\#include <dev/mii/mii\_bitbang.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00124}00124 \textcolor{preprocessor}{\#include <dev/mii/miivar.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00125}00125 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00126}00126 \textcolor{preprocessor}{\#include <dev/pci/pcireg.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00127}00127 \textcolor{preprocessor}{\#include <dev/pci/pcivar.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00128}00128 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00129}00129 \textcolor{preprocessor}{\#include <machine/bus.h>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00130}00130 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00131}00131 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{if__ngereg_8h}{dev/nge/if\_ngereg.h}}>}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00132}00132 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00133}00133 \textcolor{comment}{/* "{}device miibus"{} required.  See GENERIC if you get errors here. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00134}00134 \textcolor{preprocessor}{\#include "{}miibus\_if.h"{}}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00135}00135 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00136}\mbox{\hyperlink{if__nge_8c_a7900370d90d16e9cf7ff69f17ca47689}{00136}} \mbox{\hyperlink{if__nge_8c_a7900370d90d16e9cf7ff69f17ca47689}{MODULE\_DEPEND}}(nge, pci, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00137}\mbox{\hyperlink{if__nge_8c_a323753dfaf5fcf9fc5140802d650a0cc}{00137}} \mbox{\hyperlink{if__nge_8c_a7900370d90d16e9cf7ff69f17ca47689}{MODULE\_DEPEND}}(nge, ether, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00138}\mbox{\hyperlink{if__nge_8c_aeb379e89459eb8857e407548d20227b8}{00138}} \mbox{\hyperlink{if__nge_8c_a7900370d90d16e9cf7ff69f17ca47689}{MODULE\_DEPEND}}(nge, miibus, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00139}00139 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00140}\mbox{\hyperlink{if__nge_8c_acb062d853343d9f1617f1fdbb74f2a04}{00140}} \textcolor{preprocessor}{\#define NGE\_CSUM\_FEATURES       (CSUM\_IP | CSUM\_TCP | CSUM\_UDP)}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00141}00141 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00142}00142 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00143}00143 \textcolor{comment}{ * Various supported device vendors/types and their names.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00144}00144 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00145}\mbox{\hyperlink{if__nge_8c_a6adcd63a8a8fc27e15618b6df144b17d}{00145}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__type}{nge\_type}} \mbox{\hyperlink{if__nge_8c_a6adcd63a8a8fc27e15618b6df144b17d}{nge\_devs}}[] = \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00146}00146         \{ \mbox{\hyperlink{if__ngereg_8h_a221026af76e8e5f19b3c36c65478d585}{NGE\_VENDORID}}, \mbox{\hyperlink{if__ngereg_8h_a5993dde8d10592bbdae9dea8a6f56476}{NGE\_DEVICEID}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00147}00147             \textcolor{stringliteral}{"{}National Semiconductor Gigabit Ethernet"{}} \},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00148}00148         \{ 0, 0, NULL \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00149}00149 \};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00150}00150 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00151}00151 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__nge_8c_a7f30987d57cffcfa9a496bc90b390084}{nge\_probe}}(device\_t);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00152}00152 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__nge_8c_a12c3d13253e03ebf8b8a766aafe507bf}{nge\_attach}}(device\_t);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00153}00153 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__nge_8c_a5d5e754934604ce7f98909dba8661ca0}{nge\_detach}}(device\_t);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00154}00154 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__nge_8c_a931d40221554b2514cd9ad6e52c70963}{nge\_shutdown}}(device\_t);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00155}00155 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__nge_8c_a2ee505e753ccf3c61b3d73ae1ee464b1}{nge\_suspend}}(device\_t);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00156}00156 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__nge_8c_a53ec13d52e2833463c7b45d7eef34e25}{nge\_resume}}(device\_t);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00157}00157 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00158}00158 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_a771e20cd9ef110857454c27e71652231}{nge\_discard\_rxbuf}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00159}00159 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__nge_8c_ad77abeb382aa2ca9c352ab2103640453}{nge\_newbuf}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00160}00160 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__nge_8c_ae03f77d2f2306164d24dc74e5c9de012}{nge\_encap}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *, \textcolor{keyword}{struct} mbuf **);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00161}00161 \textcolor{preprocessor}{\#ifndef \_\_NO\_STRICT\_ALIGNMENT}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00162}00162 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_aaf81a3309772856b925d6aecc46d1571}{nge\_fixup\_rx}}(\textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00163}00163 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00164}00164 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__nge_8c_a5309c35e59df21a3a3102326fa57dae4}{nge\_rxeof}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00165}00165 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_a63a556df379a487a1d56e4d32ad68456}{nge\_txeof}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00166}00166 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_ab76e53be9cb000caa8ecf984ccceeb6a}{nge\_intr}}(\textcolor{keywordtype}{void} *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00167}00167 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_a984c6c5051e1134e2dc69da61389b087}{nge\_tick}}(\textcolor{keywordtype}{void} *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00168}00168 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_a25220701f680281bf402ac417e973a1e}{nge\_stats\_update}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00169}00169 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_a58ca32a784c2a1aa0bce3c94337c1a32}{nge\_start}}(\textcolor{keyword}{struct} ifnet *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00170}00170 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_ad2902445bf55cddca069c3162091c509}{nge\_start\_locked}}(\textcolor{keyword}{struct} ifnet *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00171}00171 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__nge_8c_a6bd790902a685f581517fb7998d13a6f}{nge\_ioctl}}(\textcolor{keyword}{struct} ifnet *, u\_long, caddr\_t);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00172}00172 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_a4ea95c1fa3aa6d1651aed6334ce2992e}{nge\_init}}(\textcolor{keywordtype}{void} *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00173}00173 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_aed2b3e36e09028db73bd888fd5c1e319}{nge\_init\_locked}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00174}00174 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__nge_8c_ad22b729a9097b444402b77e65a9c7855}{nge\_stop\_mac}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00175}00175 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_a5f1c4f9e585d5f34ebe3b81d687ebb2a}{nge\_stop}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00176}00176 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_ad6cd542efc03ee8ca3c267b5d5fcc3df}{nge\_wol}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00177}00177 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_a4a09759d0a337c988dd49225b47eb12b}{nge\_watchdog}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00178}00178 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__nge_8c_a8ad2990142595a47f4c54ba6b5b09550}{nge\_mediachange}}(\textcolor{keyword}{struct} ifnet *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00179}00179 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_acbf31a34c95e5695e3548513ce7c058a}{nge\_mediastatus}}(\textcolor{keyword}{struct} ifnet *, \textcolor{keyword}{struct} ifmediareq *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00180}00180 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00181}00181 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_a54734c49a246f7836c8b25ea8fe4518b}{nge\_delay}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00182}00182 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_abb0e9e942bbdce95cd3b058e00960019}{nge\_eeprom\_idle}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00183}00183 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_aa234511383cdd722efcc56874ca39785}{nge\_eeprom\_putbyte}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00184}00184 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_ae9787000c416c32bbac80bf2d3ebcf5c}{nge\_eeprom\_getword}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *, \textcolor{keywordtype}{int}, uint16\_t *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00185}00185 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_a86d406ed91950605fb43896b918829b9}{nge\_read\_eeprom}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *, caddr\_t, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00186}00186 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00187}00187 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__nge_8c_a00c3b65579e4dce27027784f00866ac7}{nge\_miibus\_readreg}}(device\_t, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00188}00188 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__nge_8c_ab66b0e69c57deb958593150e7890ca7b}{nge\_miibus\_writereg}}(device\_t, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00189}00189 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_a4394be97bf3bfcf0be6812ad5f7a1af5}{nge\_miibus\_statchg}}(device\_t);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00190}00190 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00191}00191 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_a04894fa150ac70b234baaaef57930c47}{nge\_rxfilter}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00192}00192 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_a3f9235356d0ca17f235a12160244e2cf}{nge\_reset}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00193}00193 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_a419fcd545f542ed80faed05c17aae5f1}{nge\_dmamap\_cb}}(\textcolor{keywordtype}{void} *, bus\_dma\_segment\_t *, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00194}00194 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__nge_8c_a97788d813aabe6e2d3b4018f742d1e49}{nge\_dma\_alloc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00195}00195 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_a52daa5366437f42cadedf21fd44439b0}{nge\_dma\_free}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00196}00196 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__nge_8c_ae0edbc751498d6811dcc66af5765c8f3}{nge\_list\_rx\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00197}00197 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__nge_8c_ab387b6fe058d481d4c54f5200bef2abc}{nge\_list\_tx\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00198}00198 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_a02024fcb047d38c99dc8308f988078ad}{nge\_sysctl\_node}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00199}00199 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__nge_8c_a311f247d9a16f81312129360d96c124d}{sysctl\_int\_range}}(SYSCTL\_HANDLER\_ARGS, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00200}00200 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__nge_8c_ac087661b11aab3144489de1f2181defa}{sysctl\_hw\_nge\_int\_holdoff}}(SYSCTL\_HANDLER\_ARGS);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00201}00201 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00202}00202 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00203}00203 \textcolor{comment}{ * MII bit-\/bang glue}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00204}00204 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00205}00205 \textcolor{keyword}{static} uint32\_t \mbox{\hyperlink{if__nge_8c_a7da1ae2368f62eb83ebb96ece8056f1d}{nge\_mii\_bitbang\_read}}(device\_t);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00206}00206 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__nge_8c_a4364f9d959b2d8243bdb08117785c26a}{nge\_mii\_bitbang\_write}}(device\_t, uint32\_t);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00207}00207 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00208}\mbox{\hyperlink{if__nge_8c_a5c3bfbb4787ed2f38786ee5189f30ab7}{00208}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }mii\_bitbang\_ops \mbox{\hyperlink{if__nge_8c_a5c3bfbb4787ed2f38786ee5189f30ab7}{nge\_mii\_bitbang\_ops}} = \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00209}00209         \mbox{\hyperlink{if__nge_8c_a7da1ae2368f62eb83ebb96ece8056f1d}{nge\_mii\_bitbang\_read}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00210}00210         \mbox{\hyperlink{if__nge_8c_a4364f9d959b2d8243bdb08117785c26a}{nge\_mii\_bitbang\_write}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00211}00211         \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00212}00212                 \mbox{\hyperlink{if__ngereg_8h_aa69ec8aa2bddf910ffed28d3e98e917d}{NGE\_MEAR\_MII\_DATA}},     \textcolor{comment}{/* MII\_BIT\_MDO */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00213}00213                 \mbox{\hyperlink{if__ngereg_8h_aa69ec8aa2bddf910ffed28d3e98e917d}{NGE\_MEAR\_MII\_DATA}},     \textcolor{comment}{/* MII\_BIT\_MDI */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00214}00214                 \mbox{\hyperlink{if__ngereg_8h_a3ddbea7849323b80df2d022fa4d98752}{NGE\_MEAR\_MII\_CLK}},       \textcolor{comment}{/* MII\_BIT\_MDC */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00215}00215                 \mbox{\hyperlink{if__ngereg_8h_a4062c8640708a4538b102d7451a14cb7}{NGE\_MEAR\_MII\_DIR}},       \textcolor{comment}{/* MII\_BIT\_DIR\_HOST\_PHY */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00216}00216                 0,                      \textcolor{comment}{/* MII\_BIT\_DIR\_PHY\_HOST */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00217}00217         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00218}00218 \};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00219}00219 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00220}\mbox{\hyperlink{if__nge_8c_ab7700e2f5dcc3f53169b1a27c96010c4}{00220}} \textcolor{keyword}{static} device\_method\_t \mbox{\hyperlink{if__nge_8c_ab7700e2f5dcc3f53169b1a27c96010c4}{nge\_methods}}[] = \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00221}00221         \textcolor{comment}{/* Device interface */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00222}00222         DEVMETHOD(device\_probe,         \mbox{\hyperlink{if__nge_8c_a7f30987d57cffcfa9a496bc90b390084}{nge\_probe}}),}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00223}00223         DEVMETHOD(device\_attach,        \mbox{\hyperlink{if__nge_8c_a12c3d13253e03ebf8b8a766aafe507bf}{nge\_attach}}),}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00224}00224         DEVMETHOD(device\_detach,        \mbox{\hyperlink{if__nge_8c_a5d5e754934604ce7f98909dba8661ca0}{nge\_detach}}),}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00225}00225         DEVMETHOD(device\_shutdown,      \mbox{\hyperlink{if__nge_8c_a931d40221554b2514cd9ad6e52c70963}{nge\_shutdown}}),}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00226}00226         DEVMETHOD(device\_suspend,       \mbox{\hyperlink{if__nge_8c_a2ee505e753ccf3c61b3d73ae1ee464b1}{nge\_suspend}}),}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00227}00227         DEVMETHOD(device\_resume,        \mbox{\hyperlink{if__nge_8c_a53ec13d52e2833463c7b45d7eef34e25}{nge\_resume}}),}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00228}00228 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00229}00229         \textcolor{comment}{/* MII interface */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00230}00230         DEVMETHOD(miibus\_readreg,       \mbox{\hyperlink{if__nge_8c_a00c3b65579e4dce27027784f00866ac7}{nge\_miibus\_readreg}}),}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00231}00231         DEVMETHOD(miibus\_writereg,      \mbox{\hyperlink{if__nge_8c_ab66b0e69c57deb958593150e7890ca7b}{nge\_miibus\_writereg}}),}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00232}00232         DEVMETHOD(miibus\_statchg,       \mbox{\hyperlink{if__nge_8c_a4394be97bf3bfcf0be6812ad5f7a1af5}{nge\_miibus\_statchg}}),}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00233}00233 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00234}00234         DEVMETHOD\_END}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00235}00235 \};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00236}00236 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00237}\mbox{\hyperlink{if__nge_8c_a977500f97aa777b9068ed85d00981ec6}{00237}} \textcolor{keyword}{static} driver\_t \mbox{\hyperlink{if__nge_8c_a977500f97aa777b9068ed85d00981ec6}{nge\_driver}} = \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00238}00238         \textcolor{stringliteral}{"{}nge"{}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00239}00239         \mbox{\hyperlink{if__nge_8c_ab7700e2f5dcc3f53169b1a27c96010c4}{nge\_methods}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00240}00240         \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structnge__softc}{nge\_softc}})}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00241}00241 \};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00242}00242 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00243}\mbox{\hyperlink{if__nge_8c_aa67ca6168306e2769b0b07d3f372b3c6}{00243}} \textcolor{keyword}{static} devclass\_t \mbox{\hyperlink{if__nge_8c_aa67ca6168306e2769b0b07d3f372b3c6}{nge\_devclass}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00244}00244 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00245}\mbox{\hyperlink{if__nge_8c_a45cac6c62e4801e6dbc297b3b7d8c21c}{00245}} \mbox{\hyperlink{if__nge_8c_a45cac6c62e4801e6dbc297b3b7d8c21c}{DRIVER\_MODULE}}(nge, pci, \mbox{\hyperlink{if__nge_8c_a977500f97aa777b9068ed85d00981ec6}{nge\_driver}}, \mbox{\hyperlink{if__nge_8c_aa67ca6168306e2769b0b07d3f372b3c6}{nge\_devclass}}, 0, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00246}\mbox{\hyperlink{if__nge_8c_ab667f13ce624e869782905deb14b57bb}{00246}} \mbox{\hyperlink{if__nge_8c_a45cac6c62e4801e6dbc297b3b7d8c21c}{DRIVER\_MODULE}}(miibus, nge, miibus\_driver, miibus\_devclass, 0, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00247}00247 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00248}\mbox{\hyperlink{if__nge_8c_afcd425eed4d24b2afd9cda6a89330638}{00248}} \textcolor{preprocessor}{\#define NGE\_SETBIT(sc, reg, x)                          \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00249}00249 \textcolor{preprocessor}{        CSR\_WRITE\_4(sc, reg,                            \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00250}00250 \textcolor{preprocessor}{                CSR\_READ\_4(sc, reg) | (x))}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00251}00251 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00252}\mbox{\hyperlink{if__nge_8c_a70b349eff06269a5344d24cdd8581df2}{00252}} \textcolor{preprocessor}{\#define NGE\_CLRBIT(sc, reg, x)                          \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00253}00253 \textcolor{preprocessor}{        CSR\_WRITE\_4(sc, reg,                            \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00254}00254 \textcolor{preprocessor}{                CSR\_READ\_4(sc, reg) \& \string~(x))}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00255}00255 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00256}\mbox{\hyperlink{if__nge_8c_a0fb020c2bbc2ae6912e0ec36c4011fa8}{00256}} \textcolor{preprocessor}{\#define SIO\_SET(x)                                      \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00257}00257 \textcolor{preprocessor}{        CSR\_WRITE\_4(sc, NGE\_MEAR, CSR\_READ\_4(sc, NGE\_MEAR) | (x))}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00258}00258 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00259}\mbox{\hyperlink{if__nge_8c_a9cc6debe949fb8e5afad98294fa3a522}{00259}} \textcolor{preprocessor}{\#define SIO\_CLR(x)                                      \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00260}00260 \textcolor{preprocessor}{        CSR\_WRITE\_4(sc, NGE\_MEAR, CSR\_READ\_4(sc, NGE\_MEAR) \& \string~(x))}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00261}00261 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00262}00262 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00263}\mbox{\hyperlink{if__nge_8c_a54734c49a246f7836c8b25ea8fe4518b}{00263}} \mbox{\hyperlink{if__nge_8c_a54734c49a246f7836c8b25ea8fe4518b}{nge\_delay}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00264}00264 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00265}00265         \textcolor{keywordtype}{int} idx;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00266}00266 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00267}00267         \textcolor{keywordflow}{for} (idx = (300 / 33) + 1; idx > 0; idx-\/-\/)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00268}00268                 \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a8530e5d23599fe33a65b74ad6021a800}{NGE\_CSR}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00269}00269 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00270}00270 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00271}00271 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00272}\mbox{\hyperlink{if__nge_8c_abb0e9e942bbdce95cd3b058e00960019}{00272}} \mbox{\hyperlink{if__nge_8c_abb0e9e942bbdce95cd3b058e00960019}{nge\_eeprom\_idle}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00273}00273 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00274}00274         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00275}00275 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00276}00276         \mbox{\hyperlink{if__nge_8c_a0fb020c2bbc2ae6912e0ec36c4011fa8}{SIO\_SET}}(\mbox{\hyperlink{if__ngereg_8h_a2e3c9dd7fdbc2ac7dc0aa399c62c2598}{NGE\_MEAR\_EE\_CSEL}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00277}00277         \mbox{\hyperlink{if__nge_8c_a54734c49a246f7836c8b25ea8fe4518b}{nge\_delay}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00278}00278         \mbox{\hyperlink{if__nge_8c_a0fb020c2bbc2ae6912e0ec36c4011fa8}{SIO\_SET}}(\mbox{\hyperlink{if__ngereg_8h_a645dc8edd601486d8d7f92061928fad9}{NGE\_MEAR\_EE\_CLK}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00279}00279         \mbox{\hyperlink{if__nge_8c_a54734c49a246f7836c8b25ea8fe4518b}{nge\_delay}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00280}00280 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00281}00281         \textcolor{keywordflow}{for} (i = 0; i < 25; i++) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00282}00282                 \mbox{\hyperlink{if__nge_8c_a9cc6debe949fb8e5afad98294fa3a522}{SIO\_CLR}}(\mbox{\hyperlink{if__ngereg_8h_a645dc8edd601486d8d7f92061928fad9}{NGE\_MEAR\_EE\_CLK}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00283}00283                 \mbox{\hyperlink{if__nge_8c_a54734c49a246f7836c8b25ea8fe4518b}{nge\_delay}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00284}00284                 \mbox{\hyperlink{if__nge_8c_a0fb020c2bbc2ae6912e0ec36c4011fa8}{SIO\_SET}}(\mbox{\hyperlink{if__ngereg_8h_a645dc8edd601486d8d7f92061928fad9}{NGE\_MEAR\_EE\_CLK}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00285}00285                 \mbox{\hyperlink{if__nge_8c_a54734c49a246f7836c8b25ea8fe4518b}{nge\_delay}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00286}00286         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00287}00287 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00288}00288         \mbox{\hyperlink{if__nge_8c_a9cc6debe949fb8e5afad98294fa3a522}{SIO\_CLR}}(\mbox{\hyperlink{if__ngereg_8h_a645dc8edd601486d8d7f92061928fad9}{NGE\_MEAR\_EE\_CLK}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00289}00289         \mbox{\hyperlink{if__nge_8c_a54734c49a246f7836c8b25ea8fe4518b}{nge\_delay}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00290}00290         \mbox{\hyperlink{if__nge_8c_a9cc6debe949fb8e5afad98294fa3a522}{SIO\_CLR}}(\mbox{\hyperlink{if__ngereg_8h_a2e3c9dd7fdbc2ac7dc0aa399c62c2598}{NGE\_MEAR\_EE\_CSEL}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00291}00291         \mbox{\hyperlink{if__nge_8c_a54734c49a246f7836c8b25ea8fe4518b}{nge\_delay}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00292}00292         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_ac0bcb4d955759be1412b66989b5cef44}{NGE\_MEAR}}, 0x00000000);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00293}00293 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00294}00294 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00295}00295 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00296}00296 \textcolor{comment}{ * Send a read command and address to the EEPROM, check for ACK.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00297}00297 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00298}00298 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00299}\mbox{\hyperlink{if__nge_8c_aa234511383cdd722efcc56874ca39785}{00299}} \mbox{\hyperlink{if__nge_8c_aa234511383cdd722efcc56874ca39785}{nge\_eeprom\_putbyte}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc, \textcolor{keywordtype}{int} addr)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00300}00300 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00301}00301         \textcolor{keywordtype}{int} d, i;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00302}00302 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00303}00303         d = addr | \mbox{\hyperlink{if__ngereg_8h_ab4b5d13e5559157df0bf1658cfbd2867}{NGE\_EECMD\_READ}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00304}00304 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00305}00305         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00306}00306 \textcolor{comment}{         * Feed in each bit and stobe the clock.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00307}00307 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00308}00308         \textcolor{keywordflow}{for} (i = 0x400; i; i >>= 1) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00309}00309                 \textcolor{keywordflow}{if} (d \& i) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00310}00310                         \mbox{\hyperlink{if__nge_8c_a0fb020c2bbc2ae6912e0ec36c4011fa8}{SIO\_SET}}(\mbox{\hyperlink{if__ngereg_8h_a533734c47897c6d539c64f44fc47ae69}{NGE\_MEAR\_EE\_DIN}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00311}00311                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00312}00312                         \mbox{\hyperlink{if__nge_8c_a9cc6debe949fb8e5afad98294fa3a522}{SIO\_CLR}}(\mbox{\hyperlink{if__ngereg_8h_a533734c47897c6d539c64f44fc47ae69}{NGE\_MEAR\_EE\_DIN}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00313}00313                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00314}00314                 \mbox{\hyperlink{if__nge_8c_a54734c49a246f7836c8b25ea8fe4518b}{nge\_delay}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00315}00315                 \mbox{\hyperlink{if__nge_8c_a0fb020c2bbc2ae6912e0ec36c4011fa8}{SIO\_SET}}(\mbox{\hyperlink{if__ngereg_8h_a645dc8edd601486d8d7f92061928fad9}{NGE\_MEAR\_EE\_CLK}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00316}00316                 \mbox{\hyperlink{if__nge_8c_a54734c49a246f7836c8b25ea8fe4518b}{nge\_delay}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00317}00317                 \mbox{\hyperlink{if__nge_8c_a9cc6debe949fb8e5afad98294fa3a522}{SIO\_CLR}}(\mbox{\hyperlink{if__ngereg_8h_a645dc8edd601486d8d7f92061928fad9}{NGE\_MEAR\_EE\_CLK}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00318}00318                 \mbox{\hyperlink{if__nge_8c_a54734c49a246f7836c8b25ea8fe4518b}{nge\_delay}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00319}00319         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00320}00320 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00321}00321 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00322}00322 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00323}00323 \textcolor{comment}{ * Read a word of data stored in the EEPROM at address 'addr.'}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00324}00324 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00325}00325 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00326}\mbox{\hyperlink{if__nge_8c_ae9787000c416c32bbac80bf2d3ebcf5c}{00326}} \mbox{\hyperlink{if__nge_8c_ae9787000c416c32bbac80bf2d3ebcf5c}{nge\_eeprom\_getword}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc, \textcolor{keywordtype}{int} addr, uint16\_t *dest)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00327}00327 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00328}00328         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00329}00329         uint16\_t word = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00330}00330 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00331}00331         \textcolor{comment}{/* Force EEPROM to idle state. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00332}00332         \mbox{\hyperlink{if__nge_8c_abb0e9e942bbdce95cd3b058e00960019}{nge\_eeprom\_idle}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00333}00333 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00334}00334         \textcolor{comment}{/* Enter EEPROM access mode. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00335}00335         \mbox{\hyperlink{if__nge_8c_a54734c49a246f7836c8b25ea8fe4518b}{nge\_delay}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00336}00336         \mbox{\hyperlink{if__nge_8c_a9cc6debe949fb8e5afad98294fa3a522}{SIO\_CLR}}(\mbox{\hyperlink{if__ngereg_8h_a645dc8edd601486d8d7f92061928fad9}{NGE\_MEAR\_EE\_CLK}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00337}00337         \mbox{\hyperlink{if__nge_8c_a54734c49a246f7836c8b25ea8fe4518b}{nge\_delay}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00338}00338         \mbox{\hyperlink{if__nge_8c_a0fb020c2bbc2ae6912e0ec36c4011fa8}{SIO\_SET}}(\mbox{\hyperlink{if__ngereg_8h_a2e3c9dd7fdbc2ac7dc0aa399c62c2598}{NGE\_MEAR\_EE\_CSEL}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00339}00339         \mbox{\hyperlink{if__nge_8c_a54734c49a246f7836c8b25ea8fe4518b}{nge\_delay}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00340}00340 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00341}00341         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00342}00342 \textcolor{comment}{         * Send address of word we want to read.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00343}00343 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00344}00344         \mbox{\hyperlink{if__nge_8c_aa234511383cdd722efcc56874ca39785}{nge\_eeprom\_putbyte}}(sc, addr);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00345}00345 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00346}00346         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00347}00347 \textcolor{comment}{         * Start reading bits from EEPROM.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00348}00348 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00349}00349         \textcolor{keywordflow}{for} (i = 0x8000; i; i >>= 1) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00350}00350                 \mbox{\hyperlink{if__nge_8c_a0fb020c2bbc2ae6912e0ec36c4011fa8}{SIO\_SET}}(\mbox{\hyperlink{if__ngereg_8h_a645dc8edd601486d8d7f92061928fad9}{NGE\_MEAR\_EE\_CLK}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00351}00351                 \mbox{\hyperlink{if__nge_8c_a54734c49a246f7836c8b25ea8fe4518b}{nge\_delay}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00352}00352                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_ac0bcb4d955759be1412b66989b5cef44}{NGE\_MEAR}}) \& \mbox{\hyperlink{if__ngereg_8h_ae558bc74a8d601b6dcba4cf3cb085374}{NGE\_MEAR\_EE\_DOUT}})}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00353}00353                         word |= i;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00354}00354                 \mbox{\hyperlink{if__nge_8c_a54734c49a246f7836c8b25ea8fe4518b}{nge\_delay}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00355}00355                 \mbox{\hyperlink{if__nge_8c_a9cc6debe949fb8e5afad98294fa3a522}{SIO\_CLR}}(\mbox{\hyperlink{if__ngereg_8h_a645dc8edd601486d8d7f92061928fad9}{NGE\_MEAR\_EE\_CLK}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00356}00356                 \mbox{\hyperlink{if__nge_8c_a54734c49a246f7836c8b25ea8fe4518b}{nge\_delay}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00357}00357         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00358}00358 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00359}00359         \textcolor{comment}{/* Turn off EEPROM access mode. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00360}00360         \mbox{\hyperlink{if__nge_8c_abb0e9e942bbdce95cd3b058e00960019}{nge\_eeprom\_idle}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00361}00361 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00362}00362         *dest = word;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00363}00363 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00364}00364 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00365}00365 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00366}00366 \textcolor{comment}{ * Read a sequence of words from the EEPROM.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00367}00367 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00368}00368 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00369}\mbox{\hyperlink{if__nge_8c_a86d406ed91950605fb43896b918829b9}{00369}} \mbox{\hyperlink{if__nge_8c_a86d406ed91950605fb43896b918829b9}{nge\_read\_eeprom}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc, caddr\_t dest, \textcolor{keywordtype}{int} off, \textcolor{keywordtype}{int} cnt)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00370}00370 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00371}00371         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00372}00372         uint16\_t word = 0, *ptr;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00373}00373 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00374}00374         \textcolor{keywordflow}{for} (i = 0; i < cnt; i++) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00375}00375                 \mbox{\hyperlink{if__nge_8c_ae9787000c416c32bbac80bf2d3ebcf5c}{nge\_eeprom\_getword}}(sc, off + i, \&word);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00376}00376                 ptr = (uint16\_t *)(dest + (i * 2));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00377}00377                 *ptr = word;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00378}00378         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00379}00379 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00380}00380 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00381}00381 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00382}00382 \textcolor{comment}{ * Read the MII serial port for the MII bit-\/bang module.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00383}00383 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00384}00384 \textcolor{keyword}{static} uint32\_t}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00385}\mbox{\hyperlink{if__nge_8c_a7da1ae2368f62eb83ebb96ece8056f1d}{00385}} \mbox{\hyperlink{if__nge_8c_a7da1ae2368f62eb83ebb96ece8056f1d}{nge\_mii\_bitbang\_read}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00386}00386 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00387}00387         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00388}00388         uint32\_t val;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00389}00389 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00390}00390         sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00391}00391 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00392}00392         val = \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_ac0bcb4d955759be1412b66989b5cef44}{NGE\_MEAR}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00393}00393         \mbox{\hyperlink{if__ngereg_8h_a8d0df18248ed8e804a14eecc559d53bc}{CSR\_BARRIER\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_ac0bcb4d955759be1412b66989b5cef44}{NGE\_MEAR}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00394}00394             BUS\_SPACE\_BARRIER\_READ | BUS\_SPACE\_BARRIER\_WRITE);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00395}00395 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00396}00396         \textcolor{keywordflow}{return} (val);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00397}00397 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00398}00398 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00399}00399 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00400}00400 \textcolor{comment}{ * Write the MII serial port for the MII bit-\/bang module.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00401}00401 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00402}00402 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00403}\mbox{\hyperlink{if__nge_8c_a4364f9d959b2d8243bdb08117785c26a}{00403}} \mbox{\hyperlink{if__nge_8c_a4364f9d959b2d8243bdb08117785c26a}{nge\_mii\_bitbang\_write}}(device\_t dev, uint32\_t val)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00404}00404 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00405}00405         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00406}00406 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00407}00407         sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00408}00408 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00409}00409         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_ac0bcb4d955759be1412b66989b5cef44}{NGE\_MEAR}}, val);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00410}00410         \mbox{\hyperlink{if__ngereg_8h_a8d0df18248ed8e804a14eecc559d53bc}{CSR\_BARRIER\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_ac0bcb4d955759be1412b66989b5cef44}{NGE\_MEAR}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00411}00411             BUS\_SPACE\_BARRIER\_READ | BUS\_SPACE\_BARRIER\_WRITE);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00412}00412 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00413}00413 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00414}00414 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00415}\mbox{\hyperlink{if__nge_8c_a00c3b65579e4dce27027784f00866ac7}{00415}} \mbox{\hyperlink{if__nge_8c_a00c3b65579e4dce27027784f00866ac7}{nge\_miibus\_readreg}}(device\_t dev, \textcolor{keywordtype}{int} phy, \textcolor{keywordtype}{int} reg)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00416}00416 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00417}00417         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00418}00418         \textcolor{keywordtype}{int} rv;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00419}00419 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00420}00420         sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00421}00421         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structnge__softc_ac84c514781515c9c5e2b88fc019e0265}{nge\_flags}} \& \mbox{\hyperlink{if__ngereg_8h_af0d3f50db685ea99ffd9abc9ec0b732c}{NGE\_FLAG\_TBI}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00422}00422                 \textcolor{comment}{/* Pretend PHY is at address 0. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00423}00423                 \textcolor{keywordflow}{if} (phy != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00424}00424                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00425}00425                 \textcolor{keywordflow}{switch} (reg) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00426}00426                 \textcolor{keywordflow}{case} MII\_BMCR:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00427}00427                         reg = \mbox{\hyperlink{if__ngereg_8h_a90c246ba0f6489bfec5de6e5a067aacd}{NGE\_TBI\_BMCR}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00428}00428                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00429}00429                 \textcolor{keywordflow}{case} MII\_BMSR:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00430}00430                         \textcolor{comment}{/* 83820/83821 has different bit layout for BMSR. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00431}00431                         rv = BMSR\_ANEG | BMSR\_EXTCAP | BMSR\_EXTSTAT;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00432}00432                         reg = \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a05f78ed9f7c1a9bbd9df4ff657018190}{NGE\_TBI\_BMSR}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00433}00433                         \textcolor{keywordflow}{if} ((reg \& \mbox{\hyperlink{if__ngereg_8h_ac690a0a86de6f61b66b0173843384c91}{NGE\_TBIBMSR\_ANEG\_DONE}}) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00434}00434                                 rv |= BMSR\_ACOMP;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00435}00435                         \textcolor{keywordflow}{if} ((reg \& \mbox{\hyperlink{if__ngereg_8h_aa5f3eb3f3824cdab2279a7e9dc1ced8b}{NGE\_TBIBMSR\_LINKSTAT}}) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00436}00436                                 rv |= BMSR\_LINK;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00437}00437                         \textcolor{keywordflow}{return} (rv);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00438}00438                 \textcolor{keywordflow}{case} MII\_ANAR:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00439}00439                         reg = \mbox{\hyperlink{if__ngereg_8h_acaf4e5f578f318e40476ca4503f3f384}{NGE\_TBI\_ANAR}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00440}00440                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00441}00441                 \textcolor{keywordflow}{case} MII\_ANLPAR:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00442}00442                         reg = \mbox{\hyperlink{if__ngereg_8h_a543d838b9dc06640b6d0a73fed7df3d8}{NGE\_TBI\_ANLPAR}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00443}00443                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00444}00444                 \textcolor{keywordflow}{case} MII\_ANER:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00445}00445                         reg = \mbox{\hyperlink{if__ngereg_8h_a001c2934a32f3c31732190fc3c0b8983}{NGE\_TBI\_ANER}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00446}00446                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00447}00447                 \textcolor{keywordflow}{case} MII\_EXTSR:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00448}00448                         reg = \mbox{\hyperlink{if__ngereg_8h_ab1e32cd0aa9c7d3f070df2bceb3b1da2}{NGE\_TBI\_ESR}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00449}00449                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00450}00450                 \textcolor{keywordflow}{case} MII\_PHYIDR1:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00451}00451                 \textcolor{keywordflow}{case} MII\_PHYIDR2:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00452}00452                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00453}00453                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00454}00454                         device\_printf(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00455}00455                             \textcolor{stringliteral}{"{}bad phy register read : \%d\(\backslash\)n"{}}, reg);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00456}00456                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00457}00457                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00458}00458                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, reg));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00459}00459         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00460}00460 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00461}00461         \textcolor{keywordflow}{return} (mii\_bitbang\_readreg(dev, \&\mbox{\hyperlink{if__nge_8c_a5c3bfbb4787ed2f38786ee5189f30ab7}{nge\_mii\_bitbang\_ops}}, phy, reg));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00462}00462 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00463}00463 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00464}00464 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00465}\mbox{\hyperlink{if__nge_8c_ab66b0e69c57deb958593150e7890ca7b}{00465}} \mbox{\hyperlink{if__nge_8c_ab66b0e69c57deb958593150e7890ca7b}{nge\_miibus\_writereg}}(device\_t dev, \textcolor{keywordtype}{int} phy, \textcolor{keywordtype}{int} reg, \textcolor{keywordtype}{int} data)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00466}00466 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00467}00467         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00468}00468 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00469}00469         sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00470}00470         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structnge__softc_ac84c514781515c9c5e2b88fc019e0265}{nge\_flags}} \& \mbox{\hyperlink{if__ngereg_8h_af0d3f50db685ea99ffd9abc9ec0b732c}{NGE\_FLAG\_TBI}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00471}00471                 \textcolor{comment}{/* Pretend PHY is at address 0. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00472}00472                 \textcolor{keywordflow}{if} (phy != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00473}00473                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00474}00474                 \textcolor{keywordflow}{switch} (reg) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00475}00475                 \textcolor{keywordflow}{case} MII\_BMCR:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00476}00476                         reg = \mbox{\hyperlink{if__ngereg_8h_a90c246ba0f6489bfec5de6e5a067aacd}{NGE\_TBI\_BMCR}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00477}00477                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00478}00478                 \textcolor{keywordflow}{case} MII\_BMSR:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00479}00479                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00480}00480                 \textcolor{keywordflow}{case} MII\_ANAR:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00481}00481                         reg = \mbox{\hyperlink{if__ngereg_8h_acaf4e5f578f318e40476ca4503f3f384}{NGE\_TBI\_ANAR}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00482}00482                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00483}00483                 \textcolor{keywordflow}{case} MII\_ANLPAR:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00484}00484                         reg = \mbox{\hyperlink{if__ngereg_8h_a543d838b9dc06640b6d0a73fed7df3d8}{NGE\_TBI\_ANLPAR}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00485}00485                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00486}00486                 \textcolor{keywordflow}{case} MII\_ANER:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00487}00487                         reg = \mbox{\hyperlink{if__ngereg_8h_a001c2934a32f3c31732190fc3c0b8983}{NGE\_TBI\_ANER}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00488}00488                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00489}00489                 \textcolor{keywordflow}{case} MII\_EXTSR:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00490}00490                         reg = \mbox{\hyperlink{if__ngereg_8h_ab1e32cd0aa9c7d3f070df2bceb3b1da2}{NGE\_TBI\_ESR}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00491}00491                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00492}00492                 \textcolor{keywordflow}{case} MII\_PHYIDR1:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00493}00493                 \textcolor{keywordflow}{case} MII\_PHYIDR2:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00494}00494                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00495}00495                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00496}00496                         device\_printf(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00497}00497                             \textcolor{stringliteral}{"{}bad phy register write : \%d\(\backslash\)n"{}}, reg);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00498}00498                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00499}00499                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00500}00500                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, reg, data);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00501}00501                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00502}00502         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00503}00503 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00504}00504         mii\_bitbang\_writereg(dev, \&\mbox{\hyperlink{if__nge_8c_a5c3bfbb4787ed2f38786ee5189f30ab7}{nge\_mii\_bitbang\_ops}}, phy, reg, data);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00505}00505 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00506}00506         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00507}00507 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00508}00508 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00509}00509 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00510}00510 \textcolor{comment}{ * media status/link state change handler.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00511}00511 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00512}00512 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00513}\mbox{\hyperlink{if__nge_8c_a4394be97bf3bfcf0be6812ad5f7a1af5}{00513}} \mbox{\hyperlink{if__nge_8c_a4394be97bf3bfcf0be6812ad5f7a1af5}{nge\_miibus\_statchg}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00514}00514 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00515}00515         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00516}00516         \textcolor{keyword}{struct }mii\_data *mii;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00517}00517         \textcolor{keyword}{struct }ifnet *ifp;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00518}00518         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__txdesc}{nge\_txdesc}} *txd;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00519}00519         uint32\_t done, reg, status;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00520}00520         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00521}00521 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00522}00522         sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00523}00523         \mbox{\hyperlink{if__ngereg_8h_aef7ce8bc258716f95755fd594bb3436e}{NGE\_LOCK\_ASSERT}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00524}00524 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00525}00525         mii = device\_get\_softc(sc-\/>\mbox{\hyperlink{structnge__softc_a0c48586b5276b5d260cf1d0f606eef32}{nge\_miibus}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00526}00526         ifp = sc-\/>\mbox{\hyperlink{structnge__softc_ae1ee58f588347b47a3e046b13f030118}{nge\_ifp}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00527}00527         \textcolor{keywordflow}{if} (mii == NULL || ifp == NULL ||}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00528}00528             (ifp-\/>if\_drv\_flags \& IFF\_DRV\_RUNNING) == 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00529}00529                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00530}00530 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00531}00531         sc-\/>\mbox{\hyperlink{structnge__softc_ac84c514781515c9c5e2b88fc019e0265}{nge\_flags}} \&= \string~NGE\_FLAG\_LINK;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00532}00532         \textcolor{keywordflow}{if} ((mii-\/>mii\_media\_status \& (IFM\_AVALID | IFM\_ACTIVE)) ==}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00533}00533             (IFM\_AVALID | IFM\_ACTIVE)) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00534}00534                 \textcolor{keywordflow}{switch} (IFM\_SUBTYPE(mii-\/>mii\_media\_active)) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00535}00535                 \textcolor{keywordflow}{case} IFM\_10\_T:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00536}00536                 \textcolor{keywordflow}{case} IFM\_100\_TX:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00537}00537                 \textcolor{keywordflow}{case} IFM\_1000\_T:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00538}00538                 \textcolor{keywordflow}{case} IFM\_1000\_SX:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00539}00539                 \textcolor{keywordflow}{case} IFM\_1000\_LX:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00540}00540                 \textcolor{keywordflow}{case} IFM\_1000\_CX:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00541}00541                         sc-\/>\mbox{\hyperlink{structnge__softc_ac84c514781515c9c5e2b88fc019e0265}{nge\_flags}} |= \mbox{\hyperlink{if__ngereg_8h_a404d97bcfec9925bde7d065cb2c82074}{NGE\_FLAG\_LINK}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00542}00542                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00543}00543                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00544}00544                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00545}00545                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00546}00546         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00547}00547 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00548}00548         \textcolor{comment}{/* Stop Tx/Rx MACs. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00549}00549         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__nge_8c_ad22b729a9097b444402b77e65a9c7855}{nge\_stop\_mac}}(sc) == ETIMEDOUT)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00550}00550                 device\_printf(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00551}00551                     \textcolor{stringliteral}{"{}\%s: unable to stop Tx/Rx MAC\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00552}00552         \mbox{\hyperlink{if__nge_8c_a63a556df379a487a1d56e4d32ad68456}{nge\_txeof}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00553}00553         \mbox{\hyperlink{if__nge_8c_a5309c35e59df21a3a3102326fa57dae4}{nge\_rxeof}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00554}00554         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a3d7f33c53cb34088a9af8a6b68a03f5d}{nge\_head}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00555}00555                 m\_freem(sc-\/>\mbox{\hyperlink{structnge__softc_a3d7f33c53cb34088a9af8a6b68a03f5d}{nge\_head}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00556}00556                 sc-\/>\mbox{\hyperlink{structnge__softc_a3d7f33c53cb34088a9af8a6b68a03f5d}{nge\_head}} = sc-\/>\mbox{\hyperlink{structnge__softc_a3dec9af0002f6eee694bd4842a913309}{nge\_tail}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00557}00557         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00558}00558 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00559}00559         \textcolor{comment}{/* Release queued frames. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00560}00560         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__ngereg_8h_a2c640f4df126d566325ac35549986d2d}{NGE\_TX\_RING\_CNT}}; i++) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00561}00561                 txd = \&sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_ac62d7f895349014f6b56adde934fbb0a}{nge\_txdesc}}[i];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00562}00562                 \textcolor{keywordflow}{if} (txd-\/>\mbox{\hyperlink{structnge__txdesc_ac0980a7537bb5a6c403c3d89ec58663b}{tx\_m}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00563}00563                         bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a6fc520951d327aa4be4f35f2dfa3f521}{nge\_tx\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00564}00564                             txd-\/>\mbox{\hyperlink{structnge__txdesc_aa334e70e247f63d45bd94da3e631e79f}{tx\_dmamap}}, BUS\_DMASYNC\_POSTWRITE);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00565}00565                         bus\_dmamap\_unload(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a6fc520951d327aa4be4f35f2dfa3f521}{nge\_tx\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00566}00566                             txd-\/>\mbox{\hyperlink{structnge__txdesc_aa334e70e247f63d45bd94da3e631e79f}{tx\_dmamap}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00567}00567                         m\_freem(txd-\/>\mbox{\hyperlink{structnge__txdesc_ac0980a7537bb5a6c403c3d89ec58663b}{tx\_m}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00568}00568                         txd-\/>\mbox{\hyperlink{structnge__txdesc_ac0980a7537bb5a6c403c3d89ec58663b}{tx\_m}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00569}00569                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00570}00570         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00571}00571 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00572}00572         \textcolor{comment}{/* Program MAC with resolved speed/duplex. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00573}00573         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structnge__softc_ac84c514781515c9c5e2b88fc019e0265}{nge\_flags}} \& \mbox{\hyperlink{if__ngereg_8h_a404d97bcfec9925bde7d065cb2c82074}{NGE\_FLAG\_LINK}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00574}00574                 \textcolor{keywordflow}{if} ((IFM\_OPTIONS(mii-\/>mii\_media\_active) \& IFM\_FDX) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00575}00575                         \mbox{\hyperlink{if__nge_8c_afcd425eed4d24b2afd9cda6a89330638}{NGE\_SETBIT}}(sc, \mbox{\hyperlink{if__ngereg_8h_ac03f73cf6606d3cd310b9f3a94dc5818}{NGE\_TX\_CFG}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00576}00576                             (\mbox{\hyperlink{if__ngereg_8h_acd144716e35095df4e1d08deeecbdb43}{NGE\_TXCFG\_IGN\_HBEAT}} | \mbox{\hyperlink{if__ngereg_8h_a38c6639c4c68fbd42d47775b340ec991}{NGE\_TXCFG\_IGN\_CARR}}));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00577}00577                         \mbox{\hyperlink{if__nge_8c_afcd425eed4d24b2afd9cda6a89330638}{NGE\_SETBIT}}(sc, \mbox{\hyperlink{if__ngereg_8h_a7f1364697aacd7581353641ca9a651b2}{NGE\_RX\_CFG}}, \mbox{\hyperlink{if__ngereg_8h_a50cf1bf967428e6aee329a0ac5f4c0c7}{NGE\_RXCFG\_RX\_FDX}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00578}00578 \textcolor{preprocessor}{\#ifdef notyet}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00579}00579                         \textcolor{comment}{/* Enable flow-\/control. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00580}00580                         \textcolor{keywordflow}{if} ((IFM\_OPTIONS(mii-\/>mii\_media\_active) \&}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00581}00581                             (IFM\_ETH\_RXPAUSE | IFM\_ETH\_TXPAUSE)) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00582}00582                                 \mbox{\hyperlink{if__nge_8c_afcd425eed4d24b2afd9cda6a89330638}{NGE\_SETBIT}}(sc, \mbox{\hyperlink{if__ngereg_8h_adde29edad5e57b2f2bc72c4875073d4a}{NGE\_PAUSECSR}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00583}00583                                     \mbox{\hyperlink{if__ngereg_8h_abde7ddfd46e1ce9184fc6b2cc4967a3e}{NGE\_PAUSECSR\_PAUSE\_ENB}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00584}00584 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00585}00585                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00586}00586                         \mbox{\hyperlink{if__nge_8c_a70b349eff06269a5344d24cdd8581df2}{NGE\_CLRBIT}}(sc, \mbox{\hyperlink{if__ngereg_8h_ac03f73cf6606d3cd310b9f3a94dc5818}{NGE\_TX\_CFG}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00587}00587                             (\mbox{\hyperlink{if__ngereg_8h_acd144716e35095df4e1d08deeecbdb43}{NGE\_TXCFG\_IGN\_HBEAT}} | \mbox{\hyperlink{if__ngereg_8h_a38c6639c4c68fbd42d47775b340ec991}{NGE\_TXCFG\_IGN\_CARR}}));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00588}00588                         \mbox{\hyperlink{if__nge_8c_a70b349eff06269a5344d24cdd8581df2}{NGE\_CLRBIT}}(sc, \mbox{\hyperlink{if__ngereg_8h_a7f1364697aacd7581353641ca9a651b2}{NGE\_RX\_CFG}}, \mbox{\hyperlink{if__ngereg_8h_a50cf1bf967428e6aee329a0ac5f4c0c7}{NGE\_RXCFG\_RX\_FDX}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00589}00589                         \mbox{\hyperlink{if__nge_8c_a70b349eff06269a5344d24cdd8581df2}{NGE\_CLRBIT}}(sc, \mbox{\hyperlink{if__ngereg_8h_adde29edad5e57b2f2bc72c4875073d4a}{NGE\_PAUSECSR}}, \mbox{\hyperlink{if__ngereg_8h_abde7ddfd46e1ce9184fc6b2cc4967a3e}{NGE\_PAUSECSR\_PAUSE\_ENB}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00590}00590                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00591}00591                 \textcolor{comment}{/* If we have a 1000Mbps link, set the mode\_1000 bit. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00592}00592                 reg = \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a380ea42fdd5fb3f8186c9fe7a2f410e5}{NGE\_CFG}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00593}00593                 \textcolor{keywordflow}{switch} (IFM\_SUBTYPE(mii-\/>mii\_media\_active)) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00594}00594                 \textcolor{keywordflow}{case} IFM\_1000\_SX:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00595}00595                 \textcolor{keywordflow}{case} IFM\_1000\_LX:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00596}00596                 \textcolor{keywordflow}{case} IFM\_1000\_CX:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00597}00597                 \textcolor{keywordflow}{case} IFM\_1000\_T:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00598}00598                         reg |= \mbox{\hyperlink{if__ngereg_8h_a439d02d3945c4210776fba51a90060a9}{NGE\_CFG\_MODE\_1000}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00599}00599                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00600}00600                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00601}00601                         reg \&= \string~NGE\_CFG\_MODE\_1000;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00602}00602                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00603}00603                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00604}00604                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a380ea42fdd5fb3f8186c9fe7a2f410e5}{NGE\_CFG}}, reg);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00605}00605 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00606}00606                 \textcolor{comment}{/* Reset Tx/Rx MAC. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00607}00607                 reg = \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a8530e5d23599fe33a65b74ad6021a800}{NGE\_CSR}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00608}00608                 reg |= \mbox{\hyperlink{if__ngereg_8h_aa5becf749571ddd8251ccc352ce8ce22}{NGE\_CSR\_TX\_RESET}} | \mbox{\hyperlink{if__ngereg_8h_a7cc3c3e4f62ac60066b9e47b85611a10}{NGE\_CSR\_RX\_RESET}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00609}00609                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a8530e5d23599fe33a65b74ad6021a800}{NGE\_CSR}}, reg);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00610}00610                 \textcolor{comment}{/* Check the completion of reset. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00611}00611                 done = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00612}00612                 \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__ngereg_8h_a9a8df12a892089b46b1b27ca0c538f00}{NGE\_TIMEOUT}}; i++) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00613}00613                         DELAY(1);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00614}00614                         status = \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_afe4d3bf547292dbf8a277dd3c6a016ec}{NGE\_ISR}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00615}00615                         \textcolor{keywordflow}{if} ((status \& \mbox{\hyperlink{if__ngereg_8h_ac0505a5640db3ef3d77c3374c53830bb}{NGE\_ISR\_RX\_RESET\_DONE}}) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00616}00616                                 done |= \mbox{\hyperlink{if__ngereg_8h_ac0505a5640db3ef3d77c3374c53830bb}{NGE\_ISR\_RX\_RESET\_DONE}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00617}00617                         \textcolor{keywordflow}{if} ((status \& \mbox{\hyperlink{if__ngereg_8h_ac7e5ac076ebd8e5143ef6c5ef7d979fa}{NGE\_ISR\_TX\_RESET\_DONE}}) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00618}00618                                 done |= \mbox{\hyperlink{if__ngereg_8h_ac7e5ac076ebd8e5143ef6c5ef7d979fa}{NGE\_ISR\_TX\_RESET\_DONE}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00619}00619                         \textcolor{keywordflow}{if} (done ==}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00620}00620                             (\mbox{\hyperlink{if__ngereg_8h_ac7e5ac076ebd8e5143ef6c5ef7d979fa}{NGE\_ISR\_TX\_RESET\_DONE}} | \mbox{\hyperlink{if__ngereg_8h_ac0505a5640db3ef3d77c3374c53830bb}{NGE\_ISR\_RX\_RESET\_DONE}}))}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00621}00621                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00622}00622                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00623}00623                 \textcolor{keywordflow}{if} (i == \mbox{\hyperlink{if__ngereg_8h_a9a8df12a892089b46b1b27ca0c538f00}{NGE\_TIMEOUT}})}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00624}00624                         device\_printf(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00625}00625                             \textcolor{stringliteral}{"{}\%s: unable to reset Tx/Rx MAC\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00626}00626                 \textcolor{comment}{/* Reuse Rx buffer and reset consumer pointer. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00627}00627                 sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_aeb5b3bb7215e5e127e6038d4df3fde4a}{nge\_rx\_cons}} = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00628}00628                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00629}00629 \textcolor{comment}{                 * It seems that resetting Rx/Tx MAC results in}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00630}00630 \textcolor{comment}{                 * resetting Tx/Rx descriptor pointer registers such}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00631}00631 \textcolor{comment}{                 * that reloading Tx/Rx lists address are needed.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00632}00632 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00633}00633                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_acd52accb036d8c3a86b6105e6b7d68c3}{NGE\_RX\_LISTPTR\_HI}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00634}00634                     \mbox{\hyperlink{if__ngereg_8h_a76cf84764e0c48e78af63c526c5cdd38}{NGE\_ADDR\_HI}}(sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_ab414dc2a3256f10bf3100df2dfdb05b5}{nge\_rx\_ring\_paddr}}));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00635}00635                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_aeed8215557134f0e0966dea56b095032}{NGE\_RX\_LISTPTR\_LO}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00636}00636                     \mbox{\hyperlink{if__ngereg_8h_a11c2f0eb778450088fe042ea7ddc75d6}{NGE\_ADDR\_LO}}(sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_ab414dc2a3256f10bf3100df2dfdb05b5}{nge\_rx\_ring\_paddr}}));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00637}00637                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a960467752f638054b1c0d04c6d1e93a8}{NGE\_TX\_LISTPTR\_HI}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00638}00638                     \mbox{\hyperlink{if__ngereg_8h_a76cf84764e0c48e78af63c526c5cdd38}{NGE\_ADDR\_HI}}(sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_aca7b49c4d17ad5be83cbd9f6dcf9616a}{nge\_tx\_ring\_paddr}}));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00639}00639                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a67c004d61b464b8b92f41b6efef771d9}{NGE\_TX\_LISTPTR\_LO}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00640}00640                     \mbox{\hyperlink{if__ngereg_8h_a11c2f0eb778450088fe042ea7ddc75d6}{NGE\_ADDR\_LO}}(sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_aca7b49c4d17ad5be83cbd9f6dcf9616a}{nge\_tx\_ring\_paddr}}));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00641}00641                 \textcolor{comment}{/* Reinitialize Tx buffers. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00642}00642                 \mbox{\hyperlink{if__nge_8c_ab387b6fe058d481d4c54f5200bef2abc}{nge\_list\_tx\_init}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00643}00643 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00644}00644                 \textcolor{comment}{/* Restart Rx MAC. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00645}00645                 reg = \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a8530e5d23599fe33a65b74ad6021a800}{NGE\_CSR}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00646}00646                 reg |= \mbox{\hyperlink{if__ngereg_8h_a04be078304033bcc5fa709d4a8f0ee2a}{NGE\_CSR\_RX\_ENABLE}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00647}00647                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a8530e5d23599fe33a65b74ad6021a800}{NGE\_CSR}}, reg);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00648}00648                 \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__ngereg_8h_a9a8df12a892089b46b1b27ca0c538f00}{NGE\_TIMEOUT}}; i++) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00649}00649                         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a8530e5d23599fe33a65b74ad6021a800}{NGE\_CSR}}) \& \mbox{\hyperlink{if__ngereg_8h_a04be078304033bcc5fa709d4a8f0ee2a}{NGE\_CSR\_RX\_ENABLE}}) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00650}00650                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00651}00651                         DELAY(1);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00652}00652                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00653}00653                 \textcolor{keywordflow}{if} (i == \mbox{\hyperlink{if__ngereg_8h_a9a8df12a892089b46b1b27ca0c538f00}{NGE\_TIMEOUT}})}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00654}00654                         device\_printf(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00655}00655                             \textcolor{stringliteral}{"{}\%s: unable to restart Rx MAC\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00656}00656         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00657}00657 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00658}00658         \textcolor{comment}{/* Data LED off for TBI mode */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00659}00659         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structnge__softc_ac84c514781515c9c5e2b88fc019e0265}{nge\_flags}} \& \mbox{\hyperlink{if__ngereg_8h_af0d3f50db685ea99ffd9abc9ec0b732c}{NGE\_FLAG\_TBI}}) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00660}00660                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a6ba1dafa838f31dd928f00b7378d3fd5}{NGE\_GPIO}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00661}00661                     \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a6ba1dafa838f31dd928f00b7378d3fd5}{NGE\_GPIO}}) \& \string~\mbox{\hyperlink{if__ngereg_8h_a1818b994ac9bc97a6720931f4fd320dc}{NGE\_GPIO\_GP3\_OUT}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00662}00662 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00663}00663 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00664}00664 \textcolor{keyword}{static} u\_int}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00665}\mbox{\hyperlink{if__nge_8c_afefd54b5db283ec9b4984e4cc22965cd}{00665}} \mbox{\hyperlink{if__nge_8c_afefd54b5db283ec9b4984e4cc22965cd}{nge\_write\_maddr}}(\textcolor{keywordtype}{void} *arg, \textcolor{keyword}{struct} sockaddr\_dl *sdl, u\_int cnt)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00666}00666 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00667}00667         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc = arg;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00668}00668         uint32\_t h;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00669}00669         \textcolor{keywordtype}{int} bit, index;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00670}00670 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00671}00671         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00672}00672 \textcolor{comment}{         * From the 11 bits returned by the crc routine, the top 7}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00673}00673 \textcolor{comment}{         * bits represent the 16-\/bit word in the mcast hash table}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00674}00674 \textcolor{comment}{         * that needs to be updated, and the lower 4 bits represent}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00675}00675 \textcolor{comment}{         * which bit within that byte needs to be set.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00676}00676 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00677}00677         h = ether\_crc32\_be(LLADDR(sdl), ETHER\_ADDR\_LEN) >> 21;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00678}00678         index = (h >> 4) \& 0x7F;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00679}00679         bit = h \& 0xF;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00680}00680         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a73cd220d86eb40f5b5cd1207566773ca}{NGE\_RXFILT\_CTL}}, \mbox{\hyperlink{if__ngereg_8h_ae150d57ec1a46169b64df0f9747bd884}{NGE\_FILTADDR\_MCAST\_LO}} + (index * 2));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00681}00681         \mbox{\hyperlink{if__nge_8c_afcd425eed4d24b2afd9cda6a89330638}{NGE\_SETBIT}}(sc, \mbox{\hyperlink{if__ngereg_8h_a2ea72629c303ee542882806965bcfbb3}{NGE\_RXFILT\_DATA}}, (1 << bit));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00682}00682 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00683}00683         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00684}00684 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00685}00685 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00686}00686 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00687}\mbox{\hyperlink{if__nge_8c_a04894fa150ac70b234baaaef57930c47}{00687}} \mbox{\hyperlink{if__nge_8c_a04894fa150ac70b234baaaef57930c47}{nge\_rxfilter}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00688}00688 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00689}00689         \textcolor{keyword}{struct }ifnet *ifp;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00690}00690         uint32\_t i, rxfilt;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00691}00691 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00692}00692         \mbox{\hyperlink{if__ngereg_8h_aef7ce8bc258716f95755fd594bb3436e}{NGE\_LOCK\_ASSERT}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00693}00693         ifp = sc-\/>\mbox{\hyperlink{structnge__softc_ae1ee58f588347b47a3e046b13f030118}{nge\_ifp}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00694}00694 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00695}00695         \textcolor{comment}{/* Make sure to stop Rx filtering. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00696}00696         rxfilt = \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a73cd220d86eb40f5b5cd1207566773ca}{NGE\_RXFILT\_CTL}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00697}00697         rxfilt \&= \string~NGE\_RXFILTCTL\_ENABLE;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00698}00698         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a73cd220d86eb40f5b5cd1207566773ca}{NGE\_RXFILT\_CTL}}, rxfilt);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00699}00699         \mbox{\hyperlink{if__ngereg_8h_a8d0df18248ed8e804a14eecc559d53bc}{CSR\_BARRIER\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a73cd220d86eb40f5b5cd1207566773ca}{NGE\_RXFILT\_CTL}}, BUS\_SPACE\_BARRIER\_WRITE);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00700}00700 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00701}00701         rxfilt \&= \string~(\mbox{\hyperlink{if__ngereg_8h_a28929de869488649de58911f9962f522}{NGE\_RXFILTCTL\_ALLMULTI}} | \mbox{\hyperlink{if__ngereg_8h_a76358ef4dfff195fc16757d5c7c84068}{NGE\_RXFILTCTL\_ALLPHYS}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00702}00702         rxfilt \&= \string~NGE\_RXFILTCTL\_BROAD;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00703}00703         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00704}00704 \textcolor{comment}{         * We don't want to use the hash table for matching unicast}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00705}00705 \textcolor{comment}{         * addresses.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00706}00706 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00707}00707         rxfilt \&= \string~(\mbox{\hyperlink{if__ngereg_8h_ae72340ac93aa835f7e031ddbbe67779a}{NGE\_RXFILTCTL\_MCHASH}} | \mbox{\hyperlink{if__ngereg_8h_aa3e88c0b933915fa165235881f540e2d}{NGE\_RXFILTCTL\_UCHASH}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00708}00708 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00709}00709         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00710}00710 \textcolor{comment}{         * For the NatSemi chip, we have to explicitly enable the}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00711}00711 \textcolor{comment}{         * reception of ARP frames, as well as turn on the 'perfect}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00712}00712 \textcolor{comment}{         * match' filter where we store the station address, otherwise}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00713}00713 \textcolor{comment}{         * we won't receive unicasts meant for this host.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00714}00714 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00715}00715         rxfilt |= \mbox{\hyperlink{if__ngereg_8h_ab774b944b6fd7020c098812308316274}{NGE\_RXFILTCTL\_ARP}} | \mbox{\hyperlink{if__ngereg_8h_a1ff731c7cf97a7739286e7cf4992b29b}{NGE\_RXFILTCTL\_PERFECT}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00716}00716 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00717}00717         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00718}00718 \textcolor{comment}{         * Set the capture broadcast bit to capture broadcast frames.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00719}00719 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00720}00720         \textcolor{keywordflow}{if} ((ifp-\/>if\_flags \& IFF\_BROADCAST) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00721}00721                 rxfilt |= \mbox{\hyperlink{if__ngereg_8h_a104b4b1f23dc9988c935a307deccf2ae}{NGE\_RXFILTCTL\_BROAD}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00722}00722 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00723}00723         \textcolor{keywordflow}{if} ((ifp-\/>if\_flags \& IFF\_PROMISC) != 0 ||}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00724}00724             (ifp-\/>if\_flags \& IFF\_ALLMULTI) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00725}00725                 rxfilt |= \mbox{\hyperlink{if__ngereg_8h_a28929de869488649de58911f9962f522}{NGE\_RXFILTCTL\_ALLMULTI}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00726}00726                 \textcolor{keywordflow}{if} ((ifp-\/>if\_flags \& IFF\_PROMISC) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00727}00727                         rxfilt |= \mbox{\hyperlink{if__ngereg_8h_a76358ef4dfff195fc16757d5c7c84068}{NGE\_RXFILTCTL\_ALLPHYS}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00728}00728                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00729}00729         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00730}00730 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00731}00731         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00732}00732 \textcolor{comment}{         * We have to explicitly enable the multicast hash table}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00733}00733 \textcolor{comment}{         * on the NatSemi chip if we want to use it, which we do.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00734}00734 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00735}00735         rxfilt |= \mbox{\hyperlink{if__ngereg_8h_ae72340ac93aa835f7e031ddbbe67779a}{NGE\_RXFILTCTL\_MCHASH}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00736}00736 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00737}00737         \textcolor{comment}{/* first, zot all the existing hash bits */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00738}00738         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__ngereg_8h_ab64e7303e0e5bd1fca01d15bc780aaaa}{NGE\_MCAST\_FILTER\_LEN}}; i += 2) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00739}00739                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a73cd220d86eb40f5b5cd1207566773ca}{NGE\_RXFILT\_CTL}}, \mbox{\hyperlink{if__ngereg_8h_ae150d57ec1a46169b64df0f9747bd884}{NGE\_FILTADDR\_MCAST\_LO}} + i);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00740}00740                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a2ea72629c303ee542882806965bcfbb3}{NGE\_RXFILT\_DATA}}, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00741}00741         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00742}00742 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00743}00743         if\_foreach\_llmaddr(ifp, \mbox{\hyperlink{if__nge_8c_afefd54b5db283ec9b4984e4cc22965cd}{nge\_write\_maddr}}, sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00744}00744 done:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00745}00745         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a73cd220d86eb40f5b5cd1207566773ca}{NGE\_RXFILT\_CTL}}, rxfilt);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00746}00746         \textcolor{comment}{/* Turn the receive filter on. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00747}00747         rxfilt |= \mbox{\hyperlink{if__ngereg_8h_afa9abe07ee7999d6c75360c9768b2f3c}{NGE\_RXFILTCTL\_ENABLE}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00748}00748         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a73cd220d86eb40f5b5cd1207566773ca}{NGE\_RXFILT\_CTL}}, rxfilt);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00749}00749         \mbox{\hyperlink{if__ngereg_8h_a8d0df18248ed8e804a14eecc559d53bc}{CSR\_BARRIER\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a73cd220d86eb40f5b5cd1207566773ca}{NGE\_RXFILT\_CTL}}, BUS\_SPACE\_BARRIER\_WRITE);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00750}00750 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00751}00751 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00752}00752 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00753}\mbox{\hyperlink{if__nge_8c_a3f9235356d0ca17f235a12160244e2cf}{00753}} \mbox{\hyperlink{if__nge_8c_a3f9235356d0ca17f235a12160244e2cf}{nge\_reset}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00754}00754 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00755}00755         uint32\_t v;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00756}00756         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00757}00757 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00758}00758         \mbox{\hyperlink{if__nge_8c_afcd425eed4d24b2afd9cda6a89330638}{NGE\_SETBIT}}(sc, \mbox{\hyperlink{if__ngereg_8h_a8530e5d23599fe33a65b74ad6021a800}{NGE\_CSR}}, \mbox{\hyperlink{if__ngereg_8h_a8e776d4b382e56b64f7c244b92332c20}{NGE\_CSR\_RESET}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00759}00759 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00760}00760         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__ngereg_8h_a9a8df12a892089b46b1b27ca0c538f00}{NGE\_TIMEOUT}}; i++) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00761}00761                 \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a8530e5d23599fe33a65b74ad6021a800}{NGE\_CSR}}) \& \mbox{\hyperlink{if__ngereg_8h_a8e776d4b382e56b64f7c244b92332c20}{NGE\_CSR\_RESET}}))}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00762}00762                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00763}00763                 DELAY(1);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00764}00764         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00765}00765 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00766}00766         \textcolor{keywordflow}{if} (i == \mbox{\hyperlink{if__ngereg_8h_a9a8df12a892089b46b1b27ca0c538f00}{NGE\_TIMEOUT}})}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00767}00767                 device\_printf(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}}, \textcolor{stringliteral}{"{}reset never completed\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00768}00768 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00769}00769         \textcolor{comment}{/* Wait a little while for the chip to get its brains in order. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00770}00770         DELAY(1000);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00771}00771 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00772}00772         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00773}00773 \textcolor{comment}{         * If this is a NetSemi chip, make sure to clear}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00774}00774 \textcolor{comment}{         * PME mode.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00775}00775 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00776}00776         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_aa882f6d9448acf4052fbe174d7b90350}{NGE\_CLKRUN}}, \mbox{\hyperlink{if__ngereg_8h_a5fc392881c73416987a30e3aeaf91f90}{NGE\_CLKRUN\_PMESTS}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00777}00777         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_aa882f6d9448acf4052fbe174d7b90350}{NGE\_CLKRUN}}, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00778}00778 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00779}00779         \textcolor{comment}{/* Clear WOL events which may interfere normal Rx filter opertaion. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00780}00780         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_ac1b3d84befe746c788786899ec788c4a}{NGE\_WOLCSR}}, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00781}00781 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00782}00782         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00783}00783 \textcolor{comment}{         * Only DP83820 supports 64bits addressing/data transfers and}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00784}00784 \textcolor{comment}{         * 64bit addressing requires different descriptor structures.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00785}00785 \textcolor{comment}{         * To make it simple, disable 64bit addressing/data transfers.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00786}00786 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00787}00787         v = \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a380ea42fdd5fb3f8186c9fe7a2f410e5}{NGE\_CFG}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00788}00788         v \&= \string~(\mbox{\hyperlink{if__ngereg_8h_aefd8dcb3a453274e10989a0a70360e51}{NGE\_CFG\_64BIT\_ADDR\_ENB}} | \mbox{\hyperlink{if__ngereg_8h_ae9a159616f7828c96cad99985a584460}{NGE\_CFG\_64BIT\_DATA\_ENB}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00789}00789         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a380ea42fdd5fb3f8186c9fe7a2f410e5}{NGE\_CFG}}, v);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00790}00790 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00791}00791 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00792}00792 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00793}00793 \textcolor{comment}{ * Probe for a NatSemi chip. Check the PCI vendor and device}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00794}00794 \textcolor{comment}{ * IDs against our list and return a device name if we find a match.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00795}00795 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00796}00796 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00797}\mbox{\hyperlink{if__nge_8c_a7f30987d57cffcfa9a496bc90b390084}{00797}} \mbox{\hyperlink{if__nge_8c_a7f30987d57cffcfa9a496bc90b390084}{nge\_probe}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00798}00798 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00799}00799         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__type}{nge\_type}} *t;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00800}00800 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00801}00801         t = \mbox{\hyperlink{if__nge_8c_a6adcd63a8a8fc27e15618b6df144b17d}{nge\_devs}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00802}00802 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00803}00803         \textcolor{keywordflow}{while} (t-\/>\mbox{\hyperlink{structnge__type_aa38ab348ecbec44623295338f701990d}{nge\_name}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00804}00804                 \textcolor{keywordflow}{if} ((pci\_get\_vendor(dev) == t-\/>\mbox{\hyperlink{structnge__type_ac0345879d12cbee666518ff7f7a62b2a}{nge\_vid}}) \&\&}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00805}00805                     (pci\_get\_device(dev) == t-\/>\mbox{\hyperlink{structnge__type_a91b6bbea3a84c7b9e3fb5300fc34505f}{nge\_did}})) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00806}00806                         device\_set\_desc(dev, t-\/>\mbox{\hyperlink{structnge__type_aa38ab348ecbec44623295338f701990d}{nge\_name}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00807}00807                         \textcolor{keywordflow}{return} (BUS\_PROBE\_DEFAULT);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00808}00808                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00809}00809                 t++;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00810}00810         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00811}00811 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00812}00812         \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00813}00813 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00814}00814 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00815}00815 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00816}00816 \textcolor{comment}{ * Attach the interface. Allocate softc structures, do ifmedia}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00817}00817 \textcolor{comment}{ * setup and ethernet/BPF attach.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00818}00818 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00819}00819 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00820}\mbox{\hyperlink{if__nge_8c_a12c3d13253e03ebf8b8a766aafe507bf}{00820}} \mbox{\hyperlink{if__nge_8c_a12c3d13253e03ebf8b8a766aafe507bf}{nge\_attach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00821}00821 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00822}00822         uint8\_t eaddr[ETHER\_ADDR\_LEN];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00823}00823         uint16\_t ea[ETHER\_ADDR\_LEN/2], ea\_temp, reg;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00824}00824         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00825}00825         \textcolor{keyword}{struct }ifnet *ifp;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00826}00826         \textcolor{keywordtype}{int} error, i, rid;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00827}00827 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00828}00828         error = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00829}00829         sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00830}00830         sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}} = dev;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00831}00831 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00832}00832         \mbox{\hyperlink{if__ngereg_8h_ac0e3fd3746933d4dd113bd944ae7187b}{NGE\_LOCK\_INIT}}(sc, device\_get\_nameunit(dev));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00833}00833         callout\_init\_mtx(\&sc-\/>\mbox{\hyperlink{structnge__softc_abd2b1bd8b840edd031917b2f3da8243e}{nge\_stat\_ch}}, \&sc-\/>\mbox{\hyperlink{structnge__softc_ac3e41d9d815f5cc96ac45608932b9424}{nge\_mtx}}, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00834}00834 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00835}00835         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00836}00836 \textcolor{comment}{         * Map control/status registers.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00837}00837 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00838}00838         pci\_enable\_busmaster(dev);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00839}00839 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00840}00840 \textcolor{preprocessor}{\#ifdef NGE\_USEIOSPACE}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00841}00841         sc-\/>\mbox{\hyperlink{structnge__softc_aaf106f1e616607101d1dd0a1f424e817}{nge\_res\_type}} = SYS\_RES\_IOPORT;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00842}00842         sc-\/>\mbox{\hyperlink{structnge__softc_a2f0719b3b31e5bf78d043a28de7df9bf}{nge\_res\_id}} = PCIR\_BAR(0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00843}00843 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00844}00844         sc-\/>\mbox{\hyperlink{structnge__softc_aaf106f1e616607101d1dd0a1f424e817}{nge\_res\_type}} = SYS\_RES\_MEMORY;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00845}00845         sc-\/>\mbox{\hyperlink{structnge__softc_a2f0719b3b31e5bf78d043a28de7df9bf}{nge\_res\_id}} = PCIR\_BAR(1);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00846}00846 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00847}00847         sc-\/>\mbox{\hyperlink{structnge__softc_a338a43e090d7737ee5cb85c69f135e80}{nge\_res}} = bus\_alloc\_resource\_any(dev, sc-\/>\mbox{\hyperlink{structnge__softc_aaf106f1e616607101d1dd0a1f424e817}{nge\_res\_type}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00848}00848             \&sc-\/>\mbox{\hyperlink{structnge__softc_a2f0719b3b31e5bf78d043a28de7df9bf}{nge\_res\_id}}, RF\_ACTIVE);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00849}00849 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00850}00850         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a338a43e090d7737ee5cb85c69f135e80}{nge\_res}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00851}00851                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_aaf106f1e616607101d1dd0a1f424e817}{nge\_res\_type}} == SYS\_RES\_MEMORY) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00852}00852                         sc-\/>\mbox{\hyperlink{structnge__softc_aaf106f1e616607101d1dd0a1f424e817}{nge\_res\_type}} = SYS\_RES\_IOPORT;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00853}00853                         sc-\/>\mbox{\hyperlink{structnge__softc_a2f0719b3b31e5bf78d043a28de7df9bf}{nge\_res\_id}} = PCIR\_BAR(0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00854}00854                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00855}00855                         sc-\/>\mbox{\hyperlink{structnge__softc_aaf106f1e616607101d1dd0a1f424e817}{nge\_res\_type}} = SYS\_RES\_MEMORY;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00856}00856                         sc-\/>\mbox{\hyperlink{structnge__softc_a2f0719b3b31e5bf78d043a28de7df9bf}{nge\_res\_id}} = PCIR\_BAR(1);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00857}00857                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00858}00858                 sc-\/>\mbox{\hyperlink{structnge__softc_a338a43e090d7737ee5cb85c69f135e80}{nge\_res}} = bus\_alloc\_resource\_any(dev, sc-\/>\mbox{\hyperlink{structnge__softc_aaf106f1e616607101d1dd0a1f424e817}{nge\_res\_type}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00859}00859                     \&sc-\/>\mbox{\hyperlink{structnge__softc_a2f0719b3b31e5bf78d043a28de7df9bf}{nge\_res\_id}}, RF\_ACTIVE);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00860}00860                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a338a43e090d7737ee5cb85c69f135e80}{nge\_res}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00861}00861                         device\_printf(dev, \textcolor{stringliteral}{"{}couldn't allocate \%s resources\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00862}00862                             sc-\/>\mbox{\hyperlink{structnge__softc_aaf106f1e616607101d1dd0a1f424e817}{nge\_res\_type}} == SYS\_RES\_MEMORY ? \textcolor{stringliteral}{"{}memory"{}} :}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00863}00863                             \textcolor{stringliteral}{"{}I/O"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00864}00864                         \mbox{\hyperlink{if__ngereg_8h_a7dc8f588df3a0c4198605947a4055ace}{NGE\_LOCK\_DESTROY}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00865}00865                         \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00866}00866                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00867}00867         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00868}00868 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00869}00869         \textcolor{comment}{/* Allocate interrupt */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00870}00870         rid = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00871}00871         sc-\/>\mbox{\hyperlink{structnge__softc_a0dd426e8a705a7364e24f20dc416d4b9}{nge\_irq}} = bus\_alloc\_resource\_any(dev, SYS\_RES\_IRQ, \&rid,}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00872}00872             RF\_SHAREABLE | RF\_ACTIVE);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00873}00873 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00874}00874         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a0dd426e8a705a7364e24f20dc416d4b9}{nge\_irq}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00875}00875                 device\_printf(dev, \textcolor{stringliteral}{"{}couldn't map interrupt\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00876}00876                 error = ENXIO;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00877}00877                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00878}00878         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00879}00879 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00880}00880         \textcolor{comment}{/* Enable MWI. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00881}00881         reg = pci\_read\_config(dev, PCIR\_COMMAND, 2);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00882}00882         reg |= PCIM\_CMD\_MWRICEN;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00883}00883         pci\_write\_config(dev, PCIR\_COMMAND, reg, 2);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00884}00884 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00885}00885         \textcolor{comment}{/* Reset the adapter. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00886}00886         \mbox{\hyperlink{if__nge_8c_a3f9235356d0ca17f235a12160244e2cf}{nge\_reset}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00887}00887 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00888}00888         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00889}00889 \textcolor{comment}{         * Get station address from the EEPROM.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00890}00890 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00891}00891         \mbox{\hyperlink{if__nge_8c_a86d406ed91950605fb43896b918829b9}{nge\_read\_eeprom}}(sc, (caddr\_t)ea, \mbox{\hyperlink{if__ngereg_8h_a7798d65f34b902d01964d7e584b296f7}{NGE\_EE\_NODEADDR}}, 3);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00892}00892         \textcolor{keywordflow}{for} (i = 0; i < ETHER\_ADDR\_LEN / 2; i++)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00893}00893                 ea[i] = le16toh(ea[i]);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00894}00894         ea\_temp = ea[0];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00895}00895         ea[0] = ea[2];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00896}00896         ea[2] = ea\_temp;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00897}00897         bcopy(ea, eaddr, \textcolor{keyword}{sizeof}(eaddr));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00898}00898 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00899}00899         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__nge_8c_a97788d813aabe6e2d3b4018f742d1e49}{nge\_dma\_alloc}}(sc) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00900}00900                 error = ENXIO;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00901}00901                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00902}00902         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00903}00903 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00904}00904         \mbox{\hyperlink{if__nge_8c_a02024fcb047d38c99dc8308f988078ad}{nge\_sysctl\_node}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00905}00905 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00906}00906         ifp = sc-\/>\mbox{\hyperlink{structnge__softc_ae1ee58f588347b47a3e046b13f030118}{nge\_ifp}} = if\_alloc(IFT\_ETHER);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00907}00907         \textcolor{keywordflow}{if} (ifp == NULL) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00908}00908                 device\_printf(dev, \textcolor{stringliteral}{"{}can not allocate ifnet structure\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00909}00909                 error = ENOSPC;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00910}00910                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00911}00911         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00912}00912         ifp-\/>if\_softc = sc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00913}00913         if\_initname(ifp, device\_get\_name(dev), device\_get\_unit(dev));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00914}00914         ifp-\/>if\_flags = IFF\_BROADCAST | IFF\_SIMPLEX | IFF\_MULTICAST;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00915}00915         ifp-\/>if\_ioctl = \mbox{\hyperlink{if__nge_8c_a6bd790902a685f581517fb7998d13a6f}{nge\_ioctl}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00916}00916         ifp-\/>if\_start = \mbox{\hyperlink{if__nge_8c_a58ca32a784c2a1aa0bce3c94337c1a32}{nge\_start}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00917}00917         ifp-\/>if\_init = \mbox{\hyperlink{if__nge_8c_a4ea95c1fa3aa6d1651aed6334ce2992e}{nge\_init}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00918}00918         ifp-\/>if\_snd.ifq\_drv\_maxlen = \mbox{\hyperlink{if__ngereg_8h_a2c640f4df126d566325ac35549986d2d}{NGE\_TX\_RING\_CNT}} -\/ 1;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00919}00919         IFQ\_SET\_MAXLEN(\&ifp-\/>if\_snd, ifp-\/>if\_snd.ifq\_drv\_maxlen);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00920}00920         IFQ\_SET\_READY(\&ifp-\/>if\_snd);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00921}00921         ifp-\/>if\_hwassist = \mbox{\hyperlink{if__nge_8c_acb062d853343d9f1617f1fdbb74f2a04}{NGE\_CSUM\_FEATURES}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00922}00922         ifp-\/>if\_capabilities = IFCAP\_HWCSUM;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00923}00923         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00924}00924 \textcolor{comment}{         * It seems that some hardwares doesn't provide 3.3V auxiliary}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00925}00925 \textcolor{comment}{         * supply(3VAUX) to drive PME such that checking PCI power}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00926}00926 \textcolor{comment}{         * management capability is necessary.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00927}00927 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00928}00928         \textcolor{keywordflow}{if} (pci\_find\_cap(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}}, PCIY\_PMG, \&i) == 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00929}00929                 ifp-\/>if\_capabilities |= IFCAP\_WOL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00930}00930         ifp-\/>if\_capenable = ifp-\/>if\_capabilities;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00931}00931 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00932}00932         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a380ea42fdd5fb3f8186c9fe7a2f410e5}{NGE\_CFG}}) \& \mbox{\hyperlink{if__ngereg_8h_a4f88ed8622277b11bc3d1a5280b98d8c}{NGE\_CFG\_TBI\_EN}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00933}00933                 sc-\/>\mbox{\hyperlink{structnge__softc_ac84c514781515c9c5e2b88fc019e0265}{nge\_flags}} |= \mbox{\hyperlink{if__ngereg_8h_af0d3f50db685ea99ffd9abc9ec0b732c}{NGE\_FLAG\_TBI}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00934}00934                 device\_printf(dev, \textcolor{stringliteral}{"{}Using TBI\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00935}00935                 \textcolor{comment}{/* Configure GPIO. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00936}00936                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a6ba1dafa838f31dd928f00b7378d3fd5}{NGE\_GPIO}}, \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a6ba1dafa838f31dd928f00b7378d3fd5}{NGE\_GPIO}})}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00937}00937                     | \mbox{\hyperlink{if__ngereg_8h_af2e51c6e8c43ff4ac637e4de3f2b583f}{NGE\_GPIO\_GP4\_OUT}}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00938}00938                     | \mbox{\hyperlink{if__ngereg_8h_a3b979e6e5e1d13f5f6aa8aac02eaa039}{NGE\_GPIO\_GP1\_OUTENB}} | \mbox{\hyperlink{if__ngereg_8h_a650f7159cdaae916d9a611a22e3f225a}{NGE\_GPIO\_GP2\_OUTENB}}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00939}00939                     | \mbox{\hyperlink{if__ngereg_8h_a8bff8d82ed257123d4a1919cdbe30996}{NGE\_GPIO\_GP3\_OUTENB}}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00940}00940                     | \mbox{\hyperlink{if__ngereg_8h_ad9927ee128f554f654af50c424d6e131}{NGE\_GPIO\_GP3\_IN}} | \mbox{\hyperlink{if__ngereg_8h_a511766689f26224216adb56858b4ba63}{NGE\_GPIO\_GP4\_IN}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00941}00941         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00942}00942 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00943}00943         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00944}00944 \textcolor{comment}{         * Do MII setup.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00945}00945 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00946}00946         error = mii\_attach(dev, \&sc-\/>\mbox{\hyperlink{structnge__softc_a0c48586b5276b5d260cf1d0f606eef32}{nge\_miibus}}, ifp, \mbox{\hyperlink{if__nge_8c_a8ad2990142595a47f4c54ba6b5b09550}{nge\_mediachange}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00947}00947             \mbox{\hyperlink{if__nge_8c_acbf31a34c95e5695e3548513ce7c058a}{nge\_mediastatus}}, BMSR\_DEFCAPMASK, MII\_PHY\_ANY, MII\_OFFSET\_ANY, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00948}00948         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00949}00949                 device\_printf(dev, \textcolor{stringliteral}{"{}attaching PHYs failed\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00950}00950                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00951}00951         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00952}00952 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00953}00953         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00954}00954 \textcolor{comment}{         * Call MI attach routine.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00955}00955 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00956}00956         ether\_ifattach(ifp, eaddr);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00957}00957 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00958}00958         \textcolor{comment}{/* VLAN capability setup. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00959}00959         ifp-\/>if\_capabilities |= IFCAP\_VLAN\_MTU | IFCAP\_VLAN\_HWTAGGING;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00960}00960         ifp-\/>if\_capabilities |= IFCAP\_VLAN\_HWCSUM;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00961}00961         ifp-\/>if\_capenable = ifp-\/>if\_capabilities;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00962}00962 \textcolor{preprocessor}{\#ifdef DEVICE\_POLLING}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00963}00963         ifp-\/>if\_capabilities |= IFCAP\_POLLING;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00964}00964 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00965}00965         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00966}00966 \textcolor{comment}{         * Tell the upper layer(s) we support long frames.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00967}00967 \textcolor{comment}{         * Must appear after the call to ether\_ifattach() because}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00968}00968 \textcolor{comment}{         * ether\_ifattach() sets ifi\_hdrlen to the default value.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00969}00969 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00970}00970         ifp-\/>if\_hdrlen = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }ether\_vlan\_header);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00971}00971 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00972}00972         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00973}00973 \textcolor{comment}{         * Hookup IRQ last.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00974}00974 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00975}00975         error = bus\_setup\_intr(dev, sc-\/>\mbox{\hyperlink{structnge__softc_a0dd426e8a705a7364e24f20dc416d4b9}{nge\_irq}}, INTR\_TYPE\_NET | INTR\_MPSAFE,}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00976}00976             NULL, \mbox{\hyperlink{if__nge_8c_ab76e53be9cb000caa8ecf984ccceeb6a}{nge\_intr}}, sc, \&sc-\/>\mbox{\hyperlink{structnge__softc_a3432a50099a4f43cb87da50420884dca}{nge\_intrhand}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00977}00977         \textcolor{keywordflow}{if} (error) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00978}00978                 device\_printf(dev, \textcolor{stringliteral}{"{}couldn't set up irq\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00979}00979                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00980}00980         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00981}00981 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00982}00982 fail:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00983}00983         \textcolor{keywordflow}{if} (error != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00984}00984                 \mbox{\hyperlink{if__nge_8c_a5d5e754934604ce7f98909dba8661ca0}{nge\_detach}}(dev);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00985}00985         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00986}00986 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00987}00987 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00988}00988 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00989}\mbox{\hyperlink{if__nge_8c_a5d5e754934604ce7f98909dba8661ca0}{00989}} \mbox{\hyperlink{if__nge_8c_a5d5e754934604ce7f98909dba8661ca0}{nge\_detach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00990}00990 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00991}00991         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00992}00992         \textcolor{keyword}{struct }ifnet *ifp;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00993}00993 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00994}00994         sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00995}00995         ifp = sc-\/>\mbox{\hyperlink{structnge__softc_ae1ee58f588347b47a3e046b13f030118}{nge\_ifp}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00996}00996 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00997}00997 \textcolor{preprocessor}{\#ifdef DEVICE\_POLLING}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00998}00998         \textcolor{keywordflow}{if} (ifp != NULL \&\& ifp-\/>if\_capenable \& IFCAP\_POLLING)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l00999}00999                 ether\_poll\_deregister(ifp);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01000}01000 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01001}01001 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01002}01002         \textcolor{keywordflow}{if} (device\_is\_attached(dev)) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01003}01003                 \mbox{\hyperlink{if__ngereg_8h_ab99f47bf2cd630291194ae818035d11e}{NGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01004}01004                 sc-\/>\mbox{\hyperlink{structnge__softc_ac84c514781515c9c5e2b88fc019e0265}{nge\_flags}} |= \mbox{\hyperlink{if__ngereg_8h_a3cdfb8427d9e84d9a93a288c99d8ccf2}{NGE\_FLAG\_DETACH}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01005}01005                 \mbox{\hyperlink{if__nge_8c_a5f1c4f9e585d5f34ebe3b81d687ebb2a}{nge\_stop}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01006}01006                 \mbox{\hyperlink{if__ngereg_8h_a384e888bfa48167ca9e46af78aaba7e7}{NGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01007}01007                 callout\_drain(\&sc-\/>\mbox{\hyperlink{structnge__softc_abd2b1bd8b840edd031917b2f3da8243e}{nge\_stat\_ch}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01008}01008                 \textcolor{keywordflow}{if} (ifp != NULL)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01009}01009                         ether\_ifdetach(ifp);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01010}01010         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01011}01011 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01012}01012         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a0c48586b5276b5d260cf1d0f606eef32}{nge\_miibus}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01013}01013                 device\_delete\_child(dev, sc-\/>\mbox{\hyperlink{structnge__softc_a0c48586b5276b5d260cf1d0f606eef32}{nge\_miibus}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01014}01014                 sc-\/>\mbox{\hyperlink{structnge__softc_a0c48586b5276b5d260cf1d0f606eef32}{nge\_miibus}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01015}01015         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01016}01016         bus\_generic\_detach(dev);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01017}01017         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a3432a50099a4f43cb87da50420884dca}{nge\_intrhand}} != NULL)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01018}01018                 bus\_teardown\_intr(dev, sc-\/>\mbox{\hyperlink{structnge__softc_a0dd426e8a705a7364e24f20dc416d4b9}{nge\_irq}}, sc-\/>\mbox{\hyperlink{structnge__softc_a3432a50099a4f43cb87da50420884dca}{nge\_intrhand}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01019}01019         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a0dd426e8a705a7364e24f20dc416d4b9}{nge\_irq}} != NULL)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01020}01020                 bus\_release\_resource(dev, SYS\_RES\_IRQ, 0, sc-\/>\mbox{\hyperlink{structnge__softc_a0dd426e8a705a7364e24f20dc416d4b9}{nge\_irq}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01021}01021         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a338a43e090d7737ee5cb85c69f135e80}{nge\_res}} != NULL)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01022}01022                 bus\_release\_resource(dev, sc-\/>\mbox{\hyperlink{structnge__softc_aaf106f1e616607101d1dd0a1f424e817}{nge\_res\_type}}, sc-\/>\mbox{\hyperlink{structnge__softc_a2f0719b3b31e5bf78d043a28de7df9bf}{nge\_res\_id}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01023}01023                     sc-\/>\mbox{\hyperlink{structnge__softc_a338a43e090d7737ee5cb85c69f135e80}{nge\_res}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01024}01024 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01025}01025         \mbox{\hyperlink{if__nge_8c_a52daa5366437f42cadedf21fd44439b0}{nge\_dma\_free}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01026}01026         \textcolor{keywordflow}{if} (ifp != NULL)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01027}01027                 if\_free(ifp);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01028}01028 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01029}01029         \mbox{\hyperlink{if__ngereg_8h_a7dc8f588df3a0c4198605947a4055ace}{NGE\_LOCK\_DESTROY}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01030}01030 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01031}01031         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01032}01032 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01033}01033 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01034}\mbox{\hyperlink{structnge__dmamap__arg}{01034}} \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__dmamap__arg}{nge\_dmamap\_arg}} \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01035}\mbox{\hyperlink{structnge__dmamap__arg_a1121b8dc7f966d80997240cbeae88a05}{01035}}         bus\_addr\_t      \mbox{\hyperlink{structnge__dmamap__arg_a1121b8dc7f966d80997240cbeae88a05}{nge\_busaddr}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01036}01036 \};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01037}01037 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01038}01038 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01039}\mbox{\hyperlink{if__nge_8c_a419fcd545f542ed80faed05c17aae5f1}{01039}} \mbox{\hyperlink{if__nge_8c_a419fcd545f542ed80faed05c17aae5f1}{nge\_dmamap\_cb}}(\textcolor{keywordtype}{void} *arg, bus\_dma\_segment\_t *segs, \textcolor{keywordtype}{int} nseg, \textcolor{keywordtype}{int} error)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01040}01040 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01041}01041         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__dmamap__arg}{nge\_dmamap\_arg}} *ctx;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01042}01042 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01043}01043         \textcolor{keywordflow}{if} (error != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01044}01044                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01045}01045         ctx = arg;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01046}01046         ctx-\/>\mbox{\hyperlink{structnge__dmamap__arg_a1121b8dc7f966d80997240cbeae88a05}{nge\_busaddr}} = segs[0].ds\_addr;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01047}01047 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01048}01048 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01049}01049 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01050}\mbox{\hyperlink{if__nge_8c_a97788d813aabe6e2d3b4018f742d1e49}{01050}} \mbox{\hyperlink{if__nge_8c_a97788d813aabe6e2d3b4018f742d1e49}{nge\_dma\_alloc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01051}01051 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01052}01052         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__dmamap__arg}{nge\_dmamap\_arg}} ctx;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01053}01053         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__txdesc}{nge\_txdesc}} *txd;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01054}01054         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__rxdesc}{nge\_rxdesc}} *rxd;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01055}01055         \textcolor{keywordtype}{int} error, i;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01056}01056 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01057}01057         \textcolor{comment}{/* Create parent DMA tag. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01058}01058         error = bus\_dma\_tag\_create(}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01059}01059             bus\_get\_dma\_tag(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}}),        \textcolor{comment}{/* parent */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01060}01060             1, 0,                       \textcolor{comment}{/* alignment, boundary */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01061}01061             BUS\_SPACE\_MAXADDR\_32BIT,    \textcolor{comment}{/* lowaddr */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01062}01062             BUS\_SPACE\_MAXADDR,          \textcolor{comment}{/* highaddr */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01063}01063             NULL, NULL,                 \textcolor{comment}{/* filter, filterarg */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01064}01064             BUS\_SPACE\_MAXSIZE\_32BIT,    \textcolor{comment}{/* maxsize */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01065}01065             0,                          \textcolor{comment}{/* nsegments */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01066}01066             BUS\_SPACE\_MAXSIZE\_32BIT,    \textcolor{comment}{/* maxsegsize */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01067}01067             0,                          \textcolor{comment}{/* flags */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01068}01068             NULL, NULL,                 \textcolor{comment}{/* lockfunc, lockarg */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01069}01069             \&sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_ae9d81a21f6b44316940a6dfba9b11163}{nge\_parent\_tag}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01070}01070         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01071}01071                 device\_printf(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}}, \textcolor{stringliteral}{"{}failed to create parent DMA tag\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01072}01072                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01073}01073         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01074}01074         \textcolor{comment}{/* Create tag for Tx ring. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01075}01075         error = bus\_dma\_tag\_create(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_ae9d81a21f6b44316940a6dfba9b11163}{nge\_parent\_tag}},\textcolor{comment}{/* parent */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01076}01076             \mbox{\hyperlink{if__ngereg_8h_afa63e0df1dbdc845534c0463da714d06}{NGE\_RING\_ALIGN}}, 0,            \textcolor{comment}{/* alignment, boundary */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01077}01077             BUS\_SPACE\_MAXADDR,          \textcolor{comment}{/* lowaddr */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01078}01078             BUS\_SPACE\_MAXADDR,          \textcolor{comment}{/* highaddr */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01079}01079             NULL, NULL,                 \textcolor{comment}{/* filter, filterarg */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01080}01080             \mbox{\hyperlink{if__ngereg_8h_a3501f4a0e99b90e211c74700eda046aa}{NGE\_TX\_RING\_SIZE}},           \textcolor{comment}{/* maxsize */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01081}01081             1,                          \textcolor{comment}{/* nsegments */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01082}01082             \mbox{\hyperlink{if__ngereg_8h_a3501f4a0e99b90e211c74700eda046aa}{NGE\_TX\_RING\_SIZE}},           \textcolor{comment}{/* maxsegsize */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01083}01083             0,                          \textcolor{comment}{/* flags */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01084}01084             NULL, NULL,                 \textcolor{comment}{/* lockfunc, lockarg */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01085}01085             \&sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_acf30833820602cf7e1dc430f8cc3b35d}{nge\_tx\_ring\_tag}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01086}01086         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01087}01087                 device\_printf(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}}, \textcolor{stringliteral}{"{}failed to create Tx ring DMA tag\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01088}01088                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01089}01089         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01090}01090 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01091}01091         \textcolor{comment}{/* Create tag for Rx ring. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01092}01092         error = bus\_dma\_tag\_create(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_ae9d81a21f6b44316940a6dfba9b11163}{nge\_parent\_tag}},\textcolor{comment}{/* parent */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01093}01093             \mbox{\hyperlink{if__ngereg_8h_afa63e0df1dbdc845534c0463da714d06}{NGE\_RING\_ALIGN}}, 0,            \textcolor{comment}{/* alignment, boundary */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01094}01094             BUS\_SPACE\_MAXADDR,          \textcolor{comment}{/* lowaddr */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01095}01095             BUS\_SPACE\_MAXADDR,          \textcolor{comment}{/* highaddr */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01096}01096             NULL, NULL,                 \textcolor{comment}{/* filter, filterarg */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01097}01097             \mbox{\hyperlink{if__ngereg_8h_a7607bc303031b4d62cac5f3dab652829}{NGE\_RX\_RING\_SIZE}},           \textcolor{comment}{/* maxsize */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01098}01098             1,                          \textcolor{comment}{/* nsegments */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01099}01099             \mbox{\hyperlink{if__ngereg_8h_a7607bc303031b4d62cac5f3dab652829}{NGE\_RX\_RING\_SIZE}},           \textcolor{comment}{/* maxsegsize */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01100}01100             0,                          \textcolor{comment}{/* flags */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01101}01101             NULL, NULL,                 \textcolor{comment}{/* lockfunc, lockarg */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01102}01102             \&sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a62132b3fe7e7e05ddd6fe0bab137e10f}{nge\_rx\_ring\_tag}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01103}01103         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01104}01104                 device\_printf(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01105}01105                     \textcolor{stringliteral}{"{}failed to create Rx ring DMA tag\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01106}01106                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01107}01107         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01108}01108 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01109}01109         \textcolor{comment}{/* Create tag for Tx buffers. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01110}01110         error = bus\_dma\_tag\_create(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_ae9d81a21f6b44316940a6dfba9b11163}{nge\_parent\_tag}},\textcolor{comment}{/* parent */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01111}01111             1, 0,                       \textcolor{comment}{/* alignment, boundary */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01112}01112             BUS\_SPACE\_MAXADDR,          \textcolor{comment}{/* lowaddr */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01113}01113             BUS\_SPACE\_MAXADDR,          \textcolor{comment}{/* highaddr */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01114}01114             NULL, NULL,                 \textcolor{comment}{/* filter, filterarg */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01115}01115             MCLBYTES * \mbox{\hyperlink{if__ngereg_8h_a62b09b1217c00212a9f12273528d38c2}{NGE\_MAXTXSEGS}},      \textcolor{comment}{/* maxsize */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01116}01116             \mbox{\hyperlink{if__ngereg_8h_a62b09b1217c00212a9f12273528d38c2}{NGE\_MAXTXSEGS}},         \textcolor{comment}{/* nsegments */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01117}01117             MCLBYTES,                   \textcolor{comment}{/* maxsegsize */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01118}01118             0,                          \textcolor{comment}{/* flags */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01119}01119             NULL, NULL,                 \textcolor{comment}{/* lockfunc, lockarg */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01120}01120             \&sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a6fc520951d327aa4be4f35f2dfa3f521}{nge\_tx\_tag}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01121}01121         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01122}01122                 device\_printf(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}}, \textcolor{stringliteral}{"{}failed to create Tx DMA tag\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01123}01123                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01124}01124         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01125}01125 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01126}01126         \textcolor{comment}{/* Create tag for Rx buffers. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01127}01127         error = bus\_dma\_tag\_create(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_ae9d81a21f6b44316940a6dfba9b11163}{nge\_parent\_tag}},\textcolor{comment}{/* parent */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01128}01128             \mbox{\hyperlink{if__ngereg_8h_a037d77fdc180715e76e86075a976e81c}{NGE\_RX\_ALIGN}}, 0,                \textcolor{comment}{/* alignment, boundary */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01129}01129             BUS\_SPACE\_MAXADDR,          \textcolor{comment}{/* lowaddr */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01130}01130             BUS\_SPACE\_MAXADDR,          \textcolor{comment}{/* highaddr */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01131}01131             NULL, NULL,                 \textcolor{comment}{/* filter, filterarg */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01132}01132             MCLBYTES,                   \textcolor{comment}{/* maxsize */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01133}01133             1,                          \textcolor{comment}{/* nsegments */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01134}01134             MCLBYTES,                   \textcolor{comment}{/* maxsegsize */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01135}01135             0,                          \textcolor{comment}{/* flags */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01136}01136             NULL, NULL,                 \textcolor{comment}{/* lockfunc, lockarg */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01137}01137             \&sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a204c4899e279570c9853dd867ea12a0b}{nge\_rx\_tag}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01138}01138         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01139}01139                 device\_printf(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}}, \textcolor{stringliteral}{"{}failed to create Rx DMA tag\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01140}01140                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01141}01141         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01142}01142 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01143}01143         \textcolor{comment}{/* Allocate DMA'able memory and load the DMA map for Tx ring. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01144}01144         error = bus\_dmamem\_alloc(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_acf30833820602cf7e1dc430f8cc3b35d}{nge\_tx\_ring\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01145}01145             (\textcolor{keywordtype}{void} **)\&sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_ad0d36c434e96d681af75191422afad1f}{nge\_tx\_ring}}, BUS\_DMA\_WAITOK |}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01146}01146             BUS\_DMA\_COHERENT | BUS\_DMA\_ZERO, \&sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a2265d4ebec9fc83f9d65b2e5fa524b86}{nge\_tx\_ring\_map}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01147}01147         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01148}01148                 device\_printf(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01149}01149                     \textcolor{stringliteral}{"{}failed to allocate DMA'able memory for Tx ring\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01150}01150                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01151}01151         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01152}01152 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01153}01153         ctx.\mbox{\hyperlink{structnge__dmamap__arg_a1121b8dc7f966d80997240cbeae88a05}{nge\_busaddr}} = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01154}01154         error = bus\_dmamap\_load(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_acf30833820602cf7e1dc430f8cc3b35d}{nge\_tx\_ring\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01155}01155             sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a2265d4ebec9fc83f9d65b2e5fa524b86}{nge\_tx\_ring\_map}}, sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_ad0d36c434e96d681af75191422afad1f}{nge\_tx\_ring}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01156}01156             \mbox{\hyperlink{if__ngereg_8h_a3501f4a0e99b90e211c74700eda046aa}{NGE\_TX\_RING\_SIZE}}, \mbox{\hyperlink{if__nge_8c_a419fcd545f542ed80faed05c17aae5f1}{nge\_dmamap\_cb}}, \&ctx, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01157}01157         \textcolor{keywordflow}{if} (error != 0 || ctx.\mbox{\hyperlink{structnge__dmamap__arg_a1121b8dc7f966d80997240cbeae88a05}{nge\_busaddr}} == 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01158}01158                 device\_printf(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01159}01159                     \textcolor{stringliteral}{"{}failed to load DMA'able memory for Tx ring\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01160}01160                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01161}01161         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01162}01162         sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_aca7b49c4d17ad5be83cbd9f6dcf9616a}{nge\_tx\_ring\_paddr}} = ctx.\mbox{\hyperlink{structnge__dmamap__arg_a1121b8dc7f966d80997240cbeae88a05}{nge\_busaddr}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01163}01163 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01164}01164         \textcolor{comment}{/* Allocate DMA'able memory and load the DMA map for Rx ring. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01165}01165         error = bus\_dmamem\_alloc(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a62132b3fe7e7e05ddd6fe0bab137e10f}{nge\_rx\_ring\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01166}01166             (\textcolor{keywordtype}{void} **)\&sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_a48cc6c82d6e12a847ecd1276a1302325}{nge\_rx\_ring}}, BUS\_DMA\_WAITOK |}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01167}01167             BUS\_DMA\_COHERENT | BUS\_DMA\_ZERO, \&sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a11e64532648aec0ec427c004e1c6be46}{nge\_rx\_ring\_map}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01168}01168         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01169}01169                 device\_printf(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01170}01170                     \textcolor{stringliteral}{"{}failed to allocate DMA'able memory for Rx ring\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01171}01171                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01172}01172         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01173}01173 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01174}01174         ctx.\mbox{\hyperlink{structnge__dmamap__arg_a1121b8dc7f966d80997240cbeae88a05}{nge\_busaddr}} = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01175}01175         error = bus\_dmamap\_load(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a62132b3fe7e7e05ddd6fe0bab137e10f}{nge\_rx\_ring\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01176}01176             sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a11e64532648aec0ec427c004e1c6be46}{nge\_rx\_ring\_map}}, sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_a48cc6c82d6e12a847ecd1276a1302325}{nge\_rx\_ring}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01177}01177             \mbox{\hyperlink{if__ngereg_8h_a7607bc303031b4d62cac5f3dab652829}{NGE\_RX\_RING\_SIZE}}, \mbox{\hyperlink{if__nge_8c_a419fcd545f542ed80faed05c17aae5f1}{nge\_dmamap\_cb}}, \&ctx, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01178}01178         \textcolor{keywordflow}{if} (error != 0 || ctx.\mbox{\hyperlink{structnge__dmamap__arg_a1121b8dc7f966d80997240cbeae88a05}{nge\_busaddr}} == 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01179}01179                 device\_printf(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01180}01180                     \textcolor{stringliteral}{"{}failed to load DMA'able memory for Rx ring\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01181}01181                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01182}01182         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01183}01183         sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_ab414dc2a3256f10bf3100df2dfdb05b5}{nge\_rx\_ring\_paddr}} = ctx.\mbox{\hyperlink{structnge__dmamap__arg_a1121b8dc7f966d80997240cbeae88a05}{nge\_busaddr}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01184}01184 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01185}01185         \textcolor{comment}{/* Create DMA maps for Tx buffers. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01186}01186         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__ngereg_8h_a2c640f4df126d566325ac35549986d2d}{NGE\_TX\_RING\_CNT}}; i++) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01187}01187                 txd = \&sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_ac62d7f895349014f6b56adde934fbb0a}{nge\_txdesc}}[i];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01188}01188                 txd-\/>\mbox{\hyperlink{structnge__txdesc_ac0980a7537bb5a6c403c3d89ec58663b}{tx\_m}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01189}01189                 txd-\/>\mbox{\hyperlink{structnge__txdesc_aa334e70e247f63d45bd94da3e631e79f}{tx\_dmamap}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01190}01190                 error = bus\_dmamap\_create(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a6fc520951d327aa4be4f35f2dfa3f521}{nge\_tx\_tag}}, 0,}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01191}01191                     \&txd-\/>\mbox{\hyperlink{structnge__txdesc_aa334e70e247f63d45bd94da3e631e79f}{tx\_dmamap}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01192}01192                 \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01193}01193                         device\_printf(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01194}01194                             \textcolor{stringliteral}{"{}failed to create Tx dmamap\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01195}01195                         \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01196}01196                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01197}01197         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01198}01198         \textcolor{comment}{/* Create DMA maps for Rx buffers. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01199}01199         \textcolor{keywordflow}{if} ((error = bus\_dmamap\_create(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a204c4899e279570c9853dd867ea12a0b}{nge\_rx\_tag}}, 0,}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01200}01200             \&sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a63f35d2a406829368eb0a7c4a5c80d35}{nge\_rx\_sparemap}})) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01201}01201                 device\_printf(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01202}01202                     \textcolor{stringliteral}{"{}failed to create spare Rx dmamap\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01203}01203                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01204}01204         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01205}01205         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__ngereg_8h_a4d2146cfe1e24ec4c810bf0d1d43bb0a}{NGE\_RX\_RING\_CNT}}; i++) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01206}01206                 rxd = \&sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a8cc2b833224ffdb58e8e160b48bb31f1}{nge\_rxdesc}}[i];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01207}01207                 rxd-\/>\mbox{\hyperlink{structnge__rxdesc_a70001dab71c024cbe4803374c626e40a}{rx\_m}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01208}01208                 rxd-\/>\mbox{\hyperlink{structnge__rxdesc_a1aa2aa43da87a94cb49bb235995f37f5}{rx\_dmamap}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01209}01209                 error = bus\_dmamap\_create(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a204c4899e279570c9853dd867ea12a0b}{nge\_rx\_tag}}, 0,}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01210}01210                     \&rxd-\/>\mbox{\hyperlink{structnge__rxdesc_a1aa2aa43da87a94cb49bb235995f37f5}{rx\_dmamap}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01211}01211                 \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01212}01212                         device\_printf(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01213}01213                             \textcolor{stringliteral}{"{}failed to create Rx dmamap\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01214}01214                         \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01215}01215                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01216}01216         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01217}01217 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01218}01218 fail:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01219}01219         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01220}01220 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01221}01221 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01222}01222 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01223}\mbox{\hyperlink{if__nge_8c_a52daa5366437f42cadedf21fd44439b0}{01223}} \mbox{\hyperlink{if__nge_8c_a52daa5366437f42cadedf21fd44439b0}{nge\_dma\_free}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01224}01224 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01225}01225         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__txdesc}{nge\_txdesc}} *txd;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01226}01226         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__rxdesc}{nge\_rxdesc}} *rxd;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01227}01227         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01228}01228 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01229}01229         \textcolor{comment}{/* Tx ring. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01230}01230         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_acf30833820602cf7e1dc430f8cc3b35d}{nge\_tx\_ring\_tag}}) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01231}01231                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_aca7b49c4d17ad5be83cbd9f6dcf9616a}{nge\_tx\_ring\_paddr}})}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01232}01232                         bus\_dmamap\_unload(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_acf30833820602cf7e1dc430f8cc3b35d}{nge\_tx\_ring\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01233}01233                             sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a2265d4ebec9fc83f9d65b2e5fa524b86}{nge\_tx\_ring\_map}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01234}01234                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_ad0d36c434e96d681af75191422afad1f}{nge\_tx\_ring}})}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01235}01235                         bus\_dmamem\_free(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_acf30833820602cf7e1dc430f8cc3b35d}{nge\_tx\_ring\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01236}01236                             sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_ad0d36c434e96d681af75191422afad1f}{nge\_tx\_ring}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01237}01237                             sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a2265d4ebec9fc83f9d65b2e5fa524b86}{nge\_tx\_ring\_map}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01238}01238                 sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_ad0d36c434e96d681af75191422afad1f}{nge\_tx\_ring}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01239}01239                 sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_aca7b49c4d17ad5be83cbd9f6dcf9616a}{nge\_tx\_ring\_paddr}} = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01240}01240                 bus\_dma\_tag\_destroy(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_acf30833820602cf7e1dc430f8cc3b35d}{nge\_tx\_ring\_tag}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01241}01241                 sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_acf30833820602cf7e1dc430f8cc3b35d}{nge\_tx\_ring\_tag}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01242}01242         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01243}01243         \textcolor{comment}{/* Rx ring. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01244}01244         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a62132b3fe7e7e05ddd6fe0bab137e10f}{nge\_rx\_ring\_tag}}) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01245}01245                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_ab414dc2a3256f10bf3100df2dfdb05b5}{nge\_rx\_ring\_paddr}})}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01246}01246                         bus\_dmamap\_unload(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a62132b3fe7e7e05ddd6fe0bab137e10f}{nge\_rx\_ring\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01247}01247                             sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a11e64532648aec0ec427c004e1c6be46}{nge\_rx\_ring\_map}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01248}01248                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_a48cc6c82d6e12a847ecd1276a1302325}{nge\_rx\_ring}})}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01249}01249                         bus\_dmamem\_free(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a62132b3fe7e7e05ddd6fe0bab137e10f}{nge\_rx\_ring\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01250}01250                             sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_a48cc6c82d6e12a847ecd1276a1302325}{nge\_rx\_ring}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01251}01251                             sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a11e64532648aec0ec427c004e1c6be46}{nge\_rx\_ring\_map}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01252}01252                 sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_a48cc6c82d6e12a847ecd1276a1302325}{nge\_rx\_ring}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01253}01253                 sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_ab414dc2a3256f10bf3100df2dfdb05b5}{nge\_rx\_ring\_paddr}} = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01254}01254                 bus\_dma\_tag\_destroy(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a62132b3fe7e7e05ddd6fe0bab137e10f}{nge\_rx\_ring\_tag}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01255}01255                 sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a62132b3fe7e7e05ddd6fe0bab137e10f}{nge\_rx\_ring\_tag}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01256}01256         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01257}01257         \textcolor{comment}{/* Tx buffers. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01258}01258         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a6fc520951d327aa4be4f35f2dfa3f521}{nge\_tx\_tag}}) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01259}01259                 \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__ngereg_8h_a2c640f4df126d566325ac35549986d2d}{NGE\_TX\_RING\_CNT}}; i++) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01260}01260                         txd = \&sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_ac62d7f895349014f6b56adde934fbb0a}{nge\_txdesc}}[i];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01261}01261                         \textcolor{keywordflow}{if} (txd-\/>\mbox{\hyperlink{structnge__txdesc_aa334e70e247f63d45bd94da3e631e79f}{tx\_dmamap}}) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01262}01262                                 bus\_dmamap\_destroy(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a6fc520951d327aa4be4f35f2dfa3f521}{nge\_tx\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01263}01263                                     txd-\/>\mbox{\hyperlink{structnge__txdesc_aa334e70e247f63d45bd94da3e631e79f}{tx\_dmamap}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01264}01264                                 txd-\/>\mbox{\hyperlink{structnge__txdesc_aa334e70e247f63d45bd94da3e631e79f}{tx\_dmamap}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01265}01265                         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01266}01266                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01267}01267                 bus\_dma\_tag\_destroy(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a6fc520951d327aa4be4f35f2dfa3f521}{nge\_tx\_tag}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01268}01268                 sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a6fc520951d327aa4be4f35f2dfa3f521}{nge\_tx\_tag}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01269}01269         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01270}01270         \textcolor{comment}{/* Rx buffers. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01271}01271         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a204c4899e279570c9853dd867ea12a0b}{nge\_rx\_tag}}) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01272}01272                 \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__ngereg_8h_a4d2146cfe1e24ec4c810bf0d1d43bb0a}{NGE\_RX\_RING\_CNT}}; i++) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01273}01273                         rxd = \&sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a8cc2b833224ffdb58e8e160b48bb31f1}{nge\_rxdesc}}[i];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01274}01274                         \textcolor{keywordflow}{if} (rxd-\/>\mbox{\hyperlink{structnge__rxdesc_a1aa2aa43da87a94cb49bb235995f37f5}{rx\_dmamap}}) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01275}01275                                 bus\_dmamap\_destroy(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a204c4899e279570c9853dd867ea12a0b}{nge\_rx\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01276}01276                                     rxd-\/>\mbox{\hyperlink{structnge__rxdesc_a1aa2aa43da87a94cb49bb235995f37f5}{rx\_dmamap}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01277}01277                                 rxd-\/>\mbox{\hyperlink{structnge__rxdesc_a1aa2aa43da87a94cb49bb235995f37f5}{rx\_dmamap}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01278}01278                         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01279}01279                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01280}01280                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a63f35d2a406829368eb0a7c4a5c80d35}{nge\_rx\_sparemap}}) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01281}01281                         bus\_dmamap\_destroy(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a204c4899e279570c9853dd867ea12a0b}{nge\_rx\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01282}01282                             sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a63f35d2a406829368eb0a7c4a5c80d35}{nge\_rx\_sparemap}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01283}01283                         sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a63f35d2a406829368eb0a7c4a5c80d35}{nge\_rx\_sparemap}} = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01284}01284                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01285}01285                 bus\_dma\_tag\_destroy(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a204c4899e279570c9853dd867ea12a0b}{nge\_rx\_tag}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01286}01286                 sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a204c4899e279570c9853dd867ea12a0b}{nge\_rx\_tag}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01287}01287         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01288}01288 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01289}01289         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_ae9d81a21f6b44316940a6dfba9b11163}{nge\_parent\_tag}}) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01290}01290                 bus\_dma\_tag\_destroy(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_ae9d81a21f6b44316940a6dfba9b11163}{nge\_parent\_tag}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01291}01291                 sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_ae9d81a21f6b44316940a6dfba9b11163}{nge\_parent\_tag}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01292}01292         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01293}01293 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01294}01294 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01295}01295 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01296}01296 \textcolor{comment}{ * Initialize the transmit descriptors.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01297}01297 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01298}01298 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01299}\mbox{\hyperlink{if__nge_8c_ab387b6fe058d481d4c54f5200bef2abc}{01299}} \mbox{\hyperlink{if__nge_8c_ab387b6fe058d481d4c54f5200bef2abc}{nge\_list\_tx\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01300}01300 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01301}01301         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__ring__data}{nge\_ring\_data}} *rd;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01302}01302         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__txdesc}{nge\_txdesc}} *txd;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01303}01303         bus\_addr\_t addr;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01304}01304         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01305}01305 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01306}01306         sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a0f74e5f74f354debc69355b5f0f2bfbf}{nge\_tx\_prod}} = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01307}01307         sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a76e95a9d78f714eda3196d9721c91031}{nge\_tx\_cons}} = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01308}01308         sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_af0cee28aac530bd098e997a179f3f058}{nge\_tx\_cnt}} = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01309}01309 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01310}01310         rd = \&sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01311}01311         bzero(rd-\/>\mbox{\hyperlink{structnge__ring__data_ad0d36c434e96d681af75191422afad1f}{nge\_tx\_ring}}, \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{if__ngereg_8h_a5443b6bb4002412f0ecc02023c715cde}{nge\_desc}}) * \mbox{\hyperlink{if__ngereg_8h_a2c640f4df126d566325ac35549986d2d}{NGE\_TX\_RING\_CNT}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01312}01312         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__ngereg_8h_a2c640f4df126d566325ac35549986d2d}{NGE\_TX\_RING\_CNT}}; i++) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01313}01313                 \textcolor{keywordflow}{if} (i == \mbox{\hyperlink{if__ngereg_8h_a2c640f4df126d566325ac35549986d2d}{NGE\_TX\_RING\_CNT}} -\/ 1)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01314}01314                         addr = \mbox{\hyperlink{if__ngereg_8h_a7e1440f1aa4812412749840b98bfaa79}{NGE\_TX\_RING\_ADDR}}(sc, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01315}01315                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01316}01316                         addr = \mbox{\hyperlink{if__ngereg_8h_a7e1440f1aa4812412749840b98bfaa79}{NGE\_TX\_RING\_ADDR}}(sc, i + 1);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01317}01317                 rd-\/>\mbox{\hyperlink{structnge__ring__data_ad0d36c434e96d681af75191422afad1f}{nge\_tx\_ring}}[i].nge\_next = htole32(\mbox{\hyperlink{if__ngereg_8h_a11c2f0eb778450088fe042ea7ddc75d6}{NGE\_ADDR\_LO}}(addr));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01318}01318                 txd = \&sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_ac62d7f895349014f6b56adde934fbb0a}{nge\_txdesc}}[i];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01319}01319                 txd-\/>\mbox{\hyperlink{structnge__txdesc_ac0980a7537bb5a6c403c3d89ec58663b}{tx\_m}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01320}01320         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01321}01321 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01322}01322         bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_acf30833820602cf7e1dc430f8cc3b35d}{nge\_tx\_ring\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01323}01323             sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a2265d4ebec9fc83f9d65b2e5fa524b86}{nge\_tx\_ring\_map}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01324}01324             BUS\_DMASYNC\_PREREAD | BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01325}01325 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01326}01326         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01327}01327 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01328}01328 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01329}01329 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01330}01330 \textcolor{comment}{ * Initialize the RX descriptors and allocate mbufs for them. Note that}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01331}01331 \textcolor{comment}{ * we arrange the descriptors in a closed ring, so that the last descriptor}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01332}01332 \textcolor{comment}{ * points back to the first.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01333}01333 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01334}01334 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01335}\mbox{\hyperlink{if__nge_8c_ae0edbc751498d6811dcc66af5765c8f3}{01335}} \mbox{\hyperlink{if__nge_8c_ae0edbc751498d6811dcc66af5765c8f3}{nge\_list\_rx\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01336}01336 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01337}01337         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__ring__data}{nge\_ring\_data}} *rd;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01338}01338         bus\_addr\_t addr;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01339}01339         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01340}01340 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01341}01341         sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_aeb5b3bb7215e5e127e6038d4df3fde4a}{nge\_rx\_cons}} = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01342}01342         sc-\/>\mbox{\hyperlink{structnge__softc_a3d7f33c53cb34088a9af8a6b68a03f5d}{nge\_head}} = sc-\/>\mbox{\hyperlink{structnge__softc_a3dec9af0002f6eee694bd4842a913309}{nge\_tail}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01343}01343 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01344}01344         rd = \&sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01345}01345         bzero(rd-\/>\mbox{\hyperlink{structnge__ring__data_a48cc6c82d6e12a847ecd1276a1302325}{nge\_rx\_ring}}, \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{if__ngereg_8h_a5443b6bb4002412f0ecc02023c715cde}{nge\_desc}}) * \mbox{\hyperlink{if__ngereg_8h_a4d2146cfe1e24ec4c810bf0d1d43bb0a}{NGE\_RX\_RING\_CNT}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01346}01346         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__ngereg_8h_a4d2146cfe1e24ec4c810bf0d1d43bb0a}{NGE\_RX\_RING\_CNT}}; i++) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01347}01347                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__nge_8c_ad77abeb382aa2ca9c352ab2103640453}{nge\_newbuf}}(sc, i) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01348}01348                         \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01349}01349                 \textcolor{keywordflow}{if} (i == \mbox{\hyperlink{if__ngereg_8h_a4d2146cfe1e24ec4c810bf0d1d43bb0a}{NGE\_RX\_RING\_CNT}} -\/ 1)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01350}01350                         addr = \mbox{\hyperlink{if__ngereg_8h_ad6408481a44a7cd500d014beff23979c}{NGE\_RX\_RING\_ADDR}}(sc, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01351}01351                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01352}01352                         addr = \mbox{\hyperlink{if__ngereg_8h_ad6408481a44a7cd500d014beff23979c}{NGE\_RX\_RING\_ADDR}}(sc, i + 1);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01353}01353                 rd-\/>\mbox{\hyperlink{structnge__ring__data_a48cc6c82d6e12a847ecd1276a1302325}{nge\_rx\_ring}}[i].nge\_next = htole32(\mbox{\hyperlink{if__ngereg_8h_a11c2f0eb778450088fe042ea7ddc75d6}{NGE\_ADDR\_LO}}(addr));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01354}01354         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01355}01355 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01356}01356         bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a62132b3fe7e7e05ddd6fe0bab137e10f}{nge\_rx\_ring\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01357}01357             sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a11e64532648aec0ec427c004e1c6be46}{nge\_rx\_ring\_map}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01358}01358             BUS\_DMASYNC\_PREREAD | BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01359}01359 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01360}01360         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01361}01361 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01362}01362 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01363}01363 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01364}\mbox{\hyperlink{if__nge_8c_a771e20cd9ef110857454c27e71652231}{01364}} \mbox{\hyperlink{if__nge_8c_a771e20cd9ef110857454c27e71652231}{nge\_discard\_rxbuf}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc, \textcolor{keywordtype}{int} idx)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01365}01365 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01366}01366         \textcolor{keyword}{struct }\mbox{\hyperlink{if__ngereg_8h_a5443b6bb4002412f0ecc02023c715cde}{nge\_desc}} *desc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01367}01367 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01368}01368         desc = \&sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_a48cc6c82d6e12a847ecd1276a1302325}{nge\_rx\_ring}}[idx];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01369}01369         desc-\/>nge\_cmdsts = htole32(MCLBYTES -\/ \textcolor{keyword}{sizeof}(uint64\_t));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01370}01370         desc-\/>nge\_extsts = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01371}01371 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01372}01372 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01373}01373 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01374}01374 \textcolor{comment}{ * Initialize an RX descriptor and attach an MBUF cluster.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01375}01375 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01376}01376 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01377}\mbox{\hyperlink{if__nge_8c_ad77abeb382aa2ca9c352ab2103640453}{01377}} \mbox{\hyperlink{if__nge_8c_ad77abeb382aa2ca9c352ab2103640453}{nge\_newbuf}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc, \textcolor{keywordtype}{int} idx)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01378}01378 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01379}01379         \textcolor{keyword}{struct }\mbox{\hyperlink{if__ngereg_8h_a5443b6bb4002412f0ecc02023c715cde}{nge\_desc}} *desc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01380}01380         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__rxdesc}{nge\_rxdesc}} *rxd;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01381}01381         \textcolor{keyword}{struct }mbuf *m;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01382}01382         bus\_dma\_segment\_t segs[1];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01383}01383         bus\_dmamap\_t map;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01384}01384         \textcolor{keywordtype}{int} nsegs;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01385}01385 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01386}01386         m = m\_getcl(M\_NOWAIT, MT\_DATA, M\_PKTHDR);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01387}01387         \textcolor{keywordflow}{if} (m == NULL)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01388}01388                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01389}01389         m-\/>m\_len = m-\/>m\_pkthdr.len = MCLBYTES;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01390}01390         m\_adj(m, \textcolor{keyword}{sizeof}(uint64\_t));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01391}01391 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01392}01392         \textcolor{keywordflow}{if} (bus\_dmamap\_load\_mbuf\_sg(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a204c4899e279570c9853dd867ea12a0b}{nge\_rx\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01393}01393             sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a63f35d2a406829368eb0a7c4a5c80d35}{nge\_rx\_sparemap}}, m, segs, \&nsegs, 0) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01394}01394                 m\_freem(m);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01395}01395                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01396}01396         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01397}01397         KASSERT(nsegs == 1, (\textcolor{stringliteral}{"{}\%s: \%d segments returned!"{}}, \_\_func\_\_, nsegs));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01398}01398 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01399}01399         rxd = \&sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a8cc2b833224ffdb58e8e160b48bb31f1}{nge\_rxdesc}}[idx];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01400}01400         \textcolor{keywordflow}{if} (rxd-\/>\mbox{\hyperlink{structnge__rxdesc_a70001dab71c024cbe4803374c626e40a}{rx\_m}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01401}01401                 bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a204c4899e279570c9853dd867ea12a0b}{nge\_rx\_tag}}, rxd-\/>\mbox{\hyperlink{structnge__rxdesc_a1aa2aa43da87a94cb49bb235995f37f5}{rx\_dmamap}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01402}01402                     BUS\_DMASYNC\_POSTREAD);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01403}01403                 bus\_dmamap\_unload(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a204c4899e279570c9853dd867ea12a0b}{nge\_rx\_tag}}, rxd-\/>\mbox{\hyperlink{structnge__rxdesc_a1aa2aa43da87a94cb49bb235995f37f5}{rx\_dmamap}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01404}01404         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01405}01405         map = rxd-\/>\mbox{\hyperlink{structnge__rxdesc_a1aa2aa43da87a94cb49bb235995f37f5}{rx\_dmamap}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01406}01406         rxd-\/>\mbox{\hyperlink{structnge__rxdesc_a1aa2aa43da87a94cb49bb235995f37f5}{rx\_dmamap}} = sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a63f35d2a406829368eb0a7c4a5c80d35}{nge\_rx\_sparemap}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01407}01407         sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a63f35d2a406829368eb0a7c4a5c80d35}{nge\_rx\_sparemap}} = map;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01408}01408         bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a204c4899e279570c9853dd867ea12a0b}{nge\_rx\_tag}}, rxd-\/>\mbox{\hyperlink{structnge__rxdesc_a1aa2aa43da87a94cb49bb235995f37f5}{rx\_dmamap}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01409}01409             BUS\_DMASYNC\_PREREAD);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01410}01410         rxd-\/>\mbox{\hyperlink{structnge__rxdesc_a70001dab71c024cbe4803374c626e40a}{rx\_m}} = m;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01411}01411         desc = \&sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_a48cc6c82d6e12a847ecd1276a1302325}{nge\_rx\_ring}}[idx];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01412}01412         desc-\/>nge\_ptr = htole32(\mbox{\hyperlink{if__ngereg_8h_a11c2f0eb778450088fe042ea7ddc75d6}{NGE\_ADDR\_LO}}(segs[0].ds\_addr));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01413}01413         desc-\/>nge\_cmdsts = htole32(segs[0].ds\_len);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01414}01414         desc-\/>nge\_extsts = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01415}01415 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01416}01416         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01417}01417 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01418}01418 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01419}01419 \textcolor{preprocessor}{\#ifndef \_\_NO\_STRICT\_ALIGNMENT}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01420}01420 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01421}\mbox{\hyperlink{if__nge_8c_aaf81a3309772856b925d6aecc46d1571}{01421}} \mbox{\hyperlink{if__nge_8c_aaf81a3309772856b925d6aecc46d1571}{nge\_fixup\_rx}}(\textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01422}01422 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01423}01423         \textcolor{keywordtype}{int}                     i;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01424}01424         uint16\_t                *src, *dst;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01425}01425 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01426}01426         src = mtod(m, uint16\_t *);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01427}01427         dst = src -\/ 1;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01428}01428 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01429}01429         \textcolor{keywordflow}{for} (i = 0; i < (m-\/>m\_len / \textcolor{keyword}{sizeof}(uint16\_t) + 1); i++)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01430}01430                 *dst++ = *src++;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01431}01431 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01432}01432         m-\/>m\_data -\/= ETHER\_ALIGN;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01433}01433 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01434}01434 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01435}01435 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01436}01436 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01437}01437 \textcolor{comment}{ * A frame has been uploaded: pass the resulting mbuf chain up to}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01438}01438 \textcolor{comment}{ * the higher level protocols.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01439}01439 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01440}01440 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01441}\mbox{\hyperlink{if__nge_8c_a5309c35e59df21a3a3102326fa57dae4}{01441}} \mbox{\hyperlink{if__nge_8c_a5309c35e59df21a3a3102326fa57dae4}{nge\_rxeof}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01442}01442 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01443}01443         \textcolor{keyword}{struct }mbuf *m;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01444}01444         \textcolor{keyword}{struct }ifnet *ifp;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01445}01445         \textcolor{keyword}{struct }\mbox{\hyperlink{if__ngereg_8h_a5443b6bb4002412f0ecc02023c715cde}{nge\_desc}} *cur\_rx;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01446}01446         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__rxdesc}{nge\_rxdesc}} *rxd;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01447}01447         \textcolor{keywordtype}{int} cons, prog, rx\_npkts, total\_len;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01448}01448         uint32\_t cmdsts, extsts;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01449}01449 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01450}01450         \mbox{\hyperlink{if__ngereg_8h_aef7ce8bc258716f95755fd594bb3436e}{NGE\_LOCK\_ASSERT}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01451}01451 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01452}01452         ifp = sc-\/>\mbox{\hyperlink{structnge__softc_ae1ee58f588347b47a3e046b13f030118}{nge\_ifp}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01453}01453         cons = sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_aeb5b3bb7215e5e127e6038d4df3fde4a}{nge\_rx\_cons}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01454}01454         rx\_npkts = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01455}01455 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01456}01456         bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a62132b3fe7e7e05ddd6fe0bab137e10f}{nge\_rx\_ring\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01457}01457             sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a11e64532648aec0ec427c004e1c6be46}{nge\_rx\_ring\_map}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01458}01458             BUS\_DMASYNC\_POSTREAD | BUS\_DMASYNC\_POSTWRITE);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01459}01459 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01460}01460         \textcolor{keywordflow}{for} (prog = 0; prog < \mbox{\hyperlink{if__ngereg_8h_a4d2146cfe1e24ec4c810bf0d1d43bb0a}{NGE\_RX\_RING\_CNT}} \&\&}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01461}01461             (ifp-\/>if\_drv\_flags \& IFF\_DRV\_RUNNING) != 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01462}01462             \mbox{\hyperlink{if__ngereg_8h_a786e8c0f287d06095ed6f4783807db22}{NGE\_INC}}(cons, \mbox{\hyperlink{if__ngereg_8h_a4d2146cfe1e24ec4c810bf0d1d43bb0a}{NGE\_RX\_RING\_CNT}})) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01463}01463 \textcolor{preprocessor}{\#ifdef DEVICE\_POLLING}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01464}01464                 \textcolor{keywordflow}{if} (ifp-\/>if\_capenable \& IFCAP\_POLLING) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01465}01465                         \textcolor{keywordflow}{if} (sc-\/>rxcycles <= 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01466}01466                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01467}01467                         sc-\/>rxcycles-\/-\/;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01468}01468                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01469}01469 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01470}01470                 cur\_rx = \&sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_a48cc6c82d6e12a847ecd1276a1302325}{nge\_rx\_ring}}[cons];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01471}01471                 cmdsts = le32toh(cur\_rx-\/>nge\_cmdsts);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01472}01472                 extsts = le32toh(cur\_rx-\/>nge\_extsts);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01473}01473                 \textcolor{keywordflow}{if} ((cmdsts \& \mbox{\hyperlink{if__ngereg_8h_a094d1b80ade11fcaed8bba3ac526bc86}{NGE\_CMDSTS\_OWN}}) == 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01474}01474                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01475}01475                 prog++;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01476}01476                 rxd = \&sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a8cc2b833224ffdb58e8e160b48bb31f1}{nge\_rxdesc}}[cons];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01477}01477                 m = rxd-\/>\mbox{\hyperlink{structnge__rxdesc_a70001dab71c024cbe4803374c626e40a}{rx\_m}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01478}01478                 total\_len = cmdsts \& \mbox{\hyperlink{if__ngereg_8h_a62a03454d92ad38c079a2c54aba7784e}{NGE\_CMDSTS\_BUFLEN}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01479}01479 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01480}01480                 \textcolor{keywordflow}{if} ((cmdsts \& \mbox{\hyperlink{if__ngereg_8h_a65b612af8682c1bcd543b6080c2ed8de}{NGE\_CMDSTS\_MORE}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01481}01481                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__nge_8c_ad77abeb382aa2ca9c352ab2103640453}{nge\_newbuf}}(sc, cons) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01482}01482                                 if\_inc\_counter(ifp, IFCOUNTER\_IQDROPS, 1);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01483}01483                                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a3d7f33c53cb34088a9af8a6b68a03f5d}{nge\_head}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01484}01484                                         m\_freem(sc-\/>\mbox{\hyperlink{structnge__softc_a3d7f33c53cb34088a9af8a6b68a03f5d}{nge\_head}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01485}01485                                         sc-\/>\mbox{\hyperlink{structnge__softc_a3d7f33c53cb34088a9af8a6b68a03f5d}{nge\_head}} = sc-\/>\mbox{\hyperlink{structnge__softc_a3dec9af0002f6eee694bd4842a913309}{nge\_tail}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01486}01486                                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01487}01487                                 \mbox{\hyperlink{if__nge_8c_a771e20cd9ef110857454c27e71652231}{nge\_discard\_rxbuf}}(sc, cons);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01488}01488                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01489}01489                         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01490}01490                         m-\/>m\_len = total\_len;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01491}01491                         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a3d7f33c53cb34088a9af8a6b68a03f5d}{nge\_head}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01492}01492                                 m-\/>m\_pkthdr.len = total\_len;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01493}01493                                 sc-\/>\mbox{\hyperlink{structnge__softc_a3d7f33c53cb34088a9af8a6b68a03f5d}{nge\_head}} = sc-\/>\mbox{\hyperlink{structnge__softc_a3dec9af0002f6eee694bd4842a913309}{nge\_tail}} = m;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01494}01494                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01495}01495                                 m-\/>m\_flags \&= \string~M\_PKTHDR;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01496}01496                                 sc-\/>\mbox{\hyperlink{structnge__softc_a3d7f33c53cb34088a9af8a6b68a03f5d}{nge\_head}}-\/>m\_pkthdr.len += total\_len;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01497}01497                                 sc-\/>\mbox{\hyperlink{structnge__softc_a3dec9af0002f6eee694bd4842a913309}{nge\_tail}}-\/>m\_next = m;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01498}01498                                 sc-\/>\mbox{\hyperlink{structnge__softc_a3dec9af0002f6eee694bd4842a913309}{nge\_tail}} = m;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01499}01499                         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01500}01500                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01501}01501                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01502}01502 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01503}01503                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01504}01504 \textcolor{comment}{                 * If an error occurs, update stats, clear the}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01505}01505 \textcolor{comment}{                 * status word and leave the mbuf cluster in place:}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01506}01506 \textcolor{comment}{                 * it should simply get re-\/used next time this descriptor}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01507}01507 \textcolor{comment}{                 * comes up in the ring.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01508}01508 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01509}01509                 \textcolor{keywordflow}{if} ((cmdsts \& \mbox{\hyperlink{if__ngereg_8h_a2eee3a015363864086aa8c0341d1a791}{NGE\_CMDSTS\_PKT\_OK}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01510}01510                         \textcolor{keywordflow}{if} ((cmdsts \& \mbox{\hyperlink{if__ngereg_8h_a3955136195546e4597b46eeaeba7e61f}{NGE\_RXSTAT\_RUNT}}) \&\&}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01511}01511                             total\_len >= (ETHER\_MIN\_LEN -\/ ETHER\_CRC\_LEN -\/ 4)) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01512}01512                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01513}01513 \textcolor{comment}{                                 * Work-\/around hardware bug, accept runt frames}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01514}01514 \textcolor{comment}{                                 * if its length is larger than or equal to 56.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01515}01515 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01516}01516                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01517}01517                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01518}01518 \textcolor{comment}{                                 * Input error counters are updated by hardware.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01519}01519 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01520}01520                                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a3d7f33c53cb34088a9af8a6b68a03f5d}{nge\_head}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01521}01521                                         m\_freem(sc-\/>\mbox{\hyperlink{structnge__softc_a3d7f33c53cb34088a9af8a6b68a03f5d}{nge\_head}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01522}01522                                         sc-\/>\mbox{\hyperlink{structnge__softc_a3d7f33c53cb34088a9af8a6b68a03f5d}{nge\_head}} = sc-\/>\mbox{\hyperlink{structnge__softc_a3dec9af0002f6eee694bd4842a913309}{nge\_tail}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01523}01523                                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01524}01524                                 \mbox{\hyperlink{if__nge_8c_a771e20cd9ef110857454c27e71652231}{nge\_discard\_rxbuf}}(sc, cons);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01525}01525                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01526}01526                         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01527}01527                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01528}01528 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01529}01529                 \textcolor{comment}{/* Try conjure up a replacement mbuf. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01530}01530 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01531}01531                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__nge_8c_ad77abeb382aa2ca9c352ab2103640453}{nge\_newbuf}}(sc, cons) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01532}01532                         if\_inc\_counter(ifp, IFCOUNTER\_IQDROPS, 1);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01533}01533                         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a3d7f33c53cb34088a9af8a6b68a03f5d}{nge\_head}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01534}01534                                 m\_freem(sc-\/>\mbox{\hyperlink{structnge__softc_a3d7f33c53cb34088a9af8a6b68a03f5d}{nge\_head}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01535}01535                                 sc-\/>\mbox{\hyperlink{structnge__softc_a3d7f33c53cb34088a9af8a6b68a03f5d}{nge\_head}} = sc-\/>\mbox{\hyperlink{structnge__softc_a3dec9af0002f6eee694bd4842a913309}{nge\_tail}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01536}01536                         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01537}01537                         \mbox{\hyperlink{if__nge_8c_a771e20cd9ef110857454c27e71652231}{nge\_discard\_rxbuf}}(sc, cons);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01538}01538                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01539}01539                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01540}01540 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01541}01541                 \textcolor{comment}{/* Chain received mbufs. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01542}01542                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a3d7f33c53cb34088a9af8a6b68a03f5d}{nge\_head}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01543}01543                         m-\/>m\_len = total\_len;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01544}01544                         m-\/>m\_flags \&= \string~M\_PKTHDR;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01545}01545                         sc-\/>\mbox{\hyperlink{structnge__softc_a3dec9af0002f6eee694bd4842a913309}{nge\_tail}}-\/>m\_next = m;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01546}01546                         m = sc-\/>\mbox{\hyperlink{structnge__softc_a3d7f33c53cb34088a9af8a6b68a03f5d}{nge\_head}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01547}01547                         m-\/>m\_pkthdr.len += total\_len;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01548}01548                         sc-\/>\mbox{\hyperlink{structnge__softc_a3d7f33c53cb34088a9af8a6b68a03f5d}{nge\_head}} = sc-\/>\mbox{\hyperlink{structnge__softc_a3dec9af0002f6eee694bd4842a913309}{nge\_tail}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01549}01549                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01550}01550                         m-\/>m\_pkthdr.len = m-\/>m\_len = total\_len;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01551}01551 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01552}01552                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01553}01553 \textcolor{comment}{                 * Ok. NatSemi really screwed up here. This is the}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01554}01554 \textcolor{comment}{                 * only gigE chip I know of with alignment constraints}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01555}01555 \textcolor{comment}{                 * on receive buffers. RX buffers must be 64-\/bit aligned.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01556}01556 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01557}01557                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01558}01558 \textcolor{comment}{                 * By popular demand, ignore the alignment problems}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01559}01559 \textcolor{comment}{                 * on the non-\/strict alignment platform. The performance hit}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01560}01560 \textcolor{comment}{                 * incurred due to unaligned accesses is much smaller}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01561}01561 \textcolor{comment}{                 * than the hit produced by forcing buffer copies all}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01562}01562 \textcolor{comment}{                 * the time, especially with jumbo frames. We still}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01563}01563 \textcolor{comment}{                 * need to fix up the alignment everywhere else though.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01564}01564 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01565}01565 \textcolor{preprocessor}{\#ifndef \_\_NO\_STRICT\_ALIGNMENT}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01566}01566                 \mbox{\hyperlink{if__nge_8c_aaf81a3309772856b925d6aecc46d1571}{nge\_fixup\_rx}}(m);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01567}01567 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01568}01568                 m-\/>m\_pkthdr.rcvif = ifp;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01569}01569                 if\_inc\_counter(ifp, IFCOUNTER\_IPACKETS, 1);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01570}01570 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01571}01571                 \textcolor{keywordflow}{if} ((ifp-\/>if\_capenable \& IFCAP\_RXCSUM) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01572}01572                         \textcolor{comment}{/* Do IP checksum checking. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01573}01573                         \textcolor{keywordflow}{if} ((extsts \& \mbox{\hyperlink{if__ngereg_8h_a46ba283d92a12832f119b6d45d4db595}{NGE\_RXEXTSTS\_IPPKT}}) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01574}01574                                 m-\/>m\_pkthdr.csum\_flags |= CSUM\_IP\_CHECKED;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01575}01575                         \textcolor{keywordflow}{if} ((extsts \& \mbox{\hyperlink{if__ngereg_8h_a8d71f392b4646a6a98bf7317e0b02bcc}{NGE\_RXEXTSTS\_IPCSUMERR}}) == 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01576}01576                                 m-\/>m\_pkthdr.csum\_flags |= CSUM\_IP\_VALID;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01577}01577                         \textcolor{keywordflow}{if} ((extsts \& \mbox{\hyperlink{if__ngereg_8h_ad33de301736c3c12826250af287a3820}{NGE\_RXEXTSTS\_TCPPKT}} \&\&}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01578}01578                             !(extsts \& \mbox{\hyperlink{if__ngereg_8h_a7b1df8f3b7abc292e7acd96e2bdf6dbc}{NGE\_RXEXTSTS\_TCPCSUMERR}})) ||}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01579}01579                             (extsts \& \mbox{\hyperlink{if__ngereg_8h_af7ceef0ebab6e4c853fa92c15da2741c}{NGE\_RXEXTSTS\_UDPPKT}} \&\&}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01580}01580                             !(extsts \& \mbox{\hyperlink{if__ngereg_8h_abb07f9ab1667bf85fe2c48daf3a68ed7}{NGE\_RXEXTSTS\_UDPCSUMERR}}))) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01581}01581                                 m-\/>m\_pkthdr.csum\_flags |=}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01582}01582                                     CSUM\_DATA\_VALID | CSUM\_PSEUDO\_HDR;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01583}01583                                 m-\/>m\_pkthdr.csum\_data = 0xffff;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01584}01584                         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01585}01585                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01586}01586 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01587}01587                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01588}01588 \textcolor{comment}{                 * If we received a packet with a vlan tag, pass it}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01589}01589 \textcolor{comment}{                 * to vlan\_input() instead of ether\_input().}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01590}01590 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01591}01591                 \textcolor{keywordflow}{if} ((extsts \& \mbox{\hyperlink{if__ngereg_8h_a0f1fa8d4d56df34c9cb8232de0eb9086}{NGE\_RXEXTSTS\_VLANPKT}}) != 0 \&\&}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01592}01592                     (ifp-\/>if\_capenable \& IFCAP\_VLAN\_HWTAGGING) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01593}01593                         m-\/>m\_pkthdr.ether\_vtag =}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01594}01594                             bswap16(extsts \& \mbox{\hyperlink{if__ngereg_8h_a16c0050375c9938e96e17435b3432624}{NGE\_RXEXTSTS\_VTCI}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01595}01595                         m-\/>m\_flags |= M\_VLANTAG;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01596}01596                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01597}01597                 \mbox{\hyperlink{if__ngereg_8h_a384e888bfa48167ca9e46af78aaba7e7}{NGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01598}01598                 (*ifp-\/>if\_input)(ifp, m);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01599}01599                 \mbox{\hyperlink{if__ngereg_8h_ab99f47bf2cd630291194ae818035d11e}{NGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01600}01600                 rx\_npkts++;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01601}01601         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01602}01602 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01603}01603         \textcolor{keywordflow}{if} (prog > 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01604}01604                 sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_aeb5b3bb7215e5e127e6038d4df3fde4a}{nge\_rx\_cons}} = cons;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01605}01605                 bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a62132b3fe7e7e05ddd6fe0bab137e10f}{nge\_rx\_ring\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01606}01606                     sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a11e64532648aec0ec427c004e1c6be46}{nge\_rx\_ring\_map}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01607}01607                     BUS\_DMASYNC\_PREREAD | BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01608}01608         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01609}01609         \textcolor{keywordflow}{return} (rx\_npkts);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01610}01610 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01611}01611 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01612}01612 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01613}01613 \textcolor{comment}{ * A frame was downloaded to the chip. It's safe for us to clean up}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01614}01614 \textcolor{comment}{ * the list buffers.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01615}01615 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01616}01616 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01617}\mbox{\hyperlink{if__nge_8c_a63a556df379a487a1d56e4d32ad68456}{01617}} \mbox{\hyperlink{if__nge_8c_a63a556df379a487a1d56e4d32ad68456}{nge\_txeof}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01618}01618 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01619}01619         \textcolor{keyword}{struct }\mbox{\hyperlink{if__ngereg_8h_a5443b6bb4002412f0ecc02023c715cde}{nge\_desc}} *cur\_tx;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01620}01620         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__txdesc}{nge\_txdesc}} *txd;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01621}01621         \textcolor{keyword}{struct }ifnet *ifp;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01622}01622         uint32\_t cmdsts;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01623}01623         \textcolor{keywordtype}{int} cons, prod;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01624}01624 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01625}01625         \mbox{\hyperlink{if__ngereg_8h_aef7ce8bc258716f95755fd594bb3436e}{NGE\_LOCK\_ASSERT}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01626}01626         ifp = sc-\/>\mbox{\hyperlink{structnge__softc_ae1ee58f588347b47a3e046b13f030118}{nge\_ifp}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01627}01627 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01628}01628         cons = sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a76e95a9d78f714eda3196d9721c91031}{nge\_tx\_cons}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01629}01629         prod = sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a0f74e5f74f354debc69355b5f0f2bfbf}{nge\_tx\_prod}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01630}01630         \textcolor{keywordflow}{if} (cons == prod)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01631}01631                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01632}01632 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01633}01633         bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_acf30833820602cf7e1dc430f8cc3b35d}{nge\_tx\_ring\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01634}01634             sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a2265d4ebec9fc83f9d65b2e5fa524b86}{nge\_tx\_ring\_map}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01635}01635             BUS\_DMASYNC\_POSTREAD | BUS\_DMASYNC\_POSTWRITE);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01636}01636 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01637}01637         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01638}01638 \textcolor{comment}{         * Go through our tx list and free mbufs for those}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01639}01639 \textcolor{comment}{         * frames that have been transmitted.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01640}01640 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01641}01641         \textcolor{keywordflow}{for} (; cons != prod; \mbox{\hyperlink{if__ngereg_8h_a786e8c0f287d06095ed6f4783807db22}{NGE\_INC}}(cons, \mbox{\hyperlink{if__ngereg_8h_a2c640f4df126d566325ac35549986d2d}{NGE\_TX\_RING\_CNT}})) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01642}01642                 cur\_tx = \&sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_ad0d36c434e96d681af75191422afad1f}{nge\_tx\_ring}}[cons];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01643}01643                 cmdsts = le32toh(cur\_tx-\/>nge\_cmdsts);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01644}01644                 \textcolor{keywordflow}{if} ((cmdsts \& \mbox{\hyperlink{if__ngereg_8h_a094d1b80ade11fcaed8bba3ac526bc86}{NGE\_CMDSTS\_OWN}}) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01645}01645                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01646}01646                 sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_af0cee28aac530bd098e997a179f3f058}{nge\_tx\_cnt}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01647}01647                 ifp-\/>if\_drv\_flags \&= \string~IFF\_DRV\_OACTIVE;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01648}01648                 \textcolor{keywordflow}{if} ((cmdsts \& \mbox{\hyperlink{if__ngereg_8h_a65b612af8682c1bcd543b6080c2ed8de}{NGE\_CMDSTS\_MORE}}) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01649}01649                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01650}01650 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01651}01651                 txd = \&sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_ac62d7f895349014f6b56adde934fbb0a}{nge\_txdesc}}[cons];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01652}01652                 bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a6fc520951d327aa4be4f35f2dfa3f521}{nge\_tx\_tag}}, txd-\/>\mbox{\hyperlink{structnge__txdesc_aa334e70e247f63d45bd94da3e631e79f}{tx\_dmamap}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01653}01653                     BUS\_DMASYNC\_POSTWRITE);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01654}01654                 bus\_dmamap\_unload(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a6fc520951d327aa4be4f35f2dfa3f521}{nge\_tx\_tag}}, txd-\/>\mbox{\hyperlink{structnge__txdesc_aa334e70e247f63d45bd94da3e631e79f}{tx\_dmamap}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01655}01655                 \textcolor{keywordflow}{if} ((cmdsts \& \mbox{\hyperlink{if__ngereg_8h_a2eee3a015363864086aa8c0341d1a791}{NGE\_CMDSTS\_PKT\_OK}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01656}01656                         if\_inc\_counter(ifp, IFCOUNTER\_OERRORS, 1);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01657}01657                         \textcolor{keywordflow}{if} ((cmdsts \& \mbox{\hyperlink{if__ngereg_8h_a1a66776dd5150269e5cc8d89c32bd39d}{NGE\_TXSTAT\_EXCESSCOLLS}}) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01658}01658                                 if\_inc\_counter(ifp, IFCOUNTER\_COLLISIONS, 1);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01659}01659                         \textcolor{keywordflow}{if} ((cmdsts \& \mbox{\hyperlink{if__ngereg_8h_a746df21c756ef42c3792cae51852aec8}{NGE\_TXSTAT\_OUTOFWINCOLL}}) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01660}01660                                 if\_inc\_counter(ifp, IFCOUNTER\_COLLISIONS, 1);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01661}01661                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01662}01662                         if\_inc\_counter(ifp, IFCOUNTER\_OPACKETS, 1);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01663}01663 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01664}01664                 if\_inc\_counter(ifp, IFCOUNTER\_COLLISIONS, (cmdsts \& \mbox{\hyperlink{if__ngereg_8h_aa62b7aa9f6a39a55fe59bc73a505e8b7}{NGE\_TXSTAT\_COLLCNT}}) >> 16);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01665}01665                 KASSERT(txd-\/>\mbox{\hyperlink{structnge__txdesc_ac0980a7537bb5a6c403c3d89ec58663b}{tx\_m}} != NULL, (\textcolor{stringliteral}{"{}\%s: freeing NULL mbuf!\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01666}01666                     \_\_func\_\_));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01667}01667                 m\_freem(txd-\/>\mbox{\hyperlink{structnge__txdesc_ac0980a7537bb5a6c403c3d89ec58663b}{tx\_m}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01668}01668                 txd-\/>\mbox{\hyperlink{structnge__txdesc_ac0980a7537bb5a6c403c3d89ec58663b}{tx\_m}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01669}01669         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01670}01670 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01671}01671         sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a76e95a9d78f714eda3196d9721c91031}{nge\_tx\_cons}} = cons;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01672}01672         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_af0cee28aac530bd098e997a179f3f058}{nge\_tx\_cnt}} == 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01673}01673                 sc-\/>\mbox{\hyperlink{structnge__softc_a903985ea3957a7bff8dca0f1861fcc29}{nge\_watchdog\_timer}} = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01674}01674 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01675}01675 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01676}01676 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01677}\mbox{\hyperlink{if__nge_8c_a984c6c5051e1134e2dc69da61389b087}{01677}} \mbox{\hyperlink{if__nge_8c_a984c6c5051e1134e2dc69da61389b087}{nge\_tick}}(\textcolor{keywordtype}{void} *xsc)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01678}01678 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01679}01679         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01680}01680         \textcolor{keyword}{struct }mii\_data *mii;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01681}01681 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01682}01682         sc = xsc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01683}01683         \mbox{\hyperlink{if__ngereg_8h_aef7ce8bc258716f95755fd594bb3436e}{NGE\_LOCK\_ASSERT}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01684}01684         mii = device\_get\_softc(sc-\/>\mbox{\hyperlink{structnge__softc_a0c48586b5276b5d260cf1d0f606eef32}{nge\_miibus}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01685}01685         mii\_tick(mii);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01686}01686         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01687}01687 \textcolor{comment}{         * For PHYs that does not reset established link, it is}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01688}01688 \textcolor{comment}{         * necessary to check whether driver still have a valid}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01689}01689 \textcolor{comment}{         * link(e.g link state change callback is not called).}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01690}01690 \textcolor{comment}{         * Otherwise, driver think it lost link because driver}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01691}01691 \textcolor{comment}{         * initialization routine clears link state flag.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01692}01692 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01693}01693         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structnge__softc_ac84c514781515c9c5e2b88fc019e0265}{nge\_flags}} \& \mbox{\hyperlink{if__ngereg_8h_a404d97bcfec9925bde7d065cb2c82074}{NGE\_FLAG\_LINK}}) == 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01694}01694                 \mbox{\hyperlink{if__nge_8c_a4394be97bf3bfcf0be6812ad5f7a1af5}{nge\_miibus\_statchg}}(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01695}01695         \mbox{\hyperlink{if__nge_8c_a25220701f680281bf402ac417e973a1e}{nge\_stats\_update}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01696}01696         \mbox{\hyperlink{if__nge_8c_a4a09759d0a337c988dd49225b47eb12b}{nge\_watchdog}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01697}01697         callout\_reset(\&sc-\/>\mbox{\hyperlink{structnge__softc_abd2b1bd8b840edd031917b2f3da8243e}{nge\_stat\_ch}}, hz, \mbox{\hyperlink{if__nge_8c_a984c6c5051e1134e2dc69da61389b087}{nge\_tick}}, sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01698}01698 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01699}01699 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01700}01700 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01701}\mbox{\hyperlink{if__nge_8c_a25220701f680281bf402ac417e973a1e}{01701}} \mbox{\hyperlink{if__nge_8c_a25220701f680281bf402ac417e973a1e}{nge\_stats\_update}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01702}01702 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01703}01703         \textcolor{keyword}{struct }ifnet *ifp;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01704}01704         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__stats}{nge\_stats}} now, *stats, *nstats;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01705}01705 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01706}01706         \mbox{\hyperlink{if__ngereg_8h_aef7ce8bc258716f95755fd594bb3436e}{NGE\_LOCK\_ASSERT}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01707}01707 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01708}01708         ifp = sc-\/>\mbox{\hyperlink{structnge__softc_ae1ee58f588347b47a3e046b13f030118}{nge\_ifp}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01709}01709         stats = \&now;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01710}01710         stats-\/>\mbox{\hyperlink{structnge__stats_a65ad0fe640a3d4253a57de51b1b08c65}{rx\_pkts\_errs}} =}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01711}01711             \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_ac95b2d29958dcd4631d6e7ae8acf1a4b}{NGE\_MIB\_RXERRPKT}}) \& 0xFFFF;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01712}01712         stats-\/>\mbox{\hyperlink{structnge__stats_a8676f1c6384201f9b7a5eb37afe4b85f}{rx\_crc\_errs}} =}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01713}01713             \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a81c17ac89aa4376e3df9d7060aa6ee39}{NGE\_MIB\_RXERRFCS}}) \& 0xFFFF;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01714}01714         stats-\/>\mbox{\hyperlink{structnge__stats_a3ebefa4f6ca7c1fc424d9dcf25b5b6a3}{rx\_fifo\_oflows}} =}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01715}01715             \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a5987845dc9580a8a3b5fa5bfdf70986c}{NGE\_MIB\_RXERRMISSEDPKT}}) \& 0xFFFF;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01716}01716         stats-\/>\mbox{\hyperlink{structnge__stats_a7fb620b1ea719e315476b85e217c64db}{rx\_align\_errs}} =}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01717}01717             \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a9c91b378a3a9cda4cf35d3cba3af1224}{NGE\_MIB\_RXERRALIGN}}) \& 0xFFFF;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01718}01718         stats-\/>\mbox{\hyperlink{structnge__stats_ad872331ebc4ed1f40cad44173780a381}{rx\_sym\_errs}} =}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01719}01719             \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a2e0b98047d4f7469d65b80f01a59c622}{NGE\_MIB\_RXERRSYM}}) \& 0xFFFF;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01720}01720         stats-\/>\mbox{\hyperlink{structnge__stats_a9c8529d3ad19f17eb1feefea9ce359ba}{rx\_pkts\_jumbos}} =}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01721}01721             \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_ac6811070fddf73030daa73713e1b6964}{NGE\_MIB\_RXERRGIANT}}) \& 0xFFFF;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01722}01722         stats-\/>\mbox{\hyperlink{structnge__stats_a69c590a50342562e1b8b742a71208908}{rx\_len\_errs}} =}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01723}01723             \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a7dcf474c89c8629b696046f63720410d}{NGE\_MIB\_RXERRRANGLEN}}) \& 0xFFFF;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01724}01724         stats-\/>\mbox{\hyperlink{structnge__stats_af4b56dd00075f187e155fe2bfc599636}{rx\_unctl\_frames}} =}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01725}01725             \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a1cab7ce420fbb44ca9233362595d327e}{NGE\_MIB\_RXBADOPCODE}}) \& 0xFFFF;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01726}01726         stats-\/>\mbox{\hyperlink{structnge__stats_a9cadc4152365610e92ed78740d69ef65}{rx\_pause}} =}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01727}01727             \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_ab4e9a4240b30ebe69f4c91123a7b7e13}{NGE\_MIB\_RXPAUSEPKTS}}) \& 0xFFFF;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01728}01728         stats-\/>\mbox{\hyperlink{structnge__stats_ac0b2e5714f966fff8ba0a30c1c8d517f}{tx\_pause}} =}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01729}01729             \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_ac7973892f532dc34c32992fea8e948b4}{NGE\_MIB\_TXPAUSEPKTS}}) \& 0xFFFF;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01730}01730         stats-\/>\mbox{\hyperlink{structnge__stats_a8e9e67ef0e5cff196204aa67f7152c00}{tx\_seq\_errs}} =}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01731}01731             \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a9292c6cf414561e312eddd52caca6f2a}{NGE\_MIB\_TXERRSQE}}) \& 0xFF;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01732}01732 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01733}01733         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01734}01734 \textcolor{comment}{         * Since we've accept errored frames exclude Rx length errors.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01735}01735 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01736}01736         if\_inc\_counter(ifp, IFCOUNTER\_IERRORS,}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01737}01737             stats-\/>\mbox{\hyperlink{structnge__stats_a65ad0fe640a3d4253a57de51b1b08c65}{rx\_pkts\_errs}} + stats-\/>\mbox{\hyperlink{structnge__stats_a8676f1c6384201f9b7a5eb37afe4b85f}{rx\_crc\_errs}} +}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01738}01738             stats-\/>\mbox{\hyperlink{structnge__stats_a3ebefa4f6ca7c1fc424d9dcf25b5b6a3}{rx\_fifo\_oflows}} + stats-\/>\mbox{\hyperlink{structnge__stats_ad872331ebc4ed1f40cad44173780a381}{rx\_sym\_errs}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01739}01739 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01740}01740         nstats = \&sc-\/>\mbox{\hyperlink{structnge__softc_aa7c4279b0d07fb682ac8a99a83aea680}{nge\_stats}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01741}01741         nstats-\/>\mbox{\hyperlink{structnge__stats_a65ad0fe640a3d4253a57de51b1b08c65}{rx\_pkts\_errs}} += stats-\/>\mbox{\hyperlink{structnge__stats_a65ad0fe640a3d4253a57de51b1b08c65}{rx\_pkts\_errs}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01742}01742         nstats-\/>\mbox{\hyperlink{structnge__stats_a8676f1c6384201f9b7a5eb37afe4b85f}{rx\_crc\_errs}} += stats-\/>\mbox{\hyperlink{structnge__stats_a8676f1c6384201f9b7a5eb37afe4b85f}{rx\_crc\_errs}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01743}01743         nstats-\/>\mbox{\hyperlink{structnge__stats_a3ebefa4f6ca7c1fc424d9dcf25b5b6a3}{rx\_fifo\_oflows}} += stats-\/>\mbox{\hyperlink{structnge__stats_a3ebefa4f6ca7c1fc424d9dcf25b5b6a3}{rx\_fifo\_oflows}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01744}01744         nstats-\/>\mbox{\hyperlink{structnge__stats_a7fb620b1ea719e315476b85e217c64db}{rx\_align\_errs}} += stats-\/>\mbox{\hyperlink{structnge__stats_a7fb620b1ea719e315476b85e217c64db}{rx\_align\_errs}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01745}01745         nstats-\/>\mbox{\hyperlink{structnge__stats_ad872331ebc4ed1f40cad44173780a381}{rx\_sym\_errs}} += stats-\/>\mbox{\hyperlink{structnge__stats_ad872331ebc4ed1f40cad44173780a381}{rx\_sym\_errs}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01746}01746         nstats-\/>\mbox{\hyperlink{structnge__stats_a9c8529d3ad19f17eb1feefea9ce359ba}{rx\_pkts\_jumbos}} += stats-\/>\mbox{\hyperlink{structnge__stats_a9c8529d3ad19f17eb1feefea9ce359ba}{rx\_pkts\_jumbos}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01747}01747         nstats-\/>\mbox{\hyperlink{structnge__stats_a69c590a50342562e1b8b742a71208908}{rx\_len\_errs}} += stats-\/>\mbox{\hyperlink{structnge__stats_a69c590a50342562e1b8b742a71208908}{rx\_len\_errs}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01748}01748         nstats-\/>\mbox{\hyperlink{structnge__stats_af4b56dd00075f187e155fe2bfc599636}{rx\_unctl\_frames}} += stats-\/>\mbox{\hyperlink{structnge__stats_af4b56dd00075f187e155fe2bfc599636}{rx\_unctl\_frames}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01749}01749         nstats-\/>\mbox{\hyperlink{structnge__stats_a9cadc4152365610e92ed78740d69ef65}{rx\_pause}} += stats-\/>\mbox{\hyperlink{structnge__stats_a9cadc4152365610e92ed78740d69ef65}{rx\_pause}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01750}01750         nstats-\/>\mbox{\hyperlink{structnge__stats_ac0b2e5714f966fff8ba0a30c1c8d517f}{tx\_pause}} += stats-\/>\mbox{\hyperlink{structnge__stats_ac0b2e5714f966fff8ba0a30c1c8d517f}{tx\_pause}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01751}01751         nstats-\/>\mbox{\hyperlink{structnge__stats_a8e9e67ef0e5cff196204aa67f7152c00}{tx\_seq\_errs}} += stats-\/>\mbox{\hyperlink{structnge__stats_a8e9e67ef0e5cff196204aa67f7152c00}{tx\_seq\_errs}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01752}01752 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01753}01753 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01754}01754 \textcolor{preprocessor}{\#ifdef DEVICE\_POLLING}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01755}01755 \textcolor{keyword}{static} poll\_handler\_t nge\_poll;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01756}01756 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01757}01757 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01758}01758 nge\_poll(\textcolor{keyword}{struct} ifnet *ifp, \textcolor{keyword}{enum} poll\_cmd cmd, \textcolor{keywordtype}{int} count)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01759}01759 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01760}01760         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01761}01761         \textcolor{keywordtype}{int} rx\_npkts = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01762}01762 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01763}01763         sc = ifp-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01764}01764 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01765}01765         \mbox{\hyperlink{if__ngereg_8h_ab99f47bf2cd630291194ae818035d11e}{NGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01766}01766         \textcolor{keywordflow}{if} ((ifp-\/>if\_drv\_flags \& IFF\_DRV\_RUNNING) == 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01767}01767                 \mbox{\hyperlink{if__ngereg_8h_a384e888bfa48167ca9e46af78aaba7e7}{NGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01768}01768                 \textcolor{keywordflow}{return} (rx\_npkts);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01769}01769         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01770}01770 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01771}01771         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01772}01772 \textcolor{comment}{         * On the nge, reading the status register also clears it.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01773}01773 \textcolor{comment}{         * So before returning to intr mode we must make sure that all}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01774}01774 \textcolor{comment}{         * possible pending sources of interrupts have been served.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01775}01775 \textcolor{comment}{         * In practice this means run to completion the *eof routines,}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01776}01776 \textcolor{comment}{         * and then call the interrupt routine.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01777}01777 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01778}01778         sc-\/>rxcycles = count;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01779}01779         rx\_npkts = \mbox{\hyperlink{if__nge_8c_a5309c35e59df21a3a3102326fa57dae4}{nge\_rxeof}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01780}01780         \mbox{\hyperlink{if__nge_8c_a63a556df379a487a1d56e4d32ad68456}{nge\_txeof}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01781}01781         \textcolor{keywordflow}{if} (!IFQ\_DRV\_IS\_EMPTY(\&ifp-\/>if\_snd))}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01782}01782                 \mbox{\hyperlink{if__nge_8c_ad2902445bf55cddca069c3162091c509}{nge\_start\_locked}}(ifp);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01783}01783 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01784}01784         \textcolor{keywordflow}{if} (sc-\/>rxcycles > 0 || cmd == POLL\_AND\_CHECK\_STATUS) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01785}01785                 uint32\_t        status;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01786}01786 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01787}01787                 \textcolor{comment}{/* Reading the ISR register clears all interrupts. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01788}01788                 status = \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_afe4d3bf547292dbf8a277dd3c6a016ec}{NGE\_ISR}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01789}01789 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01790}01790                 \textcolor{keywordflow}{if} ((status \& (\mbox{\hyperlink{if__ngereg_8h_a0d6bc0ee763baf89c855f7b3b9d452b3}{NGE\_ISR\_RX\_ERR}}|\mbox{\hyperlink{if__ngereg_8h_a9a45ef1c523b9e7539ccc2e155276188}{NGE\_ISR\_RX\_OFLOW}})) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01791}01791                         rx\_npkts += \mbox{\hyperlink{if__nge_8c_a5309c35e59df21a3a3102326fa57dae4}{nge\_rxeof}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01792}01792 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01793}01793                 \textcolor{keywordflow}{if} ((status \& \mbox{\hyperlink{if__ngereg_8h_a60b018f1d0a24e7a4aeeca47a71005ac}{NGE\_ISR\_RX\_IDLE}}) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01794}01794                         \mbox{\hyperlink{if__nge_8c_afcd425eed4d24b2afd9cda6a89330638}{NGE\_SETBIT}}(sc, \mbox{\hyperlink{if__ngereg_8h_a8530e5d23599fe33a65b74ad6021a800}{NGE\_CSR}}, \mbox{\hyperlink{if__ngereg_8h_a04be078304033bcc5fa709d4a8f0ee2a}{NGE\_CSR\_RX\_ENABLE}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01795}01795 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01796}01796                 \textcolor{keywordflow}{if} ((status \& \mbox{\hyperlink{if__ngereg_8h_a637793fee048f9f4c37ca76d199d802c}{NGE\_ISR\_SYSERR}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01797}01797                         ifp-\/>if\_drv\_flags \&= \string~IFF\_DRV\_RUNNING;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01798}01798                         \mbox{\hyperlink{if__nge_8c_aed2b3e36e09028db73bd888fd5c1e319}{nge\_init\_locked}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01799}01799                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01800}01800         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01801}01801         \mbox{\hyperlink{if__ngereg_8h_a384e888bfa48167ca9e46af78aaba7e7}{NGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01802}01802         \textcolor{keywordflow}{return} (rx\_npkts);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01803}01803 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01804}01804 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* DEVICE\_POLLING */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01805}01805 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01806}01806 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01807}\mbox{\hyperlink{if__nge_8c_ab76e53be9cb000caa8ecf984ccceeb6a}{01807}} \mbox{\hyperlink{if__nge_8c_ab76e53be9cb000caa8ecf984ccceeb6a}{nge\_intr}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01808}01808 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01809}01809         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01810}01810         \textcolor{keyword}{struct }ifnet *ifp;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01811}01811         uint32\_t status;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01812}01812 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01813}01813         sc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structnge__softc}{nge\_softc}} *)arg;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01814}01814         ifp = sc-\/>\mbox{\hyperlink{structnge__softc_ae1ee58f588347b47a3e046b13f030118}{nge\_ifp}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01815}01815 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01816}01816         \mbox{\hyperlink{if__ngereg_8h_ab99f47bf2cd630291194ae818035d11e}{NGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01817}01817 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01818}01818         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structnge__softc_ac84c514781515c9c5e2b88fc019e0265}{nge\_flags}} \& \mbox{\hyperlink{if__ngereg_8h_a6c91c6bb7a5a2ea60f98887cd8b7fb94}{NGE\_FLAG\_SUSPENDED}}) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01819}01819                 \textcolor{keywordflow}{goto} done\_locked;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01820}01820 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01821}01821         \textcolor{comment}{/* Reading the ISR register clears all interrupts. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01822}01822         status = \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_afe4d3bf547292dbf8a277dd3c6a016ec}{NGE\_ISR}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01823}01823         \textcolor{keywordflow}{if} (status == 0xffffffff || (status \& \mbox{\hyperlink{if__ngereg_8h_a97879c76e68d99a7de32ec0ef7784778}{NGE\_INTRS}}) == 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01824}01824                 \textcolor{keywordflow}{goto} done\_locked;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01825}01825 \textcolor{preprocessor}{\#ifdef DEVICE\_POLLING}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01826}01826         \textcolor{keywordflow}{if} ((ifp-\/>if\_capenable \& IFCAP\_POLLING) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01827}01827                 \textcolor{keywordflow}{goto} done\_locked;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01828}01828 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01829}01829         \textcolor{keywordflow}{if} ((ifp-\/>if\_drv\_flags \& IFF\_DRV\_RUNNING) == 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01830}01830                 \textcolor{keywordflow}{goto} done\_locked;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01831}01831 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01832}01832         \textcolor{comment}{/* Disable interrupts. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01833}01833         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_ab4e2598f55a5d6b4f98e98098e7e7884}{NGE\_IER}}, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01834}01834 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01835}01835         \textcolor{comment}{/* Data LED on for TBI mode */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01836}01836         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structnge__softc_ac84c514781515c9c5e2b88fc019e0265}{nge\_flags}} \& \mbox{\hyperlink{if__ngereg_8h_af0d3f50db685ea99ffd9abc9ec0b732c}{NGE\_FLAG\_TBI}}) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01837}01837                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a6ba1dafa838f31dd928f00b7378d3fd5}{NGE\_GPIO}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01838}01838                     \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a6ba1dafa838f31dd928f00b7378d3fd5}{NGE\_GPIO}}) | \mbox{\hyperlink{if__ngereg_8h_a1818b994ac9bc97a6720931f4fd320dc}{NGE\_GPIO\_GP3\_OUT}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01839}01839 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01840}01840         \textcolor{keywordflow}{for} (; (status \& \mbox{\hyperlink{if__ngereg_8h_a97879c76e68d99a7de32ec0ef7784778}{NGE\_INTRS}}) != 0;) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01841}01841                 \textcolor{keywordflow}{if} ((status \& (\mbox{\hyperlink{if__ngereg_8h_ac3d087748be36e3974c3bb0aea6b5c66}{NGE\_ISR\_TX\_DESC\_OK}} | \mbox{\hyperlink{if__ngereg_8h_aa4c0ecb6b47e7cdd779ee125542f2deb}{NGE\_ISR\_TX\_ERR}} |}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01842}01842                     \mbox{\hyperlink{if__ngereg_8h_a7ec10b7adf319a31542622fc961dccfb}{NGE\_ISR\_TX\_OK}} | \mbox{\hyperlink{if__ngereg_8h_a1de76683c072e1520d0725fb34520ce7}{NGE\_ISR\_TX\_IDLE}})) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01843}01843                         \mbox{\hyperlink{if__nge_8c_a63a556df379a487a1d56e4d32ad68456}{nge\_txeof}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01844}01844 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01845}01845                 \textcolor{keywordflow}{if} ((status \& (\mbox{\hyperlink{if__ngereg_8h_a9853f42851759e2a66384bd2108eef11}{NGE\_ISR\_RX\_DESC\_OK}} | \mbox{\hyperlink{if__ngereg_8h_a0d6bc0ee763baf89c855f7b3b9d452b3}{NGE\_ISR\_RX\_ERR}} |}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01846}01846                     \mbox{\hyperlink{if__ngereg_8h_a9a45ef1c523b9e7539ccc2e155276188}{NGE\_ISR\_RX\_OFLOW}} | \mbox{\hyperlink{if__ngereg_8h_adb99f86d3299166768e4e26e7f59f4c1}{NGE\_ISR\_RX\_FIFO\_OFLOW}} |}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01847}01847                     \mbox{\hyperlink{if__ngereg_8h_a60b018f1d0a24e7a4aeeca47a71005ac}{NGE\_ISR\_RX\_IDLE}} | \mbox{\hyperlink{if__ngereg_8h_acd2a47e1ee0aa038858e454834719e01}{NGE\_ISR\_RX\_OK}})) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01848}01848                         \mbox{\hyperlink{if__nge_8c_a5309c35e59df21a3a3102326fa57dae4}{nge\_rxeof}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01849}01849 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01850}01850                 \textcolor{keywordflow}{if} ((status \& \mbox{\hyperlink{if__ngereg_8h_a60b018f1d0a24e7a4aeeca47a71005ac}{NGE\_ISR\_RX\_IDLE}}) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01851}01851                         \mbox{\hyperlink{if__nge_8c_afcd425eed4d24b2afd9cda6a89330638}{NGE\_SETBIT}}(sc, \mbox{\hyperlink{if__ngereg_8h_a8530e5d23599fe33a65b74ad6021a800}{NGE\_CSR}}, \mbox{\hyperlink{if__ngereg_8h_a04be078304033bcc5fa709d4a8f0ee2a}{NGE\_CSR\_RX\_ENABLE}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01852}01852 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01853}01853                 \textcolor{keywordflow}{if} ((status \& \mbox{\hyperlink{if__ngereg_8h_a637793fee048f9f4c37ca76d199d802c}{NGE\_ISR\_SYSERR}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01854}01854                         ifp-\/>if\_drv\_flags \&= \string~IFF\_DRV\_RUNNING;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01855}01855                         \mbox{\hyperlink{if__nge_8c_aed2b3e36e09028db73bd888fd5c1e319}{nge\_init\_locked}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01856}01856                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01857}01857                 \textcolor{comment}{/* Reading the ISR register clears all interrupts. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01858}01858                 status = \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_afe4d3bf547292dbf8a277dd3c6a016ec}{NGE\_ISR}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01859}01859         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01860}01860 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01861}01861         \textcolor{comment}{/* Re-\/enable interrupts. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01862}01862         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_ab4e2598f55a5d6b4f98e98098e7e7884}{NGE\_IER}}, 1);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01863}01863 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01864}01864         \textcolor{keywordflow}{if} (!IFQ\_DRV\_IS\_EMPTY(\&ifp-\/>if\_snd))}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01865}01865                 \mbox{\hyperlink{if__nge_8c_ad2902445bf55cddca069c3162091c509}{nge\_start\_locked}}(ifp);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01866}01866 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01867}01867         \textcolor{comment}{/* Data LED off for TBI mode */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01868}01868         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structnge__softc_ac84c514781515c9c5e2b88fc019e0265}{nge\_flags}} \& \mbox{\hyperlink{if__ngereg_8h_af0d3f50db685ea99ffd9abc9ec0b732c}{NGE\_FLAG\_TBI}}) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01869}01869                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a6ba1dafa838f31dd928f00b7378d3fd5}{NGE\_GPIO}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01870}01870                     \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a6ba1dafa838f31dd928f00b7378d3fd5}{NGE\_GPIO}}) \& \string~\mbox{\hyperlink{if__ngereg_8h_a1818b994ac9bc97a6720931f4fd320dc}{NGE\_GPIO\_GP3\_OUT}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01871}01871 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01872}01872 done\_locked:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01873}01873         \mbox{\hyperlink{if__ngereg_8h_a384e888bfa48167ca9e46af78aaba7e7}{NGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01874}01874 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01875}01875 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01876}01876 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01877}01877 \textcolor{comment}{ * Encapsulate an mbuf chain in a descriptor by coupling the mbuf data}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01878}01878 \textcolor{comment}{ * pointers to the fragment pointers.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01879}01879 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01880}01880 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01881}\mbox{\hyperlink{if__nge_8c_ae03f77d2f2306164d24dc74e5c9de012}{01881}} \mbox{\hyperlink{if__nge_8c_ae03f77d2f2306164d24dc74e5c9de012}{nge\_encap}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc, \textcolor{keyword}{struct} mbuf **m\_head)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01882}01882 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01883}01883         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__txdesc}{nge\_txdesc}} *txd, *txd\_last;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01884}01884         \textcolor{keyword}{struct }\mbox{\hyperlink{if__ngereg_8h_a5443b6bb4002412f0ecc02023c715cde}{nge\_desc}} *desc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01885}01885         \textcolor{keyword}{struct }mbuf *m;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01886}01886         bus\_dmamap\_t map;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01887}01887         bus\_dma\_segment\_t txsegs[\mbox{\hyperlink{if__ngereg_8h_a62b09b1217c00212a9f12273528d38c2}{NGE\_MAXTXSEGS}}];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01888}01888         \textcolor{keywordtype}{int} error, i, nsegs, prod, si;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01889}01889 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01890}01890         \mbox{\hyperlink{if__ngereg_8h_aef7ce8bc258716f95755fd594bb3436e}{NGE\_LOCK\_ASSERT}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01891}01891 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01892}01892         m = *m\_head;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01893}01893         prod = sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a0f74e5f74f354debc69355b5f0f2bfbf}{nge\_tx\_prod}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01894}01894         txd = \&sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_ac62d7f895349014f6b56adde934fbb0a}{nge\_txdesc}}[prod];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01895}01895         txd\_last = txd;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01896}01896         map = txd-\/>\mbox{\hyperlink{structnge__txdesc_aa334e70e247f63d45bd94da3e631e79f}{tx\_dmamap}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01897}01897         error = bus\_dmamap\_load\_mbuf\_sg(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a6fc520951d327aa4be4f35f2dfa3f521}{nge\_tx\_tag}}, map,}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01898}01898             *m\_head, txsegs, \&nsegs, BUS\_DMA\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01899}01899         \textcolor{keywordflow}{if} (error == EFBIG) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01900}01900                 m = m\_collapse(*m\_head, M\_NOWAIT, \mbox{\hyperlink{if__ngereg_8h_a62b09b1217c00212a9f12273528d38c2}{NGE\_MAXTXSEGS}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01901}01901                 \textcolor{keywordflow}{if} (m == NULL) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01902}01902                         m\_freem(*m\_head);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01903}01903                         *m\_head = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01904}01904                         \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01905}01905                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01906}01906                 *m\_head = m;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01907}01907                 error = bus\_dmamap\_load\_mbuf\_sg(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a6fc520951d327aa4be4f35f2dfa3f521}{nge\_tx\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01908}01908                     map, *m\_head, txsegs, \&nsegs, BUS\_DMA\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01909}01909                 \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01910}01910                         m\_freem(*m\_head);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01911}01911                         *m\_head = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01912}01912                         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01913}01913                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01914}01914         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (error != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01915}01915                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01916}01916         \textcolor{keywordflow}{if} (nsegs == 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01917}01917                 m\_freem(*m\_head);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01918}01918                 *m\_head = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01919}01919                 \textcolor{keywordflow}{return} (EIO);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01920}01920         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01921}01921 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01922}01922         \textcolor{comment}{/* Check number of available descriptors. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01923}01923         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_af0cee28aac530bd098e997a179f3f058}{nge\_tx\_cnt}} + nsegs >= (\mbox{\hyperlink{if__ngereg_8h_a2c640f4df126d566325ac35549986d2d}{NGE\_TX\_RING\_CNT}} -\/ 1)) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01924}01924                 bus\_dmamap\_unload(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a6fc520951d327aa4be4f35f2dfa3f521}{nge\_tx\_tag}}, map);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01925}01925                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01926}01926         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01927}01927 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01928}01928         bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a6fc520951d327aa4be4f35f2dfa3f521}{nge\_tx\_tag}}, map, BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01929}01929 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01930}01930         si = prod;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01931}01931         \textcolor{keywordflow}{for} (i = 0; i < nsegs; i++) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01932}01932                 desc = \&sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_ad0d36c434e96d681af75191422afad1f}{nge\_tx\_ring}}[prod];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01933}01933                 desc-\/>nge\_ptr = htole32(\mbox{\hyperlink{if__ngereg_8h_a11c2f0eb778450088fe042ea7ddc75d6}{NGE\_ADDR\_LO}}(txsegs[i].ds\_addr));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01934}01934                 \textcolor{keywordflow}{if} (i == 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01935}01935                         desc-\/>nge\_cmdsts = htole32(txsegs[i].ds\_len |}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01936}01936                             \mbox{\hyperlink{if__ngereg_8h_a65b612af8682c1bcd543b6080c2ed8de}{NGE\_CMDSTS\_MORE}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01937}01937                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01938}01938                         desc-\/>nge\_cmdsts = htole32(txsegs[i].ds\_len |}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01939}01939                             \mbox{\hyperlink{if__ngereg_8h_a65b612af8682c1bcd543b6080c2ed8de}{NGE\_CMDSTS\_MORE}} | \mbox{\hyperlink{if__ngereg_8h_a094d1b80ade11fcaed8bba3ac526bc86}{NGE\_CMDSTS\_OWN}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01940}01940                 desc-\/>nge\_extsts = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01941}01941                 sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_af0cee28aac530bd098e997a179f3f058}{nge\_tx\_cnt}}++;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01942}01942                 \mbox{\hyperlink{if__ngereg_8h_a786e8c0f287d06095ed6f4783807db22}{NGE\_INC}}(prod, \mbox{\hyperlink{if__ngereg_8h_a2c640f4df126d566325ac35549986d2d}{NGE\_TX\_RING\_CNT}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01943}01943         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01944}01944         \textcolor{comment}{/* Update producer index. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01945}01945         sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a0f74e5f74f354debc69355b5f0f2bfbf}{nge\_tx\_prod}} = prod;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01946}01946 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01947}01947         prod = (prod + \mbox{\hyperlink{if__ngereg_8h_a2c640f4df126d566325ac35549986d2d}{NGE\_TX\_RING\_CNT}} -\/ 1) \% \mbox{\hyperlink{if__ngereg_8h_a2c640f4df126d566325ac35549986d2d}{NGE\_TX\_RING\_CNT}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01948}01948         desc = \&sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_ad0d36c434e96d681af75191422afad1f}{nge\_tx\_ring}}[prod];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01949}01949         \textcolor{comment}{/* Check if we have a VLAN tag to insert. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01950}01950         \textcolor{keywordflow}{if} ((m-\/>m\_flags \& M\_VLANTAG) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01951}01951                 desc-\/>nge\_extsts |= htole32(\mbox{\hyperlink{if__ngereg_8h_a7138b817e553d343079a5e338fa27bfb}{NGE\_TXEXTSTS\_VLANPKT}} |}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01952}01952                     bswap16(m-\/>m\_pkthdr.ether\_vtag));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01953}01953         \textcolor{comment}{/* Set EOP on the last descriptor. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01954}01954         desc-\/>nge\_cmdsts \&= htole32(\string~\mbox{\hyperlink{if__ngereg_8h_a65b612af8682c1bcd543b6080c2ed8de}{NGE\_CMDSTS\_MORE}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01955}01955 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01956}01956         \textcolor{comment}{/* Set checksum offload in the first descriptor. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01957}01957         desc = \&sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_ad0d36c434e96d681af75191422afad1f}{nge\_tx\_ring}}[si];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01958}01958         \textcolor{keywordflow}{if} ((m-\/>m\_pkthdr.csum\_flags \& \mbox{\hyperlink{if__nge_8c_acb062d853343d9f1617f1fdbb74f2a04}{NGE\_CSUM\_FEATURES}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01959}01959                 \textcolor{keywordflow}{if} ((m-\/>m\_pkthdr.csum\_flags \& CSUM\_IP) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01960}01960                         desc-\/>nge\_extsts |= htole32(\mbox{\hyperlink{if__ngereg_8h_a668feb3e8221a0549132193eb36b48ce}{NGE\_TXEXTSTS\_IPCSUM}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01961}01961                 \textcolor{keywordflow}{if} ((m-\/>m\_pkthdr.csum\_flags \& CSUM\_TCP) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01962}01962                         desc-\/>nge\_extsts |= htole32(\mbox{\hyperlink{if__ngereg_8h_a1212f6d78e6372466ed6ee1c344a6d60}{NGE\_TXEXTSTS\_TCPCSUM}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01963}01963                 \textcolor{keywordflow}{if} ((m-\/>m\_pkthdr.csum\_flags \& CSUM\_UDP) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01964}01964                         desc-\/>nge\_extsts |= htole32(\mbox{\hyperlink{if__ngereg_8h_a09f41394ea95a786fb2bc98f35702682}{NGE\_TXEXTSTS\_UDPCSUM}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01965}01965         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01966}01966         \textcolor{comment}{/* Lastly, turn the first descriptor ownership to hardware. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01967}01967         desc-\/>nge\_cmdsts |= htole32(\mbox{\hyperlink{if__ngereg_8h_a094d1b80ade11fcaed8bba3ac526bc86}{NGE\_CMDSTS\_OWN}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01968}01968 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01969}01969         txd = \&sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_ac62d7f895349014f6b56adde934fbb0a}{nge\_txdesc}}[prod];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01970}01970         map = txd\_last-\/>\mbox{\hyperlink{structnge__txdesc_aa334e70e247f63d45bd94da3e631e79f}{tx\_dmamap}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01971}01971         txd\_last-\/>\mbox{\hyperlink{structnge__txdesc_aa334e70e247f63d45bd94da3e631e79f}{tx\_dmamap}} = txd-\/>\mbox{\hyperlink{structnge__txdesc_aa334e70e247f63d45bd94da3e631e79f}{tx\_dmamap}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01972}01972         txd-\/>\mbox{\hyperlink{structnge__txdesc_aa334e70e247f63d45bd94da3e631e79f}{tx\_dmamap}} = map;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01973}01973         txd-\/>\mbox{\hyperlink{structnge__txdesc_ac0980a7537bb5a6c403c3d89ec58663b}{tx\_m}} = m;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01974}01974 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01975}01975         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01976}01976 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01977}01977 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01978}01978 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01979}01979 \textcolor{comment}{ * Main transmit routine. To avoid having to do mbuf copies, we put pointers}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01980}01980 \textcolor{comment}{ * to the mbuf data regions directly in the transmit lists. We also save a}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01981}01981 \textcolor{comment}{ * copy of the pointers since the transmit list fragment pointers are}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01982}01982 \textcolor{comment}{ * physical addresses.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01983}01983 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01984}01984 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01985}01985 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01986}\mbox{\hyperlink{if__nge_8c_a58ca32a784c2a1aa0bce3c94337c1a32}{01986}} \mbox{\hyperlink{if__nge_8c_a58ca32a784c2a1aa0bce3c94337c1a32}{nge\_start}}(\textcolor{keyword}{struct} ifnet *ifp)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01987}01987 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01988}01988         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01989}01989 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01990}01990         sc = ifp-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01991}01991         \mbox{\hyperlink{if__ngereg_8h_ab99f47bf2cd630291194ae818035d11e}{NGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01992}01992         \mbox{\hyperlink{if__nge_8c_ad2902445bf55cddca069c3162091c509}{nge\_start\_locked}}(ifp);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01993}01993         \mbox{\hyperlink{if__ngereg_8h_a384e888bfa48167ca9e46af78aaba7e7}{NGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01994}01994 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01995}01995 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01996}01996 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01997}\mbox{\hyperlink{if__nge_8c_ad2902445bf55cddca069c3162091c509}{01997}} \mbox{\hyperlink{if__nge_8c_ad2902445bf55cddca069c3162091c509}{nge\_start\_locked}}(\textcolor{keyword}{struct} ifnet *ifp)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01998}01998 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l01999}01999         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02000}02000         \textcolor{keyword}{struct }mbuf *m\_head;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02001}02001         \textcolor{keywordtype}{int} enq;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02002}02002 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02003}02003         sc = ifp-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02004}02004 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02005}02005         \mbox{\hyperlink{if__ngereg_8h_aef7ce8bc258716f95755fd594bb3436e}{NGE\_LOCK\_ASSERT}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02006}02006 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02007}02007         \textcolor{keywordflow}{if} ((ifp-\/>if\_drv\_flags \& (IFF\_DRV\_RUNNING | IFF\_DRV\_OACTIVE)) !=}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02008}02008             IFF\_DRV\_RUNNING || (sc-\/>\mbox{\hyperlink{structnge__softc_ac84c514781515c9c5e2b88fc019e0265}{nge\_flags}} \& \mbox{\hyperlink{if__ngereg_8h_a404d97bcfec9925bde7d065cb2c82074}{NGE\_FLAG\_LINK}}) == 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02009}02009                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02010}02010 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02011}02011         \textcolor{keywordflow}{for} (enq = 0; !IFQ\_DRV\_IS\_EMPTY(\&ifp-\/>if\_snd) \&\&}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02012}02012             sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_af0cee28aac530bd098e997a179f3f058}{nge\_tx\_cnt}} < \mbox{\hyperlink{if__ngereg_8h_a2c640f4df126d566325ac35549986d2d}{NGE\_TX\_RING\_CNT}} -\/ 2; ) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02013}02013                 IFQ\_DRV\_DEQUEUE(\&ifp-\/>if\_snd, m\_head);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02014}02014                 \textcolor{keywordflow}{if} (m\_head == NULL)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02015}02015                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02016}02016                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02017}02017 \textcolor{comment}{                 * Pack the data into the transmit ring. If we}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02018}02018 \textcolor{comment}{                 * don't have room, set the OACTIVE flag and wait}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02019}02019 \textcolor{comment}{                 * for the NIC to drain the ring.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02020}02020 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02021}02021                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__nge_8c_ae03f77d2f2306164d24dc74e5c9de012}{nge\_encap}}(sc, \&m\_head)) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02022}02022                         \textcolor{keywordflow}{if} (m\_head == NULL)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02023}02023                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02024}02024                         IFQ\_DRV\_PREPEND(\&ifp-\/>if\_snd, m\_head);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02025}02025                         ifp-\/>if\_drv\_flags |= IFF\_DRV\_OACTIVE;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02026}02026                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02027}02027                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02028}02028 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02029}02029                 enq++;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02030}02030                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02031}02031 \textcolor{comment}{                 * If there's a BPF listener, bounce a copy of this frame}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02032}02032 \textcolor{comment}{                 * to him.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02033}02033 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02034}02034                 ETHER\_BPF\_MTAP(ifp, m\_head);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02035}02035         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02036}02036 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02037}02037         \textcolor{keywordflow}{if} (enq > 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02038}02038                 bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_acf30833820602cf7e1dc430f8cc3b35d}{nge\_tx\_ring\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02039}02039                     sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a2265d4ebec9fc83f9d65b2e5fa524b86}{nge\_tx\_ring\_map}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02040}02040                     BUS\_DMASYNC\_PREREAD | BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02041}02041                 \textcolor{comment}{/* Transmit */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02042}02042                 \mbox{\hyperlink{if__nge_8c_afcd425eed4d24b2afd9cda6a89330638}{NGE\_SETBIT}}(sc, \mbox{\hyperlink{if__ngereg_8h_a8530e5d23599fe33a65b74ad6021a800}{NGE\_CSR}}, \mbox{\hyperlink{if__ngereg_8h_a7f0eabb31f64e0f69e9b0be81f865b65}{NGE\_CSR\_TX\_ENABLE}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02043}02043 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02044}02044                 \textcolor{comment}{/* Set a timeout in case the chip goes out to lunch. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02045}02045                 sc-\/>\mbox{\hyperlink{structnge__softc_a903985ea3957a7bff8dca0f1861fcc29}{nge\_watchdog\_timer}} = 5;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02046}02046         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02047}02047 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02048}02048 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02049}02049 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02050}\mbox{\hyperlink{if__nge_8c_a4ea95c1fa3aa6d1651aed6334ce2992e}{02050}} \mbox{\hyperlink{if__nge_8c_a4ea95c1fa3aa6d1651aed6334ce2992e}{nge\_init}}(\textcolor{keywordtype}{void} *xsc)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02051}02051 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02052}02052         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc = xsc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02053}02053 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02054}02054         \mbox{\hyperlink{if__ngereg_8h_ab99f47bf2cd630291194ae818035d11e}{NGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02055}02055         \mbox{\hyperlink{if__nge_8c_aed2b3e36e09028db73bd888fd5c1e319}{nge\_init\_locked}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02056}02056         \mbox{\hyperlink{if__ngereg_8h_a384e888bfa48167ca9e46af78aaba7e7}{NGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02057}02057 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02058}02058 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02059}02059 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02060}\mbox{\hyperlink{if__nge_8c_aed2b3e36e09028db73bd888fd5c1e319}{02060}} \mbox{\hyperlink{if__nge_8c_aed2b3e36e09028db73bd888fd5c1e319}{nge\_init\_locked}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02061}02061 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02062}02062         \textcolor{keyword}{struct }ifnet *ifp = sc-\/>\mbox{\hyperlink{structnge__softc_ae1ee58f588347b47a3e046b13f030118}{nge\_ifp}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02063}02063         \textcolor{keyword}{struct }mii\_data *mii;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02064}02064         uint8\_t *eaddr;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02065}02065         uint32\_t reg;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02066}02066 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02067}02067         \mbox{\hyperlink{if__ngereg_8h_aef7ce8bc258716f95755fd594bb3436e}{NGE\_LOCK\_ASSERT}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02068}02068 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02069}02069         \textcolor{keywordflow}{if} ((ifp-\/>if\_drv\_flags \& IFF\_DRV\_RUNNING) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02070}02070                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02071}02071 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02072}02072         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02073}02073 \textcolor{comment}{         * Cancel pending I/O and free all RX/TX buffers.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02074}02074 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02075}02075         \mbox{\hyperlink{if__nge_8c_a5f1c4f9e585d5f34ebe3b81d687ebb2a}{nge\_stop}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02076}02076 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02077}02077         \textcolor{comment}{/* Reset the adapter. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02078}02078         \mbox{\hyperlink{if__nge_8c_a3f9235356d0ca17f235a12160244e2cf}{nge\_reset}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02079}02079 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02080}02080         \textcolor{comment}{/* Disable Rx filter prior to programming Rx filter. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02081}02081         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a73cd220d86eb40f5b5cd1207566773ca}{NGE\_RXFILT\_CTL}}, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02082}02082         \mbox{\hyperlink{if__ngereg_8h_a8d0df18248ed8e804a14eecc559d53bc}{CSR\_BARRIER\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a73cd220d86eb40f5b5cd1207566773ca}{NGE\_RXFILT\_CTL}}, BUS\_SPACE\_BARRIER\_WRITE);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02083}02083 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02084}02084         mii = device\_get\_softc(sc-\/>\mbox{\hyperlink{structnge__softc_a0c48586b5276b5d260cf1d0f606eef32}{nge\_miibus}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02085}02085 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02086}02086         \textcolor{comment}{/* Set MAC address. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02087}02087         eaddr = IF\_LLADDR(sc-\/>\mbox{\hyperlink{structnge__softc_ae1ee58f588347b47a3e046b13f030118}{nge\_ifp}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02088}02088         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a73cd220d86eb40f5b5cd1207566773ca}{NGE\_RXFILT\_CTL}}, \mbox{\hyperlink{if__ngereg_8h_af75e8f804dfc9fd465486da49a75de59}{NGE\_FILTADDR\_PAR0}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02089}02089         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a2ea72629c303ee542882806965bcfbb3}{NGE\_RXFILT\_DATA}}, (eaddr[1] << 8) | eaddr[0]);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02090}02090         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a73cd220d86eb40f5b5cd1207566773ca}{NGE\_RXFILT\_CTL}}, \mbox{\hyperlink{if__ngereg_8h_aa61638ca0de41315a022bec591c0710d}{NGE\_FILTADDR\_PAR1}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02091}02091         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a2ea72629c303ee542882806965bcfbb3}{NGE\_RXFILT\_DATA}}, (eaddr[3] << 8) | eaddr[2]);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02092}02092         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a73cd220d86eb40f5b5cd1207566773ca}{NGE\_RXFILT\_CTL}}, \mbox{\hyperlink{if__ngereg_8h_a8c72ea23f035f29412139fe7f7bbd527}{NGE\_FILTADDR\_PAR2}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02093}02093         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a2ea72629c303ee542882806965bcfbb3}{NGE\_RXFILT\_DATA}}, (eaddr[5] << 8) | eaddr[4]);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02094}02094 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02095}02095         \textcolor{comment}{/* Init circular RX list. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02096}02096         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__nge_8c_ae0edbc751498d6811dcc66af5765c8f3}{nge\_list\_rx\_init}}(sc) == ENOBUFS) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02097}02097                 device\_printf(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}}, \textcolor{stringliteral}{"{}initialization failed: no "{}}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02098}02098                         \textcolor{stringliteral}{"{}memory for rx buffers\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02099}02099                 \mbox{\hyperlink{if__nge_8c_a5f1c4f9e585d5f34ebe3b81d687ebb2a}{nge\_stop}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02100}02100                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02101}02101         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02102}02102 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02103}02103         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02104}02104 \textcolor{comment}{         * Init tx descriptors.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02105}02105 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02106}02106         \mbox{\hyperlink{if__nge_8c_ab387b6fe058d481d4c54f5200bef2abc}{nge\_list\_tx\_init}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02107}02107 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02108}02108         \textcolor{comment}{/* Set Rx filter. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02109}02109         \mbox{\hyperlink{if__nge_8c_a04894fa150ac70b234baaaef57930c47}{nge\_rxfilter}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02110}02110 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02111}02111         \textcolor{comment}{/* Disable PRIQ ctl. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02112}02112         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a637e16546a6d0cdf4d2438cdbd5c25a3}{NGE\_PRIOQCTL}}, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02113}02113 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02114}02114         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02115}02115 \textcolor{comment}{         * Set pause frames parameters.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02116}02116 \textcolor{comment}{         *  Rx stat FIFO hi-\/threshold : 2 or more packets}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02117}02117 \textcolor{comment}{         *  Rx stat FIFO lo-\/threshold : less than 2 packets}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02118}02118 \textcolor{comment}{         *  Rx data FIFO hi-\/threshold : 2K or more bytes}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02119}02119 \textcolor{comment}{         *  Rx data FIFO lo-\/threshold : less than 2K bytes}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02120}02120 \textcolor{comment}{         *  pause time : (512ns * 0xffff) -\/> 33.55ms}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02121}02121 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02122}02122         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_adde29edad5e57b2f2bc72c4875073d4a}{NGE\_PAUSECSR}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02123}02123             \mbox{\hyperlink{if__ngereg_8h_a393b50f93431ea8e2d66396426e8f170}{NGE\_PAUSECSR\_PAUSE\_ON\_MCAST}} |}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02124}02124             \mbox{\hyperlink{if__ngereg_8h_a8c81ab2a96e1f0d8bf8c32c14f6104cd}{NGE\_PAUSECSR\_PAUSE\_ON\_DA}} |}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02125}02125             ((1 << 24) \& \mbox{\hyperlink{if__ngereg_8h_aa55900faa5e1d1b3fe8831793bb51a15}{NGE\_PAUSECSR\_RX\_STATFIFO\_THR\_HI}}) |}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02126}02126             ((1 << 22) \& \mbox{\hyperlink{if__ngereg_8h_ab61dc6399a60aa25beaa0e9820225140}{NGE\_PAUSECSR\_RX\_STATFIFO\_THR\_LO}}) |}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02127}02127             ((1 << 20) \& \mbox{\hyperlink{if__ngereg_8h_a3e8c4c7b3f4788a1dd47376bda894457}{NGE\_PAUSECSR\_RX\_DATAFIFO\_THR\_HI}}) |}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02128}02128             ((1 << 18) \& \mbox{\hyperlink{if__ngereg_8h_a186d67cc7d9b3fc620ec08527b27414f}{NGE\_PAUSECSR\_RX\_DATAFIFO\_THR\_LO}}) |}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02129}02129             \mbox{\hyperlink{if__ngereg_8h_a79e2712ad5c3e77453dcc6028784d3e6}{NGE\_PAUSECSR\_CNT}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02130}02130 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02131}02131         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02132}02132 \textcolor{comment}{         * Load the address of the RX and TX lists.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02133}02133 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02134}02134         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_acd52accb036d8c3a86b6105e6b7d68c3}{NGE\_RX\_LISTPTR\_HI}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02135}02135             \mbox{\hyperlink{if__ngereg_8h_a76cf84764e0c48e78af63c526c5cdd38}{NGE\_ADDR\_HI}}(sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_ab414dc2a3256f10bf3100df2dfdb05b5}{nge\_rx\_ring\_paddr}}));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02136}02136         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_aeed8215557134f0e0966dea56b095032}{NGE\_RX\_LISTPTR\_LO}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02137}02137             \mbox{\hyperlink{if__ngereg_8h_a11c2f0eb778450088fe042ea7ddc75d6}{NGE\_ADDR\_LO}}(sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_ab414dc2a3256f10bf3100df2dfdb05b5}{nge\_rx\_ring\_paddr}}));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02138}02138         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a960467752f638054b1c0d04c6d1e93a8}{NGE\_TX\_LISTPTR\_HI}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02139}02139             \mbox{\hyperlink{if__ngereg_8h_a76cf84764e0c48e78af63c526c5cdd38}{NGE\_ADDR\_HI}}(sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_aca7b49c4d17ad5be83cbd9f6dcf9616a}{nge\_tx\_ring\_paddr}}));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02140}02140         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a67c004d61b464b8b92f41b6efef771d9}{NGE\_TX\_LISTPTR\_LO}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02141}02141             \mbox{\hyperlink{if__ngereg_8h_a11c2f0eb778450088fe042ea7ddc75d6}{NGE\_ADDR\_LO}}(sc-\/>\mbox{\hyperlink{structnge__softc_a60b41cad1580b806f62ea6470855f9ac}{nge\_rdata}}.\mbox{\hyperlink{structnge__ring__data_aca7b49c4d17ad5be83cbd9f6dcf9616a}{nge\_tx\_ring\_paddr}}));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02142}02142 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02143}02143         \textcolor{comment}{/* Set RX configuration. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02144}02144         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a7f1364697aacd7581353641ca9a651b2}{NGE\_RX\_CFG}}, \mbox{\hyperlink{if__ngereg_8h_a127af42f5dcd0f79f6f6f018f8cae74a}{NGE\_RXCFG}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02145}02145 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02146}02146         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a34e66e74f72b83e110c198c252b9d937}{NGE\_VLAN\_IP\_RXCTL}}, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02147}02147         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02148}02148 \textcolor{comment}{         * Enable hardware checksum validation for all IPv4}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02149}02149 \textcolor{comment}{         * packets, do not reject packets with bad checksums.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02150}02150 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02151}02151         \textcolor{keywordflow}{if} ((ifp-\/>if\_capenable \& IFCAP\_RXCSUM) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02152}02152                 \mbox{\hyperlink{if__nge_8c_afcd425eed4d24b2afd9cda6a89330638}{NGE\_SETBIT}}(sc, \mbox{\hyperlink{if__ngereg_8h_a34e66e74f72b83e110c198c252b9d937}{NGE\_VLAN\_IP\_RXCTL}}, \mbox{\hyperlink{if__ngereg_8h_a45842c45c2dda1d7e9ff46b1a2077906}{NGE\_VIPRXCTL\_IPCSUM\_ENB}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02153}02153 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02154}02154         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02155}02155 \textcolor{comment}{         * Tell the chip to detect and strip VLAN tag info from}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02156}02156 \textcolor{comment}{         * received frames. The tag will be provided in the extsts}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02157}02157 \textcolor{comment}{         * field in the RX descriptors.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02158}02158 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02159}02159         \mbox{\hyperlink{if__nge_8c_afcd425eed4d24b2afd9cda6a89330638}{NGE\_SETBIT}}(sc, \mbox{\hyperlink{if__ngereg_8h_a34e66e74f72b83e110c198c252b9d937}{NGE\_VLAN\_IP\_RXCTL}}, \mbox{\hyperlink{if__ngereg_8h_ab9b39565c4d2ddf0df62dd9b5200f1f6}{NGE\_VIPRXCTL\_TAG\_DETECT\_ENB}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02160}02160         \textcolor{keywordflow}{if} ((ifp-\/>if\_capenable \& IFCAP\_VLAN\_HWTAGGING) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02161}02161                 \mbox{\hyperlink{if__nge_8c_afcd425eed4d24b2afd9cda6a89330638}{NGE\_SETBIT}}(sc, \mbox{\hyperlink{if__ngereg_8h_a34e66e74f72b83e110c198c252b9d937}{NGE\_VLAN\_IP\_RXCTL}}, \mbox{\hyperlink{if__ngereg_8h_adb33d8080d6f2ede7e6d5b0d0900ce0b}{NGE\_VIPRXCTL\_TAG\_STRIP\_ENB}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02162}02162 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02163}02163         \textcolor{comment}{/* Set TX configuration. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02164}02164         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_ac03f73cf6606d3cd310b9f3a94dc5818}{NGE\_TX\_CFG}}, \mbox{\hyperlink{if__ngereg_8h_ad023d4478469b345501d776eb6f8896d}{NGE\_TXCFG}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02165}02165 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02166}02166         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02167}02167 \textcolor{comment}{         * Enable TX IPv4 checksumming on a per-\/packet basis.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02168}02168 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02169}02169         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_ae24834123f29fd32da5ac355f0ce2d04}{NGE\_VLAN\_IP\_TXCTL}}, \mbox{\hyperlink{if__ngereg_8h_a804cb582c65cef9e2fc6b364648c5d58}{NGE\_VIPTXCTL\_CSUM\_PER\_PKT}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02170}02170 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02171}02171         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02172}02172 \textcolor{comment}{         * Tell the chip to insert VLAN tags on a per-\/packet basis as}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02173}02173 \textcolor{comment}{         * dictated by the code in the frame encapsulation routine.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02174}02174 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02175}02175         \mbox{\hyperlink{if__nge_8c_afcd425eed4d24b2afd9cda6a89330638}{NGE\_SETBIT}}(sc, \mbox{\hyperlink{if__ngereg_8h_ae24834123f29fd32da5ac355f0ce2d04}{NGE\_VLAN\_IP\_TXCTL}}, \mbox{\hyperlink{if__ngereg_8h_a5dc91b90b4ccb8a1961acf20c4838bda}{NGE\_VIPTXCTL\_TAG\_PER\_PKT}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02176}02176 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02177}02177         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02178}02178 \textcolor{comment}{         * Enable the delivery of PHY interrupts based on}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02179}02179 \textcolor{comment}{         * link/speed/duplex status changes. Also enable the}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02180}02180 \textcolor{comment}{         * extsts field in the DMA descriptors (needed for}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02181}02181 \textcolor{comment}{         * TCP/IP checksum offload on transmit).}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02182}02182 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02183}02183         \mbox{\hyperlink{if__nge_8c_afcd425eed4d24b2afd9cda6a89330638}{NGE\_SETBIT}}(sc, \mbox{\hyperlink{if__ngereg_8h_a380ea42fdd5fb3f8186c9fe7a2f410e5}{NGE\_CFG}}, \mbox{\hyperlink{if__ngereg_8h_acd7538c90d6e1dcb68137962f583bb4f}{NGE\_CFG\_PHYINTR\_SPD}} |}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02184}02184             \mbox{\hyperlink{if__ngereg_8h_a90f8d6252288d8297f2805999ebc37eb}{NGE\_CFG\_PHYINTR\_LNK}} | \mbox{\hyperlink{if__ngereg_8h_a3fc0fa6e940c3d26996d0be6d6e5b7de}{NGE\_CFG\_PHYINTR\_DUP}} | \mbox{\hyperlink{if__ngereg_8h_a7cad05c9a98837fecb619175699b348f}{NGE\_CFG\_EXTSTS\_ENB}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02185}02185 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02186}02186         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02187}02187 \textcolor{comment}{         * Configure interrupt holdoff (moderation). We can}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02188}02188 \textcolor{comment}{         * have the chip delay interrupt delivery for a certain}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02189}02189 \textcolor{comment}{         * period. Units are in 100us, and the max setting}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02190}02190 \textcolor{comment}{         * is 25500us (0xFF x 100us). Default is a 100us holdoff.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02191}02191 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02192}02192         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_af95317ac25f4f919199a2bc4c66b73ce}{NGE\_IHR}}, sc-\/>\mbox{\hyperlink{structnge__softc_ac79661bdc6e3d7d905cd7b9b799a5e82}{nge\_int\_holdoff}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02193}02193 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02194}02194         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02195}02195 \textcolor{comment}{         * Enable MAC statistics counters and clear.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02196}02196 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02197}02197         reg = \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a335b56e829494baa5ac7c735f25861b7}{NGE\_MIBCTL}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02198}02198         reg \&= \string~NGE\_MIBCTL\_FREEZE\_CNT;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02199}02199         reg |= \mbox{\hyperlink{if__ngereg_8h_a14e45fa1168e7bf7085cea3708c9307f}{NGE\_MIBCTL\_CLEAR\_CNT}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02200}02200         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a335b56e829494baa5ac7c735f25861b7}{NGE\_MIBCTL}}, reg);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02201}02201 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02202}02202         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02203}02203 \textcolor{comment}{         * Enable interrupts.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02204}02204 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02205}02205         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a7135ba5a59aa88b6f57e30777f09af5d}{NGE\_IMR}}, \mbox{\hyperlink{if__ngereg_8h_a97879c76e68d99a7de32ec0ef7784778}{NGE\_INTRS}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02206}02206 \textcolor{preprocessor}{\#ifdef DEVICE\_POLLING}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02207}02207         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02208}02208 \textcolor{comment}{         * ... only enable interrupts if we are not polling, make sure}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02209}02209 \textcolor{comment}{         * they are off otherwise.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02210}02210 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02211}02211         \textcolor{keywordflow}{if} ((ifp-\/>if\_capenable \& IFCAP\_POLLING) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02212}02212                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_ab4e2598f55a5d6b4f98e98098e7e7884}{NGE\_IER}}, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02213}02213         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02214}02214 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02215}02215         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_ab4e2598f55a5d6b4f98e98098e7e7884}{NGE\_IER}}, 1);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02216}02216 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02217}02217         sc-\/>\mbox{\hyperlink{structnge__softc_ac84c514781515c9c5e2b88fc019e0265}{nge\_flags}} \&= \string~NGE\_FLAG\_LINK;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02218}02218         mii\_mediachg(mii);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02219}02219 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02220}02220         sc-\/>\mbox{\hyperlink{structnge__softc_a903985ea3957a7bff8dca0f1861fcc29}{nge\_watchdog\_timer}} = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02221}02221         callout\_reset(\&sc-\/>\mbox{\hyperlink{structnge__softc_abd2b1bd8b840edd031917b2f3da8243e}{nge\_stat\_ch}}, hz, \mbox{\hyperlink{if__nge_8c_a984c6c5051e1134e2dc69da61389b087}{nge\_tick}}, sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02222}02222 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02223}02223         ifp-\/>if\_drv\_flags |= IFF\_DRV\_RUNNING;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02224}02224         ifp-\/>if\_drv\_flags \&= \string~IFF\_DRV\_OACTIVE;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02225}02225 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02226}02226 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02227}02227 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02228}02228 \textcolor{comment}{ * Set media options.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02229}02229 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02230}02230 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02231}\mbox{\hyperlink{if__nge_8c_a8ad2990142595a47f4c54ba6b5b09550}{02231}} \mbox{\hyperlink{if__nge_8c_a8ad2990142595a47f4c54ba6b5b09550}{nge\_mediachange}}(\textcolor{keyword}{struct} ifnet *ifp)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02232}02232 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02233}02233         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02234}02234         \textcolor{keyword}{struct }mii\_data *mii;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02235}02235         \textcolor{keyword}{struct }mii\_softc *miisc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02236}02236         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02237}02237 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02238}02238         sc = ifp-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02239}02239         \mbox{\hyperlink{if__ngereg_8h_ab99f47bf2cd630291194ae818035d11e}{NGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02240}02240         mii = device\_get\_softc(sc-\/>\mbox{\hyperlink{structnge__softc_a0c48586b5276b5d260cf1d0f606eef32}{nge\_miibus}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02241}02241         LIST\_FOREACH(miisc, \&mii-\/>mii\_phys, mii\_list)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02242}02242                 PHY\_RESET(miisc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02243}02243         error = mii\_mediachg(mii);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02244}02244         \mbox{\hyperlink{if__ngereg_8h_a384e888bfa48167ca9e46af78aaba7e7}{NGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02245}02245 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02246}02246         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02247}02247 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02248}02248 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02249}02249 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02250}02250 \textcolor{comment}{ * Report current media status.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02251}02251 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02252}02252 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02253}\mbox{\hyperlink{if__nge_8c_acbf31a34c95e5695e3548513ce7c058a}{02253}} \mbox{\hyperlink{if__nge_8c_acbf31a34c95e5695e3548513ce7c058a}{nge\_mediastatus}}(\textcolor{keyword}{struct} ifnet *ifp, \textcolor{keyword}{struct} ifmediareq *ifmr)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02254}02254 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02255}02255         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02256}02256         \textcolor{keyword}{struct }mii\_data *mii;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02257}02257 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02258}02258         sc = ifp-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02259}02259         \mbox{\hyperlink{if__ngereg_8h_ab99f47bf2cd630291194ae818035d11e}{NGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02260}02260         mii = device\_get\_softc(sc-\/>\mbox{\hyperlink{structnge__softc_a0c48586b5276b5d260cf1d0f606eef32}{nge\_miibus}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02261}02261         mii\_pollstat(mii);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02262}02262         ifmr-\/>ifm\_active = mii-\/>mii\_media\_active;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02263}02263         ifmr-\/>ifm\_status = mii-\/>mii\_media\_status;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02264}02264         \mbox{\hyperlink{if__ngereg_8h_a384e888bfa48167ca9e46af78aaba7e7}{NGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02265}02265 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02266}02266 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02267}02267 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02268}\mbox{\hyperlink{if__nge_8c_a6bd790902a685f581517fb7998d13a6f}{02268}} \mbox{\hyperlink{if__nge_8c_a6bd790902a685f581517fb7998d13a6f}{nge\_ioctl}}(\textcolor{keyword}{struct} ifnet *ifp, u\_long command, caddr\_t data)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02269}02269 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02270}02270         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc = ifp-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02271}02271         \textcolor{keyword}{struct }ifreq *ifr = (\textcolor{keyword}{struct }ifreq *) data;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02272}02272         \textcolor{keyword}{struct }mii\_data *mii;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02273}02273         \textcolor{keywordtype}{int} error = 0, mask;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02274}02274 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02275}02275         \textcolor{keywordflow}{switch} (command) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02276}02276         \textcolor{keywordflow}{case} SIOCSIFMTU:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02277}02277                 \textcolor{keywordflow}{if} (ifr-\/>ifr\_mtu < ETHERMIN || ifr-\/>ifr\_mtu > \mbox{\hyperlink{if__ngereg_8h_ac7ae961f41045c2fd7ee1eb518f7f087}{NGE\_JUMBO\_MTU}})}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02278}02278                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02279}02279                 \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02280}02280                         \mbox{\hyperlink{if__ngereg_8h_ab99f47bf2cd630291194ae818035d11e}{NGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02281}02281                         ifp-\/>if\_mtu = ifr-\/>ifr\_mtu;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02282}02282                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02283}02283 \textcolor{comment}{                         * Workaround: if the MTU is larger than}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02284}02284 \textcolor{comment}{                         * 8152 (TX FIFO size minus 64 minus 18), turn off}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02285}02285 \textcolor{comment}{                         * TX checksum offloading.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02286}02286 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02287}02287                         \textcolor{keywordflow}{if} (ifr-\/>ifr\_mtu >= 8152) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02288}02288                                 ifp-\/>if\_capenable \&= \string~IFCAP\_TXCSUM;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02289}02289                                 ifp-\/>if\_hwassist \&= \string~NGE\_CSUM\_FEATURES;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02290}02290                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02291}02291                                 ifp-\/>if\_capenable |= IFCAP\_TXCSUM;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02292}02292                                 ifp-\/>if\_hwassist |= \mbox{\hyperlink{if__nge_8c_acb062d853343d9f1617f1fdbb74f2a04}{NGE\_CSUM\_FEATURES}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02293}02293                         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02294}02294                         \mbox{\hyperlink{if__ngereg_8h_a384e888bfa48167ca9e46af78aaba7e7}{NGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02295}02295                         VLAN\_CAPABILITIES(ifp);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02296}02296                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02297}02297                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02298}02298         \textcolor{keywordflow}{case} SIOCSIFFLAGS:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02299}02299                 \mbox{\hyperlink{if__ngereg_8h_ab99f47bf2cd630291194ae818035d11e}{NGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02300}02300                 \textcolor{keywordflow}{if} ((ifp-\/>if\_flags \& IFF\_UP) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02301}02301                         \textcolor{keywordflow}{if} ((ifp-\/>if\_drv\_flags \& IFF\_DRV\_RUNNING) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02302}02302                                 \textcolor{keywordflow}{if} ((ifp-\/>if\_flags \string^ sc-\/>\mbox{\hyperlink{structnge__softc_adbd826d50aed930cca233c4f1c458232}{nge\_if\_flags}}) \&}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02303}02303                                     (IFF\_PROMISC | IFF\_ALLMULTI))}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02304}02304                                         \mbox{\hyperlink{if__nge_8c_a04894fa150ac70b234baaaef57930c47}{nge\_rxfilter}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02305}02305                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02306}02306                                 \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structnge__softc_ac84c514781515c9c5e2b88fc019e0265}{nge\_flags}} \& \mbox{\hyperlink{if__ngereg_8h_a3cdfb8427d9e84d9a93a288c99d8ccf2}{NGE\_FLAG\_DETACH}}) == 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02307}02307                                         \mbox{\hyperlink{if__nge_8c_aed2b3e36e09028db73bd888fd5c1e319}{nge\_init\_locked}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02308}02308                         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02309}02309                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02310}02310                         \textcolor{keywordflow}{if} ((ifp-\/>if\_drv\_flags \& IFF\_DRV\_RUNNING) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02311}02311                                 \mbox{\hyperlink{if__nge_8c_a5f1c4f9e585d5f34ebe3b81d687ebb2a}{nge\_stop}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02312}02312                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02313}02313                 sc-\/>\mbox{\hyperlink{structnge__softc_adbd826d50aed930cca233c4f1c458232}{nge\_if\_flags}} = ifp-\/>if\_flags;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02314}02314                 \mbox{\hyperlink{if__ngereg_8h_a384e888bfa48167ca9e46af78aaba7e7}{NGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02315}02315                 error = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02316}02316                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02317}02317         \textcolor{keywordflow}{case} SIOCADDMULTI:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02318}02318         \textcolor{keywordflow}{case} SIOCDELMULTI:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02319}02319                 \mbox{\hyperlink{if__ngereg_8h_ab99f47bf2cd630291194ae818035d11e}{NGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02320}02320                 \textcolor{keywordflow}{if} ((ifp-\/>if\_drv\_flags \& IFF\_DRV\_RUNNING) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02321}02321                         \mbox{\hyperlink{if__nge_8c_a04894fa150ac70b234baaaef57930c47}{nge\_rxfilter}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02322}02322                 \mbox{\hyperlink{if__ngereg_8h_a384e888bfa48167ca9e46af78aaba7e7}{NGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02323}02323                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02324}02324         \textcolor{keywordflow}{case} SIOCGIFMEDIA:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02325}02325         \textcolor{keywordflow}{case} SIOCSIFMEDIA:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02326}02326                 mii = device\_get\_softc(sc-\/>\mbox{\hyperlink{structnge__softc_a0c48586b5276b5d260cf1d0f606eef32}{nge\_miibus}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02327}02327                 error = ifmedia\_ioctl(ifp, ifr, \&mii-\/>mii\_media, command);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02328}02328                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02329}02329         \textcolor{keywordflow}{case} SIOCSIFCAP:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02330}02330                 \mbox{\hyperlink{if__ngereg_8h_ab99f47bf2cd630291194ae818035d11e}{NGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02331}02331                 mask = ifr-\/>ifr\_reqcap \string^ ifp-\/>if\_capenable;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02332}02332 \textcolor{preprocessor}{\#ifdef DEVICE\_POLLING}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02333}02333                 \textcolor{keywordflow}{if} ((mask \& IFCAP\_POLLING) != 0 \&\&}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02334}02334                     (IFCAP\_POLLING \& ifp-\/>if\_capabilities) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02335}02335                         ifp-\/>if\_capenable \string^= IFCAP\_POLLING;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02336}02336                         \textcolor{keywordflow}{if} ((IFCAP\_POLLING \& ifp-\/>if\_capenable) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02337}02337                                 error = ether\_poll\_register(nge\_poll, ifp);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02338}02338                                 \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02339}02339                                         \mbox{\hyperlink{if__ngereg_8h_a384e888bfa48167ca9e46af78aaba7e7}{NGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02340}02340                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02341}02341                                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02342}02342                                 \textcolor{comment}{/* Disable interrupts. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02343}02343                                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_ab4e2598f55a5d6b4f98e98098e7e7884}{NGE\_IER}}, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02344}02344                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02345}02345                                 error = ether\_poll\_deregister(ifp);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02346}02346                                 \textcolor{comment}{/* Enable interrupts. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02347}02347                                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_ab4e2598f55a5d6b4f98e98098e7e7884}{NGE\_IER}}, 1);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02348}02348                         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02349}02349                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02350}02350 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* DEVICE\_POLLING */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02351}02351                 \textcolor{keywordflow}{if} ((mask \& IFCAP\_TXCSUM) != 0 \&\&}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02352}02352                     (IFCAP\_TXCSUM \& ifp-\/>if\_capabilities) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02353}02353                         ifp-\/>if\_capenable \string^= IFCAP\_TXCSUM;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02354}02354                         \textcolor{keywordflow}{if} ((IFCAP\_TXCSUM \& ifp-\/>if\_capenable) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02355}02355                                 ifp-\/>if\_hwassist |= \mbox{\hyperlink{if__nge_8c_acb062d853343d9f1617f1fdbb74f2a04}{NGE\_CSUM\_FEATURES}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02356}02356                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02357}02357                                 ifp-\/>if\_hwassist \&= \string~NGE\_CSUM\_FEATURES;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02358}02358                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02359}02359                 \textcolor{keywordflow}{if} ((mask \& IFCAP\_RXCSUM) != 0 \&\&}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02360}02360                     (IFCAP\_RXCSUM \& ifp-\/>if\_capabilities) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02361}02361                         ifp-\/>if\_capenable \string^= IFCAP\_RXCSUM;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02362}02362 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02363}02363                 \textcolor{keywordflow}{if} ((mask \& IFCAP\_WOL) != 0 \&\&}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02364}02364                     (ifp-\/>if\_capabilities \& IFCAP\_WOL) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02365}02365                         \textcolor{keywordflow}{if} ((mask \& IFCAP\_WOL\_UCAST) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02366}02366                                 ifp-\/>if\_capenable \string^= IFCAP\_WOL\_UCAST;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02367}02367                         \textcolor{keywordflow}{if} ((mask \& IFCAP\_WOL\_MCAST) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02368}02368                                 ifp-\/>if\_capenable \string^= IFCAP\_WOL\_MCAST;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02369}02369                         \textcolor{keywordflow}{if} ((mask \& IFCAP\_WOL\_MAGIC) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02370}02370                                 ifp-\/>if\_capenable \string^= IFCAP\_WOL\_MAGIC;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02371}02371                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02372}02372 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02373}02373                 \textcolor{keywordflow}{if} ((mask \& IFCAP\_VLAN\_HWCSUM) != 0 \&\&}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02374}02374                     (ifp-\/>if\_capabilities \& IFCAP\_VLAN\_HWCSUM) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02375}02375                         ifp-\/>if\_capenable \string^= IFCAP\_VLAN\_HWCSUM;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02376}02376                 \textcolor{keywordflow}{if} ((mask \& IFCAP\_VLAN\_HWTAGGING) != 0 \&\&}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02377}02377                     (ifp-\/>if\_capabilities \& IFCAP\_VLAN\_HWTAGGING) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02378}02378                         ifp-\/>if\_capenable \string^= IFCAP\_VLAN\_HWTAGGING;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02379}02379                         \textcolor{keywordflow}{if} ((ifp-\/>if\_drv\_flags \& IFF\_DRV\_RUNNING) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02380}02380                                 \textcolor{keywordflow}{if} ((ifp-\/>if\_capenable \&}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02381}02381                                     IFCAP\_VLAN\_HWTAGGING) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02382}02382                                         \mbox{\hyperlink{if__nge_8c_afcd425eed4d24b2afd9cda6a89330638}{NGE\_SETBIT}}(sc,}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02383}02383                                             \mbox{\hyperlink{if__ngereg_8h_a34e66e74f72b83e110c198c252b9d937}{NGE\_VLAN\_IP\_RXCTL}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02384}02384                                             \mbox{\hyperlink{if__ngereg_8h_adb33d8080d6f2ede7e6d5b0d0900ce0b}{NGE\_VIPRXCTL\_TAG\_STRIP\_ENB}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02385}02385                                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02386}02386                                         \mbox{\hyperlink{if__nge_8c_a70b349eff06269a5344d24cdd8581df2}{NGE\_CLRBIT}}(sc,}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02387}02387                                             \mbox{\hyperlink{if__ngereg_8h_a34e66e74f72b83e110c198c252b9d937}{NGE\_VLAN\_IP\_RXCTL}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02388}02388                                             \mbox{\hyperlink{if__ngereg_8h_adb33d8080d6f2ede7e6d5b0d0900ce0b}{NGE\_VIPRXCTL\_TAG\_STRIP\_ENB}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02389}02389                         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02390}02390                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02391}02391                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02392}02392 \textcolor{comment}{                 * Both VLAN hardware tagging and checksum offload is}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02393}02393 \textcolor{comment}{                 * required to do checksum offload on VLAN interface.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02394}02394 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02395}02395                 \textcolor{keywordflow}{if} ((ifp-\/>if\_capenable \& IFCAP\_TXCSUM) == 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02396}02396                         ifp-\/>if\_capenable \&= \string~IFCAP\_VLAN\_HWCSUM;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02397}02397                 \textcolor{keywordflow}{if} ((ifp-\/>if\_capenable \& IFCAP\_VLAN\_HWTAGGING) == 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02398}02398                         ifp-\/>if\_capenable \&= \string~IFCAP\_VLAN\_HWCSUM;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02399}02399                 \mbox{\hyperlink{if__ngereg_8h_a384e888bfa48167ca9e46af78aaba7e7}{NGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02400}02400                 VLAN\_CAPABILITIES(ifp);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02401}02401                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02402}02402         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02403}02403                 error = ether\_ioctl(ifp, command, data);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02404}02404                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02405}02405         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02406}02406 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02407}02407         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02408}02408 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02409}02409 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02410}02410 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02411}\mbox{\hyperlink{if__nge_8c_a4a09759d0a337c988dd49225b47eb12b}{02411}} \mbox{\hyperlink{if__nge_8c_a4a09759d0a337c988dd49225b47eb12b}{nge\_watchdog}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02412}02412 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02413}02413         \textcolor{keyword}{struct }ifnet *ifp;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02414}02414 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02415}02415         \mbox{\hyperlink{if__ngereg_8h_aef7ce8bc258716f95755fd594bb3436e}{NGE\_LOCK\_ASSERT}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02416}02416 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02417}02417         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a903985ea3957a7bff8dca0f1861fcc29}{nge\_watchdog\_timer}} == 0 || -\/-\/sc-\/>\mbox{\hyperlink{structnge__softc_a903985ea3957a7bff8dca0f1861fcc29}{nge\_watchdog\_timer}})}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02418}02418                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02419}02419 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02420}02420         ifp = sc-\/>\mbox{\hyperlink{structnge__softc_ae1ee58f588347b47a3e046b13f030118}{nge\_ifp}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02421}02421         if\_inc\_counter(ifp, IFCOUNTER\_OERRORS, 1);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02422}02422         if\_printf(ifp, \textcolor{stringliteral}{"{}watchdog timeout\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02423}02423 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02424}02424         ifp-\/>if\_drv\_flags \&= \string~IFF\_DRV\_RUNNING;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02425}02425         \mbox{\hyperlink{if__nge_8c_aed2b3e36e09028db73bd888fd5c1e319}{nge\_init\_locked}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02426}02426 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02427}02427         \textcolor{keywordflow}{if} (!IFQ\_DRV\_IS\_EMPTY(\&ifp-\/>if\_snd))}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02428}02428                 \mbox{\hyperlink{if__nge_8c_ad2902445bf55cddca069c3162091c509}{nge\_start\_locked}}(ifp);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02429}02429 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02430}02430 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02431}02431 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02432}\mbox{\hyperlink{if__nge_8c_ad22b729a9097b444402b77e65a9c7855}{02432}} \mbox{\hyperlink{if__nge_8c_ad22b729a9097b444402b77e65a9c7855}{nge\_stop\_mac}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02433}02433 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02434}02434         uint32\_t reg;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02435}02435         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02436}02436 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02437}02437         \mbox{\hyperlink{if__ngereg_8h_aef7ce8bc258716f95755fd594bb3436e}{NGE\_LOCK\_ASSERT}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02438}02438 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02439}02439         reg = \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a8530e5d23599fe33a65b74ad6021a800}{NGE\_CSR}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02440}02440         \textcolor{keywordflow}{if} ((reg \& (\mbox{\hyperlink{if__ngereg_8h_a7f0eabb31f64e0f69e9b0be81f865b65}{NGE\_CSR\_TX\_ENABLE}} | \mbox{\hyperlink{if__ngereg_8h_a04be078304033bcc5fa709d4a8f0ee2a}{NGE\_CSR\_RX\_ENABLE}})) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02441}02441                 reg \&= \string~(\mbox{\hyperlink{if__ngereg_8h_a7f0eabb31f64e0f69e9b0be81f865b65}{NGE\_CSR\_TX\_ENABLE}} | \mbox{\hyperlink{if__ngereg_8h_a04be078304033bcc5fa709d4a8f0ee2a}{NGE\_CSR\_RX\_ENABLE}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02442}02442                 reg |= \mbox{\hyperlink{if__ngereg_8h_a68e79a2813ade6efc0b42fa82cd9940f}{NGE\_CSR\_TX\_DISABLE}} | \mbox{\hyperlink{if__ngereg_8h_a4102612a61df2a10b0094c470e6c265e}{NGE\_CSR\_RX\_DISABLE}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02443}02443                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a8530e5d23599fe33a65b74ad6021a800}{NGE\_CSR}}, reg);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02444}02444                 \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__ngereg_8h_a9a8df12a892089b46b1b27ca0c538f00}{NGE\_TIMEOUT}}; i++) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02445}02445                         DELAY(1);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02446}02446                         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a8530e5d23599fe33a65b74ad6021a800}{NGE\_CSR}}) \&}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02447}02447                             (\mbox{\hyperlink{if__ngereg_8h_a04be078304033bcc5fa709d4a8f0ee2a}{NGE\_CSR\_RX\_ENABLE}} | \mbox{\hyperlink{if__ngereg_8h_a7f0eabb31f64e0f69e9b0be81f865b65}{NGE\_CSR\_TX\_ENABLE}})) == 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02448}02448                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02449}02449                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02450}02450                 \textcolor{keywordflow}{if} (i == \mbox{\hyperlink{if__ngereg_8h_a9a8df12a892089b46b1b27ca0c538f00}{NGE\_TIMEOUT}})}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02451}02451                         \textcolor{keywordflow}{return} (ETIMEDOUT);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02452}02452         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02453}02453 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02454}02454         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02455}02455 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02456}02456 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02457}02457 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02458}02458 \textcolor{comment}{ * Stop the adapter and free any mbufs allocated to the}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02459}02459 \textcolor{comment}{ * RX and TX lists.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02460}02460 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02461}02461 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02462}\mbox{\hyperlink{if__nge_8c_a5f1c4f9e585d5f34ebe3b81d687ebb2a}{02462}} \mbox{\hyperlink{if__nge_8c_a5f1c4f9e585d5f34ebe3b81d687ebb2a}{nge\_stop}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02463}02463 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02464}02464         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__txdesc}{nge\_txdesc}} *txd;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02465}02465         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__rxdesc}{nge\_rxdesc}} *rxd;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02466}02466         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02467}02467         \textcolor{keyword}{struct }ifnet *ifp;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02468}02468 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02469}02469         \mbox{\hyperlink{if__ngereg_8h_aef7ce8bc258716f95755fd594bb3436e}{NGE\_LOCK\_ASSERT}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02470}02470         ifp = sc-\/>\mbox{\hyperlink{structnge__softc_ae1ee58f588347b47a3e046b13f030118}{nge\_ifp}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02471}02471 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02472}02472         ifp-\/>if\_drv\_flags \&= \string~(IFF\_DRV\_RUNNING | IFF\_DRV\_OACTIVE);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02473}02473         sc-\/>\mbox{\hyperlink{structnge__softc_ac84c514781515c9c5e2b88fc019e0265}{nge\_flags}} \&= \string~NGE\_FLAG\_LINK;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02474}02474         callout\_stop(\&sc-\/>\mbox{\hyperlink{structnge__softc_abd2b1bd8b840edd031917b2f3da8243e}{nge\_stat\_ch}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02475}02475         sc-\/>\mbox{\hyperlink{structnge__softc_a903985ea3957a7bff8dca0f1861fcc29}{nge\_watchdog\_timer}} = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02476}02476 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02477}02477         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_ab4e2598f55a5d6b4f98e98098e7e7884}{NGE\_IER}}, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02478}02478         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a7135ba5a59aa88b6f57e30777f09af5d}{NGE\_IMR}}, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02479}02479         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__nge_8c_ad22b729a9097b444402b77e65a9c7855}{nge\_stop\_mac}}(sc) == ETIMEDOUT)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02480}02480                 device\_printf(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02481}02481                    \textcolor{stringliteral}{"{}\%s: unable to stop Tx/Rx MAC\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02482}02482         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a960467752f638054b1c0d04c6d1e93a8}{NGE\_TX\_LISTPTR\_HI}}, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02483}02483         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a67c004d61b464b8b92f41b6efef771d9}{NGE\_TX\_LISTPTR\_LO}}, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02484}02484         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_acd52accb036d8c3a86b6105e6b7d68c3}{NGE\_RX\_LISTPTR\_HI}}, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02485}02485         \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_aeed8215557134f0e0966dea56b095032}{NGE\_RX\_LISTPTR\_LO}}, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02486}02486         \mbox{\hyperlink{if__nge_8c_a25220701f680281bf402ac417e973a1e}{nge\_stats\_update}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02487}02487         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_a3d7f33c53cb34088a9af8a6b68a03f5d}{nge\_head}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02488}02488                 m\_freem(sc-\/>\mbox{\hyperlink{structnge__softc_a3d7f33c53cb34088a9af8a6b68a03f5d}{nge\_head}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02489}02489                 sc-\/>\mbox{\hyperlink{structnge__softc_a3d7f33c53cb34088a9af8a6b68a03f5d}{nge\_head}} = sc-\/>\mbox{\hyperlink{structnge__softc_a3dec9af0002f6eee694bd4842a913309}{nge\_tail}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02490}02490         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02491}02491 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02492}02492         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02493}02493 \textcolor{comment}{         * Free RX and TX mbufs still in the queues.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02494}02494 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02495}02495         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__ngereg_8h_a4d2146cfe1e24ec4c810bf0d1d43bb0a}{NGE\_RX\_RING\_CNT}}; i++) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02496}02496                 rxd = \&sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a8cc2b833224ffdb58e8e160b48bb31f1}{nge\_rxdesc}}[i];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02497}02497                 \textcolor{keywordflow}{if} (rxd-\/>\mbox{\hyperlink{structnge__rxdesc_a70001dab71c024cbe4803374c626e40a}{rx\_m}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02498}02498                         bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a204c4899e279570c9853dd867ea12a0b}{nge\_rx\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02499}02499                             rxd-\/>\mbox{\hyperlink{structnge__rxdesc_a1aa2aa43da87a94cb49bb235995f37f5}{rx\_dmamap}}, BUS\_DMASYNC\_POSTREAD);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02500}02500                         bus\_dmamap\_unload(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a204c4899e279570c9853dd867ea12a0b}{nge\_rx\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02501}02501                             rxd-\/>\mbox{\hyperlink{structnge__rxdesc_a1aa2aa43da87a94cb49bb235995f37f5}{rx\_dmamap}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02502}02502                         m\_freem(rxd-\/>\mbox{\hyperlink{structnge__rxdesc_a70001dab71c024cbe4803374c626e40a}{rx\_m}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02503}02503                         rxd-\/>\mbox{\hyperlink{structnge__rxdesc_a70001dab71c024cbe4803374c626e40a}{rx\_m}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02504}02504                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02505}02505         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02506}02506         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__ngereg_8h_a2c640f4df126d566325ac35549986d2d}{NGE\_TX\_RING\_CNT}}; i++) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02507}02507                 txd = \&sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_ac62d7f895349014f6b56adde934fbb0a}{nge\_txdesc}}[i];}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02508}02508                 \textcolor{keywordflow}{if} (txd-\/>\mbox{\hyperlink{structnge__txdesc_ac0980a7537bb5a6c403c3d89ec58663b}{tx\_m}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02509}02509                         bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a6fc520951d327aa4be4f35f2dfa3f521}{nge\_tx\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02510}02510                             txd-\/>\mbox{\hyperlink{structnge__txdesc_aa334e70e247f63d45bd94da3e631e79f}{tx\_dmamap}}, BUS\_DMASYNC\_POSTWRITE);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02511}02511                         bus\_dmamap\_unload(sc-\/>\mbox{\hyperlink{structnge__softc_a560b9266e2e14c6d37e591a67e260312}{nge\_cdata}}.\mbox{\hyperlink{structnge__chain__data_a6fc520951d327aa4be4f35f2dfa3f521}{nge\_tx\_tag}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02512}02512                             txd-\/>\mbox{\hyperlink{structnge__txdesc_aa334e70e247f63d45bd94da3e631e79f}{tx\_dmamap}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02513}02513                         m\_freem(txd-\/>\mbox{\hyperlink{structnge__txdesc_ac0980a7537bb5a6c403c3d89ec58663b}{tx\_m}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02514}02514                         txd-\/>\mbox{\hyperlink{structnge__txdesc_ac0980a7537bb5a6c403c3d89ec58663b}{tx\_m}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02515}02515                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02516}02516         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02517}02517 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02518}02518 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02519}02519 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02520}02520 \textcolor{comment}{ * Before setting WOL bits, caller should have stopped Receiver.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02521}02521 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02522}02522 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02523}\mbox{\hyperlink{if__nge_8c_ad6cd542efc03ee8ca3c267b5d5fcc3df}{02523}} \mbox{\hyperlink{if__nge_8c_ad6cd542efc03ee8ca3c267b5d5fcc3df}{nge\_wol}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02524}02524 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02525}02525         \textcolor{keyword}{struct }ifnet *ifp;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02526}02526         uint32\_t reg;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02527}02527         uint16\_t pmstat;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02528}02528         \textcolor{keywordtype}{int} pmc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02529}02529 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02530}02530         \mbox{\hyperlink{if__ngereg_8h_aef7ce8bc258716f95755fd594bb3436e}{NGE\_LOCK\_ASSERT}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02531}02531 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02532}02532         \textcolor{keywordflow}{if} (pci\_find\_cap(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}}, PCIY\_PMG, \&pmc) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02533}02533                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02534}02534 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02535}02535         ifp = sc-\/>\mbox{\hyperlink{structnge__softc_ae1ee58f588347b47a3e046b13f030118}{nge\_ifp}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02536}02536         \textcolor{keywordflow}{if} ((ifp-\/>if\_capenable \& IFCAP\_WOL) == 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02537}02537                 \textcolor{comment}{/* Disable WOL \& disconnect CLKRUN to save power. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02538}02538                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_ac1b3d84befe746c788786899ec788c4a}{NGE\_WOLCSR}}, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02539}02539                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_aa882f6d9448acf4052fbe174d7b90350}{NGE\_CLKRUN}}, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02540}02540         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02541}02541                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__nge_8c_ad22b729a9097b444402b77e65a9c7855}{nge\_stop\_mac}}(sc) == ETIMEDOUT)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02542}02542                         device\_printf(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02543}02543                             \textcolor{stringliteral}{"{}\%s: unable to stop Tx/Rx MAC\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02544}02544                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02545}02545 \textcolor{comment}{                 * Make sure wake frames will be buffered in the Rx FIFO.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02546}02546 \textcolor{comment}{                 * (i.e. Silent Rx mode.)}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02547}02547 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02548}02548                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_acd52accb036d8c3a86b6105e6b7d68c3}{NGE\_RX\_LISTPTR\_HI}}, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02549}02549                 \mbox{\hyperlink{if__ngereg_8h_a8d0df18248ed8e804a14eecc559d53bc}{CSR\_BARRIER\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_acd52accb036d8c3a86b6105e6b7d68c3}{NGE\_RX\_LISTPTR\_HI}}, BUS\_SPACE\_BARRIER\_WRITE);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02550}02550                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_aeed8215557134f0e0966dea56b095032}{NGE\_RX\_LISTPTR\_LO}}, 0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02551}02551                 \mbox{\hyperlink{if__ngereg_8h_a8d0df18248ed8e804a14eecc559d53bc}{CSR\_BARRIER\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_aeed8215557134f0e0966dea56b095032}{NGE\_RX\_LISTPTR\_LO}}, BUS\_SPACE\_BARRIER\_WRITE);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02552}02552                 \textcolor{comment}{/* Enable Rx again. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02553}02553                 \mbox{\hyperlink{if__nge_8c_afcd425eed4d24b2afd9cda6a89330638}{NGE\_SETBIT}}(sc, \mbox{\hyperlink{if__ngereg_8h_a8530e5d23599fe33a65b74ad6021a800}{NGE\_CSR}}, \mbox{\hyperlink{if__ngereg_8h_a04be078304033bcc5fa709d4a8f0ee2a}{NGE\_CSR\_RX\_ENABLE}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02554}02554                 \mbox{\hyperlink{if__ngereg_8h_a8d0df18248ed8e804a14eecc559d53bc}{CSR\_BARRIER\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_a8530e5d23599fe33a65b74ad6021a800}{NGE\_CSR}}, BUS\_SPACE\_BARRIER\_WRITE);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02555}02555 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02556}02556                 \textcolor{comment}{/* Configure WOL events. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02557}02557                 reg = 0;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02558}02558                 \textcolor{keywordflow}{if} ((ifp-\/>if\_capenable \& IFCAP\_WOL\_UCAST) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02559}02559                         reg |= \mbox{\hyperlink{if__ngereg_8h_a0fb8f659423598c30d43ffa5e91b5f6b}{NGE\_WOLCSR\_WAKE\_ON\_UNICAST}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02560}02560                 \textcolor{keywordflow}{if} ((ifp-\/>if\_capenable \& IFCAP\_WOL\_MCAST) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02561}02561                         reg |= \mbox{\hyperlink{if__ngereg_8h_a2f0b266ad4e3b3b51fc30847599f2f48}{NGE\_WOLCSR\_WAKE\_ON\_MULTICAST}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02562}02562                 \textcolor{keywordflow}{if} ((ifp-\/>if\_capenable \& IFCAP\_WOL\_MAGIC) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02563}02563                         reg |= \mbox{\hyperlink{if__ngereg_8h_a623c0794fc91fe4481633d8e84e5177e}{NGE\_WOLCSR\_WAKE\_ON\_MAGICPKT}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02564}02564                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_ac1b3d84befe746c788786899ec788c4a}{NGE\_WOLCSR}}, reg);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02565}02565 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02566}02566                 \textcolor{comment}{/* Activate CLKRUN. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02567}02567                 reg = \mbox{\hyperlink{if__ngereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_aa882f6d9448acf4052fbe174d7b90350}{NGE\_CLKRUN}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02568}02568                 reg |= \mbox{\hyperlink{if__ngereg_8h_a4e176b71d0957d88c2dca199fb6c3fc2}{NGE\_CLKRUN\_PMEENB}} | \mbox{\hyperlink{if__ngereg_8h_a580838ac558c3e4addd516f9c832fb40}{NGE\_CLNRUN\_CLKRUN\_ENB}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02569}02569                 \mbox{\hyperlink{if__ngereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__ngereg_8h_aa882f6d9448acf4052fbe174d7b90350}{NGE\_CLKRUN}}, reg);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02570}02570         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02571}02571 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02572}02572         \textcolor{comment}{/* Request PME. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02573}02573         pmstat = pci\_read\_config(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}}, pmc + PCIR\_POWER\_STATUS, 2);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02574}02574         pmstat \&= \string~(PCIM\_PSTAT\_PME | PCIM\_PSTAT\_PMEENABLE);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02575}02575         \textcolor{keywordflow}{if} ((ifp-\/>if\_capenable \& IFCAP\_WOL) != 0)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02576}02576                 pmstat |= PCIM\_PSTAT\_PME | PCIM\_PSTAT\_PMEENABLE;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02577}02577         pci\_write\_config(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}}, pmc + PCIR\_POWER\_STATUS, pmstat, 2);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02578}02578 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02579}02579 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02580}02580 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02581}02581 \textcolor{comment}{ * Stop all chip I/O so that the kernel's probe routines don't}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02582}02582 \textcolor{comment}{ * get confused by errant DMAs when rebooting.}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02583}02583 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02584}02584 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02585}\mbox{\hyperlink{if__nge_8c_a931d40221554b2514cd9ad6e52c70963}{02585}} \mbox{\hyperlink{if__nge_8c_a931d40221554b2514cd9ad6e52c70963}{nge\_shutdown}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02586}02586 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02587}02587 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02588}02588         \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__nge_8c_a2ee505e753ccf3c61b3d73ae1ee464b1}{nge\_suspend}}(dev));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02589}02589 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02590}02590 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02591}02591 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02592}\mbox{\hyperlink{if__nge_8c_a2ee505e753ccf3c61b3d73ae1ee464b1}{02592}} \mbox{\hyperlink{if__nge_8c_a2ee505e753ccf3c61b3d73ae1ee464b1}{nge\_suspend}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02593}02593 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02594}02594         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02595}02595 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02596}02596         sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02597}02597 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02598}02598         \mbox{\hyperlink{if__ngereg_8h_ab99f47bf2cd630291194ae818035d11e}{NGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02599}02599         \mbox{\hyperlink{if__nge_8c_a5f1c4f9e585d5f34ebe3b81d687ebb2a}{nge\_stop}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02600}02600         \mbox{\hyperlink{if__nge_8c_ad6cd542efc03ee8ca3c267b5d5fcc3df}{nge\_wol}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02601}02601         sc-\/>\mbox{\hyperlink{structnge__softc_ac84c514781515c9c5e2b88fc019e0265}{nge\_flags}} |= \mbox{\hyperlink{if__ngereg_8h_a6c91c6bb7a5a2ea60f98887cd8b7fb94}{NGE\_FLAG\_SUSPENDED}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02602}02602         \mbox{\hyperlink{if__ngereg_8h_a384e888bfa48167ca9e46af78aaba7e7}{NGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02603}02603 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02604}02604         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02605}02605 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02606}02606 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02607}02607 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02608}\mbox{\hyperlink{if__nge_8c_a53ec13d52e2833463c7b45d7eef34e25}{02608}} \mbox{\hyperlink{if__nge_8c_a53ec13d52e2833463c7b45d7eef34e25}{nge\_resume}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02609}02609 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02610}02610         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02611}02611         \textcolor{keyword}{struct }ifnet *ifp;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02612}02612         uint16\_t pmstat;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02613}02613         \textcolor{keywordtype}{int} pmc;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02614}02614 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02615}02615         sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02616}02616 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02617}02617         \mbox{\hyperlink{if__ngereg_8h_ab99f47bf2cd630291194ae818035d11e}{NGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02618}02618         ifp = sc-\/>\mbox{\hyperlink{structnge__softc_ae1ee58f588347b47a3e046b13f030118}{nge\_ifp}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02619}02619         \textcolor{keywordflow}{if} (pci\_find\_cap(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}}, PCIY\_PMG, \&pmc) == 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02620}02620                 \textcolor{comment}{/* Disable PME and clear PME status. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02621}02621                 pmstat = pci\_read\_config(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02622}02622                     pmc + PCIR\_POWER\_STATUS, 2);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02623}02623                 \textcolor{keywordflow}{if} ((pmstat \& PCIM\_PSTAT\_PMEENABLE) != 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02624}02624                         pmstat \&= \string~PCIM\_PSTAT\_PMEENABLE;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02625}02625                         pci\_write\_config(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02626}02626                             pmc + PCIR\_POWER\_STATUS, pmstat, 2);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02627}02627                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02628}02628         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02629}02629         \textcolor{keywordflow}{if} (ifp-\/>if\_flags \& IFF\_UP) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02630}02630                 ifp-\/>if\_drv\_flags \&= \string~IFF\_DRV\_RUNNING;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02631}02631                 \mbox{\hyperlink{if__nge_8c_aed2b3e36e09028db73bd888fd5c1e319}{nge\_init\_locked}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02632}02632         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02633}02633 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02634}02634         sc-\/>\mbox{\hyperlink{structnge__softc_ac84c514781515c9c5e2b88fc019e0265}{nge\_flags}} \&= \string~NGE\_FLAG\_SUSPENDED;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02635}02635         \mbox{\hyperlink{if__ngereg_8h_a384e888bfa48167ca9e46af78aaba7e7}{NGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02636}02636 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02637}02637         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02638}02638 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02639}02639 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02640}\mbox{\hyperlink{if__nge_8c_a923e7f39e6ec107009e55f0112ab94f2}{02640}} \textcolor{preprocessor}{\#define NGE\_SYSCTL\_STAT\_ADD32(c, h, n, p, d)    \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02641}02641 \textcolor{preprocessor}{            SYSCTL\_ADD\_UINT(c, h, OID\_AUTO, n, CTLFLAG\_RD, p, 0, d)}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02642}02642 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02643}02643 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02644}\mbox{\hyperlink{if__nge_8c_a02024fcb047d38c99dc8308f988078ad}{02644}} \mbox{\hyperlink{if__nge_8c_a02024fcb047d38c99dc8308f988078ad}{nge\_sysctl\_node}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structnge__softc}{nge\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02645}02645 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02646}02646         \textcolor{keyword}{struct }sysctl\_ctx\_list *ctx;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02647}02647         \textcolor{keyword}{struct }sysctl\_oid\_list *child, *parent;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02648}02648         \textcolor{keyword}{struct }sysctl\_oid *tree;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02649}02649         \textcolor{keyword}{struct }\mbox{\hyperlink{structnge__stats}{nge\_stats}} *stats;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02650}02650         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02651}02651 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02652}02652         ctx = device\_get\_sysctl\_ctx(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02653}02653         child = SYSCTL\_CHILDREN(device\_get\_sysctl\_tree(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}}));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02654}02654         SYSCTL\_ADD\_PROC(ctx, child, OID\_AUTO, \textcolor{stringliteral}{"{}int\_holdoff"{}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02655}02655             CTLTYPE\_INT | CTLFLAG\_RW | CTLFLAG\_NEEDGIANT, \&sc-\/>\mbox{\hyperlink{structnge__softc_ac79661bdc6e3d7d905cd7b9b799a5e82}{nge\_int\_holdoff}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02656}02656             0, \mbox{\hyperlink{if__nge_8c_ac087661b11aab3144489de1f2181defa}{sysctl\_hw\_nge\_int\_holdoff}}, \textcolor{stringliteral}{"{}I"{}}, \textcolor{stringliteral}{"{}NGE interrupt moderation"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02657}02657         \textcolor{comment}{/* Pull in device tunables. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02658}02658         sc-\/>\mbox{\hyperlink{structnge__softc_ac79661bdc6e3d7d905cd7b9b799a5e82}{nge\_int\_holdoff}} = \mbox{\hyperlink{if__ngereg_8h_aeaa9007f957187f4c3bdc6698976f8e8}{NGE\_INT\_HOLDOFF\_DEFAULT}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02659}02659         error = resource\_int\_value(device\_get\_name(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}}),}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02660}02660             device\_get\_unit(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}}), \textcolor{stringliteral}{"{}int\_holdoff"{}}, \&sc-\/>\mbox{\hyperlink{structnge__softc_ac79661bdc6e3d7d905cd7b9b799a5e82}{nge\_int\_holdoff}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02661}02661         \textcolor{keywordflow}{if} (error == 0) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02662}02662                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structnge__softc_ac79661bdc6e3d7d905cd7b9b799a5e82}{nge\_int\_holdoff}} < \mbox{\hyperlink{if__ngereg_8h_a0b8a6d542398c4d2b7a740a792466203}{NGE\_INT\_HOLDOFF\_MIN}} ||}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02663}02663                     sc-\/>\mbox{\hyperlink{structnge__softc_ac79661bdc6e3d7d905cd7b9b799a5e82}{nge\_int\_holdoff}} > \mbox{\hyperlink{if__ngereg_8h_abb42f8c91e331689b868a1cb14aff8bd}{NGE\_INT\_HOLDOFF\_MAX}} ) \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02664}02664                         device\_printf(sc-\/>\mbox{\hyperlink{structnge__softc_a37fe35980de618ce638e6bc03dab4b0f}{nge\_dev}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02665}02665                             \textcolor{stringliteral}{"{}int\_holdoff value out of range; "{}}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02666}02666                             \textcolor{stringliteral}{"{}using default: \%d(\%d us)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02667}02667                             \mbox{\hyperlink{if__ngereg_8h_aeaa9007f957187f4c3bdc6698976f8e8}{NGE\_INT\_HOLDOFF\_DEFAULT}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02668}02668                             \mbox{\hyperlink{if__ngereg_8h_aeaa9007f957187f4c3bdc6698976f8e8}{NGE\_INT\_HOLDOFF\_DEFAULT}} * 100);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02669}02669                         sc-\/>\mbox{\hyperlink{structnge__softc_ac79661bdc6e3d7d905cd7b9b799a5e82}{nge\_int\_holdoff}} = \mbox{\hyperlink{if__ngereg_8h_aeaa9007f957187f4c3bdc6698976f8e8}{NGE\_INT\_HOLDOFF\_DEFAULT}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02670}02670                 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02671}02671         \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02672}02672 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02673}02673         stats = \&sc-\/>\mbox{\hyperlink{structnge__softc_aa7c4279b0d07fb682ac8a99a83aea680}{nge\_stats}};}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02674}02674         tree = SYSCTL\_ADD\_NODE(ctx, child, OID\_AUTO, \textcolor{stringliteral}{"{}stats"{}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02675}02675             CTLFLAG\_RD | CTLFLAG\_MPSAFE, NULL, \textcolor{stringliteral}{"{}NGE statistics"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02676}02676         parent = SYSCTL\_CHILDREN(tree);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02677}02677 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02678}02678         \textcolor{comment}{/* Rx statistics. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02679}02679         tree = SYSCTL\_ADD\_NODE(ctx, parent, OID\_AUTO, \textcolor{stringliteral}{"{}rx"{}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02680}02680             CTLFLAG\_RD | CTLFLAG\_MPSAFE, NULL, \textcolor{stringliteral}{"{}Rx MAC statistics"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02681}02681         child = SYSCTL\_CHILDREN(tree);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02682}02682         \mbox{\hyperlink{if__nge_8c_a923e7f39e6ec107009e55f0112ab94f2}{NGE\_SYSCTL\_STAT\_ADD32}}(ctx, child, \textcolor{stringliteral}{"{}pkts\_errs"{}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02683}02683             \&stats-\/>\mbox{\hyperlink{structnge__stats_a65ad0fe640a3d4253a57de51b1b08c65}{rx\_pkts\_errs}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02684}02684             \textcolor{stringliteral}{"{}Packet errors including both wire errors and FIFO overruns"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02685}02685         \mbox{\hyperlink{if__nge_8c_a923e7f39e6ec107009e55f0112ab94f2}{NGE\_SYSCTL\_STAT\_ADD32}}(ctx, child, \textcolor{stringliteral}{"{}crc\_errs"{}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02686}02686             \&stats-\/>\mbox{\hyperlink{structnge__stats_a8676f1c6384201f9b7a5eb37afe4b85f}{rx\_crc\_errs}}, \textcolor{stringliteral}{"{}CRC errors"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02687}02687         \mbox{\hyperlink{if__nge_8c_a923e7f39e6ec107009e55f0112ab94f2}{NGE\_SYSCTL\_STAT\_ADD32}}(ctx, child, \textcolor{stringliteral}{"{}fifo\_oflows"{}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02688}02688             \&stats-\/>\mbox{\hyperlink{structnge__stats_a3ebefa4f6ca7c1fc424d9dcf25b5b6a3}{rx\_fifo\_oflows}}, \textcolor{stringliteral}{"{}FIFO overflows"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02689}02689         \mbox{\hyperlink{if__nge_8c_a923e7f39e6ec107009e55f0112ab94f2}{NGE\_SYSCTL\_STAT\_ADD32}}(ctx, child, \textcolor{stringliteral}{"{}align\_errs"{}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02690}02690             \&stats-\/>\mbox{\hyperlink{structnge__stats_a7fb620b1ea719e315476b85e217c64db}{rx\_align\_errs}}, \textcolor{stringliteral}{"{}Frame alignment errors"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02691}02691         \mbox{\hyperlink{if__nge_8c_a923e7f39e6ec107009e55f0112ab94f2}{NGE\_SYSCTL\_STAT\_ADD32}}(ctx, child, \textcolor{stringliteral}{"{}sym\_errs"{}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02692}02692             \&stats-\/>\mbox{\hyperlink{structnge__stats_ad872331ebc4ed1f40cad44173780a381}{rx\_sym\_errs}}, \textcolor{stringliteral}{"{}One or more symbol errors"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02693}02693         \mbox{\hyperlink{if__nge_8c_a923e7f39e6ec107009e55f0112ab94f2}{NGE\_SYSCTL\_STAT\_ADD32}}(ctx, child, \textcolor{stringliteral}{"{}pkts\_jumbos"{}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02694}02694             \&stats-\/>\mbox{\hyperlink{structnge__stats_a9c8529d3ad19f17eb1feefea9ce359ba}{rx\_pkts\_jumbos}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02695}02695             \textcolor{stringliteral}{"{}Packets received with length greater than 1518 bytes"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02696}02696         \mbox{\hyperlink{if__nge_8c_a923e7f39e6ec107009e55f0112ab94f2}{NGE\_SYSCTL\_STAT\_ADD32}}(ctx, child, \textcolor{stringliteral}{"{}len\_errs"{}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02697}02697             \&stats-\/>\mbox{\hyperlink{structnge__stats_a69c590a50342562e1b8b742a71208908}{rx\_len\_errs}}, \textcolor{stringliteral}{"{}In Range Length errors"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02698}02698         \mbox{\hyperlink{if__nge_8c_a923e7f39e6ec107009e55f0112ab94f2}{NGE\_SYSCTL\_STAT\_ADD32}}(ctx, child, \textcolor{stringliteral}{"{}unctl\_frames"{}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02699}02699             \&stats-\/>\mbox{\hyperlink{structnge__stats_af4b56dd00075f187e155fe2bfc599636}{rx\_unctl\_frames}}, \textcolor{stringliteral}{"{}Control frames with unsupported opcode"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02700}02700         \mbox{\hyperlink{if__nge_8c_a923e7f39e6ec107009e55f0112ab94f2}{NGE\_SYSCTL\_STAT\_ADD32}}(ctx, child, \textcolor{stringliteral}{"{}pause"{}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02701}02701             \&stats-\/>\mbox{\hyperlink{structnge__stats_a9cadc4152365610e92ed78740d69ef65}{rx\_pause}}, \textcolor{stringliteral}{"{}Pause frames"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02702}02702 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02703}02703         \textcolor{comment}{/* Tx statistics. */}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02704}02704         tree = SYSCTL\_ADD\_NODE(ctx, parent, OID\_AUTO, \textcolor{stringliteral}{"{}tx"{}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02705}02705             CTLFLAG\_RD | CTLFLAG\_MPSAFE, NULL, \textcolor{stringliteral}{"{}Tx MAC statistics"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02706}02706         child = SYSCTL\_CHILDREN(tree);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02707}02707         \mbox{\hyperlink{if__nge_8c_a923e7f39e6ec107009e55f0112ab94f2}{NGE\_SYSCTL\_STAT\_ADD32}}(ctx, child, \textcolor{stringliteral}{"{}pause"{}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02708}02708             \&stats-\/>\mbox{\hyperlink{structnge__stats_ac0b2e5714f966fff8ba0a30c1c8d517f}{tx\_pause}}, \textcolor{stringliteral}{"{}Pause frames"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02709}02709         \mbox{\hyperlink{if__nge_8c_a923e7f39e6ec107009e55f0112ab94f2}{NGE\_SYSCTL\_STAT\_ADD32}}(ctx, child, \textcolor{stringliteral}{"{}seq\_errs"{}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02710}02710             \&stats-\/>\mbox{\hyperlink{structnge__stats_a8e9e67ef0e5cff196204aa67f7152c00}{tx\_seq\_errs}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02711}02711             \textcolor{stringliteral}{"{}Loss of collision heartbeat during transmission"{}});}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02712}02712 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02713}02713 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02714}02714 \textcolor{preprocessor}{\#undef NGE\_SYSCTL\_STAT\_ADD32}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02715}02715 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02716}02716 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02717}\mbox{\hyperlink{if__nge_8c_a311f247d9a16f81312129360d96c124d}{02717}} \mbox{\hyperlink{if__nge_8c_a311f247d9a16f81312129360d96c124d}{sysctl\_int\_range}}(SYSCTL\_HANDLER\_ARGS, \textcolor{keywordtype}{int} low, \textcolor{keywordtype}{int} high)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02718}02718 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02719}02719         \textcolor{keywordtype}{int} error, value;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02720}02720 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02721}02721         \textcolor{keywordflow}{if} (arg1 == NULL)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02722}02722                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02723}02723         value = *(\textcolor{keywordtype}{int} *)arg1;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02724}02724         error = sysctl\_handle\_int(oidp, \&value, 0, req);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02725}02725         \textcolor{keywordflow}{if} (error != 0 || req-\/>newptr == NULL)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02726}02726                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02727}02727         \textcolor{keywordflow}{if} (value < low || value > high)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02728}02728                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02729}02729         *(\textcolor{keywordtype}{int} *)arg1 = value;}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02730}02730 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02731}02731         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02732}02732 \}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02733}02733 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02734}02734 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02735}\mbox{\hyperlink{if__nge_8c_ac087661b11aab3144489de1f2181defa}{02735}} \mbox{\hyperlink{if__nge_8c_ac087661b11aab3144489de1f2181defa}{sysctl\_hw\_nge\_int\_holdoff}}(SYSCTL\_HANDLER\_ARGS)}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02736}02736 \{}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02737}02737 }
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02738}02738         \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__nge_8c_a311f247d9a16f81312129360d96c124d}{sysctl\_int\_range}}(oidp, arg1, arg2, req, \mbox{\hyperlink{if__ngereg_8h_a0b8a6d542398c4d2b7a740a792466203}{NGE\_INT\_HOLDOFF\_MIN}},}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02739}02739             \mbox{\hyperlink{if__ngereg_8h_abb42f8c91e331689b868a1cb14aff8bd}{NGE\_INT\_HOLDOFF\_MAX}}));}
\DoxyCodeLine{\Hypertarget{if__nge_8c_source_l02740}02740 \}}

\end{DoxyCode}
