\hypertarget{LCBC_8c}{
\section{LCBC.c File Reference}
\label{LCBC_8c}\index{LCBC.c@{LCBC.c}}
}
Implementation of the LCB command list and command item utility routines. 

{\tt \#include \char`\"{}LCBD/LCBC.h\char`\"{}}\par
{\tt \#include \char`\"{}LCBD/LCB\_\-cr.h\char`\"{}}\par
{\tt \#include $<$stdio.h$>$}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
unsigned int \hyperlink{LCBC_8c_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 
static unsigned int \hyperlink{LCBC_8c_e45bbc636f6688bb3cb8340fcd8f0cf8}{show} (void $\ast$prm, const \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ci)
\begin{CompactList}\small\item\em Shows (prints) a single command item. \item\end{CompactList}\item 
void \hyperlink{LCBC_8c_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 
static \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ \hyperlink{LCBC_8c_693e551e5c7daf4c0d892119d7a5c262}{fill\_\-simple} (\hyperlink{struct__LCB__ci__simple}{LCB\_\-ci\_\-simple} $\ast$simple, unsigned short int stall, unsigned int header)
\begin{CompactList}\small\item\em Constructs a {\em simple\/} LCB command. A simple LCB command consists of only a header word, containing the command length and an opcode, plus a stall word. \item\end{CompactList}\item 
static \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ \hyperlink{LCBC_8c_05cd02261eefa6b0c12c01d85ca15960}{fill\_\-reg} (\hyperlink{struct__LCB__ci__reg}{LCB\_\-ci\_\-reg} $\ast$reg, unsigned int field\_\-select, unsigned int value, unsigned short int stall, unsigned int header)
\begin{CompactList}\small\item\em Constructs a LCB register access command. \item\end{CompactList}\item 
static \hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ \hyperlink{LCBC_8c_36f235a024ff4a37cd94f2f8b33991da}{fill\_\-cmd} (\hyperlink{struct__LCB__ci__cmd}{LCB\_\-ci\_\-cmd} $\ast$cmd, const \hyperlink{struct__LCB__ci__cmd__payload}{LCB\_\-ci\_\-cmd\_\-payload} $\ast$payload, unsigned short int stall\_\-timeout, unsigned int header)
\begin{CompactList}\small\item\em Constructs transmit command, with or without a response. \item\end{CompactList}\item 
\hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ \hyperlink{LCBC_8c_8ba9e7828ca4802c595cbf34c121eff2}{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)
\begin{CompactList}\small\item\em Constructs transmit command, without a response. \item\end{CompactList}\item 
\hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ \hyperlink{LCBC_8c_a4fe16396ac33a9544311c54f2da7dfd}{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)
\begin{CompactList}\small\item\em Constructs transmit command, with a response. \item\end{CompactList}\item 
\hyperlink{union__LCB__ci}{LCB\_\-ci} $\ast$ \hyperlink{LCBC_8c_c4d2168f6ef72f031446b310b7dd97db}{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_8c_e1c915f3f8557283481e6711e93056c9}{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_8c_685cbc7668470ae5c45bd5207c9ad0b4}{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_8c_1e88494169695d555597cd24ad7c5f48}{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_8c_b59a5eb12e0d097f3e753b12e3cef718}{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_8c_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_8c_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_8c_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_8c_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_8c_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_8c_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_8c_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}
Implementation of the LCB command list and command item utility routines. 

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


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

\subsection{Function Documentation}
\hypertarget{LCBC_8c_36f235a024ff4a37cd94f2f8b33991da}{
\index{LCBC.c@{LCBC.c}!fill_cmd@{fill\_\-cmd}}
\index{fill_cmd@{fill\_\-cmd}!LCBC.c@{LCBC.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static {\bf LCB\_\-ci} $\ast$ fill\_\-cmd ({\bf LCB\_\-ci\_\-cmd} $\ast$ {\em cmd}, const {\bf LCB\_\-ci\_\-cmd\_\-payload} $\ast$ {\em payload}, unsigned short int {\em stall\_\-timeout}, unsigned int {\em header})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{LCBC_8c_36f235a024ff4a37cd94f2f8b33991da}


Constructs transmit command, with or 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 cmd}]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\_\-timeout}]The stall or timeout period, in units of 20MHz clock ticks \item[{\em header}]The header plus op code \end{description}
\end{Desc}
\hypertarget{LCBC_8c_05cd02261eefa6b0c12c01d85ca15960}{
\index{LCBC.c@{LCBC.c}!fill_reg@{fill\_\-reg}}
\index{fill_reg@{fill\_\-reg}!LCBC.c@{LCBC.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static {\bf LCB\_\-ci} $\ast$ fill\_\-reg ({\bf LCB\_\-ci\_\-reg} $\ast$ {\em reg}, unsigned int {\em field\_\-select}, unsigned int {\em value}, unsigned short int {\em stall}, unsigned int {\em header})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{LCBC_8c_05cd02261eefa6b0c12c01d85ca15960}


Constructs a LCB 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 reg}]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 \item[{\em header}]The header word, opcode + command length\end{description}
\end{Desc}
\begin{Desc}
\item[LCB Register Access Commands]A LCB register access command consists of the header word, containing the command length and the opcode, plus two command specific parameters, the value to write to the register and a word indicating which bits of the value to write, plus a stall parameter. There are three such registers on the LCB\begin{itemize}
\item CSR\item FIFO FAULTS\item RECEIVE STATISTICS/STATUS \end{itemize}
\end{Desc}
\hypertarget{LCBC_8c_693e551e5c7daf4c0d892119d7a5c262}{
\index{LCBC.c@{LCBC.c}!fill_simple@{fill\_\-simple}}
\index{fill_simple@{fill\_\-simple}!LCBC.c@{LCBC.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static {\bf LCB\_\-ci} $\ast$ fill\_\-simple ({\bf LCB\_\-ci\_\-simple} $\ast$ {\em simple}, unsigned short int {\em stall}, unsigned int {\em header})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{LCBC_8c_693e551e5c7daf4c0d892119d7a5c262}


Constructs a {\em simple\/} LCB command. A simple LCB command consists of only a header word, containing the command length and an opcode, plus a stall word. 

\begin{Desc}
\item[Returns:]Pointer to the next command item to be filled\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em simple}]The command item to be filled. \item[{\em stall}]The stall time, in units of 20MHz clock ticks \item[{\em header}]The header plus op code\end{description}
\end{Desc}
\begin{Desc}
\item[Simple commands]The set of LCB {\em simple\/} commands consist of\begin{itemize}
\item Mark Time\item LAT Reset \end{itemize}
\end{Desc}
\hypertarget{LCBC_8c_a704be79bb1a26274afad6913ed177b0}{
\index{LCBC.c@{LCBC.c}!LCBC_cmd_xmit@{LCBC\_\-cmd\_\-xmit}}
\index{LCBC_cmd_xmit@{LCBC\_\-cmd\_\-xmit}!LCBC.c@{LCBC.c}}
\subsubsection{\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_8c_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}
\hypertarget{LCBC_8c_8ba9e7828ca4802c595cbf34c121eff2}{
\index{LCBC.c@{LCBC.c}!LCBC_cmd_xmit_fill@{LCBC\_\-cmd\_\-xmit\_\-fill}}
\index{LCBC_cmd_xmit_fill@{LCBC\_\-cmd\_\-xmit\_\-fill}!LCBC.c@{LCBC.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\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_8c_8ba9e7828ca4802c595cbf34c121eff2}


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 time, in units of 20MHz clock ticks \end{description}
\end{Desc}
\hypertarget{LCBC_8c_7884b766c7567245e382832de1ff1748}{
\index{LCBC.c@{LCBC.c}!LCBC_cmdr_xmit@{LCBC\_\-cmdr\_\-xmit}}
\index{LCBC_cmdr_xmit@{LCBC\_\-cmdr\_\-xmit}!LCBC.c@{LCBC.c}}
\subsubsection{\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_8c_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}
\hypertarget{LCBC_8c_a4fe16396ac33a9544311c54f2da7dfd}{
\index{LCBC.c@{LCBC.c}!LCBC_cmdr_xmit_fill@{LCBC\_\-cmdr\_\-xmit\_\-fill}}
\index{LCBC_cmdr_xmit_fill@{LCBC\_\-cmdr\_\-xmit\_\-fill}!LCBC.c@{LCBC.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\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_8c_a4fe16396ac33a9544311c54f2da7dfd}


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 period, in units of 20MHz clock ticks \end{description}
\end{Desc}
\hypertarget{LCBC_8c_aac498e7073290eb1d41f7839cfed172}{
\index{LCBC.c@{LCBC.c}!LCBC_csr_access@{LCBC\_\-csr\_\-access}}
\index{LCBC_csr_access@{LCBC\_\-csr\_\-access}!LCBC.c@{LCBC.c}}
\subsubsection{\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_8c_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}
\hypertarget{LCBC_8c_685cbc7668470ae5c45bd5207c9ad0b4}{
\index{LCBC.c@{LCBC.c}!LCBC_csr_access_fill@{LCBC\_\-csr\_\-access\_\-fill}}
\index{LCBC_csr_access_fill@{LCBC\_\-csr\_\-access\_\-fill}!LCBC.c@{LCBC.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\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_8c_685cbc7668470ae5c45bd5207c9ad0b4}


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_8c_96383bdcc4e763e7d95dd45f419702c1}{
\index{LCBC.c@{LCBC.c}!LCBC_faults_access@{LCBC\_\-faults\_\-access}}
\index{LCBC_faults_access@{LCBC\_\-faults\_\-access}!LCBC.c@{LCBC.c}}
\subsubsection{\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_8c_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}
\hypertarget{LCBC_8c_1e88494169695d555597cd24ad7c5f48}{
\index{LCBC.c@{LCBC.c}!LCBC_faults_access_fill@{LCBC\_\-faults\_\-access\_\-fill}}
\index{LCBC_faults_access_fill@{LCBC\_\-faults\_\-access\_\-fill}!LCBC.c@{LCBC.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\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_8c_1e88494169695d555597cd24ad7c5f48}


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_8c_77e9ca256b3b39efdc4f709597777fdb}{
\index{LCBC.c@{LCBC.c}!LCBC_lat_reset@{LCBC\_\-lat\_\-reset}}
\index{LCBC_lat_reset@{LCBC\_\-lat\_\-reset}!LCBC.c@{LCBC.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBC\_\-lat\_\-reset (LCBD {\em lcb}, unsigned short int {\em stall})}}
\label{LCBC_8c_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}
\hypertarget{LCBC_8c_e1c915f3f8557283481e6711e93056c9}{
\index{LCBC.c@{LCBC.c}!LCBC_lat_reset_fill@{LCBC\_\-lat\_\-reset\_\-fill}}
\index{LCBC_lat_reset_fill@{LCBC\_\-lat\_\-reset\_\-fill}!LCBC.c@{LCBC.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}LCBC\_\-ci LCBC\_\-lat\_\-reset\_\-fill ({\bf LCB\_\-ci\_\-lat\_\-reset} $\ast$ {\em ci}, unsigned short int {\em stall})}}
\label{LCBC_8c_e1c915f3f8557283481e6711e93056c9}


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_8c_4d554def122f3124e95e937af878b7fc}{
\index{LCBC.c@{LCBC.c}!LCBC_mark_time@{LCBC\_\-mark\_\-time}}
\index{LCBC_mark_time@{LCBC\_\-mark\_\-time}!LCBC.c@{LCBC.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int LCBC\_\-mark\_\-time (LCBD {\em lcb}, unsigned short int {\em stall})}}
\label{LCBC_8c_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}
\hypertarget{LCBC_8c_c4d2168f6ef72f031446b310b7dd97db}{
\index{LCBC.c@{LCBC.c}!LCBC_mark_time_fill@{LCBC\_\-mark\_\-time\_\-fill}}
\index{LCBC_mark_time_fill@{LCBC\_\-mark\_\-time\_\-fill}!LCBC.c@{LCBC.c}}
\subsubsection{\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_8c_c4d2168f6ef72f031446b310b7dd97db}


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_8c_3c66ca243001e425ede57ad59291b21b}{
\index{LCBC.c@{LCBC.c}!LCBC_process@{LCBC\_\-process}}
\index{LCBC_process@{LCBC\_\-process}!LCBC.c@{LCBC.c}}
\subsubsection{\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_8c_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}
\hypertarget{LCBC_8c_078c176250912bf35db615ca07b60938}{
\index{LCBC.c@{LCBC.c}!LCBC_rxstats_access@{LCBC\_\-rxstats\_\-access}}
\index{LCBC_rxstats_access@{LCBC\_\-rxstats\_\-access}!LCBC.c@{LCBC.c}}
\subsubsection{\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_8c_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}
\hypertarget{LCBC_8c_b59a5eb12e0d097f3e753b12e3cef718}{
\index{LCBC.c@{LCBC.c}!LCBC_rxstats_access_fill@{LCBC\_\-rxstats\_\-access\_\-fill}}
\index{LCBC_rxstats_access_fill@{LCBC\_\-rxstats\_\-access\_\-fill}!LCBC.c@{LCBC.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\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_8c_b59a5eb12e0d097f3e753b12e3cef718}


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_8c_447fd073cae5c7da2991522fbe9a71e2}{
\index{LCBC.c@{LCBC.c}!LCBC_show@{LCBC\_\-show}}
\index{LCBC_show@{LCBC\_\-show}!LCBC.c@{LCBC.c}}
\subsubsection{\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_8c_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}
\hypertarget{LCBC_8c_e45bbc636f6688bb3cb8340fcd8f0cf8}{
\index{LCBC.c@{LCBC.c}!show@{show}}
\index{show@{show}!LCBC.c@{LCBC.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static unsigned int show (void $\ast$ {\em prm}, const {\bf LCB\_\-ci} $\ast$ {\em ci})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{LCBC_8c_e45bbc636f6688bb3cb8340fcd8f0cf8}


Shows (prints) a single command item. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em prm}]Arbitrary user parameter, unused \item[{\em ci}]Pointer to command item\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]0\end{Desc}
Useful when passed to LCBC\_\-process () to print all result items. 