nidas v1.2.3
Public Attributes | List of all members
pc104sg_board Struct Reference

Everything needed to access the board. More...

Public Attributes

unsigned int ioport
 
unsigned long addr
 
int irq
 
struct class * class
 
struct device * device
 
char deviceName [32]
 
dev_t pc104sg_device
 Linux device.
 
struct cdev pc104sg_cdev
 Linux character device.
 
struct irig_devicedev
 Information needed by file operations.
 
spinlock_t dev_lock
 spinlock used to control access to irig_device member.
 
atomic_t num_opened
 How many concurrent opens of the device.
 
unsigned char IntMask
 The three possible interrupts generated by this card are enabled with bits 5,6,7 of the status port:
 
spinlock_t lock
 Spinlock to control concurrent access to board registers and shared variables in this structure.
 
int TMsecClockTicker
 Our clock ticker, 1/10s of milliseconds since 00:00 GMT.
 
int WriteClock
 Index into TMsecClock of the next clock value to be written.
 
int count100Hz
 
enum clockState clockState
 Current clock state.
 
enum clockAction clockAction
 Action to be performed at the beginning of the next 100 Hz tasklet, either NO_ACTION or RESET_COUNTERS.
 
enum notifyClients notifyClients
 If clockAction is RESET_COUNTERS, whether to notify clients after resetting our software clocks.
 
struct pc104sg_status status
 Status structure accessed by IRIG_GET_STATUS ioctl.
 
unsigned char extendedStatus
 Instantaneous value of extended status bits, read from DP RAM at 100 Hz.
 
unsigned char lastStatus
 Value of last extendedStatus, so we can detect SYNC <-> NOSYNC transitions.
 
int lastSyncTime
 last time that software clock was set against a sync'd irig clock.
 
int DP_RamExtStatusEnabled
 Set to true if ISR should send requests for status from dual-ported RAM.
 
int DP_RamExtStatusRequested
 Set to true if ISR has sent a request for status from dual-ported RAM.
 
struct tasklet_struct tasklet100Hz
 
atomic_t pending100Hz
 How many 100Hz ticks are yet unhandled in tasklet?
 
struct irig_callback * oneHzCallback
 Our 1 Hz callback.
 
struct clockSnapShot snapshot
 Snapshot of the hardware and software clock and status.
 
int doSnapShot
 Set to true if the interrupt service routine should take a snapshot.
 
int askedSnapShot
 Toward the end of a second, the bottom half asks the ISR for a clock snapshot.
 
struct clockSnapShot resetSnapshot
 Snapshot taken by the ISR when clockAction == RESET_COUNTERS.
 
int resetSnapshotDone
 RESETS snapshot has been taken.
 
unsigned char statusOR
 An OR of the status bits since the last 1Hz snapshot.
 
struct list_head CallbackLists [IRIG_NUM_RATES]
 
struct list_head CallbackPool
 Pool of allocated callback entries.
 
spinlock_t cblist_lock
 Spinlock to control concurrent access to callback lists.
 
struct list_head pendingAdds
 Callback entries that are to be added to the active list on next pass though loop.
 
struct irig_callback * pendingRemoves [CALLBACK_POOL_SIZE]
 Callback entries that are to be removed on next pass though loop.
 
int nPendingRemoves
 
atomic_t nPendingCallbackChanges
 
wait_queue_head_t callbackWaitQ
 wait_queue for tasks that want to wait until their callback is definitely not running.
 
int max100HzBacklog
 
int ndtLast
 Number of 100 Hz delta-Ts the softare clock was off on the last check.
 
int ndtNSecs
 

Detailed Description

Everything needed to access the board.

Member Data Documentation

◆ addr

unsigned long pc104sg_board::addr

◆ askedSnapShot

int pc104sg_board::askedSnapShot

Toward the end of a second, the bottom half asks the ISR for a clock snapshot.

This is used so that it doesn't ask twice in the second.

◆ CallbackLists

struct list_head pc104sg_board::CallbackLists[IRIG_NUM_RATES]

◆ CallbackPool

struct list_head pc104sg_board::CallbackPool

Pool of allocated callback entries.

◆ callbackWaitQ

wait_queue_head_t pc104sg_board::callbackWaitQ

wait_queue for tasks that want to wait until their callback is definitely not running.

◆ cblist_lock

spinlock_t pc104sg_board::cblist_lock

Spinlock to control concurrent access to callback lists.

◆ class

struct class* pc104sg_board::class

◆ clockAction

enum clockAction pc104sg_board::clockAction

Action to be performed at the beginning of the next 100 Hz tasklet, either NO_ACTION or RESET_COUNTERS.

◆ clockState

enum clockState pc104sg_board::clockState

Current clock state.

◆ count100Hz

int pc104sg_board::count100Hz

