\hypertarget{SIV_8h}{
\section{SIV.h File Reference}
\label{SIV_8h}\index{SIV.h@{SIV.h}}
}
Interface to the packet's State Information Vector. 



This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=100pt]{SIV_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{SIV_8h_a0}{
typedef enum \hyperlink{SIV_8h_a49}{\_\-SIV\_\-V} \hyperlink{SIV_8h_a0}{SIV\_\-V}}
\label{SIV_8h_a0}

\begin{CompactList}\small\item\em Typedef for enum \_\-SIV\_\-V. \item\end{CompactList}\item 
\hypertarget{SIV_8h_a1}{
typedef enum \hyperlink{SIV_8h_a50}{\_\-SIV\_\-M} \hyperlink{SIV_8h_a1}{SIV\_\-M}}
\label{SIV_8h_a1}

\begin{CompactList}\small\item\em Typedef for SIV\_\-M. \item\end{CompactList}\item 
\hypertarget{SIV_8h_a2}{
typedef signed int \hyperlink{SIV_8h_a2}{SIV}}
\label{SIV_8h_a2}

\begin{CompactList}\small\item\em The state information vector. \item\end{CompactList}\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum \hyperlink{SIV_8h_a49}{\_\-SIV\_\-V} \{ \par
\hyperlink{SIV_8h_a49a3}{SIV\_\-V\_\-STATE} =  30, 
\par
\hyperlink{SIV_8h_a49a4}{SIV\_\-V\_\-STATE\_\-MORE} =  SIV\_\-V\_\-STATE + 1, 
\par
\hyperlink{SIV_8h_a49a5}{SIV\_\-V\_\-STATE\_\-NOTFIRST} =  SIV\_\-V\_\-STATE + 0, 
\par
\hyperlink{SIV_8h_a49a6}{SIV\_\-V\_\-RSVD} =  24, 
\par
\hyperlink{SIV_8h_a49a7}{SIV\_\-V\_\-ERR} =  16, 
\par
\hyperlink{SIV_8h_a49a8}{SIV\_\-V\_\-ERR\_\-RSVD\_\-7} =  SIV\_\-V\_\-ERR + 7, 
\par
\hyperlink{SIV_8h_a49a9}{SIV\_\-V\_\-ERR\_\-RSVD\_\-6} =  SIV\_\-V\_\-ERR + 6, 
\par
\hyperlink{SIV_8h_a49a10}{SIV\_\-V\_\-ERR\_\-SEQ} =  SIV\_\-V\_\-ERR + 5, 
\par
\hyperlink{SIV_8h_a49a11}{SIV\_\-V\_\-ERR\_\-SEQ0} =  SIV\_\-V\_\-ERR + 4, 
\par
\hyperlink{SIV_8h_a49a12}{SIV\_\-V\_\-ERR\_\-EBM} =  SIV\_\-V\_\-ERR + 3, 
\par
\hyperlink{SIV_8h_a49a13}{SIV\_\-V\_\-ERR\_\-PARITY} =  SIV\_\-V\_\-ERR + 2, 
\par
\hyperlink{SIV_8h_a49a14}{SIV\_\-V\_\-ERR\_\-XFR} =  SIV\_\-V\_\-ERR + 1, 
\par
\hyperlink{SIV_8h_a49a15}{SIV\_\-V\_\-ERR\_\-RCV} =  SIV\_\-V\_\-ERR + 0, 
\par
\hyperlink{SIV_8h_a49a16}{SIV\_\-V\_\-VAL} =  0, 
\par
\hyperlink{SIV_8h_a49a17}{SIV\_\-V\_\-VAL\_\-RSVD} =  SIV\_\-V\_\-VAL + 13, 
\par
\hyperlink{SIV_8h_a49a18}{SIV\_\-V\_\-VAL\_\-EDWSTATUS} =  SIV\_\-V\_\-VAL + 8, 
\par
\hyperlink{SIV_8h_a49a19}{SIV\_\-V\_\-VAL\_\-EBMERR} =  SIV\_\-V\_\-VAL + 5, 
\par
\hyperlink{SIV_8h_a49a20}{SIV\_\-V\_\-VAL\_\-EBMSEQ} =  SIV\_\-V\_\-VAL + 0
 \}
\begin{CompactList}\small\item\em The right justified bit offsets of the Packet Reassembly state information vector. \item\end{CompactList}\item 
enum \hyperlink{SIV_8h_a50}{\_\-SIV\_\-M} \{ \par
\hyperlink{SIV_8h_a50a21}{SIV\_\-M\_\-STATE} =  (0x3 $<$$<$ SIV\_\-V\_\-STATE), 
\par
\hyperlink{SIV_8h_a50a22}{SIV\_\-M\_\-STATE\_\-MORE} =  (1 $<$$<$ SIV\_\-V\_\-STATE\_\-MORE), 
\par
\hyperlink{SIV_8h_a50a23}{SIV\_\-M\_\-STATE\_\-NOTFIRST} =  (1 $<$$<$ SIV\_\-V\_\-STATE\_\-NOTFIRST), 
\par
\hyperlink{SIV_8h_a50a24}{SIV\_\-M\_\-RSVD} =  (0x3f $<$$<$ SIV\_\-V\_\-RSVD), 
\par
\hyperlink{SIV_8h_a50a25}{SIV\_\-M\_\-ERR} =  (0xff $<$$<$ SIV\_\-V\_\-ERR), 
\par
\hyperlink{SIV_8h_a50a26}{SIV\_\-M\_\-ERR\_\-SEQ} =  (1 $<$$<$ SIV\_\-V\_\-ERR\_\-SEQ ), 
\par
\hyperlink{SIV_8h_a50a27}{SIV\_\-M\_\-ERR\_\-SEQ0} =  (1 $<$$<$ SIV\_\-V\_\-ERR\_\-SEQ0), 
\par
\hyperlink{SIV_8h_a50a28}{SIV\_\-M\_\-ERR\_\-EBM} =  (1 $<$$<$ SIV\_\-V\_\-ERR\_\-EBM), 
\par
\hyperlink{SIV_8h_a50a29}{SIV\_\-M\_\-ERR\_\-PARITY} =  (1 $<$$<$ SIV\_\-V\_\-ERR\_\-PARITY), 
\par
\hyperlink{SIV_8h_a50a30}{SIV\_\-M\_\-ERR\_\-XFR} =  (1 $<$$<$ SIV\_\-V\_\-ERR\_\-XFR ), 
\par
\hyperlink{SIV_8h_a50a31}{SIV\_\-M\_\-ERR\_\-RCV} =  (1 $<$$<$ SIV\_\-V\_\-ERR\_\-RCV ), 
\par
\hyperlink{SIV_8h_a50a32}{SIV\_\-M\_\-VAL} =  (0xffff $<$$<$ SIV\_\-V\_\-VAL), 
\par
\hyperlink{SIV_8h_a50a33}{SIV\_\-M\_\-VAL\_\-RSVD} =  (0x3 $<$$<$ SIV\_\-V\_\-VAL\_\-RSVD), 
\par
\hyperlink{SIV_8h_a50a34}{SIV\_\-M\_\-VAL\_\-EDWSTATUS} =  (0x1f $<$$<$ SIV\_\-V\_\-VAL\_\-EDWSTATUS), 
\par
\hyperlink{SIV_8h_a50a35}{SIV\_\-M\_\-VAL\_\-EBMERR} =  (0x7 $<$$<$ SIV\_\-V\_\-VAL\_\-EBMERR), 
\par
\hyperlink{SIV_8h_a50a36}{SIV\_\-M\_\-VAL\_\-EBMSEQ} =  (0x1f $<$$<$ SIV\_\-V\_\-VAL\_\-EBMSEQ)
 \}
\begin{CompactList}\small\item\em The in place mask of the Packet Reassembly state information vector. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
\hyperlink{SIV_8h_a2}{SIV} \hyperlink{SIV_8h_a37}{SIV\_\-init} (void)
\begin{CompactList}\small\item\em Returns an initializes the Packet Reassembly State Information Vector. \item\end{CompactList}\item 
\hyperlink{SIV_8h_a2}{SIV} \hyperlink{SIV_8h_a38}{SIV\_\-update} (\hyperlink{SIV_8h_a2}{SIV} siv, unsigned int edw, const EBF\_\-pkt $\ast$pkt)
\begin{CompactList}\small\item\em Returns the updated the State Information Vector. \item\end{CompactList}\item 
static \_\-\_\-inline int \hyperlink{SIV_8h_a39}{SIV\_\-\_\-is\-First} (\hyperlink{SIV_8h_a2}{SIV} siv)
\begin{CompactList}\small\item\em Returns non-zero is this is the first or only packet in a sequence. \item\end{CompactList}\item 
static \_\-\_\-inline int \hyperlink{SIV_8h_a40}{SIV\_\-\_\-is\-Not\-First} (\hyperlink{SIV_8h_a2}{SIV} siv)
\begin{CompactList}\small\item\em Returns non-zero is this is the not first or only packet in a sequence. \item\end{CompactList}\item 
static \_\-\_\-inline int \hyperlink{SIV_8h_a41}{SIV\_\-\_\-is\-Mid} (\hyperlink{SIV_8h_a2}{SIV} siv)
\begin{CompactList}\small\item\em Returns non-zero is this is not the first or last member of a sequence. \item\end{CompactList}\item 
static \_\-\_\-inline int \hyperlink{SIV_8h_a42}{SIV\_\-\_\-is\-First\-Or\-Last} (\hyperlink{SIV_8h_a2}{SIV} siv)
\begin{CompactList}\small\item\em Returns non-zero is this is the first or last member of a sequence. \item\end{CompactList}\item 
static \_\-\_\-inline int \hyperlink{SIV_8h_a43}{SIV\_\-\_\-is\-Last} (\hyperlink{SIV_8h_a2}{SIV} siv)
\begin{CompactList}\small\item\em Returns non-zero is this is not the last or only member of a sequence. \item\end{CompactList}\item 
static \_\-\_\-inline int \hyperlink{SIV_8h_a44}{SIV\_\-\_\-is\-More} (\hyperlink{SIV_8h_a2}{SIV} siv)
\begin{CompactList}\small\item\em Returns non-zero if there are more packets to come. \item\end{CompactList}\item 
static \_\-\_\-inline int \hyperlink{SIV_8h_a45}{SIV\_\-\_\-is\-List} (\hyperlink{SIV_8h_a2}{SIV} siv)
\begin{CompactList}\small\item\em Returns non-zero is this is a member of a sequence. \item\end{CompactList}\item 
static \_\-\_\-inline int \hyperlink{SIV_8h_a46}{SIV\_\-\_\-is\-Only} (\hyperlink{SIV_8h_a2}{SIV} siv)
\begin{CompactList}\small\item\em Returns non-zero is this is not the only member of a sequence. \item\end{CompactList}\item 
static \_\-\_\-inline int \hyperlink{SIV_8h_a47}{SIV\_\-\_\-is\-Last\-Seq} (\hyperlink{SIV_8h_a2}{SIV} siv)
\begin{CompactList}\small\item\em Returns non-zero if this is the last packet in a sequence. \item\end{CompactList}\item 
static \_\-\_\-inline int \hyperlink{SIV_8h_a48}{SIV\_\-\_\-has\-Errors} (\hyperlink{SIV_8h_a2}{SIV} siv)
\begin{CompactList}\small\item\em Returns a non-zero value if errors are present. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Interface to the packet's State Information Vector. 

\begin{Desc}
\item[Author:]JJRussell - \href{mailto:russell@slac.stanford.edu}{\tt russell@slac.stanford.edu}\end{Desc}


\footnotesize\begin{verbatim}   CVS $Id: SIV.h,v 1.1 2006/02/15 22:31:41 russell Exp $
\end{verbatim}
\normalsize


\begin{Desc}
\item[Overview]The LCB delivers events and other information to a CPU in the form of packets. The hardware may break the data into multiple packets for two reasons\begin{enumerate}
\item The most common is because a packet has a finite length (the maximum is 4K - 128 = 3968 bytes on a byte-wide LCB). Data larger than this must broken into multiple packets each of which is smaller than this maximum\item The event fabric between the EBM and CPU can assert backpressure. In order to avoid deadlocks, the EBM relinquishes the event fabric and breaks the data into multiple packets.\end{enumerate}
\end{Desc}
\begin{Desc}
\item[]By limiting the data shipped out of a CPU to the maximum, the first form of packetizing can be avoided. This would truly be nice if one could avoid the whole packet reassembly process for CPU-to-CPU communications, but, unfortunately, the second reason for packetization cannot be avoided.\end{Desc}
\begin{Desc}
\item[What's Provided]Packet reassemble is presented in layers, with this routine at the lowest layers.It is a very simple routine to implement the state machine that guides the packet reassembly process.\end{Desc}
\begin{Desc}
\item[Layout of this 32-bit word]This word comes in 4 major sub-fields\begin{enumerate}
\item State field, 2 bits\item Reserved field, 6 bits\item Error summary field, 8 bits\item Value field, 16 bits\end{enumerate}
\end{Desc}
\begin{Desc}
\item[Each of these fields is now discussed in turn]\end{Desc}
\begin{Desc}
\item[The State Field and the State Machine]The entire state of the packet reassembly process can be described by the following 3 booleans\end{Desc}
\begin{enumerate}
\item More packets to come\item List in progress (vs a single packet)\item An error was detected during the reassembly process\end{enumerate}


\begin{Desc}
\item[]It is the job of the error field to summarize the source of errors which could b potentially fatal to the handling/decoding of the packet. The state field is constructed such that a standalone packet (the most normal case) has a value of 0.\end{Desc}
\begin{Desc}
\item[The Error Field]The error field can be thought of as a group of bits summarizing the source of serious errors. The error field of a perfectly constructed packet will be zero\end{Desc}
\begin{enumerate}
\item First packet did not have sequence number 0\item Subsequent packets did not have the anticipated sequence number\item The event descriptor receive status had a value other than SUCCESS or PACKET\_\-TRUNCATED. (There is only one other INVALID\_\-DATA\_\-PARITY.) This will be dealt with in more detail later.\end{enumerate}


\begin{Desc}
\item[Back to the State Machine]For purposes of this discussion, it is convenient to think of collapsing all the errors syndromes to a single bit, error or no error. Then the states of the packet reasssembly, plus the interpretation are\end{Desc}
par \begin{table}[h]\begin{TabularC}{2}
\hline
State &Interpretation 

\\\hline
{\tt Done, No list, No Error} &{\tt Well-behaved single packet} 

\\\hline
{\tt Done, No list, Error} &{\tt Single packet with an error} 

\\\hline
{\tt Done, List, No Error} &{\tt Completed list of packets, no error} 

\\\hline
{\tt Done, List,Error} &{\tt Completed list of packets, with error(s)} 

\\\hline
{\tt List in progress, No list, No Error} &{\tt First packet in a list of packets} 

\\\hline
{\tt List in progress, No list, Error} &{\tt First packet in a list of packets, with error(s)} 

\\\hline
{\tt List in progress, List, No Error} &{\tt Middle packet in a list of packets, no error} 

\\\hline
{\tt List in progress, List,Error} &{\tt Middle packet in a list of packets, with error(s)} 



\begin{Desc}
\item[State Transitions]A state transition occurs when a new packet arrives. The relevant information is extracted from the new packet causing the current state to be updated. The function SIV\_\-Update (siv, edw, packet) performs this function.\end{Desc}
\begin{Desc}
\item[]The state information vector was carefully arranged so that 3 of the most interesting states told by a simply comparision with 0\end{Desc}
\begin{enumerate}
\item == 0, One and Only packet in the sequence\item $>$ 0, Last packet in a sequence\item $<$ 0, More packets to come\end{enumerate}


\begin{Desc}
\item[]While the bits in the state information can be test directly, the user is encouraged to use the inlines provided for a more modular approach.\end{Desc}
\begin{itemize}
\item SIV\_\-\_\-is\-First - is the only or first packet of a sequence\item SIV\_\-\_\-is\-Not\-First - is not the first packet of a sequence\end{itemize}


\begin{itemize}
\item SIV\_\-\_\-iss\-Mid - is the middle packet of a sequence\item SIV\_\-\_\-is\-First\-Or\-Last - is the first and/or last packet\end{itemize}


\begin{itemize}
\item SIV\_\-\_\-is\-Last - is the only or last, i.e. no more to come\item SIV\_\-\_\-is\-More - more to follow\end{itemize}


\begin{itemize}
\item SIV\_\-\_\-is\-List - is member of a list\item SIV\_\-\_\-is\-Only - is the only packet\end{itemize}


\begin{itemize}
\item SIV\_\-\_\-is\-Last\-Seq - is the last member of a sequence\end{itemize}


\begin{Desc}
\item[Typical Usage]The following code snippet illustrates typical usage\end{Desc}


\footnotesize\begin{verbatim}        siv = SIV_update (ctl->siv, edw, pkt);  // Update the previous siv
        ctl->siv = siv;                         // Retain state

        EBF_dirCompose (dir, siv);              // Always update the dir
        if (SIV_isFirst (siv))                  // Check if first
        {
            ...
        }

        if (SIV_isLast (siv))                   // Check is sequence is done
        {
            EBF_dirReassemble (dir, ALL);
        }
\end{verbatim}
\normalsize


\\\hline
\end{TabularC}
\centering
\caption{Packet Reassembly States}
\end{table}


\subsection{Enumeration Type Documentation}
\hypertarget{SIV_8h_a50}{
\index{SIV.h@{SIV.h}!_SIV_M@{\_\-SIV\_\-M}}
\index{_SIV_M@{\_\-SIV\_\-M}!SIV.h@{SIV.h}}
\subsubsection[\_\-SIV\_\-M]{\setlength{\rightskip}{0pt plus 5cm}enum \hyperlink{SIV_8h_a50}{\_\-SIV\_\-M}}}
\label{SIV_8h_a50}


The in place mask of the Packet Reassembly state information vector. 

\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{SIV_M_STATE@{SIV\_\-M\_\-STATE}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_M_STATE@{SIV\_\-M\_\-STATE}}\item[{\em 
\hypertarget{SIV_8h_a50a21}{
SIV\_\-M\_\-STATE}
\label{SIV_8h_a50a21}
}]State field mask \index{SIV_M_STATE_MORE@{SIV\_\-M\_\-STATE\_\-MORE}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_M_STATE_MORE@{SIV\_\-M\_\-STATE\_\-MORE}}\item[{\em 
\hypertarget{SIV_8h_a50a22}{
SIV\_\-M\_\-STATE\_\-MORE}
\label{SIV_8h_a50a22}
}]More packets are expected, {\em i.e\/}. a list is in progress \index{SIV_M_STATE_NOTFIRST@{SIV\_\-M\_\-STATE\_\-NOTFIRST}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_M_STATE_NOTFIRST@{SIV\_\-M\_\-STATE\_\-NOTFIRST}}\item[{\em 
\hypertarget{SIV_8h_a50a23}{
SIV\_\-M\_\-STATE\_\-NOTFIRST}
\label{SIV_8h_a50a23}
}]More than one packet is on the list \index{SIV_M_RSVD@{SIV\_\-M\_\-RSVD}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_M_RSVD@{SIV\_\-M\_\-RSVD}}\item[{\em 
\hypertarget{SIV_8h_a50a24}{
SIV\_\-M\_\-RSVD}
\label{SIV_8h_a50a24}
}]Reserved field mask \index{SIV_M_ERR@{SIV\_\-M\_\-ERR}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_M_ERR@{SIV\_\-M\_\-ERR}}\item[{\em 
\hypertarget{SIV_8h_a50a25}{
SIV\_\-M\_\-ERR}
\label{SIV_8h_a50a25}
}]Error field mask \index{SIV_M_ERR_SEQ@{SIV\_\-M\_\-ERR\_\-SEQ}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_M_ERR_SEQ@{SIV\_\-M\_\-ERR\_\-SEQ}}\item[{\em 
\hypertarget{SIV_8h_a50a26}{
SIV\_\-M\_\-ERR\_\-SEQ}
\label{SIV_8h_a50a26}
}]Unexpected sequence number on the other than the first packet \index{SIV_M_ERR_SEQ0@{SIV\_\-M\_\-ERR\_\-SEQ0}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_M_ERR_SEQ0@{SIV\_\-M\_\-ERR\_\-SEQ0}}\item[{\em 
\hypertarget{SIV_8h_a50a27}{
SIV\_\-M\_\-ERR\_\-SEQ0}
\label{SIV_8h_a50a27}
}]Unexpected sequence number on the first packet \index{SIV_M_ERR_EBM@{SIV\_\-M\_\-ERR\_\-EBM}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_M_ERR_EBM@{SIV\_\-M\_\-ERR\_\-EBM}}\item[{\em 
\hypertarget{SIV_8h_a50a28}{
SIV\_\-M\_\-ERR\_\-EBM}
\label{SIV_8h_a50a28}
}]The error field of EBM word of the first contributor was non-zero \index{SIV_M_ERR_PARITY@{SIV\_\-M\_\-ERR\_\-PARITY}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_M_ERR_PARITY@{SIV\_\-M\_\-ERR\_\-PARITY}}\item[{\em 
\hypertarget{SIV_8h_a50a29}{
SIV\_\-M\_\-ERR\_\-PARITY}
\label{SIV_8h_a50a29}
}]Parity error in the LATp word of the first contributor \index{SIV_M_ERR_XFR@{SIV\_\-M\_\-ERR\_\-XFR}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_M_ERR_XFR@{SIV\_\-M\_\-ERR\_\-XFR}}\item[{\em 
\hypertarget{SIV_8h_a50a30}{
SIV\_\-M\_\-ERR\_\-XFR}
\label{SIV_8h_a50a30}
}]Transfer error in the event descriptor \index{SIV_M_ERR_RCV@{SIV\_\-M\_\-ERR\_\-RCV}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_M_ERR_RCV@{SIV\_\-M\_\-ERR\_\-RCV}}\item[{\em 
\hypertarget{SIV_8h_a50a31}{
SIV\_\-M\_\-ERR\_\-RCV}
\label{SIV_8h_a50a31}
}]Receive error in the event descriptor \index{SIV_M_VAL@{SIV\_\-M\_\-VAL}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_M_VAL@{SIV\_\-M\_\-VAL}}\item[{\em 
\hypertarget{SIV_8h_a50a32}{
SIV\_\-M\_\-VAL}
\label{SIV_8h_a50a32}
}]Value field mask \index{SIV_M_VAL_RSVD@{SIV\_\-M\_\-VAL\_\-RSVD}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_M_VAL_RSVD@{SIV\_\-M\_\-VAL\_\-RSVD}}\item[{\em 
\hypertarget{SIV_8h_a50a33}{
SIV\_\-M\_\-VAL\_\-RSVD}
\label{SIV_8h_a50a33}
}]Reserved value field mask \index{SIV_M_VAL_EDWSTATUS@{SIV\_\-M\_\-VAL\_\-EDWSTATUS}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_M_VAL_EDWSTATUS@{SIV\_\-M\_\-VAL\_\-EDWSTATUS}}\item[{\em 
\hypertarget{SIV_8h_a50a34}{
SIV\_\-M\_\-VAL\_\-EDWSTATUS}
\label{SIV_8h_a50a34}
}]The EDW (event descriptor word status \index{SIV_M_VAL_EBMERR@{SIV\_\-M\_\-VAL\_\-EBMERR}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_M_VAL_EBMERR@{SIV\_\-M\_\-VAL\_\-EBMERR}}\item[{\em 
\hypertarget{SIV_8h_a50a35}{
SIV\_\-M\_\-VAL\_\-EBMERR}
\label{SIV_8h_a50a35}
}]The EBM error field mask \index{SIV_M_VAL_EBMSEQ@{SIV\_\-M\_\-VAL\_\-EBMSEQ}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_M_VAL_EBMSEQ@{SIV\_\-M\_\-VAL\_\-EBMSEQ}}\item[{\em 
\hypertarget{SIV_8h_a50a36}{
SIV\_\-M\_\-VAL\_\-EBMSEQ}
\label{SIV_8h_a50a36}
}]The expected sequence number \end{description}
\end{Desc}

\hypertarget{SIV_8h_a49}{
\index{SIV.h@{SIV.h}!_SIV_V@{\_\-SIV\_\-V}}
\index{_SIV_V@{\_\-SIV\_\-V}!SIV.h@{SIV.h}}
\subsubsection[\_\-SIV\_\-V]{\setlength{\rightskip}{0pt plus 5cm}enum \hyperlink{SIV_8h_a49}{\_\-SIV\_\-V}}}
\label{SIV_8h_a49}


The right justified bit offsets of the Packet Reassembly state information vector. 

\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{SIV_V_STATE@{SIV\_\-V\_\-STATE}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_V_STATE@{SIV\_\-V\_\-STATE}}\item[{\em 
\hypertarget{SIV_8h_a49a3}{
SIV\_\-V\_\-STATE}
\label{SIV_8h_a49a3}
}]Beginning of the state field \index{SIV_V_STATE_MORE@{SIV\_\-V\_\-STATE\_\-MORE}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_V_STATE_MORE@{SIV\_\-V\_\-STATE\_\-MORE}}\item[{\em 
\hypertarget{SIV_8h_a49a4}{
SIV\_\-V\_\-STATE\_\-MORE}
\label{SIV_8h_a49a4}
}]More packets are expected, {\em i.e\/}. a list is in progress \index{SIV_V_STATE_NOTFIRST@{SIV\_\-V\_\-STATE\_\-NOTFIRST}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_V_STATE_NOTFIRST@{SIV\_\-V\_\-STATE\_\-NOTFIRST}}\item[{\em 
\hypertarget{SIV_8h_a49a5}{
SIV\_\-V\_\-STATE\_\-NOTFIRST}
\label{SIV_8h_a49a5}
}]Not the first packet on the list \index{SIV_V_RSVD@{SIV\_\-V\_\-RSVD}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_V_RSVD@{SIV\_\-V\_\-RSVD}}\item[{\em 
\hypertarget{SIV_8h_a49a6}{
SIV\_\-V\_\-RSVD}
\label{SIV_8h_a49a6}
}]6 bit reserved field \index{SIV_V_ERR@{SIV\_\-V\_\-ERR}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_V_ERR@{SIV\_\-V\_\-ERR}}\item[{\em 
\hypertarget{SIV_8h_a49a7}{
SIV\_\-V\_\-ERR}
\label{SIV_8h_a49a7}
}]Beginning of the error field \index{SIV_V_ERR_RSVD_7@{SIV\_\-V\_\-ERR\_\-RSVD\_\-7}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_V_ERR_RSVD_7@{SIV\_\-V\_\-ERR\_\-RSVD\_\-7}}\item[{\em 
\hypertarget{SIV_8h_a49a8}{
SIV\_\-V\_\-ERR\_\-RSVD\_\-7}
\label{SIV_8h_a49a8}
}]Reserved for future use \index{SIV_V_ERR_RSVD_6@{SIV\_\-V\_\-ERR\_\-RSVD\_\-6}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_V_ERR_RSVD_6@{SIV\_\-V\_\-ERR\_\-RSVD\_\-6}}\item[{\em 
\hypertarget{SIV_8h_a49a9}{
SIV\_\-V\_\-ERR\_\-RSVD\_\-6}
\label{SIV_8h_a49a9}
}]Reserved for future use \index{SIV_V_ERR_SEQ@{SIV\_\-V\_\-ERR\_\-SEQ}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_V_ERR_SEQ@{SIV\_\-V\_\-ERR\_\-SEQ}}\item[{\em 
\hypertarget{SIV_8h_a49a10}{
SIV\_\-V\_\-ERR\_\-SEQ}
\label{SIV_8h_a49a10}
}]Unexpected sequence number on the other than the first packet \index{SIV_V_ERR_SEQ0@{SIV\_\-V\_\-ERR\_\-SEQ0}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_V_ERR_SEQ0@{SIV\_\-V\_\-ERR\_\-SEQ0}}\item[{\em 
\hypertarget{SIV_8h_a49a11}{
SIV\_\-V\_\-ERR\_\-SEQ0}
\label{SIV_8h_a49a11}
}]Unexpected sequence number on the first packet \index{SIV_V_ERR_EBM@{SIV\_\-V\_\-ERR\_\-EBM}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_V_ERR_EBM@{SIV\_\-V\_\-ERR\_\-EBM}}\item[{\em 
\hypertarget{SIV_8h_a49a12}{
SIV\_\-V\_\-ERR\_\-EBM}
\label{SIV_8h_a49a12}
}]The error field of the EBM word of the first contributor was non-zero. . \index{SIV_V_ERR_PARITY@{SIV\_\-V\_\-ERR\_\-PARITY}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_V_ERR_PARITY@{SIV\_\-V\_\-ERR\_\-PARITY}}\item[{\em 
\hypertarget{SIV_8h_a49a13}{
SIV\_\-V\_\-ERR\_\-PARITY}
\label{SIV_8h_a49a13}
}]Parity error in the LATp word of the first contributor. In theory this should never occur. The LATp standard indicates that such packets should be discarded. \index{SIV_V_ERR_XFR@{SIV\_\-V\_\-ERR\_\-XFR}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_V_ERR_XFR@{SIV\_\-V\_\-ERR\_\-XFR}}\item[{\em 
\hypertarget{SIV_8h_a49a14}{
SIV\_\-V\_\-ERR\_\-XFR}
\label{SIV_8h_a49a14}
}]Transfer error in event descriptor \index{SIV_V_ERR_RCV@{SIV\_\-V\_\-ERR\_\-RCV}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_V_ERR_RCV@{SIV\_\-V\_\-ERR\_\-RCV}}\item[{\em 
\hypertarget{SIV_8h_a49a15}{
SIV\_\-V\_\-ERR\_\-RCV}
\label{SIV_8h_a49a15}
}]Receive error in event descriptor \index{SIV_V_VAL@{SIV\_\-V\_\-VAL}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_V_VAL@{SIV\_\-V\_\-VAL}}\item[{\em 
\hypertarget{SIV_8h_a49a16}{
SIV\_\-V\_\-VAL}
\label{SIV_8h_a49a16}
}]Beginning of the value field \index{SIV_V_VAL_RSVD@{SIV\_\-V\_\-VAL\_\-RSVD}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_V_VAL_RSVD@{SIV\_\-V\_\-VAL\_\-RSVD}}\item[{\em 
\hypertarget{SIV_8h_a49a17}{
SIV\_\-V\_\-VAL\_\-RSVD}
\label{SIV_8h_a49a17}
}]3 bit reserved field \index{SIV_V_VAL_EDWSTATUS@{SIV\_\-V\_\-VAL\_\-EDWSTATUS}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_V_VAL_EDWSTATUS@{SIV\_\-V\_\-VAL\_\-EDWSTATUS}}\item[{\em 
\hypertarget{SIV_8h_a49a18}{
SIV\_\-V\_\-VAL\_\-EDWSTATUS}
\label{SIV_8h_a49a18}
}]5 bit field holding the receive and transmit status from the event descriptor word. \index{SIV_V_VAL_EBMERR@{SIV\_\-V\_\-VAL\_\-EBMERR}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_V_VAL_EBMERR@{SIV\_\-V\_\-VAL\_\-EBMERR}}\item[{\em 
\hypertarget{SIV_8h_a49a19}{
SIV\_\-V\_\-VAL\_\-EBMERR}
\label{SIV_8h_a49a19}
}]3 bit field holding the EBM error field from the first contribution \index{SIV_V_VAL_EBMSEQ@{SIV\_\-V\_\-VAL\_\-EBMSEQ}!SIV.h@{SIV.h}}\index{SIV.h@{SIV.h}!SIV_V_VAL_EBMSEQ@{SIV\_\-V\_\-VAL\_\-EBMSEQ}}\item[{\em 
\hypertarget{SIV_8h_a49a20}{
SIV\_\-V\_\-VAL\_\-EBMSEQ}
\label{SIV_8h_a49a20}
}]5 bit field holding the expected sequence number \end{description}
\end{Desc}



\subsection{Function Documentation}
\hypertarget{SIV_8h_a48}{
\index{SIV.h@{SIV.h}!SIV__hasErrors@{SIV\_\-\_\-hasErrors}}
\index{SIV__hasErrors@{SIV\_\-\_\-hasErrors}!SIV.h@{SIV.h}}
\subsubsection[SIV\_\-\_\-hasErrors]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline int SIV\_\-\_\-has\-Errors (\hyperlink{SIV_8h_a2}{SIV} {\em siv})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{SIV_8h_a48}


Returns a non-zero value if errors are present. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em Non-zero}]if errors are present \item[{\em Zero}]is error free\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em siv}]The state information vector to test\end{description}
\end{Desc}
\hypertarget{SIV_8h_a39}{
\index{SIV.h@{SIV.h}!SIV__isFirst@{SIV\_\-\_\-isFirst}}
\index{SIV__isFirst@{SIV\_\-\_\-isFirst}!SIV.h@{SIV.h}}
\subsubsection[SIV\_\-\_\-isFirst]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline int SIV\_\-\_\-is\-First (\hyperlink{SIV_8h_a2}{SIV} {\em siv})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{SIV_8h_a39}


Returns non-zero is this is the first or only packet in a sequence. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em ==}]0 if this is not the first or only member of a sequence != 0 if this is the first or only member of a sequence\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em siv}]The state information vector to test\end{description}
\end{Desc}
\begin{Desc}
\item[]This is logical opposite of SIV\_\-\_\-is\-Not\-First\end{Desc}
\hypertarget{SIV_8h_a42}{
\index{SIV.h@{SIV.h}!SIV__isFirstOrLast@{SIV\_\-\_\-isFirstOrLast}}
\index{SIV__isFirstOrLast@{SIV\_\-\_\-isFirstOrLast}!SIV.h@{SIV.h}}
\subsubsection[SIV\_\-\_\-isFirstOrLast]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline int SIV\_\-\_\-is\-First\-Or\-Last (\hyperlink{SIV_8h_a2}{SIV} {\em siv})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{SIV_8h_a42}


Returns non-zero is this is the first or last member of a sequence. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em ==}]0 if this is the first or last member of a sequence != 0 if this is not the first or last member of a sequence\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em siv}]The state information vector to test\end{description}
\end{Desc}
\begin{Desc}
\item[]This is the logical opposite of EBF\_\-\_\-siv\-Is\-Mid. Note that in the case that there is only one packet, this packet is both the first and the last, so this function will return non-zero.\end{Desc}
\hypertarget{SIV_8h_a43}{
\index{SIV.h@{SIV.h}!SIV__isLast@{SIV\_\-\_\-isLast}}
\index{SIV__isLast@{SIV\_\-\_\-isLast}!SIV.h@{SIV.h}}
\subsubsection[SIV\_\-\_\-isLast]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline int SIV\_\-\_\-is\-Last (\hyperlink{SIV_8h_a2}{SIV} {\em siv})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{SIV_8h_a43}


Returns non-zero is this is not the last or only member of a sequence. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em ==}]0 if this is not the last or only member of a sequence != 0 if this is the last or only member of a sequence\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em siv}]The state information vector to test\end{description}
\end{Desc}
\begin{Desc}
\item[Warning:]To make these routines as trivial as possible, the user should strip the error fields using SIV\_\-\_\-err\-Remove;\end{Desc}
\begin{Desc}
\item[]This is logical opposite of EBF\_\-\_\-siv\-Is\-More.\end{Desc}
\hypertarget{SIV_8h_a47}{
\index{SIV.h@{SIV.h}!SIV__isLastSeq@{SIV\_\-\_\-isLastSeq}}
\index{SIV__isLastSeq@{SIV\_\-\_\-isLastSeq}!SIV.h@{SIV.h}}
\subsubsection[SIV\_\-\_\-isLastSeq]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline int SIV\_\-\_\-is\-Last\-Seq (\hyperlink{SIV_8h_a2}{SIV} {\em siv})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{SIV_8h_a47}


Returns non-zero if this is the last packet in a sequence. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em ==}]0 if this is not the last member of a sequence != 0 if this is the last member of a sequence\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em siv}]The state information vector to test\end{description}
\end{Desc}
\hypertarget{SIV_8h_a45}{
\index{SIV.h@{SIV.h}!SIV__isList@{SIV\_\-\_\-isList}}
\index{SIV__isList@{SIV\_\-\_\-isList}!SIV.h@{SIV.h}}
\subsubsection[SIV\_\-\_\-isList]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline int SIV\_\-\_\-is\-List (\hyperlink{SIV_8h_a2}{SIV} {\em siv})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{SIV_8h_a45}


Returns non-zero is this is a member of a sequence. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em ==}]0 if this is not a member of a sequence != 0 if this is a member of a sequence\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em siv}]The state information vector to test\end{description}
\end{Desc}
\begin{Desc}
\item[]This is the negation of SIV\_\-\_\-is\-Only\end{Desc}
\hypertarget{SIV_8h_a41}{
\index{SIV.h@{SIV.h}!SIV__isMid@{SIV\_\-\_\-isMid}}
\index{SIV__isMid@{SIV\_\-\_\-isMid}!SIV.h@{SIV.h}}
\subsubsection[SIV\_\-\_\-isMid]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline int SIV\_\-\_\-is\-Mid (\hyperlink{SIV_8h_a2}{SIV} {\em siv})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{SIV_8h_a41}


Returns non-zero is this is not the first or last member of a sequence. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em ==}]0 if this is not the first or last member of a sequence != 0 if this is the first or last member of a sequence\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em siv}]The state information vector to test\end{description}
\end{Desc}
\begin{Desc}
\item[]This is the logical opposite of EBF\_\-\_\-siv\-Is\-First\-Or\-Last.\end{Desc}
\hypertarget{SIV_8h_a44}{
\index{SIV.h@{SIV.h}!SIV__isMore@{SIV\_\-\_\-isMore}}
\index{SIV__isMore@{SIV\_\-\_\-isMore}!SIV.h@{SIV.h}}
\subsubsection[SIV\_\-\_\-isMore]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline int SIV\_\-\_\-is\-More (\hyperlink{SIV_8h_a2}{SIV} {\em siv})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{SIV_8h_a44}


Returns non-zero if there are more packets to come. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em ==}]0 if this is not the only member of a sequence != 0 if this is the only member of a sequence\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em siv}]The state information vector to test\end{description}
\end{Desc}
\begin{Desc}
\item[]This is logical opposite of SIV\_\-\_\-is\-Last.\end{Desc}
\hypertarget{SIV_8h_a40}{
\index{SIV.h@{SIV.h}!SIV__isNotFirst@{SIV\_\-\_\-isNotFirst}}
\index{SIV__isNotFirst@{SIV\_\-\_\-isNotFirst}!SIV.h@{SIV.h}}
\subsubsection[SIV\_\-\_\-isNotFirst]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline int SIV\_\-\_\-is\-Not\-First (\hyperlink{SIV_8h_a2}{SIV} {\em siv})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{SIV_8h_a40}


Returns non-zero is this is the not first or only packet in a sequence. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em ==}]0 if this is the first or only member of a sequence != 0 if this is not the first or only member of a sequence\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em siv}]The state information vector to test\end{description}
\end{Desc}
\begin{Desc}
\item[]This is logical opposite of EBF\_\-\_\-siv\-Is\-First\end{Desc}
\hypertarget{SIV_8h_a46}{
\index{SIV.h@{SIV.h}!SIV__isOnly@{SIV\_\-\_\-isOnly}}
\index{SIV__isOnly@{SIV\_\-\_\-isOnly}!SIV.h@{SIV.h}}
\subsubsection[SIV\_\-\_\-isOnly]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline int SIV\_\-\_\-is\-Only (\hyperlink{SIV_8h_a2}{SIV} {\em siv})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{SIV_8h_a46}


Returns non-zero is this is not the only member of a sequence. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em ==}]0 if this is not the only member of a sequence != 0 if this is the only member of a sequence\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em siv}]The state information vector to test\end{description}
\end{Desc}
\begin{Desc}
\item[]This is the negation of SIV\_\-\_\-is\-List\end{Desc}
\hypertarget{SIV_8h_a37}{
\index{SIV.h@{SIV.h}!SIV_init@{SIV\_\-init}}
\index{SIV_init@{SIV\_\-init}!SIV.h@{SIV.h}}
\subsubsection[SIV\_\-init]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{SIV_8h_a2}{SIV} SIV\_\-init (void)}}
\label{SIV_8h_a37}


Returns an initializes the Packet Reassembly State Information Vector. 

\begin{Desc}
\item[Returns:]The inialization value of the Packet Reassembly State Information\end{Desc}
\hypertarget{SIV_8h_a38}{
\index{SIV.h@{SIV.h}!SIV_update@{SIV\_\-update}}
\index{SIV_update@{SIV\_\-update}!SIV.h@{SIV.h}}
\subsubsection[SIV\_\-update]{\setlength{\rightskip}{0pt plus 5cm}SIV\_\-update (\hyperlink{SIV_8h_a2}{SIV} {\em siv}, unsigned int {\em edw}, const EBF\_\-pkt $\ast$ {\em pkt})}}
\label{SIV_8h_a38}


Returns the updated the State Information Vector. 

\begin{Desc}
\item[Returns:]The updated the State Information Vector\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em siv}]The current value of the State Information Vector \item[{\em edw}]The event descriptor word \item[{\em pkt}]The new EBF packet. This contains the information used to perform the update\end{description}
\end{Desc}
