\hypertarget{LCBC_8h}{
\section{LCBC.h File Reference}
\label{LCBC_8h}\index{LCBC.h@{LCBC.h}}
}
Definitions of the LCB command structures. 

{\tt \#include \char`\"{}LCBD/LCB\_\-cr.h\char`\"{}}\par
{\tt \#include \char`\"{}LCBD/LCBD\_\-cr.h\char`\"{}}\par
{\tt \#include \char`\"{}PBI/Attribute.h\char`\"{}}\par
{\tt \#include \char`\"{}PBI/Inline.h\char`\"{}}\par


Include dependency graph for LCBC.h:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=319pt]{LCBC_8h__incl}
\end{center}
\end{figure}


This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=106pt]{LCBC_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define \hyperlink{LCBC_8h_a0}{LCBC\_\-MAP\_\-TYPE\_\-BY\_\-OPCODE}
\begin{CompactList}\small\item\em Defines a 32-bit integer that functions as a map of the command type indexed by opcode. \item\end{CompactList}\item 
\#define \hyperlink{LCBC_8h_a1}{LCBC\_\-TYPE\_\-BY\_\-OPCODE\_\-FULL}(\_\-map, \_\-opcode)
\begin{CompactList}\small\item\em Maps an opcode to a command item type. \item\end{CompactList}\item 
\#define \hyperlink{LCBC_8h_a2}{LCBC\_\-TYPE\_\-BY\_\-OPCODE}(\_\-opcode)~LCBC\_\-TYPE\_\-BY\_\-OPCODE\_\-FULL(LCBC\_\-MAP\_\-TYPE\_\-BY\_\-OPCODE, \_\-opcode)
\begin{CompactList}\small\item\em Maps an opcode to a result item type. \item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{LCBC_8h_a3}{
typedef enum \hyperlink{LCBC_8h_a35}{\_\-LCBC\_\-TYPE} \hyperlink{LCBC_8h_a3}{LCBC\_\-TYPE}}
\label{LCBC_8h_a3}

\begin{CompactList}\small\item\em Typedef for enum \_\-LCBC\_\-TYPE. \item\end{CompactList}\item 
typedef unsigned int \hyperlink{LCBC_8h_a4}{LCBC\_\-processor} (void $\ast$prm, const \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ci)
\begin{CompactList}\small\item\em Callback routine for LCBC\_\-process. \item\end{CompactList}\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum \hyperlink{LCBC_8h_a35}{\_\-LCBC\_\-TYPE} \{ \par
\hyperlink{LCBC_8h_a35a5}{LCBC\_\-TYPE\_\-UNDEFINED} =  0, 
\par
\hyperlink{LCBC_8h_a35a6}{LCBC\_\-TYPE\_\-SIMPLE} =  1, 
\par
\hyperlink{LCBC_8h_a35a7}{LCBC\_\-TYPE\_\-REGISTER} =  2, 
\par
\hyperlink{LCBC_8h_a35a8}{LCBC\_\-TYPE\_\-COMMAND} =  3, 
\par
\hyperlink{LCBC_8h_a35a9}{LCBC\_\-TYPE\_\-EVENT} =  4
 \}
\begin{CompactList}\small\item\em Enumerates the four defined command item types + one undefined type. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
LCBC\_\-\_\-EXP\_\-PROTO const void $\ast$ \hyperlink{LCBC_8h_a10}{LCBC\_\-\_\-advance} (const \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ci, int nbytes) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Advances the pointer {\em ci\/} by the specified number of bytes. \item\end{CompactList}\item 
LCBC\_\-\_\-EXP\_\-PROTO const \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ \hyperlink{LCBC_8h_a11}{LCBC\_\-\_\-next} (const \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ci) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Advances the pointer {\em ci\/} to the next command item. \item\end{CompactList}\item 
LCBC\_\-\_\-EXP\_\-PROTO \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ \hyperlink{LCBC_8h_a12}{LCBC\_\-\_\-mark\_\-time\_\-fill} (\hyperlink{struct__LCB__ci__simple}{LCB\_\-ci\_\-mark\_\-time} $\ast$ci, unsigned short int stall) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Constructs a {\em mark\/} time LCB command. \item\end{CompactList}\item 
LCBC\_\-\_\-EXP\_\-PROTO \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ \hyperlink{LCBC_8h_a13}{LCBC\_\-\_\-event\_\-fill} (\hyperlink{struct__LCB__ci__event}{LCB\_\-ci\_\-event} $\ast$ci, unsigned int latp\_\-adr, unsigned int proto, unsigned int len32, unsigned short int stall) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Constructs event transmit command, without a response. \item\end{CompactList}\item 
LCBC\_\-\_\-EXP\_\-PROTO \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ \hyperlink{LCBC_8h_a14}{LCBC\_\-\_\-cmd\_\-xmit\_\-fill} (\hyperlink{struct__LCB__ci__cmd}{LCB\_\-ci\_\-cmd} $\ast$ci, const \hyperlink{struct__LCB__ci__cmd__payload}{LCB\_\-ci\_\-cmd\_\-payload} $\ast$payload, unsigned short int stall) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Constructs transmit command, without a response. \item\end{CompactList}\item 
LCBC\_\-\_\-EXP\_\-PROTO \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ \hyperlink{LCBC_8h_a15}{LCBC\_\-\_\-lat\_\-reset\_\-fill} (\hyperlink{struct__LCB__ci__simple}{LCB\_\-ci\_\-lat\_\-reset} $\ast$ci, unsigned short int stall) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Constructs a {\em LAT\/} reset LCB command. \item\end{CompactList}\item 
LCBC\_\-\_\-EXP\_\-PROTO \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ \hyperlink{LCBC_8h_a16}{LCBC\_\-\_\-cmdr\_\-xmit\_\-fill} (\hyperlink{struct__LCB__ci__cmdr}{LCB\_\-ci\_\-cmdr} $\ast$ci, const \hyperlink{struct__LCB__ci__cmd__payload}{LCB\_\-ci\_\-cmd\_\-payload} $\ast$payload, unsigned short int timeout) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Constructs transmit command, with a response. \item\end{CompactList}\item 
LCBC\_\-\_\-EXP\_\-PROTO \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ \hyperlink{LCBC_8h_a17}{LCBC\_\-\_\-csr\_\-access\_\-fill} (\hyperlink{struct__LCB__ci__reg}{LCB\_\-ci\_\-csr} $\ast$ci, unsigned int value, unsigned int field\_\-select, unsigned short int stall) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Constructs a LCB CSR register access command. \item\end{CompactList}\item 
LCBC\_\-\_\-EXP\_\-PROTO \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ \hyperlink{LCBC_8h_a18}{LCBC\_\-\_\-faults\_\-access\_\-fill} (\hyperlink{struct__LCB__ci__reg}{LCB\_\-ci\_\-faults} $\ast$ci, unsigned int value, unsigned int field\_\-select, unsigned short int stall) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Constructs a LCB FIFO FAULTS register access command. \item\end{CompactList}\item 
LCBC\_\-\_\-EXP\_\-PROTO \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ \hyperlink{LCBC_8h_a19}{LCBC\_\-\_\-rxstats\_\-access\_\-fill} (\hyperlink{struct__LCB__ci__reg}{LCB\_\-ci\_\-rxstats} $\ast$ci, unsigned int value, unsigned int field\_\-select, unsigned short int stall) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Constructs a LCB Receive Statistics/Status register access command. \item\end{CompactList}\item 
\hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ \hyperlink{LCBC_8h_a20}{LCBC\_\-mark\_\-time\_\-fill} (\hyperlink{struct__LCB__ci__simple}{LCB\_\-ci\_\-mark\_\-time} $\ast$ci, unsigned short int stall)
\begin{CompactList}\small\item\em Constructs a {\em mark\/} time LCB command. \item\end{CompactList}\item 
\hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ \hyperlink{LCBC_8h_a21}{LCBC\_\-event\_\-fill} (\hyperlink{struct__LCB__ci__event}{LCB\_\-ci\_\-event} $\ast$ci, unsigned int latp\_\-adr, unsigned int proto, unsigned int len32, unsigned short int stall)
\begin{CompactList}\small\item\em Constructs event transmit command. \item\end{CompactList}\item 
\hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ \hyperlink{LCBC_8h_a22}{LCBC\_\-lat\_\-reset\_\-fill} (\hyperlink{struct__LCB__ci__simple}{LCB\_\-ci\_\-lat\_\-reset} $\ast$ci, unsigned short int stall)
\begin{CompactList}\small\item\em Constructs a {\em LAT\/} reset LCB command. \item\end{CompactList}\item 
\hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ \hyperlink{LCBC_8h_a23}{LCBC\_\-csr\_\-access\_\-fill} (\hyperlink{struct__LCB__ci__reg}{LCB\_\-ci\_\-csr} $\ast$ci, unsigned int value, unsigned int field\_\-select, unsigned short int stall)
\begin{CompactList}\small\item\em Constructs a LCB CSR register access command. \item\end{CompactList}\item 
\hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ \hyperlink{LCBC_8h_a24}{LCBC\_\-faults\_\-access\_\-fill} (\hyperlink{struct__LCB__ci__reg}{LCB\_\-ci\_\-faults} $\ast$ci, unsigned int value, unsigned int field\_\-select, unsigned short int stall)
\begin{CompactList}\small\item\em Constructs a LCB FIFO FAULTS register access command. \item\end{CompactList}\item 
\hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ \hyperlink{LCBC_8h_a25}{LCBC\_\-rxstats\_\-access\_\-fill} (\hyperlink{struct__LCB__ci__reg}{LCB\_\-ci\_\-rxstats} $\ast$ci, unsigned int value, unsigned int field\_\-select, unsigned short int stall)
\begin{CompactList}\small\item\em Constructs a LCB RECEIVE STATISTICS/STATUS register access command. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBC_8h_a26}{LCBC\_\-process} (const \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ci, const \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$end, \hyperlink{LCBC_8h_a4}{LCBC\_\-processor} rtn, void $\ast$prm)
\begin{CompactList}\small\item\em Executes the user specified handler for each command item in the range {\em ci\/} to {\em end\/}. \item\end{CompactList}\item 
void \hyperlink{LCBC_8h_a27}{LCBC\_\-show} (unsigned int options, const \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$beg, const \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$end)
\begin{CompactList}\small\item\em Dumps the result items to stdout. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBC_8h_a28}{LCBC\_\-cmd\_\-xmit} (LCBD lcb, const \hyperlink{struct__LCB__ci__cmd__payload}{LCB\_\-ci\_\-cmd\_\-payload} $\ast$payload, unsigned short int stall)
\begin{CompactList}\small\item\em Utility routine to compose and submit a command with no response command (department of redundancy department?). \item\end{CompactList}\item 
unsigned int \hyperlink{LCBC_8h_a29}{LCBC\_\-mark\_\-time} (LCBD lcb, unsigned short int stall)
\begin{CompactList}\small\item\em Utility routine to compose and execute an LCB mark time command. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBC_8h_a30}{LCBC\_\-lat\_\-reset} (LCBD lcb, unsigned short int stall)
\begin{CompactList}\small\item\em Utility routine to compose and execute an LCB LAT reset command. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBC_8h_a31}{LCBC\_\-cmdr\_\-xmit} (LCBD lcb, const \hyperlink{struct__LCB__ci__cmd__payload}{LCB\_\-ci\_\-cmd\_\-payload} $\ast$ci\_\-payload, unsigned short int timeout, \hyperlink{struct__LCB__ri__cmd__payload}{LCB\_\-ri\_\-cmd\_\-payload} $\ast$ri\_\-payload)
\begin{CompactList}\small\item\em Utility routine to compose and submit a command with response command (department of redundancy department?). \item\end{CompactList}\item 
unsigned int \hyperlink{LCBC_8h_a32}{LCBC\_\-csr\_\-access} (LCBD lcb, unsigned int value, unsigned int field\_\-select, unsigned short int stall, unsigned int $\ast$old\_\-val, unsigned int $\ast$cur\_\-val)
\begin{CompactList}\small\item\em Utility routine to compose and execute an access command to LCB's CSR register. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBC_8h_a33}{LCBC\_\-faults\_\-access} (LCBD lcb, unsigned int value, unsigned int field\_\-select, unsigned short int stall, unsigned int $\ast$old\_\-val, unsigned int $\ast$cur\_\-val)
\begin{CompactList}\small\item\em Utility routine to compose and execute an access command to LCB's FIFO FAULTS register. \item\end{CompactList}\item 
unsigned int \hyperlink{LCBC_8h_a34}{LCBC\_\-rxstats\_\-access} (LCBD lcb, unsigned int value, unsigned int field\_\-select, unsigned short int stall, unsigned int $\ast$old\_\-val, unsigned int $\ast$cur\_\-val)
\begin{CompactList}\small\item\em Utility routine to compose and execute an access command to LCB's RECEIVE STATISTICS/STATS register. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Definitions of the LCB command structures. 

\begin{Desc}
\item[Author:]Curt Brune -- \href{mailto:curt@slac.stanford.edu}{\tt curt@slac.stanford.edu} 

JJRussell -- \href{mailto:russell@slac.stanford.edu}{\tt russell@slac.stanford.edu}\end{Desc}


\footnotesize\begin{verbatim}  CVS $Id
\end{verbatim}
\normalsize


These map out the data structure of command items. See chapter 3 \& 4 of Mike Huffer's \char`\"{}LAT Communications Board -- Design Specification\char`\"{} for more details.

\subsection{Define Documentation}
\hypertarget{LCBC_8h_a0}{
\index{LCBC.h@{LCBC.h}!LCBC_MAP_TYPE_BY_OPCODE@{LCBC\_\-MAP\_\-TYPE\_\-BY\_\-OPCODE}}
\index{LCBC_MAP_TYPE_BY_OPCODE@{LCBC\_\-MAP\_\-TYPE\_\-BY\_\-OPCODE}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-MAP\_\-TYPE\_\-BY\_\-OPCODE]{\setlength{\rightskip}{0pt plus 5cm}\#define LCBC\_\-MAP\_\-TYPE\_\-BY\_\-OPCODE}}
\label{LCBC_8h_a0}


{\bf Value:}

\footnotesize\begin{verbatim}(                                                                       \
   (LCBC_TYPE_COMMAND      << (3 *  LCB_OPCODE_CMD        )) |            \
   (LCBC_TYPE_SIMPLE       << (3 *  LCB_OPCODE_MARK_TIME  )) |            \
   (LCBC_TYPE_EVENT        << (3 *  LCB_OPCODE_EVENT      )) |            \
   (LCBC_TYPE_SIMPLE       << (3 *  LCB_OPCODE_LAT_RESET  )) |            \
   (LCBC_TYPE_COMMAND      << (3 *  LCB_OPCODE_CMDR       )) |            \
   (LCBC_TYPE_REGISTER     << (3 *  LCB_OPCODE_CSR        )) |            \
   (LCBC_TYPE_UNDEFINED    << (3 *  LCB_OPCODE_6          )) |            \
   (LCBC_TYPE_REGISTER     << (3 *  LCB_OPCODE_FAULTS     )) |            \
   (LCBC_TYPE_UNDEFINED    << (3 *  LCB_OPCODE_8          )) |            \
   (LCBC_TYPE_REGISTER     << (3 *  LCB_OPCODE_RXSTATS    ))              \
 )
\end{verbatim}\normalsize 
Defines a 32-bit integer that functions as a map of the command type indexed by opcode. 

The 32-bit integer functions as a map of the command type indexed by opcode. Each command type consumes 3 bits. Given that there are 16 potential opcodes, it takes 48 bits to define the map. This means the map cannot be contained in a 32 bit integer. Ah, but wait, only the first ten opcodes are actually defined. So we can cheat, and only define the first ten. Indexing by greater than 32 will produce a 0.



\footnotesize\begin{verbatim}     type = opcode <= 10
          ? ((LCBC_MAP_TYPE_BY_OPCODE >> (3 * opcode)) & 0x3)
          : LCBC_TYPE_UNDEFINED;
\end{verbatim}
\normalsize


There are 16 opcodes, that map to 5 descriptor types

0 LCB\_\-OPCODE\_\-CMD = LCBC\_\-TYPE\_\-COMMAND 1 LCB\_\-OPCODE\_\-MARK\_\-TIME = LCBC\_\-TYPE\_\-SIMPLE 2 LCB\_\-OPCODE\_\-EVENT = LCBC\_\-TYPE\_\-EVENT 3 LCB\_\-OPCODE\_\-LAT\_\-RESET = LCBC\_\-TYPE\_\-SIMPLE 4 LCB\_\-OPCODE\_\-CMDW = LCBC\_\-TYPE\_\-COMMAND 5 LCB\_\-OPCODE\_\-CSR = LCBC\_\-TYPE\_\-REGISTER 6 LCB\_\-OPCODE\_\-6 = LCBC\_\-TYPE\_\-UNDEFINED 7 LCB\_\-OPCODE\_\-FAULTS = LCBC\_\-TYPE\_\-REGISTER 8 LCB\_\-OPCODE\_\-8 = LCBC\_\-TYPE\_\-UNDEFINED 9 LCB\_\-OPCODE\_\-RXSTATS = LCBC\_\-TYPE\_\-REGISTER A LCB\_\-OPCODE\_\-A = LCBC\_\-TYPE\_\-UNDEFINED B LCB\_\-OPCODE\_\-B = LCBC\_\-TYPE\_\-UNDEFINED C LCB\_\-OPCODE\_\-C = LCBC\_\-TYPE\_\-UNDEFINED D LCB\_\-OPCODE\_\-D = LCBC\_\-TYPE\_\-UNDEFINED E LCB\_\-OPCODE\_\-E = LCBC\_\-TYPE\_\-UNDEFINED F LCB\_\-PPCODE\_\-F = LCBC\_\-TYPE\_\-UNDEFINED\hypertarget{LCBC_8h_a2}{
\index{LCBC.h@{LCBC.h}!LCBC_TYPE_BY_OPCODE@{LCBC\_\-TYPE\_\-BY\_\-OPCODE}}
\index{LCBC_TYPE_BY_OPCODE@{LCBC\_\-TYPE\_\-BY\_\-OPCODE}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-TYPE\_\-BY\_\-OPCODE]{\setlength{\rightskip}{0pt plus 5cm}\#define LCBC\_\-TYPE\_\-BY\_\-OPCODE(\_\-opcode)~LCBC\_\-TYPE\_\-BY\_\-OPCODE\_\-FULL(LCBC\_\-MAP\_\-TYPE\_\-BY\_\-OPCODE, \_\-opcode)}}
\label{LCBC_8h_a2}


Maps an opcode to a result item type. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-opcode}]The opcode to map\end{description}
\end{Desc}
\hypertarget{LCBC_8h_a1}{
\index{LCBC.h@{LCBC.h}!LCBC_TYPE_BY_OPCODE_FULL@{LCBC\_\-TYPE\_\-BY\_\-OPCODE\_\-FULL}}
\index{LCBC_TYPE_BY_OPCODE_FULL@{LCBC\_\-TYPE\_\-BY\_\-OPCODE\_\-FULL}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-TYPE\_\-BY\_\-OPCODE\_\-FULL]{\setlength{\rightskip}{0pt plus 5cm}\#define LCBC\_\-TYPE\_\-BY\_\-OPCODE\_\-FULL(\_\-map, \_\-opcode)}}
\label{LCBC_8h_a1}


{\bf Value:}

\footnotesize\begin{verbatim}_opcode <= 10                                                     \
        ? (((unsigned long long int)_map >> (3 * (_opcode))) & 0x7)       \
        : LCBC_TYPE_UNDEFINED
\end{verbatim}\normalsize 
Maps an opcode to a command item type. 

\begin{Desc}
\item[Returns:]The result type\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-map}]The mapping word. \item[{\em \_\-opcode}]The opcode to map\end{description}
\end{Desc}
The {\em \_\-map\/} must have the value {\em LCBR\_\-TYPE\_\-MAP\_\-BY\_\-OPCODE\/}. This form may be more efficient than LCBR\_\-TYPE\_\-BY\_\-OPCODE, since the mapping word may be already in a register, saving (on the Power\-PC) the two instructions to load it. For those instances when this is macro is only being used once within a function, LCBR\_\-TYPE\_\-BY\_\-OPCODE is is simpler.

\subsection{Typedef Documentation}
\hypertarget{LCBC_8h_a4}{
\index{LCBC.h@{LCBC.h}!LCBC_processor@{LCBC\_\-processor}}
\index{LCBC_processor@{LCBC\_\-processor}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-processor]{\setlength{\rightskip}{0pt plus 5cm}unsigned int \hyperlink{LCBC_8h_a4}{LCBC\_\-processor}}}
\label{LCBC_8h_a4}


Callback routine for LCBC\_\-process. 

\begin{Desc}
\item[Returns:]Status, an non-zero status will cause LCBC\_\-process to quit processing items\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em prm}]Arbitrary user parameter passed to this routine \item[{\em ci}]The command item to process\end{description}
\end{Desc}
This routine gets called by LCBC\_\-process once for each command item. The routine processes the command item and then may return either 0, indicating to continue or non-zero, indicating to stop processing

\subsection{Enumeration Type Documentation}
\hypertarget{LCBC_8h_a35}{
\index{LCBC.h@{LCBC.h}!_LCBC_TYPE@{\_\-LCBC\_\-TYPE}}
\index{_LCBC_TYPE@{\_\-LCBC\_\-TYPE}!LCBC.h@{LCBC.h}}
\subsubsection[\_\-LCBC\_\-TYPE]{\setlength{\rightskip}{0pt plus 5cm}enum \hyperlink{LCBC_8h_a35}{\_\-LCBC\_\-TYPE}}}
\label{LCBC_8h_a35}


Enumerates the four defined command item types + one undefined type. 

\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{LCBC_TYPE_UNDEFINED@{LCBC\_\-TYPE\_\-UNDEFINED}!LCBC.h@{LCBC.h}}\index{LCBC.h@{LCBC.h}!LCBC_TYPE_UNDEFINED@{LCBC\_\-TYPE\_\-UNDEFINED}}\item[{\em 
\hypertarget{LCBC_8h_a35a5}{
LCBC\_\-TYPE\_\-UNDEFINED}
\label{LCBC_8h_a35a5}
}]Type is undefined \index{LCBC_TYPE_SIMPLE@{LCBC\_\-TYPE\_\-SIMPLE}!LCBC.h@{LCBC.h}}\index{LCBC.h@{LCBC.h}!LCBC_TYPE_SIMPLE@{LCBC\_\-TYPE\_\-SIMPLE}}\item[{\em 
\hypertarget{LCBC_8h_a35a6}{
LCBC\_\-TYPE\_\-SIMPLE}
\label{LCBC_8h_a35a6}
}]Type is of a simple command \index{LCBC_TYPE_REGISTER@{LCBC\_\-TYPE\_\-REGISTER}!LCBC.h@{LCBC.h}}\index{LCBC.h@{LCBC.h}!LCBC_TYPE_REGISTER@{LCBC\_\-TYPE\_\-REGISTER}}\item[{\em 
\hypertarget{LCBC_8h_a35a7}{
LCBC\_\-TYPE\_\-REGISTER}
\label{LCBC_8h_a35a7}
}]Type is a register access command \index{LCBC_TYPE_COMMAND@{LCBC\_\-TYPE\_\-COMMAND}!LCBC.h@{LCBC.h}}\index{LCBC.h@{LCBC.h}!LCBC_TYPE_COMMAND@{LCBC\_\-TYPE\_\-COMMAND}}\item[{\em 
\hypertarget{LCBC_8h_a35a8}{
LCBC\_\-TYPE\_\-COMMAND}
\label{LCBC_8h_a35a8}
}]Type is a transmit command command \index{LCBC_TYPE_EVENT@{LCBC\_\-TYPE\_\-EVENT}!LCBC.h@{LCBC.h}}\index{LCBC.h@{LCBC.h}!LCBC_TYPE_EVENT@{LCBC\_\-TYPE\_\-EVENT}}\item[{\em 
\hypertarget{LCBC_8h_a35a9}{
LCBC\_\-TYPE\_\-EVENT}
\label{LCBC_8h_a35a9}
}]Type is a transmit event \end{description}
\end{Desc}



\subsection{Function Documentation}
\hypertarget{LCBC_8h_a10}{
\index{LCBC.h@{LCBC.h}!LCBC__advance@{LCBC\_\-\_\-advance}}
\index{LCBC__advance@{LCBC\_\-\_\-advance}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-\_\-advance]{\setlength{\rightskip}{0pt plus 5cm}LCBC\_\-\_\-EXP\_\-FNC const void $\ast$ LCBC\_\-\_\-advance (const \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ {\em ci}, int {\em nbytes})}}
\label{LCBC_8h_a10}


Advances the pointer {\em ci\/} by the specified number of bytes. 

\begin{Desc}
\item[Returns:]The advanced pointer\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ci}]Thehe command item pointer to advance \item[{\em nbytes}]The number of bytes to advance the pointer\end{description}
\end{Desc}
\hypertarget{LCBC_8h_a14}{
\index{LCBC.h@{LCBC.h}!LCBC__cmd_xmit_fill@{LCBC\_\-\_\-cmd\_\-xmit\_\-fill}}
\index{LCBC__cmd_xmit_fill@{LCBC\_\-\_\-cmd\_\-xmit\_\-fill}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-\_\-cmd\_\-xmit\_\-fill]{\setlength{\rightskip}{0pt plus 5cm}LCBC\_\-\_\-EXP\_\-FNC \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ LCBC\_\-\_\-cmd\_\-xmit\_\-fill (\hyperlink{struct__LCB__ci__cmd}{LCB\_\-ci\_\-cmd} $\ast$ {\em ci}, const \hyperlink{struct__LCB__ci__cmd__payload}{LCB\_\-ci\_\-cmd\_\-payload} $\ast$ {\em payload}, unsigned short int {\em stall})}}
\label{LCBC_8h_a14}


Constructs transmit command, without a response. 

\begin{Desc}
\item[Returns:]Pointer to the next command item to be filled\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ci}]The command item to be filled. \item[{\em payload}]The transmit command's payload. This consists of a LATp header plus a highly encoded bit pattern which determines further routing and the action to be taken at the destination \item[{\em stall}]The stall period, in units of 20MHz clock ticks\end{description}
\end{Desc}
\hypertarget{LCBC_8h_a16}{
\index{LCBC.h@{LCBC.h}!LCBC__cmdr_xmit_fill@{LCBC\_\-\_\-cmdr\_\-xmit\_\-fill}}
\index{LCBC__cmdr_xmit_fill@{LCBC\_\-\_\-cmdr\_\-xmit\_\-fill}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-\_\-cmdr\_\-xmit\_\-fill]{\setlength{\rightskip}{0pt plus 5cm}LCBC\_\-\_\-EXP\_\-FNC \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ LCBC\_\-\_\-cmdr\_\-xmit\_\-fill (\hyperlink{struct__LCB__ci__cmdr}{LCB\_\-ci\_\-cmdr} $\ast$ {\em ci}, const \hyperlink{struct__LCB__ci__cmd__payload}{LCB\_\-ci\_\-cmd\_\-payload} $\ast$ {\em payload}, unsigned short int {\em timeout})}}
\label{LCBC_8h_a16}


