\hypertarget{dp83867phy_8c_source}{}\doxysection{dp83867phy.\+c}
\label{dp83867phy_8c_source}\index{dev/mii/dp83867phy.c@{dev/mii/dp83867phy.c}}
\mbox{\hyperlink{dp83867phy_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2021 Alstom Group.}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 2021 Semihalf.}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00007}00007 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00008}00008 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00009}00009 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00010}00010 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00011}00011 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00012}00012 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00013}00013 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00014}00014 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00015}00015 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00016}00016 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00017}00017 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00018}00018 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00019}00019 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00020}00020 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00021}00021 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00022}00022 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00023}00023 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00024}00024 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00025}00025 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00026}00026 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00027}00027 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00028}00028 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00029}00029 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00030}00030 \textcolor{comment}{ * Driver for TI DP83867 Ethernet PHY}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00031}00031 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00032}00032 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00034}\mbox{\hyperlink{dp83867phy_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00034}} \mbox{\hyperlink{dp83867phy_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00035}00035 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/resource.h>}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/rman.h>}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <sys/socket.h>}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00043}00043 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <machine/resource.h>}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00045}00045 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <net/if.h>}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <net/if\_media.h>}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00048}00048 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{mii_8h}{dev/mii/mii.h}}>}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{miivar_8h}{dev/mii/miivar.h}}>}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00051}00051 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00052}00052 \textcolor{preprocessor}{\#include "{}miidevs.h"{}}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00053}00053 \textcolor{preprocessor}{\#include "{}miibus\_if.h"{}}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00054}00054 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00055}\mbox{\hyperlink{dp83867phy_8c_ad27cc17b25bb93134368d5eb21126eae}{00055}} \textcolor{preprocessor}{\#define BIT(x)                  (1 << (x))}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00056}00056 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00057}\mbox{\hyperlink{dp83867phy_8c_ac809f1c71abe3ad54b6b92f0ad794bb5}{00057}} \textcolor{preprocessor}{\#define DP83867\_PHYCR           0x10}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00058}\mbox{\hyperlink{dp83867phy_8c_ae881841263523943aaffff4def10be73}{00058}} \textcolor{preprocessor}{\#define DP83867\_PHYSTS          0x11}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00059}\mbox{\hyperlink{dp83867phy_8c_a30950d7fb1275bdeadb6fdbda3295527}{00059}} \textcolor{preprocessor}{\#define DP83867\_MICR            0x12}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00060}\mbox{\hyperlink{dp83867phy_8c_a032baf52408fc4ac591faebcc64e61ed}{00060}} \textcolor{preprocessor}{\#define DP83867\_ISR             0x13}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00061}\mbox{\hyperlink{dp83867phy_8c_a625d8dedb335f466325d0ed65d79cb9b}{00061}} \textcolor{preprocessor}{\#define DP83867\_CFG3            0x1E}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00062}\mbox{\hyperlink{dp83867phy_8c_a765cf6fb548fb842f07a57c0a98bc525}{00062}} \textcolor{preprocessor}{\#define DP83867\_CTRL            0x1F}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00063}\mbox{\hyperlink{dp83867phy_8c_a972f0fec9bca55cd1d2a9dfd598dc926}{00063}} \textcolor{preprocessor}{\#define DP83867\_CFG4            0x31}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00064}\mbox{\hyperlink{dp83867phy_8c_ade4da1ce9fcec0eb2b8fee4a55c313b3}{00064}} \textcolor{preprocessor}{\#define DP83867\_RGMIICTL        0x32}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00065}\mbox{\hyperlink{dp83867phy_8c_acfd17fe887aa6702ca51d95c93b736cd}{00065}} \textcolor{preprocessor}{\#define DP83867\_STRP\_STS1       0x6E}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00066}\mbox{\hyperlink{dp83867phy_8c_ade82d508aacc65ca40a07098aad811f8}{00066}} \textcolor{preprocessor}{\#define DP83867\_STRP\_STS2       0x6F}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00067}00067 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00068}\mbox{\hyperlink{dp83867phy_8c_a5f399dd08be07203e17567d23922ae1d}{00068}} \textcolor{preprocessor}{\#define DP83867\_PHYSTS\_LINK\_UP          BIT(10)}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00069}\mbox{\hyperlink{dp83867phy_8c_ae7c667001187c57bb5f19e86a062b453}{00069}} \textcolor{preprocessor}{\#define DP83867\_PHYSTS\_ANEG\_PENDING     BIT(11)}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00070}\mbox{\hyperlink{dp83867phy_8c_a41098885d6e6857c4db1e16632869885}{00070}} \textcolor{preprocessor}{\#define DP83867\_PHYSTS\_FD               BIT(13)}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00071}\mbox{\hyperlink{dp83867phy_8c_a0733f9e9768e764a8e6cc21bfd3b5deb}{00071}} \textcolor{preprocessor}{\#define DP83867\_PHYSTS\_SPEED\_MASK       (BIT(15) | BIT(14))}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00072}\mbox{\hyperlink{dp83867phy_8c_aea176984fa810433ee93a8fbd9ca9063}{00072}} \textcolor{preprocessor}{\#define DP83867\_PHYSTS\_SPEED\_1000       BIT(15)}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00073}\mbox{\hyperlink{dp83867phy_8c_abdc3800d4d1d2bf9da6e20157925bbb2}{00073}} \textcolor{preprocessor}{\#define DP83867\_PHYSTS\_SPEED\_100        BIT(14)}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00074}\mbox{\hyperlink{dp83867phy_8c_a3e29f8561a0452e7814d16c53109068b}{00074}} \textcolor{preprocessor}{\#define DP83867\_PHYSTS\_SPEED\_10         0}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00075}00075 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00076}\mbox{\hyperlink{dp83867phy_8c_a233fa0328eca0b4d05f102313e688f68}{00076}} \textcolor{preprocessor}{\#define DP83867\_MICR\_AN\_ERR             BIT(15)}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00077}\mbox{\hyperlink{dp83867phy_8c_a99f33bf6810fcdf3b2693f54721fb9fa}{00077}} \textcolor{preprocessor}{\#define DP83867\_MICR\_SPEED\_CHG          BIT(14)}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00078}\mbox{\hyperlink{dp83867phy_8c_a1fbea9c46fb9d9763b82d6ba757e9ec0}{00078}} \textcolor{preprocessor}{\#define DP83867\_MICR\_DP\_MODE\_CHG        BIT(13)}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00079}\mbox{\hyperlink{dp83867phy_8c_ab8a897bf76dc6f88b3e7fb482eaeff6f}{00079}} \textcolor{preprocessor}{\#define DP83867\_MICR\_AN\_CMPL            BIT(11)}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00080}\mbox{\hyperlink{dp83867phy_8c_a36e9025d3ea03a1ef24d4e22722c4828}{00080}} \textcolor{preprocessor}{\#define DP83867\_MICR\_LINK\_CHG           BIT(10)}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00081}00081 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00082}\mbox{\hyperlink{dp83867phy_8c_a062c922784d7a6d1abf116d825a202d3}{00082}} \textcolor{preprocessor}{\#define DP83867\_CFG3\_INT\_OE             BIT(7)}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00083}00083 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00084}\mbox{\hyperlink{dp83867phy_8c_a516fa2a77373af9942a6688b4ba6b5ff}{00084}} \textcolor{preprocessor}{\#define DP83867\_CFG4\_TST\_MODE1          BIT(7)}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00085}\mbox{\hyperlink{dp83867phy_8c_a500ab46de8a326e2c897355866d78781}{00085}} \textcolor{preprocessor}{\#define DP83867\_CFG4\_ANEG\_MASK          (BIT(5) | BIT(6))}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00086}\mbox{\hyperlink{dp83867phy_8c_a1389779f54fb400c9162b18d13c0b098}{00086}} \textcolor{preprocessor}{\#define DP83867\_CFG4\_ANEG\_16MS          (0 << 5)}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00087}00087 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00088}\mbox{\hyperlink{dp83867phy_8c_ac6b4829e2d4344f095582fc7b657e7be}{00088}} \textcolor{preprocessor}{\#define BMSR\_100\_MASK   (BMSR\_100T4 | BMSR\_100TXFDX | BMSR\_100TXHDX | \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00089}00089 \textcolor{preprocessor}{                         BMSR\_100T2FDX | BMSR\_100T2HDX)}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00090}00090 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00091}00091 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{dp83867phy_8c_a50ec11dc47473cc65829d0a6083a46f8}{dp\_probe}}(device\_t);}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00092}00092 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{dp83867phy_8c_afe53a4517ba77932a0b105b752d0fed7}{dp\_attach}}(device\_t);}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00093}00093 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00094}00094 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{dp83867phy_8c_adc6feb9702534d51bb7e1e6f3f10b5af}{dp\_service}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}}*, \textcolor{keyword}{struct} \mbox{\hyperlink{structmii__data}{mii\_data}}*, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00095}00095 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{dp83867phy_8c_ad43c3ccd72bd15ca50c6e90d1999d7a5}{dp\_status}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}}*);}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00096}00096 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00097}\mbox{\hyperlink{structdp83867__softc}{00097}} \textcolor{keyword}{struct }\mbox{\hyperlink{structdp83867__softc}{dp83867\_softc}} \{}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00098}\mbox{\hyperlink{structdp83867__softc_afedfac456858f233a6ea38b1422c0174}{00098}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structmii__softc}{mii\_softc}} \mbox{\hyperlink{structdp83867__softc_afedfac456858f233a6ea38b1422c0174}{mii\_sc}};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00099}\mbox{\hyperlink{structdp83867__softc_a174bc35b78d4bf0cb505141940ab3470}{00099}}         \textcolor{keyword}{struct }resource *\mbox{\hyperlink{structdp83867__softc_a174bc35b78d4bf0cb505141940ab3470}{irq\_res}};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00100}\mbox{\hyperlink{structdp83867__softc_afabbe9fbc171cb74e446f318fd81c0ff}{00100}}         \textcolor{keywordtype}{void}            *\mbox{\hyperlink{structdp83867__softc_afabbe9fbc171cb74e446f318fd81c0ff}{irq\_cookie}};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00101}00101 \};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00102}00102 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00103}\mbox{\hyperlink{dp83867phy_8c_ad4e9c7143d120d933b8d8fa6a9f6fd4f}{00103}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structmii__phydesc}{mii\_phydesc}} \mbox{\hyperlink{dp83867phy_8c_ad4e9c7143d120d933b8d8fa6a9f6fd4f}{dpphys}}[] = \{}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00104}00104         \mbox{\hyperlink{miivar_8h_ae87ddbe9ffefd4caca54be68c7b281fc}{MII\_PHY\_DESC}}(xxTI, DP83867),}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00105}00105         \mbox{\hyperlink{miivar_8h_a4cc657798701d214afbeff2b27c5083d}{MII\_PHY\_END}}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00106}00106 \};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00107}00107 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00108}\mbox{\hyperlink{dp83867phy_8c_a24e55fa2dd452dec0c13fde390f89c65}{00108}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structmii__phy__funcs}{mii\_phy\_funcs}} \mbox{\hyperlink{dp83867phy_8c_a24e55fa2dd452dec0c13fde390f89c65}{dpphy\_funcs}} = \{}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00109}00109         \mbox{\hyperlink{dp83867phy_8c_adc6feb9702534d51bb7e1e6f3f10b5af}{dp\_service}},}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00110}00110         \mbox{\hyperlink{dp83867phy_8c_ad43c3ccd72bd15ca50c6e90d1999d7a5}{dp\_status}},}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00111}00111         \mbox{\hyperlink{mii__physubr_8c_ac21db38f2acb040663be6eac5468eaa2}{mii\_phy\_reset}}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00112}00112 \};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00113}00113 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00114}00114 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00115}\mbox{\hyperlink{dp83867phy_8c_ad2adc69aa49a191bfd0561465ba2b132}{00115}} \mbox{\hyperlink{dp83867phy_8c_ad2adc69aa49a191bfd0561465ba2b132}{dp\_intr}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00116}00116 \{}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00117}00117         \textcolor{keyword}{struct }\mbox{\hyperlink{structmii__softc}{mii\_softc}} *sc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structmii__softc}{mii\_softc}} *)arg;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00118}00118         uint32\_t status;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00119}00119 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00120}00120         status = \mbox{\hyperlink{miivar_8h_a4f9acdc044cd8d94bd80432e4f01bcd2}{PHY\_READ}}(sc, \mbox{\hyperlink{dp83867phy_8c_a032baf52408fc4ac591faebcc64e61ed}{DP83867\_ISR}});}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00121}00121         status \&= \mbox{\hyperlink{miivar_8h_a4f9acdc044cd8d94bd80432e4f01bcd2}{PHY\_READ}}(sc, \mbox{\hyperlink{dp83867phy_8c_a30950d7fb1275bdeadb6fdbda3295527}{DP83867\_MICR}});}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00122}00122         \textcolor{keywordflow}{if} (!status)}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00123}00123                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00124}00124 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00125}00125         \mbox{\hyperlink{miivar_8h_a1c1cdb714bf40ba701256727dd6a73c5}{PHY\_STATUS}}(sc);}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00126}00126         \mbox{\hyperlink{mii__physubr_8c_ac5a93e41e086c93143a04d9d4548b251}{mii\_phy\_update}}(sc, \mbox{\hyperlink{miivar_8h_a6c5cb4a5233e6b1e8a8542636e8ba4c8}{MII\_MEDIACHG}});}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00127}00127 \}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00128}00128 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00129}00129 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00130}\mbox{\hyperlink{dp83867phy_8c_a50ec11dc47473cc65829d0a6083a46f8}{00130}} \mbox{\hyperlink{dp83867phy_8c_a50ec11dc47473cc65829d0a6083a46f8}{dp\_probe}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00131}00131 \{}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00132}00132 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00133}00133         \textcolor{keywordflow}{return} (\mbox{\hyperlink{mii__physubr_8c_a6eae4dd21de85ca536b06467bf0a5f88}{mii\_phy\_dev\_probe}}(dev, \mbox{\hyperlink{dp83867phy_8c_ad4e9c7143d120d933b8d8fa6a9f6fd4f}{dpphys}}, BUS\_PROBE\_DEFAULT));}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00134}00134 \}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00135}00135 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00136}00136 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00137}\mbox{\hyperlink{dp83867phy_8c_afe53a4517ba77932a0b105b752d0fed7}{00137}} \mbox{\hyperlink{dp83867phy_8c_afe53a4517ba77932a0b105b752d0fed7}{dp\_attach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00138}00138 \{}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00139}00139         \textcolor{keyword}{struct }\mbox{\hyperlink{structdp83867__softc}{dp83867\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00140}00140         \textcolor{keyword}{struct }\mbox{\hyperlink{structmii__softc}{mii\_softc}} *mii\_sc;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00141}00141         uint32\_t value, maxspeed;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00142}00142         ssize\_t size;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00143}00143         \textcolor{keywordtype}{int} rid, error;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00144}00144 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00145}00145         sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00146}00146         mii\_sc = \&sc-\/>\mbox{\hyperlink{structdp83867__softc_afedfac456858f233a6ea38b1422c0174}{mii\_sc}};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00147}00147 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00148}00148         size = device\_get\_property(dev, \textcolor{stringliteral}{"{}max-\/speed"{}}, \&maxspeed,}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00149}00149             \textcolor{keyword}{sizeof}(maxspeed), DEVICE\_PROP\_UINT32);}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00150}00150         \textcolor{keywordflow}{if} (size <= 0)}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00151}00151                 maxspeed = 0;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00152}00152 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00153}00153         mii\_sc-\/>\mbox{\hyperlink{structmii__softc_a62d6b45733153b536e1a48ef97b7cc49}{mii\_maxspeed}} = maxspeed;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00154}00154         \mbox{\hyperlink{mii__physubr_8c_a50acf7ba3fab73b23c13fe7da8c93f1d}{mii\_phy\_dev\_attach}}(dev, \mbox{\hyperlink{miivar_8h_a8d2d38c2ee2b3eb2ccd1f0a3da5fed03}{MIIF\_NOMANPAUSE}}, \&\mbox{\hyperlink{dp83867phy_8c_a24e55fa2dd452dec0c13fde390f89c65}{dpphy\_funcs}}, 1);}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00155}00155 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00156}00156         rid = 0;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00157}00157         sc-\/>\mbox{\hyperlink{structdp83867__softc_a174bc35b78d4bf0cb505141940ab3470}{irq\_res}} = bus\_alloc\_resource\_any(dev, SYS\_RES\_IRQ, \&rid, RF\_ACTIVE);}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00158}00158         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structdp83867__softc_a174bc35b78d4bf0cb505141940ab3470}{irq\_res}} == NULL)}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00159}00159                 \textcolor{keywordflow}{goto} no\_irq;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00160}00160 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00161}00161         error = bus\_setup\_intr(dev, sc-\/>\mbox{\hyperlink{structdp83867__softc_a174bc35b78d4bf0cb505141940ab3470}{irq\_res}}, INTR\_TYPE\_NET | INTR\_MPSAFE,}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00162}00162             NULL, \mbox{\hyperlink{dp83867phy_8c_ad2adc69aa49a191bfd0561465ba2b132}{dp\_intr}}, sc, \&sc-\/>\mbox{\hyperlink{structdp83867__softc_afabbe9fbc171cb74e446f318fd81c0ff}{irq\_cookie}});}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00163}00163         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00164}00164                 bus\_release\_resource(dev, SYS\_RES\_IRQ, 0, sc-\/>\mbox{\hyperlink{structdp83867__softc_a174bc35b78d4bf0cb505141940ab3470}{irq\_res}});}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00165}00165                 sc-\/>\mbox{\hyperlink{structdp83867__softc_a174bc35b78d4bf0cb505141940ab3470}{irq\_res}} = NULL;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00166}00166                 \textcolor{keywordflow}{goto} no\_irq;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00167}00167         \}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00168}00168 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00169}00169         \textcolor{comment}{/* Ack and unmask all relevant interrupts. */}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00170}00170         (void)\mbox{\hyperlink{miivar_8h_a4f9acdc044cd8d94bd80432e4f01bcd2}{PHY\_READ}}(mii\_sc, \mbox{\hyperlink{dp83867phy_8c_a032baf52408fc4ac591faebcc64e61ed}{DP83867\_ISR}});}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00171}00171         value = \mbox{\hyperlink{dp83867phy_8c_a233fa0328eca0b4d05f102313e688f68}{DP83867\_MICR\_AN\_ERR}} |}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00172}00172             \mbox{\hyperlink{dp83867phy_8c_a99f33bf6810fcdf3b2693f54721fb9fa}{DP83867\_MICR\_SPEED\_CHG}} |}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00173}00173             \mbox{\hyperlink{dp83867phy_8c_a1fbea9c46fb9d9763b82d6ba757e9ec0}{DP83867\_MICR\_DP\_MODE\_CHG}} |}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00174}00174             \mbox{\hyperlink{dp83867phy_8c_ab8a897bf76dc6f88b3e7fb482eaeff6f}{DP83867\_MICR\_AN\_CMPL}} |}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00175}00175             \mbox{\hyperlink{dp83867phy_8c_a36e9025d3ea03a1ef24d4e22722c4828}{DP83867\_MICR\_LINK\_CHG}};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00176}00176         \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(mii\_sc, \mbox{\hyperlink{dp83867phy_8c_a30950d7fb1275bdeadb6fdbda3295527}{DP83867\_MICR}}, value);}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00177}00177 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00178}00178         value = \mbox{\hyperlink{miivar_8h_a4f9acdc044cd8d94bd80432e4f01bcd2}{PHY\_READ}}(mii\_sc, \mbox{\hyperlink{dp83867phy_8c_a625d8dedb335f466325d0ed65d79cb9b}{DP83867\_CFG3}});}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00179}00179         value |= \mbox{\hyperlink{dp83867phy_8c_a062c922784d7a6d1abf116d825a202d3}{DP83867\_CFG3\_INT\_OE}};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00180}00180         \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(mii\_sc, \mbox{\hyperlink{dp83867phy_8c_a625d8dedb335f466325d0ed65d79cb9b}{DP83867\_CFG3}}, value);}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00181}00181 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00182}00182 no\_irq:}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00183}00183         \textcolor{comment}{/* Set autonegotation timeout to max possible value. */}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00184}00184         value = \mbox{\hyperlink{miivar_8h_a4f9acdc044cd8d94bd80432e4f01bcd2}{PHY\_READ}}(mii\_sc, \mbox{\hyperlink{dp83867phy_8c_a972f0fec9bca55cd1d2a9dfd598dc926}{DP83867\_CFG4}});}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00185}00185         value \&= \string~DP83867\_CFG4\_ANEG\_MASK;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00186}00186         value \&= \string~DP83867\_CFG4\_TST\_MODE1;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00187}00187         value |= \mbox{\hyperlink{dp83867phy_8c_a1389779f54fb400c9162b18d13c0b098}{DP83867\_CFG4\_ANEG\_16MS}};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00188}00188         \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(mii\_sc, \mbox{\hyperlink{dp83867phy_8c_a972f0fec9bca55cd1d2a9dfd598dc926}{DP83867\_CFG4}}, value);}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00189}00189 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00190}00190         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00191}00191 \}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00192}00192 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00193}00193 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00194}\mbox{\hyperlink{dp83867phy_8c_a274be2b2ba6c8ee7020eb7a84b08ad74}{00194}} \mbox{\hyperlink{dp83867phy_8c_a274be2b2ba6c8ee7020eb7a84b08ad74}{dp\_detach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00195}00195 \{}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00196}00196         \textcolor{keyword}{struct }\mbox{\hyperlink{structdp83867__softc}{dp83867\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00197}00197 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00198}00198         sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00199}00199 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00200}00200         bus\_teardown\_intr(dev, sc-\/>\mbox{\hyperlink{structdp83867__softc_a174bc35b78d4bf0cb505141940ab3470}{irq\_res}}, sc-\/>\mbox{\hyperlink{structdp83867__softc_afabbe9fbc171cb74e446f318fd81c0ff}{irq\_cookie}});}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00201}00201         bus\_release\_resource(dev, SYS\_RES\_IRQ, 0, sc-\/>\mbox{\hyperlink{structdp83867__softc_a174bc35b78d4bf0cb505141940ab3470}{irq\_res}});}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00202}00202 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00203}00203         \textcolor{keywordflow}{return} (\mbox{\hyperlink{mii__physubr_8c_af08a34e3932c19824be61fc41ee1083f}{mii\_phy\_detach}}(dev));}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00204}00204 \}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00205}00205 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00206}00206 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00207}\mbox{\hyperlink{dp83867phy_8c_adc6feb9702534d51bb7e1e6f3f10b5af}{00207}} \mbox{\hyperlink{dp83867phy_8c_adc6feb9702534d51bb7e1e6f3f10b5af}{dp\_service}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structmii__data}{mii\_data}} *mii, \textcolor{keywordtype}{int} cmd)}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00208}00208 \{}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00209}00209 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00210}00210         \textcolor{keywordflow}{switch} (cmd) \{}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00211}00211         \textcolor{keywordflow}{case} \mbox{\hyperlink{miivar_8h_a5ee687df11441661206e4d2922ab5a52}{MII\_POLLSTAT}}:}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00212}00212                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00213}00213         \textcolor{keywordflow}{case} \mbox{\hyperlink{miivar_8h_a6c5cb4a5233e6b1e8a8542636e8ba4c8}{MII\_MEDIACHG}}:}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00214}00214                 \mbox{\hyperlink{mii__physubr_8c_afac2ea5f0d036a16125e01fc48a41457}{mii\_phy\_setmedia}}(sc);}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00215}00215                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00216}00216         \textcolor{keywordflow}{case} \mbox{\hyperlink{miivar_8h_a7aba758235b2d688fc41842a167187e5}{MII\_TICK}}:}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00217}00217                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{mii__physubr_8c_aee0c2c158db70e66816d5c1269e83290}{mii\_phy\_tick}}(sc) == EJUSTRETURN)}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00218}00218                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00219}00219 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00220}00220                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00221}00221         \}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00222}00222 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00223}00223         \mbox{\hyperlink{miivar_8h_a1c1cdb714bf40ba701256727dd6a73c5}{PHY\_STATUS}}(sc);}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00224}00224         \mbox{\hyperlink{mii__physubr_8c_ac5a93e41e086c93143a04d9d4548b251}{mii\_phy\_update}}(sc, cmd);}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00225}00225         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00226}00226 \}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00227}00227 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00228}00228 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00229}\mbox{\hyperlink{dp83867phy_8c_ad43c3ccd72bd15ca50c6e90d1999d7a5}{00229}} \mbox{\hyperlink{dp83867phy_8c_ad43c3ccd72bd15ca50c6e90d1999d7a5}{dp\_status}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00230}00230 \{}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00231}00231         \textcolor{keyword}{struct }\mbox{\hyperlink{structmii__data}{mii\_data}} *mii;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00232}00232         \textcolor{keywordtype}{int} bmsr, bmcr, physts;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00233}00233 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00234}00234         mii = sc-\/>\mbox{\hyperlink{structmii__softc_a12011aec864a92fb63b711b43e6b4356}{mii\_pdata}};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00235}00235         mii-\/>\mbox{\hyperlink{structmii__data_a15c66b8658a144ac3294603a8146ac09}{mii\_media\_status}} = IFM\_AVALID;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00236}00236         mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}} = IFM\_ETHER;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00237}00237 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00238}00238         bmsr = \mbox{\hyperlink{miivar_8h_a4f9acdc044cd8d94bd80432e4f01bcd2}{PHY\_READ}}(sc, \mbox{\hyperlink{mii_8h_aa2f632686d6298a7c898b1c805586aab}{MII\_BMSR}}) | \mbox{\hyperlink{miivar_8h_a4f9acdc044cd8d94bd80432e4f01bcd2}{PHY\_READ}}(sc, \mbox{\hyperlink{mii_8h_aa2f632686d6298a7c898b1c805586aab}{MII\_BMSR}});}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00239}00239         physts = \mbox{\hyperlink{miivar_8h_a4f9acdc044cd8d94bd80432e4f01bcd2}{PHY\_READ}}(sc, \mbox{\hyperlink{dp83867phy_8c_ae881841263523943aaffff4def10be73}{DP83867\_PHYSTS}});}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00240}00240 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00241}00241         \textcolor{keywordflow}{if} ((bmsr \& \mbox{\hyperlink{mii_8h_aca42eb005e0fdbae038bd7c9f12a1035}{BMSR\_LINK}}) \&\& (physts \& \mbox{\hyperlink{dp83867phy_8c_a5f399dd08be07203e17567d23922ae1d}{DP83867\_PHYSTS\_LINK\_UP}}))}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00242}00242                 mii-\/>\mbox{\hyperlink{structmii__data_a15c66b8658a144ac3294603a8146ac09}{mii\_media\_status}} |= IFM\_ACTIVE;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00243}00243 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00244}00244         bmcr = \mbox{\hyperlink{miivar_8h_a4f9acdc044cd8d94bd80432e4f01bcd2}{PHY\_READ}}(sc, \mbox{\hyperlink{mii_8h_a9137acedc42ff140f244da7473cff29e}{MII\_BMCR}});}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00245}00245         \textcolor{keywordflow}{if} (bmcr \& \mbox{\hyperlink{mii_8h_a28b8dcb818bc18a079b39b5517c27e3a}{BMCR\_ISO}}) \{}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00246}00246                 mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}} |= IFM\_NONE;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00247}00247                 mii-\/>\mbox{\hyperlink{structmii__data_a15c66b8658a144ac3294603a8146ac09}{mii\_media\_status}} = 0;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00248}00248                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00249}00249         \}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00250}00250 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00251}00251         \textcolor{keywordflow}{if} (bmcr \& \mbox{\hyperlink{mii_8h_aafd596a9125ddece08d5a9798dce42d6}{BMCR\_LOOP}})}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00252}00252                 mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}} |= IFM\_LOOP;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00253}00253 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00254}00254         \textcolor{comment}{/* Autoneg in progress. */}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00255}00255         \textcolor{keywordflow}{if} (!(physts \& \mbox{\hyperlink{dp83867phy_8c_ae7c667001187c57bb5f19e86a062b453}{DP83867\_PHYSTS\_ANEG\_PENDING}})) \{}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00256}00256                 mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}} |= IFM\_NONE;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00257}00257                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00258}00258         \}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00259}00259 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00260}00260         \textcolor{keywordflow}{switch} (physts \& \mbox{\hyperlink{dp83867phy_8c_a0733f9e9768e764a8e6cc21bfd3b5deb}{DP83867\_PHYSTS\_SPEED\_MASK}}) \{}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00261}00261         \textcolor{keywordflow}{case} \mbox{\hyperlink{dp83867phy_8c_aea176984fa810433ee93a8fbd9ca9063}{DP83867\_PHYSTS\_SPEED\_1000}}:}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00262}00262                 mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}} |= IFM\_1000\_T;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00263}00263                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00264}00264         \textcolor{keywordflow}{case} \mbox{\hyperlink{dp83867phy_8c_abdc3800d4d1d2bf9da6e20157925bbb2}{DP83867\_PHYSTS\_SPEED\_100}}:}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00265}00265                 mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}} |= IFM\_100\_TX;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00266}00266                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00267}00267         \textcolor{keywordflow}{case} \mbox{\hyperlink{dp83867phy_8c_a3e29f8561a0452e7814d16c53109068b}{DP83867\_PHYSTS\_SPEED\_10}}:}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00268}00268                 mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}} |= IFM\_10\_T;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00269}00269                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00270}00270         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00271}00271                 mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}} |= IFM\_NONE;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00272}00272                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00273}00273         \}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00274}00274         \textcolor{keywordflow}{if} (physts \& \mbox{\hyperlink{dp83867phy_8c_a41098885d6e6857c4db1e16632869885}{DP83867\_PHYSTS\_FD}})}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00275}00275                 mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}} |= IFM\_FDX;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00276}00276         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00277}00277                 mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}} |= IFM\_HDX;}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00278}00278 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00279}00279 \}}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00280}00280 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00281}\mbox{\hyperlink{dp83867phy_8c_a52ecfaeef36bd19ec3df05ecd4270f92}{00281}} \textcolor{keyword}{static} device\_method\_t \mbox{\hyperlink{dp83867phy_8c_a52ecfaeef36bd19ec3df05ecd4270f92}{dp\_methods}}[] = \{}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00282}00282         DEVMETHOD(device\_probe,         \mbox{\hyperlink{dp83867phy_8c_a50ec11dc47473cc65829d0a6083a46f8}{dp\_probe}}),}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00283}00283         DEVMETHOD(device\_attach,        \mbox{\hyperlink{dp83867phy_8c_afe53a4517ba77932a0b105b752d0fed7}{dp\_attach}}),}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00284}00284         DEVMETHOD(device\_detach,        \mbox{\hyperlink{dp83867phy_8c_a274be2b2ba6c8ee7020eb7a84b08ad74}{dp\_detach}}),}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00285}00285         DEVMETHOD\_END}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00286}00286 \};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00287}00287 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00288}\mbox{\hyperlink{dp83867phy_8c_a489bf6f91e1d78ba96639d9d924865de}{00288}} \textcolor{keyword}{static} devclass\_t \mbox{\hyperlink{dp83867phy_8c_a489bf6f91e1d78ba96639d9d924865de}{dp\_devclass}};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00289}00289 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00290}\mbox{\hyperlink{dp83867phy_8c_ab2d2438912846be67cdf9cd7a55b4437}{00290}} \textcolor{keyword}{static} driver\_t \mbox{\hyperlink{dp83867phy_8c_ab2d2438912846be67cdf9cd7a55b4437}{dp\_driver}} = \{}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00291}00291         \textcolor{stringliteral}{"{}dp83867phy"{}},}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00292}00292         \mbox{\hyperlink{dp83867phy_8c_a52ecfaeef36bd19ec3df05ecd4270f92}{dp\_methods}},}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00293}00293         \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structdp83867__softc}{dp83867\_softc}})}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00294}00294 \};}
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00295}00295 }
\DoxyCodeLine{\Hypertarget{dp83867phy_8c_source_l00296}\mbox{\hyperlink{dp83867phy_8c_a977944cc50d6060a50f30eb589ea0a4d}{00296}} \mbox{\hyperlink{dp83867phy_8c_a977944cc50d6060a50f30eb589ea0a4d}{DRIVER\_MODULE}}(dp83867phy, \mbox{\hyperlink{miibus__if_8m_a4cbc1805319b363b9b338406a4b2a683}{miibus}}, \mbox{\hyperlink{dp83867phy_8c_ab2d2438912846be67cdf9cd7a55b4437}{dp\_driver}}, \mbox{\hyperlink{dp83867phy_8c_a489bf6f91e1d78ba96639d9d924865de}{dp\_devclass}}, 0, 0);}

\end{DoxyCode}
