\hypertarget{if__lge_8c_source}{}\doxysection{if\+\_\+lge.\+c}
\label{if__lge_8c_source}\index{dev/lge/if\_lge.c@{dev/lge/if\_lge.c}}
\mbox{\hyperlink{if__lge_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/4-\/Clause}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2001 Wind River Systems}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 1997, 1998, 1999, 2000, 2001}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00006}00006 \textcolor{comment}{ *      Bill Paul <william.paul@windriver.com>.  All rights reserved.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00007}00007 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00008}00008 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00009}00009 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00010}00010 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00011}00011 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00012}00012 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00013}00013 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00014}00014 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00015}00015 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00016}00016 \textcolor{comment}{ * 3. All advertising materials mentioning features or use of this software}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00017}00017 \textcolor{comment}{ *    must display the following acknowledgement:}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00018}00018 \textcolor{comment}{ *      This product includes software developed by Bill Paul.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00019}00019 \textcolor{comment}{ * 4. Neither the name of the author nor the names of any co-\/contributors}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00020}00020 \textcolor{comment}{ *    may be used to endorse or promote products derived from this software}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00021}00021 \textcolor{comment}{ *    without specific prior written permission.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00022}00022 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00023}00023 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00024}00024 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00025}00025 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00026}00026 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00027}00027 \textcolor{comment}{ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00028}00028 \textcolor{comment}{ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00029}00029 \textcolor{comment}{ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00030}00030 \textcolor{comment}{ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00031}00031 \textcolor{comment}{ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00032}00032 \textcolor{comment}{ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00033}00033 \textcolor{comment}{ * THE POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00034}00034 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00035}00035 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00037}\mbox{\hyperlink{if__lge_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00037}} \mbox{\hyperlink{if__lge_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00038}00038 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00039}00039 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00040}00040 \textcolor{comment}{ * Level 1 LXT1001 gigabit ethernet driver for FreeBSD. Public}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00041}00041 \textcolor{comment}{ * documentation not available, but ask me nicely.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00042}00042 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00043}00043 \textcolor{comment}{ * The Level 1 chip is used on some D-\/Link, SMC and Addtron NICs.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00044}00044 \textcolor{comment}{ * It's a 64-\/bit PCI part that supports TCP/IP checksum offload,}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00045}00045 \textcolor{comment}{ * VLAN tagging/insertion, GMII and TBI (1000baseX) ports. There}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00046}00046 \textcolor{comment}{ * are three supported methods for data transfer between host and}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00047}00047 \textcolor{comment}{ * NIC: programmed I/O, traditional scatter/gather DMA and Packet}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00048}00048 \textcolor{comment}{ * Propulsion Technology (tm) DMA. The latter mechanism is a form}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00049}00049 \textcolor{comment}{ * of double buffer DMA where the packet data is copied to a}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00050}00050 \textcolor{comment}{ * pre-\/allocated DMA buffer who's physical address has been loaded}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00051}00051 \textcolor{comment}{ * into a table at device initialization time. The rationale is that}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00052}00052 \textcolor{comment}{ * the virtual to physical address translation needed for normal}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00053}00053 \textcolor{comment}{ * scatter/gather DMA is more expensive than the data copy needed}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00054}00054 \textcolor{comment}{ * for double buffering. This may be true in Windows NT and the like,}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00055}00055 \textcolor{comment}{ * but it isn't true for us, at least on the x86 arch. This driver}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00056}00056 \textcolor{comment}{ * uses the scatter/gather I/O method for both TX and RX.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00057}00057 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00058}00058 \textcolor{comment}{ * The LXT1001 only supports TCP/IP checksum offload on receive.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00059}00059 \textcolor{comment}{ * Also, the VLAN tagging is done using a 16-\/entry table which allows}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00060}00060 \textcolor{comment}{ * the chip to perform hardware filtering based on VLAN tags. Sadly,}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00061}00061 \textcolor{comment}{ * our vlan support doesn't currently play well with this kind of}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00062}00062 \textcolor{comment}{ * hardware support.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00063}00063 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00064}00064 \textcolor{comment}{ * Special thanks to:}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00065}00065 \textcolor{comment}{ * -\/ Jeff James at Intel, for arranging to have the LXT1001 manual}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00066}00066 \textcolor{comment}{ *   released (at long last)}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00067}00067 \textcolor{comment}{ * -\/ Beny Chen at D-\/Link, for actually sending it to me}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00068}00068 \textcolor{comment}{ * -\/ Brad Short and Keith Alexis at SMC, for sending me sample}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00069}00069 \textcolor{comment}{ *   SMC9462SX and SMC9462TX adapters for testing}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00070}00070 \textcolor{comment}{ * -\/ Paul Saab at Y!, for not killing me (though it remains to be seen}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00071}00071 \textcolor{comment}{ *   if in fact he did me much of a favor)}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00072}00072 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00073}00073 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00074}00074 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00075}00075 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00076}00076 \textcolor{preprocessor}{\#include <sys/sockio.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00077}00077 \textcolor{preprocessor}{\#include <sys/mbuf.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00078}00078 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00079}00079 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00080}00080 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00081}00081 \textcolor{preprocessor}{\#include <sys/socket.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00082}00082 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00083}00083 \textcolor{preprocessor}{\#include <net/if.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00084}00084 \textcolor{preprocessor}{\#include <net/if\_var.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00085}00085 \textcolor{preprocessor}{\#include <net/if\_arp.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00086}00086 \textcolor{preprocessor}{\#include <net/ethernet.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00087}00087 \textcolor{preprocessor}{\#include <net/if\_dl.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00088}00088 \textcolor{preprocessor}{\#include <net/if\_media.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00089}00089 \textcolor{preprocessor}{\#include <net/if\_types.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00090}00090 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00091}00091 \textcolor{preprocessor}{\#include <net/bpf.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00092}00092 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00093}00093 \textcolor{preprocessor}{\#include <vm/vm.h>}              \textcolor{comment}{/* for vtophys */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00094}00094 \textcolor{preprocessor}{\#include <vm/pmap.h>}            \textcolor{comment}{/* for vtophys */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00095}00095 \textcolor{preprocessor}{\#include <machine/bus.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00096}00096 \textcolor{preprocessor}{\#include <machine/resource.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00097}00097 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00098}00098 \textcolor{preprocessor}{\#include <sys/rman.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00099}00099 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00100}00100 \textcolor{preprocessor}{\#include <dev/mii/mii.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00101}00101 \textcolor{preprocessor}{\#include <dev/mii/miivar.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00102}00102 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00103}00103 \textcolor{preprocessor}{\#include <dev/pci/pcireg.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00104}00104 \textcolor{preprocessor}{\#include <dev/pci/pcivar.h>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00105}00105 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00106}\mbox{\hyperlink{if__lge_8c_af8398dc6c553267f3d0d274b0c146b34}{00106}} \textcolor{preprocessor}{\#define LGE\_USEIOSPACE}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00107}00107 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00108}00108 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{if__lgereg_8h}{dev/lge/if\_lgereg.h}}>}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00109}00109 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00110}00110 \textcolor{comment}{/* "{}device miibus"{} required.  See GENERIC if you get errors here. */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00111}00111 \textcolor{preprocessor}{\#include "{}miibus\_if.h"{}}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00112}00112 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00113}00113 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00114}00114 \textcolor{comment}{ * Various supported device vendors/types and their names.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00115}00115 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00116}\mbox{\hyperlink{if__lge_8c_a467c2ec48625790f74de05f899f8620a}{00116}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__type}{lge\_type}} \mbox{\hyperlink{if__lge_8c_a467c2ec48625790f74de05f899f8620a}{lge\_devs}}[] = \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00117}00117         \{ \mbox{\hyperlink{if__lgereg_8h_af0e23480ee30dcbb5d977283930638d6}{LGE\_VENDORID}}, \mbox{\hyperlink{if__lgereg_8h_a740e04b49d7963ca0163c11cb45b9bbe}{LGE\_DEVICEID}}, \textcolor{stringliteral}{"{}Level 1 Gigabit Ethernet"{}} \},}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00118}00118         \{ 0, 0, NULL \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00119}00119 \};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00120}00120 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00121}00121 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__lge_8c_a7a9ae40ee7166713740914bd3e79fcf9}{lge\_probe}}(device\_t);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00122}00122 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__lge_8c_acda27634d3e3362be844bfdb58c4becd}{lge\_attach}}(device\_t);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00123}00123 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__lge_8c_aefc9d4c0331217df75ad603233ca39f5}{lge\_detach}}(device\_t);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00124}00124 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00125}00125 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__lge_8c_a9fb07171b3a8392f098a7c12a7033c2b}{lge\_alloc\_jumbo\_mem}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlge__softc}{lge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00126}00126 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__lge_8c_a81fe10434f524fdaa48f92f89e852b38}{lge\_free\_jumbo\_mem}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlge__softc}{lge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00127}00127 \textcolor{keyword}{static} \textcolor{keywordtype}{void} *\mbox{\hyperlink{if__lge_8c_aa8d7c94d2858e6c0d690df4dd3e42240}{lge\_jalloc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlge__softc}{lge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00128}00128 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__lge_8c_a53443d69810eaeeee3061a1624f9cf93}{lge\_jfree}}(\textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00129}00129 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00130}00130 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__lge_8c_aecc2e07885e6bad91afde4839a491d05}{lge\_newbuf}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlge__softc}{lge\_softc}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structlge__rx__desc}{lge\_rx\_desc}} *, \textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00131}00131 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__lge_8c_ad5f29342337eb7f3567ca05bf276edc7}{lge\_encap}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlge__softc}{lge\_softc}} *, \textcolor{keyword}{struct} mbuf *, u\_int32\_t *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00132}00132 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__lge_8c_ab5485b1bb0180d8fdc6d3f71741c536f}{lge\_rxeof}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlge__softc}{lge\_softc}} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00133}00133 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__lge_8c_a8c2f4fb93a14715b693c07b7cf27b98a}{lge\_rxeoc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlge__softc}{lge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00134}00134 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__lge_8c_a9983fd571bfe17221f45ee626b518712}{lge\_txeof}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlge__softc}{lge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00135}00135 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__lge_8c_a3e279bc7de37913b2cbc0263413f3347}{lge\_intr}}(\textcolor{keywordtype}{void} *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00136}00136 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__lge_8c_a688e2b91eb5e2144421ea3eeb1e95c3f}{lge\_tick}}(\textcolor{keywordtype}{void} *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00137}00137 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__lge_8c_afbbd2bf50dc1eb85fbcb1da7b67b80d0}{lge\_start}}(\textcolor{keyword}{struct} ifnet *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00138}00138 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__lge_8c_a38c27f49282f58b22b66add1f8af71b0}{lge\_start\_locked}}(\textcolor{keyword}{struct} ifnet *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00139}00139 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__lge_8c_a28cf356073ea72a57537f51d616a80c6}{lge\_ioctl}}(\textcolor{keyword}{struct} ifnet *, u\_long, caddr\_t);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00140}00140 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__lge_8c_acaa317157953f5f95fae8ad1ef6894ed}{lge\_init}}(\textcolor{keywordtype}{void} *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00141}00141 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__lge_8c_ac3f39c3e796d83d651cb9c5fc5796e08}{lge\_init\_locked}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlge__softc}{lge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00142}00142 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__lge_8c_a86be044ed884c02e2d26d3b35fcf6275}{lge\_stop}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlge__softc}{lge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00143}00143 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__lge_8c_ab57c127d31575d3987769aa74fc1b0f5}{lge\_watchdog}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlge__softc}{lge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00144}00144 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__lge_8c_a0155b546cdccab41f0b96d082bd46b87}{lge\_shutdown}}(device\_t);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00145}00145 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__lge_8c_a6b4f502fb50ae3a79851121396e059af}{lge\_ifmedia\_upd}}(\textcolor{keyword}{struct} ifnet *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00146}00146 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__lge_8c_a77f4759743d50be62495478820446824}{lge\_ifmedia\_upd\_locked}}(\textcolor{keyword}{struct} ifnet *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00147}00147 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__lge_8c_aec15d8928d8cb3078a8656bdb97c12e8}{lge\_ifmedia\_sts}}(\textcolor{keyword}{struct} ifnet *, \textcolor{keyword}{struct} ifmediareq *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00148}00148 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00149}00149 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__lge_8c_abd1e7dbf1c4968f880231868ade7b78c}{lge\_eeprom\_getword}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlge__softc}{lge\_softc}} *, \textcolor{keywordtype}{int}, u\_int16\_t *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00150}00150 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__lge_8c_a689d49e4f889495f972dfda913c24d13}{lge\_read\_eeprom}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlge__softc}{lge\_softc}} *, caddr\_t, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00151}00151 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00152}00152 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__lge_8c_a45348b816bbb7e7d0c2ce61e5de54757}{lge\_miibus\_readreg}}(device\_t, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00153}00153 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__lge_8c_a1b5bb076c2e30a3477c41792c6951ee2}{lge\_miibus\_writereg}}(device\_t, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00154}00154 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__lge_8c_a1b8222ac1b95420bc366ce3cc43fd532}{lge\_miibus\_statchg}}(device\_t);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00155}00155 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00156}00156 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__lge_8c_abb70d1d05d585a1a280b9d20e6d9fc77}{lge\_setmulti}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlge__softc}{lge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00157}00157 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{if__lge_8c_aa7585b21961b182417dd99c94ad91853}{lge\_reset}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlge__softc}{lge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00158}00158 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__lge_8c_a4826833381ce47d056f3965901577136}{lge\_list\_rx\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlge__softc}{lge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00159}00159 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{if__lge_8c_af1f84d773cea894e640a2984448b613d}{lge\_list\_tx\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlge__softc}{lge\_softc}} *);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00160}00160 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00161}00161 \textcolor{preprocessor}{\#ifdef LGE\_USEIOSPACE}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00162}\mbox{\hyperlink{if__lge_8c_afe6308b8a2c2a5a812af527fa6e6a542}{00162}} \textcolor{preprocessor}{\#define LGE\_RES                 SYS\_RES\_IOPORT}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00163}\mbox{\hyperlink{if__lge_8c_a1ada294006fd1c6f6c9ad204f702c506}{00163}} \textcolor{preprocessor}{\#define LGE\_RID                 LGE\_PCI\_LOIO}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00164}00164 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00165}00165 \textcolor{preprocessor}{\#define LGE\_RES                 SYS\_RES\_MEMORY}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00166}00166 \textcolor{preprocessor}{\#define LGE\_RID                 LGE\_PCI\_LOMEM}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00167}00167 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00168}00168 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00169}\mbox{\hyperlink{if__lge_8c_a6b44a8ff7e50a54e813316f99ed5bf35}{00169}} \textcolor{keyword}{static} device\_method\_t \mbox{\hyperlink{if__lge_8c_a6b44a8ff7e50a54e813316f99ed5bf35}{lge\_methods}}[] = \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00170}00170         \textcolor{comment}{/* Device interface */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00171}00171         DEVMETHOD(device\_probe,         \mbox{\hyperlink{if__lge_8c_a7a9ae40ee7166713740914bd3e79fcf9}{lge\_probe}}),}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00172}00172         DEVMETHOD(device\_attach,        \mbox{\hyperlink{if__lge_8c_acda27634d3e3362be844bfdb58c4becd}{lge\_attach}}),}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00173}00173         DEVMETHOD(device\_detach,        \mbox{\hyperlink{if__lge_8c_aefc9d4c0331217df75ad603233ca39f5}{lge\_detach}}),}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00174}00174         DEVMETHOD(device\_shutdown,      \mbox{\hyperlink{if__lge_8c_a0155b546cdccab41f0b96d082bd46b87}{lge\_shutdown}}),}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00175}00175 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00176}00176         \textcolor{comment}{/* MII interface */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00177}00177         DEVMETHOD(miibus\_readreg,       \mbox{\hyperlink{if__lge_8c_a45348b816bbb7e7d0c2ce61e5de54757}{lge\_miibus\_readreg}}),}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00178}00178         DEVMETHOD(miibus\_writereg,      \mbox{\hyperlink{if__lge_8c_a1b5bb076c2e30a3477c41792c6951ee2}{lge\_miibus\_writereg}}),}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00179}00179         DEVMETHOD(miibus\_statchg,       \mbox{\hyperlink{if__lge_8c_a1b8222ac1b95420bc366ce3cc43fd532}{lge\_miibus\_statchg}}),}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00180}00180 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00181}00181         DEVMETHOD\_END}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00182}00182 \};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00183}00183 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00184}\mbox{\hyperlink{if__lge_8c_a0f1ad7a61e2bd2999ed340c8f4ce38bf}{00184}} \textcolor{keyword}{static} driver\_t \mbox{\hyperlink{if__lge_8c_a0f1ad7a61e2bd2999ed340c8f4ce38bf}{lge\_driver}} = \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00185}00185         \textcolor{stringliteral}{"{}lge"{}},}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00186}00186         \mbox{\hyperlink{if__lge_8c_a6b44a8ff7e50a54e813316f99ed5bf35}{lge\_methods}},}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00187}00187         \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}})}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00188}00188 \};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00189}00189 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00190}\mbox{\hyperlink{if__lge_8c_a0661186d5be3a95a72dbd90bff506785}{00190}} \textcolor{keyword}{static} devclass\_t \mbox{\hyperlink{if__lge_8c_a0661186d5be3a95a72dbd90bff506785}{lge\_devclass}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00191}00191 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00192}\mbox{\hyperlink{if__lge_8c_af83285d5699306d2f1fd7d69ca3b21d8}{00192}} \mbox{\hyperlink{if__lge_8c_af83285d5699306d2f1fd7d69ca3b21d8}{DRIVER\_MODULE}}(lge, pci, \mbox{\hyperlink{if__lge_8c_a0f1ad7a61e2bd2999ed340c8f4ce38bf}{lge\_driver}}, \mbox{\hyperlink{if__lge_8c_a0661186d5be3a95a72dbd90bff506785}{lge\_devclass}}, 0, 0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00193}\mbox{\hyperlink{if__lge_8c_aff625a12c89a6ece499fe1e7a564ef20}{00193}} \mbox{\hyperlink{if__lge_8c_af83285d5699306d2f1fd7d69ca3b21d8}{DRIVER\_MODULE}}(miibus, lge, miibus\_driver, miibus\_devclass, 0, 0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00194}\mbox{\hyperlink{if__lge_8c_ab1943c869e0f73ba70d797852289e085}{00194}} \mbox{\hyperlink{if__lge_8c_ab1943c869e0f73ba70d797852289e085}{MODULE\_DEPEND}}(lge, pci, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00195}\mbox{\hyperlink{if__lge_8c_a155b6ea3b15058ae9bf2d31c28a94423}{00195}} \mbox{\hyperlink{if__lge_8c_ab1943c869e0f73ba70d797852289e085}{MODULE\_DEPEND}}(lge, ether, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00196}\mbox{\hyperlink{if__lge_8c_afbbd650a9e744d412a3e0e5dfd41bead}{00196}} \mbox{\hyperlink{if__lge_8c_ab1943c869e0f73ba70d797852289e085}{MODULE\_DEPEND}}(lge, miibus, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00197}00197 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00198}\mbox{\hyperlink{if__lge_8c_a47d3fea7169890193e2bb0d8147d8ee9}{00198}} \textcolor{preprocessor}{\#define LGE\_SETBIT(sc, reg, x)                          \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00199}00199 \textcolor{preprocessor}{        CSR\_WRITE\_4(sc, reg,                            \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00200}00200 \textcolor{preprocessor}{                CSR\_READ\_4(sc, reg) | (x))}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00201}00201 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00202}\mbox{\hyperlink{if__lge_8c_a35f0814c54eb65a3ad5c425c89e6a975}{00202}} \textcolor{preprocessor}{\#define LGE\_CLRBIT(sc, reg, x)                          \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00203}00203 \textcolor{preprocessor}{        CSR\_WRITE\_4(sc, reg,                            \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00204}00204 \textcolor{preprocessor}{                CSR\_READ\_4(sc, reg) \& \string~(x))}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00205}00205 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00206}\mbox{\hyperlink{if__lge_8c_a0fb020c2bbc2ae6912e0ec36c4011fa8}{00206}} \textcolor{preprocessor}{\#define SIO\_SET(x)                                      \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00207}00207 \textcolor{preprocessor}{        CSR\_WRITE\_4(sc, LGE\_MEAR, CSR\_READ\_4(sc, LGE\_MEAR) | x)}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00208}00208 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00209}\mbox{\hyperlink{if__lge_8c_a9cc6debe949fb8e5afad98294fa3a522}{00209}} \textcolor{preprocessor}{\#define SIO\_CLR(x)                                      \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00210}00210 \textcolor{preprocessor}{        CSR\_WRITE\_4(sc, LGE\_MEAR, CSR\_READ\_4(sc, LGE\_MEAR) \& \string~x)}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00211}00211 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00212}00212 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00213}00213 \textcolor{comment}{ * Read a word of data stored in the EEPROM at address 'addr.'}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00214}00214 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00215}00215 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00216}\mbox{\hyperlink{if__lge_8c_abd1e7dbf1c4968f880231868ade7b78c}{00216}} \mbox{\hyperlink{if__lge_8c_abd1e7dbf1c4968f880231868ade7b78c}{lge\_eeprom\_getword}}(sc, addr, dest)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00217}00217         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00218}00218         \textcolor{keywordtype}{int}                     addr;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00219}00219         u\_int16\_t               *dest;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00220}00220 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00221}00221         \textcolor{keywordtype}{int}                     i;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00222}00222         u\_int32\_t               val;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00223}00223 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00224}00224         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_adfe4a3e3a968d6b7f7c1991717858190}{LGE\_EECTL}}, \mbox{\hyperlink{if__lgereg_8h_aa742d6e0488b40ba0d93a26ad047dbb9}{LGE\_EECTL\_CMD\_READ}}|}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00225}00225             \mbox{\hyperlink{if__lgereg_8h_a8dbc876140f70159d30699d5c13656ef}{LGE\_EECTL\_SINGLEACCESS}}|((addr >> 1) << 8));}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00226}00226 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00227}00227         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__lgereg_8h_a83bb64fe639235951ac8fb7b4f367341}{LGE\_TIMEOUT}}; i++)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00228}00228                 \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{if__lgereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_adfe4a3e3a968d6b7f7c1991717858190}{LGE\_EECTL}}) \& \mbox{\hyperlink{if__lgereg_8h_aa742d6e0488b40ba0d93a26ad047dbb9}{LGE\_EECTL\_CMD\_READ}}))}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00229}00229                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00230}00230 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00231}00231         \textcolor{keywordflow}{if} (i == \mbox{\hyperlink{if__lgereg_8h_a83bb64fe639235951ac8fb7b4f367341}{LGE\_TIMEOUT}}) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00232}00232                 device\_printf(sc-\/>\mbox{\hyperlink{structlge__softc_a48b41ad357b297d5f6ba58a02d0062df}{lge\_dev}}, \textcolor{stringliteral}{"{}EEPROM read timed out\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00233}00233                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00234}00234         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00235}00235 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00236}00236         val = \mbox{\hyperlink{if__lgereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_a19ed939a830bb636d3573dcc193a93bb}{LGE\_EEDATA}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00237}00237 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00238}00238         \textcolor{keywordflow}{if} (addr \& 1)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00239}00239                 *dest = (val >> 16) \& 0xFFFF;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00240}00240         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00241}00241                 *dest = val \& 0xFFFF;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00242}00242 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00243}00243         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00244}00244 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00245}00245 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00246}00246 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00247}00247 \textcolor{comment}{ * Read a sequence of words from the EEPROM.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00248}00248 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00249}00249 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00250}\mbox{\hyperlink{if__lge_8c_a689d49e4f889495f972dfda913c24d13}{00250}} \mbox{\hyperlink{if__lge_8c_a689d49e4f889495f972dfda913c24d13}{lge\_read\_eeprom}}(sc, dest, off, cnt, swap)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00251}00251         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00252}00252         caddr\_t                 dest;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00253}00253         \textcolor{keywordtype}{int}                     off;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00254}00254         \textcolor{keywordtype}{int}                     cnt;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00255}00255         \textcolor{keywordtype}{int}                     swap;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00256}00256 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00257}00257         \textcolor{keywordtype}{int}                     i;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00258}00258         u\_int16\_t               word = 0, *ptr;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00259}00259 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00260}00260         \textcolor{keywordflow}{for} (i = 0; i < cnt; i++) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00261}00261                 \mbox{\hyperlink{if__lge_8c_abd1e7dbf1c4968f880231868ade7b78c}{lge\_eeprom\_getword}}(sc, off + i, \&word);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00262}00262                 ptr = (u\_int16\_t *)(dest + (i * 2));}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00263}00263                 \textcolor{keywordflow}{if} (swap)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00264}00264                         *ptr = ntohs(word);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00265}00265                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00266}00266                         *ptr = word;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00267}00267         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00268}00268 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00269}00269         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00270}00270 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00271}00271 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00272}00272 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00273}\mbox{\hyperlink{if__lge_8c_a45348b816bbb7e7d0c2ce61e5de54757}{00273}} \mbox{\hyperlink{if__lge_8c_a45348b816bbb7e7d0c2ce61e5de54757}{lge\_miibus\_readreg}}(dev, phy, reg)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00274}00274         device\_t                dev;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00275}00275         \textcolor{keywordtype}{int}                     phy, reg;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00276}00276 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00277}00277         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00278}00278         \textcolor{keywordtype}{int}                     i;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00279}00279 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00280}00280         sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00281}00281 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00282}00282         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00283}00283 \textcolor{comment}{         * If we have a non-\/PCS PHY, pretend that the internal}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00284}00284 \textcolor{comment}{         * autoneg stuff at PHY address 0 isn't there so that}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00285}00285 \textcolor{comment}{         * the miibus code will find only the GMII PHY.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00286}00286 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00287}00287         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structlge__softc_a98851e53c6ca22a9b053fc529669f73c}{lge\_pcs}} == 0 \&\& phy == 0)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00288}00288                 \textcolor{keywordflow}{return}(0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00289}00289 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00290}00290         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ad424562c8a015fdf62828ed6e7e524b8}{LGE\_GMIICTL}}, (phy << 8) | reg | \mbox{\hyperlink{if__lgereg_8h_af38f5832fd7b195e65e1fd5a2f62422b}{LGE\_GMIICMD\_READ}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00291}00291 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00292}00292         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__lgereg_8h_a83bb64fe639235951ac8fb7b4f367341}{LGE\_TIMEOUT}}; i++)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00293}00293                 \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{if__lgereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ad424562c8a015fdf62828ed6e7e524b8}{LGE\_GMIICTL}}) \& \mbox{\hyperlink{if__lgereg_8h_a5c22e8879fde78c510f3177851bd2cdd}{LGE\_GMIICTL\_CMDBUSY}}))}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00294}00294                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00295}00295 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00296}00296         \textcolor{keywordflow}{if} (i == \mbox{\hyperlink{if__lgereg_8h_a83bb64fe639235951ac8fb7b4f367341}{LGE\_TIMEOUT}}) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00297}00297                 device\_printf(sc-\/>\mbox{\hyperlink{structlge__softc_a48b41ad357b297d5f6ba58a02d0062df}{lge\_dev}}, \textcolor{stringliteral}{"{}PHY read timed out\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00298}00298                 \textcolor{keywordflow}{return}(0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00299}00299         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00300}00300 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00301}00301         \textcolor{keywordflow}{return}(\mbox{\hyperlink{if__lgereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ad424562c8a015fdf62828ed6e7e524b8}{LGE\_GMIICTL}}) >> 16);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00302}00302 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00303}00303 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00304}00304 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00305}\mbox{\hyperlink{if__lge_8c_a1b5bb076c2e30a3477c41792c6951ee2}{00305}} \mbox{\hyperlink{if__lge_8c_a1b5bb076c2e30a3477c41792c6951ee2}{lge\_miibus\_writereg}}(dev, phy, reg, data)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00306}00306         device\_t                dev;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00307}00307         \textcolor{keywordtype}{int}                     phy, reg, data;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00308}00308 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00309}00309         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00310}00310         \textcolor{keywordtype}{int}                     i;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00311}00311 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00312}00312         sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00313}00313 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00314}00314         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ad424562c8a015fdf62828ed6e7e524b8}{LGE\_GMIICTL}},}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00315}00315             (data << 16) | (phy << 8) | reg | \mbox{\hyperlink{if__lgereg_8h_aa80c21a5d89617b23beca2bfab6ba247}{LGE\_GMIICMD\_WRITE}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00316}00316 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00317}00317         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__lgereg_8h_a83bb64fe639235951ac8fb7b4f367341}{LGE\_TIMEOUT}}; i++)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00318}00318                 \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{if__lgereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ad424562c8a015fdf62828ed6e7e524b8}{LGE\_GMIICTL}}) \& \mbox{\hyperlink{if__lgereg_8h_a5c22e8879fde78c510f3177851bd2cdd}{LGE\_GMIICTL\_CMDBUSY}}))}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00319}00319                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00320}00320 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00321}00321         \textcolor{keywordflow}{if} (i == \mbox{\hyperlink{if__lgereg_8h_a83bb64fe639235951ac8fb7b4f367341}{LGE\_TIMEOUT}}) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00322}00322                 device\_printf(sc-\/>\mbox{\hyperlink{structlge__softc_a48b41ad357b297d5f6ba58a02d0062df}{lge\_dev}}, \textcolor{stringliteral}{"{}PHY write timed out\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00323}00323                 \textcolor{keywordflow}{return}(0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00324}00324         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00325}00325 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00326}00326         \textcolor{keywordflow}{return}(0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00327}00327 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00328}00328 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00329}00329 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00330}\mbox{\hyperlink{if__lge_8c_a1b8222ac1b95420bc366ce3cc43fd532}{00330}} \mbox{\hyperlink{if__lge_8c_a1b8222ac1b95420bc366ce3cc43fd532}{lge\_miibus\_statchg}}(dev)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00331}00331         device\_t                dev;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00332}00332 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00333}00333         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00334}00334         \textcolor{keyword}{struct }mii\_data         *mii;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00335}00335 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00336}00336         sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00337}00337         mii = device\_get\_softc(sc-\/>\mbox{\hyperlink{structlge__softc_a35d02416dcbefe0adc6dd3a8ec3780f7}{lge\_miibus}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00338}00338 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00339}00339         \mbox{\hyperlink{if__lge_8c_a35f0814c54eb65a3ad5c425c89e6a975}{LGE\_CLRBIT}}(sc, \mbox{\hyperlink{if__lgereg_8h_a976225a56c6ee297e1fcd4a5b5517bfe}{LGE\_GMIIMODE}}, \mbox{\hyperlink{if__lgereg_8h_a7aedbecb81cb25346c821de2c1202a84}{LGE\_GMIIMODE\_SPEED}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00340}00340         \textcolor{keywordflow}{switch} (IFM\_SUBTYPE(mii-\/>mii\_media\_active)) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00341}00341         \textcolor{keywordflow}{case} IFM\_1000\_T:}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00342}00342         \textcolor{keywordflow}{case} IFM\_1000\_SX:}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00343}00343                 \mbox{\hyperlink{if__lge_8c_a47d3fea7169890193e2bb0d8147d8ee9}{LGE\_SETBIT}}(sc, \mbox{\hyperlink{if__lgereg_8h_a976225a56c6ee297e1fcd4a5b5517bfe}{LGE\_GMIIMODE}}, \mbox{\hyperlink{if__lgereg_8h_a6e7fc74e062f98984a74cf3c7a4cb1a6}{LGE\_SPEED\_1000}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00344}00344                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00345}00345         \textcolor{keywordflow}{case} IFM\_100\_TX:}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00346}00346                 \mbox{\hyperlink{if__lge_8c_a47d3fea7169890193e2bb0d8147d8ee9}{LGE\_SETBIT}}(sc, \mbox{\hyperlink{if__lgereg_8h_a976225a56c6ee297e1fcd4a5b5517bfe}{LGE\_GMIIMODE}}, \mbox{\hyperlink{if__lgereg_8h_afcd7fccb16ab4da26dcce4e924090f96}{LGE\_SPEED\_100}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00347}00347                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00348}00348         \textcolor{keywordflow}{case} IFM\_10\_T:}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00349}00349                 \mbox{\hyperlink{if__lge_8c_a47d3fea7169890193e2bb0d8147d8ee9}{LGE\_SETBIT}}(sc, \mbox{\hyperlink{if__lgereg_8h_a976225a56c6ee297e1fcd4a5b5517bfe}{LGE\_GMIIMODE}}, \mbox{\hyperlink{if__lgereg_8h_a77cb2917df825b4828903b95efb10e42}{LGE\_SPEED\_10}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00350}00350                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00351}00351         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00352}00352                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00353}00353 \textcolor{comment}{                 * Choose something, even if it's wrong. Clearing}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00354}00354 \textcolor{comment}{                 * all the bits will hose autoneg on the internal}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00355}00355 \textcolor{comment}{                 * PHY.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00356}00356 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00357}00357                 \mbox{\hyperlink{if__lge_8c_a47d3fea7169890193e2bb0d8147d8ee9}{LGE\_SETBIT}}(sc, \mbox{\hyperlink{if__lgereg_8h_a976225a56c6ee297e1fcd4a5b5517bfe}{LGE\_GMIIMODE}}, \mbox{\hyperlink{if__lgereg_8h_a6e7fc74e062f98984a74cf3c7a4cb1a6}{LGE\_SPEED\_1000}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00358}00358                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00359}00359         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00360}00360 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00361}00361         \textcolor{keywordflow}{if} ((mii-\/>mii\_media\_active \& IFM\_GMASK) == IFM\_FDX) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00362}00362                 \mbox{\hyperlink{if__lge_8c_a47d3fea7169890193e2bb0d8147d8ee9}{LGE\_SETBIT}}(sc, \mbox{\hyperlink{if__lgereg_8h_a976225a56c6ee297e1fcd4a5b5517bfe}{LGE\_GMIIMODE}}, \mbox{\hyperlink{if__lgereg_8h_a932a7d06f3b3361e0ac058d6b546bfab}{LGE\_GMIIMODE\_FDX}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00363}00363         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00364}00364                 \mbox{\hyperlink{if__lge_8c_a35f0814c54eb65a3ad5c425c89e6a975}{LGE\_CLRBIT}}(sc, \mbox{\hyperlink{if__lgereg_8h_a976225a56c6ee297e1fcd4a5b5517bfe}{LGE\_GMIIMODE}}, \mbox{\hyperlink{if__lgereg_8h_a932a7d06f3b3361e0ac058d6b546bfab}{LGE\_GMIIMODE\_FDX}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00365}00365         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00366}00366 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00367}00367         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00368}00368 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00369}00369 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00370}00370 \textcolor{keyword}{static} u\_int}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00371}\mbox{\hyperlink{if__lge_8c_ae5b16852ddb696e6aeca991449571beb}{00371}} \mbox{\hyperlink{if__lge_8c_ae5b16852ddb696e6aeca991449571beb}{lge\_hash\_maddr}}(\textcolor{keywordtype}{void} *arg, \textcolor{keyword}{struct} sockaddr\_dl *sdl, u\_int count)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00372}00372 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00373}00373         uint32\_t h, *hashes = arg;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00374}00374 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00375}00375         h = ether\_crc32\_be(LLADDR(sdl), ETHER\_ADDR\_LEN) >> 26;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00376}00376         \textcolor{keywordflow}{if} (h < 32)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00377}00377                 hashes[0] |= (1 << h);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00378}00378         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00379}00379                 hashes[1] |= (1 << (h -\/ 32));}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00380}00380         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00381}00381 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00382}00382 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00383}00383 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00384}\mbox{\hyperlink{if__lge_8c_abb70d1d05d585a1a280b9d20e6d9fc77}{00384}} \mbox{\hyperlink{if__lge_8c_abb70d1d05d585a1a280b9d20e6d9fc77}{lge\_setmulti}}(sc)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00385}00385         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00386}00386 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00387}00387         \textcolor{keyword}{struct }ifnet            *ifp;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00388}00388         uint32\_t hashes[2] = \{ 0, 0 \};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00389}00389 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00390}00390         ifp = sc-\/>\mbox{\hyperlink{structlge__softc_aaa8504c7457a98c1e87d21e99593d163}{lge\_ifp}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00391}00391         \mbox{\hyperlink{if__lgereg_8h_aaccd7e5b4a97745229ba5cfa6653cd8d}{LGE\_LOCK\_ASSERT}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00392}00392 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00393}00393         \textcolor{comment}{/* Make sure multicast hash table is enabled. */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00394}00394         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ab7c0aea2e7d1d0bddc038e80b28cd7bf}{LGE\_MODE1}}, \mbox{\hyperlink{if__lgereg_8h_ae1850fd752648095abc122ef8d7feea5}{LGE\_MODE1\_SETRST\_CTL1}}|\mbox{\hyperlink{if__lgereg_8h_a48958b96c318cbc453f065fafd800467}{LGE\_MODE1\_RX\_MCAST}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00395}00395 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00396}00396         \textcolor{keywordflow}{if} (ifp-\/>if\_flags \& IFF\_ALLMULTI || ifp-\/>if\_flags \& IFF\_PROMISC) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00397}00397                 \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_a84fff9b5ba1e552248648c4de4ea639e}{LGE\_MAR0}}, 0xFFFFFFFF);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00398}00398                 \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ad13a2886e24cfeec0a1a302d717b42e4}{LGE\_MAR1}}, 0xFFFFFFFF);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00399}00399                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00400}00400         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00401}00401 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00402}00402         \textcolor{comment}{/* first, zot all the existing hash bits */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00403}00403         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_a84fff9b5ba1e552248648c4de4ea639e}{LGE\_MAR0}}, 0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00404}00404         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ad13a2886e24cfeec0a1a302d717b42e4}{LGE\_MAR1}}, 0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00405}00405 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00406}00406         \textcolor{comment}{/* now program new ones */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00407}00407         if\_foreach\_llmaddr(ifp, \mbox{\hyperlink{if__lge_8c_ae5b16852ddb696e6aeca991449571beb}{lge\_hash\_maddr}}, hashes);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00408}00408 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00409}00409         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_a84fff9b5ba1e552248648c4de4ea639e}{LGE\_MAR0}}, hashes[0]);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00410}00410         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ad13a2886e24cfeec0a1a302d717b42e4}{LGE\_MAR1}}, hashes[1]);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00411}00411 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00412}00412         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00413}00413 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00414}00414 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00415}00415 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00416}\mbox{\hyperlink{if__lge_8c_aa7585b21961b182417dd99c94ad91853}{00416}} \mbox{\hyperlink{if__lge_8c_aa7585b21961b182417dd99c94ad91853}{lge\_reset}}(sc)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00417}00417         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00418}00418 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00419}00419         \textcolor{keywordtype}{int}                     i;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00420}00420 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00421}00421         \mbox{\hyperlink{if__lge_8c_a47d3fea7169890193e2bb0d8147d8ee9}{LGE\_SETBIT}}(sc, \mbox{\hyperlink{if__lgereg_8h_ab7c0aea2e7d1d0bddc038e80b28cd7bf}{LGE\_MODE1}}, \mbox{\hyperlink{if__lgereg_8h_a999b53e1b006d947b290c1b880621727}{LGE\_MODE1\_SETRST\_CTL0}}|\mbox{\hyperlink{if__lgereg_8h_a0342fe94316107f3d8b7ec11fd8a588d}{LGE\_MODE1\_SOFTRST}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00422}00422 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00423}00423         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__lgereg_8h_a83bb64fe639235951ac8fb7b4f367341}{LGE\_TIMEOUT}}; i++) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00424}00424                 \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{if__lgereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ab7c0aea2e7d1d0bddc038e80b28cd7bf}{LGE\_MODE1}}) \& \mbox{\hyperlink{if__lgereg_8h_a0342fe94316107f3d8b7ec11fd8a588d}{LGE\_MODE1\_SOFTRST}}))}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00425}00425                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00426}00426         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00427}00427 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00428}00428         \textcolor{keywordflow}{if} (i == \mbox{\hyperlink{if__lgereg_8h_a83bb64fe639235951ac8fb7b4f367341}{LGE\_TIMEOUT}})}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00429}00429                 device\_printf(sc-\/>\mbox{\hyperlink{structlge__softc_a48b41ad357b297d5f6ba58a02d0062df}{lge\_dev}}, \textcolor{stringliteral}{"{}reset never completed\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00430}00430 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00431}00431         \textcolor{comment}{/* Wait a little while for the chip to get its brains in order. */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00432}00432         DELAY(1000);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00433}00433 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00434}00434         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00435}00435 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00436}00436 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00437}00437 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00438}00438 \textcolor{comment}{ * Probe for a Level 1 chip. Check the PCI vendor and device}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00439}00439 \textcolor{comment}{ * IDs against our list and return a device name if we find a match.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00440}00440 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00441}00441 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00442}\mbox{\hyperlink{if__lge_8c_a7a9ae40ee7166713740914bd3e79fcf9}{00442}} \mbox{\hyperlink{if__lge_8c_a7a9ae40ee7166713740914bd3e79fcf9}{lge\_probe}}(dev)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00443}00443         device\_t                dev;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00444}00444 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00445}00445         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__type}{lge\_type}}   *t;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00446}00446 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00447}00447         t = \mbox{\hyperlink{if__lge_8c_a467c2ec48625790f74de05f899f8620a}{lge\_devs}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00448}00448 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00449}00449         \textcolor{keywordflow}{while}(t-\/>\mbox{\hyperlink{structlge__type_a37093af2574957b57eed250d440bb5c9}{lge\_name}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00450}00450                 \textcolor{keywordflow}{if} ((pci\_get\_vendor(dev) == t-\/>\mbox{\hyperlink{structlge__type_ae8bda3920f43822bd7b731f9ec1b4950}{lge\_vid}}) \&\&}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00451}00451                     (pci\_get\_device(dev) == t-\/>\mbox{\hyperlink{structlge__type_a8b8ee4dedd4e22576675efb55f826895}{lge\_did}})) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00452}00452                         device\_set\_desc(dev, t-\/>\mbox{\hyperlink{structlge__type_a37093af2574957b57eed250d440bb5c9}{lge\_name}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00453}00453                         \textcolor{keywordflow}{return}(BUS\_PROBE\_DEFAULT);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00454}00454                 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00455}00455                 t++;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00456}00456         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00457}00457 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00458}00458         \textcolor{keywordflow}{return}(ENXIO);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00459}00459 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00460}00460 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00461}00461 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00462}00462 \textcolor{comment}{ * Attach the interface. Allocate softc structures, do ifmedia}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00463}00463 \textcolor{comment}{ * setup and ethernet/BPF attach.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00464}00464 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00465}00465 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00466}\mbox{\hyperlink{if__lge_8c_acda27634d3e3362be844bfdb58c4becd}{00466}} \mbox{\hyperlink{if__lge_8c_acda27634d3e3362be844bfdb58c4becd}{lge\_attach}}(dev)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00467}00467         device\_t                dev;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00468}00468 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00469}00469         u\_char                  eaddr[ETHER\_ADDR\_LEN];}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00470}00470         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00471}00471         \textcolor{keyword}{struct }ifnet            *ifp = NULL;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00472}00472         \textcolor{keywordtype}{int}                     error = 0, rid;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00473}00473 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00474}00474         sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00475}00475         sc-\/>\mbox{\hyperlink{structlge__softc_a48b41ad357b297d5f6ba58a02d0062df}{lge\_dev}} = dev;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00476}00476         }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00477}00477         mtx\_init(\&sc-\/>\mbox{\hyperlink{structlge__softc_a063cb3ce6e7ba9b4eeaa7f7b9f8d956e}{lge\_mtx}}, device\_get\_nameunit(dev), MTX\_NETWORK\_LOCK,}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00478}00478             MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00479}00479         callout\_init\_mtx(\&sc-\/>\mbox{\hyperlink{structlge__softc_a7c5d61da7768a58fe8615020b0e8aef3}{lge\_stat\_callout}}, \&sc-\/>\mbox{\hyperlink{structlge__softc_a063cb3ce6e7ba9b4eeaa7f7b9f8d956e}{lge\_mtx}}, 0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00480}00480 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00481}00481         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00482}00482 \textcolor{comment}{         * Map control/status registers.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00483}00483 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00484}00484         pci\_enable\_busmaster(dev);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00485}00485 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00486}00486         rid = \mbox{\hyperlink{if__lge_8c_a1ada294006fd1c6f6c9ad204f702c506}{LGE\_RID}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00487}00487         sc-\/>\mbox{\hyperlink{structlge__softc_aff473c019e6c776bb528474b7cfc09ac}{lge\_res}} = bus\_alloc\_resource\_any(dev, \mbox{\hyperlink{if__lge_8c_afe6308b8a2c2a5a812af527fa6e6a542}{LGE\_RES}}, \&rid, RF\_ACTIVE);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00488}00488 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00489}00489         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structlge__softc_aff473c019e6c776bb528474b7cfc09ac}{lge\_res}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00490}00490                 device\_printf(dev, \textcolor{stringliteral}{"{}couldn't map ports/memory\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00491}00491                 error = ENXIO;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00492}00492                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00493}00493         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00494}00494 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00495}00495         sc-\/>\mbox{\hyperlink{structlge__softc_a46df768cf06e5df15a07f9c4d6449dff}{lge\_btag}} = rman\_get\_bustag(sc-\/>\mbox{\hyperlink{structlge__softc_aff473c019e6c776bb528474b7cfc09ac}{lge\_res}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00496}00496         sc-\/>\mbox{\hyperlink{structlge__softc_a7b5de0c246624f7190fdd2caa44ae113}{lge\_bhandle}} = rman\_get\_bushandle(sc-\/>\mbox{\hyperlink{structlge__softc_aff473c019e6c776bb528474b7cfc09ac}{lge\_res}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00497}00497 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00498}00498         \textcolor{comment}{/* Allocate interrupt */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00499}00499         rid = 0;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00500}00500         sc-\/>\mbox{\hyperlink{structlge__softc_acba598d3bc9f21e1353669ed26f5ba81}{lge\_irq}} = bus\_alloc\_resource\_any(dev, SYS\_RES\_IRQ, \&rid,}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00501}00501             RF\_SHAREABLE | RF\_ACTIVE);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00502}00502 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00503}00503         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structlge__softc_acba598d3bc9f21e1353669ed26f5ba81}{lge\_irq}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00504}00504                 device\_printf(dev, \textcolor{stringliteral}{"{}couldn't map interrupt\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00505}00505                 error = ENXIO;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00506}00506                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00507}00507         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00508}00508 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00509}00509         \textcolor{comment}{/* Reset the adapter. */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00510}00510         \mbox{\hyperlink{if__lge_8c_aa7585b21961b182417dd99c94ad91853}{lge\_reset}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00511}00511 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00512}00512         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00513}00513 \textcolor{comment}{         * Get station address from the EEPROM.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00514}00514 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00515}00515         \mbox{\hyperlink{if__lge_8c_a689d49e4f889495f972dfda913c24d13}{lge\_read\_eeprom}}(sc, (caddr\_t)\&eaddr[0], \mbox{\hyperlink{if__lgereg_8h_a416db5e9698b47d4a20624ec6bcf1739}{LGE\_EE\_NODEADDR\_0}}, 1, 0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00516}00516         \mbox{\hyperlink{if__lge_8c_a689d49e4f889495f972dfda913c24d13}{lge\_read\_eeprom}}(sc, (caddr\_t)\&eaddr[2], \mbox{\hyperlink{if__lgereg_8h_ab6ec201e3656a7f3319e98e286b6aa9c}{LGE\_EE\_NODEADDR\_1}}, 1, 0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00517}00517         \mbox{\hyperlink{if__lge_8c_a689d49e4f889495f972dfda913c24d13}{lge\_read\_eeprom}}(sc, (caddr\_t)\&eaddr[4], \mbox{\hyperlink{if__lgereg_8h_ae14a60c7261d8442806c8062c7e09f95}{LGE\_EE\_NODEADDR\_2}}, 1, 0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00518}00518 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00519}00519         sc-\/>\mbox{\hyperlink{structlge__softc_a32d9253cb35fc6fc5ac031ff88d50a06}{lge\_ldata}} = contigmalloc(\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlge__list__data}{lge\_list\_data}}), M\_DEVBUF,}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00520}00520             M\_NOWAIT | M\_ZERO, 0, 0xffffffff, PAGE\_SIZE, 0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00521}00521 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00522}00522         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structlge__softc_a32d9253cb35fc6fc5ac031ff88d50a06}{lge\_ldata}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00523}00523                 device\_printf(dev, \textcolor{stringliteral}{"{}no memory for list buffers!\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00524}00524                 error = ENXIO;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00525}00525                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00526}00526         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00527}00527 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00528}00528         \textcolor{comment}{/* Try to allocate memory for jumbo buffers. */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00529}00529         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__lge_8c_a9fb07171b3a8392f098a7c12a7033c2b}{lge\_alloc\_jumbo\_mem}}(sc)) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00530}00530                 device\_printf(dev, \textcolor{stringliteral}{"{}jumbo buffer allocation failed\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00531}00531                 error = ENXIO;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00532}00532                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00533}00533         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00534}00534 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00535}00535         ifp = sc-\/>\mbox{\hyperlink{structlge__softc_aaa8504c7457a98c1e87d21e99593d163}{lge\_ifp}} = if\_alloc(IFT\_ETHER);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00536}00536         \textcolor{keywordflow}{if} (ifp == NULL) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00537}00537                 device\_printf(dev, \textcolor{stringliteral}{"{}can not if\_alloc()\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00538}00538                 error = ENOSPC;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00539}00539                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00540}00540         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00541}00541         ifp-\/>if\_softc = sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00542}00542         if\_initname(ifp, device\_get\_name(dev), device\_get\_unit(dev));}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00543}00543         ifp-\/>if\_flags = IFF\_BROADCAST | IFF\_SIMPLEX | IFF\_MULTICAST;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00544}00544         ifp-\/>if\_ioctl = \mbox{\hyperlink{if__lge_8c_a28cf356073ea72a57537f51d616a80c6}{lge\_ioctl}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00545}00545         ifp-\/>if\_start = \mbox{\hyperlink{if__lge_8c_afbbd2bf50dc1eb85fbcb1da7b67b80d0}{lge\_start}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00546}00546         ifp-\/>if\_init = \mbox{\hyperlink{if__lge_8c_acaa317157953f5f95fae8ad1ef6894ed}{lge\_init}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00547}00547         ifp-\/>if\_snd.ifq\_maxlen = \mbox{\hyperlink{if__lgereg_8h_a30fcd71cdba5c575105b3b6ed30ce91d}{LGE\_TX\_LIST\_CNT}} -\/ 1;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00548}00548         ifp-\/>if\_capabilities = IFCAP\_RXCSUM;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00549}00549         ifp-\/>if\_capenable = ifp-\/>if\_capabilities;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00550}00550 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00551}00551         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__lgereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_a976225a56c6ee297e1fcd4a5b5517bfe}{LGE\_GMIIMODE}}) \& \mbox{\hyperlink{if__lgereg_8h_a4407c46f52b5965cdc30aa6c9830f787}{LGE\_GMIIMODE\_PCSENH}})}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00552}00552                 sc-\/>\mbox{\hyperlink{structlge__softc_a98851e53c6ca22a9b053fc529669f73c}{lge\_pcs}} = 1;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00553}00553         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00554}00554                 sc-\/>\mbox{\hyperlink{structlge__softc_a98851e53c6ca22a9b053fc529669f73c}{lge\_pcs}} = 0;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00555}00555 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00556}00556         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00557}00557 \textcolor{comment}{         * Do MII setup.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00558}00558 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00559}00559         error = mii\_attach(dev, \&sc-\/>\mbox{\hyperlink{structlge__softc_a35d02416dcbefe0adc6dd3a8ec3780f7}{lge\_miibus}}, ifp, \mbox{\hyperlink{if__lge_8c_a6b4f502fb50ae3a79851121396e059af}{lge\_ifmedia\_upd}},}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00560}00560             \mbox{\hyperlink{if__lge_8c_aec15d8928d8cb3078a8656bdb97c12e8}{lge\_ifmedia\_sts}}, BMSR\_DEFCAPMASK, MII\_PHY\_ANY, MII\_OFFSET\_ANY, 0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00561}00561         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00562}00562                 device\_printf(dev, \textcolor{stringliteral}{"{}attaching PHYs failed\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00563}00563                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00564}00564         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00565}00565 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00566}00566         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00567}00567 \textcolor{comment}{         * Call MI attach routine.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00568}00568 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00569}00569         ether\_ifattach(ifp, eaddr);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00570}00570 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00571}00571         error = bus\_setup\_intr(dev, sc-\/>\mbox{\hyperlink{structlge__softc_acba598d3bc9f21e1353669ed26f5ba81}{lge\_irq}}, INTR\_TYPE\_NET | INTR\_MPSAFE,}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00572}00572             NULL, \mbox{\hyperlink{if__lge_8c_a3e279bc7de37913b2cbc0263413f3347}{lge\_intr}}, sc, \&sc-\/>\mbox{\hyperlink{structlge__softc_a3c4f90a11a9044d596abb968f5c7b564}{lge\_intrhand}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00573}00573 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00574}00574         \textcolor{keywordflow}{if} (error) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00575}00575                 ether\_ifdetach(ifp);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00576}00576                 device\_printf(dev, \textcolor{stringliteral}{"{}couldn't set up irq\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00577}00577                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00578}00578         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00579}00579         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00580}00580 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00581}00581 fail:}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00582}00582         \mbox{\hyperlink{if__lge_8c_a81fe10434f524fdaa48f92f89e852b38}{lge\_free\_jumbo\_mem}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00583}00583         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structlge__softc_a32d9253cb35fc6fc5ac031ff88d50a06}{lge\_ldata}})}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00584}00584                 contigfree(sc-\/>\mbox{\hyperlink{structlge__softc_a32d9253cb35fc6fc5ac031ff88d50a06}{lge\_ldata}},}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00585}00585                     \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlge__list__data}{lge\_list\_data}}), M\_DEVBUF);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00586}00586         \textcolor{keywordflow}{if} (ifp)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00587}00587                 if\_free(ifp);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00588}00588         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structlge__softc_acba598d3bc9f21e1353669ed26f5ba81}{lge\_irq}})}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00589}00589                 bus\_release\_resource(dev, SYS\_RES\_IRQ, 0, sc-\/>\mbox{\hyperlink{structlge__softc_acba598d3bc9f21e1353669ed26f5ba81}{lge\_irq}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00590}00590         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structlge__softc_aff473c019e6c776bb528474b7cfc09ac}{lge\_res}})}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00591}00591                 bus\_release\_resource(dev, \mbox{\hyperlink{if__lge_8c_afe6308b8a2c2a5a812af527fa6e6a542}{LGE\_RES}}, \mbox{\hyperlink{if__lge_8c_a1ada294006fd1c6f6c9ad204f702c506}{LGE\_RID}}, sc-\/>\mbox{\hyperlink{structlge__softc_aff473c019e6c776bb528474b7cfc09ac}{lge\_res}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00592}00592         mtx\_destroy(\&sc-\/>\mbox{\hyperlink{structlge__softc_a063cb3ce6e7ba9b4eeaa7f7b9f8d956e}{lge\_mtx}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00593}00593         \textcolor{keywordflow}{return}(error);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00594}00594 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00595}00595 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00596}00596 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00597}\mbox{\hyperlink{if__lge_8c_aefc9d4c0331217df75ad603233ca39f5}{00597}} \mbox{\hyperlink{if__lge_8c_aefc9d4c0331217df75ad603233ca39f5}{lge\_detach}}(dev)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00598}00598         device\_t                dev;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00599}00599 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00600}00600         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00601}00601         \textcolor{keyword}{struct }ifnet            *ifp;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00602}00602 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00603}00603         sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00604}00604         ifp = sc-\/>\mbox{\hyperlink{structlge__softc_aaa8504c7457a98c1e87d21e99593d163}{lge\_ifp}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00605}00605 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00606}00606         \mbox{\hyperlink{if__lgereg_8h_a979c0b0266ec6d6efc9d2e40d8580d31}{LGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00607}00607         \mbox{\hyperlink{if__lge_8c_aa7585b21961b182417dd99c94ad91853}{lge\_reset}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00608}00608         \mbox{\hyperlink{if__lge_8c_a86be044ed884c02e2d26d3b35fcf6275}{lge\_stop}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00609}00609         \mbox{\hyperlink{if__lgereg_8h_a2fba991aeb843a23de30e7d196e2f119}{LGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00610}00610         callout\_drain(\&sc-\/>\mbox{\hyperlink{structlge__softc_a7c5d61da7768a58fe8615020b0e8aef3}{lge\_stat\_callout}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00611}00611         ether\_ifdetach(ifp);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00612}00612 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00613}00613         bus\_generic\_detach(dev);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00614}00614         device\_delete\_child(dev, sc-\/>\mbox{\hyperlink{structlge__softc_a35d02416dcbefe0adc6dd3a8ec3780f7}{lge\_miibus}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00615}00615 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00616}00616         bus\_teardown\_intr(dev, sc-\/>\mbox{\hyperlink{structlge__softc_acba598d3bc9f21e1353669ed26f5ba81}{lge\_irq}}, sc-\/>\mbox{\hyperlink{structlge__softc_a3c4f90a11a9044d596abb968f5c7b564}{lge\_intrhand}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00617}00617         bus\_release\_resource(dev, SYS\_RES\_IRQ, 0, sc-\/>\mbox{\hyperlink{structlge__softc_acba598d3bc9f21e1353669ed26f5ba81}{lge\_irq}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00618}00618         bus\_release\_resource(dev, \mbox{\hyperlink{if__lge_8c_afe6308b8a2c2a5a812af527fa6e6a542}{LGE\_RES}}, \mbox{\hyperlink{if__lge_8c_a1ada294006fd1c6f6c9ad204f702c506}{LGE\_RID}}, sc-\/>\mbox{\hyperlink{structlge__softc_aff473c019e6c776bb528474b7cfc09ac}{lge\_res}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00619}00619 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00620}00620         contigfree(sc-\/>\mbox{\hyperlink{structlge__softc_a32d9253cb35fc6fc5ac031ff88d50a06}{lge\_ldata}}, \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlge__list__data}{lge\_list\_data}}), M\_DEVBUF);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00621}00621         if\_free(ifp);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00622}00622         \mbox{\hyperlink{if__lge_8c_a81fe10434f524fdaa48f92f89e852b38}{lge\_free\_jumbo\_mem}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00623}00623         mtx\_destroy(\&sc-\/>\mbox{\hyperlink{structlge__softc_a063cb3ce6e7ba9b4eeaa7f7b9f8d956e}{lge\_mtx}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00624}00624 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00625}00625         \textcolor{keywordflow}{return}(0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00626}00626 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00627}00627 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00628}00628 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00629}00629 \textcolor{comment}{ * Initialize the transmit descriptors.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00630}00630 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00631}00631 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00632}\mbox{\hyperlink{if__lge_8c_af1f84d773cea894e640a2984448b613d}{00632}} \mbox{\hyperlink{if__lge_8c_af1f84d773cea894e640a2984448b613d}{lge\_list\_tx\_init}}(sc)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00633}00633         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00634}00634 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00635}00635         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__list__data}{lge\_list\_data}}       *ld;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00636}00636         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__ring__data}{lge\_ring\_data}}       *cd;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00637}00637         \textcolor{keywordtype}{int}                     i;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00638}00638 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00639}00639         cd = \&sc-\/>\mbox{\hyperlink{structlge__softc_aa1500b244a7053375e45eeaee1aa134d}{lge\_cdata}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00640}00640         ld = sc-\/>\mbox{\hyperlink{structlge__softc_a32d9253cb35fc6fc5ac031ff88d50a06}{lge\_ldata}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00641}00641         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__lgereg_8h_a30fcd71cdba5c575105b3b6ed30ce91d}{LGE\_TX\_LIST\_CNT}}; i++) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00642}00642                 ld-\/>\mbox{\hyperlink{structlge__list__data_a283d25348ade381e32b61bade75d20ef}{lge\_tx\_list}}[i].\mbox{\hyperlink{structlge__tx__desc_ac884cd6601608ae923bf8ef11118f2a4}{lge\_mbuf}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00643}00643                 ld-\/>\mbox{\hyperlink{structlge__list__data_a283d25348ade381e32b61bade75d20ef}{lge\_tx\_list}}[i].\mbox{\hyperlink{structlge__tx__desc_a113d45eccb5fdf30c05da8ac79413552}{lge\_ctl}} = 0;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00644}00644         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00645}00645 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00646}00646         cd-\/>\mbox{\hyperlink{structlge__ring__data_aae1337c962b6c91c13bb39113e093919}{lge\_tx\_prod}} = cd-\/>\mbox{\hyperlink{structlge__ring__data_a72592268a4bea8bee3d15c649da5aeaf}{lge\_tx\_cons}} = 0;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00647}00647 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00648}00648         \textcolor{keywordflow}{return}(0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00649}00649 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00650}00650 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00651}00651 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00652}00652 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00653}00653 \textcolor{comment}{ * Initialize the RX descriptors and allocate mbufs for them. Note that}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00654}00654 \textcolor{comment}{ * we arralge the descriptors in a closed ring, so that the last descriptor}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00655}00655 \textcolor{comment}{ * points back to the first.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00656}00656 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00657}00657 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00658}\mbox{\hyperlink{if__lge_8c_a4826833381ce47d056f3965901577136}{00658}} \mbox{\hyperlink{if__lge_8c_a4826833381ce47d056f3965901577136}{lge\_list\_rx\_init}}(sc)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00659}00659         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00660}00660 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00661}00661         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__list__data}{lge\_list\_data}}       *ld;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00662}00662         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__ring__data}{lge\_ring\_data}}       *cd;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00663}00663         \textcolor{keywordtype}{int}                     i;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00664}00664 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00665}00665         ld = sc-\/>\mbox{\hyperlink{structlge__softc_a32d9253cb35fc6fc5ac031ff88d50a06}{lge\_ldata}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00666}00666         cd = \&sc-\/>\mbox{\hyperlink{structlge__softc_aa1500b244a7053375e45eeaee1aa134d}{lge\_cdata}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00667}00667 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00668}00668         cd-\/>\mbox{\hyperlink{structlge__ring__data_a3e12b906e3ece6c76e46b6e5e5acb39e}{lge\_rx\_prod}} = cd-\/>\mbox{\hyperlink{structlge__ring__data_a1754921b80a68a13ce9704e84e146050}{lge\_rx\_cons}} = 0;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00669}00669 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00670}00670         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_a71b218f8ae0303e6c30f3b894097b1e5}{LGE\_RXDESC\_ADDR\_HI}}, 0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00671}00671 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00672}00672         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__lgereg_8h_aa04ae3e3ea59f1d58f2eacc5f5bcf373}{LGE\_RX\_LIST\_CNT}}; i++) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00673}00673                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__lgereg_8h_a394044f8c65a429cea3c1993c9ed7766}{CSR\_READ\_1}}(sc, \mbox{\hyperlink{if__lgereg_8h_a6fffd8e891b5e71adff02877f033b5a0}{LGE\_RXCMDFREE\_8BIT}}) == 0)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00674}00674                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00675}00675                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__lge_8c_aecc2e07885e6bad91afde4839a491d05}{lge\_newbuf}}(sc, \&ld-\/>\mbox{\hyperlink{structlge__list__data_a467d444f7d8e9fabbc4dec807715de42}{lge\_rx\_list}}[i], NULL) == ENOBUFS)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00676}00676                         \textcolor{keywordflow}{return}(ENOBUFS);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00677}00677         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00678}00678 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00679}00679         \textcolor{comment}{/* Clear possible 'rx command queue empty' interrupt. */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00680}00680         \mbox{\hyperlink{if__lgereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_aa5cd97d530010f821afca67cfe0910d7}{LGE\_ISR}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00681}00681 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00682}00682         \textcolor{keywordflow}{return}(0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00683}00683 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00684}00684 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00685}00685 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00686}00686 \textcolor{comment}{ * Initialize an RX descriptor and attach an MBUF cluster.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00687}00687 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00688}00688 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00689}\mbox{\hyperlink{if__lge_8c_aecc2e07885e6bad91afde4839a491d05}{00689}} \mbox{\hyperlink{if__lge_8c_aecc2e07885e6bad91afde4839a491d05}{lge\_newbuf}}(sc, c, m)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00690}00690         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00691}00691         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__rx__desc}{lge\_rx\_desc}}   *c;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00692}00692         \textcolor{keyword}{struct }mbuf             *m;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00693}00693 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00694}00694         \textcolor{keyword}{struct }mbuf             *m\_new = NULL;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00695}00695         \textcolor{keywordtype}{char}                    *buf = NULL;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00696}00696 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00697}00697         \textcolor{keywordflow}{if} (m == NULL) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00698}00698                 MGETHDR(m\_new, M\_NOWAIT, MT\_DATA);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00699}00699                 \textcolor{keywordflow}{if} (m\_new == NULL) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00700}00700                         device\_printf(sc-\/>\mbox{\hyperlink{structlge__softc_a48b41ad357b297d5f6ba58a02d0062df}{lge\_dev}}, \textcolor{stringliteral}{"{}no memory for rx list "{}}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00701}00701                             \textcolor{stringliteral}{"{}-\/-\/ packet dropped!\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00702}00702                         \textcolor{keywordflow}{return}(ENOBUFS);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00703}00703                 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00704}00704 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00705}00705                 \textcolor{comment}{/* Allocate the jumbo buffer */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00706}00706                 buf = \mbox{\hyperlink{if__lge_8c_aa8d7c94d2858e6c0d690df4dd3e42240}{lge\_jalloc}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00707}00707                 \textcolor{keywordflow}{if} (buf == NULL) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00708}00708 \textcolor{preprocessor}{\#ifdef LGE\_VERBOSE}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00709}00709                         device\_printf(sc-\/>\mbox{\hyperlink{structlge__softc_a48b41ad357b297d5f6ba58a02d0062df}{lge\_dev}}, \textcolor{stringliteral}{"{}jumbo allocation failed "{}}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00710}00710                             \textcolor{stringliteral}{"{}-\/-\/ packet dropped!\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00711}00711 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00712}00712                         m\_freem(m\_new);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00713}00713                         \textcolor{keywordflow}{return}(ENOBUFS);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00714}00714                 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00715}00715                 \textcolor{comment}{/* Attach the buffer to the mbuf */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00716}00716                 m\_new-\/>m\_len = m\_new-\/>m\_pkthdr.len = \mbox{\hyperlink{if__lgereg_8h_a606ecd952132d0cbc601d7387a7ec22d}{LGE\_JUMBO\_FRAMELEN}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00717}00717                 m\_extadd(m\_new, buf, \mbox{\hyperlink{if__lgereg_8h_a606ecd952132d0cbc601d7387a7ec22d}{LGE\_JUMBO\_FRAMELEN}}, \mbox{\hyperlink{if__lge_8c_a53443d69810eaeeee3061a1624f9cf93}{lge\_jfree}}, sc, NULL,}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00718}00718                     0, EXT\_NET\_DRV);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00719}00719         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00720}00720                 m\_new = m;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00721}00721                 m\_new-\/>m\_len = m\_new-\/>m\_pkthdr.len = \mbox{\hyperlink{if__lgereg_8h_a606ecd952132d0cbc601d7387a7ec22d}{LGE\_JUMBO\_FRAMELEN}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00722}00722                 m\_new-\/>m\_data = m\_new-\/>m\_ext.ext\_buf;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00723}00723         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00724}00724 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00725}00725         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00726}00726 \textcolor{comment}{         * Adjust alignment so packet payload begins on a}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00727}00727 \textcolor{comment}{         * longword boundary. Mandatory for Alpha, useful on}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00728}00728 \textcolor{comment}{         * x86 too.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00729}00729 \textcolor{comment}{        */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00730}00730         m\_adj(m\_new, ETHER\_ALIGN);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00731}00731 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00732}00732         c-\/>\mbox{\hyperlink{structlge__rx__desc_a64b154de0ea4a0bc1d5532e9894ac5a1}{lge\_mbuf}} = m\_new;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00733}00733         c-\/>\mbox{\hyperlink{structlge__rx__desc_a844f9377c54afb3f04c0b7bd2cb94849}{lge\_fragptr\_hi}} = 0;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00734}00734         c-\/>\mbox{\hyperlink{structlge__rx__desc_aa9173582015c74ae18e73b8cc8204f24}{lge\_fragptr\_lo}} = vtophys(mtod(m\_new, caddr\_t));}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00735}00735         c-\/>\mbox{\hyperlink{structlge__rx__desc_ac3a3f3cc21f3111d30623106c70ba52a}{lge\_fraglen}} = m\_new-\/>m\_len;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00736}00736         c-\/>\mbox{\hyperlink{structlge__rx__desc_ab52b7650b40b5a68a7d2d0e5c57000aa}{lge\_ctl}} = m\_new-\/>m\_len | \mbox{\hyperlink{if__lgereg_8h_aed2b7582cefef40edb0b5ceb44e8a09b}{LGE\_RXCTL\_WANTINTR}} | \mbox{\hyperlink{if__lgereg_8h_a78390861a34330faa9edcd6479f3bb8f}{LGE\_FRAGCNT}}(1);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00737}00737         c-\/>\mbox{\hyperlink{structlge__rx__desc_a93a033ae9097bf8d142bab83bebb39bb}{lge\_sts}} = 0;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00738}00738 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00739}00739         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00740}00740 \textcolor{comment}{         * Put this buffer in the RX command FIFO. To do this,}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00741}00741 \textcolor{comment}{         * we just write the physical address of the descriptor}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00742}00742 \textcolor{comment}{         * into the RX descriptor address registers. Note that}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00743}00743 \textcolor{comment}{         * there are two registers, one high DWORD and one low}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00744}00744 \textcolor{comment}{         * DWORD, which lets us specify a 64-\/bit address if}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00745}00745 \textcolor{comment}{         * desired. We only use a 32-\/bit address for now.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00746}00746 \textcolor{comment}{         * Writing to the low DWORD register is what actually}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00747}00747 \textcolor{comment}{         * causes the command to be issued, so we do that}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00748}00748 \textcolor{comment}{         * last.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00749}00749 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00750}00750         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_a530f31a9f6a57beb31c1c33c3f11f708}{LGE\_RXDESC\_ADDR\_LO}}, vtophys(c));}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00751}00751         \mbox{\hyperlink{if__lgereg_8h_ad4b035d9b4024a4e3c39bd2274d0c1d0}{LGE\_INC}}(sc-\/>\mbox{\hyperlink{structlge__softc_aa1500b244a7053375e45eeaee1aa134d}{lge\_cdata}}.\mbox{\hyperlink{structlge__ring__data_a3e12b906e3ece6c76e46b6e5e5acb39e}{lge\_rx\_prod}}, \mbox{\hyperlink{if__lgereg_8h_aa04ae3e3ea59f1d58f2eacc5f5bcf373}{LGE\_RX\_LIST\_CNT}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00752}00752 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00753}00753         \textcolor{keywordflow}{return}(0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00754}00754 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00755}00755 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00756}00756 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00757}\mbox{\hyperlink{if__lge_8c_a9fb07171b3a8392f098a7c12a7033c2b}{00757}} \mbox{\hyperlink{if__lge_8c_a9fb07171b3a8392f098a7c12a7033c2b}{lge\_alloc\_jumbo\_mem}}(sc)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00758}00758         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00759}00759 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00760}00760         caddr\_t                 ptr;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00761}00761         \textcolor{keywordtype}{int}                     i;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00762}00762         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__jpool__entry}{lge\_jpool\_entry}}   *entry;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00763}00763 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00764}00764         \textcolor{comment}{/* Grab a big chunk o' storage. */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00765}00765         sc-\/>\mbox{\hyperlink{structlge__softc_aa1500b244a7053375e45eeaee1aa134d}{lge\_cdata}}.\mbox{\hyperlink{structlge__ring__data_a4563be9532e3fe40bcf01fbfee24c596}{lge\_jumbo\_buf}} = contigmalloc(\mbox{\hyperlink{if__lgereg_8h_ac17f49cc4c7cb8847e9cac5ca54ed207}{LGE\_JMEM}}, M\_DEVBUF,}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00766}00766             M\_NOWAIT, 0, 0xffffffff, PAGE\_SIZE, 0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00767}00767 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00768}00768         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structlge__softc_aa1500b244a7053375e45eeaee1aa134d}{lge\_cdata}}.\mbox{\hyperlink{structlge__ring__data_a4563be9532e3fe40bcf01fbfee24c596}{lge\_jumbo\_buf}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00769}00769                 device\_printf(sc-\/>\mbox{\hyperlink{structlge__softc_a48b41ad357b297d5f6ba58a02d0062df}{lge\_dev}}, \textcolor{stringliteral}{"{}no memory for jumbo buffers!\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00770}00770                 \textcolor{keywordflow}{return}(ENOBUFS);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00771}00771         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00772}00772 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00773}00773         SLIST\_INIT(\&sc-\/>lge\_jfree\_listhead);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00774}00774         SLIST\_INIT(\&sc-\/>lge\_jinuse\_listhead);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00775}00775 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00776}00776         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00777}00777 \textcolor{comment}{         * Now divide it up into 9K pieces and save the addresses}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00778}00778 \textcolor{comment}{         * in an array.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00779}00779 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00780}00780         ptr = sc-\/>\mbox{\hyperlink{structlge__softc_aa1500b244a7053375e45eeaee1aa134d}{lge\_cdata}}.\mbox{\hyperlink{structlge__ring__data_a4563be9532e3fe40bcf01fbfee24c596}{lge\_jumbo\_buf}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00781}00781         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__lgereg_8h_a915b5757ff656e196e0eddd150e52463}{LGE\_JSLOTS}}; i++) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00782}00782                 sc-\/>\mbox{\hyperlink{structlge__softc_aa1500b244a7053375e45eeaee1aa134d}{lge\_cdata}}.\mbox{\hyperlink{structlge__ring__data_af7883c508b758f16c9af8a155f6c7aa9}{lge\_jslots}}[i] = ptr;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00783}00783                 ptr += \mbox{\hyperlink{if__lgereg_8h_a51aab4b3381599dd47a316033626a60f}{LGE\_JLEN}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00784}00784                 entry = malloc(\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlge__jpool__entry}{lge\_jpool\_entry}}),}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00785}00785                     M\_DEVBUF, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00786}00786                 \textcolor{keywordflow}{if} (entry == NULL) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00787}00787                         device\_printf(sc-\/>\mbox{\hyperlink{structlge__softc_a48b41ad357b297d5f6ba58a02d0062df}{lge\_dev}}, \textcolor{stringliteral}{"{}no memory for jumbo "{}}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00788}00788                             \textcolor{stringliteral}{"{}buffer queue!\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00789}00789                         \textcolor{keywordflow}{return}(ENOBUFS);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00790}00790                 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00791}00791                 entry-\/>\mbox{\hyperlink{structlge__jpool__entry_aee757bcae177f5741d7cd2b81c98b3fd}{slot}} = i;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00792}00792                 SLIST\_INSERT\_HEAD(\&sc-\/>lge\_jfree\_listhead,}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00793}00793                     entry, jpool\_entries);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00794}00794         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00795}00795 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00796}00796         \textcolor{keywordflow}{return}(0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00797}00797 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00798}00798 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00799}00799 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00800}\mbox{\hyperlink{if__lge_8c_a81fe10434f524fdaa48f92f89e852b38}{00800}} \mbox{\hyperlink{if__lge_8c_a81fe10434f524fdaa48f92f89e852b38}{lge\_free\_jumbo\_mem}}(sc)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00801}00801         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00802}00802 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00803}00803         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__jpool__entry}{lge\_jpool\_entry}}   *entry;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00804}00804 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00805}00805         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structlge__softc_aa1500b244a7053375e45eeaee1aa134d}{lge\_cdata}}.\mbox{\hyperlink{structlge__ring__data_a4563be9532e3fe40bcf01fbfee24c596}{lge\_jumbo\_buf}} == NULL)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00806}00806                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00807}00807 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00808}00808         \textcolor{keywordflow}{while} ((entry = SLIST\_FIRST(\&sc-\/>lge\_jinuse\_listhead))) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00809}00809                 device\_printf(sc-\/>\mbox{\hyperlink{structlge__softc_a48b41ad357b297d5f6ba58a02d0062df}{lge\_dev}},}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00810}00810                     \textcolor{stringliteral}{"{}asked to free buffer that is in use!\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00811}00811                 SLIST\_REMOVE\_HEAD(\&sc-\/>lge\_jinuse\_listhead, jpool\_entries);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00812}00812                 SLIST\_INSERT\_HEAD(\&sc-\/>lge\_jfree\_listhead, entry,}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00813}00813                     jpool\_entries);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00814}00814         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00815}00815         \textcolor{keywordflow}{while} (!SLIST\_EMPTY(\&sc-\/>lge\_jfree\_listhead)) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00816}00816                 entry = SLIST\_FIRST(\&sc-\/>lge\_jfree\_listhead);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00817}00817                 SLIST\_REMOVE\_HEAD(\&sc-\/>lge\_jfree\_listhead, jpool\_entries);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00818}00818                 free(entry, M\_DEVBUF);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00819}00819         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00820}00820 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00821}00821         contigfree(sc-\/>\mbox{\hyperlink{structlge__softc_aa1500b244a7053375e45eeaee1aa134d}{lge\_cdata}}.\mbox{\hyperlink{structlge__ring__data_a4563be9532e3fe40bcf01fbfee24c596}{lge\_jumbo\_buf}}, \mbox{\hyperlink{if__lgereg_8h_ac17f49cc4c7cb8847e9cac5ca54ed207}{LGE\_JMEM}}, M\_DEVBUF);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00822}00822 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00823}00823         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00824}00824 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00825}00825 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00826}00826 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00827}00827 \textcolor{comment}{ * Allocate a jumbo buffer.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00828}00828 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00829}00829 \textcolor{keyword}{static} \textcolor{keywordtype}{void} *}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00830}\mbox{\hyperlink{if__lge_8c_aa8d7c94d2858e6c0d690df4dd3e42240}{00830}} \mbox{\hyperlink{if__lge_8c_aa8d7c94d2858e6c0d690df4dd3e42240}{lge\_jalloc}}(sc)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00831}00831         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00832}00832 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00833}00833         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__jpool__entry}{lge\_jpool\_entry}}   *entry;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00834}00834         }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00835}00835         entry = SLIST\_FIRST(\&sc-\/>lge\_jfree\_listhead);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00836}00836         }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00837}00837         \textcolor{keywordflow}{if} (entry == NULL) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00838}00838 \textcolor{preprocessor}{\#ifdef LGE\_VERBOSE}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00839}00839                 device\_printf(sc-\/>\mbox{\hyperlink{structlge__softc_a48b41ad357b297d5f6ba58a02d0062df}{lge\_dev}}, \textcolor{stringliteral}{"{}no free jumbo buffers\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00840}00840 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00841}00841                 \textcolor{keywordflow}{return}(NULL);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00842}00842         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00843}00843 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00844}00844         SLIST\_REMOVE\_HEAD(\&sc-\/>lge\_jfree\_listhead, jpool\_entries);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00845}00845         SLIST\_INSERT\_HEAD(\&sc-\/>lge\_jinuse\_listhead, entry, jpool\_entries);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00846}00846         \textcolor{keywordflow}{return}(sc-\/>\mbox{\hyperlink{structlge__softc_aa1500b244a7053375e45eeaee1aa134d}{lge\_cdata}}.\mbox{\hyperlink{structlge__ring__data_af7883c508b758f16c9af8a155f6c7aa9}{lge\_jslots}}[entry-\/>\mbox{\hyperlink{structlge__jpool__entry_aee757bcae177f5741d7cd2b81c98b3fd}{slot}}]);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00847}00847 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00848}00848 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00849}00849 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00850}00850 \textcolor{comment}{ * Release a jumbo buffer.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00851}00851 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00852}00852 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00853}\mbox{\hyperlink{if__lge_8c_a53443d69810eaeeee3061a1624f9cf93}{00853}} \mbox{\hyperlink{if__lge_8c_a53443d69810eaeeee3061a1624f9cf93}{lge\_jfree}}(\textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00854}00854 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00855}00855         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00856}00856         \textcolor{keywordtype}{int}                     i;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00857}00857         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__jpool__entry}{lge\_jpool\_entry}}   *entry;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00858}00858 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00859}00859         \textcolor{comment}{/* Extract the softc struct pointer. */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00860}00860         sc = m-\/>m\_ext.ext\_arg1;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00861}00861 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00862}00862         \textcolor{keywordflow}{if} (sc == NULL)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00863}00863                 panic(\textcolor{stringliteral}{"{}lge\_jfree: can't find softc pointer!"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00864}00864 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00865}00865         \textcolor{comment}{/* calculate the slot this buffer belongs to */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00866}00866         i = ((vm\_offset\_t)m-\/>m\_ext.ext\_buf}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00867}00867              -\/ (vm\_offset\_t)sc-\/>\mbox{\hyperlink{structlge__softc_aa1500b244a7053375e45eeaee1aa134d}{lge\_cdata}}.\mbox{\hyperlink{structlge__ring__data_a4563be9532e3fe40bcf01fbfee24c596}{lge\_jumbo\_buf}}) / \mbox{\hyperlink{if__lgereg_8h_a51aab4b3381599dd47a316033626a60f}{LGE\_JLEN}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00868}00868 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00869}00869         \textcolor{keywordflow}{if} ((i < 0) || (i >= \mbox{\hyperlink{if__lgereg_8h_a915b5757ff656e196e0eddd150e52463}{LGE\_JSLOTS}}))}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00870}00870                 panic(\textcolor{stringliteral}{"{}lge\_jfree: asked to free buffer that we don't manage!"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00871}00871 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00872}00872         entry = SLIST\_FIRST(\&sc-\/>lge\_jinuse\_listhead);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00873}00873         \textcolor{keywordflow}{if} (entry == NULL)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00874}00874                 panic(\textcolor{stringliteral}{"{}lge\_jfree: buffer not in use!"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00875}00875         entry-\/>\mbox{\hyperlink{structlge__jpool__entry_aee757bcae177f5741d7cd2b81c98b3fd}{slot}} = i;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00876}00876         SLIST\_REMOVE\_HEAD(\&sc-\/>lge\_jinuse\_listhead, jpool\_entries);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00877}00877         SLIST\_INSERT\_HEAD(\&sc-\/>lge\_jfree\_listhead, entry, jpool\_entries);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00878}00878 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00879}00879 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00880}00880 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00881}00881 \textcolor{comment}{ * A frame has been uploaded: pass the resulting mbuf chain up to}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00882}00882 \textcolor{comment}{ * the higher level protocols.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00883}00883 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00884}00884 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00885}\mbox{\hyperlink{if__lge_8c_ab5485b1bb0180d8fdc6d3f71741c536f}{00885}} \mbox{\hyperlink{if__lge_8c_ab5485b1bb0180d8fdc6d3f71741c536f}{lge\_rxeof}}(sc, cnt)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00886}00886         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00887}00887         \textcolor{keywordtype}{int}                     cnt;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00888}00888 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00889}00889         \textcolor{keyword}{struct }mbuf             *m;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00890}00890         \textcolor{keyword}{struct }ifnet            *ifp;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00891}00891         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__rx__desc}{lge\_rx\_desc}}   *cur\_rx;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00892}00892         \textcolor{keywordtype}{int}                     c, i, total\_len = 0;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00893}00893         u\_int32\_t               rxsts, rxctl;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00894}00894 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00895}00895         ifp = sc-\/>\mbox{\hyperlink{structlge__softc_aaa8504c7457a98c1e87d21e99593d163}{lge\_ifp}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00896}00896 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00897}00897         \textcolor{comment}{/* Find out how many frames were processed. */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00898}00898         c = cnt;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00899}00899         i = sc-\/>\mbox{\hyperlink{structlge__softc_aa1500b244a7053375e45eeaee1aa134d}{lge\_cdata}}.\mbox{\hyperlink{structlge__ring__data_a1754921b80a68a13ce9704e84e146050}{lge\_rx\_cons}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00900}00900 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00901}00901         \textcolor{comment}{/* Suck them in. */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00902}00902         \textcolor{keywordflow}{while}(c) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00903}00903                 \textcolor{keyword}{struct }mbuf             *m0 = NULL;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00904}00904 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00905}00905                 cur\_rx = \&sc-\/>\mbox{\hyperlink{structlge__softc_a32d9253cb35fc6fc5ac031ff88d50a06}{lge\_ldata}}-\/>\mbox{\hyperlink{structlge__list__data_a467d444f7d8e9fabbc4dec807715de42}{lge\_rx\_list}}[i];}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00906}00906                 rxctl = cur\_rx-\/>\mbox{\hyperlink{structlge__rx__desc_ab52b7650b40b5a68a7d2d0e5c57000aa}{lge\_ctl}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00907}00907                 rxsts = cur\_rx-\/>\mbox{\hyperlink{structlge__rx__desc_a93a033ae9097bf8d142bab83bebb39bb}{lge\_sts}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00908}00908                 m = cur\_rx-\/>\mbox{\hyperlink{structlge__rx__desc_a64b154de0ea4a0bc1d5532e9894ac5a1}{lge\_mbuf}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00909}00909                 cur\_rx-\/>\mbox{\hyperlink{structlge__rx__desc_a64b154de0ea4a0bc1d5532e9894ac5a1}{lge\_mbuf}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00910}00910                 total\_len = \mbox{\hyperlink{if__lgereg_8h_aa12e79f706da74dccb3d5833f755e7c9}{LGE\_RXBYTES}}(cur\_rx);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00911}00911                 \mbox{\hyperlink{if__lgereg_8h_ad4b035d9b4024a4e3c39bd2274d0c1d0}{LGE\_INC}}(i, \mbox{\hyperlink{if__lgereg_8h_aa04ae3e3ea59f1d58f2eacc5f5bcf373}{LGE\_RX\_LIST\_CNT}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00912}00912                 c-\/-\/;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00913}00913 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00914}00914                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00915}00915 \textcolor{comment}{                 * If an error occurs, update stats, clear the}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00916}00916 \textcolor{comment}{                 * status word and leave the mbuf cluster in place:}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00917}00917 \textcolor{comment}{                 * it should simply get re-\/used next time this descriptor}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00918}00918 \textcolor{comment}{                 * comes up in the ring.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00919}00919 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00920}00920                 \textcolor{keywordflow}{if} (rxctl \& \mbox{\hyperlink{if__lgereg_8h_a8ad28622127dc6ed310ecfc13beeab17}{LGE\_RXCTL\_ERRMASK}}) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00921}00921                         if\_inc\_counter(ifp, IFCOUNTER\_IERRORS, 1);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00922}00922                         \mbox{\hyperlink{if__lge_8c_aecc2e07885e6bad91afde4839a491d05}{lge\_newbuf}}(sc, \&\mbox{\hyperlink{if__lgereg_8h_ac7b1ccc046dab6f78386f1b515f0b471}{LGE\_RXTAIL}}(sc), m);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00923}00923                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00924}00924                 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00925}00925 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00926}00926                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__lge_8c_aecc2e07885e6bad91afde4839a491d05}{lge\_newbuf}}(sc, \&\mbox{\hyperlink{if__lgereg_8h_ac7b1ccc046dab6f78386f1b515f0b471}{LGE\_RXTAIL}}(sc), NULL) == ENOBUFS) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00927}00927                         m0 = m\_devget(mtod(m, \textcolor{keywordtype}{char} *), total\_len, ETHER\_ALIGN,}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00928}00928                             ifp, NULL);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00929}00929                         \mbox{\hyperlink{if__lge_8c_aecc2e07885e6bad91afde4839a491d05}{lge\_newbuf}}(sc, \&\mbox{\hyperlink{if__lgereg_8h_ac7b1ccc046dab6f78386f1b515f0b471}{LGE\_RXTAIL}}(sc), m);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00930}00930                         \textcolor{keywordflow}{if} (m0 == NULL) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00931}00931                                 device\_printf(sc-\/>\mbox{\hyperlink{structlge__softc_a48b41ad357b297d5f6ba58a02d0062df}{lge\_dev}}, \textcolor{stringliteral}{"{}no receive buffers "{}}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00932}00932                                     \textcolor{stringliteral}{"{}available -\/-\/ packet dropped!\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00933}00933                                 if\_inc\_counter(ifp, IFCOUNTER\_IERRORS, 1);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00934}00934                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00935}00935                         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00936}00936                         m = m0;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00937}00937                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00938}00938                         m-\/>m\_pkthdr.rcvif = ifp;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00939}00939                         m-\/>m\_pkthdr.len = m-\/>m\_len = total\_len;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00940}00940                 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00941}00941 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00942}00942                 if\_inc\_counter(ifp, IFCOUNTER\_IPACKETS, 1);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00943}00943 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00944}00944                 \textcolor{comment}{/* Do IP checksum checking. */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00945}00945                 \textcolor{keywordflow}{if} (rxsts \& \mbox{\hyperlink{if__lgereg_8h_ab57b4d3b0b7161e74d70eaaa7e4f20e6}{LGE\_RXSTS\_ISIP}})}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00946}00946                         m-\/>m\_pkthdr.csum\_flags |= CSUM\_IP\_CHECKED;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00947}00947                 \textcolor{keywordflow}{if} (!(rxsts \& \mbox{\hyperlink{if__lgereg_8h_aa6474c8784f33ffb3400d9b51015795f}{LGE\_RXSTS\_IPCSUMERR}}))}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00948}00948                         m-\/>m\_pkthdr.csum\_flags |= CSUM\_IP\_VALID;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00949}00949                 \textcolor{keywordflow}{if} ((rxsts \& \mbox{\hyperlink{if__lgereg_8h_a936676779dcabe50f2e8b1a6fcecb202}{LGE\_RXSTS\_ISTCP}} \&\&}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00950}00950                     !(rxsts \& \mbox{\hyperlink{if__lgereg_8h_a20860215dd4325b74e7dc2cbcd8045f3}{LGE\_RXSTS\_TCPCSUMERR}})) ||}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00951}00951                     (rxsts \& \mbox{\hyperlink{if__lgereg_8h_ae76b8713aae8a7b70dac29a18dd5901a}{LGE\_RXSTS\_ISUDP}} \&\&}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00952}00952                     !(rxsts \& \mbox{\hyperlink{if__lgereg_8h_a5fce76dfa1ba2c1eea9196ce895fb041}{LGE\_RXSTS\_UDPCSUMERR}}))) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00953}00953                         m-\/>m\_pkthdr.csum\_flags |=}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00954}00954                             CSUM\_DATA\_VALID|CSUM\_PSEUDO\_HDR;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00955}00955                         m-\/>m\_pkthdr.csum\_data = 0xffff;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00956}00956                 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00957}00957 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00958}00958                 \mbox{\hyperlink{if__lgereg_8h_a2fba991aeb843a23de30e7d196e2f119}{LGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00959}00959                 (*ifp-\/>if\_input)(ifp, m);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00960}00960                 \mbox{\hyperlink{if__lgereg_8h_a979c0b0266ec6d6efc9d2e40d8580d31}{LGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00961}00961         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00962}00962 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00963}00963         sc-\/>\mbox{\hyperlink{structlge__softc_aa1500b244a7053375e45eeaee1aa134d}{lge\_cdata}}.\mbox{\hyperlink{structlge__ring__data_a1754921b80a68a13ce9704e84e146050}{lge\_rx\_cons}} = i;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00964}00964 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00965}00965         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00966}00966 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00967}00967 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00968}00968 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00969}\mbox{\hyperlink{if__lge_8c_a8c2f4fb93a14715b693c07b7cf27b98a}{00969}} \mbox{\hyperlink{if__lge_8c_a8c2f4fb93a14715b693c07b7cf27b98a}{lge\_rxeoc}}(sc)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00970}00970         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00971}00971 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00972}00972         \textcolor{keyword}{struct }ifnet            *ifp;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00973}00973 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00974}00974         ifp = sc-\/>\mbox{\hyperlink{structlge__softc_aaa8504c7457a98c1e87d21e99593d163}{lge\_ifp}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00975}00975         ifp-\/>if\_drv\_flags \&= \string~IFF\_DRV\_RUNNING;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00976}00976         \mbox{\hyperlink{if__lge_8c_ac3f39c3e796d83d651cb9c5fc5796e08}{lge\_init\_locked}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00977}00977         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00978}00978 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00979}00979 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00980}00980 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00981}00981 \textcolor{comment}{ * A frame was downloaded to the chip. It's safe for us to clean up}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00982}00982 \textcolor{comment}{ * the list buffers.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00983}00983 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00984}00984 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00985}00985 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00986}\mbox{\hyperlink{if__lge_8c_a9983fd571bfe17221f45ee626b518712}{00986}} \mbox{\hyperlink{if__lge_8c_a9983fd571bfe17221f45ee626b518712}{lge\_txeof}}(sc)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00987}00987         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00988}00988 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00989}00989         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__tx__desc}{lge\_tx\_desc}}   *cur\_tx = NULL;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00990}00990         \textcolor{keyword}{struct }ifnet            *ifp;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00991}00991         u\_int32\_t               idx, txdone;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00992}00992 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00993}00993         ifp = sc-\/>\mbox{\hyperlink{structlge__softc_aaa8504c7457a98c1e87d21e99593d163}{lge\_ifp}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00994}00994 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00995}00995         \textcolor{comment}{/* Clear the timeout timer. */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00996}00996         sc-\/>\mbox{\hyperlink{structlge__softc_a49531e0a593fb548504c2ca625f2fcd2}{lge\_timer}} = 0;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00997}00997 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00998}00998         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l00999}00999 \textcolor{comment}{         * Go through our tx list and free mbufs for those}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01000}01000 \textcolor{comment}{         * frames that have been transmitted.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01001}01001 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01002}01002         idx = sc-\/>\mbox{\hyperlink{structlge__softc_aa1500b244a7053375e45eeaee1aa134d}{lge\_cdata}}.\mbox{\hyperlink{structlge__ring__data_a72592268a4bea8bee3d15c649da5aeaf}{lge\_tx\_cons}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01003}01003         txdone = \mbox{\hyperlink{if__lgereg_8h_a394044f8c65a429cea3c1993c9ed7766}{CSR\_READ\_1}}(sc, \mbox{\hyperlink{if__lgereg_8h_a8d10d7b6b59fa6969545ac4c899f4240}{LGE\_TXDMADONE\_8BIT}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01004}01004 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01005}01005         \textcolor{keywordflow}{while} (idx != sc-\/>\mbox{\hyperlink{structlge__softc_aa1500b244a7053375e45eeaee1aa134d}{lge\_cdata}}.\mbox{\hyperlink{structlge__ring__data_aae1337c962b6c91c13bb39113e093919}{lge\_tx\_prod}} \&\& txdone) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01006}01006                 cur\_tx = \&sc-\/>\mbox{\hyperlink{structlge__softc_a32d9253cb35fc6fc5ac031ff88d50a06}{lge\_ldata}}-\/>\mbox{\hyperlink{structlge__list__data_a283d25348ade381e32b61bade75d20ef}{lge\_tx\_list}}[idx];}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01007}01007 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01008}01008                 if\_inc\_counter(ifp, IFCOUNTER\_OPACKETS, 1);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01009}01009                 \textcolor{keywordflow}{if} (cur\_tx-\/>\mbox{\hyperlink{structlge__tx__desc_ac884cd6601608ae923bf8ef11118f2a4}{lge\_mbuf}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01010}01010                         m\_freem(cur\_tx-\/>\mbox{\hyperlink{structlge__tx__desc_ac884cd6601608ae923bf8ef11118f2a4}{lge\_mbuf}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01011}01011                         cur\_tx-\/>\mbox{\hyperlink{structlge__tx__desc_ac884cd6601608ae923bf8ef11118f2a4}{lge\_mbuf}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01012}01012                 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01013}01013                 cur\_tx-\/>\mbox{\hyperlink{structlge__tx__desc_a113d45eccb5fdf30c05da8ac79413552}{lge\_ctl}} = 0;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01014}01014 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01015}01015                 txdone-\/-\/;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01016}01016                 \mbox{\hyperlink{if__lgereg_8h_ad4b035d9b4024a4e3c39bd2274d0c1d0}{LGE\_INC}}(idx, \mbox{\hyperlink{if__lgereg_8h_a30fcd71cdba5c575105b3b6ed30ce91d}{LGE\_TX\_LIST\_CNT}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01017}01017                 sc-\/>\mbox{\hyperlink{structlge__softc_a49531e0a593fb548504c2ca625f2fcd2}{lge\_timer}} = 0;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01018}01018         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01019}01019 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01020}01020         sc-\/>\mbox{\hyperlink{structlge__softc_aa1500b244a7053375e45eeaee1aa134d}{lge\_cdata}}.\mbox{\hyperlink{structlge__ring__data_a72592268a4bea8bee3d15c649da5aeaf}{lge\_tx\_cons}} = idx;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01021}01021 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01022}01022         \textcolor{keywordflow}{if} (cur\_tx != NULL)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01023}01023                 ifp-\/>if\_drv\_flags \&= \string~IFF\_DRV\_OACTIVE;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01024}01024 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01025}01025         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01026}01026 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01027}01027 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01028}01028 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01029}\mbox{\hyperlink{if__lge_8c_a688e2b91eb5e2144421ea3eeb1e95c3f}{01029}} \mbox{\hyperlink{if__lge_8c_a688e2b91eb5e2144421ea3eeb1e95c3f}{lge\_tick}}(xsc)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01030}01030         \textcolor{keywordtype}{void}                    *xsc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01031}01031 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01032}01032         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01033}01033         \textcolor{keyword}{struct }mii\_data         *mii;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01034}01034         \textcolor{keyword}{struct }ifnet            *ifp;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01035}01035 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01036}01036         sc = xsc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01037}01037         ifp = sc-\/>\mbox{\hyperlink{structlge__softc_aaa8504c7457a98c1e87d21e99593d163}{lge\_ifp}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01038}01038         \mbox{\hyperlink{if__lgereg_8h_aaccd7e5b4a97745229ba5cfa6653cd8d}{LGE\_LOCK\_ASSERT}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01039}01039 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01040}01040         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_a5bbaa3f73ad3f01a5d9ba01cc3bf3736}{LGE\_STATSIDX}}, \mbox{\hyperlink{if__lgereg_8h_a1c0ae9dbafba41f6e785a3921ada0340}{LGE\_STATS\_SINGLE\_COLL\_PKTS}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01041}01041         if\_inc\_counter(ifp, IFCOUNTER\_COLLISIONS, \mbox{\hyperlink{if__lgereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ad42d6fe27779847058edb15b7b234dc1}{LGE\_STATSVAL}}));}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01042}01042         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_a5bbaa3f73ad3f01a5d9ba01cc3bf3736}{LGE\_STATSIDX}}, \mbox{\hyperlink{if__lgereg_8h_aac8cbe6c75413ffc9897c0023c31e39d}{LGE\_STATS\_MULTI\_COLL\_PKTS}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01043}01043         if\_inc\_counter(ifp, IFCOUNTER\_COLLISIONS, \mbox{\hyperlink{if__lgereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ad42d6fe27779847058edb15b7b234dc1}{LGE\_STATSVAL}}));}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01044}01044 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01045}01045         \textcolor{keywordflow}{if} (!sc-\/>\mbox{\hyperlink{structlge__softc_af57eb85d1da88765e845c5a8bdfe18d0}{lge\_link}}) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01046}01046                 mii = device\_get\_softc(sc-\/>\mbox{\hyperlink{structlge__softc_a35d02416dcbefe0adc6dd3a8ec3780f7}{lge\_miibus}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01047}01047                 mii\_tick(mii);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01048}01048                 \textcolor{keywordflow}{if} (mii-\/>mii\_media\_status \& IFM\_ACTIVE \&\&}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01049}01049                     IFM\_SUBTYPE(mii-\/>mii\_media\_active) != IFM\_NONE) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01050}01050                         sc-\/>\mbox{\hyperlink{structlge__softc_af57eb85d1da88765e845c5a8bdfe18d0}{lge\_link}}++;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01051}01051                         \textcolor{keywordflow}{if} (bootverbose \&\&}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01052}01052                             (IFM\_SUBTYPE(mii-\/>mii\_media\_active) == IFM\_1000\_SX||}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01053}01053                             IFM\_SUBTYPE(mii-\/>mii\_media\_active) == IFM\_1000\_T))}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01054}01054                                 device\_printf(sc-\/>\mbox{\hyperlink{structlge__softc_a48b41ad357b297d5f6ba58a02d0062df}{lge\_dev}}, \textcolor{stringliteral}{"{}gigabit link up\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01055}01055                         \textcolor{keywordflow}{if} (ifp-\/>if\_snd.ifq\_head != NULL)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01056}01056                                 \mbox{\hyperlink{if__lge_8c_a38c27f49282f58b22b66add1f8af71b0}{lge\_start\_locked}}(ifp);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01057}01057                 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01058}01058         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01059}01059 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01060}01060         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structlge__softc_a49531e0a593fb548504c2ca625f2fcd2}{lge\_timer}} != 0 \&\& -\/-\/sc-\/>\mbox{\hyperlink{structlge__softc_a49531e0a593fb548504c2ca625f2fcd2}{lge\_timer}} == 0)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01061}01061                 \mbox{\hyperlink{if__lge_8c_ab57c127d31575d3987769aa74fc1b0f5}{lge\_watchdog}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01062}01062         callout\_reset(\&sc-\/>\mbox{\hyperlink{structlge__softc_a7c5d61da7768a58fe8615020b0e8aef3}{lge\_stat\_callout}}, hz, \mbox{\hyperlink{if__lge_8c_a688e2b91eb5e2144421ea3eeb1e95c3f}{lge\_tick}}, sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01063}01063 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01064}01064         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01065}01065 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01066}01066 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01067}01067 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01068}\mbox{\hyperlink{if__lge_8c_a3e279bc7de37913b2cbc0263413f3347}{01068}} \mbox{\hyperlink{if__lge_8c_a3e279bc7de37913b2cbc0263413f3347}{lge\_intr}}(arg)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01069}01069         \textcolor{keywordtype}{void}                    *arg;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01070}01070 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01071}01071         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01072}01072         \textcolor{keyword}{struct }ifnet            *ifp;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01073}01073         u\_int32\_t               status;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01074}01074 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01075}01075         sc = arg;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01076}01076         ifp = sc-\/>\mbox{\hyperlink{structlge__softc_aaa8504c7457a98c1e87d21e99593d163}{lge\_ifp}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01077}01077         \mbox{\hyperlink{if__lgereg_8h_a979c0b0266ec6d6efc9d2e40d8580d31}{LGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01078}01078 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01079}01079         \textcolor{comment}{/* Suppress unwanted interrupts */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01080}01080         \textcolor{keywordflow}{if} (!(ifp-\/>if\_flags \& IFF\_UP)) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01081}01081                 \mbox{\hyperlink{if__lge_8c_a86be044ed884c02e2d26d3b35fcf6275}{lge\_stop}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01082}01082                 \mbox{\hyperlink{if__lgereg_8h_a2fba991aeb843a23de30e7d196e2f119}{LGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01083}01083                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01084}01084         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01085}01085 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01086}01086         \textcolor{keywordflow}{for} (;;) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01087}01087                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01088}01088 \textcolor{comment}{                 * Reading the ISR register clears all interrupts, and}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01089}01089 \textcolor{comment}{                 * clears the 'interrupts enabled' bit in the IMR}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01090}01090 \textcolor{comment}{                 * register.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01091}01091 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01092}01092                 status = \mbox{\hyperlink{if__lgereg_8h_a8888d9d0c5b8e75f1894f519cfb86309}{CSR\_READ\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_aa5cd97d530010f821afca67cfe0910d7}{LGE\_ISR}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01093}01093 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01094}01094                 \textcolor{keywordflow}{if} ((status \& \mbox{\hyperlink{if__lgereg_8h_a49eff5bb52c38e92ba34a1852e29ce6e}{LGE\_INTRS}}) == 0)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01095}01095                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01096}01096 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01097}01097                 \textcolor{keywordflow}{if} ((status \& (\mbox{\hyperlink{if__lgereg_8h_ace350fee196c35051692657763fd0356}{LGE\_ISR\_TXCMDFIFO\_EMPTY}}|\mbox{\hyperlink{if__lgereg_8h_a2f83e3e3e65cdd05c514a60d33fa252f}{LGE\_ISR\_TXDMA\_DONE}})))}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01098}01098                         \mbox{\hyperlink{if__lge_8c_a9983fd571bfe17221f45ee626b518712}{lge\_txeof}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01099}01099 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01100}01100                 \textcolor{keywordflow}{if} (status \& \mbox{\hyperlink{if__lgereg_8h_adaa9145e73f5e54ea3ed4d2751018951}{LGE\_ISR\_RXDMA\_DONE}})}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01101}01101                         \mbox{\hyperlink{if__lge_8c_ab5485b1bb0180d8fdc6d3f71741c536f}{lge\_rxeof}}(sc, \mbox{\hyperlink{if__lgereg_8h_a10da39be157200d9f4f0e751de2ff815}{LGE\_RX\_DMACNT}}(status));}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01102}01102 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01103}01103                 \textcolor{keywordflow}{if} (status \& \mbox{\hyperlink{if__lgereg_8h_aa8d3b5dff6a746becf1abaabff872243}{LGE\_ISR\_RXCMDFIFO\_EMPTY}})}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01104}01104                         \mbox{\hyperlink{if__lge_8c_a8c2f4fb93a14715b693c07b7cf27b98a}{lge\_rxeoc}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01105}01105 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01106}01106                 \textcolor{keywordflow}{if} (status \& \mbox{\hyperlink{if__lgereg_8h_aa598cbc7bfdb7b91fb819e8a85376c7a}{LGE\_ISR\_PHY\_INTR}}) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01107}01107                         sc-\/>\mbox{\hyperlink{structlge__softc_af57eb85d1da88765e845c5a8bdfe18d0}{lge\_link}} = 0;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01108}01108                         callout\_stop(\&sc-\/>\mbox{\hyperlink{structlge__softc_a7c5d61da7768a58fe8615020b0e8aef3}{lge\_stat\_callout}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01109}01109                         \mbox{\hyperlink{if__lge_8c_a688e2b91eb5e2144421ea3eeb1e95c3f}{lge\_tick}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01110}01110                 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01111}01111         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01112}01112 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01113}01113         \textcolor{comment}{/* Re-\/enable interrupts. */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01114}01114         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ac8c78bed0aad41c9b328a6299fc59839}{LGE\_IMR}}, \mbox{\hyperlink{if__lgereg_8h_aa34e6c50bae47302a5edee6d458c445a}{LGE\_IMR\_SETRST\_CTL0}}|\mbox{\hyperlink{if__lgereg_8h_aa16f67cbcfd7c8b6fd0c9048408d0352}{LGE\_IMR\_INTR\_ENB}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01115}01115 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01116}01116         \textcolor{keywordflow}{if} (ifp-\/>if\_snd.ifq\_head != NULL)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01117}01117                 \mbox{\hyperlink{if__lge_8c_a38c27f49282f58b22b66add1f8af71b0}{lge\_start\_locked}}(ifp);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01118}01118 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01119}01119         \mbox{\hyperlink{if__lgereg_8h_a2fba991aeb843a23de30e7d196e2f119}{LGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01120}01120         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01121}01121 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01122}01122 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01123}01123 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01124}01124 \textcolor{comment}{ * Encapsulate an mbuf chain in a descriptor by coupling the mbuf data}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01125}01125 \textcolor{comment}{ * pointers to the fragment pointers.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01126}01126 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01127}01127 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01128}\mbox{\hyperlink{if__lge_8c_ad5f29342337eb7f3567ca05bf276edc7}{01128}} \mbox{\hyperlink{if__lge_8c_ad5f29342337eb7f3567ca05bf276edc7}{lge\_encap}}(sc, m\_head, txidx)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01129}01129         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01130}01130         \textcolor{keyword}{struct }mbuf             *m\_head;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01131}01131         u\_int32\_t               *txidx;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01132}01132 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01133}01133         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__frag}{lge\_frag}}         *f = NULL;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01134}01134         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__tx__desc}{lge\_tx\_desc}}   *cur\_tx;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01135}01135         \textcolor{keyword}{struct }mbuf             *m;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01136}01136         \textcolor{keywordtype}{int}                     frag = 0, tot\_len = 0;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01137}01137 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01138}01138         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01139}01139 \textcolor{comment}{         * Start packing the mbufs in this chain into}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01140}01140 \textcolor{comment}{         * the fragment pointers. Stop when we run out}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01141}01141 \textcolor{comment}{         * of fragments or hit the end of the mbuf chain.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01142}01142 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01143}01143         m = m\_head;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01144}01144         cur\_tx = \&sc-\/>\mbox{\hyperlink{structlge__softc_a32d9253cb35fc6fc5ac031ff88d50a06}{lge\_ldata}}-\/>\mbox{\hyperlink{structlge__list__data_a283d25348ade381e32b61bade75d20ef}{lge\_tx\_list}}[*txidx];}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01145}01145         frag = 0;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01146}01146 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01147}01147         \textcolor{keywordflow}{for} (m = m\_head; m != NULL; m = m-\/>m\_next) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01148}01148                 \textcolor{keywordflow}{if} (m-\/>m\_len != 0) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01149}01149                         tot\_len += m-\/>m\_len;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01150}01150                         f = \&cur\_tx-\/>\mbox{\hyperlink{structlge__tx__desc_abe8c6108d6d60b35d42f537cd4ea2e21}{lge\_frags}}[frag];}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01151}01151                         f-\/>\mbox{\hyperlink{structlge__frag_a43d1bdea7a5c0d78e3b0dff7f7b07969}{lge\_fraglen}} = m-\/>m\_len;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01152}01152                         f-\/>\mbox{\hyperlink{structlge__frag_a8f21096d75008c2022ed55935bc709d6}{lge\_fragptr\_lo}} = vtophys(mtod(m, vm\_offset\_t));}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01153}01153                         f-\/>\mbox{\hyperlink{structlge__frag_a985ea82af91f862203bc951928e89802}{lge\_fragptr\_hi}} = 0;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01154}01154                         frag++;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01155}01155                 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01156}01156         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01157}01157 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01158}01158         \textcolor{keywordflow}{if} (m != NULL)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01159}01159                 \textcolor{keywordflow}{return}(ENOBUFS);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01160}01160 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01161}01161         cur\_tx-\/>\mbox{\hyperlink{structlge__tx__desc_ac884cd6601608ae923bf8ef11118f2a4}{lge\_mbuf}} = m\_head;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01162}01162         cur\_tx-\/>\mbox{\hyperlink{structlge__tx__desc_a113d45eccb5fdf30c05da8ac79413552}{lge\_ctl}} = \mbox{\hyperlink{if__lgereg_8h_a852dafe439b3df3bf182a5de1b2b587c}{LGE\_TXCTL\_WANTINTR}}|\mbox{\hyperlink{if__lgereg_8h_a78390861a34330faa9edcd6479f3bb8f}{LGE\_FRAGCNT}}(frag)|tot\_len;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01163}01163         \mbox{\hyperlink{if__lgereg_8h_ad4b035d9b4024a4e3c39bd2274d0c1d0}{LGE\_INC}}((*txidx), \mbox{\hyperlink{if__lgereg_8h_a30fcd71cdba5c575105b3b6ed30ce91d}{LGE\_TX\_LIST\_CNT}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01164}01164 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01165}01165         \textcolor{comment}{/* Queue for transmit */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01166}01166         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_aa501f578914a4231cf0503363c058f9c}{LGE\_TXDESC\_ADDR\_LO}}, vtophys(cur\_tx));}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01167}01167 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01168}01168         \textcolor{keywordflow}{return}(0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01169}01169 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01170}01170 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01171}01171 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01172}01172 \textcolor{comment}{ * Main transmit routine. To avoid having to do mbuf copies, we put pointers}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01173}01173 \textcolor{comment}{ * to the mbuf data regions directly in the transmit lists. We also save a}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01174}01174 \textcolor{comment}{ * copy of the pointers since the transmit list fragment pointers are}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01175}01175 \textcolor{comment}{ * physical addresses.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01176}01176 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01177}01177 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01178}01178 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01179}\mbox{\hyperlink{if__lge_8c_afbbd2bf50dc1eb85fbcb1da7b67b80d0}{01179}} \mbox{\hyperlink{if__lge_8c_afbbd2bf50dc1eb85fbcb1da7b67b80d0}{lge\_start}}(ifp)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01180}01180         \textcolor{keyword}{struct }ifnet            *ifp;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01181}01181 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01182}01182         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01183}01183 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01184}01184         sc = ifp-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01185}01185         \mbox{\hyperlink{if__lgereg_8h_a979c0b0266ec6d6efc9d2e40d8580d31}{LGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01186}01186         \mbox{\hyperlink{if__lge_8c_a38c27f49282f58b22b66add1f8af71b0}{lge\_start\_locked}}(ifp);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01187}01187         \mbox{\hyperlink{if__lgereg_8h_a2fba991aeb843a23de30e7d196e2f119}{LGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01188}01188 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01189}01189 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01190}01190 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01191}\mbox{\hyperlink{if__lge_8c_a38c27f49282f58b22b66add1f8af71b0}{01191}} \mbox{\hyperlink{if__lge_8c_a38c27f49282f58b22b66add1f8af71b0}{lge\_start\_locked}}(ifp)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01192}01192         \textcolor{keyword}{struct }ifnet            *ifp;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01193}01193 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01194}01194         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01195}01195         \textcolor{keyword}{struct }mbuf             *m\_head = NULL;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01196}01196         u\_int32\_t               idx;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01197}01197 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01198}01198         sc = ifp-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01199}01199 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01200}01200         \textcolor{keywordflow}{if} (!sc-\/>\mbox{\hyperlink{structlge__softc_af57eb85d1da88765e845c5a8bdfe18d0}{lge\_link}})}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01201}01201                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01202}01202 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01203}01203         idx = sc-\/>\mbox{\hyperlink{structlge__softc_aa1500b244a7053375e45eeaee1aa134d}{lge\_cdata}}.\mbox{\hyperlink{structlge__ring__data_aae1337c962b6c91c13bb39113e093919}{lge\_tx\_prod}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01204}01204 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01205}01205         \textcolor{keywordflow}{if} (ifp-\/>if\_drv\_flags \& IFF\_DRV\_OACTIVE)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01206}01206                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01207}01207 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01208}01208         \textcolor{keywordflow}{while}(sc-\/>\mbox{\hyperlink{structlge__softc_a32d9253cb35fc6fc5ac031ff88d50a06}{lge\_ldata}}-\/>\mbox{\hyperlink{structlge__list__data_a283d25348ade381e32b61bade75d20ef}{lge\_tx\_list}}[idx].\mbox{\hyperlink{structlge__tx__desc_ac884cd6601608ae923bf8ef11118f2a4}{lge\_mbuf}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01209}01209                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__lgereg_8h_a394044f8c65a429cea3c1993c9ed7766}{CSR\_READ\_1}}(sc, \mbox{\hyperlink{if__lgereg_8h_a9010769b94a09a448ddaa97560fd80be}{LGE\_TXCMDFREE\_8BIT}}) == 0)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01210}01210                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01211}01211 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01212}01212                 IF\_DEQUEUE(\&ifp-\/>if\_snd, m\_head);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01213}01213                 \textcolor{keywordflow}{if} (m\_head == NULL)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01214}01214                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01215}01215 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01216}01216                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__lge_8c_ad5f29342337eb7f3567ca05bf276edc7}{lge\_encap}}(sc, m\_head, \&idx)) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01217}01217                         IF\_PREPEND(\&ifp-\/>if\_snd, m\_head);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01218}01218                         ifp-\/>if\_drv\_flags |= IFF\_DRV\_OACTIVE;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01219}01219                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01220}01220                 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01221}01221 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01222}01222                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01223}01223 \textcolor{comment}{                 * If there's a BPF listener, bounce a copy of this frame}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01224}01224 \textcolor{comment}{                 * to him.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01225}01225 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01226}01226                 BPF\_MTAP(ifp, m\_head);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01227}01227         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01228}01228 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01229}01229         sc-\/>\mbox{\hyperlink{structlge__softc_aa1500b244a7053375e45eeaee1aa134d}{lge\_cdata}}.\mbox{\hyperlink{structlge__ring__data_aae1337c962b6c91c13bb39113e093919}{lge\_tx\_prod}} = idx;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01230}01230 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01231}01231         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01232}01232 \textcolor{comment}{         * Set a timeout in case the chip goes out to lunch.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01233}01233 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01234}01234         sc-\/>\mbox{\hyperlink{structlge__softc_a49531e0a593fb548504c2ca625f2fcd2}{lge\_timer}} = 5;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01235}01235 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01236}01236         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01237}01237 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01238}01238 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01239}01239 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01240}\mbox{\hyperlink{if__lge_8c_acaa317157953f5f95fae8ad1ef6894ed}{01240}} \mbox{\hyperlink{if__lge_8c_acaa317157953f5f95fae8ad1ef6894ed}{lge\_init}}(xsc)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01241}01241         \textcolor{keywordtype}{void}                    *xsc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01242}01242 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01243}01243         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc = xsc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01244}01244 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01245}01245         \mbox{\hyperlink{if__lgereg_8h_a979c0b0266ec6d6efc9d2e40d8580d31}{LGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01246}01246         \mbox{\hyperlink{if__lge_8c_ac3f39c3e796d83d651cb9c5fc5796e08}{lge\_init\_locked}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01247}01247         \mbox{\hyperlink{if__lgereg_8h_a2fba991aeb843a23de30e7d196e2f119}{LGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01248}01248 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01249}01249 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01250}01250 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01251}\mbox{\hyperlink{if__lge_8c_ac3f39c3e796d83d651cb9c5fc5796e08}{01251}} \mbox{\hyperlink{if__lge_8c_ac3f39c3e796d83d651cb9c5fc5796e08}{lge\_init\_locked}}(sc)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01252}01252         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01253}01253 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01254}01254         \textcolor{keyword}{struct }ifnet            *ifp = sc-\/>\mbox{\hyperlink{structlge__softc_aaa8504c7457a98c1e87d21e99593d163}{lge\_ifp}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01255}01255 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01256}01256         \mbox{\hyperlink{if__lgereg_8h_aaccd7e5b4a97745229ba5cfa6653cd8d}{LGE\_LOCK\_ASSERT}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01257}01257         \textcolor{keywordflow}{if} (ifp-\/>if\_drv\_flags \& IFF\_DRV\_RUNNING)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01258}01258                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01259}01259 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01260}01260         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01261}01261 \textcolor{comment}{         * Cancel pending I/O and free all RX/TX buffers.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01262}01262 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01263}01263         \mbox{\hyperlink{if__lge_8c_a86be044ed884c02e2d26d3b35fcf6275}{lge\_stop}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01264}01264         \mbox{\hyperlink{if__lge_8c_aa7585b21961b182417dd99c94ad91853}{lge\_reset}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01265}01265 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01266}01266         \textcolor{comment}{/* Set MAC address */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01267}01267         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_a33ad70dbd0d0383ebb0b2b5d9621a95b}{LGE\_PAR0}}, *(u\_int32\_t *)(\&IF\_LLADDR(sc-\/>\mbox{\hyperlink{structlge__softc_aaa8504c7457a98c1e87d21e99593d163}{lge\_ifp}})[0]));}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01268}01268         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_a48b5adf115b2c19ac349cff11b5acc74}{LGE\_PAR1}}, *(u\_int32\_t *)(\&IF\_LLADDR(sc-\/>\mbox{\hyperlink{structlge__softc_aaa8504c7457a98c1e87d21e99593d163}{lge\_ifp}})[4]));}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01269}01269 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01270}01270         \textcolor{comment}{/* Init circular RX list. */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01271}01271         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__lge_8c_a4826833381ce47d056f3965901577136}{lge\_list\_rx\_init}}(sc) == ENOBUFS) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01272}01272                 device\_printf(sc-\/>\mbox{\hyperlink{structlge__softc_a48b41ad357b297d5f6ba58a02d0062df}{lge\_dev}}, \textcolor{stringliteral}{"{}initialization failed: no "{}}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01273}01273                     \textcolor{stringliteral}{"{}memory for rx buffers\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01274}01274                 \mbox{\hyperlink{if__lge_8c_a86be044ed884c02e2d26d3b35fcf6275}{lge\_stop}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01275}01275                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01276}01276         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01277}01277 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01278}01278         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01279}01279 \textcolor{comment}{         * Init tx descriptors.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01280}01280 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01281}01281         \mbox{\hyperlink{if__lge_8c_af1f84d773cea894e640a2984448b613d}{lge\_list\_tx\_init}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01282}01282 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01283}01283         \textcolor{comment}{/* Set initial value for MODE1 register. */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01284}01284         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ab7c0aea2e7d1d0bddc038e80b28cd7bf}{LGE\_MODE1}}, \mbox{\hyperlink{if__lgereg_8h_a37bfb5e99ab71d86898358b2ee023742}{LGE\_MODE1\_RX\_UCAST}}|}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01285}01285             \mbox{\hyperlink{if__lgereg_8h_a83f931cc6252b1f4b4e45b35d04043ab}{LGE\_MODE1\_TX\_CRC}}|\mbox{\hyperlink{if__lgereg_8h_a8bf6eea1143943da22b3b1d9e355045a}{LGE\_MODE1\_TXPAD}}|}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01286}01286             \mbox{\hyperlink{if__lgereg_8h_abcaf0853dfa9c8a9f71f1ef1f63c28ad}{LGE\_MODE1\_RX\_FLOWCTL}}|\mbox{\hyperlink{if__lgereg_8h_a999b53e1b006d947b290c1b880621727}{LGE\_MODE1\_SETRST\_CTL0}}|}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01287}01287             \mbox{\hyperlink{if__lgereg_8h_ae1850fd752648095abc122ef8d7feea5}{LGE\_MODE1\_SETRST\_CTL1}}|\mbox{\hyperlink{if__lgereg_8h_ae4f150451e442f1ebd5d18530a7baf48}{LGE\_MODE1\_SETRST\_CTL2}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01288}01288 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01289}01289          \textcolor{comment}{/* If we want promiscuous mode, set the allframes bit. */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01290}01290         \textcolor{keywordflow}{if} (ifp-\/>if\_flags \& IFF\_PROMISC) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01291}01291                 \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ab7c0aea2e7d1d0bddc038e80b28cd7bf}{LGE\_MODE1}},}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01292}01292                     \mbox{\hyperlink{if__lgereg_8h_ae1850fd752648095abc122ef8d7feea5}{LGE\_MODE1\_SETRST\_CTL1}}|\mbox{\hyperlink{if__lgereg_8h_a9b2dde91fce9ffa0a9cf94853e1134b3}{LGE\_MODE1\_RX\_PROMISC}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01293}01293         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01294}01294                 \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ab7c0aea2e7d1d0bddc038e80b28cd7bf}{LGE\_MODE1}}, \mbox{\hyperlink{if__lgereg_8h_a9b2dde91fce9ffa0a9cf94853e1134b3}{LGE\_MODE1\_RX\_PROMISC}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01295}01295         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01296}01296 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01297}01297         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01298}01298 \textcolor{comment}{         * Set the capture broadcast bit to capture broadcast frames.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01299}01299 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01300}01300         \textcolor{keywordflow}{if} (ifp-\/>if\_flags \& IFF\_BROADCAST) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01301}01301                 \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ab7c0aea2e7d1d0bddc038e80b28cd7bf}{LGE\_MODE1}},}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01302}01302                     \mbox{\hyperlink{if__lgereg_8h_ae1850fd752648095abc122ef8d7feea5}{LGE\_MODE1\_SETRST\_CTL1}}|\mbox{\hyperlink{if__lgereg_8h_a6d5d73bd9f79c9b49a9ff9a7f020cb5e}{LGE\_MODE1\_RX\_BCAST}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01303}01303         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01304}01304                 \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ab7c0aea2e7d1d0bddc038e80b28cd7bf}{LGE\_MODE1}}, \mbox{\hyperlink{if__lgereg_8h_a6d5d73bd9f79c9b49a9ff9a7f020cb5e}{LGE\_MODE1\_RX\_BCAST}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01305}01305         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01306}01306 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01307}01307         \textcolor{comment}{/* Packet padding workaround? */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01308}01308         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ab7c0aea2e7d1d0bddc038e80b28cd7bf}{LGE\_MODE1}}, \mbox{\hyperlink{if__lgereg_8h_ae1850fd752648095abc122ef8d7feea5}{LGE\_MODE1\_SETRST\_CTL1}}|\mbox{\hyperlink{if__lgereg_8h_a2a7eecead594dd7e7e3b2e1e0f77d701}{LGE\_MODE1\_RMVPAD}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01309}01309 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01310}01310         \textcolor{comment}{/* No error frames */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01311}01311         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ab7c0aea2e7d1d0bddc038e80b28cd7bf}{LGE\_MODE1}}, \mbox{\hyperlink{if__lgereg_8h_a27f3b4664910f5c71319ae434bf87153}{LGE\_MODE1\_RX\_ERRPKTS}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01312}01312 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01313}01313         \textcolor{comment}{/* Receive large frames */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01314}01314         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ab7c0aea2e7d1d0bddc038e80b28cd7bf}{LGE\_MODE1}}, \mbox{\hyperlink{if__lgereg_8h_ae1850fd752648095abc122ef8d7feea5}{LGE\_MODE1\_SETRST\_CTL1}}|\mbox{\hyperlink{if__lgereg_8h_a4aac0d4e414d2326b8a96fd67f6ef1f7}{LGE\_MODE1\_RX\_GIANTS}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01315}01315 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01316}01316         \textcolor{comment}{/* Workaround: disable RX/TX flow control */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01317}01317         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ab7c0aea2e7d1d0bddc038e80b28cd7bf}{LGE\_MODE1}}, \mbox{\hyperlink{if__lgereg_8h_af607b9028ce7a52f521e954816b246c7}{LGE\_MODE1\_TX\_FLOWCTL}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01318}01318         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ab7c0aea2e7d1d0bddc038e80b28cd7bf}{LGE\_MODE1}}, \mbox{\hyperlink{if__lgereg_8h_abcaf0853dfa9c8a9f71f1ef1f63c28ad}{LGE\_MODE1\_RX\_FLOWCTL}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01319}01319 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01320}01320         \textcolor{comment}{/* Make sure to strip CRC from received frames */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01321}01321         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ab7c0aea2e7d1d0bddc038e80b28cd7bf}{LGE\_MODE1}}, \mbox{\hyperlink{if__lgereg_8h_a5712c3cbc335171537df7a38fff3fb14}{LGE\_MODE1\_RX\_CRC}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01322}01322 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01323}01323         \textcolor{comment}{/* Turn off magic packet mode */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01324}01324         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ab7c0aea2e7d1d0bddc038e80b28cd7bf}{LGE\_MODE1}}, \mbox{\hyperlink{if__lgereg_8h_a0afcdab404fba754ec9054e9d84dbe2e}{LGE\_MODE1\_MPACK\_ENB}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01325}01325 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01326}01326         \textcolor{comment}{/* Turn off all VLAN stuff */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01327}01327         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ab7c0aea2e7d1d0bddc038e80b28cd7bf}{LGE\_MODE1}}, \mbox{\hyperlink{if__lgereg_8h_a68e71b0f99ed60efc74ea66fbbae22a7}{LGE\_MODE1\_VLAN\_RX}}|\mbox{\hyperlink{if__lgereg_8h_ac57d80847dcecda474695684ff4752f4}{LGE\_MODE1\_VLAN\_TX}}|}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01328}01328             \mbox{\hyperlink{if__lgereg_8h_ae4812a867e69e89b8be789383703f7e3}{LGE\_MODE1\_VLAN\_STRIP}}|\mbox{\hyperlink{if__lgereg_8h_aa60e54a1e75ff7c9bacc331ab655d70b}{LGE\_MODE1\_VLAN\_INSERT}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01329}01329 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01330}01330         \textcolor{comment}{/* Workarond: FIFO overflow */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01331}01331         \mbox{\hyperlink{if__lgereg_8h_a08ca32fbdc23b0ac5387c64a29f0da5b}{CSR\_WRITE\_2}}(sc, \mbox{\hyperlink{if__lgereg_8h_a46457a92286206d0204ff757ac7884e9}{LGE\_RXFIFO\_HIWAT}}, 0x3FFF);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01332}01332         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ac8c78bed0aad41c9b328a6299fc59839}{LGE\_IMR}}, \mbox{\hyperlink{if__lgereg_8h_a6f8b824dc1d2b1272d89220dc35ffe68}{LGE\_IMR\_SETRST\_CTL1}}|\mbox{\hyperlink{if__lgereg_8h_ac8cf22fb5a9f36d578aacec6cf199c68}{LGE\_IMR\_RXFIFO\_WAT}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01333}01333 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01334}01334         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01335}01335 \textcolor{comment}{         * Load the multicast filter.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01336}01336 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01337}01337         \mbox{\hyperlink{if__lge_8c_abb70d1d05d585a1a280b9d20e6d9fc77}{lge\_setmulti}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01338}01338 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01339}01339         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01340}01340 \textcolor{comment}{         * Enable hardware checksum validation for all received IPv4}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01341}01341 \textcolor{comment}{         * packets, do not reject packets with bad checksums.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01342}01342 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01343}01343         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ab3230dd8a12ad552a86f20631d2bdea3}{LGE\_MODE2}}, \mbox{\hyperlink{if__lgereg_8h_a9e6f77137293e574948e12d33aa0946f}{LGE\_MODE2\_RX\_IPCSUM}}|}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01344}01344             \mbox{\hyperlink{if__lgereg_8h_a192c5a15c7a49e18708a5e34c5ac5a5a}{LGE\_MODE2\_RX\_TCPCSUM}}|\mbox{\hyperlink{if__lgereg_8h_a8a99c6d5699ec52fae91c1e681322e27}{LGE\_MODE2\_RX\_UDPCSUM}}|}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01345}01345             \mbox{\hyperlink{if__lgereg_8h_aef9f26a0121c7ae8a188d85373abadd2}{LGE\_MODE2\_RX\_ERRCSUM}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01346}01346 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01347}01347         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01348}01348 \textcolor{comment}{         * Enable the delivery of PHY interrupts based on}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01349}01349 \textcolor{comment}{         * link/speed/duplex status chalges.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01350}01350 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01351}01351         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ab7c0aea2e7d1d0bddc038e80b28cd7bf}{LGE\_MODE1}}, \mbox{\hyperlink{if__lgereg_8h_a999b53e1b006d947b290c1b880621727}{LGE\_MODE1\_SETRST\_CTL0}}|\mbox{\hyperlink{if__lgereg_8h_a05669655bc87ac069035f31753f578c3}{LGE\_MODE1\_GMIIPOLL}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01352}01352 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01353}01353         \textcolor{comment}{/* Enable receiver and transmitter. */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01354}01354         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_a71b218f8ae0303e6c30f3b894097b1e5}{LGE\_RXDESC\_ADDR\_HI}}, 0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01355}01355         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ab7c0aea2e7d1d0bddc038e80b28cd7bf}{LGE\_MODE1}}, \mbox{\hyperlink{if__lgereg_8h_ae1850fd752648095abc122ef8d7feea5}{LGE\_MODE1\_SETRST\_CTL1}}|\mbox{\hyperlink{if__lgereg_8h_a2177a7e6bf7c1d140095b39843e7ded9}{LGE\_MODE1\_RX\_ENB}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01356}01356 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01357}01357         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_a8edc2c9d5ed55e1bf3b515e4d73e9fe4}{LGE\_TXDESC\_ADDR\_HI}}, 0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01358}01358         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ab7c0aea2e7d1d0bddc038e80b28cd7bf}{LGE\_MODE1}}, \mbox{\hyperlink{if__lgereg_8h_ae1850fd752648095abc122ef8d7feea5}{LGE\_MODE1\_SETRST\_CTL1}}|\mbox{\hyperlink{if__lgereg_8h_aea01dde7cefead3f1db84d6bc7c52e2e}{LGE\_MODE1\_TX\_ENB}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01359}01359 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01360}01360         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01361}01361 \textcolor{comment}{         * Enable interrupts.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01362}01362 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01363}01363         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ac8c78bed0aad41c9b328a6299fc59839}{LGE\_IMR}}, \mbox{\hyperlink{if__lgereg_8h_aa34e6c50bae47302a5edee6d458c445a}{LGE\_IMR\_SETRST\_CTL0}}|}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01364}01364             \mbox{\hyperlink{if__lgereg_8h_a6f8b824dc1d2b1272d89220dc35ffe68}{LGE\_IMR\_SETRST\_CTL1}}|\mbox{\hyperlink{if__lgereg_8h_aa16f67cbcfd7c8b6fd0c9048408d0352}{LGE\_IMR\_INTR\_ENB}}|\mbox{\hyperlink{if__lgereg_8h_a49eff5bb52c38e92ba34a1852e29ce6e}{LGE\_INTRS}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01365}01365 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01366}01366         \mbox{\hyperlink{if__lge_8c_a77f4759743d50be62495478820446824}{lge\_ifmedia\_upd\_locked}}(ifp);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01367}01367 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01368}01368         ifp-\/>if\_drv\_flags |= IFF\_DRV\_RUNNING;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01369}01369         ifp-\/>if\_drv\_flags \&= \string~IFF\_DRV\_OACTIVE;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01370}01370 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01371}01371         callout\_reset(\&sc-\/>\mbox{\hyperlink{structlge__softc_a7c5d61da7768a58fe8615020b0e8aef3}{lge\_stat\_callout}}, hz, \mbox{\hyperlink{if__lge_8c_a688e2b91eb5e2144421ea3eeb1e95c3f}{lge\_tick}}, sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01372}01372 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01373}01373         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01374}01374 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01375}01375 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01376}01376 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01377}01377 \textcolor{comment}{ * Set media options.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01378}01378 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01379}01379 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01380}\mbox{\hyperlink{if__lge_8c_a6b4f502fb50ae3a79851121396e059af}{01380}} \mbox{\hyperlink{if__lge_8c_a6b4f502fb50ae3a79851121396e059af}{lge\_ifmedia\_upd}}(ifp)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01381}01381         \textcolor{keyword}{struct }ifnet            *ifp;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01382}01382 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01383}01383         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01384}01384 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01385}01385         sc = ifp-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01386}01386         \mbox{\hyperlink{if__lgereg_8h_a979c0b0266ec6d6efc9d2e40d8580d31}{LGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01387}01387         \mbox{\hyperlink{if__lge_8c_a77f4759743d50be62495478820446824}{lge\_ifmedia\_upd\_locked}}(ifp);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01388}01388         \mbox{\hyperlink{if__lgereg_8h_a2fba991aeb843a23de30e7d196e2f119}{LGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01389}01389 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01390}01390         \textcolor{keywordflow}{return}(0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01391}01391 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01392}01392 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01393}01393 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01394}\mbox{\hyperlink{if__lge_8c_a77f4759743d50be62495478820446824}{01394}} \mbox{\hyperlink{if__lge_8c_a77f4759743d50be62495478820446824}{lge\_ifmedia\_upd\_locked}}(ifp)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01395}01395         \textcolor{keyword}{struct }ifnet            *ifp;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01396}01396 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01397}01397         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01398}01398         \textcolor{keyword}{struct }mii\_data         *mii;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01399}01399         \textcolor{keyword}{struct }mii\_softc        *miisc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01400}01400 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01401}01401         sc = ifp-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01402}01402 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01403}01403         \mbox{\hyperlink{if__lgereg_8h_aaccd7e5b4a97745229ba5cfa6653cd8d}{LGE\_LOCK\_ASSERT}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01404}01404         mii = device\_get\_softc(sc-\/>\mbox{\hyperlink{structlge__softc_a35d02416dcbefe0adc6dd3a8ec3780f7}{lge\_miibus}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01405}01405         sc-\/>\mbox{\hyperlink{structlge__softc_af57eb85d1da88765e845c5a8bdfe18d0}{lge\_link}} = 0;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01406}01406         LIST\_FOREACH(miisc, \&mii-\/>mii\_phys, mii\_list)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01407}01407                 PHY\_RESET(miisc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01408}01408         mii\_mediachg(mii);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01409}01409 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01410}01410 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01411}01411 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01412}01412 \textcolor{comment}{ * Report current media status.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01413}01413 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01414}01414 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01415}\mbox{\hyperlink{if__lge_8c_aec15d8928d8cb3078a8656bdb97c12e8}{01415}} \mbox{\hyperlink{if__lge_8c_aec15d8928d8cb3078a8656bdb97c12e8}{lge\_ifmedia\_sts}}(ifp, ifmr)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01416}01416         \textcolor{keyword}{struct }ifnet            *ifp;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01417}01417         \textcolor{keyword}{struct }ifmediareq       *ifmr;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01418}01418 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01419}01419         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01420}01420         \textcolor{keyword}{struct }mii\_data         *mii;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01421}01421 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01422}01422         sc = ifp-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01423}01423 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01424}01424         \mbox{\hyperlink{if__lgereg_8h_a979c0b0266ec6d6efc9d2e40d8580d31}{LGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01425}01425         mii = device\_get\_softc(sc-\/>\mbox{\hyperlink{structlge__softc_a35d02416dcbefe0adc6dd3a8ec3780f7}{lge\_miibus}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01426}01426         mii\_pollstat(mii);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01427}01427         ifmr-\/>ifm\_active = mii-\/>mii\_media\_active;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01428}01428         ifmr-\/>ifm\_status = mii-\/>mii\_media\_status;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01429}01429         \mbox{\hyperlink{if__lgereg_8h_a2fba991aeb843a23de30e7d196e2f119}{LGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01430}01430 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01431}01431         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01432}01432 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01433}01433 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01434}01434 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01435}\mbox{\hyperlink{if__lge_8c_a28cf356073ea72a57537f51d616a80c6}{01435}} \mbox{\hyperlink{if__lge_8c_a28cf356073ea72a57537f51d616a80c6}{lge\_ioctl}}(ifp, command, data)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01436}01436         \textcolor{keyword}{struct }ifnet            *ifp;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01437}01437         u\_long                  command;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01438}01438         caddr\_t                 data;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01439}01439 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01440}01440         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc = ifp-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01441}01441         \textcolor{keyword}{struct }ifreq            *ifr = (\textcolor{keyword}{struct }ifreq *) data;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01442}01442         \textcolor{keyword}{struct }mii\_data         *mii;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01443}01443         \textcolor{keywordtype}{int}                     error = 0;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01444}01444 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01445}01445         \textcolor{keywordflow}{switch}(command) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01446}01446         \textcolor{keywordflow}{case} SIOCSIFMTU:}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01447}01447                 \mbox{\hyperlink{if__lgereg_8h_a979c0b0266ec6d6efc9d2e40d8580d31}{LGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01448}01448                 \textcolor{keywordflow}{if} (ifr-\/>ifr\_mtu > \mbox{\hyperlink{if__lgereg_8h_aa81612977ec8a2204c34bff6d3ecba5a}{LGE\_JUMBO\_MTU}})}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01449}01449                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01450}01450                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01451}01451                         ifp-\/>if\_mtu = ifr-\/>ifr\_mtu;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01452}01452                 \mbox{\hyperlink{if__lgereg_8h_a2fba991aeb843a23de30e7d196e2f119}{LGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01453}01453                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01454}01454         \textcolor{keywordflow}{case} SIOCSIFFLAGS:}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01455}01455                 \mbox{\hyperlink{if__lgereg_8h_a979c0b0266ec6d6efc9d2e40d8580d31}{LGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01456}01456                 \textcolor{keywordflow}{if} (ifp-\/>if\_flags \& IFF\_UP) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01457}01457                         \textcolor{keywordflow}{if} (ifp-\/>if\_drv\_flags \& IFF\_DRV\_RUNNING \&\&}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01458}01458                             ifp-\/>if\_flags \& IFF\_PROMISC \&\&}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01459}01459                             !(sc-\/>\mbox{\hyperlink{structlge__softc_a1ec76927bcae37b44eadcbaf6616de47}{lge\_if\_flags}} \& IFF\_PROMISC)) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01460}01460                                 \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ab7c0aea2e7d1d0bddc038e80b28cd7bf}{LGE\_MODE1}},}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01461}01461                                     \mbox{\hyperlink{if__lgereg_8h_ae1850fd752648095abc122ef8d7feea5}{LGE\_MODE1\_SETRST\_CTL1}}|}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01462}01462                                     \mbox{\hyperlink{if__lgereg_8h_a9b2dde91fce9ffa0a9cf94853e1134b3}{LGE\_MODE1\_RX\_PROMISC}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01463}01463                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (ifp-\/>if\_drv\_flags \& IFF\_DRV\_RUNNING \&\&}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01464}01464                             !(ifp-\/>if\_flags \& IFF\_PROMISC) \&\&}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01465}01465                             sc-\/>\mbox{\hyperlink{structlge__softc_a1ec76927bcae37b44eadcbaf6616de47}{lge\_if\_flags}} \& IFF\_PROMISC) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01466}01466                                 \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ab7c0aea2e7d1d0bddc038e80b28cd7bf}{LGE\_MODE1}},}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01467}01467                                     \mbox{\hyperlink{if__lgereg_8h_a9b2dde91fce9ffa0a9cf94853e1134b3}{LGE\_MODE1\_RX\_PROMISC}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01468}01468                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01469}01469                                 ifp-\/>if\_drv\_flags \&= \string~IFF\_DRV\_RUNNING;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01470}01470                                 \mbox{\hyperlink{if__lge_8c_ac3f39c3e796d83d651cb9c5fc5796e08}{lge\_init\_locked}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01471}01471                         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01472}01472                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01473}01473                         \textcolor{keywordflow}{if} (ifp-\/>if\_drv\_flags \& IFF\_DRV\_RUNNING)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01474}01474                                 \mbox{\hyperlink{if__lge_8c_a86be044ed884c02e2d26d3b35fcf6275}{lge\_stop}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01475}01475                 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01476}01476                 sc-\/>\mbox{\hyperlink{structlge__softc_a1ec76927bcae37b44eadcbaf6616de47}{lge\_if\_flags}} = ifp-\/>if\_flags;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01477}01477                 \mbox{\hyperlink{if__lgereg_8h_a2fba991aeb843a23de30e7d196e2f119}{LGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01478}01478                 error = 0;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01479}01479                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01480}01480         \textcolor{keywordflow}{case} SIOCADDMULTI:}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01481}01481         \textcolor{keywordflow}{case} SIOCDELMULTI:}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01482}01482                 \mbox{\hyperlink{if__lgereg_8h_a979c0b0266ec6d6efc9d2e40d8580d31}{LGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01483}01483                 \mbox{\hyperlink{if__lge_8c_abb70d1d05d585a1a280b9d20e6d9fc77}{lge\_setmulti}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01484}01484                 \mbox{\hyperlink{if__lgereg_8h_a2fba991aeb843a23de30e7d196e2f119}{LGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01485}01485                 error = 0;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01486}01486                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01487}01487         \textcolor{keywordflow}{case} SIOCGIFMEDIA:}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01488}01488         \textcolor{keywordflow}{case} SIOCSIFMEDIA:}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01489}01489                 mii = device\_get\_softc(sc-\/>\mbox{\hyperlink{structlge__softc_a35d02416dcbefe0adc6dd3a8ec3780f7}{lge\_miibus}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01490}01490                 error = ifmedia\_ioctl(ifp, ifr, \&mii-\/>mii\_media, command);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01491}01491                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01492}01492         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01493}01493                 error = ether\_ioctl(ifp, command, data);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01494}01494                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01495}01495         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01496}01496 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01497}01497         \textcolor{keywordflow}{return}(error);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01498}01498 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01499}01499 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01500}01500 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01501}\mbox{\hyperlink{if__lge_8c_ab57c127d31575d3987769aa74fc1b0f5}{01501}} \mbox{\hyperlink{if__lge_8c_ab57c127d31575d3987769aa74fc1b0f5}{lge\_watchdog}}(sc)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01502}01502         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01503}01503 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01504}01504         \textcolor{keyword}{struct }ifnet            *ifp;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01505}01505 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01506}01506         \mbox{\hyperlink{if__lgereg_8h_aaccd7e5b4a97745229ba5cfa6653cd8d}{LGE\_LOCK\_ASSERT}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01507}01507         ifp = sc-\/>\mbox{\hyperlink{structlge__softc_aaa8504c7457a98c1e87d21e99593d163}{lge\_ifp}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01508}01508 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01509}01509         if\_inc\_counter(ifp, IFCOUNTER\_OERRORS, 1);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01510}01510         if\_printf(ifp, \textcolor{stringliteral}{"{}watchdog timeout\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01511}01511 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01512}01512         \mbox{\hyperlink{if__lge_8c_a86be044ed884c02e2d26d3b35fcf6275}{lge\_stop}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01513}01513         \mbox{\hyperlink{if__lge_8c_aa7585b21961b182417dd99c94ad91853}{lge\_reset}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01514}01514         ifp-\/>if\_drv\_flags \&= \string~IFF\_DRV\_RUNNING;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01515}01515         \mbox{\hyperlink{if__lge_8c_ac3f39c3e796d83d651cb9c5fc5796e08}{lge\_init\_locked}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01516}01516 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01517}01517         \textcolor{keywordflow}{if} (ifp-\/>if\_snd.ifq\_head != NULL)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01518}01518                 \mbox{\hyperlink{if__lge_8c_a38c27f49282f58b22b66add1f8af71b0}{lge\_start\_locked}}(ifp);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01519}01519 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01520}01520 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01521}01521 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01522}01522 \textcolor{comment}{ * Stop the adapter and free any mbufs allocated to the}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01523}01523 \textcolor{comment}{ * RX and TX lists.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01524}01524 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01525}01525 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01526}\mbox{\hyperlink{if__lge_8c_a86be044ed884c02e2d26d3b35fcf6275}{01526}} \mbox{\hyperlink{if__lge_8c_a86be044ed884c02e2d26d3b35fcf6275}{lge\_stop}}(sc)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01527}01527         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01528}01528 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01529}01529         \textcolor{keywordtype}{int}                     i;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01530}01530         \textcolor{keyword}{struct }ifnet            *ifp;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01531}01531 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01532}01532         \mbox{\hyperlink{if__lgereg_8h_aaccd7e5b4a97745229ba5cfa6653cd8d}{LGE\_LOCK\_ASSERT}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01533}01533         ifp = sc-\/>\mbox{\hyperlink{structlge__softc_aaa8504c7457a98c1e87d21e99593d163}{lge\_ifp}};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01534}01534         sc-\/>\mbox{\hyperlink{structlge__softc_a49531e0a593fb548504c2ca625f2fcd2}{lge\_timer}} = 0;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01535}01535         callout\_stop(\&sc-\/>\mbox{\hyperlink{structlge__softc_a7c5d61da7768a58fe8615020b0e8aef3}{lge\_stat\_callout}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01536}01536         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ac8c78bed0aad41c9b328a6299fc59839}{LGE\_IMR}}, \mbox{\hyperlink{if__lgereg_8h_aa16f67cbcfd7c8b6fd0c9048408d0352}{LGE\_IMR\_INTR\_ENB}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01537}01537 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01538}01538         \textcolor{comment}{/* Disable receiver and transmitter. */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01539}01539         \mbox{\hyperlink{if__lgereg_8h_a75a501122f68bd7e548d14dac28d2cf2}{CSR\_WRITE\_4}}(sc, \mbox{\hyperlink{if__lgereg_8h_ab7c0aea2e7d1d0bddc038e80b28cd7bf}{LGE\_MODE1}}, \mbox{\hyperlink{if__lgereg_8h_a2177a7e6bf7c1d140095b39843e7ded9}{LGE\_MODE1\_RX\_ENB}}|\mbox{\hyperlink{if__lgereg_8h_aea01dde7cefead3f1db84d6bc7c52e2e}{LGE\_MODE1\_TX\_ENB}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01540}01540         sc-\/>\mbox{\hyperlink{structlge__softc_af57eb85d1da88765e845c5a8bdfe18d0}{lge\_link}} = 0;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01541}01541 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01542}01542         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01543}01543 \textcolor{comment}{         * Free data in the RX lists.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01544}01544 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01545}01545         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__lgereg_8h_aa04ae3e3ea59f1d58f2eacc5f5bcf373}{LGE\_RX\_LIST\_CNT}}; i++) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01546}01546                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structlge__softc_a32d9253cb35fc6fc5ac031ff88d50a06}{lge\_ldata}}-\/>\mbox{\hyperlink{structlge__list__data_a467d444f7d8e9fabbc4dec807715de42}{lge\_rx\_list}}[i].\mbox{\hyperlink{structlge__rx__desc_a64b154de0ea4a0bc1d5532e9894ac5a1}{lge\_mbuf}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01547}01547                         m\_freem(sc-\/>\mbox{\hyperlink{structlge__softc_a32d9253cb35fc6fc5ac031ff88d50a06}{lge\_ldata}}-\/>\mbox{\hyperlink{structlge__list__data_a467d444f7d8e9fabbc4dec807715de42}{lge\_rx\_list}}[i].\mbox{\hyperlink{structlge__rx__desc_a64b154de0ea4a0bc1d5532e9894ac5a1}{lge\_mbuf}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01548}01548                         sc-\/>\mbox{\hyperlink{structlge__softc_a32d9253cb35fc6fc5ac031ff88d50a06}{lge\_ldata}}-\/>\mbox{\hyperlink{structlge__list__data_a467d444f7d8e9fabbc4dec807715de42}{lge\_rx\_list}}[i].\mbox{\hyperlink{structlge__rx__desc_a64b154de0ea4a0bc1d5532e9894ac5a1}{lge\_mbuf}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01549}01549                 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01550}01550         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01551}01551         bzero((\textcolor{keywordtype}{char} *)\&sc-\/>\mbox{\hyperlink{structlge__softc_a32d9253cb35fc6fc5ac031ff88d50a06}{lge\_ldata}}-\/>\mbox{\hyperlink{structlge__list__data_a467d444f7d8e9fabbc4dec807715de42}{lge\_rx\_list}},}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01552}01552                 \textcolor{keyword}{sizeof}(sc-\/>\mbox{\hyperlink{structlge__softc_a32d9253cb35fc6fc5ac031ff88d50a06}{lge\_ldata}}-\/>\mbox{\hyperlink{structlge__list__data_a467d444f7d8e9fabbc4dec807715de42}{lge\_rx\_list}}));}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01553}01553 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01554}01554         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01555}01555 \textcolor{comment}{         * Free the TX list buffers.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01556}01556 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01557}01557         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{if__lgereg_8h_a30fcd71cdba5c575105b3b6ed30ce91d}{LGE\_TX\_LIST\_CNT}}; i++) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01558}01558                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structlge__softc_a32d9253cb35fc6fc5ac031ff88d50a06}{lge\_ldata}}-\/>\mbox{\hyperlink{structlge__list__data_a283d25348ade381e32b61bade75d20ef}{lge\_tx\_list}}[i].\mbox{\hyperlink{structlge__tx__desc_ac884cd6601608ae923bf8ef11118f2a4}{lge\_mbuf}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01559}01559                         m\_freem(sc-\/>\mbox{\hyperlink{structlge__softc_a32d9253cb35fc6fc5ac031ff88d50a06}{lge\_ldata}}-\/>\mbox{\hyperlink{structlge__list__data_a283d25348ade381e32b61bade75d20ef}{lge\_tx\_list}}[i].\mbox{\hyperlink{structlge__tx__desc_ac884cd6601608ae923bf8ef11118f2a4}{lge\_mbuf}});}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01560}01560                         sc-\/>\mbox{\hyperlink{structlge__softc_a32d9253cb35fc6fc5ac031ff88d50a06}{lge\_ldata}}-\/>\mbox{\hyperlink{structlge__list__data_a283d25348ade381e32b61bade75d20ef}{lge\_tx\_list}}[i].\mbox{\hyperlink{structlge__tx__desc_ac884cd6601608ae923bf8ef11118f2a4}{lge\_mbuf}} = NULL;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01561}01561                 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01562}01562         \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01563}01563 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01564}01564         bzero((\textcolor{keywordtype}{char} *)\&sc-\/>\mbox{\hyperlink{structlge__softc_a32d9253cb35fc6fc5ac031ff88d50a06}{lge\_ldata}}-\/>\mbox{\hyperlink{structlge__list__data_a283d25348ade381e32b61bade75d20ef}{lge\_tx\_list}},}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01565}01565                 \textcolor{keyword}{sizeof}(sc-\/>\mbox{\hyperlink{structlge__softc_a32d9253cb35fc6fc5ac031ff88d50a06}{lge\_ldata}}-\/>\mbox{\hyperlink{structlge__list__data_a283d25348ade381e32b61bade75d20ef}{lge\_tx\_list}}));}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01566}01566 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01567}01567         ifp-\/>if\_drv\_flags \&= \string~(IFF\_DRV\_RUNNING | IFF\_DRV\_OACTIVE);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01568}01568 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01569}01569         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01570}01570 \}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01571}01571 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01572}01572 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01573}01573 \textcolor{comment}{ * Stop all chip I/O so that the kernel's probe routines don't}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01574}01574 \textcolor{comment}{ * get confused by errant DMAs when rebooting.}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01575}01575 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01576}01576 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01577}\mbox{\hyperlink{if__lge_8c_a0155b546cdccab41f0b96d082bd46b87}{01577}} \mbox{\hyperlink{if__lge_8c_a0155b546cdccab41f0b96d082bd46b87}{lge\_shutdown}}(dev)}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01578}01578         device\_t                dev;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01579}01579 \{}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01580}01580         \textcolor{keyword}{struct }\mbox{\hyperlink{structlge__softc}{lge\_softc}}       *sc;}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01581}01581 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01582}01582         sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01583}01583 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01584}01584         \mbox{\hyperlink{if__lgereg_8h_a979c0b0266ec6d6efc9d2e40d8580d31}{LGE\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01585}01585         \mbox{\hyperlink{if__lge_8c_aa7585b21961b182417dd99c94ad91853}{lge\_reset}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01586}01586         \mbox{\hyperlink{if__lge_8c_a86be044ed884c02e2d26d3b35fcf6275}{lge\_stop}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01587}01587         \mbox{\hyperlink{if__lgereg_8h_a2fba991aeb843a23de30e7d196e2f119}{LGE\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01588}01588 }
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01589}01589         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{if__lge_8c_source_l01590}01590 \}}

\end{DoxyCode}
