GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LCBD / V1-2-10

Constituent: lcbd     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

LCBD_p.h File Reference

Definitions of private LCBD Drivers structures. More...

#include "LCBD/LCBD_clk.h"
#include "LCBD/LCBD_evt.h"
#include "LCBD/LCBD_nut.h"
#include "LCBD/LCBD_rst.h"
#include "LCBD/LCBD_stats.h"
#include "PBI/Endianness.h"
#include "PBI/Attribute.h"
#include "MSG/MSG_pubdefs.h"
#include "PBS/FORK.h"
#include "PBS/TASK.h"
#include "PBS/L.h"
#include "PBS/MTX.h"
#include "PBS/SEM.h"
#include "PBS/BSWP.ih"
#include "LCBD/LCBD_drv.h"

Include dependency graph for LCBD_p.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Data Structures

struct  _LCBD
 Struct containing fundamental parameters for the LCB. More...

struct  _LCBD_aib
 Asycnchronous Initialization Block. More...

struct  _LCBD_clk_ucb
 Clock Unit Control Block. More...

struct  _LCBD_evt_cbb
 Cached information about the circular buffer. More...

struct  _LCBD_evt_fcb
 Event Unit free control block. More...

struct  _LCBD_evt_msg
 Event dispatch messsage. More...

struct  _LCBD_evt_ucb
 Event Unit control block. More...

struct  _LCBD_hcb
 Handler control block. More...

struct  _LCBD_icb
 Interrupt control block. More...

struct  _LCBD_ncb
 Notification control block. More...

struct  _LCBD_ncb_msg
 Format of the fork notification messsage. More...

struct  _LCBD_rst_ccb
 The Command Control Block, describes the control information for needed to control access to the LCB's command request queue. More...

struct  _LCBD_rst_flush_msg
 Result flush dispatch messsage. More...

struct  _LCBD_rst_msg
 Result dispatch messsage. More...

struct  _LCBD_rst_ucb
 Result Unit Control Block. More...

struct  _LCBD_scb
 Statistics control block. More...

union  _LCBD_siv
 Union of the bit field representation of the state vector with an unsigned int. More...

struct  _LCBD_siv_bf
 The driver's State Informat Vector, bit field representation. More...

struct  _LCBD_siv_us
 The driver's State Informat Vector, unsigned shorts. More...

struct  _LCBD_ucb
 Control block for the 3 units that comprise the LCB. More...


Defines

#define _DPRINTF(format, args...)
 expands to empty statement for production builds

#define CHECK_EQ(n, a, b)   struct Check_ ## n { int x[1 / (a == b) ]; }
 Checks is a = b, and if not the compiler will issue an error.

#define LCBD_K_INTERNAL_OP_STALL   0
 Used as the stall value for commands to the LCBD internal registers.


Typedefs

typedef enum _LCBD_DISPATCH_TYPE LCBD_DISPATCH_TYPE
 Typedef for enum __LCBD_DISPATCH_TYPE.

typedef _LCBD_clk_ucb LCBD_clk_ucb
 Typedef for struct _LCBD_clk_ucb.

typedef _LCBD_hcb LCBD_hcb
 Typedef for struct _LCBD_hcb.

typedef _LCBD_rst_msg LCBD_rst_msg
 Typedef for struct _LCBD_rst_msg.

typedef _LCBD_rst_flush_msg LCBD_rst_flush_msg
 Typedef for struct _LCBD_rst_flush_msg.

typedef _LCBD_rst_ccb LCBD_rst_ccb
 Typedef for struct _LCBD_rst_ccb.

typedef _LCBD_rst_ucb LCBD_rst_ucb
 Typedef for struct _LCBD_rst_ucb.

typedef _LCBD_evt_msg LCBD_evt_msg
 Typedef for struct _LCBD_evt_msg.

typedef _LCBD_evt_cbb LCBD_evt_cbb
 Typedef for struct _LCBD_evt_cbb.

typedef _LCBD_evt_fcb LCBD_evt_fcb
 Typedef for struct _LCBD_evt_fcb.

typedef _LCBD_evt_ucb LCBD_evt_ucb
 Typedef for struct _LCBD_evt_ucb.

typedef enum _LCBD_SIV_V LCBD_SIV_V
 Typedef for enum _LCBD_SIV_V.

typedef enum _LCBD_SIV_M LCBD_SIV_M
 Typedef for enum _LCBD_SIV_M.

typedef _LCBD_siv_bf LCBD_siv_bf
 Typedef for enum _LCBD_siv_bf.

typedef _LCBD_siv_us LCBD_siv_us
 Typedef for enum _LCBD_siv_us.

typedef _LCBD_siv LCBD_siv
 Typedef for union _LCBD_siv.

typedef _LCBD_ucb LCBD_ucb
 Typedef for struct _LCBD_ucb.

typedef _LCBD_scb LCBD_scb
 Typedef for struct _LCBD_scb.

typedef _LCBD_ncb_msg LCBD_ncb_msg
 Typedef for struct _LCBD_ncb_msg.

typedef _LCBD_ncb LCBD_ncb
 Typedef for struct _LCBD_ncb.

typedef enum _LCBD_ICB_K_TYPE LCBD_ICB_K_TYPE
 Typedef for enum _LCBD_ICB_K_TYPE.

typedef _LCBD_icb LCBD_icb
 Typedef for struct _LCBD_icb.

typedef void(* LCBD_acb )(void *prm, LCBD lcb)
 Callback for LCBD_load asynchronous completion.

typedef enum _LCBD_aib_action LCBD_aib_action
 Typedef for enum _LCBD_aib_action.

typedef _LCBD_aib LCBD_aib
 Typedef for struct _LCBD_aib.


Enumerations

enum  _LCBD_DISPATCH_TYPE {
  LCBD_DISPATCH_TYPE_ISR = 0,
  LCBD_DISPATCH_TYPE_USR = 1
}
 Enumeration of the different types of events that cause bottom half processing. More...

enum  _LCBD_SIV_V {
  LCBD_SIV_V_PCI_UNINITIALIZED = 0,
  LCBD_SIV_V_SW_UNINITIALIZED = 1,
  LCBD_SIV_V_LATP_UNINITIALIZED = 2,
  LCBD_SIV_V_NOCLOCK = 3,
  LCBD_SIV_V_DISCONNECTED = 4,
  LCBD_SIV_V_RESULT_DISABLED = 5,
  LCBD_SIV_V_CNT = 6,
  LCBD_SIV_V_STATE = 16
}
 Bit field offsets for the State Information Vector. More...

enum  _LCBD_SIV_M {
  LCBD_SIV_M_PCI_UNINITIALIZED = (1 << LCBD_SIV_V_PCI_UNINITIALIZED),
  LCBD_SIV_M_SW_UNINITIALIZED = (1 << LCBD_SIV_V_SW_UNINITIALIZED),
  LCBD_SIV_M_LATP_UNINITIALIZED = (1 << LCBD_SIV_V_LATP_UNINITIALIZED),
  LCBD_SIV_M_NOCLOCK = (1 << LCBD_SIV_V_NOCLOCK),
  LCBD_SIV_M_DISCONNECTED = (1 << LCBD_SIV_V_DISCONNECTED),
  LCBD_SIV_M_RESULT_DISABLED = (1 << LCBD_SIV_V_RESULT_DISABLED),
  LCBD_SIV_M_STATE = 0xFFFF0000,
  LCBD_SIV_M_VEC_INITIAL_VALUE = (1 << LCBD_SIV_V_CNT) - 1,
  LCBD_SIV_M_STATE_ONLINE = (LCBD_STATE_ONLINE << LCBD_SIV_V_STATE),
  LCBD_SIV_M_STATE_OFFLINE = (LCBD_STATE_OFFLINE << LCBD_SIV_V_STATE),
  LCBD_SIV_M_STATE_UNINITIALIZED,
  LCBD_SIV_M_STATE_UNLOADING = (LCBD_STATE_UNLOADING << LCBD_SIV_V_STATE),
  LCBD_SIV_M_INITIAL_VALUE
}
 Bit field masks for the State Information Vector. More...

enum  _LCBD_ICB_K_TYPE {
  LCBD_ICB_K_TYPE_PCI = 0,
  LCBD_ICB_K_TYPE_PID = 1
}
 The interrupt source type.

enum  _LCBD_aib_action {
  LCBD_AIB_ACTION_AVAILABLE = -1,
  LCBD_AIB_ACTION_NO_ACCESS = 0,
  LCBD_AIB_ACTION_COMPLETE = 1,
  LCBD_AIB_ACTION_CANCEL = 2
}
 The action to perform. More...


Functions

__inline unsigned int LCBD__pciLoad32 (volatile unsigned int *src) ATTR_UNUSED_OK
 Read a 32-bit integer from PCI Memory.

__inline void LCBD__pciStore32 (volatile unsigned int *dest, unsigned int w) ATTR_UNUSED_OK
 Write a 32-bit integer to PCI Memory.

__inline unsigned int msr_get (void)
 Gets the value of the Power PC Machine Status Register.

__inline unsigned int msr_clr (unsigned int msr)
 Clears the interrupt enable bit in the specified msr.

__inline void msr_put (unsigned int msr)
 Puts/restores the specified msr back into the Machine Status Register.

unsigned int LCBD_stats_init (LCBD_scb *scb)
 Initializes the statistics control block.

unsigned int LCBD_stats_destroy (LCBD_scb *scb)
 Destroys the statistics control block.

unsigned int lcbd_csr_access (LCBD lcb, unsigned int value, unsigned int field_select, unsigned short int timeout, unsigned int *prv, unsigned int *cur)
 Utility routine to compose and execute an access command to LCB's CSR register independent of whether the driver is offline or online.

unsigned int lcbd_faults_access (LCBD lcb, unsigned int value, unsigned int field_select, unsigned short int timeout, unsigned int *prv, unsigned int *cur)
 Utility routine to compose and execute an access command to LCB's FAULTS register independent of whether the driver is offline or online.

unsigned int lcbd_create_handler (LCBD_hcb *hcb, const char *name, int priority, LCBD lcb, int que_cnt, const FORK_que_cfg *que_cfg, int que_id, unsigned int failure)
 Creates a FORK processing task.

FORK_cb_status lcbd_evt_handler (FORK_cb_prm parameter, FORK_msg_hdr *fork_msg)
 The main LCBD descriptor dispatching routine for event traffic.

FORK_cb_status lcbd_rst_handler (FORK_cb_prm parameter, FORK_msg_hdr *fork_msg)
 The main LCBD descriptor dispatching routine.

FORK_cb_status lcbd_rst_flush_handler (FORK_cb_prm parameter, FORK_msg_hdr *fork_msg)
 The main LCBD descriptor dispatching routine.

unsigned int lcbd_nut_post (LCBD lcb)
 Posts a message to the notify service task.

unsigned int lcbd_nut_handler_destroy (LCBD lcb, unsigned int *exit_status)
 Destroys the notification service task.


Detailed Description

Definitions of private LCBD Drivers structures.

Author:
Curt Brune -- curt@slac.stanford.edu

JJRussell -- russell@slac.stanford.edu

  CVS $Id: LCBD_p.h,v 1.15 2005/04/12 17:10:24 russell Exp $

Define Documentation

#define CHECK_EQ n,
a,
 )     struct Check_ ## n { int x[1 / (a == b) ]; }
 

Checks is a = b, and if not the compiler will issue an error.

Parameters:
n Unique identifying string (helps isolate the error)
a The value to check
b The value to check


Typedef Documentation

LCBD_acb
 

Callback for LCBD_load asynchronous completion.

Parameters:
prm A user specified parameter
lcb The LCB handle

LCBD_aib
 

Typedef for struct _LCBD_aib.

This structure is used to hold information needed to handle the asynchronous completion of the LATp-side initialization. This is necessary when, in the course of doing the LATp-side initialization, no clocks are found. An handler is attached to the CLK_ON interrupt that wakes-up a callback handler where the final portion of the LATp side initialization takes place.

LCBD_evt_fcb
 

Typedef for struct _LCBD_evt_fcb.

Information for freeing events

LCBD_evt_msg
 

Typedef for struct _LCBD_evt_msg.

Describes the FORK message passed to the event handler

LCBD_evt_ucb
 

Typedef for struct _LCBD_evt_ucb.

Combines an generic handler control block with a specific message

LCBD_hcb
 

Typedef for struct _LCBD_hcb.

Describes the parameters of a LCBD handler (either event or result)

LCBD_icb
 

Typedef for struct _LCBD_icb.

This structure controls the interrupt connection information

LCBD_ncb
 

Typedef for struct _LCBD_ncb.

This structure controls the user notification of state transients.

LCBD_ncb_msg
 

Typedef for struct _LCBD_ncb_msg.

This is the format of the message exchanged by the LCBD notify routines and the fork receiver task.

LCBD_rst_ccb
 

Typedef for struct _LCBD_rst_ccb.

This data structure keeps track number of command requests that cannot be immediately queued to the driver. It is not completely the property of the result unit, being shared by between the submission code and the result handling code. This is structure represents a crack in the nice model of the LCB as 3 nearly separate units (clock, result and event). There is kind of a 4rth unit, the command submission unit, but this is its only software context, and, as pointed out, even this context is shared with the result unit. So, rather than breaking out another management unit (the command submission unit), this structure has been lumped into the result unit.

LCBD_rst_flush_msg
 

Typedef for struct _LCBD_rst_flush_msg.

Describes the FORK message passed to the result flush handler. This handler gets called back whenever the driver goes offline and there are messages on the pending que.

LCBD_rst_msg
 

Typedef for struct _LCBD_rst_msg.

Describes the FORK message passed to the result handler

LCBD_rst_ucb
 

Typedef for struct _LCBD_rst_ucb.

Combines an generic handler control block with a specific message

LCBD_scb
 

Typedef for struct _LCBD_scb.

The block contains the context used by the LCBD statistics routines. These routines do not control the accumulation of the statistics, but manage the fetching and clearing of them.

LCBD_siv
 

Typedef for union _LCBD_siv.

See also:
union _LCBD_siv

LCBD_siv_bf
 

Typedef for enum _LCBD_siv_bf.

The state information vector is a series of bit flags describing the state of driver, such as is the driver is uninitialized, is the driver disconnected from the PCI interrupt, is the clock absent. It is presented in a negative logic fashion so that a state informaton vector of 0 indicates the driver is in an ONLINE state.

LCBD_SIV_M
 

Typedef for enum _LCBD_SIV_M.

See also:
enum _LCBD_siv_bf

union _LCBD_siv

LCBD_SIV_V
 

Typedef for enum _LCBD_SIV_V.

See also:
enum _LCBD_siv_bf

union _LCBD_siv

LCBD_ucb
 

Typedef for struct _LCBD_ucb.

The block contains the context used by the LCBD to control each of its three (nearly) distinct units. These units are

  1. Clock
  2. Command/Result Unit
  3. Event


Enumeration Type Documentation

enum _LCBD_aib_action
 

The action to perform.

Enumeration values:
LCBD_AIB_ACTION_AVAILABLE  Available
LCBD_AIB_ACTION_NO_ACCESS  Don't use
LCBD_AIB_ACTION_COMPLETE  Complete the initialization
LCBD_AIB_ACTION_CANCEL  Cancel the initialization

enum _LCBD_DISPATCH_TYPE
 

Enumeration of the different types of events that cause bottom half processing.

Enumeration values:
LCBD_DISPATCH_TYPE_ISR  ISR kicked off the bottom half processing
LCBD_DISPATCH_TYPE_USR  User kicked off the bottom half processing

enum _LCBD_SIV_M
 

Bit field masks for the State Information Vector.

Enumeration values:
LCBD_SIV_M_PCI_UNINITIALIZED  PCI portion of the driver is uninitialized
LCBD_SIV_M_SW_UNINITIALIZED  Software portion of the driver is uninitialized
LCBD_SIV_M_LATP_UNINITIALIZED  LATP portion of the driver is uninitialized
LCBD_SIV_M_NOCLOCK  Driver has no 20MHz LATp clock
LCBD_SIV_M_DISCONNECTED  Driver is not connect
LCBD_SIV_M_RESULT_DISABLED  Result interrupt has not be user enabled
LCBD_SIV_M_STATE  State word
LCBD_SIV_M_VEC_INITIAL_VALUE  Initial value of the bit vector to start at
LCBD_SIV_M_STATE_ONLINE  Online value in state vector
LCBD_SIV_M_STATE_OFFLINE  Offline value in state vector
LCBD_SIV_M_STATE_UNINITIALIZED  Uninitialized value in state vector
LCBD_SIV_M_STATE_UNLOADING  Unloading value in state vector

enum _LCBD_SIV_V
 

Bit field offsets for the State Information Vector.

Enumeration values:
LCBD_SIV_V_PCI_UNINITIALIZED  PCI portion of the driver
LCBD_SIV_V_SW_UNINITIALIZED  Software portion of the driver
LCBD_SIV_V_LATP_UNINITIALIZED  LATp side of the driver
LCBD_SIV_V_NOCLOCK  Driver was no 20MHz LATp clock
LCBD_SIV_V_DISCONNECTED  Driver is not connect
LCBD_SIV_V_RESULT_DISABLED  Result interrupt not user enable
LCBD_SIV_V_CNT  Count of state bits
LCBD_SIV_V_STATE  State word


Function Documentation

__inline unsigned int LCBD__pciLoad32 volatile unsigned int *  src  )  [static]
 

Read a 32-bit integer from PCI Memory.

Parameters:
src Pointer source memory location
Returns:
value at memory location pointed to be src
See also:
LCBD__pciStore32()
This function performs the necessary byte swapping when reading PCI Memory (PCI bus is inherently little-endian).

__inline void LCBD__pciStore32 volatile unsigned int *  dest,
unsigned int  w
[static]
 

Write a 32-bit integer to PCI Memory.

Parameters:
dest Pointer destination memory
w 32-bit value to store
Returns:
LCBD_OK on success
See also:
LCBD__pciLoad32()
This function performs the necessary byte swapping when writing PCI Memory (PCI bus is inherently little-endian). For the PowerPC the function also issues an "eieio" instruction to insure the write instruction complete before other loads and stores.

unsigned int lcbd_create_handler LCBD_hcb hcb,
const char *  name,
int  priority,
LCBD  lcb,
int  que_cnt,
const FORK_que_cfg *  que_cfg,
int  que_id,
unsigned int  failure
 

Creates a FORK processing task.

Returns:
Status
Parameters:
hcb The LCBD handler control block, upon success, this is filled in with information about the newly created FORK task.
name The name of the FORK task
priority The priority of the task
lcb Used as the callback parameter to the handler
que_cnt The number of queues to configure
que_cfg The configuration of each que
que_id The que id to use for the handler
failure Status code to use in case of failure

unsigned int lcbd_csr_access LCBD  lcb,
unsigned int  value,
unsigned int  field_select,
unsigned short int  stall,
unsigned int *  prv,
unsigned int *  cur
 

Utility routine to compose and execute an access command to LCB's CSR register independent of whether the driver is offline or online.

Returns:
Status
Parameters:
lcb The LCB driver handle
value The value to write. Only bits matching those in the field_select parameter will actually be written.
field_select Pattern of those bits in value to write
stall The stall period, in units of 20MHz clock ticks, for the LCB to wait for completion.
prv Pointer to receive the value of the register before modification. This may be NULL.
cur Pointer to receive the value of the register after modification. This may be NULL.

Here is the call graph for this function:

FORK_cb_status lcbd_evt_handler FORK_cb_prm  parameter,
FORK_msg_hdr *  fork_msg
 

The main LCBD descriptor dispatching routine for event traffic.

Parameters:
parameter Pointer to private LCBD structure
fork_msg FORK system message
Returns:
FORK_C_CONTINUE

This routine is the event queue servicing task, where the real work of reading the LCB EVENT Q and dispatching of descriptors is done.
The msg parameter could be use to indicate who "tickled" the processing. The usual suspects are the ISR or a user.

Here is the call graph for this function:

unsigned int lcbd_faults_access LCBD  lcb,
unsigned int  value,
unsigned int  field_select,
unsigned short int  stall,
unsigned int *  prv,
unsigned int *  cur
 

Utility routine to compose and execute an access command to LCB's FAULTS register independent of whether the driver is offline or online.

Returns:
Status
Parameters:
lcb The LCB driver handle
value The value to write. Only bits matching those in the field_select parameter will actually be written.
field_select Pattern of those bits in value to write
stall The stall time, in units of 20MHz clock ticks, for the LCB to wait for completion.
prv Pointer to receive the value of the register before modification. This may be NULL.
cur Pointer to receive the value of the register after modification. This may be NULL.

Here is the call graph for this function:

unsigned int lcbd_nut_handler_destroy LCBD  lcb,
unsigned int *  exit_status
 

Destroys the notification service task.

Returns:
The status of from FORK_destroy
Parameters:
lcb The LCB driver handle
exit_status Pointer to receive the exit status of the notification routine.

Here is the call graph for this function:

unsigned int lcbd_nut_post LCBD  lcb  ) 
 

Posts a message to the notify service task.

Returns:
Status from FORK_qusr
Parameters:
lcb The LCB driver handle

Here is the call graph for this function:

FORK_cb_status lcbd_rst_flush_handler FORK_cb_prm  parameter,
FORK_msg_hdr *  fork_msg
 

The main LCBD descriptor dispatching routine.

Parameters:
parameter lcb Pointer to private LCBD structure
fork_msg FORK system message
Returns:
FORK_C_CONTINUE
This routine is the result flushing service. This routine gets called back in the context of the result handling task. When the driver goes offline, a message is queued to this routine containing a list head of all the transaction to dismiss.

FORK_cb_status lcbd_rst_handler FORK_cb_prm  parameter,
FORK_msg_hdr *  fork_msg
 

The main LCBD descriptor dispatching routine.

Parameters:
parameter lcb Pointer to private LCBD structure
fork_msg FORK system message
Returns:
FORK_C_CONTINUE
This routine is the result queue servicing task, where the real work of reading the LCB RESULT Q and dispatching of descriptors is done.

The msg parameter could be use to indicate who "tickled" the processing. The usual suspects are the ISR or a user.

Here is the call graph for this function:

unsigned int LCBD_stats_destroy LCBD_scb scb  ) 
 

Destroys the statistics control block.

Return values:
LCBD_OK,on success
Anything else, failure
Parameters:
scb Pointer to the statistics control block to destroy

unsigned int LCBD_stats_init LCBD_scb scb  ) 
 

Initializes the statistics control block.

Return values:
LCBD_OK,on success
LCBD_STATSIFL,on failure
Parameters:
scb Pointer to the statistics control block to initialize

static __inline unsigned int msr_clr unsigned int  msr  )  [static]
 

Clears the interrupt enable bit in the specified msr.

Returns:
The value of the Power PC Machine Status Register with the interrupt enable bit cleared
Parameters:
msr The value of the machine status register to clear the interrupt in.

static __inline unsigned int msr_get void   )  [static]
 

Gets the value of the Power PC Machine Status Register.

Returns:
The value of the Power PC Machine Status Register

static __inline void msr_put unsigned int  msr  )  [static]
 

Puts/restores the specified msr back into the Machine Status Register.

Parameters:
msr The value of the machine status register to put


Generated on Mon Jun 20 22:41:31 2005 by doxygen 1.3.3