GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > VXW / V7-1-1

Constituent: vxw_flight     Tag: rad750


Interface   Data Structures   File List   Data Fields   Globals  

sibSocket.c File Reference

TFFS socket driver for LAT SIB board EEPROM banks. More...

#include "vxWorks.h"
#include "semLib.h"
#include "pci.h"
#include "mv2600.h"
#include "tffs/flsocket.h"
#include "tffs/tffsDrv.h"
#include "drv/pci/pciConfigLib.h"
#include "drv/sib/sib.h"

Include dependency graph for sibSocket.c:


Data Structures

struct  _SIB_Socket

Defines

#define SIB_KEY_SIZE   12

Typedefs

typedef enum _SIB_Socket_Type SIB_Socket_Type
typedef _SIB_Socket SIB_Socket

Enumerations

enum  _SIB_Socket_Type {
  SIB_SOCKET_LOWER,
  SIB_SOCKET_UPPER
}

Functions

LOCAL FLBoolean sibCardDetected (FLSocket vol)
 Detect if a card is present (inserted).
LOCAL void sibVccOn (FLSocket vol)
 Turn on Vcc (3.3/5 Volts).
LOCAL void sibVccOff (FLSocket vol)
 Turn off Vcc (3.3/5 Volts).
LOCAL FLBoolean sibGetAndClearCardChangeIndicator (FLSocket vol)
 Return the hardware card-change indicator.
LOCAL FLBoolean sibWriteProtected (FLSocket vol)
 Return the write-protect state of the media.
LOCAL void sibSetWindow (FLSocket vol)
 Set current window attributes, Base address, size, etc.
LOCAL void sibSetMappingContext (FLSocket vol, unsigned page)
 Sets the window mapping register to a card address.
LOCAL FLStatus sibSocketInit (FLSocket vol)
 Perform all necessary initializations of the socket.
LOCAL FLStatus sibVppOn_Flight (FLSocket vol)
 Turns on Vpp (12 Volts).
LOCAL void sibVppOff_Flight (FLSocket vol)
 Turns off Vpp (12 Volts).
LOCAL FLStatus sibVppOn_Eval (FLSocket vol)
 Turns on Vpp (12 Volts).
LOCAL void sibVppOff_Eval (FLSocket vol)
 Turns off Vpp (12 Volts).
LOCAL FLStatus sibRegister (int bus, int dev, int func, unsigned short id)
 Registration routine for the SIB EEPROM banks.

Variables

LOCAL const int sibLowerKey [SIB_KEY_SIZE]
LOCAL const int sibUpperKey [SIB_KEY_SIZE]
LOCAL SEM_ID sibMutex

Detailed Description

TFFS socket driver for LAT SIB board EEPROM banks.

Author:
D.L. Wood
This is a TFFS socket driver to support the LAT SIB board. Each SIB board EEPROM bank is mapped to a TFFS socket drive. The sockets are named "SIB_Upper" and "SIB_Lower". Support for write protection lock and unlock is provided through the functions sibVppOn() and sibVppOff().

With the LAT EM SIB board (vendor ID = 0x11aa, device ID = 0x0001), only one EEPROM bank may be unlocked at once. The driver enforces this though a global mutex.


Define Documentation

#define SIB_KEY_SIZE   12
 

The number of elements in bank unlock circuit key.


Typedef Documentation

SIB_Socket
 

The typedef for _SIB_Socket.

SIB_Socket_Type
 

The typedef for _SIB_Socket_Type.


Enumeration Type Documentation

enum _SIB_Socket_Type
 

Marker values to distiguish SIB upper and lower EEPROM banks.


Function Documentation

LOCAL FLBoolean sibCardDetected FLSocket  vol  ) 
 

Detect if a card is present (inserted).

This routine detects if a card is present (inserted). Because the SIB board contains non-removalble media, this function always returns 'TRUE'.

Parameters:
vol The socket descriptor.
Return values:
TRUE The card is present.
FALSE The card is not present.

LOCAL FLBoolean sibGetAndClearCardChangeIndicator FLSocket  vol  ) 
 

Return the hardware card-change indicator.

This routine returns the hardware card-change indicator and clears it if set. Because the SIB board contains non-removalble media, this function always returns 'FALSE'.

Parameters:
vol The socket descriptor.
Return values:
FALSE The card has not been changed.
TRUE The card has been changed.

FLStatus sibRegister int  bus,
int  dev,
int  func,
unsigned short  id
 

Registration routine for the SIB EEPROM banks.

This routine populates the 'vol' structures for logical drives with the socket component driver routines for the SIB EEPROM bank socket . All socket routines are referanced through the 'vol' structure and never from here directly.

Two TFFS sockets are registered, one for each SIB EEPROM bank.

Parameters:
bus The PCI bus number for SIB board.
dev The PCI device number for SIB board.
func The PCI function number for SIB board.
id The PCI device ID for the SIB board (0x0001 = eval, 0x0844 = flight).
Return values:
flOK Success.
flTooManyComponents Too many TFFS drives registered.
flDriveNotAvailable The SIB board was not found.
flNotEnoughMemory Memory allocation error.
flGeneralFailure A system resource could not be created.

LOCAL void sibSetMappingContext FLSocket  vol,
unsigned  page
 

Sets the window mapping register to a card address.

This routine sets the window mapping register to a card address. The window should be set to the value of 'vol.window.currentPage', which is the card address divided by 4 KB. An address over 128MB, (page over 32K) specifies an attribute-space address.

The page to map is guaranteed to be on a full window-size boundary.

The SIB board does not require a window mapping register.

Parameters:
vol The socket descriptor.
page Page value to be mapped (4 KB units).

LOCAL void sibSetWindow FLSocket  vol  ) 
 

Set current window attributes, Base address, size, etc.

This routine sets current window hardware attributes: Base address, size, speed and bus width. The requested settings are given in the 'vol.window' structure. If it is not possible to set the window size requested in 'vol.window.size', the window size should be set to a larger value, if possible. In any case, 'vol.window.size' should contain the actual window size (in 4 KB units) on exit.

Parameters:
vol The socket descriptor.

LOCAL FLStatus sibSocketInit FLSocket  vol  ) 
 

Perform all necessary initializations of the socket.

This routine performs all necessary initializations of the socket.

Parameters:
vol The socket descriptor.
Returns:
flOK.

LOCAL void sibVccOff FLSocket  vol  ) 
 

Turn off Vcc (3.3/5 Volts).

This routine turns off Vcc (3.3/5 Volts).

The SIB board does not support power management.

Parameters:
vol The socket descriptor.

LOCAL void sibVccOn FLSocket  vol  ) 
 

Turn on Vcc (3.3/5 Volts).

This routine turns on Vcc (3.3/5 Volts). Vcc must be known to be good on exit.

The SIB board does not support power management.

Parameters:
vol The socket descriptor.

LOCAL void sibVppOff_Eval FLSocket  vol  ) 
 

Turns off Vpp (12 Volts).

This routine turns off Vpp (12 Volts).

The SIB does not support a Vpp programming voltage, but does provide a digital lock circuit to protect EEPROM when not being written. This function unlocks the SIB EEPROM bank so that locations are write protected.

This function is specific to the evaluation model SIB board. The evalation model SIB board only allows one of the EEPROM banks to be unlocked at once.

Parameters:
vol The socket descriptor.

LOCAL void sibVppOff_Flight FLSocket  vol  ) 
 

Turns off Vpp (12 Volts).

This routine turns off Vpp (12 Volts).

The SIB does not support a Vpp programming voltage, but does provide a digital lock circuit to protect EEPROM when not being written. This function unlocks the SIB EEPROM bank so that locations are write protected.

This function is specific to the flight/EM model SIB board. The flight model SIB board allows the EEPROM banks to be unlocked at simultaneously.

Parameters:
vol The socket descriptor.

LOCAL FLStatus sibVppOn_Eval FLSocket  vol  ) 
 

Turns on Vpp (12 Volts).

This routine turns on Vpp (12 Volts). Vpp must be known to be good on exit.

The SIB does not support a Vpp programming voltage, but does provide a digital lock circuit to protect EEPROM when not being written. This function unlocks the SIB EEPROM bank so that locations may be written.

This function is specific to the evaluation model SIB board. The evalation model SIB board only allows one of the EEPROM banks to be unlocked at once.

Parameters:
vol The socket descriptor.
Return values:
flOK Success.
flVppFailure EEPROM bank not unlocked.

LOCAL FLStatus sibVppOn_Flight FLSocket  vol  ) 
 

Turns on Vpp (12 Volts).

This routine turns on Vpp (12 Volts). Vpp must be known to be good on exit.

The SIB does not support a Vpp programming voltage, but does provide a digital lock circuit to protect EEPROM when not being written. This function unlocks the SIB EEPROM bank so that locations may be written.

This function is specific to the flight/EM model SIB board. The flight model SIB board allows the EEPROM banks to be unlocked at simultaneously.

Parameters:
vol The socket descriptor.
Return values:
flOK Success.
flVppFailure EEPROM bank not unlocked.

LOCAL FLBoolean sibWriteProtected FLSocket  vol  ) 
 

Return the write-protect state of the media.

This routine returns the write-protect state of the media. Because the SIB board does not support permanent write protection, this function always returns 'FALSE'.

Parameters:
vol The socket descriptor.
Return values:
FALSE The card is not write-protected.
TRUE The card is write-protected.


Variable Documentation

sibLowerKey
 

Initial value:

 
{
        1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1
}
Unlock sequence for SIB lower EEPROM bank.

LOCAL SEM_ID sibMutex
 

var sibMutex A global mutex to ensure that only one SIB EEPROM bank is unlocked at once.

sibUpperKey
 

Initial value:

 
{
        1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1
}
Unlock sequence for SIB upper EEPROM bank.


Generated on Sat Feb 2 01:36:36 2008 by  doxygen 1.4.4