\hypertarget{mlx5fpga__tools__main_8c_source}{}\doxysection{mlx5fpga\+\_\+tools\+\_\+main.\+c}
\label{mlx5fpga__tools__main_8c_source}\index{dev/mlx5/mlx5\_fpga\_tools/mlx5fpga\_tools\_main.c@{dev/mlx5/mlx5\_fpga\_tools/mlx5fpga\_tools\_main.c}}
\mbox{\hyperlink{mlx5fpga__tools__main_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2017 Mellanox Technologies. All rights reserved.}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00004}00004 \textcolor{comment}{ * This software is available to you under a choice of one of two}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00005}00005 \textcolor{comment}{ * licenses.  You may choose to be licensed under the terms of the GNU}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00006}00006 \textcolor{comment}{ * General Public License (GPL) Version 2, available from the file}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00007}00007 \textcolor{comment}{ * COPYING in the main directory of this source tree, or the}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00008}00008 \textcolor{comment}{ * OpenIB.org BSD license below:}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00009}00009 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00010}00010 \textcolor{comment}{ *     Redistribution and use in source and binary forms, with or}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00011}00011 \textcolor{comment}{ *     without modification, are permitted provided that the following}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00012}00012 \textcolor{comment}{ *     conditions are met:}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00013}00013 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00014}00014 \textcolor{comment}{ *      -\/ Redistributions of source code must retain the above}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00015}00015 \textcolor{comment}{ *        copyright notice, this list of conditions and the following}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00016}00016 \textcolor{comment}{ *        disclaimer.}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00017}00017 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00018}00018 \textcolor{comment}{ *      -\/ Redistributions in binary form must reproduce the above}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00019}00019 \textcolor{comment}{ *        copyright notice, this list of conditions and the following}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00020}00020 \textcolor{comment}{ *        disclaimer in the documentation and/or other materials}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00021}00021 \textcolor{comment}{ *        provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00022}00022 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00023}00023 \textcolor{comment}{ * THE SOFTWARE IS PROVIDED "{}AS IS"{}, WITHOUT WARRANTY OF ANY KIND,}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00024}00024 \textcolor{comment}{ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00025}00025 \textcolor{comment}{ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00026}00026 \textcolor{comment}{ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00027}00027 \textcolor{comment}{ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00028}00028 \textcolor{comment}{ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00029}00029 \textcolor{comment}{ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00030}00030 \textcolor{comment}{ * SOFTWARE.}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00031}00031 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00032}00032 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00033}00033 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00034}00034 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <linux/module.h>}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{tools_8h}{dev/mlx5/mlx5\_fpga\_tools/tools.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{tools__char_8h}{dev/mlx5/mlx5\_fpga\_tools/tools\_char.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00038}00038 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00039}00039 \textcolor{preprocessor}{\#if (\_\_FreeBSD\_version >= 1100000)}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00040}00040 \mbox{\hyperlink{mlx5fpga__tools__main_8c_ad2705d21c4b8b00518399218b7534249}{MODULE\_DEPEND}}(mlx5fpga\_tools, linuxkpi, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00041}00041 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00042}\mbox{\hyperlink{mlx5fpga__tools__main_8c_ad2705d21c4b8b00518399218b7534249}{00042}} \mbox{\hyperlink{mlx5fpga__tools__main_8c_ad2705d21c4b8b00518399218b7534249}{MODULE\_DEPEND}}(mlx5fpga\_tools, mlx5, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00043}\mbox{\hyperlink{mlx5fpga__tools__main_8c_ada569a27e19b643361480e46b44865bf}{00043}} \mbox{\hyperlink{mlx5fpga__tools__main_8c_ad2705d21c4b8b00518399218b7534249}{MODULE\_DEPEND}}(mlx5fpga\_tools, mlx5fpga, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00044}\mbox{\hyperlink{mlx5fpga__tools__main_8c_a63a7fe54f4d3987c6ead93c32d966fe9}{00044}} \mbox{\hyperlink{mlx5fpga__tools__main_8c_a63a7fe54f4d3987c6ead93c32d966fe9}{MODULE\_VERSION}}(mlx5fpga\_tools, 1);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00045}00045 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00046}00046 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5fpga__tools__main_8c_a147f24a5182a440404cdbe7acb6db06e}{mlx5\_fpga\_tools\_create}}(\textcolor{keyword}{struct} mlx5\_fpga\_device *fdev);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00047}00047 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5fpga__tools__main_8c_a7064cf4479a704000b0cd8116c7885b5}{mlx5\_fpga\_tools\_add}}(\textcolor{keyword}{struct} mlx5\_fpga\_device *fdev, u32 vid, u16 pid);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00048}00048 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5fpga__tools__main_8c_a47a98539f730be3dfd53f4fb7be9ed97}{mlx5\_fpga\_tools\_remove}}(\textcolor{keyword}{struct} mlx5\_fpga\_device *fdev);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00049}00049 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5fpga__tools__main_8c_ac3572324bc1d2c8fb8f7a755eeafcca7}{mlx5\_fpga\_tools\_destroy}}(\textcolor{keyword}{struct} mlx5\_fpga\_device *fdev);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00050}00050 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00051}00051 \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__fpga__tools__dev}{mlx5\_fpga\_tools\_dev}} *\mbox{\hyperlink{mlx5fpga__tools__main_8c_a819ecf2a368dbd3af2593db870aaf095}{mlx5\_fpga\_tools\_alloc}}(\textcolor{keyword}{struct} mlx5\_fpga\_device *\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00052}00052 \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5fpga__tools__main_8c_a1ef987d802bbe748124cf608c10207de}{mlx5\_fpga\_tools\_free}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__fpga__tools__dev}{mlx5\_fpga\_tools\_dev}} *tdev);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00053}00053 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00054}\mbox{\hyperlink{mlx5fpga__tools__main_8c_a5908f7f8d0dfd1d26d2790422981733a}{00054}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__fpga__client}{mlx5\_fpga\_client}} \mbox{\hyperlink{mlx5fpga__tools__main_8c_a5908f7f8d0dfd1d26d2790422981733a}{mlx5\_fpga\_tools\_client}} = \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00055}00055         .\mbox{\hyperlink{structmlx5__fpga__client_a3a924316a0f2712458b755e62dc51102}{name}} = \mbox{\hyperlink{tools_8h_af110801a5be94b102d360cc24000ad6a}{MLX5\_FPGA\_TOOLS\_DRIVER\_NAME}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00056}00056         .create = \mbox{\hyperlink{mlx5fpga__tools__main_8c_a147f24a5182a440404cdbe7acb6db06e}{mlx5\_fpga\_tools\_create}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00057}00057         .add = \mbox{\hyperlink{mlx5fpga__tools__main_8c_a7064cf4479a704000b0cd8116c7885b5}{mlx5\_fpga\_tools\_add}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00058}00058         .remove = \mbox{\hyperlink{mlx5fpga__tools__main_8c_a47a98539f730be3dfd53f4fb7be9ed97}{mlx5\_fpga\_tools\_remove}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00059}00059         .destroy = \mbox{\hyperlink{mlx5fpga__tools__main_8c_ac3572324bc1d2c8fb8f7a755eeafcca7}{mlx5\_fpga\_tools\_destroy}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00060}00060 \};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00061}00061 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00062}\mbox{\hyperlink{mlx5fpga__tools__main_8c_a819ecf2a368dbd3af2593db870aaf095}{00062}} \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__fpga__tools__dev}{mlx5\_fpga\_tools\_dev}} *\mbox{\hyperlink{mlx5fpga__tools__main_8c_a819ecf2a368dbd3af2593db870aaf095}{mlx5\_fpga\_tools\_alloc}}(\textcolor{keyword}{struct} mlx5\_fpga\_device *\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}})}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00063}00063 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00064}00064         \textcolor{keywordtype}{int} ret;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00065}00065         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__fpga__tools__dev}{mlx5\_fpga\_tools\_dev}} *tdev;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00066}00066 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00067}00067         tdev = kzalloc(\textcolor{keyword}{sizeof}(*tdev), GFP\_KERNEL);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00068}00068         \textcolor{keywordflow}{if} (!tdev)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00069}00069                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00070}00070 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00071}00071         tdev-\/>\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}} = \mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00072}00072         sx\_init(\&tdev-\/>\mbox{\hyperlink{structmlx5__fpga__tools__dev_adffbf51e6bfeda9b397aced1197e7600}{lock}}, \textcolor{stringliteral}{"{}mlx5fpgat"{}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00073}00073         ret = \mbox{\hyperlink{mlx5fpga__tools__char_8c_aed301af06830b6d9c79276b62c495d62}{mlx5\_fpga\_tools\_char\_add\_one}}(tdev);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00074}00074         \textcolor{keywordflow}{if} (ret)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00075}00075                 \textcolor{keywordflow}{goto} err\_free;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00076}00076 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00077}00077         \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00078}00078 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00079}00079 err\_free:}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00080}00080         kfree(tdev);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00081}00081         tdev = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00082}00082 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00083}00083 out:}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00084}00084         \textcolor{keywordflow}{return} tdev;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00085}00085 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00086}00086 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00087}\mbox{\hyperlink{mlx5fpga__tools__main_8c_a1ef987d802bbe748124cf608c10207de}{00087}} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5fpga__tools__main_8c_a1ef987d802bbe748124cf608c10207de}{mlx5\_fpga\_tools\_free}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__fpga__tools__dev}{mlx5\_fpga\_tools\_dev}} *tdev)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00088}00088 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00089}00089         \mbox{\hyperlink{mlx5fpga__tools__char_8c_ae493128112d662eb60813c651bd01012}{mlx5\_fpga\_tools\_char\_remove\_one}}(tdev);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00090}00090         kfree(tdev);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00091}00091 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00092}00092 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00093}\mbox{\hyperlink{mlx5fpga__tools__main_8c_a147f24a5182a440404cdbe7acb6db06e}{00093}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5fpga__tools__main_8c_a147f24a5182a440404cdbe7acb6db06e}{mlx5\_fpga\_tools\_create}}(\textcolor{keyword}{struct} mlx5\_fpga\_device *\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}})}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00094}00094 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00095}00095         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__fpga__tools__dev}{mlx5\_fpga\_tools\_dev}} *dev = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00096}00096 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00097}00097         dev\_dbg(\mbox{\hyperlink{mlx5fpga__sdk_8c_a65c1ff2325c686679319de217a23f645}{mlx5\_fpga\_dev}}(\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}}), \textcolor{stringliteral}{"{}tools\_create\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00098}00098 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00099}00099         dev = \mbox{\hyperlink{mlx5fpga__tools__main_8c_a819ecf2a368dbd3af2593db870aaf095}{mlx5\_fpga\_tools\_alloc}}(\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00100}00100         \textcolor{keywordflow}{if} (!dev)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00101}00101                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00102}00102 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00103}00103         \mbox{\hyperlink{mlx5fpga__sdk_8c_a1279b4bd6acbd01f22ef5cc7b2cce72f}{mlx5\_fpga\_client\_data\_set}}(\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}}, \&\mbox{\hyperlink{mlx5fpga__tools__main_8c_a5908f7f8d0dfd1d26d2790422981733a}{mlx5\_fpga\_tools\_client}}, dev);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00104}00104 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00105}00105 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00106}\mbox{\hyperlink{mlx5fpga__tools__main_8c_a7064cf4479a704000b0cd8116c7885b5}{00106}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5fpga__tools__main_8c_a7064cf4479a704000b0cd8116c7885b5}{mlx5\_fpga\_tools\_add}}(\textcolor{keyword}{struct} mlx5\_fpga\_device *\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}}, u32 vid, u16 pid)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00107}00107 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00108}00108         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00109}00109 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00110}00110 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00111}\mbox{\hyperlink{mlx5fpga__tools__main_8c_a47a98539f730be3dfd53f4fb7be9ed97}{00111}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5fpga__tools__main_8c_a47a98539f730be3dfd53f4fb7be9ed97}{mlx5\_fpga\_tools\_remove}}(\textcolor{keyword}{struct} mlx5\_fpga\_device *\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}})}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00112}00112 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00113}00113 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00114}00114 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00115}\mbox{\hyperlink{mlx5fpga__tools__main_8c_ac3572324bc1d2c8fb8f7a755eeafcca7}{00115}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5fpga__tools__main_8c_ac3572324bc1d2c8fb8f7a755eeafcca7}{mlx5\_fpga\_tools\_destroy}}(\textcolor{keyword}{struct} mlx5\_fpga\_device *\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}})}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00116}00116 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00117}00117         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__fpga__tools__dev}{mlx5\_fpga\_tools\_dev}} *dev;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00118}00118 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00119}00119         dev\_dbg(\mbox{\hyperlink{mlx5fpga__sdk_8c_a65c1ff2325c686679319de217a23f645}{mlx5\_fpga\_dev}}(\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}}), \textcolor{stringliteral}{"{}tools\_destroy\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00120}00120 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00121}00121         dev = \mbox{\hyperlink{mlx5fpga__sdk_8c_a0fcc4bf118437af06c4c8e48384d96c2}{mlx5\_fpga\_client\_data\_get}}(\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}}, \&\mbox{\hyperlink{mlx5fpga__tools__main_8c_a5908f7f8d0dfd1d26d2790422981733a}{mlx5\_fpga\_tools\_client}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00122}00122         \textcolor{keywordflow}{if} (dev)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00123}00123                 \mbox{\hyperlink{mlx5fpga__tools__main_8c_a1ef987d802bbe748124cf608c10207de}{mlx5\_fpga\_tools\_free}}(dev);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00124}00124 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00125}00125 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00126}\mbox{\hyperlink{mlx5fpga__tools__main_8c_a62d8abd398f407e6bd68550ae7d7cec1}{00126}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \_\_init \mbox{\hyperlink{mlx5fpga__tools__main_8c_a62d8abd398f407e6bd68550ae7d7cec1}{mlx5\_fpga\_tools\_init}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00127}00127 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00128}00128         \textcolor{keywordtype}{int} ret = \mbox{\hyperlink{mlx5fpga__tools__char_8c_a3dff62f3ca59225589c7bb03c8bccf31}{mlx5\_fpga\_tools\_char\_init}}();}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00129}00129 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00130}00130         \textcolor{keywordflow}{if} (ret)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00131}00131                 \textcolor{keywordflow}{return} ret;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00132}00132         \mbox{\hyperlink{mlx5fpga__core_8c_ae51eae27ad348ffebb68719be9f5fb7e}{mlx5\_fpga\_client\_register}}(\&\mbox{\hyperlink{mlx5fpga__tools__main_8c_a5908f7f8d0dfd1d26d2790422981733a}{mlx5\_fpga\_tools\_client}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00133}00133         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00134}00134 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00135}00135 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00136}\mbox{\hyperlink{mlx5fpga__tools__main_8c_a0245adaa93fa1a1be528c9a97a0e6cd9}{00136}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \_\_exit \mbox{\hyperlink{mlx5fpga__tools__main_8c_a0245adaa93fa1a1be528c9a97a0e6cd9}{mlx5\_fpga\_tools\_exit}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00137}00137 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00138}00138         \mbox{\hyperlink{mlx5fpga__core_8c_a894ca632c7439cf1a3fbb660aaf7082c}{mlx5\_fpga\_client\_unregister}}(\&\mbox{\hyperlink{mlx5fpga__tools__main_8c_a5908f7f8d0dfd1d26d2790422981733a}{mlx5\_fpga\_tools\_client}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00139}00139         \mbox{\hyperlink{mlx5fpga__tools__char_8c_a10b49528545e5ccbb0e538803c39a32b}{mlx5\_fpga\_tools\_char\_deinit}}();}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00140}00140 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00141}00141 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00142}\mbox{\hyperlink{mlx5fpga__tools__main_8c_a4e673e98072480159cf9c13e7663d3db}{00142}} \mbox{\hyperlink{mlx5fpga__tools__main_8c_a4e673e98072480159cf9c13e7663d3db}{module\_init\_order}}(\mbox{\hyperlink{mlx5fpga__tools__main_8c_a62d8abd398f407e6bd68550ae7d7cec1}{mlx5\_fpga\_tools\_init}}, SI\_ORDER\_SECOND);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__main_8c_source_l00143}\mbox{\hyperlink{mlx5fpga__tools__main_8c_a13da5edc16455e14e12baa90ea04a34f}{00143}} \mbox{\hyperlink{mlx5fpga__tools__main_8c_a13da5edc16455e14e12baa90ea04a34f}{module\_exit\_order}}(\mbox{\hyperlink{mlx5fpga__tools__main_8c_a0245adaa93fa1a1be528c9a97a0e6cd9}{mlx5\_fpga\_tools\_exit}}, SI\_ORDER\_SECOND);}

\end{DoxyCode}