Constructs transmit command, with a response. 

\begin{Desc}
\item[Returns:]Pointer to the next command item to be filled\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ci}]The command item to be filled. \item[{\em payload}]The transmit command's payload. This consists of a LATp header plus a highly encoded bit pattern which determines further routing and the action to be taken at the destination \item[{\em timeout}]The timeout perion, in units of 20MHz clock ticks\end{description}
\end{Desc}
\hypertarget{LCBC_8h_a17}{
\index{LCBC.h@{LCBC.h}!LCBC__csr_access_fill@{LCBC\_\-\_\-csr\_\-access\_\-fill}}
\index{LCBC__csr_access_fill@{LCBC\_\-\_\-csr\_\-access\_\-fill}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-\_\-csr\_\-access\_\-fill]{\setlength{\rightskip}{0pt plus 5cm}LCBC\_\-\_\-EXP\_\-FNC \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ LCBC\_\-\_\-csr\_\-access\_\-fill (\hyperlink{struct__LCB__ci__reg}{LCB\_\-ci\_\-csr} $\ast$ {\em ci}, unsigned int {\em value}, unsigned int {\em field\_\-select}, unsigned short int {\em stall})}}
\label{LCBC_8h_a17}


Constructs a LCB CSR register access command. 

\begin{Desc}
\item[Returns:]Pointer to the next command item to be filled\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ci}]The command item to be filled \item[{\em field\_\-select}]A word indicating the bits from {\em value\/} that will be written. For example, if 0, then no bits will be written, if -1, then all bits will be written. \item[{\em value}]The value to be written \item[{\em stall}]The stall time, in units of 20MHz clock ticks\end{description}
\end{Desc}
\hypertarget{LCBC_8h_a13}{
\index{LCBC.h@{LCBC.h}!LCBC__event_fill@{LCBC\_\-\_\-event\_\-fill}}
\index{LCBC__event_fill@{LCBC\_\-\_\-event\_\-fill}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-\_\-event\_\-fill]{\setlength{\rightskip}{0pt plus 5cm}LCBC\_\-\_\-EXP\_\-FNC \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ LCBC\_\-\_\-event\_\-fill (\hyperlink{struct__LCB__ci__event}{LCB\_\-ci\_\-event} $\ast$ {\em ci}, unsigned int {\em latp\_\-adr}, unsigned int {\em proto}, unsigned int {\em len32}, unsigned short int {\em stall})}}
\label{LCBC_8h_a13}


Constructs event transmit command, without a response. 

\begin{Desc}
\item[Returns:]Pointer to the next command item to be filled\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ci}]The event transmit command item to be filled. \item[{\em latp\_\-adr}]The destination LATp address \item[{\em proto}]The protocol \item[{\em len32}]The length of the data to be transformed in 32 bit words. This must be a multiple of 4, since the LCB transfer engine works in units of 16-byte cells. This length must include the LATP packet header word. \item[{\em stall}]The stall period, in units of 20MHz clock ticks\end{description}
\end{Desc}
\begin{Desc}
\item[Usage]The filling an event transmit command is not as easy as the other commands because of the variable length of the data. A trivial example of its usage is given here. This routine does not dictate when the data must be filled (it could be before or after the call to LCBC\_\-\_\-event\_\-fill. This freedom is necessary because in some cases one may not know the length until afterthe data has been moved into the event transmit command item. For example, an on-the-fly compression algorithm. In this example, the call to LCBC\_\-\_\-event\_\-fill could be on either side of the memcpy.\end{Desc}


\footnotesize\begin{verbatim}   #define LATP_ADR 22
   #define PROTO     2
   #define STALL    10
   fill (LCB_ci_event *ci, unsigned int *dst, int len32)
   {

       unsigned short *dst = ci->data;
       memcpy (dst, src, len32 * sizeof (int));


       len32 += 1;                 // Add on the length of the LATP_pckt_hdr
       len32  = (len32 + 3) & ~03; // Round to a multiple of 4 integers
       return LCBC__event_fill (ci, 22, LATP_ADR, PROTO, len32, STALL);
   }
\end{verbatim}
\normalsize
\hypertarget{LCBC_8h_a18}{
\index{LCBC.h@{LCBC.h}!LCBC__faults_access_fill@{LCBC\_\-\_\-faults\_\-access\_\-fill}}
\index{LCBC__faults_access_fill@{LCBC\_\-\_\-faults\_\-access\_\-fill}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-\_\-faults\_\-access\_\-fill]{\setlength{\rightskip}{0pt plus 5cm}LCBC\_\-\_\-EXP\_\-FNC \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ LCBC\_\-\_\-faults\_\-access\_\-fill (\hyperlink{struct__LCB__ci__reg}{LCB\_\-ci\_\-faults} $\ast$ {\em ci}, unsigned int {\em value}, unsigned int {\em field\_\-select}, unsigned short int {\em stall})}}
\label{LCBC_8h_a18}


Constructs a LCB FIFO FAULTS register access command. 

\begin{Desc}
\item[Returns:]Pointer to the next command item to be filled\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ci}]The command item to be filled \item[{\em field\_\-select}]A word indicating the bits from {\em value\/} that will be written. For example, if 0, then no bits will be written, if -1, then all bits will be written. \item[{\em value}]The value to be written \item[{\em stall}]The stall time, in units of 20MHz clock ticks\end{description}
\end{Desc}
\hypertarget{LCBC_8h_a15}{
\index{LCBC.h@{LCBC.h}!LCBC__lat_reset_fill@{LCBC\_\-\_\-lat\_\-reset\_\-fill}}
\index{LCBC__lat_reset_fill@{LCBC\_\-\_\-lat\_\-reset\_\-fill}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-\_\-lat\_\-reset\_\-fill]{\setlength{\rightskip}{0pt plus 5cm}LCBC\_\-\_\-EXP\_\-FNC \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ LCBC\_\-\_\-lat\_\-reset\_\-fill (\hyperlink{struct__LCB__ci__simple}{LCB\_\-ci\_\-lat\_\-reset} $\ast$ {\em ci}, unsigned short int {\em stall})}}
\label{LCBC_8h_a15}


Constructs a {\em LAT\/} reset LCB command. 

\begin{Desc}
\item[Returns:]Pointer to the next command item to be filled\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ci}]The command item to be filled. \item[{\em stall}]The stall time, in units of 20MHz clock ticks\end{description}
\end{Desc}
\hypertarget{LCBC_8h_a12}{
\index{LCBC.h@{LCBC.h}!LCBC__mark_time_fill@{LCBC\_\-\_\-mark\_\-time\_\-fill}}
\index{LCBC__mark_time_fill@{LCBC\_\-\_\-mark\_\-time\_\-fill}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-\_\-mark\_\-time\_\-fill]{\setlength{\rightskip}{0pt plus 5cm}LCBC\_\-\_\-EXP\_\-FNC \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ LCBC\_\-\_\-mark\_\-time\_\-fill (\hyperlink{struct__LCB__ci__simple}{LCB\_\-ci\_\-mark\_\-time} $\ast$ {\em ci}, unsigned short int {\em stall})}}
\label{LCBC_8h_a12}


Constructs a {\em mark\/} time LCB command. 

\begin{Desc}
\item[Returns:]Pointer to the next command item to be filled\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ci}]The command item to be filled. \item[{\em stall}]The stall time, in units of 20MHz clock ticks\end{description}
\end{Desc}
\hypertarget{LCBC_8h_a11}{
\index{LCBC.h@{LCBC.h}!LCBC__next@{LCBC\_\-\_\-next}}
\index{LCBC__next@{LCBC\_\-\_\-next}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-\_\-next]{\setlength{\rightskip}{0pt plus 5cm}LCBC\_\-\_\-EXP\_\-FNC const \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ LCBC\_\-\_\-next (const \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ {\em ci})}}
\label{LCBC_8h_a11}


Advances the pointer {\em ci\/} to the next command item. 

\begin{Desc}
\item[Returns:]A pointer to the next command item\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ci}]The command item\end{description}
\end{Desc}
\hypertarget{LCBC_8h_a19}{
\index{LCBC.h@{LCBC.h}!LCBC__rxstats_access_fill@{LCBC\_\-\_\-rxstats\_\-access\_\-fill}}
\index{LCBC__rxstats_access_fill@{LCBC\_\-\_\-rxstats\_\-access\_\-fill}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-\_\-rxstats\_\-access\_\-fill]{\setlength{\rightskip}{0pt plus 5cm}LCBC\_\-\_\-EXP\_\-FNC \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ LCBC\_\-\_\-rxstats\_\-access\_\-fill (\hyperlink{struct__LCB__ci__reg}{LCB\_\-ci\_\-rxstats} $\ast$ {\em ci}, unsigned int {\em value}, unsigned int {\em field\_\-select}, unsigned short int {\em stall})}}
\label{LCBC_8h_a19}


Constructs a LCB Receive Statistics/Status register access command. 

\begin{Desc}
\item[Returns:]Pointer to the next command item to be filled\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ci}]The command item to be filled \item[{\em field\_\-select}]A word indicating the bits from {\em value\/} that will be written. For example, if 0, then no bits will be written, if -1, then all bits will be written. \item[{\em value}]The value to be written \item[{\em stall}]The stall time, in units of 20MHz clock ticks\end{description}
\end{Desc}
\hypertarget{LCBC_8h_a28}{
\index{LCBC.h@{LCBC.h}!LCBC_cmd_xmit@{LCBC\_\-cmd\_\-xmit}}
\index{LCBC_cmd_xmit@{LCBC\_\-cmd\_\-xmit}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-cmd\_\-xmit]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBC\_\-cmd\_\-xmit (LCBD {\em lcb}, const \hyperlink{struct__LCB__ci__cmd__payload}{LCB\_\-ci\_\-cmd\_\-payload} $\ast$ {\em payload}, unsigned short int {\em stall})}}
\label{LCBC_8h_a28}


Utility routine to compose and submit a command with no response command (department of redundancy department?). 

\begin{Desc}
\item[Returns:]Status\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lcb}]The LCB driver handle \item[{\em payload}]The payload of the command access command. The format of this beast is dependent on the target (PDU, TEM, GTFE) and is non-trivial. However, this routine does not concern itself with the formatting, deferring that as {\em someone else's problem\/}. \item[{\em stall}]The stall time, in units of 20Mhz clock ticks\end{description}
\end{Desc}
\hypertarget{LCBC_8h_a31}{
\index{LCBC.h@{LCBC.h}!LCBC_cmdr_xmit@{LCBC\_\-cmdr\_\-xmit}}
\index{LCBC_cmdr_xmit@{LCBC\_\-cmdr\_\-xmit}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-cmdr\_\-xmit]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBC\_\-cmdr\_\-xmit (LCBD {\em lcb}, const \hyperlink{struct__LCB__ci__cmd__payload}{LCB\_\-ci\_\-cmd\_\-payload} $\ast$ {\em ci\_\-payload}, unsigned short int {\em timeout}, \hyperlink{struct__LCB__ri__cmd__payload}{LCB\_\-ri\_\-cmd\_\-payload} $\ast$ {\em ri\_\-payload})}}
\label{LCBC_8h_a31}


Utility routine to compose and submit a command with response command (department of redundancy department?). 

\begin{Desc}
\item[Returns:]Status\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lcb}]The LCB driver handle \item[{\em ci\_\-payload}]The payload of the command access command. The format of this beast is dependent on the target (PDU, TEM, GTFE) and is non-trivial. However, this routine does not concern itself with the formatting, deferring that as {\em someone else's problem\/}. \item[{\em timeout}]The LCB timeout period, in units of 20MHz clock ticks to wait for a response to be returned. \item[{\em ri\_\-payload}]The resulting (returned) payload. As is in the case of the command item payload, {\em ci\_\-payload\/}, the format of this payload is highly dependent on the target. However, this routine merely returns the payload results to the user, again adopting the philosopy of {\em not my problem\/},\end{description}
\end{Desc}
\hypertarget{LCBC_8h_a32}{
\index{LCBC.h@{LCBC.h}!LCBC_csr_access@{LCBC\_\-csr\_\-access}}
\index{LCBC_csr_access@{LCBC\_\-csr\_\-access}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-csr\_\-access]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBC\_\-csr\_\-access (LCBD {\em lcb}, unsigned int {\em value}, unsigned int {\em field\_\-select}, unsigned short int {\em stall}, unsigned int $\ast$ {\em old\_\-val}, unsigned int $\ast$ {\em cur\_\-val})}}
\label{LCBC_8h_a32}


Utility routine to compose and execute an access command to LCB's CSR register. 

