\hypertarget{mlx5fpga__trans_8c_source}{}\doxysection{mlx5fpga\+\_\+trans.\+c}
\label{mlx5fpga__trans_8c_source}\index{dev/mlx5/mlx5\_fpga/mlx5fpga\_trans.c@{dev/mlx5/mlx5\_fpga/mlx5fpga\_trans.c}}
\mbox{\hyperlink{mlx5fpga__trans_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2017 Mellanox Technologies. All rights reserved.}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00004}00004 \textcolor{comment}{ * This software is available to you under a choice of one of two}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00005}00005 \textcolor{comment}{ * licenses.  You may choose to be licensed under the terms of the GNU}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00006}00006 \textcolor{comment}{ * General Public License (GPL) Version 2, available from the file}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00007}00007 \textcolor{comment}{ * COPYING in the main directory of this source tree, or the}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00008}00008 \textcolor{comment}{ * OpenIB.org BSD license below:}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00009}00009 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00010}00010 \textcolor{comment}{ *     Redistribution and use in source and binary forms, with or}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00011}00011 \textcolor{comment}{ *     without modification, are permitted provided that the following}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00012}00012 \textcolor{comment}{ *     conditions are met:}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00013}00013 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00014}00014 \textcolor{comment}{ *      -\/ Redistributions of source code must retain the above}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00015}00015 \textcolor{comment}{ *        copyright notice, this list of conditions and the following}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00016}00016 \textcolor{comment}{ *        disclaimer.}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00017}00017 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00018}00018 \textcolor{comment}{ *      -\/ Redistributions in binary form must reproduce the above}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00019}00019 \textcolor{comment}{ *        copyright notice, this list of conditions and the following}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00020}00020 \textcolor{comment}{ *        disclaimer in the documentation and/or other materials}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00021}00021 \textcolor{comment}{ *        provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00022}00022 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00023}00023 \textcolor{comment}{ * THE SOFTWARE IS PROVIDED "{}AS IS"{}, WITHOUT WARRANTY OF ANY KIND,}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00024}00024 \textcolor{comment}{ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00025}00025 \textcolor{comment}{ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00026}00026 \textcolor{comment}{ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00027}00027 \textcolor{comment}{ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00028}00028 \textcolor{comment}{ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00029}00029 \textcolor{comment}{ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00030}00030 \textcolor{comment}{ * SOFTWARE.}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00031}00031 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00032}00032 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00033}00033 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00034}00034 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{trans_8h}{dev/mlx5/mlx5\_fpga/trans.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{conn_8h}{dev/mlx5/mlx5\_fpga/conn.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00037}00037 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00038}\mbox{\hyperlink{mlx5fpga__trans_8c_a54102e3e363218ae3a3382469d00f7b8}{00038}} \textcolor{keyword}{enum} \mbox{\hyperlink{mlx5fpga__trans_8c_a54102e3e363218ae3a3382469d00f7b8}{mlx5\_fpga\_transaction\_state}} \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00039}\mbox{\hyperlink{mlx5fpga__trans_8c_a54102e3e363218ae3a3382469d00f7b8a04638289ddc110fffcecee59a1715387}{00039}}         \mbox{\hyperlink{mlx5fpga__trans_8c_a54102e3e363218ae3a3382469d00f7b8a04638289ddc110fffcecee59a1715387}{TRANS\_STATE\_NONE}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00040}\mbox{\hyperlink{mlx5fpga__trans_8c_a54102e3e363218ae3a3382469d00f7b8a39edde2049f2cf434c3342a92fe119bd}{00040}}         \mbox{\hyperlink{mlx5fpga__trans_8c_a54102e3e363218ae3a3382469d00f7b8a39edde2049f2cf434c3342a92fe119bd}{TRANS\_STATE\_SEND}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00041}\mbox{\hyperlink{mlx5fpga__trans_8c_a54102e3e363218ae3a3382469d00f7b8a82654c0aafdbb3e4ea1da939cccb9374}{00041}}         \mbox{\hyperlink{mlx5fpga__trans_8c_a54102e3e363218ae3a3382469d00f7b8a82654c0aafdbb3e4ea1da939cccb9374}{TRANS\_STATE\_WAIT}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00042}\mbox{\hyperlink{mlx5fpga__trans_8c_a54102e3e363218ae3a3382469d00f7b8a62d7917e9ba7f9eec4dd0347e6c2cb8b}{00042}}         \mbox{\hyperlink{mlx5fpga__trans_8c_a54102e3e363218ae3a3382469d00f7b8a62d7917e9ba7f9eec4dd0347e6c2cb8b}{TRANS\_STATE\_COMPLETE}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00043}00043 \};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00044}00044 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00045}\mbox{\hyperlink{structmlx5__fpga__trans__priv}{00045}} \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__fpga__trans__priv}{mlx5\_fpga\_trans\_priv}} \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00046}\mbox{\hyperlink{structmlx5__fpga__trans__priv_ae1e8f5bfbf10ba403672abcc4ea36bce}{00046}}         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__fpga__transaction}{mlx5\_fpga\_transaction}} *\mbox{\hyperlink{structmlx5__fpga__trans__priv_ae1e8f5bfbf10ba403672abcc4ea36bce}{user\_trans}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00047}\mbox{\hyperlink{structmlx5__fpga__trans__priv_af205b6d43cdbd00b5172d32fbe6c1b7b}{00047}}         u8 \mbox{\hyperlink{structmlx5__fpga__trans__priv_af205b6d43cdbd00b5172d32fbe6c1b7b}{tid}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00048}\mbox{\hyperlink{structmlx5__fpga__trans__priv_ab6946b06ab4bd567a1ded7cf3d95336c}{00048}}         \textcolor{keyword}{enum} \mbox{\hyperlink{mlx5fpga__trans_8c_a54102e3e363218ae3a3382469d00f7b8}{mlx5\_fpga\_transaction\_state}} \mbox{\hyperlink{structmlx5__fpga__trans__priv_ab6946b06ab4bd567a1ded7cf3d95336c}{state}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00049}\mbox{\hyperlink{structmlx5__fpga__trans__priv_ad3bb11753914e22007fe373e24b99f0b}{00049}}         u8 \mbox{\hyperlink{structmlx5__fpga__trans__priv_ad3bb11753914e22007fe373e24b99f0b}{status}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00050}\mbox{\hyperlink{structmlx5__fpga__trans__priv_ac977c60005ce0949da5688eb160bf4f1}{00050}}         u32 \mbox{\hyperlink{structmlx5__fpga__trans__priv_ac977c60005ce0949da5688eb160bf4f1}{header}}[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(fpga\_shell\_qp\_packet)];}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00051}\mbox{\hyperlink{structmlx5__fpga__trans__priv_aeb6f12a33f0c10e05762cbf3fb2e453c}{00051}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__fpga__dma__buf}{mlx5\_fpga\_dma\_buf}} \mbox{\hyperlink{structmlx5__fpga__trans__priv_aeb6f12a33f0c10e05762cbf3fb2e453c}{buf}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00052}\mbox{\hyperlink{structmlx5__fpga__trans__priv_afd3aa27ab7122e35614a8a1a4fd2b70a}{00052}}         \textcolor{keyword}{struct }list\_head \mbox{\hyperlink{structmlx5__fpga__trans__priv_afd3aa27ab7122e35614a8a1a4fd2b70a}{list\_item}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00053}00053 \};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00054}00054 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00055}\mbox{\hyperlink{structmlx5__fpga__trans__device__state}{00055}} \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__fpga__trans__device__state}{mlx5\_fpga\_trans\_device\_state}} \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00056}\mbox{\hyperlink{structmlx5__fpga__trans__device__state_a1a2534843e15b09363adeb886e569a9f}{00056}}         spinlock\_t \mbox{\hyperlink{structmlx5__fpga__trans__device__state_a1a2534843e15b09363adeb886e569a9f}{lock}}; \textcolor{comment}{/* Protects all members of this struct */}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00057}\mbox{\hyperlink{structmlx5__fpga__trans__device__state_a3b734cba6886822291e2bdec83e3bd87}{00057}}         \textcolor{keyword}{struct }list\_head \mbox{\hyperlink{structmlx5__fpga__trans__device__state_a3b734cba6886822291e2bdec83e3bd87}{free\_queue}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00058}\mbox{\hyperlink{structmlx5__fpga__trans__device__state_a6717c88236657214241c7da9b8a2a61b}{00058}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__fpga__trans__priv}{mlx5\_fpga\_trans\_priv}} \mbox{\hyperlink{structmlx5__fpga__trans__device__state_a6717c88236657214241c7da9b8a2a61b}{transactions}}[\mbox{\hyperlink{trans_8h_a1afba54e768e37759c00c92a83ee1789}{MLX5\_FPGA\_TID\_COUNT}}];}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00059}00059 \};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00060}00060 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00061}\mbox{\hyperlink{mlx5fpga__trans_8c_acca9065dee8a04e8a25c84959dd24f43}{00061}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__fpga__trans__priv}{mlx5\_fpga\_trans\_priv}} *\mbox{\hyperlink{mlx5fpga__trans_8c_acca9065dee8a04e8a25c84959dd24f43}{find\_tid}}(\textcolor{keyword}{struct} mlx5\_fpga\_device *fdev,}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00062}00062                                              u8 \mbox{\hyperlink{structmlx5__fpga__trans__priv_af205b6d43cdbd00b5172d32fbe6c1b7b}{tid}})}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00063}00063 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00064}00064         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structmlx5__fpga__trans__priv_af205b6d43cdbd00b5172d32fbe6c1b7b}{tid}} >= \mbox{\hyperlink{trans_8h_a1afba54e768e37759c00c92a83ee1789}{MLX5\_FPGA\_TID\_COUNT}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00065}00065                 mlx5\_fpga\_warn(fdev, \textcolor{stringliteral}{"{}Unexpected transaction ID \%u\(\backslash\)n"{}}, \mbox{\hyperlink{structmlx5__fpga__trans__priv_af205b6d43cdbd00b5172d32fbe6c1b7b}{tid}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00066}00066                 \textcolor{keywordflow}{return} NULL;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00067}00067         \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00068}00068         \textcolor{keywordflow}{return} \&fdev-\/>trans-\/>transactions[\mbox{\hyperlink{structmlx5__fpga__trans__priv_af205b6d43cdbd00b5172d32fbe6c1b7b}{tid}}];}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00069}00069 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00070}00070 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00071}\mbox{\hyperlink{mlx5fpga__trans_8c_a046d441270edd1bb944834bd0e883121}{00071}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__fpga__trans__priv}{mlx5\_fpga\_trans\_priv}} *\mbox{\hyperlink{mlx5fpga__trans_8c_a046d441270edd1bb944834bd0e883121}{alloc\_tid}}(\textcolor{keyword}{struct} mlx5\_fpga\_device *fdev)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00072}00072 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00073}00073         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__fpga__trans__priv}{mlx5\_fpga\_trans\_priv}} *ret;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00074}00074         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} flags;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00075}00075 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00076}00076         spin\_lock\_irqsave(\&fdev-\/>trans-\/>lock, flags);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00077}00077 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00078}00078         \textcolor{keywordflow}{if} (list\_empty(\&fdev-\/>trans-\/>free\_queue)) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00079}00079                 mlx5\_fpga\_dbg(fdev, \textcolor{stringliteral}{"{}No free transaction ID available\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00080}00080                 ret = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00081}00081                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00082}00082         \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00083}00083 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00084}00084         ret = list\_first\_entry(\&fdev-\/>trans-\/>free\_queue,}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00085}00085                                \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__fpga__trans__priv}{mlx5\_fpga\_trans\_priv}}, \mbox{\hyperlink{structmlx5__fpga__trans__priv_afd3aa27ab7122e35614a8a1a4fd2b70a}{list\_item}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00086}00086         list\_del(\&ret-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_afd3aa27ab7122e35614a8a1a4fd2b70a}{list\_item}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00087}00087 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00088}00088         ret-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_ab6946b06ab4bd567a1ded7cf3d95336c}{state}} = \mbox{\hyperlink{mlx5fpga__trans_8c_a54102e3e363218ae3a3382469d00f7b8a04638289ddc110fffcecee59a1715387}{TRANS\_STATE\_NONE}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00089}00089 out:}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00090}00090         spin\_unlock\_irqrestore(\&fdev-\/>trans-\/>lock, flags);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00091}00091         \textcolor{keywordflow}{return} ret;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00092}00092 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00093}00093 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00094}\mbox{\hyperlink{mlx5fpga__trans_8c_a836875bfc3344e74edeb4b0f2c436c93}{00094}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5fpga__trans_8c_a836875bfc3344e74edeb4b0f2c436c93}{free\_tid}}(\textcolor{keyword}{struct} mlx5\_fpga\_device *fdev,}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00095}00095                      \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__fpga__trans__priv}{mlx5\_fpga\_trans\_priv}} *trans\_priv)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00096}00096 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00097}00097         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} flags;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00098}00098 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00099}00099         spin\_lock\_irqsave(\&fdev-\/>trans-\/>lock, flags);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00100}00100         list\_add\_tail(\&trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_afd3aa27ab7122e35614a8a1a4fd2b70a}{list\_item}}, \&fdev-\/>trans-\/>free\_queue);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00101}00101         spin\_unlock\_irqrestore(\&fdev-\/>trans-\/>lock, flags);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00102}00102 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00103}00103 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00104}\mbox{\hyperlink{mlx5fpga__trans_8c_a05338a5b5c6f538ecb516f3aefc01347}{00104}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5fpga__trans_8c_a05338a5b5c6f538ecb516f3aefc01347}{trans\_complete}}(\textcolor{keyword}{struct} mlx5\_fpga\_device *fdev,}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00105}00105                            \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__fpga__trans__priv}{mlx5\_fpga\_trans\_priv}} *trans\_priv, u8 \mbox{\hyperlink{structmlx5__fpga__trans__priv_ad3bb11753914e22007fe373e24b99f0b}{status}})}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00106}00106 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00107}00107         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__fpga__transaction}{mlx5\_fpga\_transaction}} *user\_trans;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00108}00108         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} flags;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00109}00109 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00110}00110         mlx5\_fpga\_dbg(fdev, \textcolor{stringliteral}{"{}Transaction \%u is complete with status \%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00111}00111                       trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_af205b6d43cdbd00b5172d32fbe6c1b7b}{tid}}, status);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00112}00112 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00113}00113         spin\_lock\_irqsave(\&fdev-\/>trans-\/>lock, flags);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00114}00114         trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_ab6946b06ab4bd567a1ded7cf3d95336c}{state}} = \mbox{\hyperlink{mlx5fpga__trans_8c_a54102e3e363218ae3a3382469d00f7b8a62d7917e9ba7f9eec4dd0347e6c2cb8b}{TRANS\_STATE\_COMPLETE}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00115}00115         trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_ad3bb11753914e22007fe373e24b99f0b}{status}} = status;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00116}00116         spin\_unlock\_irqrestore(\&fdev-\/>trans-\/>lock, flags);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00117}00117 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00118}00118         user\_trans = trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_ae1e8f5bfbf10ba403672abcc4ea36bce}{user\_trans}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00119}00119         \mbox{\hyperlink{mlx5fpga__trans_8c_a836875bfc3344e74edeb4b0f2c436c93}{free\_tid}}(fdev, trans\_priv);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00120}00120 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00121}00121         \textcolor{keywordflow}{if} (user\_trans-\/>\mbox{\hyperlink{structmlx5__fpga__transaction_afb23da20b5ec2089fd89254202850e80}{complete1}})}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00122}00122                 user\_trans-\/>\mbox{\hyperlink{structmlx5__fpga__transaction_afb23da20b5ec2089fd89254202850e80}{complete1}}(user\_trans, status);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00123}00123 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00124}00124 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00125}\mbox{\hyperlink{mlx5fpga__trans_8c_a924834d0e9343004ccd461ea0467d085}{00125}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5fpga__trans_8c_a924834d0e9343004ccd461ea0467d085}{trans\_send\_complete}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__fpga__conn}{mlx5\_fpga\_conn}} *\mbox{\hyperlink{structmlx5__fpga__transaction_ae45b280b54e61693ca56125139469750}{conn}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00126}00126                                 \textcolor{keyword}{struct} mlx5\_fpga\_device *fdev,}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00127}00127                                 \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__fpga__dma__buf}{mlx5\_fpga\_dma\_buf}} *buf, u8 status)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00128}00128 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00129}00129         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} flags;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00130}00130         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__fpga__trans__priv}{mlx5\_fpga\_trans\_priv}} *trans\_priv;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00131}00131 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00132}00132         trans\_priv = container\_of(\mbox{\hyperlink{structmlx5__fpga__trans__priv_aeb6f12a33f0c10e05762cbf3fb2e453c}{buf}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__fpga__trans__priv}{mlx5\_fpga\_trans\_priv}}, \mbox{\hyperlink{structmlx5__fpga__trans__priv_aeb6f12a33f0c10e05762cbf3fb2e453c}{buf}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00133}00133         mlx5\_fpga\_dbg(fdev, \textcolor{stringliteral}{"{}send complete tid \%u. Status: \%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00134}00134                       trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_af205b6d43cdbd00b5172d32fbe6c1b7b}{tid}}, \mbox{\hyperlink{structmlx5__fpga__trans__priv_ad3bb11753914e22007fe373e24b99f0b}{status}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00135}00135         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structmlx5__fpga__trans__priv_ad3bb11753914e22007fe373e24b99f0b}{status}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00136}00136                 \mbox{\hyperlink{mlx5fpga__trans_8c_a05338a5b5c6f538ecb516f3aefc01347}{trans\_complete}}(fdev, trans\_priv, \mbox{\hyperlink{structmlx5__fpga__trans__priv_ad3bb11753914e22007fe373e24b99f0b}{status}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00137}00137                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00138}00138         \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00139}00139 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00140}00140         spin\_lock\_irqsave(\&fdev-\/>trans-\/>lock, flags);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00141}00141         \textcolor{keywordflow}{if} (trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_ab6946b06ab4bd567a1ded7cf3d95336c}{state}} == \mbox{\hyperlink{mlx5fpga__trans_8c_a54102e3e363218ae3a3382469d00f7b8a39edde2049f2cf434c3342a92fe119bd}{TRANS\_STATE\_SEND}})}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00142}00142                 trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_ab6946b06ab4bd567a1ded7cf3d95336c}{state}} = \mbox{\hyperlink{mlx5fpga__trans_8c_a54102e3e363218ae3a3382469d00f7b8a82654c0aafdbb3e4ea1da939cccb9374}{TRANS\_STATE\_WAIT}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00143}00143         spin\_unlock\_irqrestore(\&fdev-\/>trans-\/>lock, flags);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00144}00144 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00145}00145 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00146}\mbox{\hyperlink{mlx5fpga__trans_8c_a245675d5f19bf8580f68d6cdc7e8ab67}{00146}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5fpga__trans_8c_a245675d5f19bf8580f68d6cdc7e8ab67}{trans\_validate}}(\textcolor{keyword}{struct} mlx5\_fpga\_device *fdev, u64 addr, \textcolor{keywordtype}{size\_t} size)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00147}00147 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00148}00148         \textcolor{keywordflow}{if} (size > \mbox{\hyperlink{trans_8h_a554ee58c41defe5b93f9843d48f42365}{MLX5\_FPGA\_TRANSACTION\_MAX\_SIZE}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00149}00149                 mlx5\_fpga\_warn(fdev, \textcolor{stringliteral}{"{}Cannot access \%zu bytes at once. Max is \%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00150}00150                                size, \mbox{\hyperlink{trans_8h_a554ee58c41defe5b93f9843d48f42365}{MLX5\_FPGA\_TRANSACTION\_MAX\_SIZE}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00151}00151                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00152}00152         \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00153}00153         \textcolor{keywordflow}{if} (size \& \mbox{\hyperlink{trans_8h_a1b58adbf91b112cc75974ae0672e0729}{MLX5\_FPGA\_TRANSACTION\_SEND\_ALIGN\_BITS}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00154}00154                 mlx5\_fpga\_warn(fdev, \textcolor{stringliteral}{"{}Cannot access \%zu bytes. Must be full dwords\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00155}00155                                size);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00156}00156                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00157}00157         \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00158}00158         \textcolor{keywordflow}{if} (size < 1) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00159}00159                 mlx5\_fpga\_warn(fdev, \textcolor{stringliteral}{"{}Cannot access \%zu bytes. Empty transaction not allowed\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00160}00160                                size);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00161}00161                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00162}00162         \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00163}00163         \textcolor{keywordflow}{if} (addr \& \mbox{\hyperlink{trans_8h_a1b58adbf91b112cc75974ae0672e0729}{MLX5\_FPGA\_TRANSACTION\_SEND\_ALIGN\_BITS}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00164}00164                 mlx5\_fpga\_warn(fdev, \textcolor{stringliteral}{"{}Cannot access \%zu bytes at unaligned address \%jx\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00165}00165                                size, (uintmax\_t)addr);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00166}00166                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00167}00167         \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00168}00168         \textcolor{keywordflow}{if} ((addr >> \mbox{\hyperlink{trans_8h_a45ca64bf1bbf18bcac41cbcc178018fa}{MLX5\_FPGA\_TRANSACTION\_SEND\_PAGE\_BITS}}) !=}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00169}00169             ((addr + size -\/ 1) >> \mbox{\hyperlink{trans_8h_a45ca64bf1bbf18bcac41cbcc178018fa}{MLX5\_FPGA\_TRANSACTION\_SEND\_PAGE\_BITS}})) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00170}00170                 mlx5\_fpga\_warn(fdev, \textcolor{stringliteral}{"{}Cannot access \%zu bytes at address \%jx. Crosses page boundary\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00171}00171                                size, (uintmax\_t)addr);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00172}00172                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00173}00173         \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00174}00174         \textcolor{keywordflow}{if} (addr < \mbox{\hyperlink{mlx5fpga__sdk_8c_a33f3dc86d19dbc21a46446cd9f6f69a7}{mlx5\_fpga\_ddr\_base\_get}}(fdev)) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00175}00175                 \textcolor{keywordflow}{if} (size != \textcolor{keyword}{sizeof}(u32)) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00176}00176                         mlx5\_fpga\_warn(fdev, \textcolor{stringliteral}{"{}Cannot access \%zu bytes at cr-\/space address \%jx. Must access a single dword\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00177}00177                                        size, (uintmax\_t)addr);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00178}00178                         \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00179}00179                 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00180}00180         \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00181}00181         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00182}00182 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00183}00183 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00184}\mbox{\hyperlink{mlx5fpga__trans_8c_a5ab19e75b9ee247a0e1edf9878a61aad}{00184}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5fpga__trans_8c_a5ab19e75b9ee247a0e1edf9878a61aad}{mlx5\_fpga\_trans\_exec}}(\textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__fpga__transaction}{mlx5\_fpga\_transaction}} *trans)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00185}00185 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00186}00186         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__fpga__conn}{mlx5\_fpga\_conn}} *conn = trans-\/>\mbox{\hyperlink{structmlx5__fpga__transaction_ae45b280b54e61693ca56125139469750}{conn}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00187}00187         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__fpga__trans__priv}{mlx5\_fpga\_trans\_priv}} *trans\_priv;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00188}00188         u32 *\mbox{\hyperlink{structmlx5__fpga__trans__priv_ac977c60005ce0949da5688eb160bf4f1}{header}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00189}00189         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00190}00190 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00191}00191         \textcolor{keywordflow}{if} (!trans-\/>\mbox{\hyperlink{structmlx5__fpga__transaction_afb23da20b5ec2089fd89254202850e80}{complete1}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00192}00192                 mlx5\_fpga\_warn(conn-\/>\mbox{\hyperlink{structmlx5__fpga__conn_a14fa437bcda564ce45f1a9cf2de195bc}{fdev}}, \textcolor{stringliteral}{"{}Transaction must have a completion callback\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00193}00193                 err = -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00194}00194                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00195}00195         \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00196}00196 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00197}00197         err = \mbox{\hyperlink{mlx5fpga__trans_8c_a245675d5f19bf8580f68d6cdc7e8ab67}{trans\_validate}}(conn-\/>\mbox{\hyperlink{structmlx5__fpga__conn_a14fa437bcda564ce45f1a9cf2de195bc}{fdev}}, trans-\/>\mbox{\hyperlink{structmlx5__fpga__transaction_ab3e14bbae16391d014f78bc54835fdb5}{addr}}, trans-\/>\mbox{\hyperlink{structmlx5__fpga__transaction_a2954e84fc376c9210fb5d68f3c1f2f40}{size}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00198}00198         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00199}00199                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00200}00200 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00201}00201         trans\_priv = \mbox{\hyperlink{mlx5fpga__trans_8c_a046d441270edd1bb944834bd0e883121}{alloc\_tid}}(conn-\/>\mbox{\hyperlink{structmlx5__fpga__conn_a14fa437bcda564ce45f1a9cf2de195bc}{fdev}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00202}00202         \textcolor{keywordflow}{if} (!trans\_priv) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00203}00203                 err = -\/EBUSY;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00204}00204                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00205}00205         \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00206}00206         trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_ae1e8f5bfbf10ba403672abcc4ea36bce}{user\_trans}} = trans;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00207}00207         \mbox{\hyperlink{structmlx5__fpga__trans__priv_ac977c60005ce0949da5688eb160bf4f1}{header}} = trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_ac977c60005ce0949da5688eb160bf4f1}{header}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00208}00208 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00209}00209         memset(\mbox{\hyperlink{structmlx5__fpga__trans__priv_ac977c60005ce0949da5688eb160bf4f1}{header}}, 0, \textcolor{keyword}{sizeof}(trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_ac977c60005ce0949da5688eb160bf4f1}{header}}));}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00210}00210         memset(\&trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_aeb6f12a33f0c10e05762cbf3fb2e453c}{buf}}, 0, \textcolor{keyword}{sizeof}(trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_aeb6f12a33f0c10e05762cbf3fb2e453c}{buf}}));}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00211}00211         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(fpga\_shell\_qp\_packet, \mbox{\hyperlink{structmlx5__fpga__trans__priv_ac977c60005ce0949da5688eb160bf4f1}{header}}, type,}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00212}00212                  (trans-\/>\mbox{\hyperlink{structmlx5__fpga__transaction_ae7d717d89c01b279ea20a67cb6f604c7}{direction}} == \mbox{\hyperlink{trans_8h_a2b983dd7631b4ee8d4a7a91be097237aa1fee16057da5f5057bc0a72b1855999c}{MLX5\_FPGA\_WRITE}}) ?}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00213}00213                  \mbox{\hyperlink{mlx5__ifc__fpga_8h_a5e8ce9967db697e85d5528dafee6b8dea73371cf6a9ca46fbe072379d8be402b9}{MLX5\_FPGA\_SHELL\_QP\_PACKET\_TYPE\_DDR\_WRITE}} :}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00214}00214                  \mbox{\hyperlink{mlx5__ifc__fpga_8h_a5e8ce9967db697e85d5528dafee6b8dea8a2e4bd44a0dfba8d264b5e4cac4ac1f}{MLX5\_FPGA\_SHELL\_QP\_PACKET\_TYPE\_DDR\_READ}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00215}00215         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(fpga\_shell\_qp\_packet, \mbox{\hyperlink{structmlx5__fpga__trans__priv_ac977c60005ce0949da5688eb160bf4f1}{header}}, \mbox{\hyperlink{structmlx5__fpga__trans__priv_af205b6d43cdbd00b5172d32fbe6c1b7b}{tid}}, trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_af205b6d43cdbd00b5172d32fbe6c1b7b}{tid}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00216}00216         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(fpga\_shell\_qp\_packet, \mbox{\hyperlink{structmlx5__fpga__trans__priv_ac977c60005ce0949da5688eb160bf4f1}{header}}, len, trans-\/>\mbox{\hyperlink{structmlx5__fpga__transaction_a2954e84fc376c9210fb5d68f3c1f2f40}{size}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00217}00217         \mbox{\hyperlink{device_8h_a6e7776ca1e3178584753950058580eb6}{MLX5\_SET64}}(fpga\_shell\_qp\_packet, \mbox{\hyperlink{structmlx5__fpga__trans__priv_ac977c60005ce0949da5688eb160bf4f1}{header}}, address, trans-\/>\mbox{\hyperlink{structmlx5__fpga__transaction_ab3e14bbae16391d014f78bc54835fdb5}{addr}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00218}00218 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00219}00219         trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_aeb6f12a33f0c10e05762cbf3fb2e453c}{buf}}.\mbox{\hyperlink{structmlx5__fpga__dma__buf_abb1e11b2f62f9f0dc128da89c2823685}{sg}}[0].\mbox{\hyperlink{structmlx5__fpga__dma__entry_ab6974342b5d28513b853746afd40e311}{data}} = \mbox{\hyperlink{structmlx5__fpga__trans__priv_ac977c60005ce0949da5688eb160bf4f1}{header}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00220}00220         trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_aeb6f12a33f0c10e05762cbf3fb2e453c}{buf}}.\mbox{\hyperlink{structmlx5__fpga__dma__buf_abb1e11b2f62f9f0dc128da89c2823685}{sg}}[0].\mbox{\hyperlink{structmlx5__fpga__dma__entry_a1a299b7c503caf2cb13283d77d28a0a3}{size}} = \textcolor{keyword}{sizeof}(trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_ac977c60005ce0949da5688eb160bf4f1}{header}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00221}00221         \textcolor{keywordflow}{if} (trans-\/>\mbox{\hyperlink{structmlx5__fpga__transaction_ae7d717d89c01b279ea20a67cb6f604c7}{direction}} == \mbox{\hyperlink{trans_8h_a2b983dd7631b4ee8d4a7a91be097237aa1fee16057da5f5057bc0a72b1855999c}{MLX5\_FPGA\_WRITE}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00222}00222                 trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_aeb6f12a33f0c10e05762cbf3fb2e453c}{buf}}.\mbox{\hyperlink{structmlx5__fpga__dma__buf_abb1e11b2f62f9f0dc128da89c2823685}{sg}}[1].\mbox{\hyperlink{structmlx5__fpga__dma__entry_ab6974342b5d28513b853746afd40e311}{data}} = trans-\/>\mbox{\hyperlink{structmlx5__fpga__transaction_aef5de6c3f31fc29e146b5fa9c96d6ec3}{data}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00223}00223                 trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_aeb6f12a33f0c10e05762cbf3fb2e453c}{buf}}.\mbox{\hyperlink{structmlx5__fpga__dma__buf_abb1e11b2f62f9f0dc128da89c2823685}{sg}}[1].\mbox{\hyperlink{structmlx5__fpga__dma__entry_a1a299b7c503caf2cb13283d77d28a0a3}{size}} = trans-\/>\mbox{\hyperlink{structmlx5__fpga__transaction_a2954e84fc376c9210fb5d68f3c1f2f40}{size}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00224}00224         \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00225}00225 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00226}00226         trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_aeb6f12a33f0c10e05762cbf3fb2e453c}{buf}}.\mbox{\hyperlink{structmlx5__fpga__dma__buf_aa65861ed8524a509f5b1e01f103c83de}{complete}} = \mbox{\hyperlink{mlx5fpga__trans_8c_a924834d0e9343004ccd461ea0467d085}{trans\_send\_complete}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00227}00227         trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_ab6946b06ab4bd567a1ded7cf3d95336c}{state}} = \mbox{\hyperlink{mlx5fpga__trans_8c_a54102e3e363218ae3a3382469d00f7b8a39edde2049f2cf434c3342a92fe119bd}{TRANS\_STATE\_SEND}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00228}00228 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00229}00229 \textcolor{preprocessor}{\#ifdef NOT\_YET}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00230}00230         \textcolor{comment}{/* XXXKIB */}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00231}00231         err = \mbox{\hyperlink{conn_8h_a2f46b0f5fe1b32e64a3105989aa903ae}{mlx5\_fpga\_conn\_send}}(conn-\/>\mbox{\hyperlink{structmlx5__fpga__conn_a14fa437bcda564ce45f1a9cf2de195bc}{fdev}}-\/>shell\_conn, \&trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_aeb6f12a33f0c10e05762cbf3fb2e453c}{buf}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00232}00232 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00233}00233         err = 0;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00234}00234 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00235}00235         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00236}00236                 \textcolor{keywordflow}{goto} out\_buf\_tid;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00237}00237         \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00238}00238 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00239}00239 out\_buf\_tid:}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00240}00240         \mbox{\hyperlink{mlx5fpga__trans_8c_a836875bfc3344e74edeb4b0f2c436c93}{free\_tid}}(conn-\/>\mbox{\hyperlink{structmlx5__fpga__conn_a14fa437bcda564ce45f1a9cf2de195bc}{fdev}}, trans\_priv);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00241}00241 out:}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00242}00242         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00243}00243 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00244}00244 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00245}\mbox{\hyperlink{mlx5fpga__trans_8c_a51ec92711d42a593954be18f06275d3a}{00245}} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5fpga__trans_8c_a51ec92711d42a593954be18f06275d3a}{mlx5\_fpga\_trans\_recv}}(\textcolor{keywordtype}{void} *cb\_arg, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__fpga__dma__buf}{mlx5\_fpga\_dma\_buf}} *\mbox{\hyperlink{structmlx5__fpga__trans__priv_aeb6f12a33f0c10e05762cbf3fb2e453c}{buf}})}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00246}00246 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00247}00247         \textcolor{keyword}{struct }mlx5\_fpga\_device *fdev = cb\_arg;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00248}00248         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__fpga__trans__priv}{mlx5\_fpga\_trans\_priv}} *trans\_priv;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00249}00249         \textcolor{keywordtype}{size\_t} payload\_len;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00250}00250         u8 \mbox{\hyperlink{structmlx5__fpga__trans__priv_ad3bb11753914e22007fe373e24b99f0b}{status}} = 0;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00251}00251         u8 \mbox{\hyperlink{structmlx5__fpga__trans__priv_af205b6d43cdbd00b5172d32fbe6c1b7b}{tid}}, type;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00252}00252 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00253}00253         mlx5\_fpga\_dbg(fdev, \textcolor{stringliteral}{"{}Rx QP message on core conn; \%u bytes\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00254}00254                       \mbox{\hyperlink{structmlx5__fpga__trans__priv_aeb6f12a33f0c10e05762cbf3fb2e453c}{buf}}-\/>\mbox{\hyperlink{structmlx5__fpga__dma__buf_abb1e11b2f62f9f0dc128da89c2823685}{sg}}[0].\mbox{\hyperlink{structmlx5__fpga__dma__entry_a1a299b7c503caf2cb13283d77d28a0a3}{size}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00255}00255 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00256}00256         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structmlx5__fpga__trans__priv_aeb6f12a33f0c10e05762cbf3fb2e453c}{buf}}-\/>\mbox{\hyperlink{structmlx5__fpga__dma__buf_abb1e11b2f62f9f0dc128da89c2823685}{sg}}[0].\mbox{\hyperlink{structmlx5__fpga__dma__entry_a1a299b7c503caf2cb13283d77d28a0a3}{size}} < \mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(fpga\_shell\_qp\_packet)) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00257}00257                 mlx5\_fpga\_warn(fdev, \textcolor{stringliteral}{"{}Short message \%u bytes from device\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00258}00258                                \mbox{\hyperlink{structmlx5__fpga__trans__priv_aeb6f12a33f0c10e05762cbf3fb2e453c}{buf}}-\/>\mbox{\hyperlink{structmlx5__fpga__dma__buf_abb1e11b2f62f9f0dc128da89c2823685}{sg}}[0].\mbox{\hyperlink{structmlx5__fpga__dma__entry_a1a299b7c503caf2cb13283d77d28a0a3}{size}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00259}00259                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00260}00260         \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00261}00261         payload\_len = \mbox{\hyperlink{structmlx5__fpga__trans__priv_aeb6f12a33f0c10e05762cbf3fb2e453c}{buf}}-\/>\mbox{\hyperlink{structmlx5__fpga__dma__buf_abb1e11b2f62f9f0dc128da89c2823685}{sg}}[0].\mbox{\hyperlink{structmlx5__fpga__dma__entry_a1a299b7c503caf2cb13283d77d28a0a3}{size}} -\/ \mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(fpga\_shell\_qp\_packet);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00262}00262 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00263}00263         \mbox{\hyperlink{structmlx5__fpga__trans__priv_af205b6d43cdbd00b5172d32fbe6c1b7b}{tid}} = \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(fpga\_shell\_qp\_packet, \mbox{\hyperlink{structmlx5__fpga__trans__priv_aeb6f12a33f0c10e05762cbf3fb2e453c}{buf}}-\/>\mbox{\hyperlink{structmlx5__fpga__dma__buf_abb1e11b2f62f9f0dc128da89c2823685}{sg}}[0].\mbox{\hyperlink{structmlx5__fpga__dma__entry_ab6974342b5d28513b853746afd40e311}{data}}, \mbox{\hyperlink{structmlx5__fpga__trans__priv_af205b6d43cdbd00b5172d32fbe6c1b7b}{tid}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00264}00264         trans\_priv = \mbox{\hyperlink{mlx5fpga__trans_8c_acca9065dee8a04e8a25c84959dd24f43}{find\_tid}}(fdev, \mbox{\hyperlink{structmlx5__fpga__trans__priv_af205b6d43cdbd00b5172d32fbe6c1b7b}{tid}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00265}00265         \textcolor{keywordflow}{if} (!trans\_priv)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00266}00266                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00267}00267 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00268}00268         type = \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(fpga\_shell\_qp\_packet, \mbox{\hyperlink{structmlx5__fpga__trans__priv_aeb6f12a33f0c10e05762cbf3fb2e453c}{buf}}-\/>\mbox{\hyperlink{structmlx5__fpga__dma__buf_abb1e11b2f62f9f0dc128da89c2823685}{sg}}[0].\mbox{\hyperlink{structmlx5__fpga__dma__entry_ab6974342b5d28513b853746afd40e311}{data}}, type);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00269}00269         \textcolor{keywordflow}{switch} (type) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00270}00270         \textcolor{keywordflow}{case} \mbox{\hyperlink{mlx5__ifc__fpga_8h_a5e8ce9967db697e85d5528dafee6b8dea93f2bb2553028b86e2b7c672dbd01cd9}{MLX5\_FPGA\_SHELL\_QP\_PACKET\_TYPE\_DDR\_READ\_RESPONSE}}:}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00271}00271                 \textcolor{keywordflow}{if} (trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_ae1e8f5bfbf10ba403672abcc4ea36bce}{user\_trans}}-\/>\mbox{\hyperlink{structmlx5__fpga__transaction_ae7d717d89c01b279ea20a67cb6f604c7}{direction}} != \mbox{\hyperlink{trans_8h_a2b983dd7631b4ee8d4a7a91be097237aab83cee66a57cd5b46f508a5ae613422c}{MLX5\_FPGA\_READ}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00272}00272                         mlx5\_fpga\_warn(fdev, \textcolor{stringliteral}{"{}Wrong answer type \%u to a \%u transaction\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00273}00273                                        type, trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_ae1e8f5bfbf10ba403672abcc4ea36bce}{user\_trans}}-\/>\mbox{\hyperlink{structmlx5__fpga__transaction_ae7d717d89c01b279ea20a67cb6f604c7}{direction}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00274}00274                         \mbox{\hyperlink{structmlx5__fpga__trans__priv_ad3bb11753914e22007fe373e24b99f0b}{status}} = -\/EIO;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00275}00275                         \textcolor{keywordflow}{goto} complete;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00276}00276                 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00277}00277                 \textcolor{keywordflow}{if} (payload\_len != trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_ae1e8f5bfbf10ba403672abcc4ea36bce}{user\_trans}}-\/>\mbox{\hyperlink{structmlx5__fpga__transaction_a2954e84fc376c9210fb5d68f3c1f2f40}{size}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00278}00278                         mlx5\_fpga\_warn(fdev, \textcolor{stringliteral}{"{}Incorrect transaction payload length \%zu expected \%zu\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00279}00279                                        payload\_len,}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00280}00280                                        trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_ae1e8f5bfbf10ba403672abcc4ea36bce}{user\_trans}}-\/>\mbox{\hyperlink{structmlx5__fpga__transaction_a2954e84fc376c9210fb5d68f3c1f2f40}{size}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00281}00281                         \textcolor{keywordflow}{goto} complete;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00282}00282                 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00283}00283                 memcpy(trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_ae1e8f5bfbf10ba403672abcc4ea36bce}{user\_trans}}-\/>\mbox{\hyperlink{structmlx5__fpga__transaction_aef5de6c3f31fc29e146b5fa9c96d6ec3}{data}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00284}00284                        \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(fpga\_shell\_qp\_packet, \mbox{\hyperlink{structmlx5__fpga__trans__priv_aeb6f12a33f0c10e05762cbf3fb2e453c}{buf}}-\/>\mbox{\hyperlink{structmlx5__fpga__dma__buf_abb1e11b2f62f9f0dc128da89c2823685}{sg}}[0].\mbox{\hyperlink{structmlx5__fpga__dma__entry_ab6974342b5d28513b853746afd40e311}{data}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00285}00285                                     \mbox{\hyperlink{mlx5__en__tx_8c_af943c26117683b64b9cd6943e2c496e5}{data}}), payload\_len);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00286}00286                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00287}00287         \textcolor{keywordflow}{case} \mbox{\hyperlink{mlx5__ifc__fpga_8h_a5e8ce9967db697e85d5528dafee6b8dea3d6d54f5cffaf74d153d9f202a90596a}{MLX5\_FPGA\_SHELL\_QP\_PACKET\_TYPE\_DDR\_WRITE\_RESPONSE}}:}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00288}00288                 \textcolor{keywordflow}{if} (trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_ae1e8f5bfbf10ba403672abcc4ea36bce}{user\_trans}}-\/>\mbox{\hyperlink{structmlx5__fpga__transaction_ae7d717d89c01b279ea20a67cb6f604c7}{direction}} != \mbox{\hyperlink{trans_8h_a2b983dd7631b4ee8d4a7a91be097237aa1fee16057da5f5057bc0a72b1855999c}{MLX5\_FPGA\_WRITE}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00289}00289                         mlx5\_fpga\_warn(fdev, \textcolor{stringliteral}{"{}Wrong answer type \%u to a \%u transaction\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00290}00290                                        type, trans\_priv-\/>\mbox{\hyperlink{structmlx5__fpga__trans__priv_ae1e8f5bfbf10ba403672abcc4ea36bce}{user\_trans}}-\/>\mbox{\hyperlink{structmlx5__fpga__transaction_ae7d717d89c01b279ea20a67cb6f604c7}{direction}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00291}00291                         \mbox{\hyperlink{structmlx5__fpga__trans__priv_ad3bb11753914e22007fe373e24b99f0b}{status}} = -\/EIO;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00292}00292                         \textcolor{keywordflow}{goto} complete;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00293}00293                 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00294}00294                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00295}00295         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00296}00296                 mlx5\_fpga\_warn(fdev, \textcolor{stringliteral}{"{}Unexpected message type \%u len \%u from device\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00297}00297                                type, \mbox{\hyperlink{structmlx5__fpga__trans__priv_aeb6f12a33f0c10e05762cbf3fb2e453c}{buf}}-\/>\mbox{\hyperlink{structmlx5__fpga__dma__buf_abb1e11b2f62f9f0dc128da89c2823685}{sg}}[0].\mbox{\hyperlink{structmlx5__fpga__dma__entry_a1a299b7c503caf2cb13283d77d28a0a3}{size}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00298}00298                 \mbox{\hyperlink{structmlx5__fpga__trans__priv_ad3bb11753914e22007fe373e24b99f0b}{status}} = -\/EIO;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00299}00299                 \textcolor{keywordflow}{goto} complete;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00300}00300         \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00301}00301 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00302}00302 complete:}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00303}00303         \mbox{\hyperlink{mlx5fpga__trans_8c_a05338a5b5c6f538ecb516f3aefc01347}{trans\_complete}}(fdev, trans\_priv, \mbox{\hyperlink{structmlx5__fpga__trans__priv_ad3bb11753914e22007fe373e24b99f0b}{status}});}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00304}00304 out:}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00305}00305         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00306}00306 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00307}00307 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00308}\mbox{\hyperlink{mlx5fpga__trans_8c_ae13a014b26163a451655dc60d864aeb4}{00308}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5fpga__trans_8c_ae13a014b26163a451655dc60d864aeb4}{mlx5\_fpga\_trans\_device\_init}}(\textcolor{keyword}{struct} mlx5\_fpga\_device *fdev)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00309}00309 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00310}00310         \textcolor{keywordtype}{int} ret = 0;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00311}00311         \textcolor{keywordtype}{int} \mbox{\hyperlink{structmlx5__fpga__trans__priv_af205b6d43cdbd00b5172d32fbe6c1b7b}{tid}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00312}00312 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00313}00313         fdev-\/>trans = kzalloc(\textcolor{keyword}{sizeof}(*fdev-\/>trans), GFP\_KERNEL);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00314}00314         \textcolor{keywordflow}{if} (!fdev-\/>trans) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00315}00315                 ret = -\/ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00316}00316                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00317}00317         \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00318}00318 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00319}00319         INIT\_LIST\_HEAD(\&fdev-\/>trans-\/>free\_queue);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00320}00320         \textcolor{keywordflow}{for} (\mbox{\hyperlink{structmlx5__fpga__trans__priv_af205b6d43cdbd00b5172d32fbe6c1b7b}{tid}} = 0; \mbox{\hyperlink{structmlx5__fpga__trans__priv_af205b6d43cdbd00b5172d32fbe6c1b7b}{tid}} < ARRAY\_SIZE(fdev-\/>trans-\/>transactions); \mbox{\hyperlink{structmlx5__fpga__trans__priv_af205b6d43cdbd00b5172d32fbe6c1b7b}{tid}}++) \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00321}00321                 fdev-\/>trans-\/>transactions[\mbox{\hyperlink{structmlx5__fpga__trans__priv_af205b6d43cdbd00b5172d32fbe6c1b7b}{tid}}].tid = \mbox{\hyperlink{structmlx5__fpga__trans__priv_af205b6d43cdbd00b5172d32fbe6c1b7b}{tid}};}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00322}00322                 list\_add\_tail(\&fdev-\/>trans-\/>transactions[\mbox{\hyperlink{structmlx5__fpga__trans__priv_af205b6d43cdbd00b5172d32fbe6c1b7b}{tid}}].list\_item,}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00323}00323                               \&fdev-\/>trans-\/>free\_queue);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00324}00324         \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00325}00325 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00326}00326         spin\_lock\_init(\&fdev-\/>trans-\/>lock);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00327}00327 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00328}00328 out:}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00329}00329         \textcolor{keywordflow}{return} ret;}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00330}00330 \}}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00331}00331 }
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00332}\mbox{\hyperlink{mlx5fpga__trans_8c_ad684faeee8b96af775d6082d8ed779fc}{00332}} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5fpga__trans_8c_ad684faeee8b96af775d6082d8ed779fc}{mlx5\_fpga\_trans\_device\_cleanup}}(\textcolor{keyword}{struct} mlx5\_fpga\_device *fdev)}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00333}00333 \{}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00334}00334         kfree(fdev-\/>trans);}
\DoxyCodeLine{\Hypertarget{mlx5fpga__trans_8c_source_l00335}00335 \}}

\end{DoxyCode}
