\hypertarget{micphy_8c_source}{}\doxysection{micphy.\+c}
\label{micphy_8c_source}\index{dev/mii/micphy.c@{dev/mii/micphy.c}}
\mbox{\hyperlink{micphy_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2014,2019 Ruslan Bukin <br@bsdpad.com>}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00003}00003 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00004}00004 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00005}00005 \textcolor{comment}{ * This software was developed by SRI International and the University of}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00006}00006 \textcolor{comment}{ * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-\/10-\/C-\/0237)}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00007}00007 \textcolor{comment}{ * ("{}CTSRD"{}), as part of the DARPA CRASH research programme.}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00008}00008 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00009}00009 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00010}00010 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00011}00011 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00012}00012 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00013}00013 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00014}00014 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00015}00015 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00016}00016 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00017}00017 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00018}00018 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00019}00019 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00020}00020 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00021}00021 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00022}00022 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00023}00023 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00024}00024 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00025}00025 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00026}00026 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00027}00027 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00028}00028 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00029}00029 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00031}00031 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00032}\mbox{\hyperlink{micphy_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00032}} \mbox{\hyperlink{micphy_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00033}00033 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00034}00034 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00035}00035 \textcolor{comment}{ * Micrel KSZ8081/KSZ9021/KSZ9031 Gigabit Ethernet Transceiver}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00036}00036 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00037}00037 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/socket.h>}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <sys/errno.h>}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00046}00046 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <machine/bus.h>}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00048}00048 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <net/if.h>}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <net/if\_media.h>}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00051}00051 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00052}00052 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{mii_8h}{dev/mii/mii.h}}>}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{miivar_8h}{dev/mii/miivar.h}}>}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00054}00054 \textcolor{preprocessor}{\#include "{}miidevs.h"{}}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00055}00055 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00056}00056 \textcolor{preprocessor}{\#include "{}miibus\_if.h"{}}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00057}00057 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00058}00058 \textcolor{preprocessor}{\#include <dev/fdt/fdt\_common.h>}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00059}00059 \textcolor{preprocessor}{\#include <dev/ofw/openfirm.h>}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00060}00060 \textcolor{preprocessor}{\#include <dev/ofw/ofw\_bus.h>}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00061}00061 \textcolor{preprocessor}{\#include <dev/ofw/ofw\_bus\_subr.h>}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00062}00062 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{mii__fdt_8h}{dev/mii/mii\_fdt.h}}>}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00063}00063 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00064}\mbox{\hyperlink{micphy_8c_addc3f725a3567246f924d08ea1968a09}{00064}} \textcolor{preprocessor}{\#define MII\_KSZPHY\_EXTREG                       0x0b}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00065}\mbox{\hyperlink{micphy_8c_ad8d5e7236d1b410b158540c90097885a}{00065}} \textcolor{preprocessor}{\#define  KSZPHY\_EXTREG\_WRITE                    (1 << 15)}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00066}\mbox{\hyperlink{micphy_8c_acb5515f9c875f905c7cef0b6d7dd050e}{00066}} \textcolor{preprocessor}{\#define MII\_KSZPHY\_EXTREG\_WRITE                 0x0c}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00067}\mbox{\hyperlink{micphy_8c_ad604cc12549ff11252b85bb41c3cd321}{00067}} \textcolor{preprocessor}{\#define MII\_KSZPHY\_EXTREG\_READ                  0x0d}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00068}\mbox{\hyperlink{micphy_8c_a2b6af80e26e4a1460766512c0fe757e0}{00068}} \textcolor{preprocessor}{\#define MII\_KSZPHY\_CLK\_CONTROL\_PAD\_SKEW         0x104}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00069}\mbox{\hyperlink{micphy_8c_ac51f78a976a2ee4e15d8f67d9001ba6b}{00069}} \textcolor{preprocessor}{\#define MII\_KSZPHY\_RX\_DATA\_PAD\_SKEW             0x105}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00070}\mbox{\hyperlink{micphy_8c_a7c6fbf2773ac028320a764a3c943a316}{00070}} \textcolor{preprocessor}{\#define MII\_KSZPHY\_TX\_DATA\_PAD\_SKEW             0x106}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00071}00071 \textcolor{comment}{/* KSZ9031 */}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00072}\mbox{\hyperlink{micphy_8c_abcdcbf8b859c1c1fb3ee537ca066ea83}{00072}} \textcolor{preprocessor}{\#define MII\_KSZ9031\_MMD\_ACCESS\_CTRL             0x0d}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00073}\mbox{\hyperlink{micphy_8c_a078b870e4600ad002d5c6542bdb1f2b7}{00073}} \textcolor{preprocessor}{\#define MII\_KSZ9031\_MMD\_ACCESS\_DATA             0x0e}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00074}\mbox{\hyperlink{micphy_8c_a10b26bc38113cc78fd97caba3276ddaf}{00074}} \textcolor{preprocessor}{\#define  MII\_KSZ9031\_MMD\_DATA\_NOINC             (1 << 14)}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00075}\mbox{\hyperlink{micphy_8c_a6f2295aabe379aeca020e4790cc64fec}{00075}} \textcolor{preprocessor}{\#define MII\_KSZ9031\_CONTROL\_PAD\_SKEW            0x4}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00076}\mbox{\hyperlink{micphy_8c_aa21824a16f77aa9a408b7f63fc4a5dc4}{00076}} \textcolor{preprocessor}{\#define MII\_KSZ9031\_RX\_DATA\_PAD\_SKEW            0x5}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00077}\mbox{\hyperlink{micphy_8c_a1ba47669d8bb188248654bc53249417f}{00077}} \textcolor{preprocessor}{\#define MII\_KSZ9031\_TX\_DATA\_PAD\_SKEW            0x6}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00078}\mbox{\hyperlink{micphy_8c_a965f9559726effd3ecb5d106d39c9f6f}{00078}} \textcolor{preprocessor}{\#define MII\_KSZ9031\_CLOCK\_PAD\_SKEW              0x8}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00079}00079 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00080}\mbox{\hyperlink{micphy_8c_a3ebecb08d99666bca9e01a4e4f074024}{00080}} \textcolor{preprocessor}{\#define MII\_KSZ8081\_PHYCTL2                     0x1f}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00081}00081 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00082}\mbox{\hyperlink{micphy_8c_aacad2c3389a603ff34541175a9293e29}{00082}} \textcolor{preprocessor}{\#define PS\_TO\_REG(p)    ((p) / 200)}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00083}00083 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00084}00084 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{micphy_8c_a46c7c10653bb771cc0e468f412494c68}{micphy\_probe}}(device\_t);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00085}00085 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{micphy_8c_ae3a216792c1bd924185e7ada8852f393}{micphy\_attach}}(device\_t);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00086}00086 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{micphy_8c_a016a902087d1888a4c434fa68f9b855f}{micphy\_reset}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00087}00087 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{micphy_8c_a7c224900524aefb7aa2f33c18da919be}{micphy\_service}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structmii__data}{mii\_data}} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00088}00088 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00089}\mbox{\hyperlink{micphy_8c_ad5ccdabc633549045484148a01407b72}{00089}} \textcolor{keyword}{static} device\_method\_t \mbox{\hyperlink{micphy_8c_ad5ccdabc633549045484148a01407b72}{micphy\_methods}}[] = \{}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00090}00090         \textcolor{comment}{/* device interface */}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00091}00091         DEVMETHOD(device\_probe,         \mbox{\hyperlink{micphy_8c_a46c7c10653bb771cc0e468f412494c68}{micphy\_probe}}),}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00092}00092         DEVMETHOD(device\_attach,        \mbox{\hyperlink{micphy_8c_ae3a216792c1bd924185e7ada8852f393}{micphy\_attach}}),}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00093}00093         DEVMETHOD(device\_detach,        \mbox{\hyperlink{mii__physubr_8c_af08a34e3932c19824be61fc41ee1083f}{mii\_phy\_detach}}),}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00094}00094         DEVMETHOD(device\_shutdown,      bus\_generic\_shutdown),}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00095}00095         DEVMETHOD\_END}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00096}00096 \};}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00097}00097 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00098}\mbox{\hyperlink{micphy_8c_ad073500cb515038f9cdfad9cfb8a3bc0}{00098}} \textcolor{keyword}{static} devclass\_t \mbox{\hyperlink{micphy_8c_ad073500cb515038f9cdfad9cfb8a3bc0}{micphy\_devclass}};}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00099}00099 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00100}\mbox{\hyperlink{micphy_8c_a9d435a8c0e9fc6f4a6fd2077f97e7e26}{00100}} \textcolor{keyword}{static} driver\_t \mbox{\hyperlink{micphy_8c_a9d435a8c0e9fc6f4a6fd2077f97e7e26}{micphy\_driver}} = \{}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00101}00101         \textcolor{stringliteral}{"{}micphy"{}},}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00102}00102         \mbox{\hyperlink{micphy_8c_ad5ccdabc633549045484148a01407b72}{micphy\_methods}},}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00103}00103         \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structmii__softc}{mii\_softc}})}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00104}00104 \};}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00105}00105 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00106}\mbox{\hyperlink{micphy_8c_ab9a7cfa2e1830d875ca6e359fe7b72da}{00106}} \mbox{\hyperlink{micphy_8c_ab9a7cfa2e1830d875ca6e359fe7b72da}{DRIVER\_MODULE}}(micphy, \mbox{\hyperlink{miibus__if_8m_a4cbc1805319b363b9b338406a4b2a683}{miibus}}, \mbox{\hyperlink{micphy_8c_a9d435a8c0e9fc6f4a6fd2077f97e7e26}{micphy\_driver}}, \mbox{\hyperlink{micphy_8c_ad073500cb515038f9cdfad9cfb8a3bc0}{micphy\_devclass}}, 0, 0);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00107}00107 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00108}\mbox{\hyperlink{micphy_8c_a706eaaef56333806156a0c372a34bf29}{00108}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structmii__phydesc}{mii\_phydesc}} \mbox{\hyperlink{micphy_8c_a706eaaef56333806156a0c372a34bf29}{micphys}}[] = \{}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00109}00109         \mbox{\hyperlink{miivar_8h_ae87ddbe9ffefd4caca54be68c7b281fc}{MII\_PHY\_DESC}}(MICREL, KSZ8081),}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00110}00110         \mbox{\hyperlink{miivar_8h_ae87ddbe9ffefd4caca54be68c7b281fc}{MII\_PHY\_DESC}}(MICREL, KSZ9021),}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00111}00111         \mbox{\hyperlink{miivar_8h_ae87ddbe9ffefd4caca54be68c7b281fc}{MII\_PHY\_DESC}}(MICREL, KSZ9031),}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00112}00112         \mbox{\hyperlink{miivar_8h_a4cc657798701d214afbeff2b27c5083d}{MII\_PHY\_END}}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00113}00113 \};}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00114}00114 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00115}\mbox{\hyperlink{micphy_8c_a6a6fba2be94b2125b4aac4fece466b5a}{00115}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structmii__phy__funcs}{mii\_phy\_funcs}} \mbox{\hyperlink{micphy_8c_a6a6fba2be94b2125b4aac4fece466b5a}{micphy\_funcs}} = \{}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00116}00116         \mbox{\hyperlink{micphy_8c_a7c224900524aefb7aa2f33c18da919be}{micphy\_service}},}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00117}00117         \mbox{\hyperlink{miivar_8h_af0fe8ba84ff2d8de4b480836f1cd7bbc}{ukphy\_status}},}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00118}00118         \mbox{\hyperlink{micphy_8c_a016a902087d1888a4c434fa68f9b855f}{micphy\_reset}}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00119}00119 \};}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00120}00120 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00121}00121 \textcolor{keyword}{static} uint32\_t}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00122}\mbox{\hyperlink{micphy_8c_a912c455327bcf4cca7c05c3bce07d4f1}{00122}} \mbox{\hyperlink{micphy_8c_a912c455327bcf4cca7c05c3bce07d4f1}{ksz9031\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *sc, uint32\_t devaddr, uint32\_t \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}})}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00123}00123 \{}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00124}00124         \textcolor{comment}{/* Set up device address and register. */}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00125}00125         \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(sc, \mbox{\hyperlink{micphy_8c_abcdcbf8b859c1c1fb3ee537ca066ea83}{MII\_KSZ9031\_MMD\_ACCESS\_CTRL}}, devaddr);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00126}00126         \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(sc, \mbox{\hyperlink{micphy_8c_a078b870e4600ad002d5c6542bdb1f2b7}{MII\_KSZ9031\_MMD\_ACCESS\_DATA}}, \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}});}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00127}00127 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00128}00128         \textcolor{comment}{/* Select register data for MMD and read the value. */}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00129}00129         \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(sc, \mbox{\hyperlink{micphy_8c_abcdcbf8b859c1c1fb3ee537ca066ea83}{MII\_KSZ9031\_MMD\_ACCESS\_CTRL}},}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00130}00130             \mbox{\hyperlink{micphy_8c_a10b26bc38113cc78fd97caba3276ddaf}{MII\_KSZ9031\_MMD\_DATA\_NOINC}} | devaddr);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00131}00131 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00132}00132         \textcolor{keywordflow}{return} (\mbox{\hyperlink{miivar_8h_a4f9acdc044cd8d94bd80432e4f01bcd2}{PHY\_READ}}(sc, \mbox{\hyperlink{micphy_8c_a078b870e4600ad002d5c6542bdb1f2b7}{MII\_KSZ9031\_MMD\_ACCESS\_DATA}}));}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00133}00133 \}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00134}00134 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00135}00135 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00136}\mbox{\hyperlink{micphy_8c_a14dd63cac0160f11cb59d568e89a8d8c}{00136}} \mbox{\hyperlink{micphy_8c_a14dd63cac0160f11cb59d568e89a8d8c}{ksz9031\_write}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *sc, uint32\_t devaddr, uint32\_t \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}},}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00137}00137         uint32\_t \mbox{\hyperlink{miibus__if_8m_aa0ccb5ee6d882ee3605ff47745c6467b}{val}})}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00138}00138 \{}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00139}00139 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00140}00140         \textcolor{comment}{/* Set up device address and register. */}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00141}00141         \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(sc, \mbox{\hyperlink{micphy_8c_abcdcbf8b859c1c1fb3ee537ca066ea83}{MII\_KSZ9031\_MMD\_ACCESS\_CTRL}}, devaddr);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00142}00142         \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(sc, \mbox{\hyperlink{micphy_8c_a078b870e4600ad002d5c6542bdb1f2b7}{MII\_KSZ9031\_MMD\_ACCESS\_DATA}}, \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}});}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00143}00143 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00144}00144         \textcolor{comment}{/* Select register data for MMD and write the value. */}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00145}00145         \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(sc, \mbox{\hyperlink{micphy_8c_abcdcbf8b859c1c1fb3ee537ca066ea83}{MII\_KSZ9031\_MMD\_ACCESS\_CTRL}},}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00146}00146             \mbox{\hyperlink{micphy_8c_a10b26bc38113cc78fd97caba3276ddaf}{MII\_KSZ9031\_MMD\_DATA\_NOINC}} | devaddr);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00147}00147         \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(sc, \mbox{\hyperlink{micphy_8c_a078b870e4600ad002d5c6542bdb1f2b7}{MII\_KSZ9031\_MMD\_ACCESS\_DATA}}, \mbox{\hyperlink{miibus__if_8m_aa0ccb5ee6d882ee3605ff47745c6467b}{val}});}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00148}00148 \}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00149}00149 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00150}00150 \textcolor{keyword}{static} uint32\_t}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00151}\mbox{\hyperlink{micphy_8c_a05516290c33d49ff756da883fa17cdcb}{00151}} \mbox{\hyperlink{micphy_8c_a05516290c33d49ff756da883fa17cdcb}{ksz9021\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *sc, uint32\_t \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}})}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00152}00152 \{}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00153}00153 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00154}00154         \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(sc, \mbox{\hyperlink{micphy_8c_addc3f725a3567246f924d08ea1968a09}{MII\_KSZPHY\_EXTREG}}, \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}});}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00155}00155 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00156}00156         \textcolor{keywordflow}{return} (\mbox{\hyperlink{miivar_8h_a4f9acdc044cd8d94bd80432e4f01bcd2}{PHY\_READ}}(sc, \mbox{\hyperlink{micphy_8c_ad604cc12549ff11252b85bb41c3cd321}{MII\_KSZPHY\_EXTREG\_READ}}));}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00157}00157 \}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00158}00158 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00159}00159 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00160}\mbox{\hyperlink{micphy_8c_a0e404737ce626d5ea96d37f800fd34b7}{00160}} \mbox{\hyperlink{micphy_8c_a0e404737ce626d5ea96d37f800fd34b7}{ksz9021\_write}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *sc, uint32\_t \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}}, uint32\_t \mbox{\hyperlink{miibus__if_8m_aa0ccb5ee6d882ee3605ff47745c6467b}{val}})}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00161}00161 \{}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00162}00162 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00163}00163         \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(sc, \mbox{\hyperlink{micphy_8c_addc3f725a3567246f924d08ea1968a09}{MII\_KSZPHY\_EXTREG}}, \mbox{\hyperlink{micphy_8c_ad8d5e7236d1b410b158540c90097885a}{KSZPHY\_EXTREG\_WRITE}} | \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}});}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00164}00164         \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(sc, \mbox{\hyperlink{micphy_8c_acb5515f9c875f905c7cef0b6d7dd050e}{MII\_KSZPHY\_EXTREG\_WRITE}}, \mbox{\hyperlink{miibus__if_8m_aa0ccb5ee6d882ee3605ff47745c6467b}{val}});}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00165}00165 \}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00166}00166 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00167}00167 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00168}\mbox{\hyperlink{micphy_8c_a298f2d704ab7be9cde28053c9656e0dc}{00168}} \mbox{\hyperlink{micphy_8c_a298f2d704ab7be9cde28053c9656e0dc}{ksz90x1\_load\_values}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *sc, phandle\_t node,}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00169}00169     uint32\_t dev, uint32\_t \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}}, \textcolor{keywordtype}{char} *field1, uint32\_t f1mask, \textcolor{keywordtype}{int} f1off,}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00170}00170     \textcolor{keywordtype}{char} *field2, uint32\_t f2mask, \textcolor{keywordtype}{int} f2off, \textcolor{keywordtype}{char} *field3, uint32\_t f3mask,}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00171}00171     \textcolor{keywordtype}{int} f3off, \textcolor{keywordtype}{char} *field4, uint32\_t f4mask, \textcolor{keywordtype}{int} f4off)}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00172}00172 \{}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00173}00173         pcell\_t dts\_value[1];}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00174}00174         \textcolor{keywordtype}{int} len;}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00175}00175         \textcolor{keywordtype}{int} \mbox{\hyperlink{miibus__if_8m_aa0ccb5ee6d882ee3605ff47745c6467b}{val}};}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00176}00176 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00177}00177         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structmii__softc_a78f933ccf4c00044756002bdd88e4836}{mii\_mpd\_model}} == MII\_MODEL\_MICREL\_KSZ9031)}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00178}00178                 \mbox{\hyperlink{miibus__if_8m_aa0ccb5ee6d882ee3605ff47745c6467b}{val}} = \mbox{\hyperlink{micphy_8c_a912c455327bcf4cca7c05c3bce07d4f1}{ksz9031\_read}}(sc, dev, \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}});}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00179}00179         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00180}00180                 \mbox{\hyperlink{miibus__if_8m_aa0ccb5ee6d882ee3605ff47745c6467b}{val}} = \mbox{\hyperlink{micphy_8c_a05516290c33d49ff756da883fa17cdcb}{ksz9021\_read}}(sc, \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}});}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00181}00181 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00182}00182         \textcolor{keywordflow}{if} ((len = OF\_getproplen(node, field1)) > 0) \{}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00183}00183                 OF\_getencprop(node, field1, dts\_value, len);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00184}00184                 \mbox{\hyperlink{miibus__if_8m_aa0ccb5ee6d882ee3605ff47745c6467b}{val}} \&= \string~(f1mask << f1off);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00185}00185                 \mbox{\hyperlink{miibus__if_8m_aa0ccb5ee6d882ee3605ff47745c6467b}{val}} |= (\mbox{\hyperlink{micphy_8c_aacad2c3389a603ff34541175a9293e29}{PS\_TO\_REG}}(dts\_value[0]) \& f1mask) << f1off;}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00186}00186         \}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00187}00187 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00188}00188         \textcolor{keywordflow}{if} (field2 != NULL \&\& (len = OF\_getproplen(node, field2)) > 0) \{}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00189}00189                 OF\_getencprop(node, field2, dts\_value, len);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00190}00190                 \mbox{\hyperlink{miibus__if_8m_aa0ccb5ee6d882ee3605ff47745c6467b}{val}} \&= \string~(f2mask << f2off);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00191}00191                 \mbox{\hyperlink{miibus__if_8m_aa0ccb5ee6d882ee3605ff47745c6467b}{val}} |= (\mbox{\hyperlink{micphy_8c_aacad2c3389a603ff34541175a9293e29}{PS\_TO\_REG}}(dts\_value[0]) \& f2mask) << f2off;}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00192}00192         \}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00193}00193 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00194}00194         \textcolor{keywordflow}{if} (field3 != NULL \&\& (len = OF\_getproplen(node, field3)) > 0) \{}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00195}00195                 OF\_getencprop(node, field3, dts\_value, len);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00196}00196                 \mbox{\hyperlink{miibus__if_8m_aa0ccb5ee6d882ee3605ff47745c6467b}{val}} \&= \string~(f3mask << f3off);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00197}00197                 \mbox{\hyperlink{miibus__if_8m_aa0ccb5ee6d882ee3605ff47745c6467b}{val}} |= (\mbox{\hyperlink{micphy_8c_aacad2c3389a603ff34541175a9293e29}{PS\_TO\_REG}}(dts\_value[0]) \& f3mask) << f3off;}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00198}00198         \}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00199}00199 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00200}00200         \textcolor{keywordflow}{if} (field4 != NULL \&\& (len = OF\_getproplen(node, field4)) > 0) \{}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00201}00201                 OF\_getencprop(node, field4, dts\_value, len);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00202}00202                 \mbox{\hyperlink{miibus__if_8m_aa0ccb5ee6d882ee3605ff47745c6467b}{val}} \&= \string~(f4mask << f4off);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00203}00203                 \mbox{\hyperlink{miibus__if_8m_aa0ccb5ee6d882ee3605ff47745c6467b}{val}} |= (\mbox{\hyperlink{micphy_8c_aacad2c3389a603ff34541175a9293e29}{PS\_TO\_REG}}(dts\_value[0]) \& f4mask) << f4off;}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00204}00204         \}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00205}00205 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00206}00206         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structmii__softc_a78f933ccf4c00044756002bdd88e4836}{mii\_mpd\_model}} == MII\_MODEL\_MICREL\_KSZ9031)}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00207}00207                 \mbox{\hyperlink{micphy_8c_a14dd63cac0160f11cb59d568e89a8d8c}{ksz9031\_write}}(sc, dev, \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}}, \mbox{\hyperlink{miibus__if_8m_aa0ccb5ee6d882ee3605ff47745c6467b}{val}});}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00208}00208         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00209}00209                 \mbox{\hyperlink{micphy_8c_a0e404737ce626d5ea96d37f800fd34b7}{ksz9021\_write}}(sc, \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}}, \mbox{\hyperlink{miibus__if_8m_aa0ccb5ee6d882ee3605ff47745c6467b}{val}});}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00210}00210 \}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00211}00211 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00212}00212 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00213}\mbox{\hyperlink{micphy_8c_abfb76c97d146fcffb0b2233056d2f7cd}{00213}} \mbox{\hyperlink{micphy_8c_abfb76c97d146fcffb0b2233056d2f7cd}{ksz9031\_load\_values}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *sc, phandle\_t node)}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00214}00214 \{}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00215}00215 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00216}00216         \mbox{\hyperlink{micphy_8c_a298f2d704ab7be9cde28053c9656e0dc}{ksz90x1\_load\_values}}(sc, node, 2, \mbox{\hyperlink{micphy_8c_a6f2295aabe379aeca020e4790cc64fec}{MII\_KSZ9031\_CONTROL\_PAD\_SKEW}},}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00217}00217             \textcolor{stringliteral}{"{}txen-\/skew-\/ps"{}}, 0xf, 0, \textcolor{stringliteral}{"{}rxdv-\/skew-\/ps"{}}, 0xf, 4,}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00218}00218             NULL, 0, 0, NULL, 0, 0);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00219}00219         \mbox{\hyperlink{micphy_8c_a298f2d704ab7be9cde28053c9656e0dc}{ksz90x1\_load\_values}}(sc, node, 2, \mbox{\hyperlink{micphy_8c_aa21824a16f77aa9a408b7f63fc4a5dc4}{MII\_KSZ9031\_RX\_DATA\_PAD\_SKEW}},}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00220}00220             \textcolor{stringliteral}{"{}rxd0-\/skew-\/ps"{}}, 0xf, 0, \textcolor{stringliteral}{"{}rxd1-\/skew-\/ps"{}}, 0xf, 4,}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00221}00221             \textcolor{stringliteral}{"{}rxd2-\/skew-\/ps"{}}, 0xf, 8, \textcolor{stringliteral}{"{}rxd3-\/skew-\/ps"{}}, 0xf, 12);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00222}00222         \mbox{\hyperlink{micphy_8c_a298f2d704ab7be9cde28053c9656e0dc}{ksz90x1\_load\_values}}(sc, node, 2, \mbox{\hyperlink{micphy_8c_a1ba47669d8bb188248654bc53249417f}{MII\_KSZ9031\_TX\_DATA\_PAD\_SKEW}},}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00223}00223             \textcolor{stringliteral}{"{}txd0-\/skew-\/ps"{}}, 0xf, 0, \textcolor{stringliteral}{"{}txd1-\/skew-\/ps"{}}, 0xf, 4,}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00224}00224             \textcolor{stringliteral}{"{}txd2-\/skew-\/ps"{}}, 0xf, 8, \textcolor{stringliteral}{"{}txd3-\/skew-\/ps"{}}, 0xf, 12);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00225}00225         \mbox{\hyperlink{micphy_8c_a298f2d704ab7be9cde28053c9656e0dc}{ksz90x1\_load\_values}}(sc, node, 2, \mbox{\hyperlink{micphy_8c_a965f9559726effd3ecb5d106d39c9f6f}{MII\_KSZ9031\_CLOCK\_PAD\_SKEW}},}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00226}00226             \textcolor{stringliteral}{"{}rxc-\/skew-\/ps"{}}, 0x1f, 0, \textcolor{stringliteral}{"{}txc-\/skew-\/ps"{}}, 0x1f, 5,}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00227}00227             NULL, 0, 0, NULL, 0, 0);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00228}00228 \}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00229}00229 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00230}00230 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00231}\mbox{\hyperlink{micphy_8c_aae94e3119516a075c71327fede010f39}{00231}} \mbox{\hyperlink{micphy_8c_aae94e3119516a075c71327fede010f39}{ksz9021\_load\_values}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *sc, phandle\_t node)}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00232}00232 \{}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00233}00233 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00234}00234         \mbox{\hyperlink{micphy_8c_a298f2d704ab7be9cde28053c9656e0dc}{ksz90x1\_load\_values}}(sc, node, 0, \mbox{\hyperlink{micphy_8c_a2b6af80e26e4a1460766512c0fe757e0}{MII\_KSZPHY\_CLK\_CONTROL\_PAD\_SKEW}},}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00235}00235             \textcolor{stringliteral}{"{}txen-\/skew-\/ps"{}}, 0xf, 0, \textcolor{stringliteral}{"{}txc-\/skew-\/ps"{}}, 0xf, 4,}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00236}00236             \textcolor{stringliteral}{"{}rxdv-\/skew-\/ps"{}}, 0xf, 8, \textcolor{stringliteral}{"{}rxc-\/skew-\/ps"{}}, 0xf, 12);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00237}00237         \mbox{\hyperlink{micphy_8c_a298f2d704ab7be9cde28053c9656e0dc}{ksz90x1\_load\_values}}(sc, node, 0, \mbox{\hyperlink{micphy_8c_ac51f78a976a2ee4e15d8f67d9001ba6b}{MII\_KSZPHY\_RX\_DATA\_PAD\_SKEW}},}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00238}00238             \textcolor{stringliteral}{"{}rxd0-\/skew-\/ps"{}}, 0xf, 0, \textcolor{stringliteral}{"{}rxd1-\/skew-\/ps"{}}, 0xf, 4,}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00239}00239             \textcolor{stringliteral}{"{}rxd2-\/skew-\/ps"{}}, 0xf, 8, \textcolor{stringliteral}{"{}rxd3-\/skew-\/ps"{}}, 0xf, 12);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00240}00240         \mbox{\hyperlink{micphy_8c_a298f2d704ab7be9cde28053c9656e0dc}{ksz90x1\_load\_values}}(sc, node, 0, \mbox{\hyperlink{micphy_8c_a7c6fbf2773ac028320a764a3c943a316}{MII\_KSZPHY\_TX\_DATA\_PAD\_SKEW}},}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00241}00241             \textcolor{stringliteral}{"{}txd0-\/skew-\/ps"{}}, 0xf, 0, \textcolor{stringliteral}{"{}txd1-\/skew-\/ps"{}}, 0xf, 4,}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00242}00242             \textcolor{stringliteral}{"{}txd2-\/skew-\/ps"{}}, 0xf, 8, \textcolor{stringliteral}{"{}txd3-\/skew-\/ps"{}}, 0xf, 12);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00243}00243 \}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00244}00244 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00245}00245 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00246}\mbox{\hyperlink{micphy_8c_a46c7c10653bb771cc0e468f412494c68}{00246}} \mbox{\hyperlink{micphy_8c_a46c7c10653bb771cc0e468f412494c68}{micphy\_probe}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00247}00247 \{}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00248}00248 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00249}00249         \textcolor{keywordflow}{return} (\mbox{\hyperlink{mii__physubr_8c_a6eae4dd21de85ca536b06467bf0a5f88}{mii\_phy\_dev\_probe}}(dev, \mbox{\hyperlink{micphy_8c_a706eaaef56333806156a0c372a34bf29}{micphys}}, BUS\_PROBE\_DEFAULT));}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00250}00250 \}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00251}00251 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00252}00252 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00253}\mbox{\hyperlink{micphy_8c_ae3a216792c1bd924185e7ada8852f393}{00253}} \mbox{\hyperlink{micphy_8c_ae3a216792c1bd924185e7ada8852f393}{micphy\_attach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00254}00254 \{}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00255}00255         \mbox{\hyperlink{structmii__fdt__phy__config}{mii\_fdt\_phy\_config\_t}} *cfg;}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00256}00256         \textcolor{keyword}{struct }\mbox{\hyperlink{structmii__softc}{mii\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00257}00257         phandle\_t node;}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00258}00258         device\_t \mbox{\hyperlink{miibus__if_8m_a4cbc1805319b363b9b338406a4b2a683}{miibus}};}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00259}00259         device\_t parent;}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00260}00260 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00261}00261         sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00262}00262 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00263}00263         \mbox{\hyperlink{mii__physubr_8c_a50acf7ba3fab73b23c13fe7da8c93f1d}{mii\_phy\_dev\_attach}}(dev, \mbox{\hyperlink{miivar_8h_a8d2d38c2ee2b3eb2ccd1f0a3da5fed03}{MIIF\_NOMANPAUSE}}, \&\mbox{\hyperlink{micphy_8c_a6a6fba2be94b2125b4aac4fece466b5a}{micphy\_funcs}}, 1);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00264}00264         \mbox{\hyperlink{mii__physubr_8c_afac2ea5f0d036a16125e01fc48a41457}{mii\_phy\_setmedia}}(sc);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00265}00265 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00266}00266         \textcolor{comment}{/* Nothing further to configure for 8081 model. */}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00267}00267         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structmii__softc_a78f933ccf4c00044756002bdd88e4836}{mii\_mpd\_model}} == MII\_MODEL\_MICREL\_KSZ8081)}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00268}00268                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00269}00269 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00270}00270         \mbox{\hyperlink{miibus__if_8m_a4cbc1805319b363b9b338406a4b2a683}{miibus}} = device\_get\_parent(dev);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00271}00271         parent = device\_get\_parent(\mbox{\hyperlink{miibus__if_8m_a4cbc1805319b363b9b338406a4b2a683}{miibus}});}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00272}00272 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00273}00273         \textcolor{keywordflow}{if} ((node = ofw\_bus\_get\_node(parent)) == -\/1)}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00274}00274                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00275}00275 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00276}00276         cfg = \mbox{\hyperlink{mii__fdt_8c_a69c3ae4c7125341f611668875f9b55ea}{mii\_fdt\_get\_config}}(dev);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00277}00277 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00278}00278         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structmii__softc_a78f933ccf4c00044756002bdd88e4836}{mii\_mpd\_model}} == MII\_MODEL\_MICREL\_KSZ9031)}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00279}00279                 \mbox{\hyperlink{micphy_8c_abfb76c97d146fcffb0b2233056d2f7cd}{ksz9031\_load\_values}}(sc, cfg-\/>\mbox{\hyperlink{structmii__fdt__phy__config_ae6cead8b778b49216d6cd193eed5ce72}{phynode}});}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00280}00280         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00281}00281                 \mbox{\hyperlink{micphy_8c_aae94e3119516a075c71327fede010f39}{ksz9021\_load\_values}}(sc, cfg-\/>\mbox{\hyperlink{structmii__fdt__phy__config_ae6cead8b778b49216d6cd193eed5ce72}{phynode}});}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00282}00282 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00283}00283         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00284}00284 \}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00285}00285 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00286}00286 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00287}\mbox{\hyperlink{micphy_8c_a016a902087d1888a4c434fa68f9b855f}{00287}} \mbox{\hyperlink{micphy_8c_a016a902087d1888a4c434fa68f9b855f}{micphy\_reset}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00288}00288 \{}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00289}00289         \textcolor{keywordtype}{int} \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}};}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00290}00290 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00291}00291         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00292}00292 \textcolor{comment}{         * The 8081 has no "{}sticky bits"{} that survive a soft reset; several bits}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00293}00293 \textcolor{comment}{         * in the Phy Control Register 2 must be preserved across the reset.}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00294}00294 \textcolor{comment}{         * These bits are set up by the bootloader; they control how the phy}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00295}00295 \textcolor{comment}{         * interfaces to the board (such as clock frequency and LED behavior).}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00296}00296 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00297}00297         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structmii__softc_a78f933ccf4c00044756002bdd88e4836}{mii\_mpd\_model}} == MII\_MODEL\_MICREL\_KSZ8081)}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00298}00298                 \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}} = \mbox{\hyperlink{miivar_8h_a4f9acdc044cd8d94bd80432e4f01bcd2}{PHY\_READ}}(sc, \mbox{\hyperlink{micphy_8c_a3ebecb08d99666bca9e01a4e4f074024}{MII\_KSZ8081\_PHYCTL2}});}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00299}00299         \mbox{\hyperlink{mii__physubr_8c_ac21db38f2acb040663be6eac5468eaa2}{mii\_phy\_reset}}(sc);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00300}00300         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structmii__softc_a78f933ccf4c00044756002bdd88e4836}{mii\_mpd\_model}} == MII\_MODEL\_MICREL\_KSZ8081)}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00301}00301                 \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(sc, \mbox{\hyperlink{micphy_8c_a3ebecb08d99666bca9e01a4e4f074024}{MII\_KSZ8081\_PHYCTL2}}, \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}});}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00302}00302 \}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00303}00303 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00304}00304 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00305}\mbox{\hyperlink{micphy_8c_a7c224900524aefb7aa2f33c18da919be}{00305}} \mbox{\hyperlink{micphy_8c_a7c224900524aefb7aa2f33c18da919be}{micphy\_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{micphy_8c_source_l00306}00306 \{}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00307}00307 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00308}00308         \textcolor{keywordflow}{switch} (cmd) \{}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00309}00309         \textcolor{keywordflow}{case} \mbox{\hyperlink{miivar_8h_a5ee687df11441661206e4d2922ab5a52}{MII\_POLLSTAT}}:}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00310}00310                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00311}00311 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00312}00312         \textcolor{keywordflow}{case} \mbox{\hyperlink{miivar_8h_a6c5cb4a5233e6b1e8a8542636e8ba4c8}{MII\_MEDIACHG}}:}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00313}00313                 \mbox{\hyperlink{mii__physubr_8c_afac2ea5f0d036a16125e01fc48a41457}{mii\_phy\_setmedia}}(sc);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00314}00314                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00315}00315 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00316}00316         \textcolor{keywordflow}{case} \mbox{\hyperlink{miivar_8h_a7aba758235b2d688fc41842a167187e5}{MII\_TICK}}:}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00317}00317                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{mii__physubr_8c_aee0c2c158db70e66816d5c1269e83290}{mii\_phy\_tick}}(sc) == EJUSTRETURN)}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00318}00318                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00319}00319                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00320}00320         \}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00321}00321 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00322}00322         \textcolor{comment}{/* Update the media status. */}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00323}00323         \mbox{\hyperlink{miivar_8h_a1c1cdb714bf40ba701256727dd6a73c5}{PHY\_STATUS}}(sc);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00324}00324 }
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00325}00325         \textcolor{comment}{/* Callback if something changed. */}}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00326}00326         \mbox{\hyperlink{mii__physubr_8c_ac5a93e41e086c93143a04d9d4548b251}{mii\_phy\_update}}(sc, cmd);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00327}00327         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{micphy_8c_source_l00328}00328 \}}

\end{DoxyCode}
