📄 vardef.h
字号:
{
rs485 = 0x00,
modem = 0x01
};
enum false_bus_parameter /* "fdl_set_value" : if FDL-User sets false bus_parameter, */
/* application_block -> l_status = false_bus_parameter + iv; */
/* that means, high-fesponds with number of false parameter */
{
false_hsa = 0x100,
false_ts = 0x200,
false_station_type = 0x300,
false_baud_rate = 0x400,
false_medium_red = 0x500,
false_retry_ctr = 0x600,
false_default_sap = 0x700,
false_network_connection_sap = 0x800,
false_tsl = 0x900,
false_tqui = 0xa00,
false_tset = 0xb00,
false_min_tsdr = 0xc00,
false_max_tsdr = 0xd00,
false_ttr = 0xe00,
false_g = 0xf00,
false_in_ring_desired = 0x1000,
false_physical_layer = 0x1100,
false_ident = 0x1200
};
//-----------------------------------------------
typedef struct
{
#ifdef M_DOS
enum service_code code;
#else
short code;
#endif
}service;
typedef struct
{
UCHAR station;
UCHAR segment; // if no segment is used, set "NO_SEGMENT"
}remote_address;
typedef struct
{
void * buffer_ptr;
UCHAR length;
}link_service_data_unit;
typedef struct
{
UCHAR opcode; /* class of communication */
UCHAR subsystem; /* number of source-task (only necessary for MTK-user !!!!!) */
UWORD id; /* identification of FDL-USER */
service service; /* identification of service */
remote_address loc_add; /* only for network-connection !!! */
UCHAR ssap; /* source-service-access-point */
UCHAR dsap; /* destination-service-access-point */
remote_address rem_add; /* address of the remote-station */
#ifdef M_DOS
enum service_class serv_class; /* priority of service */
#else
short serv_class; /* priority of service */
#endif
link_service_data_unit receive_l_sdu; /* address and length of received netto-data, exception: */
UCHAR reserved1; /* (reserved for FDL !!!!!!!!!!) */
UCHAR reserved2; /* (reserved for FDL !!!!!!!!!!) */
link_service_data_unit send_l_sdu; /* address and length of send-netto-data, exception: */
/* 1. csrd : length means number of POLL-elements */
/* 2. await_indication : concatenation of application-blocks and */
/* withdraw_indication : number of application-blocks */
#ifdef M_DOS
enum link_status l_status; /* link-status of service or update_state for srd-indication */
#else
short l_status; /* link-status of service or update_state for srd-indication */
#endif
UCHAR reserved3[4]; /* for concatenated lists (reserved for FDL !!!!!!!!!!) */
}application_block;
typedef struct
{
UWORD reserved[2];
UCHAR length;
UWORD user;
UCHAR rb_type;
UCHAR priority;
UCHAR reserved_1;
UWORD reserved_2;
UCHAR subsystem;
UCHAR opcode;
UWORD response;
UWORD fill_length_1;
UCHAR reserved_3;
UWORD seg_length_1;
UWORD offset_1;
UWORD reserved_4;
UWORD fill_length_2;
UCHAR reserved_5;
UWORD seg_length_2;
UWORD offset_2;
UWORD reserved_6;
} rb2_header_type;
typedef struct
{
rb2_header_type rb2_header;
application_block application_block;
UCHAR reserved[12];
UCHAR reference[2];
UCHAR user_data_1[260];
UCHAR user_data_2[260];
} fdl_rb;
typedef fdl_rb flc_rb;
/* Moegliche Strukturen der Datenpuffer */
struct user_poll_element
{
UCHAR dsap; /* destination-service-access-point */
remote_address rem_add; /* address of the remote-station */
#ifdef M_DOS
enum service_class serv_class; /* priority of send-telegram */
#else
short serv_class; /* priority of send-telegram */
#endif
link_service_data_unit receive_l_sdu; /* request: length means buffer-length in byte */
/* confirm: length means length of received netto-data */
link_service_data_unit send_l_sdu; /* address and length of send-netto-data */
UCHAR reserved; /* reserved for FDL !!!!! */
#ifdef M_DOS
enum link_status l_status; /* link-status of poll-element-service */
enum poll_element_entry entry; /* locks or unlocks a poll-element */
#else
short l_status; /* link-status of poll-element-service */
short entry; /* locks or unlocks a poll-element */
#endif
UCHAR reserved_2; /* reserved for FDL !!!!! */
};
typedef struct ident
{
UCHAR reserved_header[8]; /* reserved for FDL !!!!! */
UBYTE ident[202];
UCHAR response_telegram_length; /* reserved for FDL !!!!! */
};
struct bus_parameter_block
{
UCHAR hsa; /* highest station-address */
/* range of values: 2 ... 126 */
UCHAR ts; /* FDL-address of this station */
/* range of values: 0 ... 126 */
#ifdef M_DOS
enum station_type stat_type; /* active, passive */
enum baud_rate Baud_Rate; /* transmission rate */
enum redundancy medium_red; /* availability of redundant media */
#else
short stat_type; /* active, passive */
short Baud_Rate; /* transmission rate */
short medium_red; /* availability of redundant media */
#endif
UWORD retry_ctr; /* retry-number of requestor, if no reaction of responder */
/* range of values: 1 ... 8 */
UCHAR default_sap; /* Default SAP if no address-extension is used */
/* range of values: 2 ... 62 */
UCHAR network_connection_sap;/* number of sap for network-connection (only for network-connections) */
/* range of values: 2 ... 62 */
UWORD tsl; /* SLOT-time: */
/* range of values: 2 exp 0 ... (2 exp 16) - 1 BIT-times */
UWORD tqui; /* Transmitter-Fall-Time / Repeater-Switch-Time: */
/* range of values: 0 ... (2 exp 8) - 1 BIT-times */
UWORD tset; /* setup-time */
/* range of values: 0 ... (2 exp 8) - 1 BIT-times */
UWORD min_tsdr; /* smallest STATION-DELAY-time: */
/* range of values: 2 exp 0 ... (2 exp 16) - 1 BIT-times */
UWORD max_tsdr; /* largest STATION-DELAY-time: */
/* range of values: 2 exp 0 ... (2 exp 16) - 1 BIT-times */
ULONG ttr; /* TARGET-ROTATION-time: */
/* range of values: 2 exp 0 ... (2 exp 24) - 1 BIT-times */
UCHAR g; /* GAP-UPDATE-factor: in multiples of ttr */
/* range_of_values: 1 ... 100 */
#ifdef M_DOS
flc_boolean in_ring_desired; /* request entrance into the token-ring */
enum physical_layer physical_layer; /* RS485, modem */
#else
short in_ring_desired; /* request entrance into the token-ring */
short physical_layer; /* RS485, modem */
#endif
struct ident ident; /* vendor-name, controller_type, version of hardware and software */
} bus_parameter_block;
struct fdl_sap
{
UWORD user_id; /* identification for user */
UCHAR max_l_sdu_length; /* maximal length of netto_data for this sap */
UCHAR access_sap; /* reserved destination_sap */
UCHAR access_station; /* reserved destination_address */
UCHAR access_segment; /* reserved destination_segment */
UCHAR sda; /* ... .sda = "ROLE"; sda unused by service "rsap_activate" */
UCHAR sdn; /* look sda; sdn unused by service "rsap_activate" */
UCHAR srd; /* look sda; */
UCHAR csrd; /* if you want to activate csrd for this SAP, type: ... .csrd = "ROLE"; */
/* (only INITIATOR or SERVICE_NOT_ACTIVATED possible) */
/* csrd unused by service "rsap_activate" */
void * rup_l_sdu_ptr_low; /* reserved for "sap_deactivate"; USER gets rup-buffer returned */
void * rup_l_sdu_ptr_high; /* reserved for "sap_deactivate"; USER gets rup-buffer returned */
UCHAR reserved[22]; /* reserved for FDL !!!!! */
};
struct fdl_l_stat
{
UCHAR access_station; /* reserved destination_address */
UCHAR reserved;
UCHAR sda; /* ... .sda = "ROLE"; sda unused by service "rsap_activate" */
UCHAR sdn; /* look sda; sdn unused by service "rsap_activate" */
UCHAR srd; /* look sda; */
UCHAR csrd; /* if you want to activate csrd for this SAP, type: ... .csrd = "ROLE"; */
};
/**********************************************************************/
/**************** fdl_event (returned by fma_indication) ************/
/**************** await_indication (for DSAP = EVENT_SAP)************/
/**********************************************************************/
struct event_ctr
{
UWORD threshold; /* if counter achieves threshold, a fma_indication is initiated */
UWORD counter;
};
struct event_indication
{
struct event_ctr time_out;
struct event_ctr not_syn;
struct event_ctr uart_error;
struct event_ctr out_of_ring;
struct event_ctr sdn_not_indicated;
struct event_ctr duplicate_address;
struct event_ctr hardware_error;
struct event_ctr mac_error;
UCHAR priority;
} ;
/**********************************************************************/
/**************** fdl_read_statistic_ctr ***************************/
/**********************************************************************/
struct statistic_ctr_list
{
/* error-counter */
UWORD invalid_start_delimiter_ctr;
UWORD invalid_fcb_fcv_ctr;
UWORD invalid_token_ctr;
UWORD collision_ctr;
UWORD wrong_fcs_or_ed_ctr;
UWORD frame_error_ctr;
UWORD char_error_ctr;
UWORD retry_ctr;
/* reference-counter */
ULONG start_delimiter_ctr;
ULONG stop_receive_ctr;
ULONG send_confirmed_ctr;
ULONG send_sdn_ctr;
};
#ifndef INLINE
#define INLINE __inline
#endif
#ifndef CHIP950
#define CHIP950 (DeviceExtension->chip_options&(~0xff))==0x16954000
#endif
#endif /*_VARDEF_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -