\hypertarget{qsphy_8c_source}{}\doxysection{qsphy.\+c}
\label{qsphy_8c_source}\index{dev/mii/qsphy.c@{dev/mii/qsphy.c}}
\mbox{\hyperlink{qsphy_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00001}00001 \textcolor{comment}{/*      OpenBSD: qsphy.c,v 1.6 2000/08/26 20:04:18 nate Exp */}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00002}00002 \textcolor{comment}{/*      NetBSD: qsphy.c,v 1.19 2000/02/02 23:34:57 thorpej Exp  */}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00003}00003 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00004}00004 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00005}00005 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/NetBSD AND BSD-\/2-\/Clause}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00007}00007 \textcolor{comment}{ * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00008}00008 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00009}00009 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00010}00010 \textcolor{comment}{ * This code is derived from software contributed to The NetBSD Foundation}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00011}00011 \textcolor{comment}{ * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00012}00012 \textcolor{comment}{ * NASA Ames Research Center.}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00013}00013 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00014}00014 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00015}00015 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00016}00016 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00017}00017 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00018}00018 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00019}00019 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00020}00020 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00021}00021 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00022}00022 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00023}00023 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00024}00024 \textcolor{comment}{ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00025}00025 \textcolor{comment}{ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00026}00026 \textcolor{comment}{ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00027}00027 \textcolor{comment}{ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00028}00028 \textcolor{comment}{ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00029}00029 \textcolor{comment}{ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00030}00030 \textcolor{comment}{ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00031}00031 \textcolor{comment}{ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00032}00032 \textcolor{comment}{ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00033}00033 \textcolor{comment}{ * POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00034}00034 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00035}00035 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00036}00036 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00037}00037 \textcolor{comment}{ * Copyright (c) 1997 Manuel Bouyer.  All rights reserved.}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00038}00038 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00039}00039 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00040}00040 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00041}00041 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00042}00042 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00043}00043 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00044}00044 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00045}00045 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00046}00046 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00047}00047 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00048}00048 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00049}00049 \textcolor{comment}{ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00050}00050 \textcolor{comment}{ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00051}00051 \textcolor{comment}{ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00052}00052 \textcolor{comment}{ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00053}00053 \textcolor{comment}{ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00054}00054 \textcolor{comment}{ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00055}00055 \textcolor{comment}{ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00056}00056 \textcolor{comment}{ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00057}00057 \textcolor{comment}{ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00058}00058 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00059}00059 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00060}00060 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00061}\mbox{\hyperlink{qsphy_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00061}} \mbox{\hyperlink{qsphy_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00062}00062 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00063}00063 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00064}00064 \textcolor{comment}{ * driver for Quality Semiconductor's QS6612 ethernet 10/100 PHY}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00065}00065 \textcolor{comment}{ * datasheet from www.qualitysemi.com}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00066}00066 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00067}00067 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00068}00068 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00069}00069 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00070}00070 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00071}00071 \textcolor{preprocessor}{\#include <sys/socket.h>}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00072}00072 \textcolor{preprocessor}{\#include <sys/errno.h>}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00073}00073 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00074}00074 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00075}00075 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00076}00076 \textcolor{preprocessor}{\#include <net/if.h>}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00077}00077 \textcolor{preprocessor}{\#include <net/if\_media.h>}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00078}00078 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00079}00079 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{mii_8h}{dev/mii/mii.h}}>}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00080}00080 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{miivar_8h}{dev/mii/miivar.h}}>}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00081}00081 \textcolor{preprocessor}{\#include "{}miidevs.h"{}}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00082}00082 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00083}00083 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{qsphyreg_8h}{dev/mii/qsphyreg.h}}>}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00084}00084 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00085}00085 \textcolor{preprocessor}{\#include "{}miibus\_if.h"{}}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00086}00086 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00087}00087 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{qsphy_8c_a96287f58f3089a799e0e2304f3083da7}{qsphy\_probe}}(device\_t);}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00088}00088 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{qsphy_8c_adae357f81972efa5e6e59c22c7076af6}{qsphy\_attach}}(device\_t);}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00089}00089 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00090}\mbox{\hyperlink{qsphy_8c_a2341c24ac8185292567785b383f7151a}{00090}} \textcolor{keyword}{static} device\_method\_t \mbox{\hyperlink{qsphy_8c_a2341c24ac8185292567785b383f7151a}{qsphy\_methods}}[] = \{}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00091}00091         \textcolor{comment}{/* device interface */}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00092}00092         DEVMETHOD(device\_probe,         \mbox{\hyperlink{qsphy_8c_a96287f58f3089a799e0e2304f3083da7}{qsphy\_probe}}),}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00093}00093         DEVMETHOD(device\_attach,        \mbox{\hyperlink{qsphy_8c_adae357f81972efa5e6e59c22c7076af6}{qsphy\_attach}}),}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00094}00094         DEVMETHOD(device\_detach,        \mbox{\hyperlink{mii__physubr_8c_af08a34e3932c19824be61fc41ee1083f}{mii\_phy\_detach}}),}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00095}00095         DEVMETHOD(device\_shutdown,      bus\_generic\_shutdown),}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00096}00096         DEVMETHOD\_END}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00097}00097 \};}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00098}00098 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00099}\mbox{\hyperlink{qsphy_8c_abdf9ea86312389725e2abb34a689e2e9}{00099}} \textcolor{keyword}{static} devclass\_t \mbox{\hyperlink{qsphy_8c_abdf9ea86312389725e2abb34a689e2e9}{qsphy\_devclass}};}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00100}00100 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00101}\mbox{\hyperlink{qsphy_8c_abf3544d01e7e04c457fde6a46189b7f6}{00101}} \textcolor{keyword}{static} driver\_t \mbox{\hyperlink{qsphy_8c_abf3544d01e7e04c457fde6a46189b7f6}{qsphy\_driver}} = \{}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00102}00102         \textcolor{stringliteral}{"{}qsphy"{}},}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00103}00103         \mbox{\hyperlink{qsphy_8c_a2341c24ac8185292567785b383f7151a}{qsphy\_methods}},}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00104}00104         \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structmii__softc}{mii\_softc}})}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00105}00105 \};}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00106}00106 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00107}\mbox{\hyperlink{qsphy_8c_a676cd7921c372036f294428cc3127fc3}{00107}} \mbox{\hyperlink{qsphy_8c_a676cd7921c372036f294428cc3127fc3}{DRIVER\_MODULE}}(qsphy, \mbox{\hyperlink{miibus__if_8m_a4cbc1805319b363b9b338406a4b2a683}{miibus}}, \mbox{\hyperlink{qsphy_8c_abf3544d01e7e04c457fde6a46189b7f6}{qsphy\_driver}}, \mbox{\hyperlink{qsphy_8c_abdf9ea86312389725e2abb34a689e2e9}{qsphy\_devclass}}, 0, 0);}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00108}00108 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00109}00109 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      \mbox{\hyperlink{qsphy_8c_a266da1af2d057f8c53fa55df4903d804}{qsphy\_service}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structmii__data}{mii\_data}} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00110}00110 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{qsphy_8c_a0f8b4112a87b049c504b1e1bfce19f6b}{qsphy\_reset}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *);}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00111}00111 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{qsphy_8c_aec4d717147e8d0793a7f947e83e109d5}{qsphy\_status}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *);}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00112}00112 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00113}\mbox{\hyperlink{qsphy_8c_a07d68158a08a305c67479347fbd4834f}{00113}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structmii__phydesc}{mii\_phydesc}} \mbox{\hyperlink{qsphy_8c_a07d68158a08a305c67479347fbd4834f}{qsphys}}[] = \{}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00114}00114         \mbox{\hyperlink{miivar_8h_ae87ddbe9ffefd4caca54be68c7b281fc}{MII\_PHY\_DESC}}(xxQUALSEMI, QS6612),}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00115}00115         \mbox{\hyperlink{miivar_8h_a4cc657798701d214afbeff2b27c5083d}{MII\_PHY\_END}}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00116}00116 \};}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00117}00117 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00118}\mbox{\hyperlink{qsphy_8c_a433e96df27f78c7d0455b4291b99d050}{00118}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structmii__phy__funcs}{mii\_phy\_funcs}} \mbox{\hyperlink{qsphy_8c_a433e96df27f78c7d0455b4291b99d050}{qsphy\_funcs}} = \{}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00119}00119         \mbox{\hyperlink{qsphy_8c_a266da1af2d057f8c53fa55df4903d804}{qsphy\_service}},}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00120}00120         \mbox{\hyperlink{qsphy_8c_aec4d717147e8d0793a7f947e83e109d5}{qsphy\_status}},}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00121}00121         \mbox{\hyperlink{qsphy_8c_a0f8b4112a87b049c504b1e1bfce19f6b}{qsphy\_reset}}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00122}00122 \};}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00123}00123 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00124}00124 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00125}\mbox{\hyperlink{qsphy_8c_a96287f58f3089a799e0e2304f3083da7}{00125}} \mbox{\hyperlink{qsphy_8c_a96287f58f3089a799e0e2304f3083da7}{qsphy\_probe}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00126}00126 \{}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00127}00127 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00128}00128         \textcolor{keywordflow}{return} (\mbox{\hyperlink{mii__physubr_8c_a6eae4dd21de85ca536b06467bf0a5f88}{mii\_phy\_dev\_probe}}(dev, \mbox{\hyperlink{qsphy_8c_a07d68158a08a305c67479347fbd4834f}{qsphys}}, BUS\_PROBE\_DEFAULT));}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00129}00129 \}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00130}00130 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00131}00131 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00132}\mbox{\hyperlink{qsphy_8c_adae357f81972efa5e6e59c22c7076af6}{00132}} \mbox{\hyperlink{qsphy_8c_adae357f81972efa5e6e59c22c7076af6}{qsphy\_attach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00133}00133 \{}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00134}00134 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00135}00135         \mbox{\hyperlink{mii__physubr_8c_a50acf7ba3fab73b23c13fe7da8c93f1d}{mii\_phy\_dev\_attach}}(dev, \mbox{\hyperlink{miivar_8h_a8d2d38c2ee2b3eb2ccd1f0a3da5fed03}{MIIF\_NOMANPAUSE}}, \&\mbox{\hyperlink{qsphy_8c_a433e96df27f78c7d0455b4291b99d050}{qsphy\_funcs}}, 1);}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00136}00136         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00137}00137 \}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00138}00138 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00139}00139 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00140}\mbox{\hyperlink{qsphy_8c_a266da1af2d057f8c53fa55df4903d804}{00140}} \mbox{\hyperlink{qsphy_8c_a266da1af2d057f8c53fa55df4903d804}{qsphy\_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{qsphy_8c_source_l00141}00141 \{}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00142}00142 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00143}00143         \textcolor{keywordflow}{switch} (cmd) \{}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00144}00144         \textcolor{keywordflow}{case} \mbox{\hyperlink{miivar_8h_a5ee687df11441661206e4d2922ab5a52}{MII\_POLLSTAT}}:}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00145}00145                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00146}00146 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00147}00147         \textcolor{keywordflow}{case} \mbox{\hyperlink{miivar_8h_a6c5cb4a5233e6b1e8a8542636e8ba4c8}{MII\_MEDIACHG}}:}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00148}00148                 \mbox{\hyperlink{mii__physubr_8c_afac2ea5f0d036a16125e01fc48a41457}{mii\_phy\_setmedia}}(sc);}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00149}00149                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00150}00150 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00151}00151         \textcolor{keywordflow}{case} \mbox{\hyperlink{miivar_8h_a7aba758235b2d688fc41842a167187e5}{MII\_TICK}}:}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00152}00152                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00153}00153 \textcolor{comment}{                 * This PHY's autonegotiation doesn't need to be kicked.}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00154}00154 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00155}00155                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00156}00156         \}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00157}00157 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00158}00158         \textcolor{comment}{/* Update the media status. */}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00159}00159         \mbox{\hyperlink{miivar_8h_a1c1cdb714bf40ba701256727dd6a73c5}{PHY\_STATUS}}(sc);}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00160}00160 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00161}00161         \textcolor{comment}{/* Callback if something changed. */}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00162}00162         \mbox{\hyperlink{mii__physubr_8c_ac5a93e41e086c93143a04d9d4548b251}{mii\_phy\_update}}(sc, cmd);}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00163}00163         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00164}00164 \}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00165}00165 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00166}00166 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00167}\mbox{\hyperlink{qsphy_8c_aec4d717147e8d0793a7f947e83e109d5}{00167}} \mbox{\hyperlink{qsphy_8c_aec4d717147e8d0793a7f947e83e109d5}{qsphy\_status}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00168}00168 \{}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00169}00169         \textcolor{keyword}{struct }\mbox{\hyperlink{structmii__data}{mii\_data}} *mii = sc-\/>\mbox{\hyperlink{structmii__softc_a12011aec864a92fb63b711b43e6b4356}{mii\_pdata}};}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00170}00170         \textcolor{keywordtype}{int} bmsr, bmcr, pctl;}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00171}00171 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00172}00172         mii-\/>\mbox{\hyperlink{structmii__data_a15c66b8658a144ac3294603a8146ac09}{mii\_media\_status}} = IFM\_AVALID;}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00173}00173         mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}} = IFM\_ETHER;}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00174}00174 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00175}00175         bmsr = \mbox{\hyperlink{miivar_8h_a4f9acdc044cd8d94bd80432e4f01bcd2}{PHY\_READ}}(sc, \mbox{\hyperlink{mii_8h_aa2f632686d6298a7c898b1c805586aab}{MII\_BMSR}}) |}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00176}00176             \mbox{\hyperlink{miivar_8h_a4f9acdc044cd8d94bd80432e4f01bcd2}{PHY\_READ}}(sc, \mbox{\hyperlink{mii_8h_aa2f632686d6298a7c898b1c805586aab}{MII\_BMSR}});}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00177}00177         \textcolor{keywordflow}{if} (bmsr \& \mbox{\hyperlink{mii_8h_aca42eb005e0fdbae038bd7c9f12a1035}{BMSR\_LINK}})}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00178}00178                 mii-\/>\mbox{\hyperlink{structmii__data_a15c66b8658a144ac3294603a8146ac09}{mii\_media\_status}} |= IFM\_ACTIVE;}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00179}00179 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00180}00180         bmcr = \mbox{\hyperlink{miivar_8h_a4f9acdc044cd8d94bd80432e4f01bcd2}{PHY\_READ}}(sc, \mbox{\hyperlink{mii_8h_a9137acedc42ff140f244da7473cff29e}{MII\_BMCR}});}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00181}00181         \textcolor{keywordflow}{if} (bmcr \& \mbox{\hyperlink{mii_8h_a28b8dcb818bc18a079b39b5517c27e3a}{BMCR\_ISO}}) \{}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00182}00182                 mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}} |= IFM\_NONE;}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00183}00183                 mii-\/>\mbox{\hyperlink{structmii__data_a15c66b8658a144ac3294603a8146ac09}{mii\_media\_status}} = 0;}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00184}00184                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00185}00185         \}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00186}00186 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00187}00187         \textcolor{keywordflow}{if} (bmcr \& \mbox{\hyperlink{mii_8h_aafd596a9125ddece08d5a9798dce42d6}{BMCR\_LOOP}})}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00188}00188                 mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}} |= IFM\_LOOP;}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00189}00189 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00190}00190         pctl = \mbox{\hyperlink{miivar_8h_a4f9acdc044cd8d94bd80432e4f01bcd2}{PHY\_READ}}(sc, \mbox{\hyperlink{qsphyreg_8h_a989cc490b1dc67917f3145e33483000c}{MII\_QSPHY\_PCTL}});}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00191}00191         \textcolor{keywordflow}{switch} (pctl \& \mbox{\hyperlink{qsphyreg_8h_a516c7501c0467f9ecb87cc906261064d}{PCTL\_OPMASK}}) \{}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00192}00192         \textcolor{keywordflow}{case} \mbox{\hyperlink{qsphyreg_8h_ad63a8497245081436e7202017face0ae}{PCTL\_10\_T}}:}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00193}00193                 mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}} |= IFM\_10\_T|IFM\_HDX;}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00194}00194                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00195}00195         \textcolor{keywordflow}{case} \mbox{\hyperlink{qsphyreg_8h_afe9614ba38394c70b6fadeac3285678f}{PCTL\_10\_T\_FDX}}:}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00196}00196                 mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}} |= IFM\_10\_T|IFM\_FDX;}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00197}00197                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00198}00198         \textcolor{keywordflow}{case} \mbox{\hyperlink{qsphyreg_8h_a7d4090e219d71ab4c7fa113096e61ec3}{PCTL\_100\_TX}}:}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00199}00199                 mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}} |= IFM\_100\_TX|IFM\_HDX;}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00200}00200                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00201}00201         \textcolor{keywordflow}{case} \mbox{\hyperlink{qsphyreg_8h_ad8e8c99b0e718ca5869f78d343450248}{PCTL\_100\_TX\_FDX}}:}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00202}00202                 mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}} |= IFM\_100\_TX|IFM\_FDX;}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00203}00203                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00204}00204         \textcolor{keywordflow}{case} \mbox{\hyperlink{qsphyreg_8h_a472e47980c54ace6e4cb6b6cfd255336}{PCTL\_100\_T4}}:}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00205}00205                 mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}} |= IFM\_100\_T4|IFM\_HDX;}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00206}00206                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00207}00207         \textcolor{keywordflow}{case} \mbox{\hyperlink{qsphyreg_8h_a243511ce1e7ebbaa9c4c011f53692893}{PCTL\_AN}}:}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00208}00208                 mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}} |= IFM\_NONE;}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00209}00209                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00210}00210         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00211}00211                 \textcolor{comment}{/* Erg... this shouldn't happen. */}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00212}00212                 mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}} |= IFM\_NONE;}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00213}00213                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00214}00214         \}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00215}00215         \textcolor{keywordflow}{if} ((mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}} \& IFM\_FDX) != 0)}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00216}00216                 mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}} |= \mbox{\hyperlink{mii__physubr_8c_a02a13013ccece7f7569fce9ab65424d3}{mii\_phy\_flowstatus}}(sc);}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00217}00217 \}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00218}00218 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00219}00219 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00220}\mbox{\hyperlink{qsphy_8c_a0f8b4112a87b049c504b1e1bfce19f6b}{00220}} \mbox{\hyperlink{qsphy_8c_a0f8b4112a87b049c504b1e1bfce19f6b}{qsphy\_reset}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00221}00221 \{}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00222}00222 }
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00223}00223         \mbox{\hyperlink{mii__physubr_8c_ac21db38f2acb040663be6eac5468eaa2}{mii\_phy\_reset}}(sc);}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00224}00224         \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(sc, \mbox{\hyperlink{qsphyreg_8h_aefa97cdd00562008a756ea23b4a33e60}{MII\_QSPHY\_IMASK}}, 0);}
\DoxyCodeLine{\Hypertarget{qsphy_8c_source_l00225}00225 \}}

\end{DoxyCode}
