\hypertarget{ql__inline_8h_source}{}\doxysection{ql\+\_\+inline.\+h}
\label{ql__inline_8h_source}\index{dev/qlxgbe/ql\_inline.h@{dev/qlxgbe/ql\_inline.h}}
\mbox{\hyperlink{ql__inline_8h}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2013-\/2016 Qlogic Corporation}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00005}00005 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00007}00007 \textcolor{comment}{ *  Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00008}00008 \textcolor{comment}{ *  modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00009}00009 \textcolor{comment}{ *  are met:}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00010}00010 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00011}00011 \textcolor{comment}{ *  1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00012}00012 \textcolor{comment}{ *     notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00013}00013 \textcolor{comment}{ *  2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00014}00014 \textcolor{comment}{ *     notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00015}00015 \textcolor{comment}{ *     documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00016}00016 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00017}00017 \textcolor{comment}{ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "{}AS IS"{}}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00018}00018 \textcolor{comment}{ *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00019}00019 \textcolor{comment}{ *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00020}00020 \textcolor{comment}{ *  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00021}00021 \textcolor{comment}{ *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00022}00022 \textcolor{comment}{ *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00023}00023 \textcolor{comment}{ *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00024}00024 \textcolor{comment}{ *  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00025}00025 \textcolor{comment}{ *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00026}00026 \textcolor{comment}{ *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00027}00027 \textcolor{comment}{ *  POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00028}00028 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00029}00029 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00030}00030 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00031}00031 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00032}00032 \textcolor{comment}{ * File: ql\_inline.h}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00033}00033 \textcolor{comment}{ * Author : David C Somayajulu, Qlogic Corporation, Aliso Viejo, CA 92656.}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00034}00034 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00035}00035 \textcolor{preprocessor}{\#ifndef \_QL\_INLINE\_H\_}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00036}00036 \textcolor{preprocessor}{\#define \_QL\_INLINE\_H\_}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00037}00037 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00038}\mbox{\hyperlink{ql__inline_8h_acdb1be031e0334aec4d9fa0cc872748d}{00038}} \textcolor{preprocessor}{\#define QL8\_SEMLOCK\_TIMEOUT     1000}\textcolor{comment}{/* QLA8020 Semaphore Lock Timeout 10ms */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00039}00039 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00040}00040 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00041}00041 \textcolor{comment}{ * Inline functions for hardware semaphores}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00042}00042 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00043}00043 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00044}00044 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00045}00045 \textcolor{comment}{ * Name:        qla\_sem\_lock}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00046}00046 \textcolor{comment}{ * Function:    Locks one of the semaphore registers (semaphore 2,3,5 \& 7)}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00047}00047 \textcolor{comment}{ *              If the id\_reg is valid, then id\_val is written into it.}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00048}00048 \textcolor{comment}{ *              This is for debugging purpose}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00049}00049 \textcolor{comment}{ * Returns:     0 on success; otherwise its failed.}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00050}00050 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00051}00051 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00052}\mbox{\hyperlink{ql__inline_8h_a4dd70a3a3eb7c40007cd2039faa0fce5}{00052}} \mbox{\hyperlink{ql__inline_8h_a4dd70a3a3eb7c40007cd2039faa0fce5}{qla\_sem\_lock}}(\mbox{\hyperlink{structqla__host}{qla\_host\_t}} *ha, uint32\_t sem\_reg, uint32\_t id\_reg, uint32\_t id\_val)}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00053}00053 \{}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00054}00054         \textcolor{keywordtype}{int} count = \mbox{\hyperlink{ql__inline_8h_acdb1be031e0334aec4d9fa0cc872748d}{QL8\_SEMLOCK\_TIMEOUT}};}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00055}00055 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00056}00056         \textcolor{keywordflow}{while} (count) \{}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00057}00057                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{ql__hw_8h_aa0a42c8d7ea3ce8787ad99176e49af0a}{READ\_REG32}}(ha, sem\_reg) \& \mbox{\hyperlink{ql__def_8h_add6d2693f5d356b091088437148f939b}{BIT\_0}}))}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00058}00058                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00059}00059                 count-\/-\/;}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00060}00060 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00061}00061                 \textcolor{keywordflow}{if} (!count)}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00062}00062                         \textcolor{keywordflow}{return}(-\/1);}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00063}00063                 \mbox{\hyperlink{ql__os_8h_ac19585fb4979e3ca1d70ab87532bedbd}{qla\_mdelay}}(\_\_func\_\_, 10);}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00064}00064         \}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00065}00065         \textcolor{keywordflow}{if} (id\_reg)}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00066}00066                 \mbox{\hyperlink{ql__hw_8h_af78ad5ca7df54eb01198901569d53919}{WRITE\_REG32}}(ha, id\_reg, id\_val);}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00067}00067 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00068}00068         \textcolor{keywordflow}{return}(0);}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00069}00069 \}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00070}00070 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00071}00071 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00072}00072 \textcolor{comment}{ * Name:        qla\_sem\_unlock}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00073}00073 \textcolor{comment}{ * Function:    Unlocks the semaphore registers (semaphore 2,3,5 \& 7)}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00074}00074 \textcolor{comment}{ *              previously locked by qla\_sem\_lock()}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00075}00075 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00076}00076 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00077}\mbox{\hyperlink{ql__inline_8h_a6ce7fa148fb41a273051d390a4d4d2f0}{00077}} \mbox{\hyperlink{ql__inline_8h_a6ce7fa148fb41a273051d390a4d4d2f0}{qla\_sem\_unlock}}(\mbox{\hyperlink{structqla__host}{qla\_host\_t}} *ha, uint32\_t sem\_reg)}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00078}00078 \{}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00079}00079         \mbox{\hyperlink{ql__hw_8h_aa0a42c8d7ea3ce8787ad99176e49af0a}{READ\_REG32}}(ha, sem\_reg);}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00080}00080 \}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00081}00081 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00082}00082 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00083}\mbox{\hyperlink{ql__inline_8h_ab8b24b16bba635658de870119bf4f1ff}{00083}} \mbox{\hyperlink{ql__inline_8h_ab8b24b16bba635658de870119bf4f1ff}{qla\_get\_ifq\_snd\_maxlen}}(\mbox{\hyperlink{structqla__host}{qla\_host\_t}} *ha)}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00084}00084 \{}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00085}00085         \textcolor{keywordflow}{return}(((\mbox{\hyperlink{ql__hw_8h_ad70baca046931aa8d783f9db0a950f08}{NUM\_TX\_DESCRIPTORS}} * 4) -\/ 1));}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00086}00086 \}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00087}00087 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00088}00088 \textcolor{keyword}{static} \_\_inline uint32\_t}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00089}\mbox{\hyperlink{ql__inline_8h_a62798c8161b86eecd58d6ae4044f2fdb}{00089}} \mbox{\hyperlink{ql__inline_8h_a62798c8161b86eecd58d6ae4044f2fdb}{qla\_get\_optics}}(\mbox{\hyperlink{structqla__host}{qla\_host\_t}} *ha)}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00090}00090 \{}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00091}00091         uint32\_t link\_speed;}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00092}00092 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00093}00093         link\_speed = \mbox{\hyperlink{ql__hw_8h_aa0a42c8d7ea3ce8787ad99176e49af0a}{READ\_REG32}}(ha, \mbox{\hyperlink{ql__hw_8h_aa6202a68eb0758f99bcb7b4a26658bdd}{Q8\_LINK\_SPEED\_0}});}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00094}00094         \textcolor{keywordflow}{if} (ha-\/>\mbox{\hyperlink{structqla__host_a241ccac5b886c6195827db9ac08c78f3}{pci\_func}} == 0)}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00095}00095                 link\_speed = link\_speed \& 0xFF;}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00096}00096         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00097}00097                 link\_speed = (link\_speed >> 8) \& 0xFF;}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00098}00098 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00099}00099         \textcolor{keywordflow}{switch} (link\_speed) \{}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00100}00100         \textcolor{keywordflow}{case} 0x1:}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00101}00101                 link\_speed = IFM\_100\_FX;}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00102}00102                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00103}00103 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00104}00104         \textcolor{keywordflow}{case} 0x10:}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00105}00105                 link\_speed = IFM\_1000\_SX;}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00106}00106                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00107}00107 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00108}00108         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00109}00109                 \textcolor{keywordflow}{if} ((ha-\/>\mbox{\hyperlink{structqla__host_acf0e3d83d58551ac31fae5350139cd45}{hw}}.\mbox{\hyperlink{struct__qla__hw_ac73dcdf01101454ed4bb0a3b8958605d}{module\_type}} == 0x4) ||}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00110}00110                         (ha-\/>\mbox{\hyperlink{structqla__host_acf0e3d83d58551ac31fae5350139cd45}{hw}}.\mbox{\hyperlink{struct__qla__hw_ac73dcdf01101454ed4bb0a3b8958605d}{module\_type}} == 0x5) ||}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00111}00111                         (ha-\/>\mbox{\hyperlink{structqla__host_acf0e3d83d58551ac31fae5350139cd45}{hw}}.\mbox{\hyperlink{struct__qla__hw_ac73dcdf01101454ed4bb0a3b8958605d}{module\_type}} == 0x6))}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00112}00112                         link\_speed = (IFM\_10G\_TWINAX);}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00113}00113                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00114}00114                         link\_speed = (IFM\_10G\_LR | IFM\_10G\_SR);}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00115}00115                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00116}00116         \}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00117}00117 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00118}00118         \textcolor{keywordflow}{return}(link\_speed);}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00119}00119 \}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00120}00120 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00121}00121 \textcolor{keyword}{static} \_\_inline uint8\_t *}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00122}\mbox{\hyperlink{ql__inline_8h_af65229340c8f2c1ba55412b89f7d6e17}{00122}} \mbox{\hyperlink{ql__inline_8h_af65229340c8f2c1ba55412b89f7d6e17}{qla\_get\_mac\_addr}}(\mbox{\hyperlink{structqla__host}{qla\_host\_t}} *ha)}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00123}00123 \{}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00124}00124         \textcolor{keywordflow}{return} (ha-\/>\mbox{\hyperlink{structqla__host_acf0e3d83d58551ac31fae5350139cd45}{hw}}.\mbox{\hyperlink{struct__qla__hw_a516b57a7a0df729b2e597ac95dda8834}{mac\_addr}});}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00125}00125 \}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00126}00126 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00127}00127 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00128}\mbox{\hyperlink{ql__inline_8h_a188456898e8ede9a2036e150e6a84a19}{00128}} \mbox{\hyperlink{ql__inline_8h_a188456898e8ede9a2036e150e6a84a19}{qla\_set\_hw\_rcv\_desc}}(\mbox{\hyperlink{structqla__host}{qla\_host\_t}} *ha, uint32\_t r\_idx, uint32\_t index,}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00129}00129         uint32\_t handle, bus\_addr\_t paddr, uint32\_t buf\_size)}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00130}00130 \{}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00131}00131         \textcolor{keyword}{volatile} \mbox{\hyperlink{struct__q80__rcv__desc}{q80\_recv\_desc\_t}} *rcv\_desc;}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00132}00132 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00133}00133         rcv\_desc = (\mbox{\hyperlink{struct__q80__rcv__desc}{q80\_recv\_desc\_t}} *)ha-\/>\mbox{\hyperlink{structqla__host_acf0e3d83d58551ac31fae5350139cd45}{hw}}.\mbox{\hyperlink{struct__qla__hw_a8f9065e2cfe85a0f8ff60a35728d7e5c}{dma\_buf}}.\mbox{\hyperlink{structqla__dmabuf_afd9682c495cbc91ebc160098c0e65006}{rds\_ring}}[r\_idx].dma\_b;}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00134}00134 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00135}00135         rcv\_desc += index;}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00136}00136 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00137}00137         rcv\_desc-\/>\mbox{\hyperlink{struct__q80__rcv__desc_aca938e7f9ee453d4ca3d824455fc005f}{handle}} = (uint16\_t)handle;}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00138}00138         rcv\_desc-\/>\mbox{\hyperlink{struct__q80__rcv__desc_ab05cd11c106a0d2b2dddedf941e590a1}{buf\_size}} = buf\_size;}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00139}00139         rcv\_desc-\/>\mbox{\hyperlink{struct__q80__rcv__desc_a6b63ef44a19df04c2475c65abb635764}{buf\_addr}} = paddr;}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00140}00140 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00141}00141         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00142}00142 \}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00143}00143 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00144}00144 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00145}\mbox{\hyperlink{ql__inline_8h_a308f69bc94f006ed5b3fc66e1feb94a7}{00145}} \mbox{\hyperlink{ql__inline_8h_a308f69bc94f006ed5b3fc66e1feb94a7}{qla\_init\_hw\_rcv\_descriptors}}(\mbox{\hyperlink{structqla__host}{qla\_host\_t}} *ha)}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00146}00146 \{}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00147}00147         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00148}00148 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00149}00149         \textcolor{keywordflow}{for} (i = 0; i < ha-\/>\mbox{\hyperlink{structqla__host_acf0e3d83d58551ac31fae5350139cd45}{hw}}.\mbox{\hyperlink{struct__qla__hw_a058a5e4a0f9da99ea2df51f34ef35e8b}{num\_rds\_rings}}; i++) }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00150}00150                 bzero((\textcolor{keywordtype}{void} *)ha-\/>\mbox{\hyperlink{structqla__host_acf0e3d83d58551ac31fae5350139cd45}{hw}}.\mbox{\hyperlink{struct__qla__hw_a8f9065e2cfe85a0f8ff60a35728d7e5c}{dma\_buf}}.\mbox{\hyperlink{structqla__dmabuf_afd9682c495cbc91ebc160098c0e65006}{rds\_ring}}[i].dma\_b,}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00151}00151                         (\textcolor{keyword}{sizeof}(\mbox{\hyperlink{struct__q80__rcv__desc}{q80\_recv\_desc\_t}}) * \mbox{\hyperlink{ql__hw_8h_ad9819ff90ac3963fcb6ba7c402fb98c6}{NUM\_RX\_DESCRIPTORS}}));}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00152}00152 \}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00153}00153 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00154}\mbox{\hyperlink{ql__inline_8h_a91178e086f9d41deef2f1e47d0b0118d}{00154}} \textcolor{preprocessor}{\#define QLA\_LOCK\_DEFAULT\_MS\_TIMEOUT     3000}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00155}00155 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00156}00156 \textcolor{preprocessor}{\#ifndef QLA\_LOCK\_NO\_SLEEP}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00157}\mbox{\hyperlink{ql__inline_8h_a7832261baa5391e8fdc911e54f09b551}{00157}} \textcolor{preprocessor}{\#define QLA\_LOCK\_NO\_SLEEP               0}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00158}00158 \textcolor{preprocessor}{\#endif }}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00159}00159 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00160}00160 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00161}\mbox{\hyperlink{ql__inline_8h_af5af6523fef162d7d5f42c13734e1273}{00161}} \mbox{\hyperlink{ql__inline_8h_af5af6523fef162d7d5f42c13734e1273}{qla\_lock}}(\mbox{\hyperlink{structqla__host}{qla\_host\_t}} *ha, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *str, uint32\_t timeout\_ms,}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00162}00162         uint32\_t no\_sleep)}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00163}00163 \{}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00164}00164         \textcolor{keywordtype}{int} ret = -\/1;}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00165}00165 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00166}00166         \textcolor{keywordflow}{while} (1) \{}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00167}00167                 mtx\_lock(\&ha-\/>\mbox{\hyperlink{structqla__host_a3f764332298d79805dc8e5c5d0870cc4}{hw\_lock}});}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00168}00168 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00169}00169                 \textcolor{keywordflow}{if} (ha-\/>\mbox{\hyperlink{structqla__host_a945d8fe9fc7cf31d7f5210a8c2e2043e}{qla\_detach\_active}} || ha-\/>\mbox{\hyperlink{structqla__host_ab25cbc152919b67bf59901dcb8be3bda}{offline}}) \{}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00170}00170                         mtx\_unlock(\&ha-\/>\mbox{\hyperlink{structqla__host_a3f764332298d79805dc8e5c5d0870cc4}{hw\_lock}});}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00171}00171                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00172}00172                 \}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00173}00173 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00174}00174                 \textcolor{keywordflow}{if} (!ha-\/>\mbox{\hyperlink{structqla__host_ad5c67cf0dd98a02995d1b9923f452fd6}{hw\_lock\_held}}) \{}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00175}00175                         ha-\/>\mbox{\hyperlink{structqla__host_ad5c67cf0dd98a02995d1b9923f452fd6}{hw\_lock\_held}} = 1;}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00176}00176                         ha-\/>\mbox{\hyperlink{structqla__host_a37336d8306b533d9b2b427441e218f81}{qla\_lock}} = str;}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00177}00177                         ret = 0;}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00178}00178                         mtx\_unlock(\&ha-\/>\mbox{\hyperlink{structqla__host_a3f764332298d79805dc8e5c5d0870cc4}{hw\_lock}});}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00179}00179                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00180}00180                 \}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00181}00181                 mtx\_unlock(\&ha-\/>\mbox{\hyperlink{structqla__host_a3f764332298d79805dc8e5c5d0870cc4}{hw\_lock}});}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00182}00182 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00183}00183                 \textcolor{keywordflow}{if} (-\/-\/timeout\_ms == 0) \{}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00184}00184                         ha-\/>\mbox{\hyperlink{structqla__host_a3758b325742ad2872ba50b06f11787f9}{hw\_lock\_failed}}++;}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00185}00185                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00186}00186                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00187}00187                         \textcolor{keywordflow}{if} (no\_sleep)}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00188}00188                                 DELAY(1000);}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00189}00189                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00190}00190                                 \mbox{\hyperlink{ql__os_8h_ac19585fb4979e3ca1d70ab87532bedbd}{qla\_mdelay}}(\_\_func\_\_, 1);}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00191}00191                 \}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00192}00192         \}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00193}00193 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00194}00194 \textcolor{comment}{//      if (!ha-\/>enable\_error\_recovery)}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00195}00195 \textcolor{comment}{//              device\_printf(ha-\/>pci\_dev, "{}\%s: \%s ret = \%d\(\backslash\)n"{}, \_\_func\_\_,}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00196}00196 \textcolor{comment}{//                      str,ret);}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00197}00197 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00198}00198         \textcolor{keywordflow}{return} (ret);}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00199}00199 \}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00200}00200 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00201}00201 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00202}\mbox{\hyperlink{ql__inline_8h_afd8d0ea8280d8b1572cb6e4e833944bb}{00202}} \mbox{\hyperlink{ql__inline_8h_afd8d0ea8280d8b1572cb6e4e833944bb}{qla\_unlock}}(\mbox{\hyperlink{structqla__host}{qla\_host\_t}} *ha, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *str)}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00203}00203 \{}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00204}00204         mtx\_lock(\&ha-\/>\mbox{\hyperlink{structqla__host_a3f764332298d79805dc8e5c5d0870cc4}{hw\_lock}});}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00205}00205         ha-\/>\mbox{\hyperlink{structqla__host_ad5c67cf0dd98a02995d1b9923f452fd6}{hw\_lock\_held}} = 0;}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00206}00206         ha-\/>\mbox{\hyperlink{structqla__host_a5edd19dfce7c847e861a2117b8741b3b}{qla\_unlock}} = str;}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00207}00207         mtx\_unlock(\&ha-\/>\mbox{\hyperlink{structqla__host_a3f764332298d79805dc8e5c5d0870cc4}{hw\_lock}});}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00208}00208 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00209}00209 \textcolor{comment}{//      if (!ha-\/>enable\_error\_recovery)}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00210}00210 \textcolor{comment}{//              device\_printf(ha-\/>pci\_dev, "{}\%s: \%s\(\backslash\)n"{}, \_\_func\_\_, str);}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00211}00211 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00212}00212         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00213}00213 \}}
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00214}00214 }
\DoxyCodeLine{\Hypertarget{ql__inline_8h_source_l00215}00215 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* \#ifndef \_QL\_INLINE\_H\_ */}\textcolor{preprocessor}{}}

\end{DoxyCode}
