GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > GNAT / V2-0-0
Constituent: gnat_cio     Tag: sun-gcc
#include "latp_p.h"
#include "GNAT/gio.h"
#include "GNAT/bndl.h"
#include "GNAT/latp.h"
#include "gnat_p.h"
#include <string.h>
#include <stdio.h>
Include dependency graph for latp.c:
Defines | |
#define | LATP_TYPE_CMD_RSP (0) |
Expect cmd/rsp data in FIFO. | |
#define | LATP_TYPE_EVENT (1) |
Expect event data in FIFO. | |
Functions | |
int | calcParity (unsigned int nWords, unsigned int *arr) |
Calculates the odd parity in arr. | |
void | srvIntr (gnatHandle gh) |
ISR that gives the m_syncSem semaphore when the record FIFO has a packet ready. | |
int | gWaitPacketIRQ (gnatHandle gh) |
Blocks on the ISR semaphore waiting for LATp packet ready IRQ. | |
int | __dumpFIFO (gnatHandle gh, unsigned short nWords) |
Dumps nWords from FIFO (if FIFO is non-empty). | |
int | __errDump (gnatHandle gh) |
Dumps response buffers and response FIFO. | |
int | gReadRsp (gnatHandle gh, gResponse *rspInfo) |
Transfers data from the record FIFO to the rspInfo structure. | |
int | sendLATpCell (gnatHandle gh, LATp_Cell *pCell, unsigned char lastCell) |
Loads a LATp cell into the playback FIFO. | |
int | gLoadPacket (gnatHandle gh, gResponse *rspInfo, unsigned short dest, unsigned short nWord16, unsigned short *payload) |
Loads a LATp packet into the COMM board FIFO. | |
int | gSendPacket (gnatHandle gh, gResponse *rspInfo, unsigned short dest, unsigned short nWord16, unsigned short *payload) |
Sends a LATp packet on the LAT network. | |
int | gSendLAM (gnatHandle gh, unsigned short destAddr) |
Sends the "Look At Me" message to the LAT node destAddr. | |
int | gSetAddr (gnatHandle gh, unsigned short addr) |
Sets the source address of the LATp interface associated with gh. | |
int | gGetAddr (gnatHandle gh, unsigned short *addr) |
Gets the source address of the LATp interface associated with gh. | |
int | gResetCommStats (gnatHandle gh) |
Resets the network statistics for the LATp interface associated with gh. | |
int | gGetTXstats (gnatHandle gh, LATp_TXstats *txStats) |
Returns the current transmission statistics. | |
int | gSetTXstats (gnatHandle gh, LATp_TXstats *txStats) |
Sets the current transmission statistics from txStats. | |
int | gGetRXstats (gnatHandle gh, LATp_RXstats *rxStats) |
Returns the current recieve statistics. | |
int | gSetRXstats (gnatHandle gh, LATp_RXstats *rxStats) |
Sets the current recieve statistics from rxStats. | |
int | gSetLATpChnl (gnatHandle gh, unsigned char chnl) |
Sets the incoming LATp channel number for the board. | |
int | gSetLATpMode (gnatHandle gh, unsigned char mode) |
Sets the running mode of the board. | |
int | gSetProtocol (gnatHandle gh, unsigned short proto) |
Sets the protocol to use. | |
int | gGetProtocol (gnatHandle gh, unsigned short *proto) |
Gets the current LATp protocol. | |
int | gSetTimeout (gnatHandle gh, unsigned short timeout) |
Sets the timeout to use for LATp interface. | |
int | setLATpCellHeaderParity (gnatHandle gh, unsigned short p) |
p determines if the LATp CellHeader Parity is inverted | |
int | getLATpCellHeaderParity (gnatHandle gh, unsigned short *p) |
Returns the current LATp cell header parity setting in p. | |
int | setLATpCellBodyParity (gnatHandle gh, unsigned short p) |
p determines if the LATp CellBody Parity is inverted | |
int | getLATpCellBodyParity (gnatHandle gh, unsigned short *p) |
Returns current LATp CellBody Parity in p. | |
int | setLATpSkipRspWords (gnatHandle gh, unsigned short nSkip) |
nSkip controls how many FIFO words to skip before storing read back data. | |
Variables | |
int | gnat_irqDelay = 0 |
Delay used in taskDelay() before reading FIFO. | |
unsigned short | _LAMpayload [] |
Array of 16-bit words to use at paylod for Look At Me command. |
|
Dumps nWords from FIFO (if FIFO is non-empty).
|
Here is the call graph for this function:
|
Dumps response buffers and response FIFO.
|
Here is the call graph for this function:
|
Calculates the odd parity in arr.
|
|
Returns current LATp CellBody Parity in p.
|
|
Returns the current LATp cell header parity setting in p.
|
|
Gets the source address of the LATp interface associated with gh.
|
|
Gets the current LATp protocol.
|
|
Returns the current recieve statistics.
|
|
Returns the current transmission statistics.
|
|
Loads a LATp packet into the COMM board FIFO.
Loads a LATp packet into the COMM board FIFO. Using rspInfo, dest, source it constructs a 16 bit header word for the control cell of the packet. It fills the remainder of the 128-bit control cell with data from payload (up to 14 bytes). The control cell is preceded by a 2 bit delineator and follow by a truncate bit and parity bit -- if the payload is larger than 14 bytes then additional data cells are created and injected with the appropriate delineator and suffix bits. Caller is responsible for initializing FIFO and for initiating the playback. |
Here is the call graph for this function:
|
Transfers data from the record FIFO to the rspInfo structure.
The routine checks bits 17 and 18 of every 9th FIFO word to determine when the last packet has been processed -- when these bits are both zero we have reached the end of the packet chain (potentially multiple packets, if the packets are back-to-back). Updates the LATp interface reciever statistics for packets received, cell parity errors and cell header parity errors. The response could contain multiple packets. Coming off the response FIFO LATp cells are 9 words long. Word 1 has the cell announce and cell type bits, while word 9 has the truncate and parity error bits. Additionally word 1 also has the cell header if the cell type is a control cell. |
Here is the call graph for this function:
|
Resets the network statistics for the LATp interface associated with gh.
|
|
Sends the "Look At Me" message to the LAT node destAddr.
|
Here is the call graph for this function:
|
Sends a LATp packet on the LAT network.
Sends a LATp packet on the network. Using rspInfo, dest, source it constructs a 16 bit header word for the control cell of the packet. It fills the remainder of the 128-bit control cell with data from payload (up to 14 bytes). The control cell is injected in the network preceded by a 2 bit delineator and follow by a truncate bit and parity bit -- if the payload is larger than 14 bytes then additional data cells are created and injected with the appropriate delineator and suffix bits. |
Here is the call graph for this function:
|
Sets the source address of the LATp interface associated with gh.
|
|
Sets the incoming LATp channel number for the board.
|
|
Sets the running mode of the board.
|
|
Sets the protocol to use.
|
|
Sets the current recieve statistics from rxStats.
|
|
Sets the timeout to use for LATp interface.
|
|
Sets the current transmission statistics from txStats.
|
|
Blocks on the ISR semaphore waiting for LATp packet ready IRQ.
|
|
Loads a LATp cell into the playback FIFO.
Loads a 128-bit LATp cell into the GNAT playback FIFO. The cell is preceded by a 2 bit delineator and followed by a truncate bit and parity bit. Delineator:
Suffix:
If this cell is the last cell in the packet then two additional trailing zeros are added after the parity bit |
Here is the call graph for this function:
|
p determines if the LATp CellBody Parity is inverted
|
|
p determines if the LATp CellHeader Parity is inverted
|
|
nSkip controls how many FIFO words to skip before storing read back data.
Setting nSkip to a non-zero value causes the read back routine to skip nSkip FIFO words (read and discard) before storing the data. This allows us to arbitrarily fill the record FIFO with N junk words and then instruct the read back routines to skip over the N junk words before reading and storing the data. With this technique we can probe the TEM to COMM flow control based on the Almost Full Flag of the record FIFO. |
|
ISR that gives the m_syncSem semaphore when the record FIFO has a packet ready.
|
|
Initial value: { 0x9C3E, 0x07F0, 0x0FF8, 0x01FF, 0xC003, 0xFFE0, 0x007F, }
|