◆ dev

struct irig_device* pc104sg_board::dev

Information needed by file operations.

◆ dev_lock

spinlock_t pc104sg_board::dev_lock

spinlock used to control access to irig_device member.

dev member is accessed by a tasklet in software interrupt context so we must use a spinlock, not a mutex.

◆ device

struct device* pc104sg_board::device

◆ deviceName

char pc104sg_board::deviceName[32]

◆ doSnapShot

int pc104sg_board::doSnapShot

Set to true if the interrupt service routine should take a snapshot.

This is the 1 Hz clock quality snapshot.

◆ DP_RamExtStatusEnabled

int pc104sg_board::DP_RamExtStatusEnabled

Set to true if ISR should send requests for status from dual-ported RAM.

◆ DP_RamExtStatusRequested

int pc104sg_board::DP_RamExtStatusRequested

Set to true if ISR has sent a request for status from dual-ported RAM.

◆ extendedStatus

unsigned char pc104sg_board::extendedStatus

Instantaneous value of extended status bits, read from DP RAM at 100 Hz.

◆ IntMask

unsigned char pc104sg_board::IntMask

The three possible interrupts generated by this card are enabled with bits 5,6,7 of the status port:

5 = heartbeat 6 = match 7 = external-time-tag

Writing a 0 to bits 0-4 causes other things, like board reset, so we set those bits to 1 here in the interrupt mask.

◆ ioport

unsigned int pc104sg_board::ioport

◆ irq

int pc104sg_board::irq

◆ lastStatus

unsigned char pc104sg_board::lastStatus

Value of last extendedStatus, so we can detect SYNC <-> NOSYNC transitions.

◆ lastSyncTime

int pc104sg_board::lastSyncTime

last time that software clock was set against a sync'd irig clock.

◆ lock

spinlock_t pc104sg_board::lock

Spinlock to control concurrent access to board registers and shared variables in this structure.

◆ max100HzBacklog

int pc104sg_board::max100HzBacklog

◆ ndtLast

int pc104sg_board::ndtLast

Number of 100 Hz delta-Ts the softare clock was off on the last check.

◆ ndtNSecs

int pc104sg_board::ndtNSecs

◆ notifyClients

enum notifyClients pc104sg_board::notifyClients

If clockAction is RESET_COUNTERS, whether to notify clients after resetting our software clocks.

◆ nPendingCallbackChanges

atomic_t pc104sg_board::nPendingCallbackChanges

◆ nPendingRemoves

int pc104sg_board::nPendingRemoves

◆ num_opened

atomic_t pc104sg_board::num_opened

How many concurrent opens of the device.

◆ oneHzCallback

struct irig_callback* pc104sg_board::oneHzCallback

Our 1 Hz callback.

Checks the clock snapshot, and sends a data sample if the device is opened.

◆ pc104sg_cdev

struct cdev pc104sg_board::pc104sg_cdev

Linux character device.

◆ pc104sg_device

dev_t pc104sg_board::pc104sg_device

Linux device.

◆ pending100Hz

atomic_t pc104sg_board::pending100Hz

How many 100Hz ticks are yet unhandled in tasklet?

◆ pendingAdds

struct list_head pc104sg_board::pendingAdds

Callback entries that are to be added to the active list on next pass though loop.

◆ pendingRemoves

struct irig_callback* pc104sg_board::pendingRemoves[CALLBACK_POOL_SIZE]

Callback entries that are to be removed on next pass though loop.

◆ resetSnapshot

struct clockSnapShot pc104sg_board::resetSnapshot

Snapshot taken by the ISR when clockAction == RESET_COUNTERS.

◆ resetSnapshotDone

int pc104sg_board::resetSnapshotDone

RESETS snapshot has been taken.

◆ snapshot

struct clockSnapShot pc104sg_board::snapshot

Snapshot of the hardware and software clock and status.

◆ status

struct pc104sg_status pc104sg_board::status

Status structure accessed by IRIG_GET_STATUS ioctl.

◆ statusOR

unsigned char pc104sg_board::statusOR

An OR of the status bits since the last 1Hz snapshot.

◆ tasklet100Hz

struct tasklet_struct pc104sg_board::tasklet100Hz

◆ TMsecClockTicker

int pc104sg_board::TMsecClockTicker

Our clock ticker, 1/10s of milliseconds since 00:00 GMT.

It is signed, since we are often computing time differences, and it is handy to initialize it to -1. There are 864,000,000 1/10 milliseconds in a day, so as a 32 bit signed integer, it has enough range for +- 2.4 days, but generally we restrict its value to the range 0:863,999,999.

◆ WriteClock

int pc104sg_board::WriteClock

Index into TMsecClock of the next clock value to be written.


The documentation for this struct was generated from the following file: