\hypertarget{mlx5fpga__tools__char_8c_source}{}\doxysection{mlx5fpga\+\_\+tools\+\_\+char.\+c}
\label{mlx5fpga__tools__char_8c_source}\index{dev/mlx5/mlx5\_fpga\_tools/mlx5fpga\_tools\_char.c@{dev/mlx5/mlx5\_fpga\_tools/mlx5fpga\_tools\_char.c}}
\mbox{\hyperlink{mlx5fpga__tools__char_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2017 Mellanox Technologies. All rights reserved.}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00004}00004 \textcolor{comment}{ * This software is available to you under a choice of one of two}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00005}00005 \textcolor{comment}{ * licenses.  You may choose to be licensed under the terms of the GNU}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00006}00006 \textcolor{comment}{ * General Public License (GPL) Version 2, available from the file}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00007}00007 \textcolor{comment}{ * COPYING in the main directory of this source tree, or the}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00008}00008 \textcolor{comment}{ * OpenIB.org BSD license below:}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00009}00009 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00010}00010 \textcolor{comment}{ *     Redistribution and use in source and binary forms, with or}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00011}00011 \textcolor{comment}{ *     without modification, are permitted provided that the following}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00012}00012 \textcolor{comment}{ *     conditions are met:}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00013}00013 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00014}00014 \textcolor{comment}{ *      -\/ Redistributions of source code must retain the above}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00015}00015 \textcolor{comment}{ *        copyright notice, this list of conditions and the following}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00016}00016 \textcolor{comment}{ *        disclaimer.}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00017}00017 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00018}00018 \textcolor{comment}{ *      -\/ Redistributions in binary form must reproduce the above}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00019}00019 \textcolor{comment}{ *        copyright notice, this list of conditions and the following}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00020}00020 \textcolor{comment}{ *        disclaimer in the documentation and/or other materials}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00021}00021 \textcolor{comment}{ *        provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00022}00022 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00023}00023 \textcolor{comment}{ * THE SOFTWARE IS PROVIDED "{}AS IS"{}, WITHOUT WARRANTY OF ANY KIND,}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00024}00024 \textcolor{comment}{ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00025}00025 \textcolor{comment}{ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00026}00026 \textcolor{comment}{ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00027}00027 \textcolor{comment}{ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00028}00028 \textcolor{comment}{ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00029}00029 \textcolor{comment}{ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00030}00030 \textcolor{comment}{ * SOFTWARE.}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00031}00031 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00032}00032 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00033}00033 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00034}00034 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/conf.h>}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{mlx5io_8h}{dev/mlx5/mlx5io.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{tools__char_8h}{dev/mlx5/mlx5\_fpga\_tools/tools\_char.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00040}00040 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00041}\mbox{\hyperlink{mlx5fpga__tools__char_8c_aea3cfda4f3a9f978ec759f206cf186fe}{00041}} \textcolor{preprocessor}{\#define CHUNK\_SIZE (128 * 1024)}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00042}00042 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00043}\mbox{\hyperlink{structtools__context}{00043}} \textcolor{keyword}{struct }\mbox{\hyperlink{structtools__context}{tools\_context}} \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00044}\mbox{\hyperlink{structtools__context_a193011553706272575c538ee3f192dd9}{00044}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__fpga__tools__dev}{mlx5\_fpga\_tools\_dev}} *\mbox{\hyperlink{structtools__context_a193011553706272575c538ee3f192dd9}{tdev}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00045}\mbox{\hyperlink{structtools__context_a5f603105d7d641d6f3560e423031edc9}{00045}}         \textcolor{keyword}{enum} \mbox{\hyperlink{mlx5io_8h_a3dfefb3a6f72bdc66a27282031d1350b}{mlx5\_fpga\_access\_type}} \mbox{\hyperlink{structtools__context_a5f603105d7d641d6f3560e423031edc9}{access\_type}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00046}00046 \};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00047}00047 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00048}00048 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00049}\mbox{\hyperlink{mlx5fpga__tools__char_8c_af2a89b0ce6a1f3d02510eb50965340be}{00049}} \mbox{\hyperlink{mlx5fpga__tools__char_8c_af2a89b0ce6a1f3d02510eb50965340be}{tools\_char\_ctx\_dtor}}(\textcolor{keywordtype}{void} *\mbox{\hyperlink{mlx5__en__tx_8c_af943c26117683b64b9cd6943e2c496e5}{data}})}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00050}00050 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00051}00051 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00052}00052         free(\mbox{\hyperlink{mlx5__en__tx_8c_af943c26117683b64b9cd6943e2c496e5}{data}}, M\_DEVBUF);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00053}00053 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00054}00054 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00055}00055 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00056}\mbox{\hyperlink{mlx5fpga__tools__char_8c_a7fcdadce87dd800a77774599cdc217ab}{00056}} \mbox{\hyperlink{mlx5fpga__tools__char_8c_a7fcdadce87dd800a77774599cdc217ab}{tools\_char\_open}}(\textcolor{keyword}{struct} cdev *dev, \textcolor{keywordtype}{int} oflags, \textcolor{keywordtype}{int} devtype, \textcolor{keyword}{struct} thread *td)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00057}00057 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00058}00058         \textcolor{keyword}{struct }\mbox{\hyperlink{structtools__context}{tools\_context}} *context;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00059}00059 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00060}00060         context = malloc(\textcolor{keyword}{sizeof}(*context), M\_DEVBUF, M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00061}00061         context-\/>\mbox{\hyperlink{structtools__context_a193011553706272575c538ee3f192dd9}{tdev}} = dev-\/>si\_drv1;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00062}00062         context-\/>\mbox{\hyperlink{structtools__context_a5f603105d7d641d6f3560e423031edc9}{access\_type}} = \mbox{\hyperlink{mlx5io_8h_a3dfefb3a6f72bdc66a27282031d1350ba61675a1252d96c29834cee811c8517d1}{MLX5\_FPGA\_ACCESS\_TYPE\_DONTCARE}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00063}00063         devfs\_set\_cdevpriv(context, \mbox{\hyperlink{mlx5fpga__tools__char_8c_af2a89b0ce6a1f3d02510eb50965340be}{tools\_char\_ctx\_dtor}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00064}00064         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00065}00065 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00066}00066 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00067}00067 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00068}\mbox{\hyperlink{mlx5fpga__tools__char_8c_a5b4017c2ee4db6477573af4f12a210cf}{00068}} \mbox{\hyperlink{mlx5fpga__tools__char_8c_a5b4017c2ee4db6477573af4f12a210cf}{mem\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__fpga__tools__dev}{mlx5\_fpga\_tools\_dev}} *\mbox{\hyperlink{structtools__context_a193011553706272575c538ee3f192dd9}{tdev}}, \textcolor{keywordtype}{void} *buf, \textcolor{keywordtype}{size\_t} count,}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00069}00069     u64 address, \textcolor{keyword}{enum} \mbox{\hyperlink{mlx5io_8h_a3dfefb3a6f72bdc66a27282031d1350b}{mlx5\_fpga\_access\_type}} \mbox{\hyperlink{structtools__context_a5f603105d7d641d6f3560e423031edc9}{access\_type}}, \textcolor{keywordtype}{size\_t} *retcnt)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00070}00070 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00071}00071         \textcolor{keywordtype}{int} ret;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00072}00072 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00073}00073         ret = sx\_xlock\_sig(\&\mbox{\hyperlink{structtools__context_a193011553706272575c538ee3f192dd9}{tdev}}-\/>\mbox{\hyperlink{structmlx5__fpga__tools__dev_adffbf51e6bfeda9b397aced1197e7600}{lock}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00074}00074         \textcolor{keywordflow}{if} (ret != 0)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00075}00075                 \textcolor{keywordflow}{return} (ret);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00076}00076         ret = \mbox{\hyperlink{mlx5fpga__sdk_8c_a40f307d6aeef9f487f352bdf61c1f27d}{mlx5\_fpga\_mem\_read}}(\mbox{\hyperlink{structtools__context_a193011553706272575c538ee3f192dd9}{tdev}}-\/>\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}}, count, address, buf, \mbox{\hyperlink{structtools__context_a5f603105d7d641d6f3560e423031edc9}{access\_type}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00077}00077         sx\_xunlock(\&\mbox{\hyperlink{structtools__context_a193011553706272575c538ee3f192dd9}{tdev}}-\/>\mbox{\hyperlink{structmlx5__fpga__tools__dev_adffbf51e6bfeda9b397aced1197e7600}{lock}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00078}00078         \textcolor{keywordflow}{if} (ret < 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00079}00079                 dev\_dbg(\mbox{\hyperlink{mlx5fpga__sdk_8c_a65c1ff2325c686679319de217a23f645}{mlx5\_fpga\_dev}}(\mbox{\hyperlink{structtools__context_a193011553706272575c538ee3f192dd9}{tdev}}-\/>\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}}),}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00080}00080                         \textcolor{stringliteral}{"{}Failed to read \%zu bytes at address 0x\%jx: \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00081}00081                         count, (uintmax\_t)address, ret);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00082}00082                 \textcolor{keywordflow}{return} (-\/ret);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00083}00083         \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00084}00084         *retcnt = ret;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00085}00085         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00086}00086 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00087}00087 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00088}00088 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00089}\mbox{\hyperlink{mlx5fpga__tools__char_8c_ae458d53f314efabecbef10f6f58357b3}{00089}} \mbox{\hyperlink{mlx5fpga__tools__char_8c_ae458d53f314efabecbef10f6f58357b3}{mem\_write}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__fpga__tools__dev}{mlx5\_fpga\_tools\_dev}} *\mbox{\hyperlink{structtools__context_a193011553706272575c538ee3f192dd9}{tdev}}, \textcolor{keywordtype}{void} *buf, \textcolor{keywordtype}{size\_t} count,}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00090}00090     u64 address, \textcolor{keyword}{enum} \mbox{\hyperlink{mlx5io_8h_a3dfefb3a6f72bdc66a27282031d1350b}{mlx5\_fpga\_access\_type}} \mbox{\hyperlink{structtools__context_a5f603105d7d641d6f3560e423031edc9}{access\_type}}, \textcolor{keywordtype}{size\_t} *retcnt)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00091}00091 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00092}00092         \textcolor{keywordtype}{int} ret;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00093}00093 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00094}00094         ret = sx\_xlock\_sig(\&\mbox{\hyperlink{structtools__context_a193011553706272575c538ee3f192dd9}{tdev}}-\/>\mbox{\hyperlink{structmlx5__fpga__tools__dev_adffbf51e6bfeda9b397aced1197e7600}{lock}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00095}00095         \textcolor{keywordflow}{if} (ret != 0)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00096}00096                 \textcolor{keywordflow}{return} (ret);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00097}00097         ret = \mbox{\hyperlink{mlx5fpga__sdk_8c_a6b5db119213f05d06cbe71dacf0c64f0}{mlx5\_fpga\_mem\_write}}(\mbox{\hyperlink{structtools__context_a193011553706272575c538ee3f192dd9}{tdev}}-\/>\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}}, count, address, buf, \mbox{\hyperlink{structtools__context_a5f603105d7d641d6f3560e423031edc9}{access\_type}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00098}00098         sx\_xunlock(\&\mbox{\hyperlink{structtools__context_a193011553706272575c538ee3f192dd9}{tdev}}-\/>\mbox{\hyperlink{structmlx5__fpga__tools__dev_adffbf51e6bfeda9b397aced1197e7600}{lock}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00099}00099         \textcolor{keywordflow}{if} (ret < 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00100}00100                 dev\_dbg(\mbox{\hyperlink{mlx5fpga__sdk_8c_a65c1ff2325c686679319de217a23f645}{mlx5\_fpga\_dev}}(\mbox{\hyperlink{structtools__context_a193011553706272575c538ee3f192dd9}{tdev}}-\/>\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}}),}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00101}00101                         \textcolor{stringliteral}{"{}Failed to write \%zu bytes at address 0x\%jx: \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00102}00102                         count, (uintmax\_t)address, ret);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00103}00103                 \textcolor{keywordflow}{return} (-\/ret);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00104}00104         \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00105}00105         *retcnt = ret;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00106}00106         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00107}00107 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00108}00108 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00109}00109 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00110}\mbox{\hyperlink{mlx5fpga__tools__char_8c_a2ceddc830a9e4ebf4de57e7518b19ac7}{00110}} \mbox{\hyperlink{mlx5fpga__tools__char_8c_a2ceddc830a9e4ebf4de57e7518b19ac7}{tools\_char\_llseek}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structtools__context}{tools\_context}} *context, \textcolor{keyword}{struct} uio *uio, ssize\_t *len)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00111}00111 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00112}00112         uint64\_t fbase, fsize;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00113}00113         \textcolor{keywordtype}{size\_t} llen;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00114}00114 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00115}00115         llen = uio-\/>uio\_resid;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00116}00116         \textcolor{keywordflow}{if} (llen < 1) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00117}00117                 *len = 0;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00118}00118                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00119}00119         \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00120}00120         \textcolor{keywordflow}{if} (llen > \mbox{\hyperlink{mlx5fpga__tools__char_8c_aea3cfda4f3a9f978ec759f206cf186fe}{CHUNK\_SIZE}})}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00121}00121                 llen = \mbox{\hyperlink{mlx5fpga__tools__char_8c_aea3cfda4f3a9f978ec759f206cf186fe}{CHUNK\_SIZE}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00122}00122         fbase = \mbox{\hyperlink{mlx5fpga__sdk_8c_a33f3dc86d19dbc21a46446cd9f6f69a7}{mlx5\_fpga\_ddr\_base\_get}}(context-\/>\mbox{\hyperlink{structtools__context_a193011553706272575c538ee3f192dd9}{tdev}}-\/>\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00123}00123         fsize = \mbox{\hyperlink{mlx5fpga__sdk_8c_a62c37c1d83be73ee481cbbc09cfbf034}{mlx5\_fpga\_ddr\_size\_get}}(context-\/>\mbox{\hyperlink{structtools__context_a193011553706272575c538ee3f192dd9}{tdev}}-\/>\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00124}00124         \textcolor{keywordflow}{if} (uio-\/>uio\_offset > fbase)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00125}00125                 *len = 0;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00126}00126         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (uio-\/>uio\_offset + *len > fbase + fsize)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00127}00127                 *len = fbase + fsize -\/ uio-\/>uio\_offset;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00128}00128         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00129}00129                 *len = llen;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00130}00130 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00131}00131 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00132}00132 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00133}\mbox{\hyperlink{mlx5fpga__tools__char_8c_a536c39122e573bc00b6242af5c82ef9d}{00133}} \mbox{\hyperlink{mlx5fpga__tools__char_8c_a536c39122e573bc00b6242af5c82ef9d}{tools\_char\_read}}(\textcolor{keyword}{struct} cdev *dev, \textcolor{keyword}{struct} uio *uio, \textcolor{keywordtype}{int} ioflag)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00134}00134 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00135}00135         \textcolor{keyword}{struct }\mbox{\hyperlink{structtools__context}{tools\_context}} *context;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00136}00136         \textcolor{keywordtype}{void} *kbuf;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00137}00137         \textcolor{keywordtype}{size\_t} len, len1;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00138}00138         \textcolor{keywordtype}{int} ret;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00139}00139 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00140}00140         ret = devfs\_get\_cdevpriv((\textcolor{keywordtype}{void} **)\&context);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00141}00141         \textcolor{keywordflow}{if} (ret != 0)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00142}00142                 \textcolor{keywordflow}{return} (ret);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00143}00143         dev\_dbg(\mbox{\hyperlink{mlx5fpga__sdk_8c_a65c1ff2325c686679319de217a23f645}{mlx5\_fpga\_dev}}(context-\/>\mbox{\hyperlink{structtools__context_a193011553706272575c538ee3f192dd9}{tdev}}-\/>\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}}),}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00144}00144             \textcolor{stringliteral}{"{}tools char device reading \%zu bytes at 0x\%jx\(\backslash\)n"{}}, uio-\/>uio\_resid,}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00145}00145              (uintmax\_t)uio-\/>uio\_offset);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00146}00146 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00147}00147         \mbox{\hyperlink{mlx5fpga__tools__char_8c_a2ceddc830a9e4ebf4de57e7518b19ac7}{tools\_char\_llseek}}(context, uio, \&len);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00148}00148         \textcolor{keywordflow}{if} (len == 0)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00149}00149                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00150}00150 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00151}00151         kbuf = malloc(len, M\_DEVBUF, M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00152}00152         ret = \mbox{\hyperlink{mlx5fpga__tools__char_8c_a5b4017c2ee4db6477573af4f12a210cf}{mem\_read}}(context-\/>\mbox{\hyperlink{structtools__context_a193011553706272575c538ee3f192dd9}{tdev}}, kbuf, len, uio-\/>uio\_offset,}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00153}00153             context-\/>\mbox{\hyperlink{structtools__context_a5f603105d7d641d6f3560e423031edc9}{access\_type}}, \&len1);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00154}00154         \textcolor{keywordflow}{if} (ret == 0)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00155}00155                 ret = uiomove(kbuf, len1, uio);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00156}00156         free(kbuf, M\_DEVBUF);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00157}00157         \textcolor{keywordflow}{return} (ret);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00158}00158 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00159}00159 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00160}00160 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00161}\mbox{\hyperlink{mlx5fpga__tools__char_8c_a2132acbe78eb1d35482cef3a9f7a7227}{00161}} \mbox{\hyperlink{mlx5fpga__tools__char_8c_a2132acbe78eb1d35482cef3a9f7a7227}{tools\_char\_write}}(\textcolor{keyword}{struct} cdev *dev, \textcolor{keyword}{struct} uio *uio, \textcolor{keywordtype}{int} ioflag)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00162}00162 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00163}00163         \textcolor{keyword}{struct }\mbox{\hyperlink{structtools__context}{tools\_context}} *context;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00164}00164         \textcolor{keywordtype}{void} *kbuf;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00165}00165         off\_t of;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00166}00166         \textcolor{keywordtype}{size\_t} len, len1;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00167}00167         \textcolor{keywordtype}{int} ret;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00168}00168 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00169}00169         ret = devfs\_get\_cdevpriv((\textcolor{keywordtype}{void} **)\&context);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00170}00170         \textcolor{keywordflow}{if} (ret != 0)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00171}00171                 \textcolor{keywordflow}{return} (ret);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00172}00172         dev\_dbg(\mbox{\hyperlink{mlx5fpga__sdk_8c_a65c1ff2325c686679319de217a23f645}{mlx5\_fpga\_dev}}(context-\/>\mbox{\hyperlink{structtools__context_a193011553706272575c538ee3f192dd9}{tdev}}-\/>\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}}),}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00173}00173             \textcolor{stringliteral}{"{}tools char device reading \%zu bytes at 0x\%jx\(\backslash\)n"{}}, uio-\/>uio\_resid,}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00174}00174             (uintmax\_t)uio-\/>uio\_offset);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00175}00175 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00176}00176         \mbox{\hyperlink{mlx5fpga__tools__char_8c_a2ceddc830a9e4ebf4de57e7518b19ac7}{tools\_char\_llseek}}(context, uio, \&len);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00177}00177         \textcolor{keywordflow}{if} (len == 0)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00178}00178                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00179}00179 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00180}00180         kbuf = malloc(len, M\_DEVBUF, M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00181}00181         len1 = uio-\/>uio\_resid;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00182}00182         of = uio-\/>uio\_offset;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00183}00183 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00184}00184         ret = uiomove(kbuf, len, uio);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00185}00185         \textcolor{keywordflow}{if} (ret == 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00186}00186                 len1 -\/= uio-\/>uio\_resid;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00187}00187                 ret = \mbox{\hyperlink{mlx5fpga__tools__char_8c_ae458d53f314efabecbef10f6f58357b3}{mem\_write}}(context-\/>\mbox{\hyperlink{structtools__context_a193011553706272575c538ee3f192dd9}{tdev}}, kbuf, len, of,}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00188}00188                     context-\/>\mbox{\hyperlink{structtools__context_a5f603105d7d641d6f3560e423031edc9}{access\_type}}, \&len1);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00189}00189         \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00190}00190         free(kbuf, M\_DEVBUF);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00191}00191         \textcolor{keywordflow}{return} (ret);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00192}00192 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00193}00193 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00194}\mbox{\hyperlink{mlx5fpga__tools__char_8c_a164df1937f75d7dbf4b9a3f369203d22}{00194}} \mbox{\hyperlink{mlx5fpga__tools__char_8c_a164df1937f75d7dbf4b9a3f369203d22}{CTASSERT}}(\mbox{\hyperlink{mlx5io_8h_a93efc072ca718fe70be5c4074f893b3d}{MLX5\_FPGA\_CAP\_ARR\_SZ}} == \mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(fpga\_cap));}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00195}00195 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00196}00196 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00197}\mbox{\hyperlink{mlx5fpga__tools__char_8c_a76daf0e51f691a26b896fd8f83cf3ef6}{00197}} \mbox{\hyperlink{mlx5fpga__tools__char_8c_a76daf0e51f691a26b896fd8f83cf3ef6}{tools\_char\_ioctl}}(\textcolor{keyword}{struct} cdev *dev, u\_long cmd, caddr\_t \mbox{\hyperlink{mlx5__en__tx_8c_af943c26117683b64b9cd6943e2c496e5}{data}}, \textcolor{keywordtype}{int} fflag,}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00198}00198     \textcolor{keyword}{struct} thread *td)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00199}00199 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00200}00200         \textcolor{keyword}{struct }\mbox{\hyperlink{structtools__context}{tools\_context}} *context;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00201}00201         \textcolor{keyword}{struct }mlx5\_fpga\_device *fdev;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00202}00202         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__fpga__query}{mlx5\_fpga\_query}} query;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00203}00203         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__fpga__temperature}{mlx5\_fpga\_temperature}} *\mbox{\hyperlink{structmlx5__fpga__temperature_ae269b96397899a1eb7331314462d3005}{temperature}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00204}00204         \textcolor{keyword}{enum} \mbox{\hyperlink{mlx5io_8h_ac573a5194065f34c0973d752102e6dd4}{mlx5\_fpga\_connect}} *connect;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00205}00205         u32 fpga\_cap[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(fpga\_cap)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00206}00206         \textcolor{keywordtype}{int} arg, err;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00207}00207 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00208}00208         err = devfs\_get\_cdevpriv((\textcolor{keywordtype}{void} **)\&context);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00209}00209         \textcolor{keywordflow}{if} (err != 0)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00210}00210                 \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00211}00211         fdev = context-\/>\mbox{\hyperlink{structtools__context_a193011553706272575c538ee3f192dd9}{tdev}}-\/>\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00212}00212         \textcolor{keywordflow}{if} (fdev == NULL)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00213}00213                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00214}00214 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00215}00215         \textcolor{keywordflow}{switch} (cmd) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00216}00216         \textcolor{keywordflow}{case} \mbox{\hyperlink{mlx5io_8h_a6086ed777f8aaab5c886becc8ebfb935}{MLX5\_FPGA\_ACCESS\_TYPE}}:}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00217}00217                 arg = *(\textcolor{keywordtype}{int} *)\mbox{\hyperlink{mlx5__en__tx_8c_af943c26117683b64b9cd6943e2c496e5}{data}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00218}00218                 \textcolor{keywordflow}{if} (arg > \mbox{\hyperlink{mlx5io_8h_a3dfefb3a6f72bdc66a27282031d1350bae7ba3ff42a463c314ffe8b2f0d37f2a7}{MLX5\_FPGA\_ACCESS\_TYPE\_MAX}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00219}00219                         dev\_err(\mbox{\hyperlink{mlx5fpga__sdk_8c_a65c1ff2325c686679319de217a23f645}{mlx5\_fpga\_dev}}(fdev),}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00220}00220                             \textcolor{stringliteral}{"{}unknown access type \%u\(\backslash\)n"{}}, arg);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00221}00221                         err = EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00222}00222                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00223}00223                 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00224}00224                 context-\/>\mbox{\hyperlink{structtools__context_a5f603105d7d641d6f3560e423031edc9}{access\_type}} = arg;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00225}00225                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00226}00226         \textcolor{keywordflow}{case} \mbox{\hyperlink{mlx5io_8h_ab9f3bc632bf7f9343c4d251d25599793}{MLX5\_FPGA\_LOAD}}:}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00227}00227                 arg = *(\textcolor{keywordtype}{int} *)\mbox{\hyperlink{mlx5__en__tx_8c_af943c26117683b64b9cd6943e2c496e5}{data}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00228}00228                 \textcolor{keywordflow}{if} (arg > \mbox{\hyperlink{mlx5io_8h_abd09d1f785591c0ccc8fe9e49fd49303ad9b44985c2d3522dd22e3635e7cc5ad8}{MLX5\_FPGA\_IMAGE\_FACTORY}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00229}00229                         dev\_err(\mbox{\hyperlink{mlx5fpga__sdk_8c_a65c1ff2325c686679319de217a23f645}{mlx5\_fpga\_dev}}(fdev),}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00230}00230                                 \textcolor{stringliteral}{"{}unknown image type \%u\(\backslash\)n"{}}, arg);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00231}00231                         err = EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00232}00232                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00233}00233                 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00234}00234                 err = \mbox{\hyperlink{mlx5fpga__sdk_8c_aa8f01dd739144008cb2b3a04b3c58783}{mlx5\_fpga\_device\_reload}}(fdev, arg);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00235}00235                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00236}00236         \textcolor{keywordflow}{case} \mbox{\hyperlink{mlx5io_8h_a5c0e83bc8d678bb5673fb62f4a63b795}{MLX5\_FPGA\_RESET}}:}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00237}00237                 err = \mbox{\hyperlink{mlx5fpga__sdk_8c_aa8f01dd739144008cb2b3a04b3c58783}{mlx5\_fpga\_device\_reload}}(fdev, \mbox{\hyperlink{mlx5io_8h_abd09d1f785591c0ccc8fe9e49fd49303a0296a8cbe4b0668f22c2a2f1fb763cc8}{MLX5\_FPGA\_IMAGE\_RESET}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00238}00238                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00239}00239         \textcolor{keywordflow}{case} \mbox{\hyperlink{mlx5io_8h_a3ffa877f2613e5b6cc356d8da599ca16}{MLX5\_FPGA\_RELOAD}}:}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00240}00240                 err = \mbox{\hyperlink{mlx5fpga__sdk_8c_aa8f01dd739144008cb2b3a04b3c58783}{mlx5\_fpga\_device\_reload}}(fdev, \mbox{\hyperlink{mlx5io_8h_abd09d1f785591c0ccc8fe9e49fd49303a9309f20dbda27637d7a88ea23495e967}{MLX5\_FPGA\_IMAGE\_RELOAD}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00241}00241                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00242}00242         \textcolor{keywordflow}{case} \mbox{\hyperlink{mlx5io_8h_ae07914032d0b365f5f1c20aaf90fc647}{MLX5\_FPGA\_IMAGE\_SEL}}:}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00243}00243                 arg = *(\textcolor{keywordtype}{int} *)\mbox{\hyperlink{mlx5__en__tx_8c_af943c26117683b64b9cd6943e2c496e5}{data}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00244}00244                 \textcolor{keywordflow}{if} (arg > \mbox{\hyperlink{mlx5io_8h_abd09d1f785591c0ccc8fe9e49fd49303ad9b44985c2d3522dd22e3635e7cc5ad8}{MLX5\_FPGA\_IMAGE\_FACTORY}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00245}00245                         dev\_err(\mbox{\hyperlink{mlx5fpga__sdk_8c_a65c1ff2325c686679319de217a23f645}{mlx5\_fpga\_dev}}(fdev),}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00246}00246                             \textcolor{stringliteral}{"{}unknown image type \%u\(\backslash\)n"{}}, arg);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00247}00247                         err = EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00248}00248                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00249}00249                 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00250}00250                 err = \mbox{\hyperlink{mlx5fpga__sdk_8c_af65b6b95a6edc27effd7ffac56f95305}{mlx5\_fpga\_flash\_select}}(fdev, arg);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00251}00251                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00252}00252         \textcolor{keywordflow}{case} \mbox{\hyperlink{mlx5io_8h_addfac1cb858c7f4b729176bc6a78ca28}{MLX5\_FPGA\_QUERY}}:}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00253}00253                 \mbox{\hyperlink{mlx5fpga__sdk_8c_ad47db601c8ce549134a6bf698cd1f673}{mlx5\_fpga\_device\_query}}(fdev, \&query);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00254}00254                 bcopy(\&query, \mbox{\hyperlink{mlx5__en__tx_8c_af943c26117683b64b9cd6943e2c496e5}{data}}, \textcolor{keyword}{sizeof}(query));}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00255}00255                 err = 0;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00256}00256                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00257}00257         \textcolor{keywordflow}{case} \mbox{\hyperlink{mlx5io_8h_a5702b9ff4e61807117c84acf6c48fe64}{MLX5\_FPGA\_CAP}}:}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00258}00258                 \mbox{\hyperlink{mlx5fpga__sdk_8c_a8171a68f5b898a1bdbb66e6215530e83}{mlx5\_fpga\_get\_cap}}(fdev, fpga\_cap);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00259}00259                 bcopy(\&fpga\_cap, \mbox{\hyperlink{mlx5__en__tx_8c_af943c26117683b64b9cd6943e2c496e5}{data}}, \textcolor{keyword}{sizeof}(fpga\_cap));}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00260}00260                 err = 0;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00261}00261                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00262}00262         \textcolor{keywordflow}{case} \mbox{\hyperlink{mlx5io_8h_a68081017a5919d021a8b4f14165e615d}{MLX5\_FPGA\_TEMPERATURE}}:}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00263}00263                 \mbox{\hyperlink{structmlx5__fpga__temperature_ae269b96397899a1eb7331314462d3005}{temperature}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__fpga__temperature}{mlx5\_fpga\_temperature}} *)\mbox{\hyperlink{mlx5__en__tx_8c_af943c26117683b64b9cd6943e2c496e5}{data}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00264}00264                 \mbox{\hyperlink{mlx5fpga__sdk_8c_aecbb0324f03fbf4256f02bffd8434a88}{mlx5\_fpga\_temperature}}(fdev, \mbox{\hyperlink{structmlx5__fpga__temperature_ae269b96397899a1eb7331314462d3005}{temperature}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00265}00265                 err = 0; \textcolor{comment}{/* XXXKIB */}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00266}00266                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00267}00267         \textcolor{keywordflow}{case} \mbox{\hyperlink{mlx5io_8h_add979f66c27048495ea28167838a4713}{MLX5\_FPGA\_CONNECT}}:}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00268}00268                 connect = (\textcolor{keyword}{enum} \mbox{\hyperlink{mlx5io_8h_ac573a5194065f34c0973d752102e6dd4}{mlx5\_fpga\_connect}} *)\mbox{\hyperlink{mlx5__en__tx_8c_af943c26117683b64b9cd6943e2c496e5}{data}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00269}00269                 \mbox{\hyperlink{mlx5fpga__sdk_8c_a59fee91915042d26cc3651be09c6a588}{mlx5\_fpga\_connectdisconnect}}(fdev, connect);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00270}00270                 err = 0; \textcolor{comment}{/* XXXKIB */}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00271}00271                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00272}00272         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00273}00273                 dev\_err(\mbox{\hyperlink{mlx5fpga__sdk_8c_a65c1ff2325c686679319de217a23f645}{mlx5\_fpga\_dev}}(fdev),}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00274}00274                         \textcolor{stringliteral}{"{}unknown ioctl command \%\#08lx\(\backslash\)n"{}}, cmd);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00275}00275                 err = ENOTTY;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00276}00276         \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00277}00277         \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00278}00278 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00279}00279 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00280}\mbox{\hyperlink{mlx5fpga__tools__char_8c_a30b96e9ae600f3bb8b8de507ff498e18}{00280}} \textcolor{keyword}{static} \textcolor{keyword}{struct }cdevsw \mbox{\hyperlink{mlx5fpga__tools__char_8c_a30b96e9ae600f3bb8b8de507ff498e18}{mlx5\_tools\_char\_cdevsw}} = \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00281}00281         .d\_version =    D\_VERSION,}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00282}00282         .d\_name =       \textcolor{stringliteral}{"{}mlx5\_tools\_char"{}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00283}00283         .d\_open =       \mbox{\hyperlink{mlx5fpga__tools__char_8c_a7fcdadce87dd800a77774599cdc217ab}{tools\_char\_open}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00284}00284         .d\_read =       \mbox{\hyperlink{mlx5fpga__tools__char_8c_a536c39122e573bc00b6242af5c82ef9d}{tools\_char\_read}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00285}00285         .d\_write =      \mbox{\hyperlink{mlx5fpga__tools__char_8c_a2132acbe78eb1d35482cef3a9f7a7227}{tools\_char\_write}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00286}00286         .d\_ioctl =      \mbox{\hyperlink{mlx5fpga__tools__char_8c_a76daf0e51f691a26b896fd8f83cf3ef6}{tools\_char\_ioctl}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00287}00287 \};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00288}00288 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00289}00289 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00290}\mbox{\hyperlink{mlx5fpga__tools__char_8c_aed301af06830b6d9c79276b62c495d62}{00290}} \mbox{\hyperlink{mlx5fpga__tools__char_8c_aed301af06830b6d9c79276b62c495d62}{mlx5\_fpga\_tools\_char\_add\_one}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__fpga__tools__dev}{mlx5\_fpga\_tools\_dev}} *tdev)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00291}00291 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00292}00292         \textcolor{keyword}{struct }make\_dev\_args mda;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00293}00293         \textcolor{keyword}{struct }cdev *cd;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00294}00294         device\_t bdev;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00295}00295         \textcolor{keywordtype}{int} ret;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00296}00296 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00297}00297         make\_dev\_args\_init(\&mda);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00298}00298         mda.mda\_flags = MAKEDEV\_WAITOK | MAKEDEV\_CHECKNAME;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00299}00299         mda.mda\_devsw = \&\mbox{\hyperlink{mlx5fpga__tools__char_8c_a30b96e9ae600f3bb8b8de507ff498e18}{mlx5\_tools\_char\_cdevsw}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00300}00300         mda.mda\_uid = UID\_ROOT;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00301}00301         mda.mda\_gid = GID\_OPERATOR;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00302}00302         mda.mda\_mode = 0660;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00303}00303         mda.mda\_si\_drv1 = tdev;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00304}00304         bdev = \mbox{\hyperlink{mlx5fpga__sdk_8c_a65c1ff2325c686679319de217a23f645}{mlx5\_fpga\_dev}}(tdev-\/>\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}})-\/>bsddev;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00305}00305         ret = make\_dev\_s(\&mda, \&cd,}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00306}00306             \textcolor{stringliteral}{"{}\%04x:\%02x:\%02x.\%x"{}} \mbox{\hyperlink{mlx5io_8h_a7fff35b506c70a52e3916b9abaa7048c}{MLX5\_FPGA\_TOOLS\_NAME\_SUFFIX}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00307}00307             pci\_get\_domain(bdev), pci\_get\_bus(bdev), pci\_get\_slot(bdev),}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00308}00308             pci\_get\_function(bdev));}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00309}00309         \textcolor{keywordflow}{if} (ret != 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00310}00310                 tdev-\/>\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac43b95e893d301bda1f5a835d0b941e2}{char\_device}} = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00311}00311                 dev\_err(\mbox{\hyperlink{mlx5fpga__sdk_8c_a65c1ff2325c686679319de217a23f645}{mlx5\_fpga\_dev}}(tdev-\/>\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}}),}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00312}00312                     \textcolor{stringliteral}{"{}Failed to create a char device: \%d\(\backslash\)n"{}}, ret);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00313}00313                 \textcolor{keywordflow}{return} (-\/ret);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00314}00314         \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00315}00315         tdev-\/>\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac43b95e893d301bda1f5a835d0b941e2}{char\_device}} = cd;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00316}00316 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00317}00317         dev\_dbg(\mbox{\hyperlink{mlx5fpga__sdk_8c_a65c1ff2325c686679319de217a23f645}{mlx5\_fpga\_dev}}(tdev-\/>\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}}), \textcolor{stringliteral}{"{}tools char device \%s created\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00318}00318             cd-\/>si\_name);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00319}00319         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00320}00320 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00321}00321 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00322}\mbox{\hyperlink{mlx5fpga__tools__char_8c_ae493128112d662eb60813c651bd01012}{00322}} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5fpga__tools__char_8c_ae493128112d662eb60813c651bd01012}{mlx5\_fpga\_tools\_char\_remove\_one}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__fpga__tools__dev}{mlx5\_fpga\_tools\_dev}} *tdev)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00323}00323 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00324}00324 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00325}00325         dev\_err(\mbox{\hyperlink{mlx5fpga__sdk_8c_a65c1ff2325c686679319de217a23f645}{mlx5\_fpga\_dev}}(tdev-\/>\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac649397aad194d295c5d1bb5869935da}{fdev}}), \textcolor{stringliteral}{"{}tools char device \%s destroyed\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00326}00326             ((\textcolor{keyword}{struct} cdev *)(tdev-\/>\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac43b95e893d301bda1f5a835d0b941e2}{char\_device}}))-\/>si\_name);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00327}00327         destroy\_dev((\textcolor{keyword}{struct} cdev *)(tdev-\/>\mbox{\hyperlink{structmlx5__fpga__tools__dev_ac43b95e893d301bda1f5a835d0b941e2}{char\_device}}));}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00328}00328 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00329}00329 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00330}00330 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00331}\mbox{\hyperlink{mlx5fpga__tools__char_8c_a3dff62f3ca59225589c7bb03c8bccf31}{00331}} \mbox{\hyperlink{mlx5fpga__tools__char_8c_a3dff62f3ca59225589c7bb03c8bccf31}{mlx5\_fpga\_tools\_char\_init}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00332}00332 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00333}00333 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00334}00334         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00335}00335 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00336}00336 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00337}00337 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00338}\mbox{\hyperlink{mlx5fpga__tools__char_8c_a10b49528545e5ccbb0e538803c39a32b}{00338}} \mbox{\hyperlink{mlx5fpga__tools__char_8c_a10b49528545e5ccbb0e538803c39a32b}{mlx5\_fpga\_tools\_char\_deinit}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00339}00339 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__tools__char_8c_source_l00340}00340 \}}

\end{DoxyCode}
