ARPDAS_QNX6 1.0
Classes | Defines | Functions | Variables
subbus.h File Reference
#include <sys/siginfo.h>
Include dependency graph for subbus.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  subbus_mread_req

Defines

#define SB_PCICC   1
#define SB_PCICCSIC   2
#define SB_SYSCON   3
#define SB_SYSCON104   4
#define SB_SYSCONDACS   5
#define SBF_SIC   1
#define SBF_LG_RAM   2
#define SBF_HW_CNTS   4
#define SBF_WD   8
#define SBF_SET_FAIL   0x10
#define SBF_READ_FAIL   0x20
#define SBF_READ_SW   0x40
#define SBF_NVRAM   0x80
#define SBF_CMDSTROBE   0x100
#define write_subbus(x, y)   write_ack(x,y)
#define subbus_name   get_subbus_name()
#define sbrw(x)   read_subbus(x)
#define sbwr(x, y)   write_ack(x,y)
#define sbwra(x, y)   write_ack(x,y)

Functions

int load_subbus (void)
unsigned short read_subbus (unsigned short addr)
int write_ack (unsigned short addr, unsigned short data)
int read_ack (unsigned short addr, unsigned short *data)
subbus_mread_reqpack_mread_request (int n_reads, const char *req)
subbus_mread_reqpack_mread_requests (unsigned int addr,...)
int mread_subbus (subbus_mread_req *req, unsigned short *data)
int set_cmdenbl (int value)
int set_cmdstrobe (int value)
unsigned short read_switches (void)
int set_failure (unsigned short value)
unsigned short read_failure (void)
int tick_sic (void)
int disarm_sic (void)
char * get_subbus_name (void)
int cache_write (unsigned short addr, unsigned short data)
unsigned short cache_read (unsigned short addr)
unsigned short sbrb (unsigned short addr)
unsigned short sbrba (unsigned short addr)
unsigned int sbrwa (unsigned short addr)
int subbus_int_attach (char *cardID, unsigned short address, unsigned short region, struct sigevent *event)
int subbus_int_detach (char *cardID)
int subbus_quit (void)

Variables

unsigned short subbus_version
unsigned short subbus_features
unsigned short subbus_subfunction

Detailed Description

subbus.h defines the interface to the subbus resident library Before calling the subbus routines, you must first call load_subbus(). This returns the subfunction of the resident subbus library or 0 if none is installed.

Definition in file subbus.h.


Define Documentation

#define SB_PCICC   1

Definition at line 20 of file subbus.h.

#define SB_PCICCSIC   2

Definition at line 21 of file subbus.h.

#define SB_SYSCON   3

Definition at line 22 of file subbus.h.

#define SB_SYSCON104   4

Definition at line 23 of file subbus.h.

Referenced by int_init(), and int_reset().

#define SB_SYSCONDACS   5

Definition at line 24 of file subbus.h.

#define SBF_CMDSTROBE   0x100

Definition at line 35 of file subbus.h.

#define SBF_HW_CNTS   4

Definition at line 29 of file subbus.h.

#define SBF_LG_RAM   2

Definition at line 28 of file subbus.h.

#define SBF_NVRAM   0x80

Definition at line 34 of file subbus.h.

#define SBF_READ_FAIL   0x20

Definition at line 32 of file subbus.h.

#define SBF_READ_SW   0x40

Definition at line 33 of file subbus.h.

#define SBF_SET_FAIL   0x10

Definition at line 31 of file subbus.h.

#define SBF_SIC   1

Definition at line 27 of file subbus.h.

#define SBF_WD   8

Definition at line 30 of file subbus.h.

#define sbrw (   x)    read_subbus(x)

Definition at line 69 of file subbus.h.

#define sbwr (   x,
 
)    write_ack(x,y)

Definition at line 71 of file subbus.h.

#define sbwra (   x,
 
)    write_ack(x,y)

Definition at line 72 of file subbus.h.

Referenced by int_attach(), and int_detach().

#define subbus_name   get_subbus_name()

Definition at line 63 of file subbus.h.

#define write_subbus (   x,
 
)    write_ack(x,y)

Definition at line 51 of file subbus.h.


Function Documentation

unsigned short cache_read ( unsigned short  addr)
Returns:
Cached read value or zero if address is invalid.

Definition at line 137 of file subbus.c.

References subbusd_rep_t::data, subbusd_req_data1::data, nl_error, SBC_READCACHE, SBRT_US, SBS_ACK, SBS_NOACK, send_to_subbusd(), and subbusd_rep_t::value.

Here is the call graph for this function:

int cache_write ( unsigned short  addr,
unsigned short  data 
)
Returns:
non-zero value if the hardware acknowledge is observed. Historically, the value recorded the number of iterations in the software loop waiting for the microsecond timeout.

Definition at line 219 of file subbus.c.

References subbusd_req_data0::address, subbusd_req_data0::data, nl_error, SBC_WRITECACHE, SBRT_NONE, SBS_ACK, SBS_NOACK, and send_to_subbusd().

Here is the call graph for this function:

int disarm_sic ( void  )

If system controller is associated with a watchdog timer that can reboot the system, this command disables that timer.

Definition at line 350 of file subbus.c.

References SBC_DISARM, SBRT_NONE, SC_DISARM, and send_to_subbusd().

Referenced by incoming_sbreq().

Here is the call graph for this function:

Here is the caller graph for this function:

char* get_subbus_name ( void  )

Returns the hardware name string as originally retrieved from subbusd during load_subbus().

Definition at line 107 of file subbus.c.

References local_subbus_name, nl_error, and sb_fd.

int load_subbus ( void  )

Initializes communications with subbusd driver. Returns library subfunction on success, zero on failure.

Definition at line 75 of file subbus.c.

References subbusd_rep_t::capabilities, subbusd_rep_t::data, subbusd_cap_t::features, subbusd_req_hdr_t::iohdr, local_subbus_name, subbusd_cap_t::name, nl_error, sb_fd, sb_iov, SB_KW, subbusd_req_hdr_t::sb_kw, SBC_GETCAPS, SBRT_CAP, SBS_OK, send_to_subbusd(), subbus_features, SUBBUS_NAME_MAX, subbus_subfunction, SUBBUSD_MGRID, and subbusd_cap_t::subfunc.

Here is the call graph for this function:

int mread_subbus ( subbus_mread_req req,
unsigned short *  data 
)

Passes the raw command directly to the subbus driver and parses the return string for a multi-read. Up to n_read values will be written into the array pointed to by the data argument.

Returns:
Zero on success. If return value is negative, it is the error code returned by the subbusd driver and no values are reported. If it is positive (SBS_NOACK), it indicates that although the requested number of values are reported, at least one of the values did not have an acknowledge, and a zero value was reported.

Definition at line 392 of file subbus.c.

References subbusd_rep_t::data, subbusd_rep_t::mread, subbusd_mread_t::n_reads, subbus_mread_req::n_reads, nl_assert, subbus_mread_req::req_len, subbusd_mread_t::rvals, SBC_MREAD, SBRT_MREAD, and send_to_subbusd().

Here is the call graph for this function:

subbus_mread_req* pack_mread_request ( int  n_reads,
const char *  req 
)

Takes a multi-read <addr-list> string and invokes pack_mread().

Returns:
the newly allocated request structure.

Definition at line 509 of file subbus.c.

References nl_error, and pack_mread().

Here is the call graph for this function:

subbus_mread_req* pack_mread_requests ( unsigned int  addr,
  ... 
)

Takes a zero-terminated list of addresses, generates the appropriate text request string and invokes pack_mread().

Returns:
the newly allocated request structure.

Definition at line 440 of file subbus.c.

References n_reads, nl_assert, nl_error, and pack_mread().

Here is the call graph for this function:

int read_ack ( unsigned short  addr,
unsigned short *  data 
)
Returns:
non-zero if hardware read acknowledge was observed.

Definition at line 116 of file subbus.c.

References subbusd_rep_t::data, subbusd_req_data1::data, nl_error, SBC_READACK, SBRT_US, SBS_ACK, SBS_NOACK, SC_SB_LOWA, SC_SB_LOWB, SC_SB_LOWC, send_to_subbusd(), subbusd_rep_t::value, and WAIT_COUNT.

Referenced by incoming_sbreq(), read_subbus(), sbrb(), sbrba(), and sbrwa().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned short read_failure ( void  )

The value reported represents the current state of the indicator lights. As noted in read_switches(), the least significant bit is associated the the main "fail light" located in the cockpit. This light can be lit via set_failure() or the system controller's two minute timeout circuit. In either case, read_failure() will report the actual state of the light.

Returns:
The binary-encoded value of the indicator light settings.

Definition at line 327 of file subbus.c.

References read_special(), SBC_READFAIL, and SC_LAMP.

Referenced by incoming_sbreq().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned short read_subbus ( unsigned short  addr)

Definition at line 156 of file subbus.c.

References read_ack().

Referenced by sbrb().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned short read_switches ( void  )

Reads the positions of a dedicated set of system mode switches, usually located on a control panel on the instrument.

Returns:
The binary-encoded switch positions, or zero on error.

Definition at line 314 of file subbus.c.

References read_special(), SBC_READSW, and SC_SWITCHES.

Referenced by incoming_sbreq().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned short sbrb ( unsigned short  addr)

Definition at line 162 of file subbus.c.

References read_ack(), and read_subbus().

Referenced by service_expint().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned short sbrba ( unsigned short  addr)

Definition at line 171 of file subbus.c.

References read_ack().

Here is the call graph for this function:

unsigned int sbrwa ( unsigned short  addr)

Definition at line 181 of file subbus.c.

References read_ack().

Here is the call graph for this function:

int set_cmdenbl ( int  val)

Set cmdenbl value.

Returns:
non-zero on success. Zero if not supported.

don't need to serialize access to cmdenbl, since it's I/O port mapped.

Definition at line 263 of file subbus.c.

References SBC_SETCMDENBL, SC_CMDENBL, and send_CSF().

Referenced by incoming_sbreq().

Here is the call graph for this function:

Here is the caller graph for this function:

int set_cmdstrobe ( int  value)

Function did not exist at all before version 3.10, so programs intending to use this function should verify that the resident library version is at least 3.10. The feature word can also be checked for support, and that is consistent back to previous versions.

Parameters:
value1 turns on cmdstrobe, 0 turns off cmdstrobe
Returns:
non-zero on success, zero if operation isn't supported.

Function to set cmdstrobe value.

Parameters:
valnon-zero value asserts cmdstrobe.
Returns:
non-zero no success, zero if operation is not supported.

Function did not exist at all before version 3.10, so programs intending to use this function should verify that the resident library version is at least 3.10. The feature word can also be checked for support, and that is consistent back to previous versions.

Definition at line 276 of file subbus.c.

References SBC_SETCMDSTRB, SC_SB_LOWC, SC_SB_LOWCTRL, and send_CSF().

Referenced by incoming_sbreq().

Here is the call graph for this function:

Here is the caller graph for this function:

int set_failure ( unsigned short  value)

Sets the value of a dedicated set of indicator lights, usually located on a control panel on the instrument and/or in the cockpit of the aircraft. For each bit of the input argument, a non-zero value indicates the associated light should be on.

By convention, the least significant bit is associated with the main "fail light" located in the cockpit on aircraft instruments, indicating that the instrument is not acquiring data.. This light (and the associated bit value on readback) will also be set by the system controller's two minute timeout circuit.

See also:
read_failure()
Parameters:
valueBinary-encoded light settings.

Definition at line 295 of file subbus.c.

References SBC_SETFAIL, SC_LAMP, and send_CSF().

Referenced by incoming_sbreq().

Here is the call graph for this function:

Here is the caller graph for this function:

int subbus_int_attach ( char *  cardID,
unsigned short  address,
unsigned short  region,
struct sigevent *  event 
)

Definition at line 354 of file subbus.c.

References subbusd_req_data2::address, subbusd_req_data2::cardID, subbusd_req_data2::event, nl_assert, subbusd_req_data2::region, SBC_INTATT, SBRT_US, and send_to_subbusd().

Here is the call graph for this function:

int subbus_int_detach ( char *  cardID)

Definition at line 365 of file subbus.c.

References subbusd_req_data3::cardID, nl_assert, SBC_INTDET, SBRT_US, and send_to_subbusd().

Here is the call graph for this function:

int subbus_quit ( void  )

Requests subbusd to terminate. subbusd will wait until all connections are closed.

Returns:
SBS_OK on success.

Definition at line 377 of file subbus.c.

References sb_fd, SBC_QUIT, SBRT_NONE, and send_to_subbusd().

Here is the call graph for this function:

int tick_sic ( void  )

Historically, tick_sic() has been associated with two timers. The first is a 2-second timeout that can reboot the system. The second is a 2-minute timeout that lights the main fail light indicating that the instrument is not acquiring data.

It is unclear whether the new syscon_usb will support the reboot timer or rely on a motherboard-specific watchdog timer.

Definition at line 341 of file subbus.c.

References SBC_TICK, SBRT_NONE, SC_TICK, and send_to_subbusd().

Referenced by incoming_sbreq().

Here is the call graph for this function:

Here is the caller graph for this function:

int write_ack ( unsigned short  addr,
unsigned short  data 
)
Returns:
non-zero value if the hardware acknowledge is observed. Historically, the value recorded the number of iterations in the software loop waiting for the microsecond timeout.

Definition at line 195 of file subbus.c.

References subbusd_req_data0::address, subbusd_req_data0::data, nl_error, SBC_WRITEACK, SBRT_NONE, SBS_ACK, SBS_NOACK, SC_SB_LOWA, SC_SB_LOWB, SC_SB_LOWC, send_to_subbusd(), and WAIT_COUNT.

Referenced by incoming_sbreq().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

unsigned short subbus_features

Definition at line 24 of file subbus.c.

Referenced by load_subbus().

unsigned short subbus_subfunction

Definition at line 23 of file subbus.c.

Referenced by int_init(), int_reset(), and load_subbus().

unsigned short subbus_version

Definition at line 22 of file subbus.c.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines