Chapter 6
Reporting KTx Scanner Status
6-5
Example 6.A
Declaration of Adapter Status Table
#define
UBYTE
unsigned char
#define
UBYTE
unsigned char
typedef struct
{
UBYTE
in_scan:1;
UBYTE
exists:1;
UBYTE
known:1;
UBYTE
size:2;
UBYTE
node_adapter:1;
UBYTE
undefined:2;
} ADAPTER_CONFIG_INFO;
typedef struct
{
UBYTE
fault_group_number:4;
UBYTE
in_fault_group:1;
UBYTE
adapter_online:1;
UBYTE
adapter_group_faulted:1;
UBYTE
undefined:1;
} ADAPTER_FAULT_INFO;
typedef struct
{
ADAPTER_CONFIG_INFO
adapter_config_info;
ADAPTER_FAULT_INFO
adapter_fault_info;
UBYTE
adapter_retry_count;
} ADAPTER_STATUS;
typedef struct
{
UBYTE boot_code[4];
UBYTE link_state;
UBYTE link_address;
UBYTE link_protocol;
UBYTE link_baud_rate;
UBYTE reserved1;
CONFIG_DATA
config_data;
UBYTE init_status;
RUNNING_STATUS
running_status;
UBYTE int_status_to_host;
UBYTE int_status_from_host;
UBYTE host_dead_counter;
UBYTE reset_diags_counters;
UBYTE reserved2[2];
UBYTE alive_flag;
UBYTE duplicate_node;
UBYTE off_ktx;
UBYTE stopped_flag;
UBYTE module_state;
UBYTE
COS_link_address;
UBYTE
reserved3[100];
UBYTE
num_adapter_addresses;
UBYTE
num_faulted_adapters;
OPERATING_STATUS
operating_status;
/**
*** Declare adapter status table as an array with 128
*** members, where each member has a configuration
*** byte, fault byte, and retry count byte.
**/
ADAPTER_STATUS
adapter_status_table[128];
COMMAND
cmd_buffer;
CONFIRMATION
confirmation_buffer;
UWORD
input_image_table[256];
UWORD
output_image_table[256];
} KTX_DUALPORT;