\hypertarget{mlx5__vsc_8c_source}{}\doxysection{mlx5\+\_\+vsc.\+c}
\label{mlx5__vsc_8c_source}\index{dev/mlx5/mlx5\_core/mlx5\_vsc.c@{dev/mlx5/mlx5\_core/mlx5\_vsc.c}}
\mbox{\hyperlink{mlx5__vsc_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2013-\/2017, Mellanox Technologies, Ltd.  All rights reserved.}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00004}00004 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00005}00005 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00006}00006 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00007}00007 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00008}00008 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00009}00009 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00010}00010 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00011}00011 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00012}00012 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00013}00013 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00014}00014 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00015}00015 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00016}00016 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00017}00017 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00018}00018 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00019}00019 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00020}00020 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00021}00021 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00022}00022 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00023}00023 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00024}00024 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00025}00025 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00026}00026 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00027}00027 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00028}00028 \textcolor{preprocessor}{\#include "{}opt\_rss.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00029}00029 \textcolor{preprocessor}{\#include "{}opt\_ratelimit.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00031}00031 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{driver_8h}{dev/mlx5/driver.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{device_8h}{dev/mlx5/device.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{mlx5__core_8h}{dev/mlx5/mlx5\_core/mlx5\_core.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00034}00034 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00035}\mbox{\hyperlink{driver_8h_a168c89dedcde4beec4ec919f50d2cbc4}{00035}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__vsc_8c_a168c89dedcde4beec4ec919f50d2cbc4}{mlx5\_vsc\_lock}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *mdev)}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00036}00036 \{}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00037}00037         device\_t dev = mdev-\/>\mbox{\hyperlink{structmlx5__core__dev_a0819dc9fa4983c9140507e1a02aa8313}{pdev}}-\/>dev.bsddev;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00038}00038         \textcolor{keywordtype}{int} vsc\_addr = mdev-\/>\mbox{\hyperlink{structmlx5__core__dev_ab33f60e0e7a1465eec9e9b9f4ec72292}{vsc\_addr}};}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00039}00039         \textcolor{keywordtype}{int} retries = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00040}00040         u32 lock\_val;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00041}00041         u32 counter;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00042}00042 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00043}00043         \textcolor{keywordflow}{if} (!vsc\_addr) \{}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00044}00044                 \mbox{\hyperlink{mlx5__core_8h_ac024f7b881a7d4965ecc662bc4be81ca}{mlx5\_core\_warn}}(mdev, \textcolor{stringliteral}{"{}Unable to acquire vsc lock, vsc\_addr not initialized\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00045}00045                 \textcolor{keywordflow}{return} EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00046}00046         \}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00047}00047 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00048}00048         \textcolor{keywordflow}{while} (\textcolor{keyword}{true}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00049}00049                 \textcolor{keywordflow}{if} (retries > \mbox{\hyperlink{driver_8h_a634f9f55e799f3052a34590f08100017aee82558ef1007cb6a6ccc120728ecd43}{MLX5\_VSC\_MAX\_RETRIES}})}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00050}00050                         \textcolor{keywordflow}{return} EBUSY;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00051}00051 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00052}00052                 \textcolor{keywordflow}{if} (pci\_read\_config(dev, vsc\_addr + \mbox{\hyperlink{driver_8h_a634f9f55e799f3052a34590f08100017a372c1c761b4f8d3e89434c7af735f934}{MLX5\_VSC\_SEMA\_OFFSET}}, 4)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00053}00053                         retries++;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00054}00054                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00055}00055 \textcolor{comment}{                         * The PRM suggests random 0 -\/ 10ms to prevent multiple}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00056}00056 \textcolor{comment}{                         * waiters on the same interval in order to avoid starvation}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00057}00057 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00058}00058                         DELAY((random() \% 9000) + 1000);}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00059}00059                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00060}00060                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00061}00061 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00062}00062                 counter = pci\_read\_config(dev, vsc\_addr + \mbox{\hyperlink{driver_8h_a634f9f55e799f3052a34590f08100017a907fd1567d0d55f8bc634950dfb875db}{MLX5\_VSC\_COUNTER\_OFFSET}}, 4);}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00063}00063                 pci\_write\_config(dev, vsc\_addr + \mbox{\hyperlink{driver_8h_a634f9f55e799f3052a34590f08100017a372c1c761b4f8d3e89434c7af735f934}{MLX5\_VSC\_SEMA\_OFFSET}}, counter, 4);}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00064}00064                 lock\_val = pci\_read\_config(dev, vsc\_addr + \mbox{\hyperlink{driver_8h_a634f9f55e799f3052a34590f08100017a372c1c761b4f8d3e89434c7af735f934}{MLX5\_VSC\_SEMA\_OFFSET}}, 4);}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00065}00065 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00066}00066                 \textcolor{keywordflow}{if} (lock\_val == counter)}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00067}00067                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00068}00068 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00069}00069                 retries++;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00070}00070         \}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00071}00071 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00072}00072         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00073}00073 \}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00074}00074 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00075}\mbox{\hyperlink{driver_8h_a0fd8ff9d970b8b3c05aac233e508cd57}{00075}} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__vsc_8c_a0fd8ff9d970b8b3c05aac233e508cd57}{mlx5\_vsc\_unlock}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *mdev)}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00076}00076 \{}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00077}00077         device\_t dev = mdev-\/>\mbox{\hyperlink{structmlx5__core__dev_a0819dc9fa4983c9140507e1a02aa8313}{pdev}}-\/>dev.bsddev;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00078}00078         \textcolor{keywordtype}{int} vsc\_addr = mdev-\/>\mbox{\hyperlink{structmlx5__core__dev_ab33f60e0e7a1465eec9e9b9f4ec72292}{vsc\_addr}};}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00079}00079 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00080}00080         \textcolor{keywordflow}{if} (!vsc\_addr) \{}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00081}00081                 \mbox{\hyperlink{mlx5__core_8h_ac024f7b881a7d4965ecc662bc4be81ca}{mlx5\_core\_warn}}(mdev, \textcolor{stringliteral}{"{}Unable to release vsc lock, vsc\_addr not initialized\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00082}00082                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00083}00083         \}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00084}00084 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00085}00085         pci\_write\_config(dev, vsc\_addr + \mbox{\hyperlink{driver_8h_a634f9f55e799f3052a34590f08100017a372c1c761b4f8d3e89434c7af735f934}{MLX5\_VSC\_SEMA\_OFFSET}}, 0, 4);}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00086}00086 \}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00087}00087 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00088}00088 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00089}\mbox{\hyperlink{driver_8h_aa5cb7ba7eae29b14c082b41feaba8800}{00089}} \mbox{\hyperlink{mlx5__vsc_8c_aa5cb7ba7eae29b14c082b41feaba8800}{mlx5\_vsc\_wait\_on\_flag}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *mdev, u32 expected)}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00090}00090 \{}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00091}00091         device\_t dev = mdev-\/>\mbox{\hyperlink{structmlx5__core__dev_a0819dc9fa4983c9140507e1a02aa8313}{pdev}}-\/>dev.bsddev;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00092}00092         \textcolor{keywordtype}{int} vsc\_addr = mdev-\/>\mbox{\hyperlink{structmlx5__core__dev_ab33f60e0e7a1465eec9e9b9f4ec72292}{vsc\_addr}};}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00093}00093         \textcolor{keywordtype}{int} retries = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00094}00094         u32 flag;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00095}00095 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00096}00096         \textcolor{keywordflow}{while} (\textcolor{keyword}{true}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00097}00097                 \textcolor{keywordflow}{if} (retries > \mbox{\hyperlink{driver_8h_a634f9f55e799f3052a34590f08100017aee82558ef1007cb6a6ccc120728ecd43}{MLX5\_VSC\_MAX\_RETRIES}})}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00098}00098                         \textcolor{keywordflow}{return} EBUSY;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00099}00099 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00100}00100                 flag = pci\_read\_config(dev, vsc\_addr + \mbox{\hyperlink{driver_8h_a634f9f55e799f3052a34590f08100017a38db81ad514d332006465ea1c94dc9d7}{MLX5\_VSC\_ADDR\_OFFSET}}, 4);}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00101}00101                 \textcolor{keywordflow}{if} (expected == \mbox{\hyperlink{device_8h_a4adfa7172bfa75d16404bcae52463bb9}{MLX5\_VSC\_GET}}(vsc\_addr, \&flag, flag))}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00102}00102                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00103}00103 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00104}00104                 retries++;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00105}00105                 DELAY((random() \% 90) + 10);}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00106}00106         \}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00107}00107 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00108}00108         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00109}00109 \}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00110}00110 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00111}\mbox{\hyperlink{driver_8h_a28f27c48d084a78980255a2c8d425d70}{00111}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__vsc_8c_a28f27c48d084a78980255a2c8d425d70}{mlx5\_vsc\_set\_space}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *mdev, u16 space)}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00112}00112 \{}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00113}00113         device\_t dev = mdev-\/>\mbox{\hyperlink{structmlx5__core__dev_a0819dc9fa4983c9140507e1a02aa8313}{pdev}}-\/>dev.bsddev;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00114}00114         \textcolor{keywordtype}{int} vsc\_addr = mdev-\/>\mbox{\hyperlink{structmlx5__core__dev_ab33f60e0e7a1465eec9e9b9f4ec72292}{vsc\_addr}};}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00115}00115         u32 vsc\_space = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00116}00116 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00117}00117         \textcolor{keywordflow}{if} (!vsc\_addr) \{}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00118}00118                 \mbox{\hyperlink{mlx5__core_8h_ac024f7b881a7d4965ecc662bc4be81ca}{mlx5\_core\_warn}}(mdev, \textcolor{stringliteral}{"{}Unable to set vsc space, vsc\_addr not initialized\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00119}00119                 \textcolor{keywordflow}{return} EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00120}00120         \}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00121}00121 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00122}00122         \mbox{\hyperlink{device_8h_a97edd11e0d28e0b6f02d91c5beee37e5}{MLX5\_VSC\_SET}}(vsc\_space, \&vsc\_space, space, space);}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00123}00123         pci\_write\_config(dev, vsc\_addr + \mbox{\hyperlink{driver_8h_a634f9f55e799f3052a34590f08100017a2aa9b25e8aa8dd95b85623b1c5886dd3}{MLX5\_VSC\_SPACE\_OFFSET}}, vsc\_space, 4);}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00124}00124         vsc\_space = pci\_read\_config(dev, vsc\_addr + \mbox{\hyperlink{driver_8h_a634f9f55e799f3052a34590f08100017a2aa9b25e8aa8dd95b85623b1c5886dd3}{MLX5\_VSC\_SPACE\_OFFSET}}, 4);}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00125}00125 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00126}00126         \textcolor{keywordflow}{if} (\mbox{\hyperlink{device_8h_a4adfa7172bfa75d16404bcae52463bb9}{MLX5\_VSC\_GET}}(vsc\_space, \&vsc\_space, status) != \mbox{\hyperlink{driver_8h_a634f9f55e799f3052a34590f08100017a91f6f47c7bb0632184c37f3ad2264665}{MLX5\_VSC\_SPACE\_SUPPORTED}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00127}00127                 \mbox{\hyperlink{mlx5__core_8h_ac024f7b881a7d4965ecc662bc4be81ca}{mlx5\_core\_warn}}(mdev, \textcolor{stringliteral}{"{}Space 0x\%x is not supported.\(\backslash\)n"{}}, space);}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00128}00128                 \textcolor{keywordflow}{return} ENOTSUP;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00129}00129         \}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00130}00130 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00131}00131         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00132}00132 \}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00133}00133 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00134}\mbox{\hyperlink{driver_8h_a6b2f11ae678928439bc236d6ca7eac80}{00134}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__vsc_8c_a6b2f11ae678928439bc236d6ca7eac80}{mlx5\_vsc\_write}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *mdev, u32 addr, \textcolor{keyword}{const} u32 *\mbox{\hyperlink{mlx5__en__tx_8c_af943c26117683b64b9cd6943e2c496e5}{data}})}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00135}00135 \{}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00136}00136         device\_t dev = mdev-\/>\mbox{\hyperlink{structmlx5__core__dev_a0819dc9fa4983c9140507e1a02aa8313}{pdev}}-\/>dev.bsddev;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00137}00137         \textcolor{keywordtype}{int} vsc\_addr = mdev-\/>\mbox{\hyperlink{structmlx5__core__dev_ab33f60e0e7a1465eec9e9b9f4ec72292}{vsc\_addr}};}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00138}00138         u32 in = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00139}00139         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00140}00140 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00141}00141         \textcolor{keywordflow}{if} (!vsc\_addr) \{}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00142}00142                 \mbox{\hyperlink{mlx5__core_8h_ac024f7b881a7d4965ecc662bc4be81ca}{mlx5\_core\_warn}}(mdev, \textcolor{stringliteral}{"{}Unable to call vsc write, vsc\_addr not initialized\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00143}00143                 \textcolor{keywordflow}{return} EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00144}00144         \}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00145}00145 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00146}00146         \mbox{\hyperlink{device_8h_a97edd11e0d28e0b6f02d91c5beee37e5}{MLX5\_VSC\_SET}}(vsc\_addr, \&in, address, addr);}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00147}00147         \mbox{\hyperlink{device_8h_a97edd11e0d28e0b6f02d91c5beee37e5}{MLX5\_VSC\_SET}}(vsc\_addr, \&in, flag, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00148}00148         pci\_write\_config(dev, vsc\_addr + \mbox{\hyperlink{driver_8h_a634f9f55e799f3052a34590f08100017a6747eb5b46c8460412f726b1323ec699}{MLX5\_VSC\_DATA\_OFFSET}}, *\mbox{\hyperlink{mlx5__en__tx_8c_af943c26117683b64b9cd6943e2c496e5}{data}}, 4);}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00149}00149         pci\_write\_config(dev, vsc\_addr + \mbox{\hyperlink{driver_8h_a634f9f55e799f3052a34590f08100017a38db81ad514d332006465ea1c94dc9d7}{MLX5\_VSC\_ADDR\_OFFSET}}, in, 4);}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00150}00150 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00151}00151         err = \mbox{\hyperlink{mlx5__vsc_8c_aa5cb7ba7eae29b14c082b41feaba8800}{mlx5\_vsc\_wait\_on\_flag}}(mdev, 0);}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00152}00152         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00153}00153                 \mbox{\hyperlink{mlx5__core_8h_ac024f7b881a7d4965ecc662bc4be81ca}{mlx5\_core\_warn}}(mdev, \textcolor{stringliteral}{"{}Failed waiting for write flag!\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00154}00154 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00155}00155         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00156}00156 \}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00157}00157 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00158}\mbox{\hyperlink{driver_8h_a2385c649e8efc0065db8330e25da821b}{00158}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__vsc_8c_a2385c649e8efc0065db8330e25da821b}{mlx5\_vsc\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *mdev, u32 addr, u32 *\mbox{\hyperlink{mlx5__en__tx_8c_af943c26117683b64b9cd6943e2c496e5}{data}})}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00159}00159 \{}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00160}00160         device\_t dev = mdev-\/>\mbox{\hyperlink{structmlx5__core__dev_a0819dc9fa4983c9140507e1a02aa8313}{pdev}}-\/>dev.bsddev;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00161}00161         \textcolor{keywordtype}{int} vsc\_addr = mdev-\/>\mbox{\hyperlink{structmlx5__core__dev_ab33f60e0e7a1465eec9e9b9f4ec72292}{vsc\_addr}};}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00162}00162         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00163}00163         u32 in;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00164}00164 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00165}00165         \textcolor{keywordflow}{if} (!vsc\_addr) \{}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00166}00166                 \mbox{\hyperlink{mlx5__core_8h_ac024f7b881a7d4965ecc662bc4be81ca}{mlx5\_core\_warn}}(mdev, \textcolor{stringliteral}{"{}Unable to call vsc read, vsc\_addr not initialized\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00167}00167                 \textcolor{keywordflow}{return} EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00168}00168         \}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00169}00169 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00170}00170         \mbox{\hyperlink{device_8h_a97edd11e0d28e0b6f02d91c5beee37e5}{MLX5\_VSC\_SET}}(vsc\_addr, \&in, address, addr);}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00171}00171         pci\_write\_config(dev, vsc\_addr + \mbox{\hyperlink{driver_8h_a634f9f55e799f3052a34590f08100017a38db81ad514d332006465ea1c94dc9d7}{MLX5\_VSC\_ADDR\_OFFSET}}, in, 4);}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00172}00172 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00173}00173         err = \mbox{\hyperlink{mlx5__vsc_8c_aa5cb7ba7eae29b14c082b41feaba8800}{mlx5\_vsc\_wait\_on\_flag}}(mdev, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00174}00174         \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00175}00175                 \mbox{\hyperlink{mlx5__core_8h_ac024f7b881a7d4965ecc662bc4be81ca}{mlx5\_core\_warn}}(mdev, \textcolor{stringliteral}{"{}Failed waiting for read complete flag!\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00176}00176                 \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00177}00177         \}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00178}00178 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00179}00179         *\mbox{\hyperlink{mlx5__en__tx_8c_af943c26117683b64b9cd6943e2c496e5}{data}} = pci\_read\_config(dev, vsc\_addr + \mbox{\hyperlink{driver_8h_a634f9f55e799f3052a34590f08100017a6747eb5b46c8460412f726b1323ec699}{MLX5\_VSC\_DATA\_OFFSET}}, 4);}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00180}00180 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00181}00181         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00182}00182 \}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00183}00183 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00184}\mbox{\hyperlink{driver_8h_a84d4b52ea7c0f3b222e7e423f320a687}{00184}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__vsc_8c_a84d4b52ea7c0f3b222e7e423f320a687}{mlx5\_vsc\_lock\_addr\_space}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *mdev, u32 addr)}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00185}00185 \{}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00186}00186         device\_t dev = mdev-\/>\mbox{\hyperlink{structmlx5__core__dev_a0819dc9fa4983c9140507e1a02aa8313}{pdev}}-\/>dev.bsddev;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00187}00187         \textcolor{keywordtype}{int} vsc\_addr = mdev-\/>\mbox{\hyperlink{structmlx5__core__dev_ab33f60e0e7a1465eec9e9b9f4ec72292}{vsc\_addr}};}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00188}00188         u32 \mbox{\hyperlink{mlx5__en__tx_8c_af943c26117683b64b9cd6943e2c496e5}{data}};}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00189}00189         \textcolor{keywordtype}{int} ret;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00190}00190         u32 id;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00191}00191 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00192}00192         ret = \mbox{\hyperlink{mlx5__vsc_8c_a28f27c48d084a78980255a2c8d425d70}{mlx5\_vsc\_set\_space}}(mdev, \mbox{\hyperlink{mlx5__ifc_8h_aa85e8d66aa325c34334bcaa049300dcda59f2d2172a614b4123c7e77a17a2329f}{MLX5\_VSC\_DOMAIN\_SEMAPHORES}});}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00193}00193         \textcolor{keywordflow}{if} (ret)}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00194}00194                 \textcolor{keywordflow}{return} ret;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00195}00195 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00196}00196         \textcolor{comment}{/* Get a unique ID based on the counter */}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00197}00197         \textcolor{keywordtype}{id} = pci\_read\_config(dev, vsc\_addr + \mbox{\hyperlink{driver_8h_a634f9f55e799f3052a34590f08100017a907fd1567d0d55f8bc634950dfb875db}{MLX5\_VSC\_COUNTER\_OFFSET}}, 4);}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00198}00198 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00199}00199         \textcolor{comment}{/* Try to modify lock */}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00200}00200         ret = \mbox{\hyperlink{mlx5__vsc_8c_a6b2f11ae678928439bc236d6ca7eac80}{mlx5\_vsc\_write}}(mdev, addr, \&\textcolor{keywordtype}{id});}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00201}00201         \textcolor{keywordflow}{if} (ret)}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00202}00202                 \textcolor{keywordflow}{return} ret;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00203}00203 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00204}00204         \textcolor{comment}{/* Verify */}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00205}00205         ret = \mbox{\hyperlink{mlx5__vsc_8c_a2385c649e8efc0065db8330e25da821b}{mlx5\_vsc\_read}}(mdev, addr, \&\mbox{\hyperlink{mlx5__en__tx_8c_af943c26117683b64b9cd6943e2c496e5}{data}});}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00206}00206         \textcolor{keywordflow}{if} (ret)}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00207}00207                 \textcolor{keywordflow}{return} ret;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00208}00208         \textcolor{keywordflow}{if} (\mbox{\hyperlink{mlx5__en__tx_8c_af943c26117683b64b9cd6943e2c496e5}{data}} != \textcolor{keywordtype}{id})}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00209}00209                 \textcolor{keywordflow}{return} EBUSY;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00210}00210 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00211}00211         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00212}00212 \}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00213}00213 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00214}\mbox{\hyperlink{driver_8h_a70148b5466a34950ab92cc6a62f3ba14}{00214}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__vsc_8c_a70148b5466a34950ab92cc6a62f3ba14}{mlx5\_vsc\_unlock\_addr\_space}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *mdev, u32 addr)}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00215}00215 \{}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00216}00216         u32 \mbox{\hyperlink{mlx5__en__tx_8c_af943c26117683b64b9cd6943e2c496e5}{data}} = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00217}00217         \textcolor{keywordtype}{int} ret;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00218}00218 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00219}00219         ret = \mbox{\hyperlink{mlx5__vsc_8c_a28f27c48d084a78980255a2c8d425d70}{mlx5\_vsc\_set\_space}}(mdev, \mbox{\hyperlink{mlx5__ifc_8h_aa85e8d66aa325c34334bcaa049300dcda59f2d2172a614b4123c7e77a17a2329f}{MLX5\_VSC\_DOMAIN\_SEMAPHORES}});}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00220}00220         \textcolor{keywordflow}{if} (ret)}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00221}00221                 \textcolor{keywordflow}{return} ret;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00222}00222 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00223}00223         \textcolor{comment}{/* Try to modify lock */}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00224}00224         ret = \mbox{\hyperlink{mlx5__vsc_8c_a6b2f11ae678928439bc236d6ca7eac80}{mlx5\_vsc\_write}}(mdev, addr, \&\mbox{\hyperlink{mlx5__en__tx_8c_af943c26117683b64b9cd6943e2c496e5}{data}});}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00225}00225         \textcolor{keywordflow}{if} (ret)}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00226}00226                 \textcolor{keywordflow}{return} ret;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00227}00227 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00228}00228         \textcolor{comment}{/* Verify */}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00229}00229         ret = \mbox{\hyperlink{mlx5__vsc_8c_a2385c649e8efc0065db8330e25da821b}{mlx5\_vsc\_read}}(mdev, addr, \&\mbox{\hyperlink{mlx5__en__tx_8c_af943c26117683b64b9cd6943e2c496e5}{data}});}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00230}00230         \textcolor{keywordflow}{if} (ret)}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00231}00231                 \textcolor{keywordflow}{return} ret;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00232}00232         \textcolor{keywordflow}{if} (\mbox{\hyperlink{mlx5__en__tx_8c_af943c26117683b64b9cd6943e2c496e5}{data}} != 0)}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00233}00233                 \textcolor{keywordflow}{return} EBUSY;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00234}00234 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00235}00235         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00236}00236 \}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00237}00237 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00238}\mbox{\hyperlink{driver_8h_a88c68733f60b0815c2956064d490d07d}{00238}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__vsc_8c_a88c68733f60b0815c2956064d490d07d}{mlx5\_vsc\_find\_cap}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *mdev)}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00239}00239 \{}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00240}00240         \textcolor{keywordtype}{int} *capreg = \&mdev-\/>\mbox{\hyperlink{structmlx5__core__dev_ab33f60e0e7a1465eec9e9b9f4ec72292}{vsc\_addr}};}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00241}00241         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00242}00242 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00243}00243         err = pci\_find\_cap(mdev-\/>\mbox{\hyperlink{structmlx5__core__dev_a0819dc9fa4983c9140507e1a02aa8313}{pdev}}-\/>dev.bsddev, PCIY\_VENDOR, capreg);}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00244}00244 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00245}00245         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00246}00246                 *capreg = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00247}00247 }
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00248}00248         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00249}00249 \}}
\DoxyCodeLine{\Hypertarget{mlx5__vsc_8c_source_l00250}00250 }

\end{DoxyCode}
