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


{\tt \#include $<$LCBD/LCB\_\-cr.h$>$}\par
{\tt \#include $<$LCBD/LCBD\_\-cr.h$>$}\par
{\tt \#include $<$PBI/Attribute.h$>$}\par
{\tt \#include $<$PBI/Inline.h$>$}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define \hyperlink{LCBC_8h_f3220a3bc6c049c128ed5794f1b58cc5}{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_4588c05b2c5e0718e7eb003a26a802c2}{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_4694ec607ca844589742f473ae636c16}{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_7e0ace5b5558df935d7e6c8f04723b62}{
typedef enum \hyperlink{LCBC_8h_035efbb61caed515b3964429e00a3552}{\_\-LCBC\_\-TYPE} \hyperlink{LCBC_8h_7e0ace5b5558df935d7e6c8f04723b62}{LCBC\_\-TYPE}}
\label{LCBC_8h_7e0ace5b5558df935d7e6c8f04723b62}

\begin{CompactList}\small\item\em Typedef for enum \_\-LCBC\_\-TYPE. \item\end{CompactList}\item 
typedef unsigned int \hyperlink{LCBC_8h_9215bde1477371653955a4e6b185706a}{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_035efbb61caed515b3964429e00a3552}{\_\-LCBC\_\-TYPE} \{ \par
\hyperlink{LCBC_8h_035efbb61caed515b3964429e00a355206d4826a9b0c1c9658e68013483144d6}{LCBC\_\-TYPE\_\-UNDEFINED} =  0, 
\par
\hyperlink{LCBC_8h_035efbb61caed515b3964429e00a3552716b504ce39065c2844628680f833eaf}{LCBC\_\-TYPE\_\-SIMPLE} =  1, 
\par
\hyperlink{LCBC_8h_035efbb61caed515b3964429e00a35520902540d8164f3340a2cd53c5485fb2b}{LCBC\_\-TYPE\_\-REGISTER} =  2, 
\par
\hyperlink{LCBC_8h_035efbb61caed515b3964429e00a3552343a1147e6515976662341683b4de8d7}{LCBC\_\-TYPE\_\-COMMAND} =  3, 
\par
\hyperlink{LCBC_8h_035efbb61caed515b3964429e00a3552da85b099b2d401d2e91d5996fc6668fe}{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_a8b04570236c1eccc7a409c14a005fbc}{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_4578d00c9e7d7a4025ac68a59867d56f}{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_60790d4e49af08627b8e7b6923e8b9d0}{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_780ae4e530ed696d107bbf2f5142ad10}{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_544302cdc1988a3f278229a0625cfc2a}{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_fc933926749589ca672bf87d0bab9453}{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_0cea906097f5c4723cccd3eaed0a0bf4}{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_a159639af224de4a8ee59ca322bc4997}{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_11709af9d2e139dea734dd670a270fa1}{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_1a2d8afeb1195fb7a9450290cf0f6522}{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_6137c799cdfe0026c3281bfd3adb1151}{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_bfe481af7624fbab0bb29545a61939ba}{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_1197946ca13d186f2a8979030f4dc0df}{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_e033a01143b30a39a59d7b656c29e0e0}{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_a424953e74e1b5fa792b74b0671c3543}{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_9749e3b601e7a27b6e85e1240ae0349d}{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_3c66ca243001e425ede57ad59291b21b}{LCBC\_\-process} (const \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ci, const \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$end, \hyperlink{LCBC_8h_9215bde1477371653955a4e6b185706a}{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_447fd073cae5c7da2991522fbe9a71e2}{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_a704be79bb1a26274afad6913ed177b0}{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_4d554def122f3124e95e937af878b7fc}{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_77e9ca256b3b39efdc4f709597777fdb}{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_7884b766c7567245e382832de1ff1748}{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_aac498e7073290eb1d41f7839cfed172}{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_96383bdcc4e763e7d95dd45f419702c1}{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_078c176250912bf35db615ca07b60938}{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} 

\footnotesize\begin{verbatim}
  CVS $Id
\end{verbatim}
\normalsize
\end{Desc}
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_f3220a3bc6c049c128ed5794f1b58cc5}{
\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_f3220a3bc6c049c128ed5794f1b58cc5}


\textbf{Value:}

\begin{Code}\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}
\end{Code}
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.



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



There are 16 opcodes, that map to 5 descriptor types



\begin{Code}\begin{verbatim}   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_CMDR        = 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_OPCODE_F           = LCBC_TYPE_UNDEFINED
\end{verbatim}
\end{Code}

 \hypertarget{LCBC_8h_4694ec607ca844589742f473ae636c16}{
\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_4694ec607ca844589742f473ae636c16}


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}


Referenced by show().\hypertarget{LCBC_8h_4588c05b2c5e0718e7eb003a26a802c2}{
\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_4588c05b2c5e0718e7eb003a26a802c2}


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 PowerPC) 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_9215bde1477371653955a4e6b185706a}{
\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 {\bf LCBC\_\-processor}}}
\label{LCBC_8h_9215bde1477371653955a4e6b185706a}


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_035efbb61caed515b3964429e00a3552}{
\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 {\bf \_\-LCBC\_\-TYPE}}}
\label{LCBC_8h_035efbb61caed515b3964429e00a3552}


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_035efbb61caed515b3964429e00a355206d4826a9b0c1c9658e68013483144d6}{
LCBC\_\-TYPE\_\-UNDEFINED}
\label{LCBC_8h_035efbb61caed515b3964429e00a355206d4826a9b0c1c9658e68013483144d6}
}]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_035efbb61caed515b3964429e00a3552716b504ce39065c2844628680f833eaf}{
LCBC\_\-TYPE\_\-SIMPLE}
\label{LCBC_8h_035efbb61caed515b3964429e00a3552716b504ce39065c2844628680f833eaf}
}]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_035efbb61caed515b3964429e00a35520902540d8164f3340a2cd53c5485fb2b}{
LCBC\_\-TYPE\_\-REGISTER}
\label{LCBC_8h_035efbb61caed515b3964429e00a35520902540d8164f3340a2cd53c5485fb2b}
}]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_035efbb61caed515b3964429e00a3552343a1147e6515976662341683b4de8d7}{
LCBC\_\-TYPE\_\-COMMAND}
\label{LCBC_8h_035efbb61caed515b3964429e00a3552343a1147e6515976662341683b4de8d7}
}]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_035efbb61caed515b3964429e00a3552da85b099b2d401d2e91d5996fc6668fe}{
LCBC\_\-TYPE\_\-EVENT}
\label{LCBC_8h_035efbb61caed515b3964429e00a3552da85b099b2d401d2e91d5996fc6668fe}
}]Type is a transmit event \end{description}
\end{Desc}



\subsection{Function Documentation}
\hypertarget{LCBC_8h_a8b04570236c1eccc7a409c14a005fbc}{
\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 {\bf LCB\_\-ci} $\ast$ {\em ci}, \/  int {\em nbytes})}}
\label{LCBC_8h_a8b04570236c1eccc7a409c14a005fbc}


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_544302cdc1988a3f278229a0625cfc2a}{
\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 {\bf LCB\_\-ci} $\ast$ LCBC\_\-\_\-cmd\_\-xmit\_\-fill ({\bf LCB\_\-ci\_\-cmd} $\ast$ {\em ci}, \/  const {\bf LCB\_\-ci\_\-cmd\_\-payload} $\ast$ {\em payload}, \/  unsigned short int {\em stall})}}
\label{LCBC_8h_544302cdc1988a3f278229a0625cfc2a}


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}


References \_\-LCB\_\-ci\_\-cmd::header, LCB\_\-CI\_\-HDR\_\-CMD, \_\-LCB\_\-ci\_\-cmd::payload, and \_\-LCB\_\-ci\_\-cmd::stall.\hypertarget{LCBC_8h_0cea906097f5c4723cccd3eaed0a0bf4}{
\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 {\bf LCB\_\-ci} $\ast$ LCBC\_\-\_\-cmdr\_\-xmit\_\-fill ({\bf LCB\_\-ci\_\-cmdr} $\ast$ {\em ci}, \/  const {\bf LCB\_\-ci\_\-cmd\_\-payload} $\ast$ {\em payload}, \/  unsigned short int {\em timeout})}}
\label{LCBC_8h_0cea906097f5c4723cccd3eaed0a0bf4}


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}