\begin{Desc}
\item[Returns:]Status\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lcb}]The LCB driver handle \item[{\em value}]The value to write. Only bits matching those in the {\em field\_\-select\/} parameter will actually be written. \item[{\em field\_\-select}]Pattern of those bits in {\em value\/} to write \item[{\em stall}]The stall time, in units of 20MHz clock ticks, for the LCB to wait for completion. \item[{\em old\_\-val}]Pointer to receive the value of the register before modification. This may be NULL. \item[{\em cur\_\-val}]Pointer to receive the value of the register after modification. This may be NULL.\end{description}
\end{Desc}
\hypertarget{LCBC_8h_a23}{
\index{LCBC.h@{LCBC.h}!LCBC_csr_access_fill@{LCBC\_\-csr\_\-access\_\-fill}}
\index{LCBC_csr_access_fill@{LCBC\_\-csr\_\-access\_\-fill}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-csr\_\-access\_\-fill]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{union__LCB__ci}{LCB\_\-ci}$\ast$ LCBC\_\-csr\_\-access\_\-fill (\hyperlink{struct__LCB__ci__reg}{LCB\_\-ci\_\-csr} $\ast$ {\em ci}, unsigned int {\em value}, unsigned int {\em field\_\-select}, unsigned short int {\em stall})}}
\label{LCBC_8h_a23}


Constructs a LCB CSR register access command. 

\begin{Desc}
\item[Returns:]Pointer to the next command item to be filled\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ci}]The command item to be filled \item[{\em field\_\-select}]A word indicating the bits from {\em value\/} that will be written. For example, if 0, then no bits will be written, if -1, then all bits will be written. \item[{\em value}]The value to be written \item[{\em stall}]The stall time, in units of 20MHz clock ticks\end{description}
\end{Desc}
\hypertarget{LCBC_8h_a21}{
\index{LCBC.h@{LCBC.h}!LCBC_event_fill@{LCBC\_\-event\_\-fill}}
\index{LCBC_event_fill@{LCBC\_\-event\_\-fill}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-event\_\-fill]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ LCBC\_\-event\_\-fill (\hyperlink{struct__LCB__ci__event}{LCB\_\-ci\_\-event} $\ast$ {\em ci}, unsigned int {\em latp\_\-adr}, unsigned int {\em proto}, unsigned int {\em len32}, unsigned short int {\em stall})}}
\label{LCBC_8h_a21}


Constructs event transmit command. 

\begin{Desc}
\item[Returns:]Pointer to the next command item to be filled\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ci}]The event transmit command item to be filled. \item[{\em latp\_\-adr}]The destination LATp address \item[{\em proto}]The protocol \item[{\em len32}]The length of the data to be transformed in 32 bit words. This must be a multiple of 4, since the LCB transfer engine works in units of 16-byte cells \item[{\em stall}]The stall period, in units of 20MHz clock ticks\end{description}
\end{Desc}
\begin{Desc}
\item[Usage]The filling an event transmit command is not as easy as the other commands because of the variable length of the data. A trivial example of its usage is given here. Note that there is no reason to move the data in before or after the LCBC\_\-\_\-event\_\-fill routine is called. In many cases, one may not know the length until after the data has been moved into the event transmit command item. For example, an on-the-fly compression algorithm. In this example, the call to LCBC\_\-\_\-event\_\-fill could be on either side of the memcpy.\end{Desc}


\footnotesize\begin{verbatim}   #define LATP_ADR 22
   #define PROTO     2
   #define STALL    10
   fill (LCB_ci_event *ci, unsigned int *dst, int len32)
   {

       unsigned short *dst = ci->data;
       memcpy (dst, src, len32 * sizeof (int));

       return LCBC_event_fill (ci, 22, LATP_ADR, PROTO, len32, STALL);
   }
\end{verbatim}
\normalsize
\hypertarget{LCBC_8h_a33}{
\index{LCBC.h@{LCBC.h}!LCBC_faults_access@{LCBC\_\-faults\_\-access}}
\index{LCBC_faults_access@{LCBC\_\-faults\_\-access}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-faults\_\-access]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBC\_\-faults\_\-access (LCBD {\em lcb}, unsigned int {\em value}, unsigned int {\em field\_\-select}, unsigned short int {\em stall}, unsigned int $\ast$ {\em old\_\-val}, unsigned int $\ast$ {\em cur\_\-val})}}
\label{LCBC_8h_a33}


Utility routine to compose and execute an access command to LCB's FIFO FAULTS register. 

\begin{Desc}
\item[Returns:]Status\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lcb}]The LCB driver handle \item[{\em value}]The value to write. Only bits matching those in the {\em field\_\-select\/} parameter will actually be written. \item[{\em field\_\-select}]Pattern of those bits in {\em value\/} to write \item[{\em stall}]The stall time, in units of 20MHz clock ticks, for the LCB to wait for completion. \item[{\em old\_\-val}]Pointer to receive the value of the register before modification. This may be NULL. \item[{\em cur\_\-val}]Pointer to receive the value of the register after modification. This may be NULL.\end{description}
\end{Desc}
\hypertarget{LCBC_8h_a24}{
\index{LCBC.h@{LCBC.h}!LCBC_faults_access_fill@{LCBC\_\-faults\_\-access\_\-fill}}
\index{LCBC_faults_access_fill@{LCBC\_\-faults\_\-access\_\-fill}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-faults\_\-access\_\-fill]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{union__LCB__ci}{LCB\_\-ci}$\ast$ LCBC\_\-faults\_\-access\_\-fill (\hyperlink{struct__LCB__ci__reg}{LCB\_\-ci\_\-faults} $\ast$ {\em ci}, unsigned int {\em value}, unsigned int {\em field\_\-select}, unsigned short int {\em stall})}}
\label{LCBC_8h_a24}


Constructs a LCB FIFO FAULTS register access command. 

\begin{Desc}
\item[Returns:]Pointer to the next command item to be filled\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ci}]The command item to be filled \item[{\em field\_\-select}]A word indicating the bits from {\em value\/} that will be written. For example, if 0, then no bits will be written, if -1, then all bits will be written. \item[{\em value}]The value to be written \item[{\em stall}]The stall time in units of 20MHz clock ticks\end{description}
\end{Desc}
\hypertarget{LCBC_8h_a30}{
\index{LCBC.h@{LCBC.h}!LCBC_lat_reset@{LCBC\_\-lat\_\-reset}}
\index{LCBC_lat_reset@{LCBC\_\-lat\_\-reset}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-lat\_\-reset]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBC\_\-lat\_\-reset (LCBD {\em lcb}, unsigned short int {\em stall})}}
\label{LCBC_8h_a30}


Utility routine to compose and execute an LCB LAT reset command. 

