\hypertarget{medford2__nic_8c_source}{}\doxysection{medford2\+\_\+nic.\+c}
\label{medford2__nic_8c_source}\index{dev/sfxge/common/medford2\_nic.c@{dev/sfxge/common/medford2\_nic.c}}
\mbox{\hyperlink{medford2__nic_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2015-\/2018 Solarflare Communications Inc.}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00005}00005 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00007}00007 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00008}00008 \textcolor{comment}{ * modification, are permitted provided that the following conditions are met:}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00009}00009 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00010}00010 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright notice,}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00011}00011 \textcolor{comment}{ *    this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00012}00012 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright notice,}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00013}00013 \textcolor{comment}{ *    this list of conditions and the following disclaimer in the documentation}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00014}00014 \textcolor{comment}{ *    and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00015}00015 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00016}00016 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "{}AS IS"{}}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00017}00017 \textcolor{comment}{ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00018}00018 \textcolor{comment}{ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00019}00019 \textcolor{comment}{ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00020}00020 \textcolor{comment}{ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00021}00021 \textcolor{comment}{ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00022}00022 \textcolor{comment}{ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00023}00023 \textcolor{comment}{ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00024}00024 \textcolor{comment}{ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00025}00025 \textcolor{comment}{ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00026}00026 \textcolor{comment}{ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00027}00027 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00028}00028 \textcolor{comment}{ * The views and conclusions contained in the software and documentation are}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00029}00029 \textcolor{comment}{ * those of the authors and should not be interpreted as representing official}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00030}00030 \textcolor{comment}{ * policies, either expressed or implied, of the FreeBSD Project.}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00031}00031 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00032}00032 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00034}\mbox{\hyperlink{medford2__nic_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00034}} \mbox{\hyperlink{medford2__nic_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00035}00035 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00036}00036 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{efx_8h}{efx.h}}"{}}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00037}00037 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{efx__impl_8h}{efx\_impl.h}}"{}}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00038}00038 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00039}00039 \textcolor{preprocessor}{\#if EFSYS\_OPT\_MEDFORD2}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00040}00040 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00041}00041 \textcolor{keyword}{static}  \mbox{\hyperlink{efx__annote_8h_a1f1031c250d4a2092f48ae69723d66d7}{\_\_checkReturn}}      efx\_rc\_t}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00042}\mbox{\hyperlink{medford2__nic_8c_af99e947850e3a7a73c5363e8a9015d0f}{00042}} \mbox{\hyperlink{medford2__nic_8c_af99e947850e3a7a73c5363e8a9015d0f}{medford2\_nic\_get\_required\_pcie\_bandwidth}}(}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00043}00043         \mbox{\hyperlink{efx__annote_8h_a3f6b8655e1aa9dfc15a9029f0343009e}{\_\_in}}                \mbox{\hyperlink{structefx__nic__s}{efx\_nic\_t}} *enp,}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00044}00044         \mbox{\hyperlink{efx__annote_8h_abb4c3c1135aab6c47cff22e7c16efb74}{\_\_out}}              uint32\_t *bandwidth\_mbpsp)}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00045}00045 \{}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00046}00046         uint32\_t bandwidth;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00047}00047         efx\_rc\_t rc;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00048}00048 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00049}00049         \textcolor{comment}{/* FIXME: support new Medford2 dynamic port modes */}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00050}00050 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00051}00051         \textcolor{keywordflow}{if} ((rc = \mbox{\hyperlink{ef10__impl_8h_a1909dc5274e43462256923edabf85bc2}{ef10\_nic\_get\_port\_mode\_bandwidth}}(enp,}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00052}00052                                                     \&bandwidth)) != 0)}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00053}00053                 \textcolor{keywordflow}{goto} fail1;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00054}00054 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00055}00055         *bandwidth\_mbpsp = bandwidth;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00056}00056 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00057}00057         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00058}00058 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00059}00059 fail1:}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00060}00060         \mbox{\hyperlink{efsys_8h_aa4843943221a3571f3b2b9f12f87d5f5}{EFSYS\_PROBE1}}(fail1, efx\_rc\_t, rc);}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00061}00061 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00062}00062         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00063}00063 \}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00064}00064 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00065}00065         \mbox{\hyperlink{efx__annote_8h_a1f1031c250d4a2092f48ae69723d66d7}{\_\_checkReturn}}      efx\_rc\_t}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00066}\mbox{\hyperlink{medford2__impl_8h_a99e6bf909958d3937d2365a8e5459531}{00066}} \mbox{\hyperlink{medford2__nic_8c_a99e6bf909958d3937d2365a8e5459531}{medford2\_board\_cfg}}(}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00067}00067         \mbox{\hyperlink{efx__annote_8h_a3f6b8655e1aa9dfc15a9029f0343009e}{\_\_in}}                \mbox{\hyperlink{structefx__nic__s}{efx\_nic\_t}} *enp)}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00068}00068 \{}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00069}00069         \mbox{\hyperlink{structefx__nic__cfg__s}{efx\_nic\_cfg\_t}} *encp = \&(enp-\/>en\_nic\_cfg);}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00070}00070         uint32\_t sysclk, dpcpu\_clk;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00071}00071         uint32\_t end\_padding;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00072}00072         uint32\_t bandwidth;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00073}00073         efx\_rc\_t rc;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00074}00074 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00075}00075         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00076}00076 \textcolor{comment}{         * Enable firmware workarounds for hardware errata.}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00077}00077 \textcolor{comment}{         * Expected responses are:}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00078}00078 \textcolor{comment}{         *  -\/ 0 (zero):}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00079}00079 \textcolor{comment}{         *      Success: workaround enabled or disabled as requested.}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00080}00080 \textcolor{comment}{         *  -\/ MC\_CMD\_ERR\_ENOSYS (reported as ENOTSUP):}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00081}00081 \textcolor{comment}{         *      Firmware does not support the MC\_CMD\_WORKAROUND request.}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00082}00082 \textcolor{comment}{         *      (assume that the workaround is not supported).}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00083}00083 \textcolor{comment}{         *  -\/ MC\_CMD\_ERR\_ENOENT (reported as ENOENT):}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00084}00084 \textcolor{comment}{         *      Firmware does not support the requested workaround.}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00085}00085 \textcolor{comment}{         *  -\/ MC\_CMD\_ERR\_EPERM  (reported as EACCES):}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00086}00086 \textcolor{comment}{         *      Unprivileged function cannot enable/disable workarounds.}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00087}00087 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00088}00088 \textcolor{comment}{         * See efx\_mcdi\_request\_errcode() for MCDI error translations.}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00089}00089 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00090}00090 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00091}00091         \textcolor{keywordflow}{if} (\mbox{\hyperlink{efx_8h_abff64a883aa010fdd262561d9c8dcf6a}{EFX\_PCI\_FUNCTION\_IS\_VF}}(encp)) \{}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00092}00092                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00093}00093 \textcolor{comment}{                 * Interrupt testing does not work for VFs on Medford2.}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00094}00094 \textcolor{comment}{                 * See bug50084 and bug71432 comment 21.}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00095}00095 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00096}00096                 encp-\/>\mbox{\hyperlink{structefx__nic__cfg__s_a2a1d9f6eb912569c31850058c4a241e3}{enc\_bug41750\_workaround}} = B\_TRUE;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00097}00097         \}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00098}00098 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00099}00099         \textcolor{comment}{/* Chained multicast is always enabled on Medford2 */}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00100}00100         encp-\/>\mbox{\hyperlink{structefx__nic__cfg__s_adba3c4ac105d09d85cd040f1880cc2d1}{enc\_bug26807\_workaround}} = B\_TRUE;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00101}00101 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00102}00102         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00103}00103 \textcolor{comment}{         * If the bug61265 workaround is enabled, then interrupt holdoff timers}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00104}00104 \textcolor{comment}{         * cannot be controlled by timer table writes, so MCDI must be used}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00105}00105 \textcolor{comment}{         * (timer table writes can still be used for wakeup timers).}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00106}00106 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00107}00107         rc = \mbox{\hyperlink{efx__impl_8h_aecbc01f0e4472d8d1785912c7754299e}{efx\_mcdi\_set\_workaround}}(enp, \mbox{\hyperlink{efx__regs__mcdi_8h_a3d08b8c92eeceae64d9d8a55ed38ae11}{MC\_CMD\_WORKAROUND\_BUG61265}}, B\_TRUE,}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00108}00108             NULL);}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00109}00109         \textcolor{keywordflow}{if} ((rc == 0) || (rc == EACCES))}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00110}00110                 encp-\/>\mbox{\hyperlink{structefx__nic__cfg__s_a4b608780c06f3982bc3dd4036df0a1c1}{enc\_bug61265\_workaround}} = B\_TRUE;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00111}00111         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ((rc == ENOTSUP) || (rc == ENOENT))}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00112}00112                 encp-\/>\mbox{\hyperlink{structefx__nic__cfg__s_a4b608780c06f3982bc3dd4036df0a1c1}{enc\_bug61265\_workaround}} = B\_FALSE;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00113}00113         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00114}00114                 \textcolor{keywordflow}{goto} fail1;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00115}00115 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00116}00116         \textcolor{comment}{/* Checksums for TSO sends should always be correct on Medford2. */}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00117}00117         encp-\/>\mbox{\hyperlink{structefx__nic__cfg__s_a92766d2f273f5aeb3ffd20b454bba877}{enc\_bug61297\_workaround}} = B\_FALSE;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00118}00118 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00119}00119         \textcolor{comment}{/* Get clock frequencies (in MHz). */}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00120}00120         \textcolor{keywordflow}{if} ((rc = \mbox{\hyperlink{ef10__impl_8h_a0836c476bc067955e624485eb768cbb8}{efx\_mcdi\_get\_clock}}(enp, \&sysclk, \&dpcpu\_clk)) != 0)}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00121}00121                 \textcolor{keywordflow}{goto} fail2;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00122}00122 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00123}00123         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00124}00124 \textcolor{comment}{         * The Medford2 timer quantum is 1536 dpcpu\_clk cycles, documented for}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00125}00125 \textcolor{comment}{         * the EV\_TMR\_VAL field of EV\_TIMER\_TBL. Scale for MHz and ns units.}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00126}00126 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00127}00127         encp-\/>\mbox{\hyperlink{structefx__nic__cfg__s_ab9ce21413ea501c5fe5ca39fd82513a2}{enc\_evq\_timer\_quantum\_ns}} = 1536000UL / dpcpu\_clk; \textcolor{comment}{/* 1536 cycles */}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00128}00128         encp-\/>\mbox{\hyperlink{structefx__nic__cfg__s_a8911e2b7556b30c0e9256b39e19aa96e}{enc\_evq\_timer\_max\_us}} = (encp-\/>\mbox{\hyperlink{structefx__nic__cfg__s_ab9ce21413ea501c5fe5ca39fd82513a2}{enc\_evq\_timer\_quantum\_ns}} <<}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00129}00129                     \mbox{\hyperlink{efx__regs_8h_a22a48dcc29bb96c83e99260fe21d0e9f}{FRF\_CZ\_TC\_TIMER\_VAL\_WIDTH}}) / 1000;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00130}00130 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00131}00131         \textcolor{comment}{/* Alignment for receive packet DMA buffers */}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00132}00132         encp-\/>\mbox{\hyperlink{structefx__nic__cfg__s_a0c0cd8427a2632a95b37939fd5532100}{enc\_rx\_buf\_align\_start}} = 1;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00133}00133 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00134}00134         \textcolor{comment}{/* Get the RX DMA end padding alignment configuration */}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00135}00135         \textcolor{keywordflow}{if} ((rc = \mbox{\hyperlink{ef10__impl_8h_af8ba3ef186dc17435d2de262b19045e6}{efx\_mcdi\_get\_rxdp\_config}}(enp, \&end\_padding)) != 0) \{}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00136}00136                 \textcolor{keywordflow}{if} (rc != EACCES)}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00137}00137                         \textcolor{keywordflow}{goto} fail3;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00138}00138 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00139}00139                 \textcolor{comment}{/* Assume largest tail padding size supported by hardware */}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00140}00140                 end\_padding = 256;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00141}00141         \}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00142}00142         encp-\/>\mbox{\hyperlink{structefx__nic__cfg__s_adddc2c65d366c8031f7c5680729edb46}{enc\_rx\_buf\_align\_end}} = end\_padding;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00143}00143 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00144}00144         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00145}00145 \textcolor{comment}{         * The maximum supported transmit queue size is 2048. TXQs with 4096}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00146}00146 \textcolor{comment}{         * descriptors are not supported as the top bit is used for vfifo}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00147}00147 \textcolor{comment}{         * stuffing.}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00148}00148 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00149}00149         encp-\/>\mbox{\hyperlink{structefx__nic__cfg__s_a14e91d8eda9cfc7560bf7fdd302a9972}{enc\_txq\_max\_ndescs}} = 2048;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00150}00150 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00151}00151         \mbox{\hyperlink{efx_8h_a9b48a380217f137d36b7187c271e4121}{EFX\_STATIC\_ASSERT}}(\mbox{\hyperlink{medford2__impl_8h_ab41107475ddd4385560e0ef15b68cc09}{MEDFORD2\_PIOBUF\_NBUFS}} <= \mbox{\hyperlink{ef10__impl_8h_aba9f4564169d0ac884c345441e281546}{EF10\_MAX\_PIOBUF\_NBUFS}});}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00152}00152         encp-\/>\mbox{\hyperlink{structefx__nic__cfg__s_a8f70a66f207561068edebc7509eae6a8}{enc\_piobuf\_limit}} = \mbox{\hyperlink{medford2__impl_8h_ab41107475ddd4385560e0ef15b68cc09}{MEDFORD2\_PIOBUF\_NBUFS}};}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00153}00153         encp-\/>\mbox{\hyperlink{structefx__nic__cfg__s_a75edce7c98824e1f1cdc0bfc52efdef1}{enc\_piobuf\_size}} = \mbox{\hyperlink{medford2__impl_8h_a5148e547c18a20b34311e56d7b6ba846}{MEDFORD2\_PIOBUF\_SIZE}};}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00154}00154         encp-\/>\mbox{\hyperlink{structefx__nic__cfg__s_a763b906257601dba82a4625e95fb57f6}{enc\_piobuf\_min\_alloc\_size}} = \mbox{\hyperlink{medford2__impl_8h_aef00fa0037b4405544b724ffd9e30554}{MEDFORD2\_MIN\_PIO\_ALLOC\_SIZE}};}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00155}00155 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00156}00156         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00157}00157 \textcolor{comment}{         * Medford2 stores a single global copy of VPD, not per-\/PF as on}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00158}00158 \textcolor{comment}{         * Huntington.}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00159}00159 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00160}00160         encp-\/>\mbox{\hyperlink{structefx__nic__cfg__s_ac1247ba582a1d3d474214c5691c3cf56}{enc\_vpd\_is\_global}} = B\_TRUE;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00161}00161 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00162}00162         rc = \mbox{\hyperlink{medford2__nic_8c_af99e947850e3a7a73c5363e8a9015d0f}{medford2\_nic\_get\_required\_pcie\_bandwidth}}(enp, \&bandwidth);}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00163}00163         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00164}00164                 \textcolor{keywordflow}{goto} fail4;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00165}00165         encp-\/>\mbox{\hyperlink{structefx__nic__cfg__s_a42131c90ce063510e4f4834f74d97a97}{enc\_required\_pcie\_bandwidth\_mbps}} = bandwidth;}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00166}00166         encp-\/>\mbox{\hyperlink{structefx__nic__cfg__s_a3f4e614c2bf6802d0f445510b0cb8c7e}{enc\_max\_pcie\_link\_gen}} = \mbox{\hyperlink{efx_8h_ae5368f6874a5bae0e9537bfb28e497f0}{EFX\_PCIE\_LINK\_SPEED\_GEN3}};}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00167}00167 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00168}00168         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00169}00169 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00170}00170 fail4:}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00171}00171         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail4);}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00172}00172 fail3:}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00173}00173         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail3);}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00174}00174 fail2:}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00175}00175         \mbox{\hyperlink{efsys_8h_acc330aa922e1eddffecbcf9be25dc21c}{EFSYS\_PROBE}}(fail2);}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00176}00176 fail1:}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00177}00177         \mbox{\hyperlink{efsys_8h_aa4843943221a3571f3b2b9f12f87d5f5}{EFSYS\_PROBE1}}(fail1, efx\_rc\_t, rc);}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00178}00178 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00179}00179         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00180}00180 \}}
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00181}00181 }
\DoxyCodeLine{\Hypertarget{medford2__nic_8c_source_l00182}00182 \textcolor{preprocessor}{\#endif  }\textcolor{comment}{/* EFSYS\_OPT\_MEDFORD2 */}\textcolor{preprocessor}{}}

\end{DoxyCode}