References \_\-LCB\_\-ci\_\-cmdr::header, LCB\_\-CI\_\-HDR\_\-CMDR, \_\-LCB\_\-ci\_\-cmdr::payload, and \_\-LCB\_\-ci\_\-cmdr::timeout.\hypertarget{LCBC_8h_a159639af224de4a8ee59ca322bc4997}{
\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 {\bf LCB\_\-ci} $\ast$ LCBC\_\-\_\-csr\_\-access\_\-fill ({\bf LCB\_\-ci\_\-csr} $\ast$ {\em ci}, \/  unsigned int {\em field\_\-select}, \/  unsigned int {\em value}, \/  unsigned short int {\em stall})}}
\label{LCBC_8h_a159639af224de4a8ee59ca322bc4997}


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}


References \_\-LCB\_\-ci\_\-reg::field\_\-select, \_\-LCB\_\-ci\_\-reg::header, LCB\_\-CI\_\-HDR\_\-CSR, \_\-LCB\_\-ci\_\-reg::stall, and \_\-LCB\_\-ci\_\-reg::value.\hypertarget{LCBC_8h_780ae4e530ed696d107bbf2f5142ad10}{
\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 {\bf LCB\_\-ci} $\ast$ LCBC\_\-\_\-event\_\-fill ({\bf 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_780ae4e530ed696d107bbf2f5142ad10}


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}


\begin{Code}\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}
\end{Code}

 

References \_\-LATP\_\-pckt\_\-hdr::bf, \_\-LATP\_\-cell\_\-hdr\_\-bf::dst, \_\-LATP\_\-pckt\_\-hdr\_\-bf::hdr, \_\-LCB\_\-ci\_\-event::header, \_\-LCB\_\-ci\_\-event::latp, LCB\_\-CI\_\-HDR, LCB\_\-OPCODE\_\-EVENT, \_\-LATP\_\-cell\_\-hdr\_\-bf::proto, and \_\-LATP\_\-pckt\_\-hdr::ui.\hypertarget{LCBC_8h_11709af9d2e139dea734dd670a270fa1}{
\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 {\bf LCB\_\-ci} $\ast$ LCBC\_\-\_\-faults\_\-access\_\-fill ({\bf LCB\_\-ci\_\-faults} $\ast$ {\em ci}, \/  unsigned int {\em field\_\-select}, \/  unsigned int {\em value}, \/  unsigned short int {\em stall})}}
\label{LCBC_8h_11709af9d2e139dea734dd670a270fa1}


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}


References \_\-LCB\_\-ci\_\-reg::field\_\-select, \_\-LCB\_\-ci\_\-reg::header, LCB\_\-CI\_\-HDR\_\-FAULTS, \_\-LCB\_\-ci\_\-reg::stall, and \_\-LCB\_\-ci\_\-reg::value.\hypertarget{LCBC_8h_fc933926749589ca672bf87d0bab9453}{
\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 {\bf LCB\_\-ci} $\ast$ LCBC\_\-\_\-lat\_\-reset\_\-fill ({\bf LCB\_\-ci\_\-lat\_\-reset} $\ast$ {\em ci}, \/  unsigned short int {\em stall})}}
\label{LCBC_8h_fc933926749589ca672bf87d0bab9453}


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}


References \_\-LCB\_\-ci\_\-simple::header, LCB\_\-CI\_\-HDR\_\-LAT\_\-RESET, and \_\-LCB\_\-ci\_\-simple::stall.\hypertarget{LCBC_8h_60790d4e49af08627b8e7b6923e8b9d0}{
\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 {\bf LCB\_\-ci} $\ast$ LCBC\_\-\_\-mark\_\-time\_\-fill ({\bf LCB\_\-ci\_\-mark\_\-time} $\ast$ {\em ci}, \/  unsigned short int {\em stall})}}
\label{LCBC_8h_60790d4e49af08627b8e7b6923e8b9d0}


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}


References \_\-LCB\_\-ci\_\-simple::header, LCB\_\-CI\_\-HDR\_\-MARK\_\-TIME, and \_\-LCB\_\-ci\_\-simple::stall.\hypertarget{LCBC_8h_4578d00c9e7d7a4025ac68a59867d56f}{
\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 {\bf LCB\_\-ci} $\ast$ LCBC\_\-\_\-next (const {\bf LCB\_\-ci} $\ast$ {\em ci})}}
\label{LCBC_8h_4578d00c9e7d7a4025ac68a59867d56f}


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}


References \_\-LCB\_\-ci::hdr, and \_\-LCB\_\-ci\_\-hdr\_\-bf::len.

Referenced by LCBC\_\-process().\hypertarget{LCBC_8h_1a2d8afeb1195fb7a9450290cf0f6522}{
\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 {\bf LCB\_\-ci} $\ast$ LCBC\_\-\_\-rxstats\_\-access\_\-fill ({\bf LCB\_\-ci\_\-rxstats} $\ast$ {\em ci}, \/  unsigned int {\em field\_\-select}, \/  unsigned int {\em value}, \/  unsigned short int {\em stall})}}
\label{LCBC_8h_1a2d8afeb1195fb7a9450290cf0f6522}


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}


References \_\-LCB\_\-ci\_\-reg::field\_\-select, \_\-LCB\_\-ci\_\-reg::header, LCB\_\-CI\_\-HDR\_\-RXSTATS, \_\-LCB\_\-ci\_\-reg::stall, and \_\-LCB\_\-ci\_\-reg::value.\hypertarget{LCBC_8h_a704be79bb1a26274afad6913ed177b0}{
\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 {\bf LCB\_\-ci\_\-cmd\_\-payload} $\ast$ {\em payload}, \/  unsigned short int {\em stall})}}
\label{LCBC_8h_a704be79bb1a26274afad6913ed177b0}


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}


References \_\-LCB\_\-ci\_\-cmd::header, \_\-LCB\_\-rl::item, \_\-LCB\_\-cl\_\-cmd::item, LCB\_\-CI\_\-HDR\_\-CMD, LCBD\_\-OK, LCBD\_\-qioW(), LCBD\_\-rst\_\-rcv\_\-err\_\-map(), \_\-LCB\_\-ci\_\-cmd::payload, \_\-LCBD\_\-rl::rl, and \_\-LCB\_\-ci\_\-cmd::stall.\hypertarget{LCBC_8h_7884b766c7567245e382832de1ff1748}{
\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 {\bf LCB\_\-ci\_\-cmd\_\-payload} $\ast$ {\em ci\_\-payload}, \/  unsigned short int {\em timeout}, \/  {\bf LCB\_\-ri\_\-cmd\_\-payload} $\ast$ {\em ri\_\-payload})}}
\label{LCBC_8h_7884b766c7567245e382832de1ff1748}


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}


References \_\-LCB\_\-ci\_\-cmdr::header, \_\-LCB\_\-rl::item, \_\-LCB\_\-cl\_\-cmdr::item, LCB\_\-CI\_\-HDR\_\-CMDR, LCBD\_\-qioW(), LCBD\_\-rst\_\-rcv\_\-err\_\-map(), \_\-LCB\_\-ci\_\-cmdr::payload, \_\-LCBD\_\-rl::rl, and \_\-LCB\_\-ci\_\-cmdr::timeout.\hypertarget{LCBC_8h_aac498e7073290eb1d41f7839cfed172}{
\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_aac498e7073290eb1d41f7839cfed172}


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}


References LCB\_\-CI\_\-HDR\_\-CSR.

Referenced by lcbd\_\-csr\_\-access().\hypertarget{LCBC_8h_e033a01143b30a39a59d7b656c29e0e0}{
\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}{\bf LCB\_\-ci}$\ast$ LCBC\_\-csr\_\-access\_\-fill ({\bf LCB\_\-ci\_\-csr} $\ast$ {\em ci}, \/  unsigned int {\em value}, \/  unsigned int {\em field\_\-select}, \/  unsigned short int {\em stall})}}
\label{LCBC_8h_e033a01143b30a39a59d7b656c29e0e0}


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}


References fill\_\-reg(), and LCB\_\-CI\_\-HDR\_\-CSR.\hypertarget{LCBC_8h_bfe481af7624fbab0bb29545a61939ba}{
\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}{\bf LCB\_\-ci} $\ast$ LCBC\_\-event\_\-fill ({\bf 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_bfe481af7624fbab0bb29545a61939ba}


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}


\begin{Code}\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}
\end{Code}

 \hypertarget{LCBC_8h_96383bdcc4e763e7d95dd45f419702c1}{
\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_96383bdcc4e763e7d95dd45f419702c1}


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}


References LCB\_\-CI\_\-HDR\_\-FAULTS.

Referenced by lcbd\_\-faults\_\-access().\hypertarget{LCBC_8h_a424953e74e1b5fa792b74b0671c3543}{
\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}{\bf LCB\_\-ci}$\ast$ LCBC\_\-faults\_\-access\_\-fill ({\bf LCB\_\-ci\_\-faults} $\ast$ {\em ci}, \/  unsigned int {\em value}, \/  unsigned int {\em field\_\-select}, \/  unsigned short int {\em stall})}}
\label{LCBC_8h_a424953e74e1b5fa792b74b0671c3543}


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}


References fill\_\-reg(), and LCB\_\-CI\_\-HDR\_\-FAULTS.\hypertarget{LCBC_8h_77e9ca256b3b39efdc4f709597777fdb}{
\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_77e9ca256b3b39efdc4f709597777fdb}


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}


References LCB\_\-CI\_\-HDR\_\-LAT\_\-RESET.\hypertarget{LCBC_8h_1197946ca13d186f2a8979030f4dc0df}{
\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}{\bf LCB\_\-ci}$\ast$ LCBC\_\-lat\_\-reset\_\-fill ({\bf LCB\_\-ci\_\-lat\_\-reset} $\ast$ {\em ci}, \/  unsigned short int {\em stall})}}
\label{LCBC_8h_1197946ca13d186f2a8979030f4dc0df}


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}


References fill\_\-simple(), and LCB\_\-CI\_\-HDR\_\-LAT\_\-RESET.\hypertarget{LCBC_8h_4d554def122f3124e95e937af878b7fc}{
\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_4d554def122f3124e95e937af878b7fc}


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}


References LCB\_\-CI\_\-HDR\_\-MARK\_\-TIME.\hypertarget{LCBC_8h_6137c799cdfe0026c3281bfd3adb1151}{
\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}{\bf LCB\_\-ci}$\ast$ LCBC\_\-mark\_\-time\_\-fill ({\bf LCB\_\-ci\_\-mark\_\-time} $\ast$ {\em ci}, \/  unsigned short int {\em stall})}}
\label{LCBC_8h_6137c799cdfe0026c3281bfd3adb1151}


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}


References fill\_\-simple(), and LCB\_\-CI\_\-HDR\_\-MARK\_\-TIME.\hypertarget{LCBC_8h_3c66ca243001e425ede57ad59291b21b}{
\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 {\bf LCB\_\-ci} $\ast$ {\em ci}, \/  const {\bf LCB\_\-ci} $\ast$ {\em end}, \/  {\bf LCBC\_\-processor} {\em rtn}, \/  void $\ast$ {\em prm})}}
\label{LCBC_8h_3c66ca243001e425ede57ad59291b21b}


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}


References LCBC\_\-\_\-next().

Referenced by LCBC\_\-show().\hypertarget{LCBC_8h_078c176250912bf35db615ca07b60938}{
\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_078c176250912bf35db615ca07b60938}


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}


References LCB\_\-CI\_\-HDR\_\-RXSTATS.\hypertarget{LCBC_8h_9749e3b601e7a27b6e85e1240ae0349d}{
\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}{\bf LCB\_\-ci}$\ast$ LCBC\_\-rxstats\_\-access\_\-fill ({\bf LCB\_\-ci\_\-rxstats} $\ast$ {\em ci}, \/  unsigned int {\em value}, \/  unsigned int {\em field\_\-select}, \/  unsigned short int {\em stall})}}
\label{LCBC_8h_9749e3b601e7a27b6e85e1240ae0349d}


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}


References fill\_\-reg(), and LCB\_\-CI\_\-HDR\_\-RXSTATS.\hypertarget{LCBC_8h_447fd073cae5c7da2991522fbe9a71e2}{
\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 {\bf LCB\_\-ci} $\ast$ {\em beg}, \/  const {\bf LCB\_\-ci} $\ast$ {\em end})}}
\label{LCBC_8h_447fd073cae5c7da2991522fbe9a71e2}


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}


References LCBC\_\-process(), and show().