\begin{Desc}
\item[Returns:]Status\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lcb}]The LCB driver handle \item[{\em stall}]The stall time, in units of 20Mhz clock ticks\end{description}
\end{Desc}
\begin{Desc}
\item[]To be used only with great discretion; {\em i.e\/}. in case of emergency break glass.\end{Desc}
\hypertarget{LCBC_8h_a22}{
\index{LCBC.h@{LCBC.h}!LCBC_lat_reset_fill@{LCBC\_\-lat\_\-reset\_\-fill}}
\index{LCBC_lat_reset_fill@{LCBC\_\-lat\_\-reset\_\-fill}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-lat\_\-reset\_\-fill]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{union__LCB__ci}{LCB\_\-ci}$\ast$ LCBC\_\-lat\_\-reset\_\-fill (\hyperlink{struct__LCB__ci__simple}{LCB\_\-ci\_\-lat\_\-reset} $\ast$ {\em ci}, unsigned short int {\em stall})}}
\label{LCBC_8h_a22}


Constructs a {\em LAT\/} reset LCB command. 

\begin{Desc}
\item[Returns:]Pointer to the next command item to be filled\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ci}]The command item to be filled. \item[{\em stall}]The stall time, in units of 20MHz clock ticks\end{description}
\end{Desc}
\hypertarget{LCBC_8h_a29}{
\index{LCBC.h@{LCBC.h}!LCBC_mark_time@{LCBC\_\-mark\_\-time}}
\index{LCBC_mark_time@{LCBC\_\-mark\_\-time}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-mark\_\-time]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBC\_\-mark\_\-time (LCBD {\em lcb}, unsigned short int {\em stall})}}
\label{LCBC_8h_a29}


Utility routine to compose and execute an LCB mark time command. 

\begin{Desc}
\item[Returns:]Status\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lcb}]The LCB driver handle \item[{\em stall}]The stall time, in units of 20Mhz clock ticks\end{description}
\end{Desc}
\begin{Desc}
\item[]The utility of a bare {\em mark\/} {\em time\/} command, outside the context of command list, is dubious, but is provided for completeness. With a minimal stall time, one could use effectively as a NOP.\end{Desc}
\hypertarget{LCBC_8h_a20}{
\index{LCBC.h@{LCBC.h}!LCBC_mark_time_fill@{LCBC\_\-mark\_\-time\_\-fill}}
\index{LCBC_mark_time_fill@{LCBC\_\-mark\_\-time\_\-fill}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-mark\_\-time\_\-fill]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{union__LCB__ci}{LCB\_\-ci}$\ast$ LCBC\_\-mark\_\-time\_\-fill (\hyperlink{struct__LCB__ci__simple}{LCB\_\-ci\_\-mark\_\-time} $\ast$ {\em ci}, unsigned short int {\em stall})}}
\label{LCBC_8h_a20}


Constructs a {\em mark\/} time LCB command. 

\begin{Desc}
\item[Returns:]Pointer to the next command item to be filled\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ci}]The command item to be filled. \item[{\em stall}]The stall time, in units of 20MHz clock ticks\end{description}
\end{Desc}
\hypertarget{LCBC_8h_a26}{
\index{LCBC.h@{LCBC.h}!LCBC_process@{LCBC\_\-process}}
\index{LCBC_process@{LCBC\_\-process}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-process]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBC\_\-process (const \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ {\em ci}, const \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ {\em end}, \hyperlink{LCBC_8h_a4}{LCBC\_\-processor} {\em rtn}, void $\ast$ {\em prm})}}
\label{LCBC_8h_a26}


Executes the user specified handler for each command item in the range {\em ci\/} to {\em end\/}. 

\begin{Desc}
\item[Returns:]The status of the last processing call\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ci}]The first command item to process \item[{\em end}]One past the last command item to process \item[{\em rtn}]User provided callback routine to process one item \item[{\em prm}]User provided parameter passed to {\em rtn\/} \end{description}
\end{Desc}
\hypertarget{LCBC_8h_a34}{
\index{LCBC.h@{LCBC.h}!LCBC_rxstats_access@{LCBC\_\-rxstats\_\-access}}
\index{LCBC_rxstats_access@{LCBC\_\-rxstats\_\-access}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-rxstats\_\-access]{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBC\_\-rxstats\_\-access (LCBD {\em lcb}, unsigned int {\em value}, unsigned int {\em field\_\-select}, unsigned short int {\em stall}, unsigned int $\ast$ {\em old\_\-val}, unsigned int $\ast$ {\em cur\_\-val})}}
\label{LCBC_8h_a34}


Utility routine to compose and execute an access command to LCB's RECEIVE STATISTICS/STATS register. 

\begin{Desc}
\item[Returns:]Status\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lcb}]The LCB driver handle \item[{\em value}]The value to write. Only bits matching those in the {\em field\_\-select\/} parameter will actually be written. \item[{\em field\_\-select}]Pattern of those bits in {\em value\/} to write \item[{\em stall}]The stall time, in units of 20MHz clock ticks, for the LCB to wait for completion. \item[{\em old\_\-val}]Pointer to receive the value of the register before modification. This may be NULL. \item[{\em cur\_\-val}]Pointer to receive the value of the register after modification. This may be NULL.\end{description}
\end{Desc}
\hypertarget{LCBC_8h_a25}{
\index{LCBC.h@{LCBC.h}!LCBC_rxstats_access_fill@{LCBC\_\-rxstats\_\-access\_\-fill}}
\index{LCBC_rxstats_access_fill@{LCBC\_\-rxstats\_\-access\_\-fill}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-rxstats\_\-access\_\-fill]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{union__LCB__ci}{LCB\_\-ci}$\ast$ LCBC\_\-rxstats\_\-access\_\-fill (\hyperlink{struct__LCB__ci__reg}{LCB\_\-ci\_\-rxstats} $\ast$ {\em ci}, unsigned int {\em value}, unsigned int {\em field\_\-select}, unsigned short int {\em stall})}}
\label{LCBC_8h_a25}


Constructs a LCB RECEIVE STATISTICS/STATUS register access command. 

\begin{Desc}
\item[Returns:]Pointer to the next command item to be filled\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ci}]The command item to be filled \item[{\em field\_\-select}]A word indicating the bits from {\em value\/} that will be written. For example, if 0, then no bits will be written, if -1, then all bits will be written. \item[{\em value}]The value to be written \item[{\em stall}]The stall time, in units of 20MHz clock ticks\end{description}
\end{Desc}
\hypertarget{LCBC_8h_a27}{
\index{LCBC.h@{LCBC.h}!LCBC_show@{LCBC\_\-show}}
\index{LCBC_show@{LCBC\_\-show}!LCBC.h@{LCBC.h}}
\subsubsection[LCBC\_\-show]{\setlength{\rightskip}{0pt plus 5cm}void LCBC\_\-show (unsigned int {\em options}, const \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ {\em beg}, const \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ {\em end})}}
\label{LCBC_8h_a27}


Dumps the result items to stdout. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em options}]Show options \item[{\em beg}]Pointer to the first result descriptor to show \item[{\em end}]Pointer to one past the lst result descriptor to show \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]void\end{Desc}
