\hypertarget{arswitch__8327_8c_source}{}\doxysection{arswitch\+\_\+8327.\+c}
\label{arswitch__8327_8c_source}\index{dev/etherswitch/arswitch/arswitch\_8327.c@{dev/etherswitch/arswitch/arswitch\_8327.c}}
\mbox{\hyperlink{arswitch__8327_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2011-\/2012 Stefan Bethke.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 2014 Adrian Chadd.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00006}00006 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00007}00007 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00008}00008 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00009}00009 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00010}00010 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00011}00011 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00012}00012 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00013}00013 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00014}00014 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00015}00015 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00016}00016 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00017}00017 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00018}00018 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00019}00019 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00020}00020 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00021}00021 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00022}00022 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00023}00023 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00024}00024 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00025}00025 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00026}00026 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00027}00027 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00028}00028 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00029}00029 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00030}00030 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00031}00031 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/errno.h>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/socket.h>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/sockio.h>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00041}00041 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <net/if.h>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <net/if\_arp.h>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <net/ethernet.h>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <net/if\_dl.h>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <net/if\_media.h>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <net/if\_types.h>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00048}00048 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <machine/bus.h>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <dev/iicbus/iic.h>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <dev/iicbus/iiconf.h>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00052}00052 \textcolor{preprocessor}{\#include <dev/iicbus/iicbus.h>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <dev/mii/mii.h>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00054}00054 \textcolor{preprocessor}{\#include <dev/mii/miivar.h>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00055}00055 \textcolor{preprocessor}{\#include <dev/mdio/mdio.h>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00056}00056 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00057}00057 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{etherswitch_8h}{dev/etherswitch/etherswitch.h}}>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00058}00058 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00059}00059 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{arswitchreg_8h}{dev/etherswitch/arswitch/arswitchreg.h}}>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00060}00060 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{arswitchvar_8h}{dev/etherswitch/arswitch/arswitchvar.h}}>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00061}00061 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{arswitch__reg_8h}{dev/etherswitch/arswitch/arswitch\_reg.h}}>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00062}00062 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{arswitch__phy_8h}{dev/etherswitch/arswitch/arswitch\_phy.h}}>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00063}00063 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{arswitch__vlans_8h}{dev/etherswitch/arswitch/arswitch\_vlans.h}}>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00064}00064 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00065}00065 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{arswitch__8327_8h}{dev/etherswitch/arswitch/arswitch\_8327.h}}>}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00066}00066 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00067}00067 \textcolor{preprocessor}{\#include "{}mdio\_if.h"{}}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00068}00068 \textcolor{preprocessor}{\#include "{}miibus\_if.h"{}}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00069}00069 \textcolor{preprocessor}{\#include "{}etherswitch\_if.h"{}}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00070}00070 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00071}00071 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00072}00072 \textcolor{comment}{ * AR8327 TODO:}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00073}00073 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00074}00074 \textcolor{comment}{ * There should be a default hardware setup hint set for the default}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00075}00075 \textcolor{comment}{ * switch config.  Otherwise the default is "{}all ports in one vlangroup"{},}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00076}00076 \textcolor{comment}{ * which means both CPU ports can see each other and that will quickly}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00077}00077 \textcolor{comment}{ * lead to traffic storms/loops.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00078}00078 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00079}00079 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00080}00080 \textcolor{comment}{/* Map port+led to register+shift */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00081}\mbox{\hyperlink{arswitch__8327_8c_a3c3d0c748877c705fd43eea497c7ecf7}{00081}} \textcolor{keyword}{struct }\mbox{\hyperlink{structar8327__led__mapping}{ar8327\_led\_mapping}} \mbox{\hyperlink{structar8327__led__mapping}{ar8327\_led\_mapping}}[\mbox{\hyperlink{arswitchreg_8h_a3a1fbfa21483e57e857a6c701f013b21}{AR8327\_NUM\_PHYS}}][\mbox{\hyperlink{etherswitch_8h_a6c01afd38cd148c377ccb530617af4f6}{ETHERSWITCH\_PORT\_MAX\_LEDS}}] =}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00082}00082 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00083}00083         \{       \textcolor{comment}{/* PHY0 */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00084}00084                 \{\mbox{\hyperlink{arswitchreg_8h_add3c64f0a935ec25d3eef09db4746ee0}{AR8327\_REG\_LED\_CTRL0}}, 14 \},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00085}00085                 \{\mbox{\hyperlink{arswitchreg_8h_aeaf6659bf83309aa2c94f7952aec1b2b}{AR8327\_REG\_LED\_CTRL1}}, 14 \},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00086}00086                 \{\mbox{\hyperlink{arswitchreg_8h_a5f6d45796a1f690dd31a7cb45d34aaf2}{AR8327\_REG\_LED\_CTRL2}}, 14 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00087}00087         \},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00088}00088         \{       \textcolor{comment}{/* PHY1 */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00089}00089                 \{\mbox{\hyperlink{arswitchreg_8h_adc1a1480e824ea4386d9b8b2e8ffc42a}{AR8327\_REG\_LED\_CTRL3}}, 8  \},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00090}00090                 \{\mbox{\hyperlink{arswitchreg_8h_adc1a1480e824ea4386d9b8b2e8ffc42a}{AR8327\_REG\_LED\_CTRL3}}, 10 \},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00091}00091                 \{\mbox{\hyperlink{arswitchreg_8h_adc1a1480e824ea4386d9b8b2e8ffc42a}{AR8327\_REG\_LED\_CTRL3}}, 12 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00092}00092         \},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00093}00093         \{       \textcolor{comment}{/* PHY2 */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00094}00094                 \{\mbox{\hyperlink{arswitchreg_8h_adc1a1480e824ea4386d9b8b2e8ffc42a}{AR8327\_REG\_LED\_CTRL3}}, 14 \},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00095}00095                 \{\mbox{\hyperlink{arswitchreg_8h_adc1a1480e824ea4386d9b8b2e8ffc42a}{AR8327\_REG\_LED\_CTRL3}}, 16 \},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00096}00096                 \{\mbox{\hyperlink{arswitchreg_8h_adc1a1480e824ea4386d9b8b2e8ffc42a}{AR8327\_REG\_LED\_CTRL3}}, 18 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00097}00097         \},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00098}00098         \{       \textcolor{comment}{/* PHY3 */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00099}00099                 \{\mbox{\hyperlink{arswitchreg_8h_adc1a1480e824ea4386d9b8b2e8ffc42a}{AR8327\_REG\_LED\_CTRL3}}, 20 \},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00100}00100                 \{\mbox{\hyperlink{arswitchreg_8h_adc1a1480e824ea4386d9b8b2e8ffc42a}{AR8327\_REG\_LED\_CTRL3}}, 22 \},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00101}00101                 \{\mbox{\hyperlink{arswitchreg_8h_adc1a1480e824ea4386d9b8b2e8ffc42a}{AR8327\_REG\_LED\_CTRL3}}, 24 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00102}00102         \},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00103}00103         \{       \textcolor{comment}{/* PHY4 */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00104}00104                 \{\mbox{\hyperlink{arswitchreg_8h_add3c64f0a935ec25d3eef09db4746ee0}{AR8327\_REG\_LED\_CTRL0}}, 30 \},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00105}00105                 \{\mbox{\hyperlink{arswitchreg_8h_aeaf6659bf83309aa2c94f7952aec1b2b}{AR8327\_REG\_LED\_CTRL1}}, 30 \},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00106}00106                 \{\mbox{\hyperlink{arswitchreg_8h_a5f6d45796a1f690dd31a7cb45d34aaf2}{AR8327\_REG\_LED\_CTRL2}}, 30 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00107}00107         \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00108}00108 \};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00109}00109 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00110}00110 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00111}\mbox{\hyperlink{arswitch__8327_8c_a13ffd51b2d28fbb6c10fac4160025197}{00111}} \mbox{\hyperlink{arswitch__8327_8c_a13ffd51b2d28fbb6c10fac4160025197}{ar8327\_vlan\_op}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc, uint32\_t op, uint32\_t vid,}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00112}00112     uint32\_t data)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00113}00113 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00114}00114         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00115}00115 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00116}00116         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00117}00117 \textcolor{comment}{         * Wait for the "{}done"{} bit to finish.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00118}00118 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00119}00119         \textcolor{keywordflow}{if} (\mbox{\hyperlink{arswitch__reg_8c_a9bd3bea1712ebe40f7f86480412f3f70}{arswitch\_waitreg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a83438bdca7148d7d71da94df74ceac66}{AR8327\_REG\_VTU\_FUNC1}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00120}00120             \mbox{\hyperlink{arswitchreg_8h_a5961efa6cf8b635e3a1bae6a9f8e405c}{AR8327\_VTU\_FUNC1\_BUSY}}, 0, 5))}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00121}00121                 \textcolor{keywordflow}{return} (EBUSY);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00122}00122 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00123}00123         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00124}00124 \textcolor{comment}{         * If it's a "{}load"{} operation, then ensure 'data' is loaded}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00125}00125 \textcolor{comment}{         * in first.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00126}00126 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00127}00127         \textcolor{keywordflow}{if} ((op \& \mbox{\hyperlink{arswitchreg_8h_a87f21047ebd0809d1ffde404b7d007a9}{AR8327\_VTU\_FUNC1\_OP}}) == \mbox{\hyperlink{arswitchreg_8h_ad471a0d70087850c09062408276f809d}{AR8327\_VTU\_FUNC1\_OP\_LOAD}}) \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00128}00128                 err = \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a3a85904694dbbed33ae690590683b44b}{AR8327\_REG\_VTU\_FUNC0}}, data);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00129}00129                 \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00130}00130                         \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00131}00131         \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00132}00132 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00133}00133         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00134}00134 \textcolor{comment}{         * Set the VID.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00135}00135 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00136}00136         op |= ((vid \& 0xfff) << \mbox{\hyperlink{arswitchreg_8h_acdce9c28953303f763bd38e2cf8fff8f}{AR8327\_VTU\_FUNC1\_VID\_S}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00137}00137 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00138}00138         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00139}00139 \textcolor{comment}{         * Set busy bit to start loading in the command.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00140}00140 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00141}00141         op |= \mbox{\hyperlink{arswitchreg_8h_a5961efa6cf8b635e3a1bae6a9f8e405c}{AR8327\_VTU\_FUNC1\_BUSY}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00142}00142         \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a83438bdca7148d7d71da94df74ceac66}{AR8327\_REG\_VTU\_FUNC1}}, op);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00143}00143 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00144}00144         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00145}00145 \textcolor{comment}{         * Finally -\/ wait for it to load.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00146}00146 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00147}00147         \textcolor{keywordflow}{if} (\mbox{\hyperlink{arswitch__reg_8c_a9bd3bea1712ebe40f7f86480412f3f70}{arswitch\_waitreg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a83438bdca7148d7d71da94df74ceac66}{AR8327\_REG\_VTU\_FUNC1}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00148}00148             \mbox{\hyperlink{arswitchreg_8h_a5961efa6cf8b635e3a1bae6a9f8e405c}{AR8327\_VTU\_FUNC1\_BUSY}}, 0, 5))}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00149}00149                 \textcolor{keywordflow}{return} (EBUSY);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00150}00150 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00151}00151         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00152}00152 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00153}00153 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00154}00154 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00155}\mbox{\hyperlink{arswitch__8327_8c_a2907cf76393a150e3678fd4fa46be90a}{00155}} \mbox{\hyperlink{arswitch__8327_8c_a2907cf76393a150e3678fd4fa46be90a}{ar8327\_phy\_fixup}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc, \textcolor{keywordtype}{int} \mbox{\hyperlink{etherswitch__if_8m_a5a9bb95881c089e261771c35775eeaf9}{phy}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00156}00156 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00157}00157         \textcolor{keywordflow}{if} (bootverbose)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00158}00158                 device\_printf(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00159}00159                     \textcolor{stringliteral}{"{}\%s: called; phy=\%d; chiprev=\%d\(\backslash\)n"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00160}00160                     \mbox{\hyperlink{etherswitch__if_8m_a5a9bb95881c089e261771c35775eeaf9}{phy}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00161}00161                     sc-\/>\mbox{\hyperlink{structarswitch__softc_adafb76ea18a91c7827318044aeeeead7}{chip\_rev}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00162}00162         \textcolor{keywordflow}{switch} (sc-\/>\mbox{\hyperlink{structarswitch__softc_adafb76ea18a91c7827318044aeeeead7}{chip\_rev}}) \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00163}00163         \textcolor{keywordflow}{case} 1:}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00164}00164                 \textcolor{comment}{/* For 100M waveform */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00165}00165                 \mbox{\hyperlink{arswitch__reg_8c_a1332590e041f69f344b2076b3356a2f2}{arswitch\_writedbg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{etherswitch__if_8m_a5a9bb95881c089e261771c35775eeaf9}{phy}}, 0, 0x02ea);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00166}00166                 \textcolor{comment}{/* Turn on Gigabit clock */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00167}00167                 \mbox{\hyperlink{arswitch__reg_8c_a1332590e041f69f344b2076b3356a2f2}{arswitch\_writedbg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{etherswitch__if_8m_a5a9bb95881c089e261771c35775eeaf9}{phy}}, 0x3d, 0x68a0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00168}00168                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00169}00169 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00170}00170         \textcolor{keywordflow}{case} 2:}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00171}00171                 \mbox{\hyperlink{arswitch__reg_8c_a0fe44a8fa5ddc1a44ae2d682fc23cf87}{arswitch\_writemmd}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{etherswitch__if_8m_a5a9bb95881c089e261771c35775eeaf9}{phy}}, 0x7, 0x3c);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00172}00172                 \mbox{\hyperlink{arswitch__reg_8c_a0fe44a8fa5ddc1a44ae2d682fc23cf87}{arswitch\_writemmd}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{etherswitch__if_8m_a5a9bb95881c089e261771c35775eeaf9}{phy}}, 0x4007, 0x0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00173}00173                 \textcolor{comment}{/* fallthrough */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00174}00174         \textcolor{keywordflow}{case} 4:}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00175}00175                 \mbox{\hyperlink{arswitch__reg_8c_a0fe44a8fa5ddc1a44ae2d682fc23cf87}{arswitch\_writemmd}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{etherswitch__if_8m_a5a9bb95881c089e261771c35775eeaf9}{phy}}, 0x3, 0x800d);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00176}00176                 \mbox{\hyperlink{arswitch__reg_8c_a0fe44a8fa5ddc1a44ae2d682fc23cf87}{arswitch\_writemmd}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{etherswitch__if_8m_a5a9bb95881c089e261771c35775eeaf9}{phy}}, 0x4003, 0x803f);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00177}00177 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00178}00178                 \mbox{\hyperlink{arswitch__reg_8c_a1332590e041f69f344b2076b3356a2f2}{arswitch\_writedbg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{etherswitch__if_8m_a5a9bb95881c089e261771c35775eeaf9}{phy}}, 0x3d, 0x6860);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00179}00179                 \mbox{\hyperlink{arswitch__reg_8c_a1332590e041f69f344b2076b3356a2f2}{arswitch\_writedbg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{etherswitch__if_8m_a5a9bb95881c089e261771c35775eeaf9}{phy}}, 0x5, 0x2c46);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00180}00180                 \mbox{\hyperlink{arswitch__reg_8c_a1332590e041f69f344b2076b3356a2f2}{arswitch\_writedbg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{etherswitch__if_8m_a5a9bb95881c089e261771c35775eeaf9}{phy}}, 0x3c, 0x6000);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00181}00181                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00182}00182         \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00183}00183 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00184}00184 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00185}00185 \textcolor{keyword}{static} uint32\_t}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00186}\mbox{\hyperlink{arswitch__8327_8c_aa33ebf1a315b71c9ff1b70353c58937b}{00186}} \mbox{\hyperlink{arswitch__8327_8c_aa33ebf1a315b71c9ff1b70353c58937b}{ar8327\_get\_pad\_cfg}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structar8327__pad__cfg}{ar8327\_pad\_cfg}} *cfg)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00187}00187 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00188}00188         uint32\_t t;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00189}00189 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00190}00190         \textcolor{keywordflow}{if} (!cfg)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00191}00191                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00192}00192 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00193}00193         t = 0;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00194}00194         \textcolor{keywordflow}{switch} (cfg-\/>\mbox{\hyperlink{structar8327__pad__cfg_ad96fef6e1419711b61ac8f6b54e308df}{mode}}) \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00195}00195         \textcolor{keywordflow}{case} \mbox{\hyperlink{arswitch__8327_8h_a77f88f2883190110b1305c8e3f776f8aa41549f0f2b0a168a97ff034b8c972d3e}{AR8327\_PAD\_NC}}:}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00196}00196                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00197}00197 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00198}00198         \textcolor{keywordflow}{case} \mbox{\hyperlink{arswitch__8327_8h_a77f88f2883190110b1305c8e3f776f8aa1392b085e5afa59c6376fdb9096baadb}{AR8327\_PAD\_MAC2MAC\_MII}}:}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00199}00199                 t = \mbox{\hyperlink{arswitchreg_8h_ad4bb4458e6df08045c332a82b8c4b6b1}{AR8327\_PAD\_MAC\_MII\_EN}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00200}00200                 \textcolor{keywordflow}{if} (cfg-\/>\mbox{\hyperlink{structar8327__pad__cfg_ade99acc86037cfdf0e07e11e6d160186}{rxclk\_sel}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00201}00201                         t |= \mbox{\hyperlink{arswitchreg_8h_a340b9c2f8d52cd553028ca8441f0661c}{AR8327\_PAD\_MAC\_MII\_RXCLK\_SEL}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00202}00202                 \textcolor{keywordflow}{if} (cfg-\/>\mbox{\hyperlink{structar8327__pad__cfg_a61cb4fcce61f11013a5626dd865ff223}{txclk\_sel}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00203}00203                         t |= \mbox{\hyperlink{arswitchreg_8h_a0c2f6abc5eca3179da9c5ef9e5fbfc89}{AR8327\_PAD\_MAC\_MII\_TXCLK\_SEL}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00204}00204                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00205}00205 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00206}00206         \textcolor{keywordflow}{case} \mbox{\hyperlink{arswitch__8327_8h_a77f88f2883190110b1305c8e3f776f8aa1d006505e2871306f1c4d4cf491809e3}{AR8327\_PAD\_MAC2MAC\_GMII}}:}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00207}00207                 t = \mbox{\hyperlink{arswitchreg_8h_a65bca29cdb862a02b971ee3ba9b7f1cb}{AR8327\_PAD\_MAC\_GMII\_EN}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00208}00208                 \textcolor{keywordflow}{if} (cfg-\/>\mbox{\hyperlink{structar8327__pad__cfg_ade99acc86037cfdf0e07e11e6d160186}{rxclk\_sel}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00209}00209                         t |= \mbox{\hyperlink{arswitchreg_8h_ae21433759463b74e72a6ac34eacfe028}{AR8327\_PAD\_MAC\_GMII\_RXCLK\_SEL}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00210}00210                 \textcolor{keywordflow}{if} (cfg-\/>\mbox{\hyperlink{structar8327__pad__cfg_a61cb4fcce61f11013a5626dd865ff223}{txclk\_sel}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00211}00211                         t |= \mbox{\hyperlink{arswitchreg_8h_a3f6b281c19e5c0a51bfb4c180aa575ad}{AR8327\_PAD\_MAC\_GMII\_TXCLK\_SEL}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00212}00212                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00213}00213 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00214}00214         \textcolor{keywordflow}{case} \mbox{\hyperlink{arswitch__8327_8h_a77f88f2883190110b1305c8e3f776f8aa9e6f967bce49db3983a80ec623a0b183}{AR8327\_PAD\_MAC\_SGMII}}:}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00215}00215                 t = \mbox{\hyperlink{arswitchreg_8h_ad728465466ce476f183e52bf58a1164f}{AR8327\_PAD\_SGMII\_EN}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00216}00216 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00217}00217                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00218}00218 \textcolor{comment}{                 * WAR for the Qualcomm Atheros AP136 board.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00219}00219 \textcolor{comment}{                 * It seems that RGMII TX/RX delay settings needs to be}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00220}00220 \textcolor{comment}{                 * applied for SGMII mode as well, The ethernet is not}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00221}00221 \textcolor{comment}{                 * reliable without this.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00222}00222 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00223}00223                 t |= cfg-\/>\mbox{\hyperlink{structar8327__pad__cfg_a370db94261c59b6b826a91b212958824}{txclk\_delay\_sel}} << \mbox{\hyperlink{arswitchreg_8h_a0daf6ae0494c2a929d8c525edb7bcf48}{AR8327\_PAD\_RGMII\_TXCLK\_DELAY\_SEL\_S}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00224}00224                 t |= cfg-\/>\mbox{\hyperlink{structar8327__pad__cfg_afe1b3c5a162b2899d1d0f0e78a5b1ed7}{rxclk\_delay\_sel}} << \mbox{\hyperlink{arswitchreg_8h_ab4861bf1d2d519d6343b1f0e5b4ad2c6}{AR8327\_PAD\_RGMII\_RXCLK\_DELAY\_SEL\_S}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00225}00225                 \textcolor{keywordflow}{if} (cfg-\/>\mbox{\hyperlink{structar8327__pad__cfg_a2ae595629afc8e8ca325ea143d7718f4}{rxclk\_delay\_en}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00226}00226                         t |= \mbox{\hyperlink{arswitchreg_8h_a20a3dcd6abe731de10836b77c2ae3685}{AR8327\_PAD\_RGMII\_RXCLK\_DELAY\_EN}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00227}00227                 \textcolor{keywordflow}{if} (cfg-\/>\mbox{\hyperlink{structar8327__pad__cfg_afafb75d0adeecd418108c6eb1a9c55f1}{txclk\_delay\_en}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00228}00228                         t |= \mbox{\hyperlink{arswitchreg_8h_a14a0d749770c2f06fc05bcfae44120dd}{AR8327\_PAD\_RGMII\_TXCLK\_DELAY\_EN}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00229}00229 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00230}00230                 \textcolor{keywordflow}{if} (cfg-\/>\mbox{\hyperlink{structar8327__pad__cfg_afb7ac1e1789c60016f3f37d23a86d077}{sgmii\_delay\_en}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00231}00231                         t |= \mbox{\hyperlink{arswitchreg_8h_a92006eab1c5a4f780c7db4c9ef181077}{AR8327\_PAD\_SGMII\_DELAY\_EN}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00232}00232 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00233}00233                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00234}00234 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00235}00235         \textcolor{keywordflow}{case} \mbox{\hyperlink{arswitch__8327_8h_a77f88f2883190110b1305c8e3f776f8aad00f3a47f44573652ecf2eafc06d1833}{AR8327\_PAD\_MAC2PHY\_MII}}:}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00236}00236                 t = \mbox{\hyperlink{arswitchreg_8h_a7c67a65c456cfed4c3249dae49a02def}{AR8327\_PAD\_PHY\_MII\_EN}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00237}00237                 \textcolor{keywordflow}{if} (cfg-\/>\mbox{\hyperlink{structar8327__pad__cfg_ade99acc86037cfdf0e07e11e6d160186}{rxclk\_sel}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00238}00238                         t |= \mbox{\hyperlink{arswitchreg_8h_af10227947403f08bab6289220ceca156}{AR8327\_PAD\_PHY\_MII\_RXCLK\_SEL}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00239}00239                 \textcolor{keywordflow}{if} (cfg-\/>\mbox{\hyperlink{structar8327__pad__cfg_a61cb4fcce61f11013a5626dd865ff223}{txclk\_sel}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00240}00240                         t |= \mbox{\hyperlink{arswitchreg_8h_a3ae8452ed0fc0039eed04c5c5597b42f}{AR8327\_PAD\_PHY\_MII\_TXCLK\_SEL}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00241}00241                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00242}00242 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00243}00243         \textcolor{keywordflow}{case} \mbox{\hyperlink{arswitch__8327_8h_a77f88f2883190110b1305c8e3f776f8aa9dc49d70a5eca4565253deea7bf8823a}{AR8327\_PAD\_MAC2PHY\_GMII}}:}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00244}00244                 t = \mbox{\hyperlink{arswitchreg_8h_a1b764209a45f4359a6536d189abd38e7}{AR8327\_PAD\_PHY\_GMII\_EN}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00245}00245                 \textcolor{keywordflow}{if} (cfg-\/>\mbox{\hyperlink{structar8327__pad__cfg_aef8613d5361117a03efbac564a47182e}{pipe\_rxclk\_sel}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00246}00246                         t |= \mbox{\hyperlink{arswitchreg_8h_a360d0f5c1abf4a98261e1bb442508914}{AR8327\_PAD\_PHY\_GMII\_PIPE\_RXCLK\_SEL}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00247}00247                 \textcolor{keywordflow}{if} (cfg-\/>\mbox{\hyperlink{structar8327__pad__cfg_ade99acc86037cfdf0e07e11e6d160186}{rxclk\_sel}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00248}00248                         t |= \mbox{\hyperlink{arswitchreg_8h_a6ae76730e056f586764005ef7a6b428f}{AR8327\_PAD\_PHY\_GMII\_RXCLK\_SEL}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00249}00249                 \textcolor{keywordflow}{if} (cfg-\/>\mbox{\hyperlink{structar8327__pad__cfg_a61cb4fcce61f11013a5626dd865ff223}{txclk\_sel}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00250}00250                         t |= \mbox{\hyperlink{arswitchreg_8h_af5c94b22774b9ea7ca0f7bf05b9f3d2a}{AR8327\_PAD\_PHY\_GMII\_TXCLK\_SEL}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00251}00251                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00252}00252 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00253}00253         \textcolor{keywordflow}{case} \mbox{\hyperlink{arswitch__8327_8h_a77f88f2883190110b1305c8e3f776f8aa545216438ce6370bf9d8f9c31cfcfd55}{AR8327\_PAD\_MAC\_RGMII}}:}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00254}00254                 t = \mbox{\hyperlink{arswitchreg_8h_ade40d843d72c8172d30af54ddae1277b}{AR8327\_PAD\_RGMII\_EN}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00255}00255                 t |= cfg-\/>\mbox{\hyperlink{structar8327__pad__cfg_a370db94261c59b6b826a91b212958824}{txclk\_delay\_sel}} << \mbox{\hyperlink{arswitchreg_8h_a0daf6ae0494c2a929d8c525edb7bcf48}{AR8327\_PAD\_RGMII\_TXCLK\_DELAY\_SEL\_S}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00256}00256                 t |= cfg-\/>\mbox{\hyperlink{structar8327__pad__cfg_afe1b3c5a162b2899d1d0f0e78a5b1ed7}{rxclk\_delay\_sel}} << \mbox{\hyperlink{arswitchreg_8h_ab4861bf1d2d519d6343b1f0e5b4ad2c6}{AR8327\_PAD\_RGMII\_RXCLK\_DELAY\_SEL\_S}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00257}00257                 \textcolor{keywordflow}{if} (cfg-\/>\mbox{\hyperlink{structar8327__pad__cfg_a2ae595629afc8e8ca325ea143d7718f4}{rxclk\_delay\_en}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00258}00258                         t |= \mbox{\hyperlink{arswitchreg_8h_a20a3dcd6abe731de10836b77c2ae3685}{AR8327\_PAD\_RGMII\_RXCLK\_DELAY\_EN}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00259}00259                 \textcolor{keywordflow}{if} (cfg-\/>\mbox{\hyperlink{structar8327__pad__cfg_afafb75d0adeecd418108c6eb1a9c55f1}{txclk\_delay\_en}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00260}00260                         t |= \mbox{\hyperlink{arswitchreg_8h_a14a0d749770c2f06fc05bcfae44120dd}{AR8327\_PAD\_RGMII\_TXCLK\_DELAY\_EN}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00261}00261                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00262}00262 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00263}00263         \textcolor{keywordflow}{case} \mbox{\hyperlink{arswitch__8327_8h_a77f88f2883190110b1305c8e3f776f8aa4dbc0f41b55954a0bc3c1a74650dc4a4}{AR8327\_PAD\_PHY\_GMII}}:}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00264}00264                 t = \mbox{\hyperlink{arswitchreg_8h_a2ca287fbf2aaf3dde9337e17e2799a4e}{AR8327\_PAD\_PHYX\_GMII\_EN}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00265}00265                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00266}00266 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00267}00267         \textcolor{keywordflow}{case} \mbox{\hyperlink{arswitch__8327_8h_a77f88f2883190110b1305c8e3f776f8aa081ff847e8af4860200f46b35e469a74}{AR8327\_PAD\_PHY\_RGMII}}:}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00268}00268                 t = \mbox{\hyperlink{arswitchreg_8h_a7a1fd214f5ed95200ac7e993a3b0dd25}{AR8327\_PAD\_PHYX\_RGMII\_EN}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00269}00269                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00270}00270 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00271}00271         \textcolor{keywordflow}{case} \mbox{\hyperlink{arswitch__8327_8h_a77f88f2883190110b1305c8e3f776f8aa38f9663d66281590e18f200a2f2e1231}{AR8327\_PAD\_PHY\_MII}}:}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00272}00272                 t = \mbox{\hyperlink{arswitchreg_8h_a45b7d302b0c654ecb19e33175ec819e4}{AR8327\_PAD\_PHYX\_MII\_EN}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00273}00273                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00274}00274         \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00275}00275 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00276}00276         \textcolor{keywordflow}{return} (t);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00277}00277 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00278}00278 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00279}00279 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00280}00280 \textcolor{comment}{ * Map the hard-\/coded port config from the switch setup to}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00281}00281 \textcolor{comment}{ * the chipset port config (status, duplex, flow, etc.)}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00282}00282 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00283}00283 \textcolor{keyword}{static} uint32\_t}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00284}\mbox{\hyperlink{arswitch__8327_8c_aff80403ede28c32ef6e4889fb277152c}{00284}} \mbox{\hyperlink{arswitch__8327_8c_aff80403ede28c32ef6e4889fb277152c}{ar8327\_get\_port\_init\_status}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structar8327__port__cfg}{ar8327\_port\_cfg}} *cfg)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00285}00285 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00286}00286         uint32\_t t;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00287}00287 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00288}00288         \textcolor{keywordflow}{if} (!cfg-\/>\mbox{\hyperlink{structar8327__port__cfg_a829447a963495468f6ee8ae0ed107cb7}{force\_link}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00289}00289                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{arswitchreg_8h_a347d8d29903aaabf0581b7b37ac625c9}{AR8X16\_PORT\_STS\_LINK\_AUTO}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00290}00290 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00291}00291         t = \mbox{\hyperlink{arswitchreg_8h_a2f9d2fbfc2b05a288aa47d1f39802d39}{AR8X16\_PORT\_STS\_TXMAC}} | \mbox{\hyperlink{arswitchreg_8h_ab3a27f2db10f51d590b45482591ae811}{AR8X16\_PORT\_STS\_RXMAC}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00292}00292         t |= cfg-\/>\mbox{\hyperlink{structar8327__port__cfg_a775baabf74dc593b607fab7fffb3db79}{duplex}} ? \mbox{\hyperlink{arswitchreg_8h_a847abe51d2bda5570b3490cab68edffe}{AR8X16\_PORT\_STS\_DUPLEX}} : 0;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00293}00293         t |= cfg-\/>\mbox{\hyperlink{structar8327__port__cfg_aafd022c856b616086e968637f6fb975b}{rxpause}} ? \mbox{\hyperlink{arswitchreg_8h_af9f47395de08728459e18a5fea4ff08f}{AR8X16\_PORT\_STS\_RXFLOW}} : 0;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00294}00294         t |= cfg-\/>\mbox{\hyperlink{structar8327__port__cfg_a4999299a132823699b7f09654d6d89e1}{txpause}} ? \mbox{\hyperlink{arswitchreg_8h_a7dc5c53519a4108d40d6b1b096ecf33d}{AR8X16\_PORT\_STS\_TXFLOW}} : 0;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00295}00295 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00296}00296         \textcolor{keywordflow}{switch} (cfg-\/>\mbox{\hyperlink{structar8327__port__cfg_a50397e451aa14dfdf209f363011ea70c}{speed}}) \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00297}00297         \textcolor{keywordflow}{case} \mbox{\hyperlink{arswitch__8327_8h_a9cffceeeff60f2dfcacacd853a44f831}{AR8327\_PORT\_SPEED\_10}}:}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00298}00298                 t |= \mbox{\hyperlink{arswitchreg_8h_a302fe5317bb2b3ffdbd5384653cc1245}{AR8X16\_PORT\_STS\_SPEED\_10}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00299}00299                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00300}00300         \textcolor{keywordflow}{case} \mbox{\hyperlink{arswitch__8327_8h_ade87d579e03c90f46b9f883cf20474d7}{AR8327\_PORT\_SPEED\_100}}:}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00301}00301                 t |= \mbox{\hyperlink{arswitchreg_8h_a5211c2cfeaf1fd4a835c55371eb27bca}{AR8X16\_PORT\_STS\_SPEED\_100}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00302}00302                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00303}00303         \textcolor{keywordflow}{case} \mbox{\hyperlink{arswitch__8327_8h_a3a0f7f7f34fe92300bf2be911b5041ab}{AR8327\_PORT\_SPEED\_1000}}:}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00304}00304                 t |= \mbox{\hyperlink{arswitchreg_8h_abcf882c471fc49bb30e2527d2aac90fc}{AR8X16\_PORT\_STS\_SPEED\_1000}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00305}00305                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00306}00306         \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00307}00307 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00308}00308         \textcolor{keywordflow}{return} (t);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00309}00309 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00310}00310 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00311}00311 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00312}00312 \textcolor{comment}{ * Fetch the port data for the given port.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00313}00313 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00314}00314 \textcolor{comment}{ * This goes and does dirty things with the hints space}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00315}00315 \textcolor{comment}{ * to determine what the configuration parameters should be.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00316}00316 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00317}00317 \textcolor{comment}{ * Returns 1 if the structure was successfully parsed and}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00318}00318 \textcolor{comment}{ * the contents are valid; 0 otherwise.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00319}00319 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00320}00320 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00321}\mbox{\hyperlink{arswitch__8327_8c_af9fec3bf8e96b3e12e593f7e3bc92434}{00321}} \mbox{\hyperlink{arswitch__8327_8c_af9fec3bf8e96b3e12e593f7e3bc92434}{ar8327\_fetch\_pdata\_port}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc,}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00322}00322     \textcolor{keyword}{struct} \mbox{\hyperlink{structar8327__port__cfg}{ar8327\_port\_cfg}} *pcfg,}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00323}00323     \textcolor{keywordtype}{int} \mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00324}00324 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00325}00325         \textcolor{keywordtype}{int} val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00326}00326         \textcolor{keywordtype}{char} sbuf[128];}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00327}00327 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00328}00328         \textcolor{comment}{/* Check if force\_link exists */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00329}00329         val = 0;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00330}00330         snprintf(sbuf, 128, \textcolor{stringliteral}{"{}port.\%d.force\_link"{}}, \mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00331}00331         (void) resource\_int\_value(device\_get\_name(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00332}00332             device\_get\_unit(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00333}00333             sbuf, \&val);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00334}00334         \textcolor{keywordflow}{if} (val != 1)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00335}00335                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00336}00336         pcfg-\/>\mbox{\hyperlink{structar8327__port__cfg_a829447a963495468f6ee8ae0ed107cb7}{force\_link}} = 1;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00337}00337 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00338}00338         \textcolor{comment}{/* force\_link is set; let's parse the rest of the fields */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00339}00339         snprintf(sbuf, 128, \textcolor{stringliteral}{"{}port.\%d.speed"{}}, \mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00340}00340         \textcolor{keywordflow}{if} (resource\_int\_value(device\_get\_name(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00341}00341             device\_get\_unit(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00342}00342             sbuf, \&val) == 0) \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00343}00343                 \textcolor{keywordflow}{switch} (val) \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00344}00344                 \textcolor{keywordflow}{case} 10:}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00345}00345                         pcfg-\/>\mbox{\hyperlink{structar8327__port__cfg_a50397e451aa14dfdf209f363011ea70c}{speed}} = \mbox{\hyperlink{arswitch__8327_8h_a9cffceeeff60f2dfcacacd853a44f831}{AR8327\_PORT\_SPEED\_10}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00346}00346                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00347}00347                 \textcolor{keywordflow}{case} 100:}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00348}00348                         pcfg-\/>\mbox{\hyperlink{structar8327__port__cfg_a50397e451aa14dfdf209f363011ea70c}{speed}} = \mbox{\hyperlink{arswitch__8327_8h_ade87d579e03c90f46b9f883cf20474d7}{AR8327\_PORT\_SPEED\_100}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00349}00349                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00350}00350                 \textcolor{keywordflow}{case} 1000:}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00351}00351                         pcfg-\/>\mbox{\hyperlink{structar8327__port__cfg_a50397e451aa14dfdf209f363011ea70c}{speed}} = \mbox{\hyperlink{arswitch__8327_8h_a3a0f7f7f34fe92300bf2be911b5041ab}{AR8327\_PORT\_SPEED\_1000}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00352}00352                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00353}00353                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00354}00354                         device\_printf(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00355}00355                             \textcolor{stringliteral}{"{}\%s: invalid port \%d duplex value (\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00356}00356                             \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00357}00357                             \mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00358}00358                             val);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00359}00359                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00360}00360                 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00361}00361         \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00362}00362 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00363}00363         snprintf(sbuf, 128, \textcolor{stringliteral}{"{}port.\%d.duplex"{}}, \mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00364}00364         \textcolor{keywordflow}{if} (resource\_int\_value(device\_get\_name(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00365}00365             device\_get\_unit(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00366}00366             sbuf, \&val) == 0)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00367}00367                 pcfg-\/>\mbox{\hyperlink{structar8327__port__cfg_a775baabf74dc593b607fab7fffb3db79}{duplex}} = val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00368}00368 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00369}00369         snprintf(sbuf, 128, \textcolor{stringliteral}{"{}port.\%d.txpause"{}}, \mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00370}00370         \textcolor{keywordflow}{if} (resource\_int\_value(device\_get\_name(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00371}00371             device\_get\_unit(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00372}00372             sbuf, \&val) == 0)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00373}00373                 pcfg-\/>\mbox{\hyperlink{structar8327__port__cfg_a4999299a132823699b7f09654d6d89e1}{txpause}} = val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00374}00374 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00375}00375         snprintf(sbuf, 128, \textcolor{stringliteral}{"{}port.\%d.rxpause"{}}, \mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00376}00376         \textcolor{keywordflow}{if} (resource\_int\_value(device\_get\_name(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00377}00377             device\_get\_unit(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00378}00378             sbuf, \&val) == 0)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00379}00379                 pcfg-\/>\mbox{\hyperlink{structar8327__port__cfg_aafd022c856b616086e968637f6fb975b}{rxpause}} = val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00380}00380 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00381}00381 \textcolor{preprocessor}{\#if 1}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00382}00382         device\_printf(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00383}00383             \textcolor{stringliteral}{"{}\%s: port \%d: speed=\%d, duplex=\%d, txpause=\%d, rxpause=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00384}00384             \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00385}00385             \mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00386}00386             pcfg-\/>\mbox{\hyperlink{structar8327__port__cfg_a50397e451aa14dfdf209f363011ea70c}{speed}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00387}00387             pcfg-\/>\mbox{\hyperlink{structar8327__port__cfg_a775baabf74dc593b607fab7fffb3db79}{duplex}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00388}00388             pcfg-\/>\mbox{\hyperlink{structar8327__port__cfg_a4999299a132823699b7f09654d6d89e1}{txpause}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00389}00389             pcfg-\/>\mbox{\hyperlink{structar8327__port__cfg_aafd022c856b616086e968637f6fb975b}{rxpause}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00390}00390 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00391}00391 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00392}00392         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00393}00393 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00394}00394 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00395}00395 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00396}00396 \textcolor{comment}{ * Parse the pad configuration from the boot hints.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00397}00397 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00398}00398 \textcolor{comment}{ * The (mostly optional) fields are:}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00399}00399 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00400}00400 \textcolor{comment}{ * uint32\_t mode;}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00401}00401 \textcolor{comment}{ * uint32\_t rxclk\_sel;}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00402}00402 \textcolor{comment}{ * uint32\_t txclk\_sel;}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00403}00403 \textcolor{comment}{ * uint32\_t txclk\_delay\_sel;}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00404}00404 \textcolor{comment}{ * uint32\_t rxclk\_delay\_sel;}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00405}00405 \textcolor{comment}{ * uint32\_t txclk\_delay\_en;}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00406}00406 \textcolor{comment}{ * uint32\_t rxclk\_delay\_en;}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00407}00407 \textcolor{comment}{ * uint32\_t sgmii\_delay\_en;}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00408}00408 \textcolor{comment}{ * uint32\_t pipe\_rxclk\_sel;}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00409}00409 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00410}00410 \textcolor{comment}{ * If mode isn't in the hints, 0 is returned.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00411}00411 \textcolor{comment}{ * Else the structure is fleshed out and 1 is returned.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00412}00412 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00413}00413 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00414}\mbox{\hyperlink{arswitch__8327_8c_a97e16132742d8de93e59eab88ea5b2f2}{00414}} \mbox{\hyperlink{arswitch__8327_8c_a97e16132742d8de93e59eab88ea5b2f2}{ar8327\_fetch\_pdata\_pad}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc,}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00415}00415     \textcolor{keyword}{struct} \mbox{\hyperlink{structar8327__pad__cfg}{ar8327\_pad\_cfg}} *pc,}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00416}00416     \textcolor{keywordtype}{int} pad)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00417}00417 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00418}00418         \textcolor{keywordtype}{int} val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00419}00419         \textcolor{keywordtype}{char} sbuf[128];}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00420}00420 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00421}00421         \textcolor{comment}{/* Check if mode exists */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00422}00422         val = 0;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00423}00423         snprintf(sbuf, 128, \textcolor{stringliteral}{"{}pad.\%d.mode"{}}, pad);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00424}00424         \textcolor{keywordflow}{if} (resource\_int\_value(device\_get\_name(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00425}00425             device\_get\_unit(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00426}00426             sbuf, \&val) != 0)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00427}00427                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00428}00428 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00429}00429         \textcolor{comment}{/* assume that 'mode' exists and was found */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00430}00430         pc-\/>\mbox{\hyperlink{structar8327__pad__cfg_ad96fef6e1419711b61ac8f6b54e308df}{mode}} = val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00431}00431 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00432}00432         snprintf(sbuf, 128, \textcolor{stringliteral}{"{}pad.\%d.rxclk\_sel"{}}, pad);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00433}00433         \textcolor{keywordflow}{if} (resource\_int\_value(device\_get\_name(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00434}00434             device\_get\_unit(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00435}00435             sbuf, \&val) == 0)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00436}00436                 pc-\/>\mbox{\hyperlink{structar8327__pad__cfg_ade99acc86037cfdf0e07e11e6d160186}{rxclk\_sel}} = val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00437}00437 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00438}00438         snprintf(sbuf, 128, \textcolor{stringliteral}{"{}pad.\%d.txclk\_sel"{}}, pad);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00439}00439         \textcolor{keywordflow}{if} (resource\_int\_value(device\_get\_name(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00440}00440             device\_get\_unit(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00441}00441             sbuf, \&val) == 0)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00442}00442                 pc-\/>\mbox{\hyperlink{structar8327__pad__cfg_a61cb4fcce61f11013a5626dd865ff223}{txclk\_sel}} = val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00443}00443 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00444}00444         snprintf(sbuf, 128, \textcolor{stringliteral}{"{}pad.\%d.txclk\_delay\_sel"{}}, pad);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00445}00445         \textcolor{keywordflow}{if} (resource\_int\_value(device\_get\_name(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00446}00446             device\_get\_unit(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00447}00447             sbuf, \&val) == 0)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00448}00448                 pc-\/>\mbox{\hyperlink{structar8327__pad__cfg_a370db94261c59b6b826a91b212958824}{txclk\_delay\_sel}} = val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00449}00449 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00450}00450         snprintf(sbuf, 128, \textcolor{stringliteral}{"{}pad.\%d.rxclk\_delay\_sel"{}}, pad);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00451}00451         \textcolor{keywordflow}{if} (resource\_int\_value(device\_get\_name(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00452}00452             device\_get\_unit(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00453}00453             sbuf, \&val) == 0)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00454}00454                 pc-\/>\mbox{\hyperlink{structar8327__pad__cfg_afe1b3c5a162b2899d1d0f0e78a5b1ed7}{rxclk\_delay\_sel}} = val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00455}00455 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00456}00456         snprintf(sbuf, 128, \textcolor{stringliteral}{"{}pad.\%d.txclk\_delay\_en"{}}, pad);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00457}00457         \textcolor{keywordflow}{if} (resource\_int\_value(device\_get\_name(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00458}00458             device\_get\_unit(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00459}00459             sbuf, \&val) == 0)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00460}00460                 pc-\/>\mbox{\hyperlink{structar8327__pad__cfg_afafb75d0adeecd418108c6eb1a9c55f1}{txclk\_delay\_en}} = val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00461}00461 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00462}00462         snprintf(sbuf, 128, \textcolor{stringliteral}{"{}pad.\%d.rxclk\_delay\_en"{}}, pad);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00463}00463         \textcolor{keywordflow}{if} (resource\_int\_value(device\_get\_name(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00464}00464             device\_get\_unit(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00465}00465             sbuf, \&val) == 0)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00466}00466                 pc-\/>\mbox{\hyperlink{structar8327__pad__cfg_a2ae595629afc8e8ca325ea143d7718f4}{rxclk\_delay\_en}} = val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00467}00467 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00468}00468         snprintf(sbuf, 128, \textcolor{stringliteral}{"{}pad.\%d.sgmii\_delay\_en"{}}, pad);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00469}00469         \textcolor{keywordflow}{if} (resource\_int\_value(device\_get\_name(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00470}00470             device\_get\_unit(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00471}00471             sbuf, \&val) == 0)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00472}00472                 pc-\/>\mbox{\hyperlink{structar8327__pad__cfg_afb7ac1e1789c60016f3f37d23a86d077}{sgmii\_delay\_en}} = val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00473}00473 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00474}00474         snprintf(sbuf, 128, \textcolor{stringliteral}{"{}pad.\%d.pipe\_rxclk\_sel"{}}, pad);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00475}00475         \textcolor{keywordflow}{if} (resource\_int\_value(device\_get\_name(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00476}00476             device\_get\_unit(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00477}00477             sbuf, \&val) == 0)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00478}00478                 pc-\/>\mbox{\hyperlink{structar8327__pad__cfg_aef8613d5361117a03efbac564a47182e}{pipe\_rxclk\_sel}} = val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00479}00479 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00480}00480         \textcolor{keywordflow}{if} (bootverbose) \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00481}00481                 device\_printf(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00482}00482                     \textcolor{stringliteral}{"{}\%s: pad \%d: mode=\%d, rxclk\_sel=\%d, txclk\_sel=\%d, "{}}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00483}00483                     \textcolor{stringliteral}{"{}txclk\_delay\_sel=\%d, rxclk\_delay\_sel=\%d, txclk\_delay\_en=\%d, "{}}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00484}00484                     \textcolor{stringliteral}{"{}rxclk\_enable\_en=\%d, sgmii\_delay\_en=\%d, pipe\_rxclk\_sel=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00485}00485                     \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00486}00486                     pad,}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00487}00487                     pc-\/>\mbox{\hyperlink{structar8327__pad__cfg_ad96fef6e1419711b61ac8f6b54e308df}{mode}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00488}00488                     pc-\/>\mbox{\hyperlink{structar8327__pad__cfg_ade99acc86037cfdf0e07e11e6d160186}{rxclk\_sel}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00489}00489                     pc-\/>\mbox{\hyperlink{structar8327__pad__cfg_a61cb4fcce61f11013a5626dd865ff223}{txclk\_sel}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00490}00490                     pc-\/>\mbox{\hyperlink{structar8327__pad__cfg_a370db94261c59b6b826a91b212958824}{txclk\_delay\_sel}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00491}00491                     pc-\/>\mbox{\hyperlink{structar8327__pad__cfg_afe1b3c5a162b2899d1d0f0e78a5b1ed7}{rxclk\_delay\_sel}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00492}00492                     pc-\/>\mbox{\hyperlink{structar8327__pad__cfg_afafb75d0adeecd418108c6eb1a9c55f1}{txclk\_delay\_en}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00493}00493                     pc-\/>\mbox{\hyperlink{structar8327__pad__cfg_a2ae595629afc8e8ca325ea143d7718f4}{rxclk\_delay\_en}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00494}00494                     pc-\/>\mbox{\hyperlink{structar8327__pad__cfg_afb7ac1e1789c60016f3f37d23a86d077}{sgmii\_delay\_en}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00495}00495                     pc-\/>\mbox{\hyperlink{structar8327__pad__cfg_aef8613d5361117a03efbac564a47182e}{pipe\_rxclk\_sel}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00496}00496         \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00497}00497 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00498}00498         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00499}00499 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00500}00500 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00501}00501 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00502}00502 \textcolor{comment}{ * Fetch the SGMII configuration block from the boot hints.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00503}00503 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00504}00504 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00505}\mbox{\hyperlink{arswitch__8327_8c_a108cd2edb53ffa1b34687e2fc87d3485}{00505}} \mbox{\hyperlink{arswitch__8327_8c_a108cd2edb53ffa1b34687e2fc87d3485}{ar8327\_fetch\_pdata\_sgmii}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc,}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00506}00506     \textcolor{keyword}{struct} \mbox{\hyperlink{structar8327__sgmii__cfg}{ar8327\_sgmii\_cfg}} *scfg)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00507}00507 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00508}00508         \textcolor{keywordtype}{int} val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00509}00509 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00510}00510         \textcolor{comment}{/* sgmii\_ctrl */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00511}00511         val = 0;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00512}00512         \textcolor{keywordflow}{if} (resource\_int\_value(device\_get\_name(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00513}00513             device\_get\_unit(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00514}00514             \textcolor{stringliteral}{"{}sgmii.ctrl"{}}, \&val) != 0)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00515}00515                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00516}00516         scfg-\/>\mbox{\hyperlink{structar8327__sgmii__cfg_acb96f9d199e013a811a954d1ba88f1d3}{sgmii\_ctrl}} = val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00517}00517 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00518}00518         \textcolor{comment}{/* serdes\_aen */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00519}00519         val = 0;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00520}00520         \textcolor{keywordflow}{if} (resource\_int\_value(device\_get\_name(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00521}00521             device\_get\_unit(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00522}00522             \textcolor{stringliteral}{"{}sgmii.serdes\_aen"{}}, \&val) != 0)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00523}00523                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00524}00524         scfg-\/>\mbox{\hyperlink{structar8327__sgmii__cfg_ab0be13052df30cc4ec36a420db850085}{serdes\_aen}} = val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00525}00525 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00526}00526         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00527}00527 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00528}00528 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00529}00529 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00530}00530 \textcolor{comment}{ * Fetch the LED configuration from the boot hints.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00531}00531 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00532}00532 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00533}\mbox{\hyperlink{arswitch__8327_8c_a2947e290056a74922c86e74eadbc7390}{00533}} \mbox{\hyperlink{arswitch__8327_8c_a2947e290056a74922c86e74eadbc7390}{ar8327\_fetch\_pdata\_led}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc,}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00534}00534     \textcolor{keyword}{struct} \mbox{\hyperlink{structar8327__led__cfg}{ar8327\_led\_cfg}} *lcfg)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00535}00535 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00536}00536         \textcolor{keywordtype}{int} val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00537}00537 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00538}00538         val = 0;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00539}00539         \textcolor{keywordflow}{if} (resource\_int\_value(device\_get\_name(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00540}00540             device\_get\_unit(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00541}00541             \textcolor{stringliteral}{"{}led.ctrl0"{}}, \&val) != 0)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00542}00542                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00543}00543         lcfg-\/>\mbox{\hyperlink{structar8327__led__cfg_abded2f4019b5e704fba6c777b8201955}{led\_ctrl0}} = val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00544}00544 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00545}00545         val = 0;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00546}00546         \textcolor{keywordflow}{if} (resource\_int\_value(device\_get\_name(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00547}00547             device\_get\_unit(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00548}00548             \textcolor{stringliteral}{"{}led.ctrl1"{}}, \&val) != 0)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00549}00549                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00550}00550         lcfg-\/>\mbox{\hyperlink{structar8327__led__cfg_a8e3cf10254b8eff69dcb1e9bec0d04e6}{led\_ctrl1}} = val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00551}00551 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00552}00552         val = 0;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00553}00553         \textcolor{keywordflow}{if} (resource\_int\_value(device\_get\_name(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00554}00554             device\_get\_unit(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00555}00555             \textcolor{stringliteral}{"{}led.ctrl2"{}}, \&val) != 0)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00556}00556                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00557}00557         lcfg-\/>\mbox{\hyperlink{structar8327__led__cfg_abdc4f9b67640b1483bb4e0b85bc3ddf8}{led\_ctrl2}} = val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00558}00558 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00559}00559         val = 0;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00560}00560         \textcolor{keywordflow}{if} (resource\_int\_value(device\_get\_name(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00561}00561             device\_get\_unit(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00562}00562             \textcolor{stringliteral}{"{}led.ctrl3"{}}, \&val) != 0)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00563}00563                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00564}00564         lcfg-\/>\mbox{\hyperlink{structar8327__led__cfg_aaa880dcbfb930f378ec6fe11714e7b5b}{led\_ctrl3}} = val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00565}00565 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00566}00566         val = 0;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00567}00567         \textcolor{keywordflow}{if} (resource\_int\_value(device\_get\_name(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00568}00568             device\_get\_unit(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00569}00569             \textcolor{stringliteral}{"{}led.open\_drain"{}}, \&val) != 0)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00570}00570                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00571}00571         lcfg-\/>\mbox{\hyperlink{structar8327__led__cfg_aa2908c731fa6a989ccac2083a628e3dd}{open\_drain}} = val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00572}00572 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00573}00573         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00574}00574 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00575}00575 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00576}00576 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00577}00577 \textcolor{comment}{ * Initialise the ar8327 specific hardware features from}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00578}00578 \textcolor{comment}{ * the hints provided in the boot environment.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00579}00579 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00580}00580 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00581}\mbox{\hyperlink{arswitch__8327_8c_a4979a5384b5a4156a190541dcce3cb0a}{00581}} \mbox{\hyperlink{arswitch__8327_8c_a4979a5384b5a4156a190541dcce3cb0a}{ar8327\_init\_pdata}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00582}00582 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00583}00583         \textcolor{keyword}{struct }\mbox{\hyperlink{structar8327__pad__cfg}{ar8327\_pad\_cfg}} pc;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00584}00584         \textcolor{keyword}{struct }\mbox{\hyperlink{structar8327__port__cfg}{ar8327\_port\_cfg}} port\_cfg;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00585}00585         \textcolor{keyword}{struct }\mbox{\hyperlink{structar8327__sgmii__cfg}{ar8327\_sgmii\_cfg}} scfg;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00586}00586         \textcolor{keyword}{struct }\mbox{\hyperlink{structar8327__led__cfg}{ar8327\_led\_cfg}} lcfg;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00587}00587         uint32\_t t, new\_pos, pos;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00588}00588 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00589}00589         \textcolor{comment}{/* Port 0 */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00590}00590         bzero(\&port\_cfg, \textcolor{keyword}{sizeof}(port\_cfg));}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00591}00591         sc-\/>\mbox{\hyperlink{structarswitch__softc_aea7d49b688cc485e1fa9bf277243bb16}{ar8327}}.\mbox{\hyperlink{structarswitch__softc_a833d72cf8fd939a616d3434db8ce7aaf}{port0\_status}} = 0;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00592}00592         \textcolor{keywordflow}{if} (\mbox{\hyperlink{arswitch__8327_8c_af9fec3bf8e96b3e12e593f7e3bc92434}{ar8327\_fetch\_pdata\_port}}(sc, \&port\_cfg, 0))}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00593}00593                 sc-\/>\mbox{\hyperlink{structarswitch__softc_aea7d49b688cc485e1fa9bf277243bb16}{ar8327}}.\mbox{\hyperlink{structarswitch__softc_a833d72cf8fd939a616d3434db8ce7aaf}{port0\_status}} = \mbox{\hyperlink{arswitch__8327_8c_aff80403ede28c32ef6e4889fb277152c}{ar8327\_get\_port\_init\_status}}(\&port\_cfg);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00594}00594 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00595}00595         \textcolor{comment}{/* Port 6 */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00596}00596         bzero(\&port\_cfg, \textcolor{keyword}{sizeof}(port\_cfg));}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00597}00597         sc-\/>\mbox{\hyperlink{structarswitch__softc_aea7d49b688cc485e1fa9bf277243bb16}{ar8327}}.\mbox{\hyperlink{structarswitch__softc_ae1cc324c350d520d5ad94898dfcd8e3e}{port6\_status}} = 0;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00598}00598         \textcolor{keywordflow}{if} (\mbox{\hyperlink{arswitch__8327_8c_af9fec3bf8e96b3e12e593f7e3bc92434}{ar8327\_fetch\_pdata\_port}}(sc, \&port\_cfg, 6))}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00599}00599                 sc-\/>\mbox{\hyperlink{structarswitch__softc_aea7d49b688cc485e1fa9bf277243bb16}{ar8327}}.\mbox{\hyperlink{structarswitch__softc_ae1cc324c350d520d5ad94898dfcd8e3e}{port6\_status}} = \mbox{\hyperlink{arswitch__8327_8c_aff80403ede28c32ef6e4889fb277152c}{ar8327\_get\_port\_init\_status}}(\&port\_cfg);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00600}00600 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00601}00601         \textcolor{comment}{/* Pad 0 */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00602}00602         bzero(\&pc, \textcolor{keyword}{sizeof}(pc));}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00603}00603         t = 0;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00604}00604         \textcolor{keywordflow}{if} (\mbox{\hyperlink{arswitch__8327_8c_a97e16132742d8de93e59eab88ea5b2f2}{ar8327\_fetch\_pdata\_pad}}(sc, \&pc, 0))}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00605}00605                 t = \mbox{\hyperlink{arswitch__8327_8c_aa33ebf1a315b71c9ff1b70353c58937b}{ar8327\_get\_pad\_cfg}}(\&pc);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00606}00606 \textcolor{preprocessor}{\#if 0}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00607}00607                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{arswitchvar_8h_af47a5f56a5ea9be1a450a2efa2e1a427}{AR8X16\_IS\_SWITCH}}(sc, AR8337))}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00608}00608                         t |= AR8337\_PAD\_MAC06\_EXCHANGE\_EN;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00609}00609 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00610}00610         \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a420aa13b18ca81c08afc53df620778b0}{AR8327\_REG\_PAD0\_MODE}}, t);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00611}00611 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00612}00612         \textcolor{comment}{/* Pad 5 */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00613}00613         bzero(\&pc, \textcolor{keyword}{sizeof}(pc));}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00614}00614         t = 0;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00615}00615         \textcolor{keywordflow}{if} (\mbox{\hyperlink{arswitch__8327_8c_a97e16132742d8de93e59eab88ea5b2f2}{ar8327\_fetch\_pdata\_pad}}(sc, \&pc, 5))}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00616}00616                 t = \mbox{\hyperlink{arswitch__8327_8c_aa33ebf1a315b71c9ff1b70353c58937b}{ar8327\_get\_pad\_cfg}}(\&pc);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00617}00617         \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_aa420d688023f8dadf869cdcbac9ae650}{AR8327\_REG\_PAD5\_MODE}}, t);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00618}00618 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00619}00619         \textcolor{comment}{/* Pad 6 */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00620}00620         bzero(\&pc, \textcolor{keyword}{sizeof}(pc));}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00621}00621         t = 0;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00622}00622         \textcolor{keywordflow}{if} (\mbox{\hyperlink{arswitch__8327_8c_a97e16132742d8de93e59eab88ea5b2f2}{ar8327\_fetch\_pdata\_pad}}(sc, \&pc, 6))}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00623}00623                 t = \mbox{\hyperlink{arswitch__8327_8c_aa33ebf1a315b71c9ff1b70353c58937b}{ar8327\_get\_pad\_cfg}}(\&pc);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00624}00624         \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a5a9d88e24dfa251d540172ebd6be296e}{AR8327\_REG\_PAD6\_MODE}}, t);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00625}00625 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00626}00626         pos = \mbox{\hyperlink{arswitch__reg_8c_a032a26bfd0728d9e080f65aedaf8b6a0}{arswitch\_readreg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_aaa5dd1c12d25bb67d6fb510c64f2a616}{AR8327\_REG\_POWER\_ON\_STRIP}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00627}00627         new\_pos = pos;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00628}00628 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00629}00629         \textcolor{comment}{/* XXX LED config */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00630}00630         bzero(\&lcfg, \textcolor{keyword}{sizeof}(lcfg));}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00631}00631         \textcolor{keywordflow}{if} (\mbox{\hyperlink{arswitch__8327_8c_a2947e290056a74922c86e74eadbc7390}{ar8327\_fetch\_pdata\_led}}(sc, \&lcfg)) \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00632}00632                 \textcolor{keywordflow}{if} (lcfg.\mbox{\hyperlink{structar8327__led__cfg_aa2908c731fa6a989ccac2083a628e3dd}{open\_drain}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00633}00633                         new\_pos |= \mbox{\hyperlink{arswitchreg_8h_a74557f707a67ade829f578a6b71a37ac}{AR8327\_POWER\_ON\_STRIP\_LED\_OPEN\_EN}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00634}00634                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00635}00635                         new\_pos \&= \string~AR8327\_POWER\_ON\_STRIP\_LED\_OPEN\_EN;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00636}00636 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00637}00637                 \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_add3c64f0a935ec25d3eef09db4746ee0}{AR8327\_REG\_LED\_CTRL0}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00638}00638                     lcfg.\mbox{\hyperlink{structar8327__led__cfg_abded2f4019b5e704fba6c777b8201955}{led\_ctrl0}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00639}00639                 \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_aeaf6659bf83309aa2c94f7952aec1b2b}{AR8327\_REG\_LED\_CTRL1}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00640}00640                     lcfg.\mbox{\hyperlink{structar8327__led__cfg_a8e3cf10254b8eff69dcb1e9bec0d04e6}{led\_ctrl1}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00641}00641                 \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a5f6d45796a1f690dd31a7cb45d34aaf2}{AR8327\_REG\_LED\_CTRL2}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00642}00642                     lcfg.\mbox{\hyperlink{structar8327__led__cfg_abdc4f9b67640b1483bb4e0b85bc3ddf8}{led\_ctrl2}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00643}00643                 \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_adc1a1480e824ea4386d9b8b2e8ffc42a}{AR8327\_REG\_LED\_CTRL3}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00644}00644                     lcfg.\mbox{\hyperlink{structar8327__led__cfg_aaa880dcbfb930f378ec6fe11714e7b5b}{led\_ctrl3}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00645}00645 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00646}00646                 \textcolor{keywordflow}{if} (new\_pos != pos)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00647}00647                         new\_pos |= \mbox{\hyperlink{arswitchreg_8h_a7c87f19a1c9c18d4661f0878658984ff}{AR8327\_POWER\_ON\_STRIP\_POWER\_ON\_SEL}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00648}00648         \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00649}00649 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00650}00650         \textcolor{comment}{/* SGMII config */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00651}00651         bzero(\&scfg, \textcolor{keyword}{sizeof}(scfg));}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00652}00652         \textcolor{keywordflow}{if} (\mbox{\hyperlink{arswitch__8327_8c_a108cd2edb53ffa1b34687e2fc87d3485}{ar8327\_fetch\_pdata\_sgmii}}(sc, \&scfg)) \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00653}00653                 device\_printf(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \textcolor{stringliteral}{"{}\%s: SGMII cfg?\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00654}00654                 t = scfg.\mbox{\hyperlink{structar8327__sgmii__cfg_acb96f9d199e013a811a954d1ba88f1d3}{sgmii\_ctrl}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00655}00655                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structarswitch__softc_adafb76ea18a91c7827318044aeeeead7}{chip\_rev}} == 1)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00656}00656                         t |= \mbox{\hyperlink{arswitchreg_8h_a20d86d954810725cda320575e4bc44e1}{AR8327\_SGMII\_CTRL\_EN\_PLL}} |}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00657}00657                             \mbox{\hyperlink{arswitchreg_8h_a2484ceca8572839bd72c20abcde62f0c}{AR8327\_SGMII\_CTRL\_EN\_RX}} |}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00658}00658                             \mbox{\hyperlink{arswitchreg_8h_ac8de8775b46d84de0bd503ab4bf6735c}{AR8327\_SGMII\_CTRL\_EN\_TX}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00659}00659                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00660}00660                         t \&= \string~(\mbox{\hyperlink{arswitchreg_8h_a20d86d954810725cda320575e4bc44e1}{AR8327\_SGMII\_CTRL\_EN\_PLL}} |}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00661}00661                             \mbox{\hyperlink{arswitchreg_8h_a2484ceca8572839bd72c20abcde62f0c}{AR8327\_SGMII\_CTRL\_EN\_RX}} |}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00662}00662                             \mbox{\hyperlink{arswitchreg_8h_ac8de8775b46d84de0bd503ab4bf6735c}{AR8327\_SGMII\_CTRL\_EN\_TX}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00663}00663 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00664}00664                 \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a9e4efcebc833e9375e0927d1ed55af48}{AR8327\_REG\_SGMII\_CTRL}}, t);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00665}00665 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00666}00666                 \textcolor{keywordflow}{if} (scfg.\mbox{\hyperlink{structar8327__sgmii__cfg_ab0be13052df30cc4ec36a420db850085}{serdes\_aen}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00667}00667                         new\_pos \&= \string~AR8327\_POWER\_ON\_STRIP\_SERDES\_AEN;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00668}00668                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00669}00669                         new\_pos |= \mbox{\hyperlink{arswitchreg_8h_a7dd495eb4085994fa2e43dc7aa9b5124}{AR8327\_POWER\_ON\_STRIP\_SERDES\_AEN}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00670}00670         \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00671}00671 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00672}00672         \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_aaa5dd1c12d25bb67d6fb510c64f2a616}{AR8327\_REG\_POWER\_ON\_STRIP}}, new\_pos);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00673}00673 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00674}00674         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00675}00675 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00676}00676 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00677}00677 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00678}\mbox{\hyperlink{arswitch__8327_8c_a051ff682cf35680558184da52554d11f}{00678}} \mbox{\hyperlink{arswitch__8327_8c_a051ff682cf35680558184da52554d11f}{ar8327\_hw\_setup}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00679}00679 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00680}00680         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00681}00681         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00682}00682 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00683}00683         \textcolor{comment}{/* pdata fetch and setup */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00684}00684         err = \mbox{\hyperlink{arswitch__8327_8c_a4979a5384b5a4156a190541dcce3cb0a}{ar8327\_init\_pdata}}(sc);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00685}00685         \textcolor{keywordflow}{if} (err != 0)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00686}00686                 \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00687}00687 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00688}00688         \textcolor{comment}{/* XXX init leds */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00689}00689 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00690}00690         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{arswitchreg_8h_a3a1fbfa21483e57e857a6c701f013b21}{AR8327\_NUM\_PHYS}}; i++) \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00691}00691                 \textcolor{comment}{/* phy fixup */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00692}00692                 \mbox{\hyperlink{arswitch__8327_8c_a2907cf76393a150e3678fd4fa46be90a}{ar8327\_phy\_fixup}}(sc, i);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00693}00693 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00694}00694                 \textcolor{comment}{/* start PHY autonegotiation? */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00695}00695                 \textcolor{comment}{/* XXX is this done as part of the normal PHY setup? */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00696}00696 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00697}00697         \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00698}00698 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00699}00699         \textcolor{comment}{/* Let things settle */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00700}00700         DELAY(1000);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00701}00701 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00702}00702         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00703}00703 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00704}00704 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00705}00705 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00706}\mbox{\hyperlink{arswitch__8327_8c_afde575fca1463d81fb4fed40f554dee9}{00706}} \mbox{\hyperlink{arswitch__8327_8c_afde575fca1463d81fb4fed40f554dee9}{ar8327\_atu\_learn\_default}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00707}00707 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00708}00708 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00709}00709         device\_printf(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \textcolor{stringliteral}{"{}\%s: TODO!\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00710}00710         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00711}00711 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00712}00712 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00713}00713 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00714}00714 \textcolor{comment}{ * Initialise other global values, for the AR8327.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00715}00715 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00716}00716 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00717}\mbox{\hyperlink{arswitch__8327_8c_aceb5f8a2697dff8b942c5d826919527a}{00717}} \mbox{\hyperlink{arswitch__8327_8c_aceb5f8a2697dff8b942c5d826919527a}{ar8327\_hw\_global\_setup}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00718}00718 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00719}00719         uint32\_t t;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00720}00720 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00721}00721         \mbox{\hyperlink{arswitchvar_8h_ac08400399758baa649e223dd369aa3cc}{ARSWITCH\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00722}00722 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00723}00723         \textcolor{comment}{/* enable CPU port and disable mirror port */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00724}00724         t = \mbox{\hyperlink{arswitchreg_8h_ab281edb49bbb17faa31520e86450066e}{AR8327\_FWD\_CTRL0\_CPU\_PORT\_EN}} |}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00725}00725             \mbox{\hyperlink{arswitchreg_8h_a71c6353e385e09be46c3607d2fc62c00}{AR8327\_FWD\_CTRL0\_MIRROR\_PORT}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00726}00726         \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_ac4842d9d99f516b8ace5c2d74d8cd374}{AR8327\_REG\_FWD\_CTRL0}}, t);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00727}00727 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00728}00728         \textcolor{comment}{/* forward multicast and broadcast frames to CPU */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00729}00729         t = (\mbox{\hyperlink{arswitchreg_8h_a30a3f060a283917405b4957a21db3e89}{AR8327\_PORTS\_ALL}} << \mbox{\hyperlink{arswitchreg_8h_a7dea33a4e4a8765c2b9445dec983c046}{AR8327\_FWD\_CTRL1\_UC\_FLOOD\_S}}) |}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00730}00730             (\mbox{\hyperlink{arswitchreg_8h_a30a3f060a283917405b4957a21db3e89}{AR8327\_PORTS\_ALL}} << \mbox{\hyperlink{arswitchreg_8h_a2c6157662537f0695bef3c761e81526f}{AR8327\_FWD\_CTRL1\_MC\_FLOOD\_S}}) |}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00731}00731             (\mbox{\hyperlink{arswitchreg_8h_a30a3f060a283917405b4957a21db3e89}{AR8327\_PORTS\_ALL}} << \mbox{\hyperlink{arswitchreg_8h_a89d5b2a49ca25931b10e7aa4b6f5468e}{AR8327\_FWD\_CTRL1\_BC\_FLOOD\_S}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00732}00732         \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a366ef24318b67c7fcced72b9cd041851}{AR8327\_REG\_FWD\_CTRL1}}, t);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00733}00733 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00734}00734         \textcolor{comment}{/* enable jumbo frames */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00735}00735         \textcolor{comment}{/* XXX need to macro-\/shift the value! */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00736}00736         \mbox{\hyperlink{arswitch__reg_8c_a0080a381b2a2a40990ae6da23b1a337c}{arswitch\_modifyreg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a82dfd06e182b6dbd47beb75ea04ef60f}{AR8327\_REG\_MAX\_FRAME\_SIZE}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00737}00737             \mbox{\hyperlink{arswitchreg_8h_ac49d61a305c6d5f96f990f3b7a3a8077}{AR8327\_MAX\_FRAME\_SIZE\_MTU}}, 9018 + 8 + 2);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00738}00738 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00739}00739         \textcolor{comment}{/* Enable MIB counters */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00740}00740         \mbox{\hyperlink{arswitch__reg_8c_a0080a381b2a2a40990ae6da23b1a337c}{arswitch\_modifyreg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_ade3bb6d6ced2bc8caf42005e2056efdc}{AR8327\_REG\_MODULE\_EN}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00741}00741             \mbox{\hyperlink{arswitchreg_8h_a18ceffd5b786c49cf97dccb78a08f215}{AR8327\_MODULE\_EN\_MIB}}, \mbox{\hyperlink{arswitchreg_8h_a18ceffd5b786c49cf97dccb78a08f215}{AR8327\_MODULE\_EN\_MIB}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00742}00742 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00743}00743         \textcolor{comment}{/* Disable EEE on all ports due to stability issues */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00744}00744         t = \mbox{\hyperlink{arswitch__reg_8c_a032a26bfd0728d9e080f65aedaf8b6a0}{arswitch\_readreg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_af5299a5c0c2210c77f8832560f484082}{AR8327\_REG\_EEE\_CTRL}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00745}00745         t |= \mbox{\hyperlink{arswitchreg_8h_a9d2dbc7ea873ee0bc4a6799a95fc527b}{AR8327\_EEE\_CTRL\_DISABLE\_PHY}}(0) |}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00746}00746             \mbox{\hyperlink{arswitchreg_8h_a9d2dbc7ea873ee0bc4a6799a95fc527b}{AR8327\_EEE\_CTRL\_DISABLE\_PHY}}(1) |}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00747}00747             \mbox{\hyperlink{arswitchreg_8h_a9d2dbc7ea873ee0bc4a6799a95fc527b}{AR8327\_EEE\_CTRL\_DISABLE\_PHY}}(2) |}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00748}00748             \mbox{\hyperlink{arswitchreg_8h_a9d2dbc7ea873ee0bc4a6799a95fc527b}{AR8327\_EEE\_CTRL\_DISABLE\_PHY}}(3) |}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00749}00749             \mbox{\hyperlink{arswitchreg_8h_a9d2dbc7ea873ee0bc4a6799a95fc527b}{AR8327\_EEE\_CTRL\_DISABLE\_PHY}}(4);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00750}00750         \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_af5299a5c0c2210c77f8832560f484082}{AR8327\_REG\_EEE\_CTRL}}, t);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00751}00751 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00752}00752         \textcolor{comment}{/* Set the right number of ports */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00753}00753         \textcolor{comment}{/* GMAC0 (CPU), GMAC1..5 (PHYs), GMAC6 (CPU) */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00754}00754         sc-\/>\mbox{\hyperlink{structarswitch__softc_a666c31b68b7f9b1ab5e9df7b5fda6b4e}{info}}.\mbox{\hyperlink{structetherswitch__info_afc014617d0700461bd140357120f6b42}{es\_nports}} = 7;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00755}00755 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00756}00756         \mbox{\hyperlink{arswitchvar_8h_a946c613ba31a000a1e32396435b4f55b}{ARSWITCH\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00757}00757         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00758}00758 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00759}00759 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00760}00760 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00761}00761 \textcolor{comment}{ * Port setup.  Called at attach time.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00762}00762 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00763}00763 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00764}\mbox{\hyperlink{arswitch__8327_8c_ab8502b48d713e101bad815e94b99eef8}{00764}} \mbox{\hyperlink{arswitch__8327_8c_ab8502b48d713e101bad815e94b99eef8}{ar8327\_port\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc, \textcolor{keywordtype}{int} \mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00765}00765 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00766}00766         uint32\_t t;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00767}00767         \textcolor{keywordtype}{int} ports;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00768}00768 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00769}00769         \textcolor{comment}{/* For now, port can see all other ports */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00770}00770         ports = 0x7f;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00771}00771 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00772}00772         \textcolor{keywordflow}{if} (\mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}} == \mbox{\hyperlink{arswitchreg_8h_aeb6fe03933a98b6fd49d81d160720ef3}{AR8X16\_PORT\_CPU}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00773}00773                 t = sc-\/>\mbox{\hyperlink{structarswitch__softc_aea7d49b688cc485e1fa9bf277243bb16}{ar8327}}.\mbox{\hyperlink{structarswitch__softc_a833d72cf8fd939a616d3434db8ce7aaf}{port0\_status}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00774}00774         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}} == 6)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00775}00775                 t = sc-\/>\mbox{\hyperlink{structarswitch__softc_aea7d49b688cc485e1fa9bf277243bb16}{ar8327}}.\mbox{\hyperlink{structarswitch__softc_ae1cc324c350d520d5ad94898dfcd8e3e}{port6\_status}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00776}00776         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00777}00777                 t = \mbox{\hyperlink{arswitchreg_8h_a347d8d29903aaabf0581b7b37ac625c9}{AR8X16\_PORT\_STS\_LINK\_AUTO}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00778}00778 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00779}00779         \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a15821095b5038000ccb2c97bf7180563}{AR8327\_REG\_PORT\_STATUS}}(\mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}}), t);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00780}00780         \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_af5e9ae7c76f046f755f9820fa4e9262b}{AR8327\_REG\_PORT\_HEADER}}(\mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}}), 0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00781}00781 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00782}00782         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00783}00783 \textcolor{comment}{         * Default to 1 port group.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00784}00784 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00785}00785         t = 1 << \mbox{\hyperlink{arswitchreg_8h_a7e435c04818ea78947e8071ca1b4ed64}{AR8327\_PORT\_VLAN0\_DEF\_SVID\_S}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00786}00786         t |= 1 << \mbox{\hyperlink{arswitchreg_8h_a2333e8b74b963f74ff7bd89ee5c94c58}{AR8327\_PORT\_VLAN0\_DEF\_CVID\_S}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00787}00787         \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a8efc8620a7ef8b21ac945be5f4ce1fc5}{AR8327\_REG\_PORT\_VLAN0}}(\mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}}), t);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00788}00788 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00789}00789         t = \mbox{\hyperlink{arswitchreg_8h_ae661f8af71dc1f63d89bd27734a150f7}{AR8327\_PORT\_VLAN1\_OUT\_MODE\_UNTOUCH}} << \mbox{\hyperlink{arswitchreg_8h_a3734fd2e3d1e5e3bbc8cf9966f047ee6}{AR8327\_PORT\_VLAN1\_OUT\_MODE\_S}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00790}00790         \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a785c11a60e164c599cfdbbf449ae1ab5}{AR8327\_REG\_PORT\_VLAN1}}(\mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}}), t);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00791}00791 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00792}00792         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00793}00793 \textcolor{comment}{         * This doesn't configure any ports which this port can "{}see"{}.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00794}00794 \textcolor{comment}{         * bits 0-\/6 control which ports a frame coming into this port}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00795}00795 \textcolor{comment}{         * can be sent out to.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00796}00796 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00797}00797 \textcolor{comment}{         * So by doing this, we're making it impossible to send frames out}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00798}00798 \textcolor{comment}{         * to that port.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00799}00799 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00800}00800         t = \mbox{\hyperlink{arswitchreg_8h_a9aba09eca3dbcb2980a0a460d1f5e428}{AR8327\_PORT\_LOOKUP\_LEARN}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00801}00801         t |= \mbox{\hyperlink{arswitchreg_8h_abfe19404cf24b3f016de4328e7c50b62}{AR8X16\_PORT\_CTRL\_STATE\_FORWARD}} << \mbox{\hyperlink{arswitchreg_8h_a0598b11897adfe901b97cf2ecaa0f6af}{AR8327\_PORT\_LOOKUP\_STATE\_S}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00802}00802 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00803}00803         \textcolor{comment}{/* So this allows traffic to any port except ourselves */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00804}00804         t |= (ports \& \string~(1 << \mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}}));}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00805}00805         \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_ae4570c95d17cee3ed6388bfd2ce899c6}{AR8327\_REG\_PORT\_LOOKUP}}(\mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}}), t);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00806}00806 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00807}00807 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00808}00808 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00809}\mbox{\hyperlink{arswitch__8327_8c_ab35747b300fe6b30db2f0bac69a8fb14}{00809}} \mbox{\hyperlink{arswitch__8327_8c_ab35747b300fe6b30db2f0bac69a8fb14}{ar8327\_port\_vlan\_setup}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc, \mbox{\hyperlink{structetherswitch__port}{etherswitch\_port\_t}} *p)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00810}00810 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00811}00811 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00812}00812         \textcolor{comment}{/* Check: ADDTAG/STRIPTAG -\/ exclusive */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00813}00813 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00814}00814         \mbox{\hyperlink{arswitchvar_8h_ac08400399758baa649e223dd369aa3cc}{ARSWITCH\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00815}00815 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00816}00816         \textcolor{comment}{/* Set the PVID. */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00817}00817         \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structetherswitch__port_ad8e2bebae64001c4f840310f6271f853}{es\_pvid}} != 0)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00818}00818                 sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_aad21ed71d52d9fe3bde6c59304a681a8}{arswitch\_vlan\_set\_pvid}}(sc, p-\/>\mbox{\hyperlink{structetherswitch__port_ad4603ef02270446668fc59d201aa2e59}{es\_port}}, p-\/>\mbox{\hyperlink{structetherswitch__port_ad8e2bebae64001c4f840310f6271f853}{es\_pvid}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00819}00819 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00820}00820         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00821}00821 \textcolor{comment}{         * DOUBLE\_TAG}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00822}00822 \textcolor{comment}{         * VLAN\_MODE\_ADD}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00823}00823 \textcolor{comment}{         * VLAN\_MODE\_STRIP}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00824}00824 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00825}00825         \mbox{\hyperlink{arswitchvar_8h_a946c613ba31a000a1e32396435b4f55b}{ARSWITCH\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00826}00826         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00827}00827 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00828}00828 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00829}00829 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00830}00830 \textcolor{comment}{ * Get the port VLAN configuration.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00831}00831 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00832}00832 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00833}\mbox{\hyperlink{arswitch__8327_8c_ad9645cc984967474d168750390d61f2b}{00833}} \mbox{\hyperlink{arswitch__8327_8c_ad9645cc984967474d168750390d61f2b}{ar8327\_port\_vlan\_get}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc, \mbox{\hyperlink{structetherswitch__port}{etherswitch\_port\_t}} *p)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00834}00834 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00835}00835 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00836}00836         \mbox{\hyperlink{arswitchvar_8h_ac08400399758baa649e223dd369aa3cc}{ARSWITCH\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00837}00837 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00838}00838         \textcolor{comment}{/* Retrieve the PVID */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00839}00839         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_adf986d1fe6c58719877452cb0692a5d3}{arswitch\_vlan\_get\_pvid}}(sc, p-\/>\mbox{\hyperlink{structetherswitch__port_ad4603ef02270446668fc59d201aa2e59}{es\_port}}, \&p-\/>\mbox{\hyperlink{structetherswitch__port_ad8e2bebae64001c4f840310f6271f853}{es\_pvid}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00840}00840 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00841}00841         \textcolor{comment}{/* Retrieve the current port configuration from the VTU */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00842}00842         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00843}00843 \textcolor{comment}{         * DOUBLE\_TAG}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00844}00844 \textcolor{comment}{         * VLAN\_MODE\_ADD}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00845}00845 \textcolor{comment}{         * VLAN\_MODE\_STRIP}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00846}00846 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00847}00847 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00848}00848         \mbox{\hyperlink{arswitchvar_8h_a946c613ba31a000a1e32396435b4f55b}{ARSWITCH\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00849}00849         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00850}00850 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00851}00851 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00852}00852 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00853}\mbox{\hyperlink{arswitch__8327_8c_a5f8c29026b5fdb1f64f5345c3ff01e3b}{00853}} \mbox{\hyperlink{arswitch__8327_8c_a5f8c29026b5fdb1f64f5345c3ff01e3b}{ar8327\_port\_disable\_mirror}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc, \textcolor{keywordtype}{int} \mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00854}00854 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00855}00855 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00856}00856         \mbox{\hyperlink{arswitch__reg_8c_a0080a381b2a2a40990ae6da23b1a337c}{arswitch\_modifyreg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00857}00857             \mbox{\hyperlink{arswitchreg_8h_ae4570c95d17cee3ed6388bfd2ce899c6}{AR8327\_REG\_PORT\_LOOKUP}}(\mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00858}00858             \mbox{\hyperlink{arswitchreg_8h_a06b7e66f54c9465b9740cb37598c84aa}{AR8327\_PORT\_LOOKUP\_ING\_MIRROR\_EN}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00859}00859             0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00860}00860         \mbox{\hyperlink{arswitch__reg_8c_a0080a381b2a2a40990ae6da23b1a337c}{arswitch\_modifyreg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00861}00861             \mbox{\hyperlink{arswitchreg_8h_adf5d7a56c4665fe4bb009344369582e8}{AR8327\_REG\_PORT\_HOL\_CTRL1}}(\mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00862}00862             \mbox{\hyperlink{arswitchreg_8h_a7be2bcd519a488eba51b76602d57cdd6}{AR8327\_PORT\_HOL\_CTRL1\_EG\_MIRROR\_EN}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00863}00863             0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00864}00864 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00865}00865 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00866}00866 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00867}\mbox{\hyperlink{arswitch__8327_8c_ac114d0ca6ddaeb954ec958fdadfff61d}{00867}} \mbox{\hyperlink{arswitch__8327_8c_ac114d0ca6ddaeb954ec958fdadfff61d}{ar8327\_reset\_vlans}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00868}00868 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00869}00869         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00870}00870         uint32\_t t;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00871}00871         \textcolor{keywordtype}{int} ports;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00872}00872 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00873}00873         \mbox{\hyperlink{arswitchvar_8h_a74ca3c42d23651042ca1eb048d52d6c2}{ARSWITCH\_LOCK\_ASSERT}}(sc, MA\_NOTOWNED);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00874}00874         \mbox{\hyperlink{arswitchvar_8h_ac08400399758baa649e223dd369aa3cc}{ARSWITCH\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00875}00875 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00876}00876         \textcolor{comment}{/* Clear the existing VLAN configuration */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00877}00877         memset(sc-\/>\mbox{\hyperlink{structarswitch__softc_a8fe171544b011686cddb63f0370d43b9}{vid}}, 0, \textcolor{keyword}{sizeof}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a8fe171544b011686cddb63f0370d43b9}{vid}}));}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00878}00878 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00879}00879         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00880}00880 \textcolor{comment}{         * Disable mirroring.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00881}00881 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00882}00882         \mbox{\hyperlink{arswitch__reg_8c_a0080a381b2a2a40990ae6da23b1a337c}{arswitch\_modifyreg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_ac4842d9d99f516b8ace5c2d74d8cd374}{AR8327\_REG\_FWD\_CTRL0}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00883}00883             \mbox{\hyperlink{arswitchreg_8h_a71c6353e385e09be46c3607d2fc62c00}{AR8327\_FWD\_CTRL0\_MIRROR\_PORT}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00884}00884             (0xF << \mbox{\hyperlink{arswitchreg_8h_a17f9a096118c6938105acf281eb36bab}{AR8327\_FWD\_CTRL0\_MIRROR\_PORT\_S}}));}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00885}00885 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00886}00886         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00887}00887 \textcolor{comment}{         * XXX TODO: disable any Q-\/in-\/Q port configuration,}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00888}00888 \textcolor{comment}{         * tagging, egress filters, etc.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00889}00889 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00890}00890 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00891}00891         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00892}00892 \textcolor{comment}{         * For now, let's default to one portgroup, just so traffic}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00893}00893 \textcolor{comment}{         * flows.  All ports can see other ports. There are two CPU GMACs}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00894}00894 \textcolor{comment}{         * (GMAC0, GMAC6), GMAC1..GMAC5 are external PHYs.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00895}00895 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00896}00896 \textcolor{comment}{         * (ETHERSWITCH\_VLAN\_PORT)}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00897}00897 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00898}00898         ports = 0x7f;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00899}00899 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00900}00900         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00901}00901 \textcolor{comment}{         * XXX TODO: set things up correctly for vlans!}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00902}00902 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00903}00903         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{arswitchreg_8h_a80a057cf37c980305fd18b927f2aff3b}{AR8327\_NUM\_PORTS}}; i++) \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00904}00904                 \textcolor{keywordtype}{int} egress, ingress;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00905}00905 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00906}00906                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structarswitch__softc_ae91af1c86ec749e8b1d59cf64b61cb59}{vlan\_mode}} == \mbox{\hyperlink{etherswitch_8h_accc20f8e411463758872d4ec9091a5f5}{ETHERSWITCH\_VLAN\_PORT}}) \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00907}00907                         sc-\/>\mbox{\hyperlink{structarswitch__softc_a8fe171544b011686cddb63f0370d43b9}{vid}}[i] = i | \mbox{\hyperlink{etherswitch_8h_a244a2658d933715e6218b6ad5ec60c0c}{ETHERSWITCH\_VID\_VALID}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00908}00908                         \textcolor{comment}{/* set egress == out\_keep */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00909}00909                         ingress = \mbox{\hyperlink{arswitchreg_8h_aac650df22bbfbf1fe6b8b8fbb542a309}{AR8X16\_PORT\_VLAN\_MODE\_PORT\_ONLY}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00910}00910                         \textcolor{comment}{/* in\_port\_only, forward */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00911}00911                         egress = \mbox{\hyperlink{arswitchreg_8h_ae661f8af71dc1f63d89bd27734a150f7}{AR8327\_PORT\_VLAN1\_OUT\_MODE\_UNTOUCH}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00912}00912                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structarswitch__softc_ae91af1c86ec749e8b1d59cf64b61cb59}{vlan\_mode}} == \mbox{\hyperlink{etherswitch_8h_ac5660b1c91229fa16f6348ea693575db}{ETHERSWITCH\_VLAN\_DOT1Q}}) \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00913}00913                         ingress = \mbox{\hyperlink{arswitchreg_8h_a092d9d4396dc90c93b8a15360b3ad4de}{AR8X16\_PORT\_VLAN\_MODE\_SECURE}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00914}00914                         egress = \mbox{\hyperlink{arswitchreg_8h_ac3310fa10ec67e0729ae6f159794edc5}{AR8327\_PORT\_VLAN1\_OUT\_MODE\_UNMOD}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00915}00915                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00916}00916                         \textcolor{comment}{/* set egress == out\_keep */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00917}00917                         ingress = \mbox{\hyperlink{arswitchreg_8h_aac650df22bbfbf1fe6b8b8fbb542a309}{AR8X16\_PORT\_VLAN\_MODE\_PORT\_ONLY}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00918}00918                         \textcolor{comment}{/* in\_port\_only, forward */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00919}00919                         egress = \mbox{\hyperlink{arswitchreg_8h_ae661f8af71dc1f63d89bd27734a150f7}{AR8327\_PORT\_VLAN1\_OUT\_MODE\_UNTOUCH}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00920}00920                 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00921}00921 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00922}00922                 \textcolor{comment}{/* set pvid = 1; there's only one vlangroup to start with */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00923}00923                 t = 1 << \mbox{\hyperlink{arswitchreg_8h_a7e435c04818ea78947e8071ca1b4ed64}{AR8327\_PORT\_VLAN0\_DEF\_SVID\_S}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00924}00924                 t |= 1 << \mbox{\hyperlink{arswitchreg_8h_a2333e8b74b963f74ff7bd89ee5c94c58}{AR8327\_PORT\_VLAN0\_DEF\_CVID\_S}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00925}00925                 \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a8efc8620a7ef8b21ac945be5f4ce1fc5}{AR8327\_REG\_PORT\_VLAN0}}(i), t);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00926}00926 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00927}00927                 t = \mbox{\hyperlink{arswitchreg_8h_abbaf974329c217e5112d41d95ccd36dc}{AR8327\_PORT\_VLAN1\_PORT\_VLAN\_PROP}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00928}00928                 t |= egress << \mbox{\hyperlink{arswitchreg_8h_a3734fd2e3d1e5e3bbc8cf9966f047ee6}{AR8327\_PORT\_VLAN1\_OUT\_MODE\_S}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00929}00929                 \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a785c11a60e164c599cfdbbf449ae1ab5}{AR8327\_REG\_PORT\_VLAN1}}(i), t);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00930}00930 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00931}00931                 \textcolor{comment}{/* Ports can see other ports */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00932}00932                 \textcolor{comment}{/* XXX not entirely true for dot1q? */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00933}00933                 t = (ports \& \string~(1 << i));        \textcolor{comment}{/* all ports besides us */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00934}00934                 t |= \mbox{\hyperlink{arswitchreg_8h_a9aba09eca3dbcb2980a0a460d1f5e428}{AR8327\_PORT\_LOOKUP\_LEARN}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00935}00935 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00936}00936                 t |= ingress << \mbox{\hyperlink{arswitchreg_8h_a158cc26b97f6acee98bb7575c76c43aa}{AR8327\_PORT\_LOOKUP\_IN\_MODE\_S}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00937}00937                 t |= \mbox{\hyperlink{arswitchreg_8h_abfe19404cf24b3f016de4328e7c50b62}{AR8X16\_PORT\_CTRL\_STATE\_FORWARD}} << \mbox{\hyperlink{arswitchreg_8h_a0598b11897adfe901b97cf2ecaa0f6af}{AR8327\_PORT\_LOOKUP\_STATE\_S}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00938}00938                 \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_ae4570c95d17cee3ed6388bfd2ce899c6}{AR8327\_REG\_PORT\_LOOKUP}}(i), t);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00939}00939         \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00940}00940 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00941}00941         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00942}00942 \textcolor{comment}{         * Disable port mirroring entirely.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00943}00943 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00944}00944         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{arswitchreg_8h_a80a057cf37c980305fd18b927f2aff3b}{AR8327\_NUM\_PORTS}}; i++) \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00945}00945                 \mbox{\hyperlink{arswitch__8327_8c_a5f8c29026b5fdb1f64f5345c3ff01e3b}{ar8327\_port\_disable\_mirror}}(sc, i);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00946}00946         \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00947}00947 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00948}00948         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00949}00949 \textcolor{comment}{         * If dot1q -\/ set pvid; dot1q, etc.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00950}00950 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00951}00951         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structarswitch__softc_ae91af1c86ec749e8b1d59cf64b61cb59}{vlan\_mode}} == \mbox{\hyperlink{etherswitch_8h_ac5660b1c91229fa16f6348ea693575db}{ETHERSWITCH\_VLAN\_DOT1Q}}) \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00952}00952                 sc-\/>\mbox{\hyperlink{structarswitch__softc_a8fe171544b011686cddb63f0370d43b9}{vid}}[0] = 1;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00953}00953                 \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{arswitchreg_8h_a80a057cf37c980305fd18b927f2aff3b}{AR8327\_NUM\_PORTS}}; i++) \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00954}00954                         \textcolor{comment}{/* Each port -\/ pvid 1 */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00955}00955                         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_aad21ed71d52d9fe3bde6c59304a681a8}{arswitch\_vlan\_set\_pvid}}(sc, i, sc-\/>\mbox{\hyperlink{structarswitch__softc_a8fe171544b011686cddb63f0370d43b9}{vid}}[0]);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00956}00956                 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00957}00957                 \textcolor{comment}{/* Initialise vlan1 -\/ all ports, untagged */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00958}00958                 sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_a84007c4ba055dc7106bcb4981f6f3926}{arswitch\_set\_dot1q\_vlan}}(sc, ports, ports, sc-\/>\mbox{\hyperlink{structarswitch__softc_a8fe171544b011686cddb63f0370d43b9}{vid}}[0]);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00959}00959                 sc-\/>\mbox{\hyperlink{structarswitch__softc_a8fe171544b011686cddb63f0370d43b9}{vid}}[0] |= \mbox{\hyperlink{etherswitch_8h_a244a2658d933715e6218b6ad5ec60c0c}{ETHERSWITCH\_VID\_VALID}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00960}00960         \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00961}00961 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00962}00962         \mbox{\hyperlink{arswitchvar_8h_a946c613ba31a000a1e32396435b4f55b}{ARSWITCH\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00963}00963 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00964}00964 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00965}00965 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00966}\mbox{\hyperlink{arswitch__8327_8c_a786a6c7ff3b3b61e39f562d7fcfaaf72}{00966}} \mbox{\hyperlink{arswitch__8327_8c_a786a6c7ff3b3b61e39f562d7fcfaaf72}{ar8327\_vlan\_get\_port}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc, uint32\_t *ports, \textcolor{keywordtype}{int} vid)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00967}00967 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00968}00968         \textcolor{keywordtype}{int} \mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00969}00969         uint32\_t \mbox{\hyperlink{etherswitch__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00970}00970 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00971}00971         \mbox{\hyperlink{arswitchvar_8h_a74ca3c42d23651042ca1eb048d52d6c2}{ARSWITCH\_LOCK\_ASSERT}}(sc, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00972}00972 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00973}00973         \textcolor{comment}{/* For port based vlans the vlanid is the same as the port index. */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00974}00974         \mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}} = vid \& \mbox{\hyperlink{etherswitch_8h_a955b99230ed787eb98892659921b5420}{ETHERSWITCH\_VID\_MASK}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00975}00975         \mbox{\hyperlink{etherswitch__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}} = \mbox{\hyperlink{arswitch__reg_8c_a032a26bfd0728d9e080f65aedaf8b6a0}{arswitch\_readreg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_ae4570c95d17cee3ed6388bfd2ce899c6}{AR8327\_REG\_PORT\_LOOKUP}}(\mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}}));}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00976}00976         *ports = \mbox{\hyperlink{etherswitch__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}} \& 0x7f;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00977}00977         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00978}00978 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00979}00979 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00980}00980 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00981}\mbox{\hyperlink{arswitch__8327_8c_aeddd4d494e838349bbd7eb15c5c0d495}{00981}} \mbox{\hyperlink{arswitch__8327_8c_aeddd4d494e838349bbd7eb15c5c0d495}{ar8327\_vlan\_set\_port}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc, uint32\_t ports, \textcolor{keywordtype}{int} vid)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00982}00982 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00983}00983         \textcolor{keywordtype}{int} err, \mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00984}00984 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00985}00985         \mbox{\hyperlink{arswitchvar_8h_a74ca3c42d23651042ca1eb048d52d6c2}{ARSWITCH\_LOCK\_ASSERT}}(sc, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00986}00986 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00987}00987         \textcolor{comment}{/* For port based vlans the vlanid is the same as the port index. */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00988}00988         \mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}} = vid \& \mbox{\hyperlink{etherswitch_8h_a955b99230ed787eb98892659921b5420}{ETHERSWITCH\_VID\_MASK}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00989}00989 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00990}00990         err = \mbox{\hyperlink{arswitch__reg_8c_a0080a381b2a2a40990ae6da23b1a337c}{arswitch\_modifyreg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_ae4570c95d17cee3ed6388bfd2ce899c6}{AR8327\_REG\_PORT\_LOOKUP}}(\mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}}),}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00991}00991             0x7f, \textcolor{comment}{/* vlan membership mask */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00992}00992             (ports \& 0x7f));}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00993}00993 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00994}00994         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00995}00995                 \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00996}00996         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00997}00997 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00998}00998 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l00999}00999 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01000}\mbox{\hyperlink{arswitch__8327_8c_a1988d82408cf730ab1676b54a14f9e73}{01000}} \mbox{\hyperlink{arswitch__8327_8c_a1988d82408cf730ab1676b54a14f9e73}{ar8327\_vlan\_getvgroup}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc, \mbox{\hyperlink{structetherswitch__vlangroup}{etherswitch\_vlangroup\_t}} *\mbox{\hyperlink{etherswitch__if_8m_a915ae4f6bd598a9d7649052ef4ce69f6}{vg}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01001}01001 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01002}01002 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01003}01003         \textcolor{keywordflow}{return} (\mbox{\hyperlink{arswitch__vlans_8c_ac42a8f3d7c478d2068f7a2dca7de86ae}{ar8xxx\_getvgroup}}(sc, \mbox{\hyperlink{etherswitch__if_8m_a915ae4f6bd598a9d7649052ef4ce69f6}{vg}}));}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01004}01004 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01005}01005 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01006}01006 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01007}\mbox{\hyperlink{arswitch__8327_8c_a6238d85b7865eb9e9b3ff2a689f15be4}{01007}} \mbox{\hyperlink{arswitch__8327_8c_a6238d85b7865eb9e9b3ff2a689f15be4}{ar8327\_vlan\_setvgroup}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc, \mbox{\hyperlink{structetherswitch__vlangroup}{etherswitch\_vlangroup\_t}} *\mbox{\hyperlink{etherswitch__if_8m_a915ae4f6bd598a9d7649052ef4ce69f6}{vg}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01008}01008 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01009}01009 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01010}01010         \textcolor{keywordflow}{return} (\mbox{\hyperlink{arswitch__vlans_8c_a32f97be436a195616d85d455994f8b05}{ar8xxx\_setvgroup}}(sc, \mbox{\hyperlink{etherswitch__if_8m_a915ae4f6bd598a9d7649052ef4ce69f6}{vg}}));}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01011}01011 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01012}01012 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01013}01013 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01014}\mbox{\hyperlink{arswitch__8327_8c_a37cf07c4385c696e9e399645c1dcd34e}{01014}} \mbox{\hyperlink{arswitch__8327_8c_a37cf07c4385c696e9e399645c1dcd34e}{ar8327\_get\_pvid}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc, \textcolor{keywordtype}{int} \mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}}, \textcolor{keywordtype}{int} *pvid)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01015}01015 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01016}01016         uint32\_t \mbox{\hyperlink{etherswitch__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01017}01017 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01018}01018         \mbox{\hyperlink{arswitchvar_8h_a74ca3c42d23651042ca1eb048d52d6c2}{ARSWITCH\_LOCK\_ASSERT}}(sc, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01019}01019 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01020}01020         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01021}01021 \textcolor{comment}{         * XXX for now, assuming it's CVID; likely very wrong!}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01022}01022 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01023}01023         \mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}} = \mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}} \& \mbox{\hyperlink{etherswitch_8h_a955b99230ed787eb98892659921b5420}{ETHERSWITCH\_VID\_MASK}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01024}01024         \mbox{\hyperlink{etherswitch__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}} = \mbox{\hyperlink{arswitch__reg_8c_a032a26bfd0728d9e080f65aedaf8b6a0}{arswitch\_readreg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a8efc8620a7ef8b21ac945be5f4ce1fc5}{AR8327\_REG\_PORT\_VLAN0}}(\mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}}));}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01025}01025         \mbox{\hyperlink{etherswitch__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}} = \mbox{\hyperlink{etherswitch__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}} >> \mbox{\hyperlink{arswitchreg_8h_a2333e8b74b963f74ff7bd89ee5c94c58}{AR8327\_PORT\_VLAN0\_DEF\_CVID\_S}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01026}01026         \mbox{\hyperlink{etherswitch__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}} = \mbox{\hyperlink{etherswitch__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}} \& 0xfff;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01027}01027 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01028}01028         *pvid = \mbox{\hyperlink{etherswitch__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01029}01029         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01030}01030 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01031}01031 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01032}01032 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01033}\mbox{\hyperlink{arswitch__8327_8c_a0f9e19c89d443d833d7d689363c8ef0c}{01033}} \mbox{\hyperlink{arswitch__8327_8c_a0f9e19c89d443d833d7d689363c8ef0c}{ar8327\_set\_pvid}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc, \textcolor{keywordtype}{int} \mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}}, \textcolor{keywordtype}{int} pvid)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01034}01034 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01035}01035         uint32\_t t;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01036}01036 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01037}01037         \textcolor{comment}{/* Limit pvid to valid values */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01038}01038         pvid \&= 0x7f;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01039}01039 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01040}01040         t = pvid << \mbox{\hyperlink{arswitchreg_8h_a7e435c04818ea78947e8071ca1b4ed64}{AR8327\_PORT\_VLAN0\_DEF\_SVID\_S}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01041}01041         t |= pvid << \mbox{\hyperlink{arswitchreg_8h_a2333e8b74b963f74ff7bd89ee5c94c58}{AR8327\_PORT\_VLAN0\_DEF\_CVID\_S}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01042}01042         \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a8efc8620a7ef8b21ac945be5f4ce1fc5}{AR8327\_REG\_PORT\_VLAN0}}(\mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}}), t);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01043}01043 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01044}01044         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01045}01045 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01046}01046 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01047}01047 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01048}\mbox{\hyperlink{arswitch__8327_8c_a9e142f85d7d1073530460e9b64a6981a}{01048}} \mbox{\hyperlink{arswitch__8327_8c_a9e142f85d7d1073530460e9b64a6981a}{ar8327\_atu\_wait\_ready}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01049}01049 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01050}01050         \textcolor{keywordtype}{int} ret;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01051}01051 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01052}01052         ret = \mbox{\hyperlink{arswitch__reg_8c_a9bd3bea1712ebe40f7f86480412f3f70}{arswitch\_waitreg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01053}01053             \mbox{\hyperlink{arswitchreg_8h_a41c4153584fcf5c4cd21e7bd80e41916}{AR8327\_REG\_ATU\_FUNC}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01054}01054             \mbox{\hyperlink{arswitchreg_8h_ab34aec2f0b7d9169d4fb64a383ccece8}{AR8327\_ATU\_FUNC\_BUSY}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01055}01055             0,}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01056}01056             1000);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01057}01057 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01058}01058         \textcolor{keywordflow}{return} (ret);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01059}01059 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01060}01060 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01061}01061 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01062}\mbox{\hyperlink{arswitch__8327_8c_a62a3fbe84e4a7f2b76eaa6e3aee0f834}{01062}} \mbox{\hyperlink{arswitch__8327_8c_a62a3fbe84e4a7f2b76eaa6e3aee0f834}{ar8327\_atu\_flush}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01063}01063 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01064}01064 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01065}01065         \textcolor{keywordtype}{int} ret;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01066}01066 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01067}01067         \mbox{\hyperlink{arswitchvar_8h_a74ca3c42d23651042ca1eb048d52d6c2}{ARSWITCH\_LOCK\_ASSERT}}(sc, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01068}01068 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01069}01069         ret = \mbox{\hyperlink{arswitch__8327_8c_a9e142f85d7d1073530460e9b64a6981a}{ar8327\_atu\_wait\_ready}}(sc);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01070}01070         \textcolor{keywordflow}{if} (ret)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01071}01071                 device\_printf(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \textcolor{stringliteral}{"{}\%s: waitreg failed\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01072}01072 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01073}01073         \textcolor{keywordflow}{if} (!ret)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01074}01074                 \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01075}01075                     \mbox{\hyperlink{arswitchreg_8h_a41c4153584fcf5c4cd21e7bd80e41916}{AR8327\_REG\_ATU\_FUNC}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01076}01076                     \mbox{\hyperlink{arswitchreg_8h_a74c9b96030c65a564daaa8b8705ac4bf}{AR8327\_ATU\_FUNC\_OP\_FLUSH}} | \mbox{\hyperlink{arswitchreg_8h_ab34aec2f0b7d9169d4fb64a383ccece8}{AR8327\_ATU\_FUNC\_BUSY}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01077}01077         \textcolor{keywordflow}{return} (ret);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01078}01078 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01079}01079 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01080}01080 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01081}\mbox{\hyperlink{arswitch__8327_8c_a71f2bd0a89ed39fd62bb51aea7a324b9}{01081}} \mbox{\hyperlink{arswitch__8327_8c_a71f2bd0a89ed39fd62bb51aea7a324b9}{ar8327\_atu\_flush\_port}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc, \textcolor{keywordtype}{int} \mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}})}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01082}01082 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01083}01083         \textcolor{keywordtype}{int} ret;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01084}01084         uint32\_t val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01085}01085 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01086}01086         \mbox{\hyperlink{arswitchvar_8h_a74ca3c42d23651042ca1eb048d52d6c2}{ARSWITCH\_LOCK\_ASSERT}}(sc, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01087}01087 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01088}01088         ret = \mbox{\hyperlink{arswitch__8327_8c_a9e142f85d7d1073530460e9b64a6981a}{ar8327\_atu\_wait\_ready}}(sc);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01089}01089         \textcolor{keywordflow}{if} (ret)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01090}01090                 device\_printf(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \textcolor{stringliteral}{"{}\%s: waitreg failed\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01091}01091 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01092}01092         val = \mbox{\hyperlink{arswitchreg_8h_ad56d9d69a93d63bf45ea8bf58ca824fd}{AR8327\_ATU\_FUNC\_OP\_FLUSH\_UNICAST}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01093}01093         val |= \mbox{\hyperlink{ar40xx__reg_8h_a3219d5c091f63b52ee0ceba3969ba8c1}{SM}}(\mbox{\hyperlink{etherswitch__if_8m_a63c89c04d1feae07ca35558055155ffb}{port}}, \mbox{\hyperlink{arswitchreg_8h_a43cb48833f31e43c0362aac7adfde2ac}{AR8327\_ATU\_FUNC\_PORT\_NUM}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01094}01094 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01095}01095         \textcolor{keywordflow}{if} (!ret)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01096}01096                 \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01097}01097                     \mbox{\hyperlink{arswitchreg_8h_a41c4153584fcf5c4cd21e7bd80e41916}{AR8327\_REG\_ATU\_FUNC}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01098}01098                     val | \mbox{\hyperlink{arswitchreg_8h_ab34aec2f0b7d9169d4fb64a383ccece8}{AR8327\_ATU\_FUNC\_BUSY}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01099}01099 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01100}01100         \textcolor{keywordflow}{return} (ret);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01101}01101 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01102}01102 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01103}01103 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01104}01104 \textcolor{comment}{ * Fetch a single entry from the ATU.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01105}01105 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01106}01106 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01107}\mbox{\hyperlink{arswitch__8327_8c_a064ef436fdf62b8a57f374700906632e}{01107}} \mbox{\hyperlink{arswitch__8327_8c_a064ef436fdf62b8a57f374700906632e}{ar8327\_atu\_fetch\_table}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc, \mbox{\hyperlink{structetherswitch__atu__entry}{etherswitch\_atu\_entry\_t}} *e,}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01108}01108     \textcolor{keywordtype}{int} atu\_fetch\_op)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01109}01109 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01110}01110         uint32\_t ret0, ret1, ret2, val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01111}01111 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01112}01112         \mbox{\hyperlink{arswitchvar_8h_a74ca3c42d23651042ca1eb048d52d6c2}{ARSWITCH\_LOCK\_ASSERT}}(sc, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01113}01113 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01114}01114         \textcolor{keywordflow}{switch} (atu\_fetch\_op) \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01115}01115         \textcolor{keywordflow}{case} 0:}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01116}01116                 \textcolor{comment}{/* Initialise things for the first fetch */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01117}01117 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01118}01118                 \mbox{\hyperlink{arswitchvar_8h_abdc2f40de12a2aa619e6366e0039832d}{DPRINTF}}(sc, \mbox{\hyperlink{arswitchvar_8h_af3f948cb2e0c3fd4791a85521d08ed2b}{ARSWITCH\_DBG\_ATU}}, \textcolor{stringliteral}{"{}\%s: initializing\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01119}01119                 (void) \mbox{\hyperlink{arswitch__8327_8c_a9e142f85d7d1073530460e9b64a6981a}{ar8327\_atu\_wait\_ready}}(sc);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01120}01120 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01121}01121                 \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01122}01122                     \mbox{\hyperlink{arswitchreg_8h_a41c4153584fcf5c4cd21e7bd80e41916}{AR8327\_REG\_ATU\_FUNC}}, \mbox{\hyperlink{arswitchreg_8h_a6523a0c25b98987fe399a3bb92eb233d}{AR8327\_ATU\_FUNC\_OP\_GET\_NEXT}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01123}01123                 \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a59cebe97738cd952e57b753d94d95ca7}{AR8327\_REG\_ATU\_DATA0}}, 0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01124}01124                 \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a8fe59ea1bed1224f0a79fc0f2b8bf6f3}{AR8327\_REG\_ATU\_DATA1}}, 0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01125}01125                 \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a14d7d7384948c567e4374a7975a1c5c8}{AR8327\_REG\_ATU\_DATA2}}, 0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01126}01126 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01127}01127                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01128}01128         \textcolor{keywordflow}{case} 1:}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01129}01129                 \mbox{\hyperlink{arswitchvar_8h_abdc2f40de12a2aa619e6366e0039832d}{DPRINTF}}(sc, \mbox{\hyperlink{arswitchvar_8h_af3f948cb2e0c3fd4791a85521d08ed2b}{ARSWITCH\_DBG\_ATU}}, \textcolor{stringliteral}{"{}\%s: reading next\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01130}01130                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01131}01131 \textcolor{comment}{                 * Attempt to read the next address entry; don't modify what}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01132}01132 \textcolor{comment}{                 * is there in these registers as its used for the next fetch}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01133}01133 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01134}01134                 (void) \mbox{\hyperlink{arswitch__8327_8c_a9e142f85d7d1073530460e9b64a6981a}{ar8327\_atu\_wait\_ready}}(sc);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01135}01135 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01136}01136                 \textcolor{comment}{/* Begin the next read event; not modifying anything */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01137}01137                 val = \mbox{\hyperlink{arswitch__reg_8c_a032a26bfd0728d9e080f65aedaf8b6a0}{arswitch\_readreg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a41c4153584fcf5c4cd21e7bd80e41916}{AR8327\_REG\_ATU\_FUNC}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01138}01138                 val |= \mbox{\hyperlink{arswitchreg_8h_ab34aec2f0b7d9169d4fb64a383ccece8}{AR8327\_ATU\_FUNC\_BUSY}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01139}01139                 \mbox{\hyperlink{arswitch__reg_8c_a9425ce0fc426ca95431a54cdf02b4921}{arswitch\_writereg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a41c4153584fcf5c4cd21e7bd80e41916}{AR8327\_REG\_ATU\_FUNC}}, val);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01140}01140 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01141}01141                 \textcolor{comment}{/* Wait for it to complete */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01142}01142                 (void) \mbox{\hyperlink{arswitch__8327_8c_a9e142f85d7d1073530460e9b64a6981a}{ar8327\_atu\_wait\_ready}}(sc);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01143}01143 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01144}01144                 \textcolor{comment}{/* Fetch the ethernet address and ATU status */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01145}01145                 ret0 = \mbox{\hyperlink{arswitch__reg_8c_a032a26bfd0728d9e080f65aedaf8b6a0}{arswitch\_readreg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a59cebe97738cd952e57b753d94d95ca7}{AR8327\_REG\_ATU\_DATA0}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01146}01146                 ret1 = \mbox{\hyperlink{arswitch__reg_8c_a032a26bfd0728d9e080f65aedaf8b6a0}{arswitch\_readreg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a8fe59ea1bed1224f0a79fc0f2b8bf6f3}{AR8327\_REG\_ATU\_DATA1}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01147}01147                 ret2 = \mbox{\hyperlink{arswitch__reg_8c_a032a26bfd0728d9e080f65aedaf8b6a0}{arswitch\_readreg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a14d7d7384948c567e4374a7975a1c5c8}{AR8327\_REG\_ATU\_DATA2}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01148}01148 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01149}01149                 \textcolor{comment}{/* If the status is zero, then we're done */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01150}01150                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{ar40xx__reg_8h_a3cb92725e12650d7447b06c9db39aac9}{MS}}(ret2, \mbox{\hyperlink{arswitchreg_8h_a4d4c8ac760b781680ad83a729fe052a3}{AR8327\_ATU\_FUNC\_DATA2\_STATUS}}) == 0)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01151}01151                         \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01152}01152 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01153}01153                 \textcolor{comment}{/* MAC address */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01154}01154                 e-\/>\mbox{\hyperlink{structetherswitch__atu__entry_a6f27016f34b24d0861c1d6e5cb58f24f}{es\_macaddr}}[5] = \mbox{\hyperlink{ar40xx__reg_8h_a3cb92725e12650d7447b06c9db39aac9}{MS}}(ret0, \mbox{\hyperlink{arswitchreg_8h_a73763d5456e1561baa8885b9e4766b43}{AR8327\_ATU\_DATA0\_MAC\_ADDR3}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01155}01155                 e-\/>\mbox{\hyperlink{structetherswitch__atu__entry_a6f27016f34b24d0861c1d6e5cb58f24f}{es\_macaddr}}[4] = \mbox{\hyperlink{ar40xx__reg_8h_a3cb92725e12650d7447b06c9db39aac9}{MS}}(ret0, \mbox{\hyperlink{arswitchreg_8h_af5ee15da03b75e885ed110e249346f59}{AR8327\_ATU\_DATA0\_MAC\_ADDR2}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01156}01156                 e-\/>\mbox{\hyperlink{structetherswitch__atu__entry_a6f27016f34b24d0861c1d6e5cb58f24f}{es\_macaddr}}[3] = \mbox{\hyperlink{ar40xx__reg_8h_a3cb92725e12650d7447b06c9db39aac9}{MS}}(ret0, \mbox{\hyperlink{arswitchreg_8h_a11c5711aea8c5b97222fd50116d86662}{AR8327\_ATU\_DATA0\_MAC\_ADDR1}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01157}01157                 e-\/>\mbox{\hyperlink{structetherswitch__atu__entry_a6f27016f34b24d0861c1d6e5cb58f24f}{es\_macaddr}}[2] = \mbox{\hyperlink{ar40xx__reg_8h_a3cb92725e12650d7447b06c9db39aac9}{MS}}(ret0, \mbox{\hyperlink{arswitchreg_8h_a3a7f81485a6341455e7e7ca0525f6da3}{AR8327\_ATU\_DATA0\_MAC\_ADDR0}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01158}01158                 e-\/>\mbox{\hyperlink{structetherswitch__atu__entry_a6f27016f34b24d0861c1d6e5cb58f24f}{es\_macaddr}}[0] = \mbox{\hyperlink{ar40xx__reg_8h_a3cb92725e12650d7447b06c9db39aac9}{MS}}(ret1, \mbox{\hyperlink{arswitchreg_8h_a51e2c9133fd930b2a7a1733006d39872}{AR8327\_ATU\_DATA1\_MAC\_ADDR5}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01159}01159                 e-\/>\mbox{\hyperlink{structetherswitch__atu__entry_a6f27016f34b24d0861c1d6e5cb58f24f}{es\_macaddr}}[1] = \mbox{\hyperlink{ar40xx__reg_8h_a3cb92725e12650d7447b06c9db39aac9}{MS}}(ret1, \mbox{\hyperlink{arswitchreg_8h_ae00afb11a45a2bfebb9cb0dce8cec3cc}{AR8327\_ATU\_DATA1\_MAC\_ADDR4}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01160}01160 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01161}01161                 \textcolor{comment}{/* Bitmask of ports this entry is for */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01162}01162                 e-\/>\mbox{\hyperlink{structetherswitch__atu__entry_a493f0ce4a4f7b2511dea11247d9a0631}{es\_portmask}} = \mbox{\hyperlink{ar40xx__reg_8h_a3cb92725e12650d7447b06c9db39aac9}{MS}}(ret1, \mbox{\hyperlink{arswitchreg_8h_ac532a76406dcc5a1a0f02bdf9e7e5836}{AR8327\_ATU\_DATA1\_DEST\_PORT}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01163}01163 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01164}01164                 \textcolor{comment}{/* TODO: other flags that are interesting */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01165}01165 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01166}01166                 \mbox{\hyperlink{arswitchvar_8h_abdc2f40de12a2aa619e6366e0039832d}{DPRINTF}}(sc, \mbox{\hyperlink{arswitchvar_8h_af3f948cb2e0c3fd4791a85521d08ed2b}{ARSWITCH\_DBG\_ATU}}, \textcolor{stringliteral}{"{}\%s: MAC \%6D portmask 0x\%08x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01167}01167                     \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01168}01168                     e-\/>\mbox{\hyperlink{structetherswitch__atu__entry_a6f27016f34b24d0861c1d6e5cb58f24f}{es\_macaddr}}, \textcolor{stringliteral}{"{}:"{}}, e-\/>\mbox{\hyperlink{structetherswitch__atu__entry_a493f0ce4a4f7b2511dea11247d9a0631}{es\_portmask}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01169}01169                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01170}01170         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01171}01171                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01172}01172         \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01173}01173         \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01174}01174 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01175}01175 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01176}\mbox{\hyperlink{arswitch__8327_8c_ad990757cec2e1adf2264db753972d349}{01176}} \mbox{\hyperlink{arswitch__8327_8c_ad990757cec2e1adf2264db753972d349}{ar8327\_flush\_dot1q\_vlan}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01177}01177 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01178}01178 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01179}01179         \textcolor{keywordflow}{return} (\mbox{\hyperlink{arswitch__8327_8c_a13ffd51b2d28fbb6c10fac4160025197}{ar8327\_vlan\_op}}(sc, \mbox{\hyperlink{arswitchreg_8h_ac8cbaf74edf9508be7ae7e8295eb4e82}{AR8327\_VTU\_FUNC1\_OP\_FLUSH}}, 0, 0));}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01180}01180 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01181}01181 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01182}01182 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01183}\mbox{\hyperlink{arswitch__8327_8c_ac4bb44c217f7dfe63fd3085991611e88}{01183}} \mbox{\hyperlink{arswitch__8327_8c_ac4bb44c217f7dfe63fd3085991611e88}{ar8327\_purge\_dot1q\_vlan}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc, \textcolor{keywordtype}{int} vid)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01184}01184 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01185}01185 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01186}01186         \textcolor{keywordflow}{return} (\mbox{\hyperlink{arswitch__8327_8c_a13ffd51b2d28fbb6c10fac4160025197}{ar8327\_vlan\_op}}(sc, \mbox{\hyperlink{arswitchreg_8h_a1f70faedb6e054f9da381f6c5d7a59fa}{AR8327\_VTU\_FUNC1\_OP\_PURGE}}, vid, 0));}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01187}01187 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01188}01188 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01189}01189 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01190}\mbox{\hyperlink{arswitch__8327_8c_a0a6d7593aa1b8c087c8028e2034e2d14}{01190}} \mbox{\hyperlink{arswitch__8327_8c_a0a6d7593aa1b8c087c8028e2034e2d14}{ar8327\_get\_dot1q\_vlan}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc, uint32\_t *ports,}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01191}01191     uint32\_t *untagged\_ports, \textcolor{keywordtype}{int} vid)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01192}01192 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01193}01193         \textcolor{keywordtype}{int} i, r;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01194}01194         uint32\_t op, \mbox{\hyperlink{etherswitch__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}}, val;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01195}01195 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01196}01196         op = \mbox{\hyperlink{arswitchreg_8h_a458fd974d2daa59dbf73216f99dec269}{AR8327\_VTU\_FUNC1\_OP\_GET\_ONE}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01197}01197 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01198}01198         \textcolor{comment}{/* Filter out the vid flags; only grab the VLAN ID */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01199}01199         vid \&= 0xfff;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01200}01200 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01201}01201         \textcolor{comment}{/* XXX TODO: the VTU here stores egress mode -\/ keep, tag, untagged, none */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01202}01202         r = \mbox{\hyperlink{arswitch__8327_8c_a13ffd51b2d28fbb6c10fac4160025197}{ar8327\_vlan\_op}}(sc, op, vid, 0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01203}01203         \textcolor{keywordflow}{if} (r != 0) \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01204}01204                 device\_printf(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \textcolor{stringliteral}{"{}\%s: \%d: op failed\(\backslash\)n"{}}, \_\_func\_\_, vid);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01205}01205         \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01206}01206 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01207}01207         \mbox{\hyperlink{etherswitch__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}} = \mbox{\hyperlink{arswitch__reg_8c_a032a26bfd0728d9e080f65aedaf8b6a0}{arswitch\_readreg}}(sc-\/>\mbox{\hyperlink{structarswitch__softc_a287b0e245004e2d65390e712a785452b}{sc\_dev}}, \mbox{\hyperlink{arswitchreg_8h_a3a85904694dbbed33ae690590683b44b}{AR8327\_REG\_VTU\_FUNC0}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01208}01208         \mbox{\hyperlink{arswitchvar_8h_abdc2f40de12a2aa619e6366e0039832d}{DPRINTF}}(sc, \mbox{\hyperlink{arswitchvar_8h_aedffb88ce75e76b0bb05e3b71794dcbf}{ARSWITCH\_DBG\_REGIO}}, \textcolor{stringliteral}{"{}\%s: \%d: reg=0x\%08x\(\backslash\)n"{}}, \_\_func\_\_, vid, \mbox{\hyperlink{etherswitch__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}});}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01209}01209 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01210}01210         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01211}01211 \textcolor{comment}{         * If any of the bits are set, update the port mask.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01212}01212 \textcolor{comment}{         * Worry about the port config itself when getport() is called.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01213}01213 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01214}01214         *ports = 0;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01215}01215         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{arswitchreg_8h_a80a057cf37c980305fd18b927f2aff3b}{AR8327\_NUM\_PORTS}}; i++) \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01216}01216                 val = \mbox{\hyperlink{etherswitch__if_8m_aa391927e06832c3d8d2f4e89a25cdd81}{reg}} >> \mbox{\hyperlink{arswitchreg_8h_a83137339575fa3bae63231ca8876e78e}{AR8327\_VTU\_FUNC0\_EG\_MODE\_S}}(i);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01217}01217                 val = val \& 0x3;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01218}01218                 \textcolor{comment}{/* XXX KEEP (unmodified?) */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01219}01219                 \textcolor{keywordflow}{if} (val == \mbox{\hyperlink{arswitchreg_8h_ad602ba05bcbda22b5011a0d182e32672}{AR8327\_VTU\_FUNC0\_EG\_MODE\_TAG}}) \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01220}01220                         *ports |= (1 << i);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01221}01221                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (val == \mbox{\hyperlink{arswitchreg_8h_a2897db281b2c6558cebe6a24841584bd}{AR8327\_VTU\_FUNC0\_EG\_MODE\_UNTAG}}) \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01222}01222                         *ports |= (1 << i);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01223}01223                         *untagged\_ports |= (1 << i);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01224}01224                 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01225}01225         \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01226}01226 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01227}01227         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01228}01228 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01229}01229 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01230}01230 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01231}\mbox{\hyperlink{arswitch__8327_8c_a9415bd41326065aa7dc5f0d2760fbb97}{01231}} \mbox{\hyperlink{arswitch__8327_8c_a9415bd41326065aa7dc5f0d2760fbb97}{ar8327\_set\_dot1q\_vlan}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc, uint32\_t ports,}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01232}01232     uint32\_t untagged\_ports, \textcolor{keywordtype}{int} vid)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01233}01233 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01234}01234         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01235}01235         uint32\_t op, val, mode;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01236}01236 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01237}01237         op = \mbox{\hyperlink{arswitchreg_8h_ad471a0d70087850c09062408276f809d}{AR8327\_VTU\_FUNC1\_OP\_LOAD}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01238}01238         vid \&= 0xfff;}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01239}01239 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01240}01240         \mbox{\hyperlink{arswitchvar_8h_abdc2f40de12a2aa619e6366e0039832d}{DPRINTF}}(sc, \mbox{\hyperlink{arswitchvar_8h_a002195b3125282a8f749711189a7fdcf}{ARSWITCH\_DBG\_VLAN}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01241}01241             \textcolor{stringliteral}{"{}\%s: vid: \%d, ports=0x\%08x, untagged\_ports=0x\%08x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01242}01242             \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01243}01243             vid,}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01244}01244             ports,}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01245}01245             untagged\_ports);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01246}01246 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01247}01247         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01248}01248 \textcolor{comment}{         * Mark it as valid; and that it should use per-\/VLAN MAC table,}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01249}01249 \textcolor{comment}{         * not VID=0 when doing MAC lookups}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01250}01250 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01251}01251         val = \mbox{\hyperlink{arswitchreg_8h_a7851331a8d83406c8b9d5c7aec7a2a18}{AR8327\_VTU\_FUNC0\_VALID}} | \mbox{\hyperlink{arswitchreg_8h_a973319e973149552816e2e9c153c8f8a}{AR8327\_VTU\_FUNC0\_IVL}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01252}01252 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01253}01253         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{arswitchreg_8h_a80a057cf37c980305fd18b927f2aff3b}{AR8327\_NUM\_PORTS}}; i++) \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01254}01254                 \textcolor{keywordflow}{if} ((ports \& \mbox{\hyperlink{ar40xx__reg_8h_a0516b617ff71641806a58031238ea5f4}{BIT}}(i)) == 0)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01255}01255                         mode = \mbox{\hyperlink{arswitchreg_8h_aab22959bcb5bda34f59e33bd934feab8}{AR8327\_VTU\_FUNC0\_EG\_MODE\_NOT}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01256}01256                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (untagged\_ports \& \mbox{\hyperlink{ar40xx__reg_8h_a0516b617ff71641806a58031238ea5f4}{BIT}}(i))}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01257}01257                         mode = \mbox{\hyperlink{arswitchreg_8h_a2897db281b2c6558cebe6a24841584bd}{AR8327\_VTU\_FUNC0\_EG\_MODE\_UNTAG}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01258}01258                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01259}01259                         mode = \mbox{\hyperlink{arswitchreg_8h_ad602ba05bcbda22b5011a0d182e32672}{AR8327\_VTU\_FUNC0\_EG\_MODE\_TAG}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01260}01260 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01261}01261                 val |= mode << \mbox{\hyperlink{arswitchreg_8h_a83137339575fa3bae63231ca8876e78e}{AR8327\_VTU\_FUNC0\_EG\_MODE\_S}}(i);}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01262}01262         \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01263}01263 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01264}01264         \textcolor{keywordflow}{return} (\mbox{\hyperlink{arswitch__8327_8c_a13ffd51b2d28fbb6c10fac4160025197}{ar8327\_vlan\_op}}(sc, op, vid, val));}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01265}01265 \}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01266}01266 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01267}01267 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01268}\mbox{\hyperlink{arswitch__8327_8c_ae2754b89b87f57933353e441ad86cdc7}{01268}} \mbox{\hyperlink{arswitch__8327_8c_ae2754b89b87f57933353e441ad86cdc7}{ar8327\_attach}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structarswitch__softc}{arswitch\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01269}01269 \{}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01270}01270 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01271}01271         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_a7ee7231b7c5538ba45846e2c6423e835}{arswitch\_hw\_setup}} = \mbox{\hyperlink{arswitch__8327_8c_a051ff682cf35680558184da52554d11f}{ar8327\_hw\_setup}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01272}01272         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_a19922538e0cf78f6f6c483dd7eba4ea1}{arswitch\_hw\_global\_setup}} = \mbox{\hyperlink{arswitch__8327_8c_aceb5f8a2697dff8b942c5d826919527a}{ar8327\_hw\_global\_setup}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01273}01273 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01274}01274         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_adc56fde90cd9a015b7bb9bd4ab9f6799}{arswitch\_port\_init}} = \mbox{\hyperlink{arswitch__8327_8c_ab8502b48d713e101bad815e94b99eef8}{ar8327\_port\_init}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01275}01275 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01276}01276         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_aae7d760817ef40123ef9de28d21e472d}{arswitch\_vlan\_getvgroup}} = \mbox{\hyperlink{arswitch__8327_8c_a1988d82408cf730ab1676b54a14f9e73}{ar8327\_vlan\_getvgroup}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01277}01277         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_a8c2658902431fc26b47e6dfbbf236798}{arswitch\_vlan\_setvgroup}} = \mbox{\hyperlink{arswitch__8327_8c_a6238d85b7865eb9e9b3ff2a689f15be4}{ar8327\_vlan\_setvgroup}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01278}01278         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_ac2cd6591aadc3a6ece8b6f81639d8f91}{arswitch\_port\_vlan\_setup}} = \mbox{\hyperlink{arswitch__8327_8c_ab35747b300fe6b30db2f0bac69a8fb14}{ar8327\_port\_vlan\_setup}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01279}01279         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_afaafdc12a1cc9ef58bdd1f3a8d02a116}{arswitch\_port\_vlan\_get}} = \mbox{\hyperlink{arswitch__8327_8c_ad9645cc984967474d168750390d61f2b}{ar8327\_port\_vlan\_get}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01280}01280         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_a928f54e32105d2935584b25c53585f9c}{arswitch\_flush\_dot1q\_vlan}} = \mbox{\hyperlink{arswitch__8327_8c_ad990757cec2e1adf2264db753972d349}{ar8327\_flush\_dot1q\_vlan}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01281}01281         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_a621818838f53fa1450dae4b43d18fe3c}{arswitch\_purge\_dot1q\_vlan}} = \mbox{\hyperlink{arswitch__8327_8c_ac4bb44c217f7dfe63fd3085991611e88}{ar8327\_purge\_dot1q\_vlan}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01282}01282         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_a84007c4ba055dc7106bcb4981f6f3926}{arswitch\_set\_dot1q\_vlan}} = \mbox{\hyperlink{arswitch__8327_8c_a9415bd41326065aa7dc5f0d2760fbb97}{ar8327\_set\_dot1q\_vlan}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01283}01283         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_a5d9ef4943bb5bf0346d1b064893292d0}{arswitch\_get\_dot1q\_vlan}} = \mbox{\hyperlink{arswitch__8327_8c_a0a6d7593aa1b8c087c8028e2034e2d14}{ar8327\_get\_dot1q\_vlan}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01284}01284 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01285}01285         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_a29aab2c679059f0d30c28545e51e0a12}{arswitch\_vlan\_init\_hw}} = \mbox{\hyperlink{arswitch__8327_8c_ac114d0ca6ddaeb954ec958fdadfff61d}{ar8327\_reset\_vlans}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01286}01286         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_adf986d1fe6c58719877452cb0692a5d3}{arswitch\_vlan\_get\_pvid}} = \mbox{\hyperlink{arswitch__8327_8c_a37cf07c4385c696e9e399645c1dcd34e}{ar8327\_get\_pvid}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01287}01287         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_aad21ed71d52d9fe3bde6c59304a681a8}{arswitch\_vlan\_set\_pvid}} = \mbox{\hyperlink{arswitch__8327_8c_a0f9e19c89d443d833d7d689363c8ef0c}{ar8327\_set\_pvid}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01288}01288 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01289}01289         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_ae419fedd2aedfb647ee1896687b0d376}{arswitch\_get\_port\_vlan}} = \mbox{\hyperlink{arswitch__8327_8c_a786a6c7ff3b3b61e39f562d7fcfaaf72}{ar8327\_vlan\_get\_port}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01290}01290         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_ae93538996c15a55fbaa2a62c37820e55}{arswitch\_set\_port\_vlan}} = \mbox{\hyperlink{arswitch__8327_8c_aeddd4d494e838349bbd7eb15c5c0d495}{ar8327\_vlan\_set\_port}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01291}01291 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01292}01292         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_aef24daa79d1f5d985e952c13c2fe9c30}{arswitch\_atu\_learn\_default}} = \mbox{\hyperlink{arswitch__8327_8c_afde575fca1463d81fb4fed40f554dee9}{ar8327\_atu\_learn\_default}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01293}01293         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_a472fae2b4bb75d278ae1d20e91c326a9}{arswitch\_atu\_flush}} = \mbox{\hyperlink{arswitch__8327_8c_a62a3fbe84e4a7f2b76eaa6e3aee0f834}{ar8327\_atu\_flush}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01294}01294         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_a67b0a0dd9dc85fb7c2822601b9095ba0}{arswitch\_atu\_flush\_port}} = \mbox{\hyperlink{arswitch__8327_8c_a71f2bd0a89ed39fd62bb51aea7a324b9}{ar8327\_atu\_flush\_port}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01295}01295         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_a6343e749218dc3ac18fd0292f3e3eb3c}{arswitch\_atu\_fetch\_table}} = \mbox{\hyperlink{arswitch__8327_8c_a064ef436fdf62b8a57f374700906632e}{ar8327\_atu\_fetch\_table}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01296}01296 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01297}01297         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01298}01298 \textcolor{comment}{         * Reading the PHY via the MDIO interface currently doesn't}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01299}01299 \textcolor{comment}{         * work correctly.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01300}01300 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01301}01301 \textcolor{comment}{         * So for now, just go direct to the PHY registers themselves.}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01302}01302 \textcolor{comment}{         * This has always worked  on external devices, but not internal}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01303}01303 \textcolor{comment}{         * devices (AR934x, AR724x, AR933x.)}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01304}01304 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01305}01305         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_a53449d6343b38d7ec36c08ec898354bc}{arswitch\_phy\_read}} = \mbox{\hyperlink{arswitch__phy_8c_a3492048794497b97d53fd27190f6da62}{arswitch\_readphy\_external}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01306}01306         sc-\/>\mbox{\hyperlink{structarswitch__softc_a52ff2407458f27e40cdb950d3b3c48d0}{hal}}.\mbox{\hyperlink{structarswitch__softc_a43bd2603f64b9542c72f8afb34ea8c2a}{arswitch\_phy\_write}} = \mbox{\hyperlink{arswitch__phy_8c_a3a1ff744ab0b2a5125e4c2b162961c93}{arswitch\_writephy\_external}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01307}01307 }
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01308}01308         \textcolor{comment}{/* Set the switch vlan capabilities. */}}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01309}01309         sc-\/>\mbox{\hyperlink{structarswitch__softc_a666c31b68b7f9b1ab5e9df7b5fda6b4e}{info}}.\mbox{\hyperlink{structetherswitch__info_ad66ffeb0559aa13923660793e5b41881}{es\_vlan\_caps}} = \mbox{\hyperlink{etherswitch_8h_ac5660b1c91229fa16f6348ea693575db}{ETHERSWITCH\_VLAN\_DOT1Q}} |}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01310}01310             \mbox{\hyperlink{etherswitch_8h_accc20f8e411463758872d4ec9091a5f5}{ETHERSWITCH\_VLAN\_PORT}} | \mbox{\hyperlink{etherswitch_8h_a615c37515367fb0e645d529be6ba6b78}{ETHERSWITCH\_VLAN\_DOUBLE\_TAG}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01311}01311         sc-\/>\mbox{\hyperlink{structarswitch__softc_a666c31b68b7f9b1ab5e9df7b5fda6b4e}{info}}.\mbox{\hyperlink{structetherswitch__info_a5444c63534797dc8db6bd03367cc8e33}{es\_nvlangroups}} = \mbox{\hyperlink{arswitchreg_8h_a2154e975cabac1d49af916bcf3f96df1}{AR8X16\_MAX\_VLANS}};}
\DoxyCodeLine{\Hypertarget{arswitch__8327_8c_source_l01312}01312 \}}

\end{DoxyCode}
