\hypertarget{sfxge__intr_8c_source}{}\doxysection{sfxge\+\_\+intr.\+c}
\label{sfxge__intr_8c_source}\index{dev/sfxge/sfxge\_intr.c@{dev/sfxge/sfxge\_intr.c}}
\mbox{\hyperlink{sfxge__intr_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2010-\/2016 Solarflare Communications Inc.}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00005}00005 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00007}00007 \textcolor{comment}{ * This software was developed in part by Philip Paeps under contract for}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00008}00008 \textcolor{comment}{ * Solarflare Communications, Inc.}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00009}00009 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00010}00010 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00011}00011 \textcolor{comment}{ * modification, are permitted provided that the following conditions are met:}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00012}00012 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00013}00013 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright notice,}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00014}00014 \textcolor{comment}{ *    this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00015}00015 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright notice,}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00016}00016 \textcolor{comment}{ *    this list of conditions and the following disclaimer in the documentation}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00017}00017 \textcolor{comment}{ *    and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00018}00018 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00019}00019 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "{}AS IS"{}}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00020}00020 \textcolor{comment}{ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00021}00021 \textcolor{comment}{ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00022}00022 \textcolor{comment}{ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00023}00023 \textcolor{comment}{ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00024}00024 \textcolor{comment}{ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00025}00025 \textcolor{comment}{ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00026}00026 \textcolor{comment}{ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00027}00027 \textcolor{comment}{ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00028}00028 \textcolor{comment}{ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00029}00029 \textcolor{comment}{ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00030}00030 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00031}00031 \textcolor{comment}{ * The views and conclusions contained in the software and documentation are}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00032}00032 \textcolor{comment}{ * those of the authors and should not be interpreted as representing official}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00033}00033 \textcolor{comment}{ * policies, either expressed or implied, of the FreeBSD Project.}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00034}00034 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00035}00035 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00037}\mbox{\hyperlink{sfxge__intr_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00037}} \mbox{\hyperlink{sfxge__intr_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00038}00038 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00039}00039 \textcolor{preprocessor}{\#include "{}opt\_rss.h"{}}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00040}00040 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <sys/rman.h>}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <sys/syslog.h>}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <sys/taskqueue.h>}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00049}00049 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <machine/bus.h>}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <machine/resource.h>}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00052}00052 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <dev/pci/pcireg.h>}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00054}00054 \textcolor{preprocessor}{\#include <dev/pci/pcivar.h>}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00055}00055 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00056}00056 \textcolor{preprocessor}{\#ifdef RSS}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00057}00057 \textcolor{preprocessor}{\#include <net/rss\_config.h>}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00058}00058 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00059}00059 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00060}00060 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{efx_8h}{common/efx.h}}"{}}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00061}00061 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00062}00062 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{sfxge_8h}{sfxge.h}}"{}}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00063}00063 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00064}00064 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00065}\mbox{\hyperlink{sfxge__intr_8c_aab0eef5e401fe3dcd8d5a91c9811b86a}{00065}} \mbox{\hyperlink{sfxge__intr_8c_aab0eef5e401fe3dcd8d5a91c9811b86a}{sfxge\_intr\_line\_filter}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00066}00066 \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00067}00067         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__evq}{sfxge\_evq}} *evq;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00068}00068         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__softc}{sfxge\_softc}} *\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00069}00069         \mbox{\hyperlink{structefx__nic__s}{efx\_nic\_t}} *\mbox{\hyperlink{structsfxge__softc_a8d634d233b767298d0e3a8c293be7da1}{enp}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00070}00070         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__intr}{sfxge\_intr}} *intr;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00071}00071         boolean\_t fatal;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00072}00072         uint32\_t qmask;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00073}00073 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00074}00074         evq = (\textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__evq}{sfxge\_evq}} *)arg;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00075}00075         \mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}} = evq-\/>\mbox{\hyperlink{structsfxge__evq_a67f6886e032efb726bf7891e30ec2ed2}{sc}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00076}00076         enp = \mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a8d634d233b767298d0e3a8c293be7da1}{enp}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00077}00077         intr = \&\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a89fcae12e698e6f48c768676457c0b2c}{intr}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00078}00078 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00079}00079         KASSERT(intr != NULL, (\textcolor{stringliteral}{"{}intr == NULL"{}}));}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00080}00080         KASSERT(intr-\/>\mbox{\hyperlink{structsfxge__intr_a4a4dc15248a34e6bda424a48313b15c9}{type}} == \mbox{\hyperlink{efx_8h_a9705703e0586c66934b3fc7c3362543ba7a0e2dfe96c70d5a77578a65b16d01ac}{EFX\_INTR\_LINE}},}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00081}00081             (\textcolor{stringliteral}{"{}intr-\/>type != EFX\_INTR\_LINE"{}}));}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00082}00082 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00083}00083         \textcolor{keywordflow}{if} (intr-\/>\mbox{\hyperlink{structsfxge__intr_a9dd00bc6cde576cbd1d5649fd6bdb5d3}{state}} != \mbox{\hyperlink{sfxge_8h_a9f59af986e36cbbfaa9aaa4e38904973acfb159f1123dd4028a0895a32a65285f}{SFXGE\_INTR\_STARTED}})}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00084}00084                 \textcolor{keywordflow}{return} (FILTER\_STRAY);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00085}00085 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00086}00086         (void)\mbox{\hyperlink{efx_8h_a7ca74e629b433a48546f58705b71e630}{efx\_intr\_status\_line}}(enp, \&fatal, \&qmask);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00087}00087 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00088}00088         \textcolor{keywordflow}{if} (fatal) \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00089}00089                 (void) \mbox{\hyperlink{efx_8h_a806f2ffd7c68829037d7e9d8dc000581}{efx\_intr\_disable}}(enp);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00090}00090                 (void) \mbox{\hyperlink{efx_8h_a5e557c73d970c2fa9cd93cfde3a054e8}{efx\_intr\_fatal}}(enp);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00091}00091                 \textcolor{keywordflow}{return} (FILTER\_HANDLED);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00092}00092         \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00093}00093 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00094}00094         \textcolor{keywordflow}{if} (qmask != 0) \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00095}00095                 intr-\/>\mbox{\hyperlink{structsfxge__intr_a518cabdfeaa42e5783bf77526e7387d3}{zero\_count}} = 0;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00096}00096                 \textcolor{keywordflow}{return} (FILTER\_SCHEDULE\_THREAD);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00097}00097         \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00098}00098 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00099}00099         \textcolor{comment}{/* SF bug 15783: If the function is not asserting its IRQ and}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00100}00100 \textcolor{comment}{         * we read the queue mask on the cycle before a flag is added}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00101}00101 \textcolor{comment}{         * to the mask, this inhibits the function from asserting the}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00102}00102 \textcolor{comment}{         * IRQ even though we don't see the flag set.  To work around}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00103}00103 \textcolor{comment}{         * this, we must re-\/prime all event queues and report the IRQ}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00104}00104 \textcolor{comment}{         * as handled when we see a mask of zero.  To allow for shared}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00105}00105 \textcolor{comment}{         * IRQs, we don't repeat this if we see a mask of zero twice}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00106}00106 \textcolor{comment}{         * or more in a row.}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00107}00107 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00108}00108         \textcolor{keywordflow}{if} (intr-\/>\mbox{\hyperlink{structsfxge__intr_a518cabdfeaa42e5783bf77526e7387d3}{zero\_count}}++ == 0) \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00109}00109                 \textcolor{keywordflow}{if} (evq-\/>\mbox{\hyperlink{structsfxge__evq_a56ad1e62cb90175b241976df61a31ac3}{init\_state}} == \mbox{\hyperlink{sfxge_8h_a33c0e41407b21b2420aa30e8763e385fa3c31a005851af11d6cdafa79689c8f15}{SFXGE\_EVQ\_STARTED}}) \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00110}00110                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{efx_8h_ada7129da0f68bb2e8d37a64e6e9f7d0e}{efx\_ev\_qpending}}(evq-\/>\mbox{\hyperlink{structsfxge__evq_a548cb38af18341638cb519a5c1738996}{common}}, evq-\/>\mbox{\hyperlink{structsfxge__evq_af1da5d544f71cd1fd6b9c0c4f3865801}{read\_ptr}}))}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00111}00111                                 \textcolor{keywordflow}{return} (FILTER\_SCHEDULE\_THREAD);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00112}00112                         \mbox{\hyperlink{efx_8h_a241a7684c22ccfbaa73625dbce98a665}{efx\_ev\_qprime}}(evq-\/>\mbox{\hyperlink{structsfxge__evq_a548cb38af18341638cb519a5c1738996}{common}}, evq-\/>\mbox{\hyperlink{structsfxge__evq_af1da5d544f71cd1fd6b9c0c4f3865801}{read\_ptr}});}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00113}00113                         \textcolor{keywordflow}{return} (FILTER\_HANDLED);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00114}00114                 \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00115}00115         \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00116}00116 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00117}00117         \textcolor{keywordflow}{return} (FILTER\_STRAY);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00118}00118 \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00119}00119 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00120}00120 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00121}\mbox{\hyperlink{sfxge__intr_8c_ad1f4c362471235bbebe8205786a9115f}{00121}} \mbox{\hyperlink{sfxge__intr_8c_ad1f4c362471235bbebe8205786a9115f}{sfxge\_intr\_line}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00122}00122 \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00123}00123         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__evq}{sfxge\_evq}} *evq = arg;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00124}00124 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00125}00125         (void)\mbox{\hyperlink{sfxge_8h_add95b2b14d45b519136ddf0df3d3878a}{sfxge\_ev\_qpoll}}(evq);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00126}00126 \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00127}00127 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00128}00128 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00129}\mbox{\hyperlink{sfxge__intr_8c_a03f6d0543898dfbc8a6dbc292563ba21}{00129}} \mbox{\hyperlink{sfxge__intr_8c_a03f6d0543898dfbc8a6dbc292563ba21}{sfxge\_intr\_message}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00130}00130 \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00131}00131         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__evq}{sfxge\_evq}} *evq;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00132}00132         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__softc}{sfxge\_softc}} *\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00133}00133         \mbox{\hyperlink{structefx__nic__s}{efx\_nic\_t}} *\mbox{\hyperlink{structsfxge__softc_a8d634d233b767298d0e3a8c293be7da1}{enp}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00134}00134         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__intr}{sfxge\_intr}} *intr;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00135}00135         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} \mbox{\hyperlink{sfxge_8h_a589d64202487f78e3cc30dd2e04c5201}{index}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00136}00136         boolean\_t fatal;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00137}00137 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00138}00138         evq = (\textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__evq}{sfxge\_evq}} *)arg;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00139}00139         \mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}} = evq-\/>\mbox{\hyperlink{structsfxge__evq_a67f6886e032efb726bf7891e30ec2ed2}{sc}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00140}00140         enp = \mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a8d634d233b767298d0e3a8c293be7da1}{enp}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00141}00141         intr = \&\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a89fcae12e698e6f48c768676457c0b2c}{intr}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00142}00142         \mbox{\hyperlink{sfxge_8h_a589d64202487f78e3cc30dd2e04c5201}{index}} = evq-\/>\mbox{\hyperlink{structsfxge__evq_a7a7c41afbf2d663a0df0f0ac115481d3}{index}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00143}00143 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00144}00144         KASSERT(intr != NULL, (\textcolor{stringliteral}{"{}intr == NULL"{}}));}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00145}00145         KASSERT(intr-\/>\mbox{\hyperlink{structsfxge__intr_a4a4dc15248a34e6bda424a48313b15c9}{type}} == \mbox{\hyperlink{efx_8h_a9705703e0586c66934b3fc7c3362543baec2fcfc7006a32d8d9a631030c3c73a4}{EFX\_INTR\_MESSAGE}},}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00146}00146             (\textcolor{stringliteral}{"{}intr-\/>type != EFX\_INTR\_MESSAGE"{}}));}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00147}00147 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00148}00148         \textcolor{keywordflow}{if} (\_\_predict\_false(intr-\/>\mbox{\hyperlink{structsfxge__intr_a9dd00bc6cde576cbd1d5649fd6bdb5d3}{state}} != \mbox{\hyperlink{sfxge_8h_a9f59af986e36cbbfaa9aaa4e38904973acfb159f1123dd4028a0895a32a65285f}{SFXGE\_INTR\_STARTED}}))}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00149}00149                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00150}00150 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00151}00151         (void)\mbox{\hyperlink{efx_8h_a38813e82ec394616318d7c167030bfb3}{efx\_intr\_status\_message}}(enp, \mbox{\hyperlink{sfxge_8h_a589d64202487f78e3cc30dd2e04c5201}{index}}, \&fatal);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00152}00152 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00153}00153         \textcolor{keywordflow}{if} (fatal) \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00154}00154                 (void)\mbox{\hyperlink{efx_8h_a806f2ffd7c68829037d7e9d8dc000581}{efx\_intr\_disable}}(enp);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00155}00155                 (void)\mbox{\hyperlink{efx_8h_a5e557c73d970c2fa9cd93cfde3a054e8}{efx\_intr\_fatal}}(enp);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00156}00156                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00157}00157         \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00158}00158 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00159}00159         (void)\mbox{\hyperlink{sfxge_8h_add95b2b14d45b519136ddf0df3d3878a}{sfxge\_ev\_qpoll}}(evq);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00160}00160 \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00161}00161 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00162}00162 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00163}\mbox{\hyperlink{sfxge__intr_8c_a46e3cb7587e034e785ea22c4f2f13d40}{00163}} \mbox{\hyperlink{sfxge__intr_8c_a46e3cb7587e034e785ea22c4f2f13d40}{sfxge\_intr\_bus\_enable}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsfxge__softc}{sfxge\_softc}} *\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}})}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00164}00164 \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00165}00165         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__intr}{sfxge\_intr}} *intr;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00166}00166         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__intr__hdl}{sfxge\_intr\_hdl}} *table;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00167}00167         driver\_filter\_t *filter;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00168}00168         driver\_intr\_t *handler;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00169}00169         \textcolor{keywordtype}{int} \mbox{\hyperlink{sfxge_8h_a589d64202487f78e3cc30dd2e04c5201}{index}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00170}00170         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00171}00171 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00172}00172         intr = \&\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a89fcae12e698e6f48c768676457c0b2c}{intr}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00173}00173         table = intr-\/>\mbox{\hyperlink{structsfxge__intr_a3e4a910e3abc47e4b06e4173dfc2c4f2}{table}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00174}00174 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00175}00175         \textcolor{keywordflow}{switch} (intr-\/>\mbox{\hyperlink{structsfxge__intr_a4a4dc15248a34e6bda424a48313b15c9}{type}}) \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00176}00176         \textcolor{keywordflow}{case} \mbox{\hyperlink{efx_8h_a9705703e0586c66934b3fc7c3362543baec2fcfc7006a32d8d9a631030c3c73a4}{EFX\_INTR\_MESSAGE}}:}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00177}00177                 filter = NULL; \textcolor{comment}{/* not shared */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00178}00178                 handler = \mbox{\hyperlink{sfxge__intr_8c_a03f6d0543898dfbc8a6dbc292563ba21}{sfxge\_intr\_message}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00179}00179                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00180}00180 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00181}00181         \textcolor{keywordflow}{case} \mbox{\hyperlink{efx_8h_a9705703e0586c66934b3fc7c3362543ba7a0e2dfe96c70d5a77578a65b16d01ac}{EFX\_INTR\_LINE}}:}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00182}00182                 filter = \mbox{\hyperlink{sfxge__intr_8c_aab0eef5e401fe3dcd8d5a91c9811b86a}{sfxge\_intr\_line\_filter}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00183}00183                 handler = \mbox{\hyperlink{sfxge__intr_8c_ad1f4c362471235bbebe8205786a9115f}{sfxge\_intr\_line}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00184}00184                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00185}00185 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00186}00186         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00187}00187                 KASSERT(0, (\textcolor{stringliteral}{"{}Invalid interrupt type"{}}));}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00188}00188                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00189}00189         \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00190}00190 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00191}00191         \textcolor{comment}{/* Try to add the handlers */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00192}00192         \textcolor{keywordflow}{for} (\mbox{\hyperlink{sfxge_8h_a589d64202487f78e3cc30dd2e04c5201}{index}} = 0; \mbox{\hyperlink{sfxge_8h_a589d64202487f78e3cc30dd2e04c5201}{index}} < intr-\/>\mbox{\hyperlink{structsfxge__intr_a6bd84e6985d84ff0bc389b3fa7b9f022}{n\_alloc}}; \mbox{\hyperlink{sfxge_8h_a589d64202487f78e3cc30dd2e04c5201}{index}}++) \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00193}00193                 \textcolor{keywordflow}{if} ((err = bus\_setup\_intr(\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a9bb41724d2a2835122b085d5c0c2af7a}{dev}}, table[\mbox{\hyperlink{sfxge_8h_a589d64202487f78e3cc30dd2e04c5201}{index}}].\mbox{\hyperlink{structsfxge__intr__hdl_afb61973ab0e500369368016c2673aae0}{eih\_res}},}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00194}00194                             INTR\_MPSAFE|INTR\_TYPE\_NET, filter, handler,}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00195}00195                             \mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a798ed5705bffc4f545f4ca1887b76e77}{evq}}[\mbox{\hyperlink{sfxge_8h_a589d64202487f78e3cc30dd2e04c5201}{index}}], \&table[\mbox{\hyperlink{sfxge_8h_a589d64202487f78e3cc30dd2e04c5201}{index}}].\mbox{\hyperlink{structsfxge__intr__hdl_a27f9b2af457fbe12ba4f2cdd0df44c58}{eih\_tag}})) != 0) \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00196}00196                         \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00197}00197                 \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00198}00198                 \textcolor{keywordflow}{if} (intr-\/>\mbox{\hyperlink{structsfxge__intr_a6bd84e6985d84ff0bc389b3fa7b9f022}{n\_alloc}} > 1)}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00199}00199                         bus\_describe\_intr(\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a9bb41724d2a2835122b085d5c0c2af7a}{dev}}, table[\mbox{\hyperlink{sfxge_8h_a589d64202487f78e3cc30dd2e04c5201}{index}}].\mbox{\hyperlink{structsfxge__intr__hdl_afb61973ab0e500369368016c2673aae0}{eih\_res}},}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00200}00200                             table[\mbox{\hyperlink{sfxge_8h_a589d64202487f78e3cc30dd2e04c5201}{index}}].\mbox{\hyperlink{structsfxge__intr__hdl_a27f9b2af457fbe12ba4f2cdd0df44c58}{eih\_tag}}, \textcolor{stringliteral}{"{}\%d"{}}, \mbox{\hyperlink{sfxge_8h_a589d64202487f78e3cc30dd2e04c5201}{index}});}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00201}00201 \textcolor{preprocessor}{\#ifdef RSS}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00202}00202                 bus\_bind\_intr(\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a9bb41724d2a2835122b085d5c0c2af7a}{dev}}, table[\mbox{\hyperlink{sfxge_8h_a589d64202487f78e3cc30dd2e04c5201}{index}}].\mbox{\hyperlink{structsfxge__intr__hdl_afb61973ab0e500369368016c2673aae0}{eih\_res}},}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00203}00203                               rss\_getcpu(\mbox{\hyperlink{sfxge_8h_a589d64202487f78e3cc30dd2e04c5201}{index}}));}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00204}00204 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00205}00205                 bus\_bind\_intr(\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a9bb41724d2a2835122b085d5c0c2af7a}{dev}}, table[\mbox{\hyperlink{sfxge_8h_a589d64202487f78e3cc30dd2e04c5201}{index}}].\mbox{\hyperlink{structsfxge__intr__hdl_afb61973ab0e500369368016c2673aae0}{eih\_res}}, \mbox{\hyperlink{sfxge_8h_a589d64202487f78e3cc30dd2e04c5201}{index}});}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00206}00206 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00207}00207         \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00208}00208 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00209}00209         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00210}00210 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00211}00211 fail:}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00212}00212         \textcolor{comment}{/* Remove remaining handlers */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00213}00213         \textcolor{keywordflow}{while} (-\/-\/\mbox{\hyperlink{sfxge_8h_a589d64202487f78e3cc30dd2e04c5201}{index}} >= 0)}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00214}00214                 bus\_teardown\_intr(\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a9bb41724d2a2835122b085d5c0c2af7a}{dev}}, table[\mbox{\hyperlink{sfxge_8h_a589d64202487f78e3cc30dd2e04c5201}{index}}].\mbox{\hyperlink{structsfxge__intr__hdl_afb61973ab0e500369368016c2673aae0}{eih\_res}},}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00215}00215                     table[\mbox{\hyperlink{sfxge_8h_a589d64202487f78e3cc30dd2e04c5201}{index}}].\mbox{\hyperlink{structsfxge__intr__hdl_a27f9b2af457fbe12ba4f2cdd0df44c58}{eih\_tag}});}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00216}00216 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00217}00217         \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00218}00218 \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00219}00219 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00220}00220 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00221}\mbox{\hyperlink{sfxge__intr_8c_a77194276ce7a16fe51dabce5491ff9d5}{00221}} \mbox{\hyperlink{sfxge__intr_8c_a77194276ce7a16fe51dabce5491ff9d5}{sfxge\_intr\_bus\_disable}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsfxge__softc}{sfxge\_softc}} *\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}})}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00222}00222 \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00223}00223         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__intr}{sfxge\_intr}} *intr;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00224}00224         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__intr__hdl}{sfxge\_intr\_hdl}} *table;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00225}00225         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00226}00226 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00227}00227         intr = \&\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a89fcae12e698e6f48c768676457c0b2c}{intr}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00228}00228         table = intr-\/>\mbox{\hyperlink{structsfxge__intr_a3e4a910e3abc47e4b06e4173dfc2c4f2}{table}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00229}00229 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00230}00230         \textcolor{comment}{/* Remove all handlers */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00231}00231         \textcolor{keywordflow}{for} (i = 0; i < intr-\/>\mbox{\hyperlink{structsfxge__intr_a6bd84e6985d84ff0bc389b3fa7b9f022}{n\_alloc}}; i++)}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00232}00232                 bus\_teardown\_intr(\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a9bb41724d2a2835122b085d5c0c2af7a}{dev}}, table[i].\mbox{\hyperlink{structsfxge__intr__hdl_afb61973ab0e500369368016c2673aae0}{eih\_res}},}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00233}00233                     table[i].\mbox{\hyperlink{structsfxge__intr__hdl_a27f9b2af457fbe12ba4f2cdd0df44c58}{eih\_tag}});}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00234}00234 \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00235}00235 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00236}00236 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00237}\mbox{\hyperlink{sfxge__intr_8c_a003ed0389eca6615490d9a161c5ff892}{00237}} \mbox{\hyperlink{sfxge__intr_8c_a003ed0389eca6615490d9a161c5ff892}{sfxge\_intr\_alloc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsfxge__softc}{sfxge\_softc}} *\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}, \textcolor{keywordtype}{int} count)}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00238}00238 \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00239}00239         device\_t dev;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00240}00240         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__intr__hdl}{sfxge\_intr\_hdl}} *table;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00241}00241         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__intr}{sfxge\_intr}} *intr;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00242}00242         \textcolor{keyword}{struct }resource *res;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00243}00243         \textcolor{keywordtype}{int} rid;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00244}00244         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00245}00245         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00246}00246 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00247}00247         dev = \mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a9bb41724d2a2835122b085d5c0c2af7a}{dev}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00248}00248         intr = \&\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a89fcae12e698e6f48c768676457c0b2c}{intr}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00249}00249         error = 0;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00250}00250 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00251}00251         table = malloc(count * \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsfxge__intr__hdl}{sfxge\_intr\_hdl}}),}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00252}00252             M\_SFXGE, M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00253}00253         intr-\/>\mbox{\hyperlink{structsfxge__intr_a3e4a910e3abc47e4b06e4173dfc2c4f2}{table}} = table;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00254}00254 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00255}00255         \textcolor{keywordflow}{for} (i = 0; i < count; i++) \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00256}00256                 rid = i + 1;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00257}00257                 res = bus\_alloc\_resource\_any(dev, SYS\_RES\_IRQ, \&rid,}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00258}00258                     RF\_SHAREABLE | RF\_ACTIVE);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00259}00259                 \textcolor{keywordflow}{if} (res == NULL) \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00260}00260                         device\_printf(dev, \textcolor{stringliteral}{"{}Couldn't allocate interrupts for "{}}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00261}00261                             \textcolor{stringliteral}{"{}message \%d\(\backslash\)n"{}}, rid);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00262}00262                         error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00263}00263                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00264}00264                 \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00265}00265                 table[i].\mbox{\hyperlink{structsfxge__intr__hdl_a7561228af350b33c6415b67d3eb5b241}{eih\_rid}} = rid;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00266}00266                 table[i].\mbox{\hyperlink{structsfxge__intr__hdl_afb61973ab0e500369368016c2673aae0}{eih\_res}} = res;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00267}00267         \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00268}00268 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00269}00269         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00270}00270                 count = i -\/ 1;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00271}00271                 \textcolor{keywordflow}{for} (i = 0; i < count; i++)}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00272}00272                         bus\_release\_resource(dev, SYS\_RES\_IRQ,}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00273}00273                             table[i].eih\_rid, table[i].eih\_res);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00274}00274         \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00275}00275 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00276}00276         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00277}00277 \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00278}00278 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00279}00279 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00280}\mbox{\hyperlink{sfxge__intr_8c_a6fa60dcb4969eadbf5d31cba1ae8600d}{00280}} \mbox{\hyperlink{sfxge__intr_8c_a6fa60dcb4969eadbf5d31cba1ae8600d}{sfxge\_intr\_teardown\_msix}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsfxge__softc}{sfxge\_softc}} *\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}})}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00281}00281 \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00282}00282         device\_t dev;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00283}00283         \textcolor{keyword}{struct }resource *resp;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00284}00284         \textcolor{keywordtype}{int} rid;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00285}00285 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00286}00286         dev = \mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a9bb41724d2a2835122b085d5c0c2af7a}{dev}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00287}00287         resp = \mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a89fcae12e698e6f48c768676457c0b2c}{intr}}.\mbox{\hyperlink{structsfxge__intr_a1b51e87252c220a79f581c8a2297397c}{msix\_res}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00288}00288 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00289}00289         rid = rman\_get\_rid(resp);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00290}00290         bus\_release\_resource(dev, SYS\_RES\_MEMORY, rid, resp);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00291}00291 \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00292}00292 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00293}00293 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00294}\mbox{\hyperlink{sfxge__intr_8c_a4330d8451c20edf3519444137a97ad52}{00294}} \mbox{\hyperlink{sfxge__intr_8c_a4330d8451c20edf3519444137a97ad52}{sfxge\_intr\_setup\_msix}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsfxge__softc}{sfxge\_softc}} *\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}})}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00295}00295 \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00296}00296         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__intr}{sfxge\_intr}} *intr;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00297}00297         \textcolor{keyword}{struct }resource *resp;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00298}00298         device\_t dev;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00299}00299         \textcolor{keywordtype}{int} count;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00300}00300         \textcolor{keywordtype}{int} rid;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00301}00301 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00302}00302         dev = \mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a9bb41724d2a2835122b085d5c0c2af7a}{dev}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00303}00303         intr = \&\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a89fcae12e698e6f48c768676457c0b2c}{intr}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00304}00304 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00305}00305         \textcolor{comment}{/* Check if MSI-\/X is available. */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00306}00306         count = pci\_msix\_count(dev);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00307}00307         \textcolor{keywordflow}{if} (count == 0)}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00308}00308                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00309}00309 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00310}00310         \textcolor{comment}{/* Do not try to allocate more than already estimated EVQ maximum */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00311}00311         KASSERT(\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a8a31befc934bfb068dbcde4faa1a8377}{evq\_max}} > 0, (\textcolor{stringliteral}{"{}evq\_max is zero"{}}));}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00312}00312         count = MIN(count, \mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a8a31befc934bfb068dbcde4faa1a8377}{evq\_max}});}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00313}00313 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00314}00314         rid = PCIR\_BAR(4);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00315}00315         resp = bus\_alloc\_resource\_any(dev, SYS\_RES\_MEMORY, \&rid, RF\_ACTIVE);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00316}00316         \textcolor{keywordflow}{if} (resp == NULL)}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00317}00317                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00318}00318 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00319}00319         \textcolor{keywordflow}{if} (pci\_alloc\_msix(dev, \&count) != 0) \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00320}00320                 bus\_release\_resource(dev, SYS\_RES\_MEMORY, rid, resp);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00321}00321                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00322}00322         \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00323}00323 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00324}00324         \textcolor{comment}{/* Allocate interrupt handlers. */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00325}00325         \textcolor{keywordflow}{if} (\mbox{\hyperlink{sfxge__intr_8c_a003ed0389eca6615490d9a161c5ff892}{sfxge\_intr\_alloc}}(\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}, count) != 0) \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00326}00326                 bus\_release\_resource(dev, SYS\_RES\_MEMORY, rid, resp);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00327}00327                 pci\_release\_msi(dev);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00328}00328                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00329}00329         \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00330}00330 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00331}00331         intr-\/>\mbox{\hyperlink{structsfxge__intr_a4a4dc15248a34e6bda424a48313b15c9}{type}} = \mbox{\hyperlink{efx_8h_a9705703e0586c66934b3fc7c3362543baec2fcfc7006a32d8d9a631030c3c73a4}{EFX\_INTR\_MESSAGE}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00332}00332         intr-\/>\mbox{\hyperlink{structsfxge__intr_a6bd84e6985d84ff0bc389b3fa7b9f022}{n\_alloc}} = count;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00333}00333         intr-\/>\mbox{\hyperlink{structsfxge__intr_a1b51e87252c220a79f581c8a2297397c}{msix\_res}} = resp;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00334}00334 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00335}00335         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00336}00336 \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00337}00337 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00338}00338 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00339}\mbox{\hyperlink{sfxge__intr_8c_aab47abdfa3cf1dd0759b5590f80141b3}{00339}} \mbox{\hyperlink{sfxge__intr_8c_aab47abdfa3cf1dd0759b5590f80141b3}{sfxge\_intr\_setup\_msi}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsfxge__softc}{sfxge\_softc}} *\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}})}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00340}00340 \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00341}00341         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__intr__hdl}{sfxge\_intr\_hdl}} *table;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00342}00342         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__intr}{sfxge\_intr}} *intr;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00343}00343         device\_t dev;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00344}00344         \textcolor{keywordtype}{int} count;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00345}00345         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00346}00346 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00347}00347         dev = \mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a9bb41724d2a2835122b085d5c0c2af7a}{dev}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00348}00348         intr = \&\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a89fcae12e698e6f48c768676457c0b2c}{intr}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00349}00349         \mbox{\hyperlink{structsfxge__intr_a3e4a910e3abc47e4b06e4173dfc2c4f2}{table}} = intr-\/>\mbox{\hyperlink{structsfxge__intr_a3e4a910e3abc47e4b06e4173dfc2c4f2}{table}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00350}00350 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00351}00351         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00352}00352 \textcolor{comment}{         * Check if MSI is available.  All messages must be written to}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00353}00353 \textcolor{comment}{         * the same address and on x86 this means the IRQs have the}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00354}00354 \textcolor{comment}{         * same CPU affinity.  So we only ever allocate 1.}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00355}00355 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00356}00356         count = pci\_msi\_count(dev) ? 1 : 0;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00357}00357         \textcolor{keywordflow}{if} (count == 0)}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00358}00358                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00359}00359 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00360}00360         \textcolor{keywordflow}{if} ((error = pci\_alloc\_msi(dev, \&count)) != 0)}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00361}00361                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00362}00362 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00363}00363         \textcolor{comment}{/* Allocate interrupt handler. */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00364}00364         \textcolor{keywordflow}{if} (\mbox{\hyperlink{sfxge__intr_8c_a003ed0389eca6615490d9a161c5ff892}{sfxge\_intr\_alloc}}(\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}, count) != 0) \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00365}00365                 pci\_release\_msi(dev);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00366}00366                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00367}00367         \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00368}00368 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00369}00369         intr-\/>\mbox{\hyperlink{structsfxge__intr_a4a4dc15248a34e6bda424a48313b15c9}{type}} = \mbox{\hyperlink{efx_8h_a9705703e0586c66934b3fc7c3362543baec2fcfc7006a32d8d9a631030c3c73a4}{EFX\_INTR\_MESSAGE}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00370}00370         intr-\/>\mbox{\hyperlink{structsfxge__intr_a6bd84e6985d84ff0bc389b3fa7b9f022}{n\_alloc}} = count;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00371}00371 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00372}00372         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00373}00373 \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00374}00374 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00375}00375 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00376}\mbox{\hyperlink{sfxge__intr_8c_af3d5974cf96e7f7e59c55fc399a0548b}{00376}} \mbox{\hyperlink{sfxge__intr_8c_af3d5974cf96e7f7e59c55fc399a0548b}{sfxge\_intr\_setup\_fixed}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsfxge__softc}{sfxge\_softc}} *\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}})}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00377}00377 \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00378}00378         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__intr__hdl}{sfxge\_intr\_hdl}} *table;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00379}00379         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__intr}{sfxge\_intr}} *intr;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00380}00380         \textcolor{keyword}{struct }resource *res;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00381}00381         device\_t dev;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00382}00382         \textcolor{keywordtype}{int} rid;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00383}00383 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00384}00384         dev = \mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a9bb41724d2a2835122b085d5c0c2af7a}{dev}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00385}00385         intr = \&\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a89fcae12e698e6f48c768676457c0b2c}{intr}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00386}00386 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00387}00387         rid = 0;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00388}00388         res =  bus\_alloc\_resource\_any(dev, SYS\_RES\_IRQ, \&rid,}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00389}00389             RF\_SHAREABLE | RF\_ACTIVE);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00390}00390         \textcolor{keywordflow}{if} (res == NULL)}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00391}00391                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00392}00392 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00393}00393         table = malloc(\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsfxge__intr__hdl}{sfxge\_intr\_hdl}}), M\_SFXGE, M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00394}00394         table[0].\mbox{\hyperlink{structsfxge__intr__hdl_a7561228af350b33c6415b67d3eb5b241}{eih\_rid}} = rid;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00395}00395         table[0].\mbox{\hyperlink{structsfxge__intr__hdl_afb61973ab0e500369368016c2673aae0}{eih\_res}} = res;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00396}00396 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00397}00397         intr-\/>\mbox{\hyperlink{structsfxge__intr_a4a4dc15248a34e6bda424a48313b15c9}{type}} = \mbox{\hyperlink{efx_8h_a9705703e0586c66934b3fc7c3362543ba7a0e2dfe96c70d5a77578a65b16d01ac}{EFX\_INTR\_LINE}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00398}00398         intr-\/>\mbox{\hyperlink{structsfxge__intr_a6bd84e6985d84ff0bc389b3fa7b9f022}{n\_alloc}} = 1;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00399}00399         intr-\/>\mbox{\hyperlink{structsfxge__intr_a3e4a910e3abc47e4b06e4173dfc2c4f2}{table}} = table;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00400}00400 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00401}00401         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00402}00402 \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00403}00403 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00404}\mbox{\hyperlink{sfxge__intr_8c_ab85f81a70c8f29773f1b781feb524a5b}{00404}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\textcolor{keyword}{const} \mbox{\hyperlink{sfxge__intr_8c_ab85f81a70c8f29773f1b781feb524a5b}{\_\_sfxge\_err}}[] = \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00405}00405         \textcolor{stringliteral}{"{}"{}},}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00406}00406         \textcolor{stringliteral}{"{}SRAM out-\/of-\/bounds"{}},}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00407}00407         \textcolor{stringliteral}{"{}Buffer ID out-\/of-\/bounds"{}},}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00408}00408         \textcolor{stringliteral}{"{}Internal memory parity"{}},}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00409}00409         \textcolor{stringliteral}{"{}Receive buffer ownership"{}},}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00410}00410         \textcolor{stringliteral}{"{}Transmit buffer ownership"{}},}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00411}00411         \textcolor{stringliteral}{"{}Receive descriptor ownership"{}},}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00412}00412         \textcolor{stringliteral}{"{}Transmit descriptor ownership"{}},}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00413}00413         \textcolor{stringliteral}{"{}Event queue ownership"{}},}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00414}00414         \textcolor{stringliteral}{"{}Event queue FIFO overflow"{}},}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00415}00415         \textcolor{stringliteral}{"{}Illegal address"{}},}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00416}00416         \textcolor{stringliteral}{"{}SRAM parity"{}}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00417}00417 \};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00418}00418 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00419}00419 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00420}\mbox{\hyperlink{efsys_8h_a87281c9d82af91a27985f885745417e4}{00420}} \mbox{\hyperlink{sfxge__intr_8c_a5fbacdc4c4cf55b3de4033e45a2063c7}{sfxge\_err}}(\mbox{\hyperlink{efsys_8h_abef755dca8c8076b62f3ab365a80f7b3}{efsys\_identifier\_t}} *arg, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} code, uint32\_t dword0,}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00421}00421           uint32\_t dword1)}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00422}00422 \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00423}00423         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__softc}{sfxge\_softc}} *\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__softc}{sfxge\_softc}} *)arg;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00424}00424         device\_t \mbox{\hyperlink{structsfxge__softc_a9bb41724d2a2835122b085d5c0c2af7a}{dev}} = \mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a9bb41724d2a2835122b085d5c0c2af7a}{dev}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00425}00425 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00426}00426         log(LOG\_WARNING, \textcolor{stringliteral}{"{}[\%s\%d] FATAL ERROR: \%s (0x\%08x\%08x)"{}},}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00427}00427             device\_get\_name(\mbox{\hyperlink{structsfxge__softc_a9bb41724d2a2835122b085d5c0c2af7a}{dev}}), device\_get\_unit(\mbox{\hyperlink{structsfxge__softc_a9bb41724d2a2835122b085d5c0c2af7a}{dev}}),}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00428}00428                 \mbox{\hyperlink{sfxge__intr_8c_ab85f81a70c8f29773f1b781feb524a5b}{\_\_sfxge\_err}}[code], dword1, dword0);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00429}00429 \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00430}00430 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00431}00431 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00432}\mbox{\hyperlink{sfxge_8h_a2700e5a8a90c397d63364923647eee56}{00432}} \mbox{\hyperlink{sfxge__intr_8c_a2700e5a8a90c397d63364923647eee56}{sfxge\_intr\_stop}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsfxge__softc}{sfxge\_softc}} *\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}})}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00433}00433 \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00434}00434         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__intr}{sfxge\_intr}} *intr;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00435}00435 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00436}00436         intr = \&\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a89fcae12e698e6f48c768676457c0b2c}{intr}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00437}00437 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00438}00438         KASSERT(intr-\/>\mbox{\hyperlink{structsfxge__intr_a9dd00bc6cde576cbd1d5649fd6bdb5d3}{state}} == \mbox{\hyperlink{sfxge_8h_a9f59af986e36cbbfaa9aaa4e38904973acfb159f1123dd4028a0895a32a65285f}{SFXGE\_INTR\_STARTED}},}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00439}00439             (\textcolor{stringliteral}{"{}Interrupts not started"{}}));}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00440}00440 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00441}00441         intr-\/>\mbox{\hyperlink{structsfxge__intr_a9dd00bc6cde576cbd1d5649fd6bdb5d3}{state}} = \mbox{\hyperlink{sfxge_8h_a9f59af986e36cbbfaa9aaa4e38904973a30f592e92f4544f02922ec80312f8205}{SFXGE\_INTR\_INITIALIZED}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00442}00442 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00443}00443         \textcolor{comment}{/* Disable interrupts at the NIC */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00444}00444         \mbox{\hyperlink{efx_8h_a806f2ffd7c68829037d7e9d8dc000581}{efx\_intr\_disable}}(\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a8d634d233b767298d0e3a8c293be7da1}{enp}});}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00445}00445 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00446}00446         \textcolor{comment}{/* Disable interrupts at the bus */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00447}00447         \mbox{\hyperlink{sfxge__intr_8c_a77194276ce7a16fe51dabce5491ff9d5}{sfxge\_intr\_bus\_disable}}(\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}});}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00448}00448 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00449}00449         \textcolor{comment}{/* Tear down common code interrupt bits. */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00450}00450         \mbox{\hyperlink{efx_8h_ac5d56fdb58839cc6276286b145128818}{efx\_intr\_fini}}(\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a8d634d233b767298d0e3a8c293be7da1}{enp}});}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00451}00451 \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00452}00452 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00453}00453 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00454}\mbox{\hyperlink{sfxge_8h_a5828c2dc1afc493ed3bfb2191d05c0f6}{00454}} \mbox{\hyperlink{sfxge__intr_8c_a5828c2dc1afc493ed3bfb2191d05c0f6}{sfxge\_intr\_start}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsfxge__softc}{sfxge\_softc}} *\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}})}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00455}00455 \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00456}00456         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__intr}{sfxge\_intr}} *intr;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00457}00457         \mbox{\hyperlink{structefsys__mem__s}{efsys\_mem\_t}} *esmp;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00458}00458         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00459}00459 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00460}00460         intr = \&\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a89fcae12e698e6f48c768676457c0b2c}{intr}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00461}00461         esmp = \&intr-\/>\mbox{\hyperlink{structsfxge__intr_a36f0c5b25d31a29fcce82e5cd7a9a802}{status}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00462}00462 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00463}00463         KASSERT(intr-\/>\mbox{\hyperlink{structsfxge__intr_a9dd00bc6cde576cbd1d5649fd6bdb5d3}{state}} == \mbox{\hyperlink{sfxge_8h_a9f59af986e36cbbfaa9aaa4e38904973a30f592e92f4544f02922ec80312f8205}{SFXGE\_INTR\_INITIALIZED}},}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00464}00464             (\textcolor{stringliteral}{"{}Interrupts not initialized"{}}));}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00465}00465 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00466}00466         \textcolor{comment}{/* Zero the memory. */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00467}00467         (void)memset(esmp-\/>\mbox{\hyperlink{structefsys__mem__s_a4d552c3c1a7f9701c31ecbef6861dcc9}{esm\_base}}, 0, \mbox{\hyperlink{efx_8h_a10297cd246a182f402993ab4bff74035}{EFX\_INTR\_SIZE}});}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00468}00468 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00469}00469         \textcolor{comment}{/* Initialize common code interrupt bits. */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00470}00470         (void)\mbox{\hyperlink{efx_8h_afd40630653dca1fa0390cb6ea05e9dd6}{efx\_intr\_init}}(\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a8d634d233b767298d0e3a8c293be7da1}{enp}}, intr-\/>\mbox{\hyperlink{structsfxge__intr_a4a4dc15248a34e6bda424a48313b15c9}{type}}, esmp);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00471}00471 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00472}00472         \textcolor{comment}{/* Enable interrupts at the bus */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00473}00473         \textcolor{keywordflow}{if} ((rc = \mbox{\hyperlink{sfxge__intr_8c_a46e3cb7587e034e785ea22c4f2f13d40}{sfxge\_intr\_bus\_enable}}(\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}})) != 0)}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00474}00474                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00475}00475 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00476}00476         intr-\/>\mbox{\hyperlink{structsfxge__intr_a9dd00bc6cde576cbd1d5649fd6bdb5d3}{state}} = \mbox{\hyperlink{sfxge_8h_a9f59af986e36cbbfaa9aaa4e38904973acfb159f1123dd4028a0895a32a65285f}{SFXGE\_INTR\_STARTED}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00477}00477 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00478}00478         \textcolor{comment}{/* Enable interrupts at the NIC */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00479}00479         \mbox{\hyperlink{efx_8h_ad546eb17704e9bde830604e9f2b220eb}{efx\_intr\_enable}}(\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a8d634d233b767298d0e3a8c293be7da1}{enp}});}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00480}00480 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00481}00481         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00482}00482 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00483}00483 fail:}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00484}00484         \textcolor{comment}{/* Tear down common code interrupt bits. */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00485}00485         \mbox{\hyperlink{efx_8h_ac5d56fdb58839cc6276286b145128818}{efx\_intr\_fini}}(\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a8d634d233b767298d0e3a8c293be7da1}{enp}});}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00486}00486 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00487}00487         intr-\/>\mbox{\hyperlink{structsfxge__intr_a9dd00bc6cde576cbd1d5649fd6bdb5d3}{state}} = \mbox{\hyperlink{sfxge_8h_a9f59af986e36cbbfaa9aaa4e38904973a30f592e92f4544f02922ec80312f8205}{SFXGE\_INTR\_INITIALIZED}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00488}00488 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00489}00489         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00490}00490 \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00491}00491 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00492}00492 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00493}\mbox{\hyperlink{sfxge_8h_a40788088b24824304b8d7fb4ca8bcd6b}{00493}} \mbox{\hyperlink{sfxge__intr_8c_a40788088b24824304b8d7fb4ca8bcd6b}{sfxge\_intr\_fini}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsfxge__softc}{sfxge\_softc}} *\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}})}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00494}00494 \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00495}00495         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__intr__hdl}{sfxge\_intr\_hdl}} *table;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00496}00496         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__intr}{sfxge\_intr}} *intr;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00497}00497         \mbox{\hyperlink{structefsys__mem__s}{efsys\_mem\_t}} *esmp;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00498}00498         device\_t dev;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00499}00499         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00500}00500 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00501}00501         dev = \mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a9bb41724d2a2835122b085d5c0c2af7a}{dev}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00502}00502         intr = \&\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a89fcae12e698e6f48c768676457c0b2c}{intr}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00503}00503         esmp = \&intr-\/>\mbox{\hyperlink{structsfxge__intr_a36f0c5b25d31a29fcce82e5cd7a9a802}{status}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00504}00504         \mbox{\hyperlink{structsfxge__intr_a3e4a910e3abc47e4b06e4173dfc2c4f2}{table}} = intr-\/>\mbox{\hyperlink{structsfxge__intr_a3e4a910e3abc47e4b06e4173dfc2c4f2}{table}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00505}00505 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00506}00506         KASSERT(intr-\/>\mbox{\hyperlink{structsfxge__intr_a9dd00bc6cde576cbd1d5649fd6bdb5d3}{state}} == \mbox{\hyperlink{sfxge_8h_a9f59af986e36cbbfaa9aaa4e38904973a30f592e92f4544f02922ec80312f8205}{SFXGE\_INTR\_INITIALIZED}},}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00507}00507             (\textcolor{stringliteral}{"{}intr-\/>state != SFXGE\_INTR\_INITIALIZED"{}}));}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00508}00508 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00509}00509         \textcolor{comment}{/* Free DMA memory. */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00510}00510         \mbox{\hyperlink{sfxge_8h_a4e64a2c24f7dd935ae77181f74580bc7}{sfxge\_dma\_free}}(esmp);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00511}00511 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00512}00512         \textcolor{comment}{/* Free interrupt handles. */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00513}00513         \textcolor{keywordflow}{for} (i = 0; i < intr-\/>\mbox{\hyperlink{structsfxge__intr_a6bd84e6985d84ff0bc389b3fa7b9f022}{n\_alloc}}; i++)}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00514}00514                 bus\_release\_resource(dev, SYS\_RES\_IRQ,}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00515}00515                     \mbox{\hyperlink{structsfxge__intr_a3e4a910e3abc47e4b06e4173dfc2c4f2}{table}}[i].eih\_rid, \mbox{\hyperlink{structsfxge__intr_a3e4a910e3abc47e4b06e4173dfc2c4f2}{table}}[i].eih\_res);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00516}00516 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00517}00517         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structsfxge__intr_a3e4a910e3abc47e4b06e4173dfc2c4f2}{table}}[0].eih\_rid != 0)}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00518}00518                 pci\_release\_msi(dev);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00519}00519 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00520}00520         \textcolor{keywordflow}{if} (intr-\/>\mbox{\hyperlink{structsfxge__intr_a1b51e87252c220a79f581c8a2297397c}{msix\_res}} != NULL)}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00521}00521                 \mbox{\hyperlink{sfxge__intr_8c_a6fa60dcb4969eadbf5d31cba1ae8600d}{sfxge\_intr\_teardown\_msix}}(\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}});}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00522}00522 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00523}00523         \textcolor{comment}{/* Free the handle table */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00524}00524         free(\mbox{\hyperlink{structsfxge__intr_a3e4a910e3abc47e4b06e4173dfc2c4f2}{table}}, M\_SFXGE);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00525}00525         intr-\/>\mbox{\hyperlink{structsfxge__intr_a3e4a910e3abc47e4b06e4173dfc2c4f2}{table}} = NULL;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00526}00526         intr-\/>\mbox{\hyperlink{structsfxge__intr_a6bd84e6985d84ff0bc389b3fa7b9f022}{n\_alloc}} = 0;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00527}00527 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00528}00528         \textcolor{comment}{/* Clear the interrupt type */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00529}00529         intr-\/>\mbox{\hyperlink{structsfxge__intr_a4a4dc15248a34e6bda424a48313b15c9}{type}} = \mbox{\hyperlink{efx_8h_a9705703e0586c66934b3fc7c3362543ba22c0a5f2a8f2f825b9e1ba082fcbf2cb}{EFX\_INTR\_INVALID}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00530}00530 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00531}00531         intr-\/>\mbox{\hyperlink{structsfxge__intr_a9dd00bc6cde576cbd1d5649fd6bdb5d3}{state}} = \mbox{\hyperlink{sfxge_8h_a9f59af986e36cbbfaa9aaa4e38904973af8980b65834817de80727a3d38340da3}{SFXGE\_INTR\_UNINITIALIZED}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00532}00532 \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00533}00533 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00534}00534 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00535}\mbox{\hyperlink{sfxge_8h_a5c90641fbf5a607302c197b1c66dd702}{00535}} \mbox{\hyperlink{sfxge__intr_8c_a5c90641fbf5a607302c197b1c66dd702}{sfxge\_intr\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsfxge__softc}{sfxge\_softc}} *\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}})}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00536}00536 \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00537}00537         device\_t dev;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00538}00538         \textcolor{keyword}{struct }\mbox{\hyperlink{structsfxge__intr}{sfxge\_intr}} *intr;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00539}00539         \mbox{\hyperlink{structefsys__mem__s}{efsys\_mem\_t}} *esmp;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00540}00540         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00541}00541 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00542}00542         dev = \mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a9bb41724d2a2835122b085d5c0c2af7a}{dev}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00543}00543         intr = \&\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}-\/>\mbox{\hyperlink{structsfxge__softc_a89fcae12e698e6f48c768676457c0b2c}{intr}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00544}00544         esmp = \&intr-\/>\mbox{\hyperlink{structsfxge__intr_a36f0c5b25d31a29fcce82e5cd7a9a802}{status}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00545}00545 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00546}00546         KASSERT(intr-\/>\mbox{\hyperlink{structsfxge__intr_a9dd00bc6cde576cbd1d5649fd6bdb5d3}{state}} == \mbox{\hyperlink{sfxge_8h_a9f59af986e36cbbfaa9aaa4e38904973af8980b65834817de80727a3d38340da3}{SFXGE\_INTR\_UNINITIALIZED}},}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00547}00547             (\textcolor{stringliteral}{"{}Interrupts already initialized"{}}));}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00548}00548 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00549}00549         \textcolor{comment}{/* Try to setup MSI-\/X or MSI interrupts if available. */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00550}00550         \textcolor{keywordflow}{if} ((rc = \mbox{\hyperlink{sfxge__intr_8c_a4330d8451c20edf3519444137a97ad52}{sfxge\_intr\_setup\_msix}}(\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}})) == 0)}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00551}00551                 device\_printf(dev, \textcolor{stringliteral}{"{}Using MSI-\/X interrupts\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00552}00552         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ((rc = \mbox{\hyperlink{sfxge__intr_8c_aab47abdfa3cf1dd0759b5590f80141b3}{sfxge\_intr\_setup\_msi}}(\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}})) == 0)}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00553}00553                 device\_printf(dev, \textcolor{stringliteral}{"{}Using MSI interrupts\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00554}00554         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ((rc = \mbox{\hyperlink{sfxge__intr_8c_af3d5974cf96e7f7e59c55fc399a0548b}{sfxge\_intr\_setup\_fixed}}(\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}})) == 0) \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00555}00555                 device\_printf(dev, \textcolor{stringliteral}{"{}Using fixed interrupts\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00556}00556         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00557}00557                 device\_printf(dev, \textcolor{stringliteral}{"{}Couldn't setup interrupts\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00558}00558                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00559}00559         \}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00560}00560 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00561}00561         \textcolor{comment}{/* Set up DMA for interrupts. */}}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00562}00562         \textcolor{keywordflow}{if} ((rc = \mbox{\hyperlink{sfxge_8h_a45cfd5bc59ea87755ed5318726906d61}{sfxge\_dma\_alloc}}(\mbox{\hyperlink{sfxge_8h_a0fdd68fb60df8c76625b73b761e9b8d0}{sc}}, \mbox{\hyperlink{efx_8h_a10297cd246a182f402993ab4bff74035}{EFX\_INTR\_SIZE}}, esmp)) != 0)}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00563}00563                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00564}00564 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00565}00565         intr-\/>\mbox{\hyperlink{structsfxge__intr_a9dd00bc6cde576cbd1d5649fd6bdb5d3}{state}} = \mbox{\hyperlink{sfxge_8h_a9f59af986e36cbbfaa9aaa4e38904973a30f592e92f4544f02922ec80312f8205}{SFXGE\_INTR\_INITIALIZED}};}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00566}00566 }
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00567}00567         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{sfxge__intr_8c_source_l00568}00568 \}}

\end{DoxyCode}
