\hypertarget{mii__physubr_8c_source}{}\doxysection{mii\+\_\+physubr.\+c}
\label{mii__physubr_8c_source}\index{dev/mii/mii\_physubr.c@{dev/mii/mii\_physubr.c}}
\mbox{\hyperlink{mii__physubr_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00001}00001 \textcolor{comment}{/*      \$NetBSD: mii\_physubr.c,v 1.5 1999/08/03 19:41:49 drochner Exp \$ */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00002}00002 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00003}00003 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00004}00004 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/NetBSD}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00005}00005 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00006}00006 \textcolor{comment}{ * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00007}00007 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00008}00008 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00009}00009 \textcolor{comment}{ * This code is derived from software contributed to The NetBSD Foundation}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00010}00010 \textcolor{comment}{ * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00011}00011 \textcolor{comment}{ * NASA Ames Research Center.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00012}00012 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00013}00013 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00014}00014 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00015}00015 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00016}00016 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00017}00017 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00018}00018 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00019}00019 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00020}00020 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00021}00021 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00022}00022 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00023}00023 \textcolor{comment}{ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00024}00024 \textcolor{comment}{ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00025}00025 \textcolor{comment}{ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00026}00026 \textcolor{comment}{ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00027}00027 \textcolor{comment}{ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00028}00028 \textcolor{comment}{ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00029}00029 \textcolor{comment}{ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00030}00030 \textcolor{comment}{ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00031}00031 \textcolor{comment}{ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00032}00032 \textcolor{comment}{ * POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00033}00033 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00034}00034 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00036}\mbox{\hyperlink{mii__physubr_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00036}} \mbox{\hyperlink{mii__physubr_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00037}00037 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00038}00038 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00039}00039 \textcolor{comment}{ * Subroutines common to all PHYs.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00040}00040 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00041}00041 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <sys/socket.h>}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <sys/errno.h>}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00049}00049 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <net/if.h>}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <net/if\_media.h>}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00052}00052 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{mii_8h}{dev/mii/mii.h}}>}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00054}00054 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{miivar_8h}{dev/mii/miivar.h}}>}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00055}00055 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00056}00056 \textcolor{preprocessor}{\#include "{}miibus\_if.h"{}}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00057}00057 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00058}00058 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00059}00059 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00060}00060 \textcolor{comment}{ * An array of structures to map MII media types to BMCR/ANAR settings.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00061}00061 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00062}00062 \textcolor{keyword}{enum} \{ }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00063}\mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55ba0697efe20da8e5a24948a987b90d5095}{00063}}         \mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55ba0697efe20da8e5a24948a987b90d5095}{MII\_MEDIA\_NONE}} = 0,}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00064}\mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55ba40359c84b59deebfd209111be6bfabce}{00064}}         \mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55ba40359c84b59deebfd209111be6bfabce}{MII\_MEDIA\_10\_T}},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00065}\mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55badc23045c4c55747d22376086ad1b90b2}{00065}}         \mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55badc23045c4c55747d22376086ad1b90b2}{MII\_MEDIA\_10\_T\_FDX}},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00066}\mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55ba77be240b8c1b027f0d737f582bb30e6e}{00066}}         \mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55ba77be240b8c1b027f0d737f582bb30e6e}{MII\_MEDIA\_100\_T4}},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00067}\mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55bab7d908caba822657eac89e372659e2c6}{00067}}         \mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55bab7d908caba822657eac89e372659e2c6}{MII\_MEDIA\_100\_TX}},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00068}\mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55bab34d3d87ee9536d40be2943d69b903ac}{00068}}         \mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55bab34d3d87ee9536d40be2943d69b903ac}{MII\_MEDIA\_100\_TX\_FDX}},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00069}\mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55baf569d54afcb1cf42249a33a8e6461a59}{00069}}         \mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55baf569d54afcb1cf42249a33a8e6461a59}{MII\_MEDIA\_1000\_X}},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00070}\mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55bab5cec2e4fb82b7ecd28118a82edc143d}{00070}}         \mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55bab5cec2e4fb82b7ecd28118a82edc143d}{MII\_MEDIA\_1000\_X\_FDX}},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00071}\mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55ba646328ac62e75d4beaf3eb4ccd97da19}{00071}}         \mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55ba646328ac62e75d4beaf3eb4ccd97da19}{MII\_MEDIA\_1000\_T}},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00072}\mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55ba8e8463f3e00562988e170dc3d0dedbd8}{00072}}         \mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55ba8e8463f3e00562988e170dc3d0dedbd8}{MII\_MEDIA\_1000\_T\_FDX}},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00073}\mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55ba10d480966f72d084692f30b75954346c}{00073}}         \mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55ba10d480966f72d084692f30b75954346c}{MII\_NMEDIA}},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00074}00074 \};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00075}00075 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00076}\mbox{\hyperlink{structmii__media}{00076}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structmii__media}{mii\_media}} \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00077}\mbox{\hyperlink{structmii__media_a629838fd8c149b959d58f14249ac5ddc}{00077}}         u\_int   \mbox{\hyperlink{structmii__media_a629838fd8c149b959d58f14249ac5ddc}{mm\_bmcr}};         \textcolor{comment}{/* BMCR settings for this media */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00078}\mbox{\hyperlink{structmii__media_acf2ce86c0a14b592a02479e0d6cf9b13}{00078}}         u\_int   \mbox{\hyperlink{structmii__media_acf2ce86c0a14b592a02479e0d6cf9b13}{mm\_anar}};         \textcolor{comment}{/* ANAR settings for this media */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00079}\mbox{\hyperlink{structmii__media_ac5dae221ecf037bb4f1b9d1ba3b3b38e}{00079}}         u\_int   \mbox{\hyperlink{structmii__media_ac5dae221ecf037bb4f1b9d1ba3b3b38e}{mm\_gtcr}};         \textcolor{comment}{/* 100base-\/T2 or 1000base-\/T CR */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00080}00080 \} \mbox{\hyperlink{mii__physubr_8c_a9274c3754ab1d6daa71377cb09d1aa01}{mii\_media\_table}}[\mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55ba10d480966f72d084692f30b75954346c}{MII\_NMEDIA}}] = \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00081}00081         \textcolor{comment}{/* None */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00082}00082         \{ \mbox{\hyperlink{mii_8h_a28b8dcb818bc18a079b39b5517c27e3a}{BMCR\_ISO}},             \mbox{\hyperlink{mii_8h_a890fc8f217d4396d1b0c65f1cefe9a2e}{ANAR\_CSMA}},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00083}00083           0, \},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00084}00084 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00085}00085         \textcolor{comment}{/* 10baseT */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00086}00086         \{ \mbox{\hyperlink{mii_8h_abe0c6341e185b080760358e5759ae46f}{BMCR\_S10}},             \mbox{\hyperlink{mii_8h_a890fc8f217d4396d1b0c65f1cefe9a2e}{ANAR\_CSMA}}|\mbox{\hyperlink{mii_8h_afffabbb091cbb816be17b68290d91a46}{ANAR\_10}},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00087}00087           0, \},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00088}00088 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00089}00089         \textcolor{comment}{/* 10baseT-\/FDX */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00090}00090         \{ \mbox{\hyperlink{mii_8h_abe0c6341e185b080760358e5759ae46f}{BMCR\_S10}}|\mbox{\hyperlink{mii_8h_a2a3179867c3b6168c8b8647cc768b44d}{BMCR\_FDX}},    \mbox{\hyperlink{mii_8h_a890fc8f217d4396d1b0c65f1cefe9a2e}{ANAR\_CSMA}}|\mbox{\hyperlink{mii_8h_ac4e51c5edcd6ddc1ec760bfe89ac3be4}{ANAR\_10\_FD}},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00091}00091           0, \},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00092}00092 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00093}00093         \textcolor{comment}{/* 100baseT4 */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00094}00094         \{ \mbox{\hyperlink{mii_8h_ac9cb41a58f5b6fc5e74b7b1699ed0891}{BMCR\_S100}},           \mbox{\hyperlink{mii_8h_a890fc8f217d4396d1b0c65f1cefe9a2e}{ANAR\_CSMA}}|\mbox{\hyperlink{mii_8h_a4c462e59abe881693adc937323429f91}{ANAR\_T4}},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00095}00095           0, \},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00096}00096 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00097}00097         \textcolor{comment}{/* 100baseTX */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00098}00098         \{ \mbox{\hyperlink{mii_8h_ac9cb41a58f5b6fc5e74b7b1699ed0891}{BMCR\_S100}},           \mbox{\hyperlink{mii_8h_a890fc8f217d4396d1b0c65f1cefe9a2e}{ANAR\_CSMA}}|\mbox{\hyperlink{mii_8h_ad283e403f5a3845ec5eb8fb71e5add8f}{ANAR\_TX}},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00099}00099           0, \},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00100}00100 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00101}00101         \textcolor{comment}{/* 100baseTX-\/FDX */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00102}00102         \{ \mbox{\hyperlink{mii_8h_ac9cb41a58f5b6fc5e74b7b1699ed0891}{BMCR\_S100}}|\mbox{\hyperlink{mii_8h_a2a3179867c3b6168c8b8647cc768b44d}{BMCR\_FDX}},  \mbox{\hyperlink{mii_8h_a890fc8f217d4396d1b0c65f1cefe9a2e}{ANAR\_CSMA}}|\mbox{\hyperlink{mii_8h_acc5b03ac472df013d7fe11cd83d8e1cd}{ANAR\_TX\_FD}},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00103}00103           0, \},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00104}00104 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00105}00105         \textcolor{comment}{/* 1000baseX */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00106}00106         \{ \mbox{\hyperlink{mii_8h_ab1181844d269db0df0962f4a7be0ceee}{BMCR\_S1000}},         \mbox{\hyperlink{mii_8h_a890fc8f217d4396d1b0c65f1cefe9a2e}{ANAR\_CSMA}},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00107}00107           0, \},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00108}00108 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00109}00109         \textcolor{comment}{/* 1000baseX-\/FDX */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00110}00110         \{ \mbox{\hyperlink{mii_8h_ab1181844d269db0df0962f4a7be0ceee}{BMCR\_S1000}}|\mbox{\hyperlink{mii_8h_a2a3179867c3b6168c8b8647cc768b44d}{BMCR\_FDX}},        \mbox{\hyperlink{mii_8h_a890fc8f217d4396d1b0c65f1cefe9a2e}{ANAR\_CSMA}},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00111}00111           0, \},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00112}00112 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00113}00113         \textcolor{comment}{/* 1000baseT */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00114}00114         \{ \mbox{\hyperlink{mii_8h_ab1181844d269db0df0962f4a7be0ceee}{BMCR\_S1000}},         \mbox{\hyperlink{mii_8h_a890fc8f217d4396d1b0c65f1cefe9a2e}{ANAR\_CSMA}},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00115}00115           \mbox{\hyperlink{mii_8h_a4a266f25c59599c5d226af57878fc1e8}{GTCR\_ADV\_1000THDX}} \},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00116}00116 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00117}00117         \textcolor{comment}{/* 1000baseT-\/FDX */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00118}00118         \{ \mbox{\hyperlink{mii_8h_ab1181844d269db0df0962f4a7be0ceee}{BMCR\_S1000}},         \mbox{\hyperlink{mii_8h_a890fc8f217d4396d1b0c65f1cefe9a2e}{ANAR\_CSMA}},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00119}00119           \mbox{\hyperlink{mii_8h_ac0c6d14e65e3e49b1cfcb95f0d914ef1}{GTCR\_ADV\_1000TFDX}} \},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00120}\mbox{\hyperlink{mii__physubr_8c_a9274c3754ab1d6daa71377cb09d1aa01}{00120}} \};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00121}00121 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00122}00122 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00123}\mbox{\hyperlink{mii__physubr_8c_afac2ea5f0d036a16125e01fc48a41457}{00123}} \mbox{\hyperlink{mii__physubr_8c_afac2ea5f0d036a16125e01fc48a41457}{mii\_phy\_setmedia}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00124}00124 \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00125}00125         \textcolor{keyword}{struct }\mbox{\hyperlink{structmii__data}{mii\_data}} *mii = sc-\/>\mbox{\hyperlink{structmii__softc_a12011aec864a92fb63b711b43e6b4356}{mii\_pdata}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00126}00126         \textcolor{keyword}{struct }ifmedia\_entry *ife = mii-\/>\mbox{\hyperlink{structmii__data_ac0e7ceb0ad8cc3eb2e55a6947d4c6fd0}{mii\_media}}.ifm\_cur;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00127}00127         \textcolor{keywordtype}{int} bmcr, anar, gtcr;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00128}00128         \textcolor{keywordtype}{int} index = -\/1;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00129}00129 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00130}00130         \textcolor{keywordflow}{switch} (IFM\_SUBTYPE(ife-\/>ifm\_media)) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00131}00131         \textcolor{keywordflow}{case} IFM\_AUTO:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00132}00132                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00133}00133 \textcolor{comment}{                 * Force renegotiation if MIIF\_DOPAUSE or MIIF\_FORCEANEG.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00134}00134 \textcolor{comment}{                 * The former is necessary as we might switch from flow-\/}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00135}00135 \textcolor{comment}{                 * control advertisement being off to on or vice versa.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00136}00136 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00137}00137                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{miivar_8h_a4f9acdc044cd8d94bd80432e4f01bcd2}{PHY\_READ}}(sc, \mbox{\hyperlink{mii_8h_a9137acedc42ff140f244da7473cff29e}{MII\_BMCR}}) \& \mbox{\hyperlink{mii_8h_a8d92e7dc8997005e43add732fba16a0d}{BMCR\_AUTOEN}}) == 0 ||}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00138}00138                     (sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& (\mbox{\hyperlink{miivar_8h_a14bf33c6e55e70acdbf98ebecde8997f}{MIIF\_DOPAUSE}} | \mbox{\hyperlink{miivar_8h_a474c09fc3e5b6259afdafd938e73b987}{MIIF\_FORCEANEG}})) != 0)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00139}00139                         (void)\mbox{\hyperlink{mii__physubr_8c_a6e952280acf91ba444f792089ea268e4}{mii\_phy\_auto}}(sc);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00140}00140                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00141}00141 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00142}00142         \textcolor{keywordflow}{case} IFM\_NONE:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00143}00143                 index = \mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55ba0697efe20da8e5a24948a987b90d5095}{MII\_MEDIA\_NONE}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00144}00144                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00145}00145 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00146}00146         \textcolor{keywordflow}{case} IFM\_HPNA\_1:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00147}00147                 index = \mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55ba40359c84b59deebfd209111be6bfabce}{MII\_MEDIA\_10\_T}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00148}00148                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00149}00149 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00150}00150         \textcolor{keywordflow}{case} IFM\_10\_T:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00151}00151                 \textcolor{keywordflow}{switch} (IFM\_OPTIONS(ife-\/>ifm\_media)) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00152}00152                 \textcolor{keywordflow}{case} 0:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00153}00153                         index = \mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55ba40359c84b59deebfd209111be6bfabce}{MII\_MEDIA\_10\_T}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00154}00154                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00155}00155                 \textcolor{keywordflow}{case} IFM\_FDX:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00156}00156                 \textcolor{keywordflow}{case} (IFM\_FDX | IFM\_FLOW):}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00157}00157                         index = \mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55badc23045c4c55747d22376086ad1b90b2}{MII\_MEDIA\_10\_T\_FDX}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00158}00158                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00159}00159                 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00160}00160                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00161}00161 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00162}00162         \textcolor{keywordflow}{case} IFM\_100\_TX:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00163}00163         \textcolor{keywordflow}{case} IFM\_100\_FX:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00164}00164                 \textcolor{keywordflow}{switch} (IFM\_OPTIONS(ife-\/>ifm\_media)) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00165}00165                 \textcolor{keywordflow}{case} 0:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00166}00166                         index = \mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55bab7d908caba822657eac89e372659e2c6}{MII\_MEDIA\_100\_TX}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00167}00167                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00168}00168                 \textcolor{keywordflow}{case} IFM\_FDX:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00169}00169                 \textcolor{keywordflow}{case} (IFM\_FDX | IFM\_FLOW):}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00170}00170                         index = \mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55bab34d3d87ee9536d40be2943d69b903ac}{MII\_MEDIA\_100\_TX\_FDX}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00171}00171                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00172}00172                 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00173}00173                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00174}00174 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00175}00175         \textcolor{keywordflow}{case} IFM\_100\_T4:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00176}00176                 index = \mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55ba77be240b8c1b027f0d737f582bb30e6e}{MII\_MEDIA\_100\_T4}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00177}00177                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00178}00178 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00179}00179         \textcolor{keywordflow}{case} IFM\_1000\_SX:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00180}00180                 \textcolor{keywordflow}{switch} (IFM\_OPTIONS(ife-\/>ifm\_media)) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00181}00181                 \textcolor{keywordflow}{case} 0:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00182}00182                         index = \mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55baf569d54afcb1cf42249a33a8e6461a59}{MII\_MEDIA\_1000\_X}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00183}00183                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00184}00184                 \textcolor{keywordflow}{case} IFM\_FDX:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00185}00185                 \textcolor{keywordflow}{case} (IFM\_FDX | IFM\_FLOW):}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00186}00186                         index = \mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55bab5cec2e4fb82b7ecd28118a82edc143d}{MII\_MEDIA\_1000\_X\_FDX}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00187}00187                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00188}00188                 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00189}00189                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00190}00190 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00191}00191         \textcolor{keywordflow}{case} IFM\_1000\_T:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00192}00192                 \textcolor{keywordflow}{switch} (IFM\_OPTIONS(ife-\/>ifm\_media)) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00193}00193                 \textcolor{keywordflow}{case} 0:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00194}00194                 \textcolor{keywordflow}{case} IFM\_ETH\_MASTER:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00195}00195                         index = \mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55ba646328ac62e75d4beaf3eb4ccd97da19}{MII\_MEDIA\_1000\_T}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00196}00196                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00197}00197                 \textcolor{keywordflow}{case} IFM\_FDX:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00198}00198                 \textcolor{keywordflow}{case} (IFM\_FDX | IFM\_ETH\_MASTER):}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00199}00199                 \textcolor{keywordflow}{case} (IFM\_FDX | IFM\_FLOW):}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00200}00200                 \textcolor{keywordflow}{case} (IFM\_FDX | IFM\_FLOW | IFM\_ETH\_MASTER):}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00201}00201                         index = \mbox{\hyperlink{mii__physubr_8c_a06fc87d81c62e9abb8790b6e5713c55ba8e8463f3e00562988e170dc3d0dedbd8}{MII\_MEDIA\_1000\_T\_FDX}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00202}00202                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00203}00203                 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00204}00204                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00205}00205         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00206}00206 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00207}00207         KASSERT(index != -\/1, (\textcolor{stringliteral}{"{}\%s: failed to map media word \%d"{}},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00208}00208             \_\_func\_\_, ife-\/>ifm\_media));}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00209}00209 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00210}00210         anar = \mbox{\hyperlink{mii__physubr_8c_a9274c3754ab1d6daa71377cb09d1aa01}{mii\_media\_table}}[index].\mbox{\hyperlink{structmii__media_acf2ce86c0a14b592a02479e0d6cf9b13}{mm\_anar}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00211}00211         bmcr = \mbox{\hyperlink{mii__physubr_8c_a9274c3754ab1d6daa71377cb09d1aa01}{mii\_media\_table}}[index].\mbox{\hyperlink{structmii__media_a629838fd8c149b959d58f14249ac5ddc}{mm\_bmcr}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00212}00212         gtcr = \mbox{\hyperlink{mii__physubr_8c_a9274c3754ab1d6daa71377cb09d1aa01}{mii\_media\_table}}[index].\mbox{\hyperlink{structmii__media_ac5dae221ecf037bb4f1b9d1ba3b3b38e}{mm\_gtcr}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00213}00213 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00214}00214         \textcolor{keywordflow}{if} (IFM\_SUBTYPE(ife-\/>ifm\_media) == IFM\_1000\_T) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00215}00215                 gtcr |= \mbox{\hyperlink{mii_8h_adb9180da2be476b08b85f9f4f331b18d}{GTCR\_MAN\_MS}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00216}00216                 \textcolor{keywordflow}{if} ((ife-\/>ifm\_media \& IFM\_ETH\_MASTER) != 0)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00217}00217                         gtcr |= \mbox{\hyperlink{mii_8h_a3d7cdf3121ba79b18a1dde71110acbb9}{GTCR\_ADV\_MS}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00218}00218         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00219}00219 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00220}00220         \textcolor{keywordflow}{if} ((ife-\/>ifm\_media \& IFM\_FDX) != 0 \&\&}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00221}00221             ((ife-\/>ifm\_media \& IFM\_FLOW) != 0 ||}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00222}00222             (sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_a16048a4e2a1da2f657f54b516df4b1fe}{MIIF\_FORCEPAUSE}}) != 0)) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00223}00223                 \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_a6a002884e9ef8960e630d1a16cd2c067}{MIIF\_IS\_1000X}}) != 0)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00224}00224                         anar |= \mbox{\hyperlink{mii_8h_a20371fc44ccb33030c7c541ce7a2c884}{ANAR\_X\_PAUSE\_TOWARDS}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00225}00225                 \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00226}00226                         anar |= \mbox{\hyperlink{mii_8h_a238749af941282e3a074598b16e5442a}{ANAR\_FC}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00227}00227                         \textcolor{comment}{/* XXX Only 1000BASE-\/T has PAUSE\_ASYM? */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00228}00228                         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_a376a284eabf873a1d35c3d52c93e8502}{MIIF\_HAVE\_GTCR}}) != 0 \&\&}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00229}00229                             (sc-\/>\mbox{\hyperlink{structmii__softc_a9e880a089e764bf319ae80abfa6e2daa}{mii\_extcapabilities}} \&}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00230}00230                             (\mbox{\hyperlink{mii_8h_a3f49dbf3b3c4a72194b60c3900285628}{EXTSR\_1000THDX}} | \mbox{\hyperlink{mii_8h_afa6ac41f1e175515207895edd1ca3839}{EXTSR\_1000TFDX}})) != 0)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00231}00231                                 anar |= \mbox{\hyperlink{mii_8h_a1e82606d0e1e2c1e27189dd9c71d50f2}{ANAR\_X\_PAUSE\_ASYM}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00232}00232                 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00233}00233         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00234}00234 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00235}00235         \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(sc, \mbox{\hyperlink{mii_8h_aacb2ab0ea5579b5d9e30b075991add1d}{MII\_ANAR}}, anar);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00236}00236         \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(sc, \mbox{\hyperlink{mii_8h_a9137acedc42ff140f244da7473cff29e}{MII\_BMCR}}, bmcr);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00237}00237         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_a376a284eabf873a1d35c3d52c93e8502}{MIIF\_HAVE\_GTCR}}) != 0)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00238}00238                 \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(sc, \mbox{\hyperlink{mii_8h_a17295b0b6d416c072e4fe4d593f42882}{MII\_100T2CR}}, gtcr);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00239}00239 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00240}00240 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00241}00241 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00242}\mbox{\hyperlink{mii__physubr_8c_a6e952280acf91ba444f792089ea268e4}{00242}} \mbox{\hyperlink{mii__physubr_8c_a6e952280acf91ba444f792089ea268e4}{mii\_phy\_auto}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00243}00243 \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00244}00244         \textcolor{keyword}{struct }ifmedia\_entry *ife = sc-\/>\mbox{\hyperlink{structmii__softc_a12011aec864a92fb63b711b43e6b4356}{mii\_pdata}}-\/>\mbox{\hyperlink{structmii__data_ac0e7ceb0ad8cc3eb2e55a6947d4c6fd0}{mii\_media}}.ifm\_cur;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00245}00245         \textcolor{keywordtype}{int} anar, gtcr;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00246}00246 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00247}00247         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00248}00248 \textcolor{comment}{         * Check for 1000BASE-\/X.  Autonegotiation is a bit}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00249}00249 \textcolor{comment}{         * different on such devices.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00250}00250 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00251}00251         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_a6a002884e9ef8960e630d1a16cd2c067}{MIIF\_IS\_1000X}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00252}00252                 anar = 0;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00253}00253                 \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a9e880a089e764bf319ae80abfa6e2daa}{mii\_extcapabilities}} \& \mbox{\hyperlink{mii_8h_a769f4bfc7fda27a5f3ef53e0ba26a0b5}{EXTSR\_1000XFDX}}) != 0)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00254}00254                         anar |= \mbox{\hyperlink{mii_8h_a6cee54eddda3532ee3eda69afc51101a}{ANAR\_X\_FD}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00255}00255                 \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a9e880a089e764bf319ae80abfa6e2daa}{mii\_extcapabilities}} \& \mbox{\hyperlink{mii_8h_a7e0fc4dd2c69abeaaf69ab8043643052}{EXTSR\_1000XHDX}}) != 0)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00256}00256                         anar |= \mbox{\hyperlink{mii_8h_a651c0e997cbc1a97073ae73b3e1fcd55}{ANAR\_X\_HD}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00257}00257 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00258}00258                 \textcolor{keywordflow}{if} ((ife-\/>ifm\_media \& IFM\_FLOW) != 0 ||}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00259}00259                     (sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_a16048a4e2a1da2f657f54b516df4b1fe}{MIIF\_FORCEPAUSE}}) != 0)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00260}00260                         anar |= \mbox{\hyperlink{mii_8h_a20371fc44ccb33030c7c541ce7a2c884}{ANAR\_X\_PAUSE\_TOWARDS}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00261}00261                 \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(sc, \mbox{\hyperlink{mii_8h_aacb2ab0ea5579b5d9e30b075991add1d}{MII\_ANAR}}, anar);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00262}00262         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00263}00263                 anar = \mbox{\hyperlink{mii_8h_a3406eac06aaf4c12c4b46c8296400a94}{BMSR\_MEDIA\_TO\_ANAR}}(sc-\/>\mbox{\hyperlink{structmii__softc_ac3b545baf912e9bd14af8df8bb388050}{mii\_capabilities}}) |}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00264}00264                     \mbox{\hyperlink{mii_8h_a890fc8f217d4396d1b0c65f1cefe9a2e}{ANAR\_CSMA}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00265}00265                 \textcolor{keywordflow}{if} ((ife-\/>ifm\_media \& IFM\_FLOW) != 0 ||}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00266}00266                     (sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_a16048a4e2a1da2f657f54b516df4b1fe}{MIIF\_FORCEPAUSE}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00267}00267                         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_ac3b545baf912e9bd14af8df8bb388050}{mii\_capabilities}} \&}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00268}00268                             (\mbox{\hyperlink{mii_8h_a2107023850de2125d9f4e2a80d2ea0ea}{BMSR\_10TFDX}} | \mbox{\hyperlink{mii_8h_a2953d54a8cde8b60b5daf6096478d3c6}{BMSR\_100TXFDX}})) != 0)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00269}00269                                 anar |= \mbox{\hyperlink{mii_8h_a238749af941282e3a074598b16e5442a}{ANAR\_FC}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00270}00270                         \textcolor{comment}{/* XXX Only 1000BASE-\/T has PAUSE\_ASYM? */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00271}00271                         \textcolor{keywordflow}{if} (((sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_a376a284eabf873a1d35c3d52c93e8502}{MIIF\_HAVE\_GTCR}}) != 0) \&\&}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00272}00272                             (sc-\/>\mbox{\hyperlink{structmii__softc_a9e880a089e764bf319ae80abfa6e2daa}{mii\_extcapabilities}} \&}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00273}00273                             (\mbox{\hyperlink{mii_8h_a3f49dbf3b3c4a72194b60c3900285628}{EXTSR\_1000THDX}} | \mbox{\hyperlink{mii_8h_afa6ac41f1e175515207895edd1ca3839}{EXTSR\_1000TFDX}})) != 0)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00274}00274                                 anar |= \mbox{\hyperlink{mii_8h_a1e82606d0e1e2c1e27189dd9c71d50f2}{ANAR\_X\_PAUSE\_ASYM}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00275}00275                 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00276}00276                 \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(sc, \mbox{\hyperlink{mii_8h_aacb2ab0ea5579b5d9e30b075991add1d}{MII\_ANAR}}, anar);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00277}00277                 \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_a376a284eabf873a1d35c3d52c93e8502}{MIIF\_HAVE\_GTCR}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00278}00278                         gtcr = 0;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00279}00279                         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a9e880a089e764bf319ae80abfa6e2daa}{mii\_extcapabilities}} \& \mbox{\hyperlink{mii_8h_afa6ac41f1e175515207895edd1ca3839}{EXTSR\_1000TFDX}}) != 0)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00280}00280                                 gtcr |= \mbox{\hyperlink{mii_8h_ac0c6d14e65e3e49b1cfcb95f0d914ef1}{GTCR\_ADV\_1000TFDX}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00281}00281                         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a9e880a089e764bf319ae80abfa6e2daa}{mii\_extcapabilities}} \& \mbox{\hyperlink{mii_8h_a3f49dbf3b3c4a72194b60c3900285628}{EXTSR\_1000THDX}}) != 0)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00282}00282                                 gtcr |= \mbox{\hyperlink{mii_8h_a4a266f25c59599c5d226af57878fc1e8}{GTCR\_ADV\_1000THDX}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00283}00283                         \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(sc, \mbox{\hyperlink{mii_8h_a17295b0b6d416c072e4fe4d593f42882}{MII\_100T2CR}}, gtcr);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00284}00284                 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00285}00285         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00286}00286         \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(sc, \mbox{\hyperlink{mii_8h_a9137acedc42ff140f244da7473cff29e}{MII\_BMCR}}, \mbox{\hyperlink{mii_8h_a8d92e7dc8997005e43add732fba16a0d}{BMCR\_AUTOEN}} | \mbox{\hyperlink{mii_8h_a2ed0562d5bde5bf56ec01a2e0b9a12a7}{BMCR\_STARTNEG}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00287}00287         \textcolor{keywordflow}{return} (EJUSTRETURN);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00288}00288 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00289}00289 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00290}00290 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00291}\mbox{\hyperlink{mii__physubr_8c_aee0c2c158db70e66816d5c1269e83290}{00291}} \mbox{\hyperlink{mii__physubr_8c_aee0c2c158db70e66816d5c1269e83290}{mii\_phy\_tick}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00292}00292 \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00293}00293         \textcolor{keyword}{struct }ifmedia\_entry *ife = sc-\/>\mbox{\hyperlink{structmii__softc_a12011aec864a92fb63b711b43e6b4356}{mii\_pdata}}-\/>\mbox{\hyperlink{structmii__data_ac0e7ceb0ad8cc3eb2e55a6947d4c6fd0}{mii\_media}}.ifm\_cur;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00294}00294         \textcolor{keywordtype}{int} \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00295}00295 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00296}00296         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00297}00297 \textcolor{comment}{         * If we're not doing autonegotiation, we don't need to do}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00298}00298 \textcolor{comment}{         * any extra work here.  However, we need to check the link}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00299}00299 \textcolor{comment}{         * status so we can generate an announcement if the status}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00300}00300 \textcolor{comment}{         * changes.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00301}00301 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00302}00302         \textcolor{keywordflow}{if} (IFM\_SUBTYPE(ife-\/>ifm\_media) != IFM\_AUTO) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00303}00303                 sc-\/>\mbox{\hyperlink{structmii__softc_a4be7f594fccaa2de7950161135edb3eb}{mii\_ticks}} = 0;     \textcolor{comment}{/* reset autonegotiation timer. */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00304}00304                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00305}00305         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00306}00306 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00307}00307         \textcolor{comment}{/* Read the status register twice; BMSR\_LINK is latch-\/low. */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00308}00308         \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}} = \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{mii__physubr_8c_source_l00309}00309         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}} \& \mbox{\hyperlink{mii_8h_aca42eb005e0fdbae038bd7c9f12a1035}{BMSR\_LINK}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00310}00310                 sc-\/>\mbox{\hyperlink{structmii__softc_a4be7f594fccaa2de7950161135edb3eb}{mii\_ticks}} = 0;     \textcolor{comment}{/* reset autonegotiation timer. */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00311}00311                 \textcolor{comment}{/* See above. */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00312}00312                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00313}00313         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00314}00314 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00315}00315         \textcolor{comment}{/* Announce link loss right after it happens */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00316}00316         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structmii__softc_a4be7f594fccaa2de7950161135edb3eb}{mii\_ticks}}++ == 0)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00317}00317                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00318}00318 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00319}00319         \textcolor{comment}{/* XXX: use default value if phy driver did not set mii\_anegticks */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00320}00320         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structmii__softc_a360601e70b34832b08ce0b1db3b39113}{mii\_anegticks}} == 0)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00321}00321                 sc-\/>\mbox{\hyperlink{structmii__softc_a360601e70b34832b08ce0b1db3b39113}{mii\_anegticks}} = \mbox{\hyperlink{miivar_8h_a6bd00bb7fe1f163e00cc324b104a6bb6}{MII\_ANEGTICKS\_GIGE}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00322}00322 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00323}00323         \textcolor{comment}{/* Only retry autonegotiation every mii\_anegticks ticks. */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00324}00324         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structmii__softc_a4be7f594fccaa2de7950161135edb3eb}{mii\_ticks}} <= sc-\/>\mbox{\hyperlink{structmii__softc_a360601e70b34832b08ce0b1db3b39113}{mii\_anegticks}})}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00325}00325                 \textcolor{keywordflow}{return} (EJUSTRETURN);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00326}00326 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00327}00327         sc-\/>\mbox{\hyperlink{structmii__softc_a4be7f594fccaa2de7950161135edb3eb}{mii\_ticks}} = 0;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00328}00328         \mbox{\hyperlink{miivar_8h_aa355e0359542ffc84e9060ab4556f4d8}{PHY\_RESET}}(sc);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00329}00329         \mbox{\hyperlink{mii__physubr_8c_a6e952280acf91ba444f792089ea268e4}{mii\_phy\_auto}}(sc);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00330}00330         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00331}00331 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00332}00332 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00333}00333 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00334}\mbox{\hyperlink{mii__physubr_8c_ac21db38f2acb040663be6eac5468eaa2}{00334}} \mbox{\hyperlink{mii__physubr_8c_ac21db38f2acb040663be6eac5468eaa2}{mii\_phy\_reset}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00335}00335 \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00336}00336         \textcolor{keyword}{struct }ifmedia\_entry *ife = sc-\/>\mbox{\hyperlink{structmii__softc_a12011aec864a92fb63b711b43e6b4356}{mii\_pdata}}-\/>\mbox{\hyperlink{structmii__data_ac0e7ceb0ad8cc3eb2e55a6947d4c6fd0}{mii\_media}}.ifm\_cur;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00337}00337         \textcolor{keywordtype}{int} i, \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00338}00338 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00339}00339         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_ab5201dd2953a06a0ea2cd36a4332d82a}{MIIF\_NOISOLATE}}) != 0)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00340}00340                 \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}} = \mbox{\hyperlink{mii_8h_a602d307dfe6dbbf35e6b62f0914f5594}{BMCR\_RESET}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00341}00341         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00342}00342                 \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}} = \mbox{\hyperlink{mii_8h_a602d307dfe6dbbf35e6b62f0914f5594}{BMCR\_RESET}} | \mbox{\hyperlink{mii_8h_a28b8dcb818bc18a079b39b5517c27e3a}{BMCR\_ISO}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00343}00343         \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(sc, \mbox{\hyperlink{mii_8h_a9137acedc42ff140f244da7473cff29e}{MII\_BMCR}}, \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00344}00344 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00345}00345         \textcolor{comment}{/* Wait 100ms for it to complete. */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00346}00346         \textcolor{keywordflow}{for} (i = 0; i < 100; i++) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00347}00347                 \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}} = \mbox{\hyperlink{miivar_8h_a4f9acdc044cd8d94bd80432e4f01bcd2}{PHY\_READ}}(sc, \mbox{\hyperlink{mii_8h_a9137acedc42ff140f244da7473cff29e}{MII\_BMCR}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00348}00348                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}} \& \mbox{\hyperlink{mii_8h_a602d307dfe6dbbf35e6b62f0914f5594}{BMCR\_RESET}}) == 0)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00349}00349                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00350}00350                 DELAY(1000);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00351}00351         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00352}00352 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00353}00353         \textcolor{comment}{/* NB: a PHY may default to being powered down and/or isolated. */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00354}00354         \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}} \&= \string~(\mbox{\hyperlink{mii_8h_a268f2a026617b4490ae48826b4af8a7b}{BMCR\_PDOWN}} | \mbox{\hyperlink{mii_8h_a28b8dcb818bc18a079b39b5517c27e3a}{BMCR\_ISO}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00355}00355         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_ab5201dd2953a06a0ea2cd36a4332d82a}{MIIF\_NOISOLATE}}) == 0 \&\&}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00356}00356             ((ife == NULL \&\& sc-\/>\mbox{\hyperlink{structmii__softc_a18ed2a5251a1dd8abf3c2d02f7b13a22}{mii\_inst}} != 0) ||}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00357}00357             (ife != NULL \&\& IFM\_INST(ife-\/>ifm\_media) != sc-\/>\mbox{\hyperlink{structmii__softc_a18ed2a5251a1dd8abf3c2d02f7b13a22}{mii\_inst}})))}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00358}00358                 \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}} |= \mbox{\hyperlink{mii_8h_a28b8dcb818bc18a079b39b5517c27e3a}{BMCR\_ISO}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00359}00359         \textcolor{keywordflow}{if} (\mbox{\hyperlink{miivar_8h_a4f9acdc044cd8d94bd80432e4f01bcd2}{PHY\_READ}}(sc, \mbox{\hyperlink{mii_8h_a9137acedc42ff140f244da7473cff29e}{MII\_BMCR}}) != \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}})}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00360}00360                 \mbox{\hyperlink{miivar_8h_af302bd91f8177e3ca317b822f00680b5}{PHY\_WRITE}}(sc, \mbox{\hyperlink{mii_8h_a9137acedc42ff140f244da7473cff29e}{MII\_BMCR}}, \mbox{\hyperlink{miibus__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00361}00361 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00362}00362 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00363}00363 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00364}\mbox{\hyperlink{mii__physubr_8c_ac5a93e41e086c93143a04d9d4548b251}{00364}} \mbox{\hyperlink{mii__physubr_8c_ac5a93e41e086c93143a04d9d4548b251}{mii\_phy\_update}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *sc, \textcolor{keywordtype}{int} cmd)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00365}00365 \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00366}00366         \textcolor{keyword}{struct }\mbox{\hyperlink{structmii__data}{mii\_data}} *mii = sc-\/>\mbox{\hyperlink{structmii__softc_a12011aec864a92fb63b711b43e6b4356}{mii\_pdata}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00367}00367 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00368}00368         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structmii__softc_a4abee36b90149a841b5fab48bc918f5f}{mii\_media\_active}} != mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}} ||}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00369}00369             cmd == \mbox{\hyperlink{miivar_8h_a6c5cb4a5233e6b1e8a8542636e8ba4c8}{MII\_MEDIACHG}}) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00370}00370                 MIIBUS\_STATCHG(sc-\/>\mbox{\hyperlink{structmii__softc_a621f3e4b95682f9f64ffeacf496e9a22}{mii\_dev}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00371}00371                 sc-\/>\mbox{\hyperlink{structmii__softc_a4abee36b90149a841b5fab48bc918f5f}{mii\_media\_active}} = mii-\/>\mbox{\hyperlink{structmii__data_a374b422968b2e4f40959161a1f6ed490}{mii\_media\_active}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00372}00372         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00373}00373         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structmii__softc_a8596338c95ed0534343b4c7122745399}{mii\_media\_status}} != mii-\/>\mbox{\hyperlink{structmii__data_a15c66b8658a144ac3294603a8146ac09}{mii\_media\_status}}) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00374}00374                 MIIBUS\_LINKCHG(sc-\/>\mbox{\hyperlink{structmii__softc_a621f3e4b95682f9f64ffeacf496e9a22}{mii\_dev}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00375}00375                 sc-\/>\mbox{\hyperlink{structmii__softc_a8596338c95ed0534343b4c7122745399}{mii\_media\_status}} = mii-\/>\mbox{\hyperlink{structmii__data_a15c66b8658a144ac3294603a8146ac09}{mii\_media\_status}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00376}00376         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00377}00377 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00378}00378 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00379}00379 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00380}00380 \textcolor{comment}{ * Initialize generic PHY media based on BMSR, called when a PHY is}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00381}00381 \textcolor{comment}{ * attached.  We expect to be set up to print a comma-\/separated list}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00382}00382 \textcolor{comment}{ * of media names.  Does not print a newline.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00383}00383 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00384}00384 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00385}\mbox{\hyperlink{mii__physubr_8c_ac6dc37c9b11e82962dbe7800afdda4cd}{00385}} \mbox{\hyperlink{mii__physubr_8c_ac6dc37c9b11e82962dbe7800afdda4cd}{mii\_phy\_add\_media}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00386}00386 \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00387}00387         \textcolor{keyword}{struct }\mbox{\hyperlink{structmii__data}{mii\_data}} *mii = sc-\/>\mbox{\hyperlink{structmii__softc_a12011aec864a92fb63b711b43e6b4356}{mii\_pdata}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00388}00388         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *sep = \textcolor{stringliteral}{"{}"{}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00389}00389         \textcolor{keywordtype}{int} fdx = 0;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00390}00390 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00391}00391         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_ac3b545baf912e9bd14af8df8bb388050}{mii\_capabilities}} \& \mbox{\hyperlink{mii_8h_a58bd802e99296717ac7cced521d43010}{BMSR\_MEDIAMASK}}) == 0 \&\&}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00392}00392             (sc-\/>\mbox{\hyperlink{structmii__softc_a9e880a089e764bf319ae80abfa6e2daa}{mii\_extcapabilities}} \& \mbox{\hyperlink{mii_8h_a32b0c4ca3edac502d6bf81f34df26ab7}{EXTSR\_MEDIAMASK}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00393}00393                 printf(\textcolor{stringliteral}{"{}no media present"{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00394}00394                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00395}00395         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00396}00396 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00397}00397         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00398}00398 \textcolor{comment}{         * Set the autonegotiation timer for 10/100 media.  Gigabit media is}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00399}00399 \textcolor{comment}{         * handled below.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00400}00400 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00401}00401         sc-\/>\mbox{\hyperlink{structmii__softc_a360601e70b34832b08ce0b1db3b39113}{mii\_anegticks}} = \mbox{\hyperlink{miivar_8h_a42a72427970e47f6981f3725ad177d43}{MII\_ANEGTICKS}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00402}00402 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00403}00403 \textcolor{preprocessor}{\#define ADD(m)          ifmedia\_add(\&mii-\/>mii\_media, (m), 0, NULL)}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00404}00404 \textcolor{preprocessor}{\#define PRINT(s)        printf("{}\%s\%s"{}}, sep, s); sep = "{}, "{}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00405}00405 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00406}00406         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_ab5201dd2953a06a0ea2cd36a4332d82a}{MIIF\_NOISOLATE}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00407}00407                 \mbox{\hyperlink{mii__physubr_8c_a0566ca4735f6536ae0e94b8c1868b4ee}{ADD}}(IFM\_MAKEWORD(IFM\_ETHER, IFM\_NONE, 0, sc-\/>\mbox{\hyperlink{structmii__softc_a18ed2a5251a1dd8abf3c2d02f7b13a22}{mii\_inst}}));}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00408}00408                 \mbox{\hyperlink{mii__physubr_8c_ab84291599e8de939d6536bbf940b28cd}{PRINT}}(\textcolor{stringliteral}{"{}none"{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00409}00409         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00410}00410 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00411}00411         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00412}00412 \textcolor{comment}{         * There are different interpretations for the bits in}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00413}00413 \textcolor{comment}{         * HomePNA PHYs.  And there is really only one media type}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00414}00414 \textcolor{comment}{         * that is supported.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00415}00415 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00416}00416         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_a3d8cb1fbfbadf58f4d147f4450c2dce3}{MIIF\_IS\_HPNA}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00417}00417                 \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_ac3b545baf912e9bd14af8df8bb388050}{mii\_capabilities}} \& \mbox{\hyperlink{mii_8h_ad5f1eab10df476c73a276366a36c6717}{BMSR\_10THDX}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00418}00418                         \mbox{\hyperlink{mii__physubr_8c_a0566ca4735f6536ae0e94b8c1868b4ee}{ADD}}(IFM\_MAKEWORD(IFM\_ETHER, IFM\_HPNA\_1, 0,}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00419}00419                             sc-\/>\mbox{\hyperlink{structmii__softc_a18ed2a5251a1dd8abf3c2d02f7b13a22}{mii\_inst}}));}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00420}00420                         \mbox{\hyperlink{mii__physubr_8c_ab84291599e8de939d6536bbf940b28cd}{PRINT}}(\textcolor{stringliteral}{"{}HomePNA1"{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00421}00421                 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00422}00422                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00423}00423         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00424}00424 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00425}00425         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_ac3b545baf912e9bd14af8df8bb388050}{mii\_capabilities}} \& \mbox{\hyperlink{mii_8h_ad5f1eab10df476c73a276366a36c6717}{BMSR\_10THDX}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00426}00426                 \mbox{\hyperlink{mii__physubr_8c_a0566ca4735f6536ae0e94b8c1868b4ee}{ADD}}(IFM\_MAKEWORD(IFM\_ETHER, IFM\_10\_T, 0, sc-\/>\mbox{\hyperlink{structmii__softc_a18ed2a5251a1dd8abf3c2d02f7b13a22}{mii\_inst}}));}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00427}00427                 \mbox{\hyperlink{mii__physubr_8c_ab84291599e8de939d6536bbf940b28cd}{PRINT}}(\textcolor{stringliteral}{"{}10baseT"{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00428}00428         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00429}00429         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_ac3b545baf912e9bd14af8df8bb388050}{mii\_capabilities}} \& \mbox{\hyperlink{mii_8h_a2107023850de2125d9f4e2a80d2ea0ea}{BMSR\_10TFDX}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00430}00430                 \mbox{\hyperlink{mii__physubr_8c_a0566ca4735f6536ae0e94b8c1868b4ee}{ADD}}(IFM\_MAKEWORD(IFM\_ETHER, IFM\_10\_T, IFM\_FDX, sc-\/>\mbox{\hyperlink{structmii__softc_a18ed2a5251a1dd8abf3c2d02f7b13a22}{mii\_inst}}));}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00431}00431                 \mbox{\hyperlink{mii__physubr_8c_ab84291599e8de939d6536bbf940b28cd}{PRINT}}(\textcolor{stringliteral}{"{}10baseT-\/FDX"{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00432}00432                 \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_a14bf33c6e55e70acdbf98ebecde8997f}{MIIF\_DOPAUSE}}) != 0 \&\&}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00433}00433                     (sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_a8d2d38c2ee2b3eb2ccd1f0a3da5fed03}{MIIF\_NOMANPAUSE}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00434}00434                         \mbox{\hyperlink{mii__physubr_8c_a0566ca4735f6536ae0e94b8c1868b4ee}{ADD}}(IFM\_MAKEWORD(IFM\_ETHER, IFM\_10\_T,}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00435}00435                             IFM\_FDX | IFM\_FLOW, sc-\/>\mbox{\hyperlink{structmii__softc_a18ed2a5251a1dd8abf3c2d02f7b13a22}{mii\_inst}}));}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00436}00436                         \mbox{\hyperlink{mii__physubr_8c_ab84291599e8de939d6536bbf940b28cd}{PRINT}}(\textcolor{stringliteral}{"{}10baseT-\/FDX-\/flow"{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00437}00437                 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00438}00438                 fdx = 1;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00439}00439         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00440}00440         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_ac3b545baf912e9bd14af8df8bb388050}{mii\_capabilities}} \& \mbox{\hyperlink{mii_8h_a980bf9d1b5e8053768f87821d73afcac}{BMSR\_100TXHDX}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00441}00441                 \mbox{\hyperlink{mii__physubr_8c_a0566ca4735f6536ae0e94b8c1868b4ee}{ADD}}(IFM\_MAKEWORD(IFM\_ETHER, IFM\_100\_TX, 0, sc-\/>\mbox{\hyperlink{structmii__softc_a18ed2a5251a1dd8abf3c2d02f7b13a22}{mii\_inst}}));}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00442}00442                 \mbox{\hyperlink{mii__physubr_8c_ab84291599e8de939d6536bbf940b28cd}{PRINT}}(\textcolor{stringliteral}{"{}100baseTX"{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00443}00443         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00444}00444         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_ac3b545baf912e9bd14af8df8bb388050}{mii\_capabilities}} \& \mbox{\hyperlink{mii_8h_a2953d54a8cde8b60b5daf6096478d3c6}{BMSR\_100TXFDX}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00445}00445                 \mbox{\hyperlink{mii__physubr_8c_a0566ca4735f6536ae0e94b8c1868b4ee}{ADD}}(IFM\_MAKEWORD(IFM\_ETHER, IFM\_100\_TX, IFM\_FDX, sc-\/>\mbox{\hyperlink{structmii__softc_a18ed2a5251a1dd8abf3c2d02f7b13a22}{mii\_inst}}));}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00446}00446                 \mbox{\hyperlink{mii__physubr_8c_ab84291599e8de939d6536bbf940b28cd}{PRINT}}(\textcolor{stringliteral}{"{}100baseTX-\/FDX"{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00447}00447                 \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_a14bf33c6e55e70acdbf98ebecde8997f}{MIIF\_DOPAUSE}}) != 0 \&\&}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00448}00448                     (sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_a8d2d38c2ee2b3eb2ccd1f0a3da5fed03}{MIIF\_NOMANPAUSE}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00449}00449                         \mbox{\hyperlink{mii__physubr_8c_a0566ca4735f6536ae0e94b8c1868b4ee}{ADD}}(IFM\_MAKEWORD(IFM\_ETHER, IFM\_100\_TX,}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00450}00450                             IFM\_FDX | IFM\_FLOW, sc-\/>\mbox{\hyperlink{structmii__softc_a18ed2a5251a1dd8abf3c2d02f7b13a22}{mii\_inst}}));}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00451}00451                         \mbox{\hyperlink{mii__physubr_8c_ab84291599e8de939d6536bbf940b28cd}{PRINT}}(\textcolor{stringliteral}{"{}100baseTX-\/FDX-\/flow"{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00452}00452                 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00453}00453                 fdx = 1;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00454}00454         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00455}00455         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_ac3b545baf912e9bd14af8df8bb388050}{mii\_capabilities}} \& \mbox{\hyperlink{mii_8h_acab252b88ac3b51112a512b015adf801}{BMSR\_100T4}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00456}00456                 \mbox{\hyperlink{mii__physubr_8c_a0566ca4735f6536ae0e94b8c1868b4ee}{ADD}}(IFM\_MAKEWORD(IFM\_ETHER, IFM\_100\_T4, 0, sc-\/>\mbox{\hyperlink{structmii__softc_a18ed2a5251a1dd8abf3c2d02f7b13a22}{mii\_inst}}));}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00457}00457                 \mbox{\hyperlink{mii__physubr_8c_ab84291599e8de939d6536bbf940b28cd}{PRINT}}(\textcolor{stringliteral}{"{}100baseT4"{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00458}00458         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00459}00459 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00460}00460         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a9e880a089e764bf319ae80abfa6e2daa}{mii\_extcapabilities}} \& \mbox{\hyperlink{mii_8h_a32b0c4ca3edac502d6bf81f34df26ab7}{EXTSR\_MEDIAMASK}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00461}00461                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00462}00462 \textcolor{comment}{                 * XXX Right now only handle 1000SX and 1000TX.  Need}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00463}00463 \textcolor{comment}{                 * XXX to handle 1000LX and 1000CX somehow.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00464}00464 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00465}00465                 \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a9e880a089e764bf319ae80abfa6e2daa}{mii\_extcapabilities}} \& \mbox{\hyperlink{mii_8h_a7e0fc4dd2c69abeaaf69ab8043643052}{EXTSR\_1000XHDX}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00466}00466                         sc-\/>\mbox{\hyperlink{structmii__softc_a360601e70b34832b08ce0b1db3b39113}{mii\_anegticks}} = \mbox{\hyperlink{miivar_8h_a6bd00bb7fe1f163e00cc324b104a6bb6}{MII\_ANEGTICKS\_GIGE}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00467}00467                         sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} |= \mbox{\hyperlink{miivar_8h_a6a002884e9ef8960e630d1a16cd2c067}{MIIF\_IS\_1000X}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00468}00468                         \mbox{\hyperlink{mii__physubr_8c_a0566ca4735f6536ae0e94b8c1868b4ee}{ADD}}(IFM\_MAKEWORD(IFM\_ETHER, IFM\_1000\_SX, 0,}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00469}00469                             sc-\/>\mbox{\hyperlink{structmii__softc_a18ed2a5251a1dd8abf3c2d02f7b13a22}{mii\_inst}}));}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00470}00470                         \mbox{\hyperlink{mii__physubr_8c_ab84291599e8de939d6536bbf940b28cd}{PRINT}}(\textcolor{stringliteral}{"{}1000baseSX"{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00471}00471                 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00472}00472                 \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a9e880a089e764bf319ae80abfa6e2daa}{mii\_extcapabilities}} \& \mbox{\hyperlink{mii_8h_a769f4bfc7fda27a5f3ef53e0ba26a0b5}{EXTSR\_1000XFDX}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00473}00473                         sc-\/>\mbox{\hyperlink{structmii__softc_a360601e70b34832b08ce0b1db3b39113}{mii\_anegticks}} = \mbox{\hyperlink{miivar_8h_a6bd00bb7fe1f163e00cc324b104a6bb6}{MII\_ANEGTICKS\_GIGE}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00474}00474                         sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} |= \mbox{\hyperlink{miivar_8h_a6a002884e9ef8960e630d1a16cd2c067}{MIIF\_IS\_1000X}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00475}00475                         \mbox{\hyperlink{mii__physubr_8c_a0566ca4735f6536ae0e94b8c1868b4ee}{ADD}}(IFM\_MAKEWORD(IFM\_ETHER, IFM\_1000\_SX, IFM\_FDX,}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00476}00476                             sc-\/>\mbox{\hyperlink{structmii__softc_a18ed2a5251a1dd8abf3c2d02f7b13a22}{mii\_inst}}));}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00477}00477                         \mbox{\hyperlink{mii__physubr_8c_ab84291599e8de939d6536bbf940b28cd}{PRINT}}(\textcolor{stringliteral}{"{}1000baseSX-\/FDX"{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00478}00478                         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_a14bf33c6e55e70acdbf98ebecde8997f}{MIIF\_DOPAUSE}}) != 0 \&\&}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00479}00479                             (sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_a8d2d38c2ee2b3eb2ccd1f0a3da5fed03}{MIIF\_NOMANPAUSE}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00480}00480                                 \mbox{\hyperlink{mii__physubr_8c_a0566ca4735f6536ae0e94b8c1868b4ee}{ADD}}(IFM\_MAKEWORD(IFM\_ETHER, IFM\_1000\_SX,}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00481}00481                                     IFM\_FDX | IFM\_FLOW, sc-\/>\mbox{\hyperlink{structmii__softc_a18ed2a5251a1dd8abf3c2d02f7b13a22}{mii\_inst}}));}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00482}00482                                 \mbox{\hyperlink{mii__physubr_8c_ab84291599e8de939d6536bbf940b28cd}{PRINT}}(\textcolor{stringliteral}{"{}1000baseSX-\/FDX-\/flow"{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00483}00483                         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00484}00484                         fdx = 1;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00485}00485                 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00486}00486 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00487}00487                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00488}00488 \textcolor{comment}{                 * 1000baseT media needs to be able to manipulate}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00489}00489 \textcolor{comment}{                 * master/slave mode.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00490}00490 \textcolor{comment}{                 *}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00491}00491 \textcolor{comment}{                 * All 1000baseT PHYs have a 1000baseT control register.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00492}00492 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00493}00493                 \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a9e880a089e764bf319ae80abfa6e2daa}{mii\_extcapabilities}} \& \mbox{\hyperlink{mii_8h_a3f49dbf3b3c4a72194b60c3900285628}{EXTSR\_1000THDX}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00494}00494                         sc-\/>\mbox{\hyperlink{structmii__softc_a360601e70b34832b08ce0b1db3b39113}{mii\_anegticks}} = \mbox{\hyperlink{miivar_8h_a6bd00bb7fe1f163e00cc324b104a6bb6}{MII\_ANEGTICKS\_GIGE}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00495}00495                         sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} |= \mbox{\hyperlink{miivar_8h_a376a284eabf873a1d35c3d52c93e8502}{MIIF\_HAVE\_GTCR}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00496}00496                         \mbox{\hyperlink{mii__physubr_8c_a0566ca4735f6536ae0e94b8c1868b4ee}{ADD}}(IFM\_MAKEWORD(IFM\_ETHER, IFM\_1000\_T, 0,}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00497}00497                             sc-\/>\mbox{\hyperlink{structmii__softc_a18ed2a5251a1dd8abf3c2d02f7b13a22}{mii\_inst}}));}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00498}00498                         \mbox{\hyperlink{mii__physubr_8c_ab84291599e8de939d6536bbf940b28cd}{PRINT}}(\textcolor{stringliteral}{"{}1000baseT"{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00499}00499                         \mbox{\hyperlink{mii__physubr_8c_a0566ca4735f6536ae0e94b8c1868b4ee}{ADD}}(IFM\_MAKEWORD(IFM\_ETHER, IFM\_1000\_T,}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00500}00500                             IFM\_ETH\_MASTER, sc-\/>\mbox{\hyperlink{structmii__softc_a18ed2a5251a1dd8abf3c2d02f7b13a22}{mii\_inst}}));}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00501}00501                         \mbox{\hyperlink{mii__physubr_8c_ab84291599e8de939d6536bbf940b28cd}{PRINT}}(\textcolor{stringliteral}{"{}1000baseT-\/master"{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00502}00502                 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00503}00503                 \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a9e880a089e764bf319ae80abfa6e2daa}{mii\_extcapabilities}} \& \mbox{\hyperlink{mii_8h_afa6ac41f1e175515207895edd1ca3839}{EXTSR\_1000TFDX}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00504}00504                         sc-\/>\mbox{\hyperlink{structmii__softc_a360601e70b34832b08ce0b1db3b39113}{mii\_anegticks}} = \mbox{\hyperlink{miivar_8h_a6bd00bb7fe1f163e00cc324b104a6bb6}{MII\_ANEGTICKS\_GIGE}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00505}00505                         sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} |= \mbox{\hyperlink{miivar_8h_a376a284eabf873a1d35c3d52c93e8502}{MIIF\_HAVE\_GTCR}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00506}00506                         \mbox{\hyperlink{mii__physubr_8c_a0566ca4735f6536ae0e94b8c1868b4ee}{ADD}}(IFM\_MAKEWORD(IFM\_ETHER, IFM\_1000\_T, IFM\_FDX,}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00507}00507                             sc-\/>\mbox{\hyperlink{structmii__softc_a18ed2a5251a1dd8abf3c2d02f7b13a22}{mii\_inst}}));}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00508}00508                         \mbox{\hyperlink{mii__physubr_8c_ab84291599e8de939d6536bbf940b28cd}{PRINT}}(\textcolor{stringliteral}{"{}1000baseT-\/FDX"{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00509}00509                         \mbox{\hyperlink{mii__physubr_8c_a0566ca4735f6536ae0e94b8c1868b4ee}{ADD}}(IFM\_MAKEWORD(IFM\_ETHER, IFM\_1000\_T,}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00510}00510                             IFM\_FDX | IFM\_ETH\_MASTER, sc-\/>\mbox{\hyperlink{structmii__softc_a18ed2a5251a1dd8abf3c2d02f7b13a22}{mii\_inst}}));}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00511}00511                         \mbox{\hyperlink{mii__physubr_8c_ab84291599e8de939d6536bbf940b28cd}{PRINT}}(\textcolor{stringliteral}{"{}1000baseT-\/FDX-\/master"{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00512}00512                         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_a14bf33c6e55e70acdbf98ebecde8997f}{MIIF\_DOPAUSE}}) != 0 \&\&}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00513}00513                             (sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_a8d2d38c2ee2b3eb2ccd1f0a3da5fed03}{MIIF\_NOMANPAUSE}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00514}00514                                 \mbox{\hyperlink{mii__physubr_8c_a0566ca4735f6536ae0e94b8c1868b4ee}{ADD}}(IFM\_MAKEWORD(IFM\_ETHER, IFM\_1000\_T,}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00515}00515                                     IFM\_FDX | IFM\_FLOW, sc-\/>\mbox{\hyperlink{structmii__softc_a18ed2a5251a1dd8abf3c2d02f7b13a22}{mii\_inst}}));}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00516}00516                                 \mbox{\hyperlink{mii__physubr_8c_ab84291599e8de939d6536bbf940b28cd}{PRINT}}(\textcolor{stringliteral}{"{}1000baseT-\/FDX-\/flow"{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00517}00517                                 \mbox{\hyperlink{mii__physubr_8c_a0566ca4735f6536ae0e94b8c1868b4ee}{ADD}}(IFM\_MAKEWORD(IFM\_ETHER, IFM\_1000\_T,}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00518}00518                                     IFM\_FDX | IFM\_FLOW | IFM\_ETH\_MASTER,}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00519}00519                                     sc-\/>\mbox{\hyperlink{structmii__softc_a18ed2a5251a1dd8abf3c2d02f7b13a22}{mii\_inst}}));}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00520}00520                                 \mbox{\hyperlink{mii__physubr_8c_ab84291599e8de939d6536bbf940b28cd}{PRINT}}(\textcolor{stringliteral}{"{}1000baseT-\/FDX-\/flow-\/master"{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00521}00521                         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00522}00522                         fdx = 1;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00523}00523                 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00524}00524         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00525}00525 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00526}00526         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_ac3b545baf912e9bd14af8df8bb388050}{mii\_capabilities}} \& \mbox{\hyperlink{mii_8h_ad521243185c9b6b0c8db80eeb416bacc}{BMSR\_ANEG}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00527}00527                 \textcolor{comment}{/* intentionally invalid index */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00528}00528                 \mbox{\hyperlink{mii__physubr_8c_a0566ca4735f6536ae0e94b8c1868b4ee}{ADD}}(IFM\_MAKEWORD(IFM\_ETHER, IFM\_AUTO, 0, sc-\/>\mbox{\hyperlink{structmii__softc_a18ed2a5251a1dd8abf3c2d02f7b13a22}{mii\_inst}}));}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00529}00529                 \mbox{\hyperlink{mii__physubr_8c_ab84291599e8de939d6536bbf940b28cd}{PRINT}}(\textcolor{stringliteral}{"{}auto"{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00530}00530                 \textcolor{keywordflow}{if} (fdx != 0 \&\& (sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_a14bf33c6e55e70acdbf98ebecde8997f}{MIIF\_DOPAUSE}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00531}00531                         \mbox{\hyperlink{mii__physubr_8c_a0566ca4735f6536ae0e94b8c1868b4ee}{ADD}}(IFM\_MAKEWORD(IFM\_ETHER, IFM\_AUTO, IFM\_FLOW,}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00532}00532                             sc-\/>\mbox{\hyperlink{structmii__softc_a18ed2a5251a1dd8abf3c2d02f7b13a22}{mii\_inst}}));}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00533}00533                         \mbox{\hyperlink{mii__physubr_8c_ab84291599e8de939d6536bbf940b28cd}{PRINT}}(\textcolor{stringliteral}{"{}auto-\/flow"{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00534}00534                 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00535}00535         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00536}00536 \textcolor{preprocessor}{\#undef ADD}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00537}00537 \textcolor{preprocessor}{\#undef PRINT}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00538}00538 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00539}00539 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00540}00540 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00541}\mbox{\hyperlink{mii__physubr_8c_af08a34e3932c19824be61fc41ee1083f}{00541}} \mbox{\hyperlink{mii__physubr_8c_af08a34e3932c19824be61fc41ee1083f}{mii\_phy\_detach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00542}00542 \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00543}00543         \textcolor{keyword}{struct }\mbox{\hyperlink{structmii__softc}{mii\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00544}00544 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00545}00545         sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00546}00546         sc-\/>\mbox{\hyperlink{structmii__softc_a621f3e4b95682f9f64ffeacf496e9a22}{mii\_dev}} = NULL;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00547}00547         LIST\_REMOVE(sc, mii\_list);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00548}00548         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00549}00549 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00550}00550 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00551}00551 \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structmii__phydesc}{mii\_phydesc}} *}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00552}\mbox{\hyperlink{mii__physubr_8c_a635c9a188a49510b545ce8a0ea0f896d}{00552}} \mbox{\hyperlink{mii__physubr_8c_a635c9a188a49510b545ce8a0ea0f896d}{mii\_phy\_match\_gen}}(\textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structmii__attach__args}{mii\_attach\_args}} *ma,}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00553}00553   \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structmii__phydesc}{mii\_phydesc}} *mpd, \textcolor{keywordtype}{size\_t} len)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00554}00554 \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00555}00555 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00556}00556         \textcolor{keywordflow}{for} (; mpd-\/>\mbox{\hyperlink{structmii__phydesc_a4dfec8da87088f844bd67f7026ec0c20}{mpd\_name}} != NULL;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00557}00557             mpd = (\textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structmii__phydesc}{mii\_phydesc}} *)((\textcolor{keyword}{const} \textcolor{keywordtype}{char} *)mpd + len)) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00558}00558                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{miivar_8h_a5498c0b81bb923a3a609e1a7ab4dd0a6}{MII\_OUI}}(ma-\/>\mbox{\hyperlink{structmii__attach__args_af08d2234fa1febcc42a7c72911cd8e78}{mii\_id1}}, ma-\/>\mbox{\hyperlink{structmii__attach__args_ae1ec7d7312127efe3ce421788a5f69ee}{mii\_id2}}) == mpd-\/>\mbox{\hyperlink{structmii__phydesc_a53e8930c288ed78cf8862a75965c9a1b}{mpd\_oui}} \&\&}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00559}00559                     \mbox{\hyperlink{miivar_8h_af86103abe9e9a3aa82a603d9326a0a0b}{MII\_MODEL}}(ma-\/>\mbox{\hyperlink{structmii__attach__args_ae1ec7d7312127efe3ce421788a5f69ee}{mii\_id2}}) == mpd-\/>\mbox{\hyperlink{structmii__phydesc_a029a24f0cc6a07aa8893786f517a0cdf}{mpd\_model}})}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00560}00560                         \textcolor{keywordflow}{return} (mpd);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00561}00561         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00562}00562         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00563}00563 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00564}00564 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00565}00565 \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structmii__phydesc}{mii\_phydesc}} *}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00566}\mbox{\hyperlink{mii__physubr_8c_acfc83d22ec9816dc363e4c25af5bff95}{00566}} \mbox{\hyperlink{mii__physubr_8c_acfc83d22ec9816dc363e4c25af5bff95}{mii\_phy\_match}}(\textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structmii__attach__args}{mii\_attach\_args}} *ma, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structmii__phydesc}{mii\_phydesc}} *mpd)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00567}00567 \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00568}00568 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00569}00569         \textcolor{keywordflow}{return} (\mbox{\hyperlink{mii__physubr_8c_a635c9a188a49510b545ce8a0ea0f896d}{mii\_phy\_match\_gen}}(ma, mpd, \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__phydesc}{mii\_phydesc}})));}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00570}00570 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00571}00571 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00572}00572 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00573}\mbox{\hyperlink{mii__physubr_8c_a6eae4dd21de85ca536b06467bf0a5f88}{00573}} \mbox{\hyperlink{mii__physubr_8c_a6eae4dd21de85ca536b06467bf0a5f88}{mii\_phy\_dev\_probe}}(device\_t dev, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structmii__phydesc}{mii\_phydesc}} *mpd, \textcolor{keywordtype}{int} mrv)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00574}00574 \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00575}00575 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00576}00576         mpd = \mbox{\hyperlink{mii__physubr_8c_acfc83d22ec9816dc363e4c25af5bff95}{mii\_phy\_match}}(device\_get\_ivars(dev), mpd);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00577}00577         \textcolor{keywordflow}{if} (mpd != NULL) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00578}00578                 device\_set\_desc(dev, mpd-\/>\mbox{\hyperlink{structmii__phydesc_a4dfec8da87088f844bd67f7026ec0c20}{mpd\_name}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00579}00579                 \textcolor{keywordflow}{return} (mrv);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00580}00580         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00581}00581         \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00582}00582 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00583}00583 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00584}00584 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00585}\mbox{\hyperlink{mii__physubr_8c_a50acf7ba3fab73b23c13fe7da8c93f1d}{00585}} \mbox{\hyperlink{mii__physubr_8c_a50acf7ba3fab73b23c13fe7da8c93f1d}{mii\_phy\_dev\_attach}}(device\_t dev, u\_int flags, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structmii__phy__funcs}{mii\_phy\_funcs}} *mpf,}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00586}00586     \textcolor{keywordtype}{int} add\_media)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00587}00587 \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00588}00588         \textcolor{keyword}{struct }\mbox{\hyperlink{structmii__softc}{mii\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00589}00589         \textcolor{keyword}{struct }\mbox{\hyperlink{structmii__attach__args}{mii\_attach\_args}} *ma;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00590}00590         \textcolor{keyword}{struct }\mbox{\hyperlink{structmii__data}{mii\_data}} *mii;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00591}00591 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00592}00592         sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00593}00593         ma = device\_get\_ivars(dev);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00594}00594         sc-\/>\mbox{\hyperlink{structmii__softc_a621f3e4b95682f9f64ffeacf496e9a22}{mii\_dev}} = device\_get\_parent(dev);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00595}00595         mii = ma-\/>\mbox{\hyperlink{structmii__attach__args_ad9e25452b2818a102da8810390b4afc6}{mii\_data}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00596}00596         LIST\_INSERT\_HEAD(\&mii-\/>mii\_phys, sc, mii\_list);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00597}00597 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00598}00598         sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} = flags | miibus\_get\_flags(dev);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00599}00599         sc-\/>\mbox{\hyperlink{structmii__softc_a0df74f23ca6a031c747b56fb8b1d395f}{mii\_mpd\_oui}} = \mbox{\hyperlink{miivar_8h_a5498c0b81bb923a3a609e1a7ab4dd0a6}{MII\_OUI}}(ma-\/>\mbox{\hyperlink{structmii__attach__args_af08d2234fa1febcc42a7c72911cd8e78}{mii\_id1}}, ma-\/>\mbox{\hyperlink{structmii__attach__args_ae1ec7d7312127efe3ce421788a5f69ee}{mii\_id2}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00600}00600         sc-\/>\mbox{\hyperlink{structmii__softc_a78f933ccf4c00044756002bdd88e4836}{mii\_mpd\_model}} = \mbox{\hyperlink{miivar_8h_af86103abe9e9a3aa82a603d9326a0a0b}{MII\_MODEL}}(ma-\/>\mbox{\hyperlink{structmii__attach__args_ae1ec7d7312127efe3ce421788a5f69ee}{mii\_id2}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00601}00601         sc-\/>\mbox{\hyperlink{structmii__softc_af3bfce0d44b1d6170301377cad2588f6}{mii\_mpd\_rev}} = \mbox{\hyperlink{miivar_8h_a6a560383c86d4ad602121c71644c3aac}{MII\_REV}}(ma-\/>\mbox{\hyperlink{structmii__attach__args_ae1ec7d7312127efe3ce421788a5f69ee}{mii\_id2}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00602}00602         sc-\/>\mbox{\hyperlink{structmii__softc_a157af3d80c80b4529458f07886f72a38}{mii\_capmask}} = ma-\/>\mbox{\hyperlink{structmii__attach__args_a1831213a86cc3311a185512af75c9c24}{mii\_capmask}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00603}00603         sc-\/>\mbox{\hyperlink{structmii__softc_a18ed2a5251a1dd8abf3c2d02f7b13a22}{mii\_inst}} = mii-\/>\mbox{\hyperlink{structmii__data_a9d58c172187cfbfdba8a65abb4da253e}{mii\_instance}}++;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00604}00604         sc-\/>\mbox{\hyperlink{structmii__softc_a7cd574d9b8e1385d05307c6043587131}{mii\_phy}} = ma-\/>\mbox{\hyperlink{structmii__attach__args_a57e558179b97de1ab63686e7b1cf6ee0}{mii\_phyno}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00605}00605         sc-\/>\mbox{\hyperlink{structmii__softc_a9447be3edc1330879e19a4ff719ec584}{mii\_offset}} = ma-\/>\mbox{\hyperlink{structmii__attach__args_a76771d0cd75a01a8a88b450b708e043f}{mii\_offset}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00606}00606         sc-\/>\mbox{\hyperlink{structmii__softc_ac65a28bd6117c18e6dd45dde143e3f0f}{mii\_funcs}} = mpf;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00607}00607         sc-\/>\mbox{\hyperlink{structmii__softc_a12011aec864a92fb63b711b43e6b4356}{mii\_pdata}} = mii;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00608}00608 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00609}00609         \textcolor{keywordflow}{if} (bootverbose)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00610}00610                 device\_printf(dev, \textcolor{stringliteral}{"{}OUI 0x\%06x, model 0x\%04x, rev. \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00611}00611                     sc-\/>\mbox{\hyperlink{structmii__softc_a0df74f23ca6a031c747b56fb8b1d395f}{mii\_mpd\_oui}}, sc-\/>\mbox{\hyperlink{structmii__softc_a78f933ccf4c00044756002bdd88e4836}{mii\_mpd\_model}}, sc-\/>\mbox{\hyperlink{structmii__softc_af3bfce0d44b1d6170301377cad2588f6}{mii\_mpd\_rev}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00612}00612 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00613}00613         \textcolor{keywordflow}{if} (add\_media == 0)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00614}00614                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00615}00615 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00616}00616         \mbox{\hyperlink{miivar_8h_aa355e0359542ffc84e9060ab4556f4d8}{PHY\_RESET}}(sc);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00617}00617 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00618}00618         sc-\/>\mbox{\hyperlink{structmii__softc_ac3b545baf912e9bd14af8df8bb388050}{mii\_capabilities}} = \mbox{\hyperlink{miivar_8h_a4f9acdc044cd8d94bd80432e4f01bcd2}{PHY\_READ}}(sc, \mbox{\hyperlink{mii_8h_aa2f632686d6298a7c898b1c805586aab}{MII\_BMSR}}) \& sc-\/>\mbox{\hyperlink{structmii__softc_a157af3d80c80b4529458f07886f72a38}{mii\_capmask}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00619}00619         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structmii__softc_ac3b545baf912e9bd14af8df8bb388050}{mii\_capabilities}} \& \mbox{\hyperlink{mii_8h_ab4f6d84420322e12fccdd4647cdcce3e}{BMSR\_EXTSTAT}})}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00620}00620                 sc-\/>\mbox{\hyperlink{structmii__softc_a9e880a089e764bf319ae80abfa6e2daa}{mii\_extcapabilities}} = \mbox{\hyperlink{miivar_8h_a4f9acdc044cd8d94bd80432e4f01bcd2}{PHY\_READ}}(sc, \mbox{\hyperlink{mii_8h_a615063b2b7e3d314ccf5a8adeb86ffb7}{MII\_EXTSR}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00621}00621 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00622}00622         \textcolor{keywordflow}{switch} (sc-\/>\mbox{\hyperlink{structmii__softc_a62d6b45733153b536e1a48ef97b7cc49}{mii\_maxspeed}}) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00623}00623         \textcolor{keywordflow}{case} 100:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00624}00624                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00625}00625 \textcolor{comment}{                 * This is a bit tricky.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00626}00626 \textcolor{comment}{                 * If we have a 1G capable PHY, but we don't want to advertise}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00627}00627 \textcolor{comment}{                 * 1G capabilities we need to clear the GTCR register before}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00628}00628 \textcolor{comment}{                 * doing autonegotiation.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00629}00629 \textcolor{comment}{                 * Clearing the register here is not enough since its value}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00630}00630 \textcolor{comment}{                 * can be restored after PHY\_RESET is called.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00631}00631 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00632}00632                 \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a9e880a089e764bf319ae80abfa6e2daa}{mii\_extcapabilities}} \&}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00633}00633                     (\mbox{\hyperlink{mii_8h_a3f49dbf3b3c4a72194b60c3900285628}{EXTSR\_1000THDX}} | \mbox{\hyperlink{mii_8h_afa6ac41f1e175515207895edd1ca3839}{EXTSR\_1000TFDX}})) != 0)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00634}00634                         sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} |= \mbox{\hyperlink{miivar_8h_a376a284eabf873a1d35c3d52c93e8502}{MIIF\_HAVE\_GTCR}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00635}00635 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00636}00636                 sc-\/>\mbox{\hyperlink{structmii__softc_a9e880a089e764bf319ae80abfa6e2daa}{mii\_extcapabilities}} = 0;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00637}00637                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00638}00638         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00639}00639                 device\_printf(dev,}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00640}00640                     \textcolor{stringliteral}{"{}Ignoring unsupported max speed value of \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00641}00641                     sc-\/>\mbox{\hyperlink{structmii__softc_a62d6b45733153b536e1a48ef97b7cc49}{mii\_maxspeed}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00642}00642         \textcolor{keywordflow}{case} 0:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00643}00643         \textcolor{keywordflow}{case} 1000:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00644}00644                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00645}00645         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00646}00646         device\_printf(dev, \textcolor{stringliteral}{"{} "{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00647}00647         \mbox{\hyperlink{mii__physubr_8c_ac6dc37c9b11e82962dbe7800afdda4cd}{mii\_phy\_add\_media}}(sc);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00648}00648         printf(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00649}00649 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00650}00650         MIIBUS\_MEDIAINIT(sc-\/>\mbox{\hyperlink{structmii__softc_a621f3e4b95682f9f64ffeacf496e9a22}{mii\_dev}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00651}00651 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00652}00652         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00653}00653 \textcolor{comment}{         * If maxspeed was specified we have to restart autonegotiation.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00654}00654 \textcolor{comment}{         * PHY might have attempted it and failed due to having mistakenly}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00655}00655 \textcolor{comment}{         * advertising modes that we do not in fact support.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00656}00656 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00657}00657         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structmii__softc_a62d6b45733153b536e1a48ef97b7cc49}{mii\_maxspeed}} != 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00658}00658                 sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} |= \mbox{\hyperlink{miivar_8h_a474c09fc3e5b6259afdafd938e73b987}{MIIF\_FORCEANEG}};}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00659}00659                 \mbox{\hyperlink{mii__physubr_8c_afac2ea5f0d036a16125e01fc48a41457}{mii\_phy\_setmedia}}(sc);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00660}00660                 sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \&= \string~MIIF\_FORCEANEG;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00661}00661         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00662}00662 \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00663}00663 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00664}00664 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00665}00665 \textcolor{comment}{ * Return the flow control status flag from MII\_ANAR \& MII\_ANLPAR.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00666}00666 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00667}00667 u\_int}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00668}\mbox{\hyperlink{mii__physubr_8c_a02a13013ccece7f7569fce9ab65424d3}{00668}} \mbox{\hyperlink{mii__physubr_8c_a02a13013ccece7f7569fce9ab65424d3}{mii\_phy\_flowstatus}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmii__softc}{mii\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00669}00669 \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00670}00670         \textcolor{keywordtype}{int} anar, anlpar;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00671}00671 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00672}00672         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_a14bf33c6e55e70acdbf98ebecde8997f}{MIIF\_DOPAUSE}}) == 0)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00673}00673                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00674}00674 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00675}00675         anar = \mbox{\hyperlink{miivar_8h_a4f9acdc044cd8d94bd80432e4f01bcd2}{PHY\_READ}}(sc, \mbox{\hyperlink{mii_8h_aacb2ab0ea5579b5d9e30b075991add1d}{MII\_ANAR}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00676}00676         anlpar = \mbox{\hyperlink{miivar_8h_a4f9acdc044cd8d94bd80432e4f01bcd2}{PHY\_READ}}(sc, \mbox{\hyperlink{mii_8h_a445e8381a9ea9724054bfacc10bb4c81}{MII\_ANLPAR}});}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00677}00677 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00678}00678         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00679}00679 \textcolor{comment}{         * Check for 1000BASE-\/X.  Autonegotiation is a bit}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00680}00680 \textcolor{comment}{         * different on such devices.}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00681}00681 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00682}00682         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structmii__softc_a99b489a558d699d0a69ffd5405db81aa}{mii\_flags}} \& \mbox{\hyperlink{miivar_8h_a6a002884e9ef8960e630d1a16cd2c067}{MIIF\_IS\_1000X}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00683}00683                 anar <<= 3;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00684}00684                 anlpar <<= 3;}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00685}00685         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00686}00686 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00687}00687         \textcolor{keywordflow}{if} ((anar \& \mbox{\hyperlink{mii_8h_ad3f2c012e7853f95c03a12b1cf2288ac}{ANAR\_PAUSE\_SYM}}) != 0 \&\& (anlpar \& \mbox{\hyperlink{mii_8h_ace29d6b3e03143f6749a544661bccb00}{ANLPAR\_PAUSE\_SYM}}) != 0)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00688}00688                 \textcolor{keywordflow}{return} (IFM\_FLOW | IFM\_ETH\_TXPAUSE | IFM\_ETH\_RXPAUSE);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00689}00689 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00690}00690         \textcolor{keywordflow}{if} ((anar \& \mbox{\hyperlink{mii_8h_ad3f2c012e7853f95c03a12b1cf2288ac}{ANAR\_PAUSE\_SYM}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00691}00691                 \textcolor{keywordflow}{if} ((anar \& \mbox{\hyperlink{mii_8h_a011aca3ef0b4316a14001f0d17844f3b}{ANAR\_PAUSE\_ASYM}}) != 0 \&\&}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00692}00692                     (anlpar \& \mbox{\hyperlink{mii_8h_ae9781cd473ba0e8af956c2f10a09e291}{ANLPAR\_PAUSE\_TOWARDS}}) != 0)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00693}00693                         \textcolor{keywordflow}{return} (IFM\_FLOW | IFM\_ETH\_TXPAUSE);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00694}00694                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00695}00695                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00696}00696         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00697}00697 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00698}00698         \textcolor{keywordflow}{if} ((anar \& \mbox{\hyperlink{mii_8h_a011aca3ef0b4316a14001f0d17844f3b}{ANAR\_PAUSE\_ASYM}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00699}00699                 \textcolor{keywordflow}{if} ((anlpar \& \mbox{\hyperlink{mii_8h_ace29d6b3e03143f6749a544661bccb00}{ANLPAR\_PAUSE\_SYM}}) != 0)}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00700}00700                         \textcolor{keywordflow}{return} (IFM\_FLOW | IFM\_ETH\_TXPAUSE | IFM\_ETH\_RXPAUSE);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00701}00701                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00702}00702                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00703}00703         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00704}00704 }
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00705}00705         \textcolor{keywordflow}{switch} ((anlpar \& \mbox{\hyperlink{mii_8h_ae9781cd473ba0e8af956c2f10a09e291}{ANLPAR\_PAUSE\_TOWARDS}})) \{}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00706}00706         \textcolor{keywordflow}{case} \mbox{\hyperlink{mii_8h_a4974bbdd9ff4ca60f989410397456bc9}{ANLPAR\_PAUSE\_NONE}}:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00707}00707                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00708}00708         \textcolor{keywordflow}{case} \mbox{\hyperlink{mii_8h_ab543928d950d068a0a60102c59aa7a08}{ANLPAR\_PAUSE\_ASYM}}:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00709}00709                 \textcolor{keywordflow}{return} (IFM\_FLOW | IFM\_ETH\_RXPAUSE);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00710}00710         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00711}00711                 \textcolor{keywordflow}{return} (IFM\_FLOW | IFM\_ETH\_RXPAUSE | IFM\_ETH\_TXPAUSE);}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00712}00712         \}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00713}00713         \textcolor{comment}{/* NOTREACHED */}}
\DoxyCodeLine{\Hypertarget{mii__physubr_8c_source_l00714}00714 \}}

\end{DoxyCode}
