⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sdla_fr.h

📁 umon bootloader source code, support mips cpu.
💻 H
📖 第 1 页 / 共 2 页
字号:
	fpipemon_trc_hdr_t fpipemon_trc_hdr			PACKED;
        unsigned char data[FR_MAX_NO_DATA_BYTES_IN_FRAME]	PACKED;
} fpipemon_trc_t;

/* bit settings for the 'status' byte  - note that bits 1, 2 and 3 are used */
/* for returning the number of frames being passed to fpipemon */
#define TRC_OUTGOING_FRM	0x01
#define TRC_ABORT_ERROR         0x10
#define TRC_CRC_ERROR           0x20
#define TRC_OVERRUN_ERROR       0x40
#define MORE_TRC_DATA		0x80

#define MAX_FRMS_TRACED		0x07

#define NO_TRC_ELEMENTS_OFF		0x9000
#define BASE_TRC_ELEMENTS_OFF		0x9002
#define TRC_ACTIVE			0x01
#define FLUSH_TRC_BUFFERS 		0x02
#define FLUSH_TRC_STATISTICS		0x04
#define TRC_SIGNALLING_FRMS		0x10
#define TRC_INFO_FRMS			0x20
#define ACTIVATE_TRC	(TRC_ACTIVE | TRC_SIGNALLING_FRMS | TRC_INFO_FRMS)
#define RESET_TRC	(FLUSH_TRC_BUFFERS | FLUSH_TRC_STATISTICS)

/*----------------------------------------------------------------------------
 * Channel configuration.
 *	This structure is passed to the FR_SET_CONFIG command when dlci != 0.
 */
typedef struct	fr_dlc_conf
{
	unsigned short conf_flags	PACKED;	/* 00h: configuration bits */
	unsigned short cir_fwd		PACKED;	/* 02h:  */
	unsigned short bc_fwd		PACKED;	/* 04h:  */
	unsigned short be_fwd		PACKED;	/* 06h:  */
	unsigned short cir_bwd		PACKED;	/* 08h:  */
	unsigned short bc_bwd		PACKED;	/* 0Ah:  */
	unsigned short be_bwd		PACKED;	/* 0Ch:  */
} fr_dlc_conf_t;

/*----------------------------------------------------------------------------
 * S502 interrupt mode control block.
 *	This structure is passed to the FR_SET_INTR_FLAGS and returned by the
 *	FR_READ_INTR_FLAGS commands.
 */
typedef struct fr502_intr_ctl
{
	unsigned char mode	PACKED;	/* 00h: interrupt enable flags */
	unsigned short tx_len	PACKED;	/* 01h: required Tx buffer size */
} fr502_intr_ctl_t;

/*----------------------------------------------------------------------------
 * S508 interrupt mode control block.
 *	This structure is passed to the FR_SET_INTR_FLAGS and returned by the
 *	FR_READ_INTR_FLAGS commands.
 */
typedef struct fr508_intr_ctl
{
	unsigned char mode	PACKED;	/* 00h: interrupt enable flags */
	unsigned short tx_len	PACKED;	/* 01h: required Tx buffer size */
	unsigned char irq	PACKED;	/* 03h: IRQ level to activate */
	unsigned char flags	PACKED;	/* 04h: ?? */
	unsigned short timeout	PACKED;	/* 05h: ms, for timer interrupt */
} fr508_intr_ctl_t;

/*----------------------------------------------------------------------------
 * Channel status.
 *	This structure is returned by the FR_READ_STATUS command.
 */
typedef struct	fr_dlc_Status
{
	unsigned char status		PACKED;	/* 00h: link/DLCI status */
	struct
	{
		unsigned short dlci	PACKED;	/* 01h: DLCI number */
		unsigned char status	PACKED;	/* 03h: DLCI status */
	} circuit[1]			PACKED;
} fr_dlc_status_t;

/* 'status' defines */
#define	FR_LINK_INOPER	0x00		/* for global status (DLCI == 0) */
#define	FR_LINK_OPER	0x01
#define	FR_DLCI_DELETED	0x01		/* for circuit status (DLCI != 0) */
#define	FR_DLCI_ACTIVE	0x02
#define	FR_DLCI_WAITING	0x04
#define	FR_DLCI_NEW	0x08
#define	FR_DLCI_REPORT	0x40

/*----------------------------------------------------------------------------
 * Global Statistics Block.
 *	This structure is returned by the FR_READ_STATISTICS command when
 *	dcli == 0.
 */
typedef struct	fr_link_stat
{
	unsigned short rx_too_long	PACKED;	/* 00h:  */
	unsigned short rx_dropped	PACKED;	/* 02h:  */
	unsigned short rx_dropped2	PACKED;	/* 04h:  */
	unsigned short rx_bad_dlci	PACKED;	/* 06h:  */
	unsigned short rx_bad_format	PACKED;	/* 08h:  */
	unsigned short retransmitted	PACKED;	/* 0Ah:  */
	unsigned short cpe_tx_FSE	PACKED;	/* 0Ch:  */
	unsigned short cpe_tx_LIV	PACKED;	/* 0Eh:  */
	unsigned short cpe_rx_FSR	PACKED;	/* 10h:  */
	unsigned short cpe_rx_LIV	PACKED;	/* 12h:  */
	unsigned short node_rx_FSE	PACKED;	/* 14h:  */
	unsigned short node_rx_LIV	PACKED;	/* 16h:  */
	unsigned short node_tx_FSR	PACKED;	/* 18h:  */
	unsigned short node_tx_LIV	PACKED;	/* 1Ah:  */
	unsigned short rx_ISF_err	PACKED;	/* 1Ch:  */
	unsigned short rx_unsolicited	PACKED;	/* 1Eh:  */
	unsigned short rx_SSN_err	PACKED;	/* 20h:  */
	unsigned short rx_RSN_err	PACKED;	/* 22h:  */
	unsigned short T391_timeouts	PACKED;	/* 24h:  */
	unsigned short T392_timeouts	PACKED;	/* 26h:  */
	unsigned short N392_reached	PACKED;	/* 28h:  */
	unsigned short cpe_SSN_RSN	PACKED;	/* 2Ah:  */
	unsigned short current_SSN	PACKED;	/* 2Ch:  */
	unsigned short current_RSN	PACKED;	/* 2Eh:  */
	unsigned short curreny_T391	PACKED;	/* 30h:  */
	unsigned short current_T392	PACKED;	/* 32h:  */
	unsigned short current_N392	PACKED;	/* 34h:  */
	unsigned short current_N393	PACKED;	/* 36h:  */
} fr_link_stat_t;

/*----------------------------------------------------------------------------
 * DLCI statistics.
 *	This structure is returned by the FR_READ_STATISTICS command when
 *	dlci != 0.
 */
typedef struct	fr_dlci_stat
{
	unsigned long tx_frames		PACKED;	/* 00h:  */
	unsigned long tx_bytes		PACKED;	/* 04h:  */
	unsigned long rx_frames		PACKED;	/* 08h:  */
	unsigned long rx_bytes		PACKED;	/* 0Ch:  */
	unsigned long rx_dropped	PACKED;	/* 10h:  */
	unsigned long rx_inactive	PACKED;	/* 14h:  */
	unsigned long rx_exceed_CIR	PACKED;	/* 18h:  */
	unsigned long rx_DE_set		PACKED;	/* 1Ch:  */
	unsigned long tx_throughput	PACKED;	/* 20h:  */
	unsigned long tx_calc_timer	PACKED;	/* 24h:  */
	unsigned long rx_throughput	PACKED;	/* 28h:  */
	unsigned long rx_calc_timer	PACKED;	/* 2Ch:  */
} fr_dlci_stat_t;

/*----------------------------------------------------------------------------
 * Communications error statistics.
 *	This structure is returned by the FR_READ_ERROR_STATS command.
 */
typedef struct	fr_comm_stat
{
	unsigned char rx_overruns	PACKED;	/* 00h:  */
	unsigned char rx_bad_crc	PACKED;	/* 01h:  */
	unsigned char rx_aborts		PACKED;	/* 02h:  */
	unsigned char rx_too_long	PACKED;	/* 03h:  */
	unsigned char tx_aborts		PACKED;	/* 04h:  */
	unsigned char tx_underruns	PACKED;	/* 05h:  */
	unsigned char tx_missed_undr	PACKED;	/* 06h:  */
	unsigned char dcd_dropped	PACKED;	/* 07h:  */
	unsigned char cts_dropped	PACKED;	/* 08h:  */
} fr_comm_stat_t;

/*----------------------------------------------------------------------------
 * Defines for the FR_ISSUE_IS_FRAME command.
 */
#define	FR_ISF_LVE	2		/* issue Link Verification Enquiry */
#define	FR_ISF_FSE	3		/* issue Full Status Enquiry */

/*----------------------------------------------------------------------------
 * Frame Relay ARP Header -- Used for Dynamic route creation with InvARP 
 */

typedef struct arphdr_fr
	{
	unsigned short ar_hrd PACKED;		/* format of hardware addr */
	unsigned short ar_pro PACKED;		/* format of protocol addr */
	unsigned char  ar_hln PACKED;		/* length of hardware addr */	
	unsigned char  ar_pln PACKED;		/* length of protocol addr */
	unsigned short ar_op  PACKED;		/* ARP opcode		   */
	unsigned short ar_sha PACKED;		/* Sender DLCI addr 2 bytes */
	unsigned long  ar_sip PACKED;		/* Sender IP   addr 4 bytes */
	unsigned short ar_tha PACKED;		/* Target DLCI addr 2 bytes */
	unsigned long  ar_tip PACKED;		/* Target IP   addr 4 bytes */
	} arphdr_fr_t;

/*----------------------------------------------------------------------------
 * Frame Relay RFC 1490 SNAP Header -- Used to check for ARP packets
 */
typedef struct arphdr_1490
	{
	unsigned char control PACKED;		/* UI, etc...  */
	unsigned char pad     PACKED;		/* Pad */
	unsigned char NLPID   PACKED;		/* SNAP */
	unsigned char OUI[3]  PACKED;		/* Ethertype, etc... */
	unsigned short PID    PACKED;		/* ARP, IP, etc... */
	}  arphdr_1490_t;

/* UDP/IP packet (for UDP management) layout */

/* The embedded control block for UDP mgmt
   This is essentially a mailbox structure, without the large data field */

typedef struct {
        unsigned char  opp_flag PACKED; /* the opp flag */
        unsigned char  command  PACKED; /* command code */
        unsigned short length   PACKED; /* length of data buffer */
        unsigned char  result   PACKED; /* return code */
        unsigned short dlci     PACKED; /* DLCI number */
        unsigned char  attr     PACKED; /* FECN, BECN, DE and C/R bits */
        unsigned short rxlost1  PACKED; /* frames discarded at int. level */
        unsigned long  rxlost2  PACKED; /* frames discarded at app. level */
        unsigned char  rsrv[2]  PACKED; /* reserved for future use */
} cblock_t;


/* UDP management packet layout (data area of ip packet) */

typedef struct {
        unsigned char   control                 PACKED;
        unsigned char   NLPID                   PACKED;
} fr_encap_hdr_t;

typedef struct {
//	fr_encap_hdr_t 		fr_encap_hdr	PACKED;
	ip_pkt_t 		ip_pkt		PACKED;
	udp_pkt_t		udp_pkt		PACKED;
	wp_mgmt_t 		wp_mgmt       	PACKED;
        cblock_t                cblock          PACKED;
        unsigned char           data[4080]      PACKED;
} fr_udp_pkt_t;


/* valid ip_protocol for UDP management */
#define UDPMGMT_UDP_PROTOCOL 0x11

#define UDPMGMT_FPIPE_SIGNATURE         "FPIPE8ND"
#define UDPMGMT_DRVRSTATS_SIGNATURE     "DRVSTATS"

/* values for request/reply byte */
#define UDPMGMT_REQUEST	0x01
#define UDPMGMT_REPLY	0x02
#define UDP_OFFSET	12

typedef struct {
        unsigned long if_send_entry;
        unsigned long if_send_skb_null;
        unsigned long if_send_broadcast;
        unsigned long if_send_multicast;
        unsigned long if_send_critical_ISR;
        unsigned long if_send_critical_non_ISR;
        unsigned long if_send_busy;
        unsigned long if_send_busy_timeout;
	unsigned long if_send_DRVSTATS_request;
        unsigned long if_send_FPIPE_request;
        unsigned long if_send_wan_disconnected;
        unsigned long if_send_dlci_disconnected;
        unsigned long if_send_no_bfrs;
        unsigned long if_send_adptr_bfrs_full;
        unsigned long if_send_bfrs_passed_to_adptr;
	unsigned long if_send_consec_send_fail;
} drvstats_if_send_t; 

typedef struct {
        unsigned long rx_intr_no_socket;
        unsigned long rx_intr_dev_not_started;
        unsigned long rx_intr_DRVSTATS_request;
        unsigned long rx_intr_FPIPE_request;
        unsigned long rx_intr_bfr_not_passed_to_stack;
        unsigned long rx_intr_bfr_passed_to_stack;
 } drvstats_rx_intr_t;

typedef struct {
        unsigned long UDP_FPIPE_mgmt_kmalloc_err;
        unsigned long UDP_FPIPE_mgmt_direction_err;
        unsigned long UDP_FPIPE_mgmt_adptr_type_err;
        unsigned long UDP_FPIPE_mgmt_adptr_cmnd_OK;
        unsigned long UDP_FPIPE_mgmt_adptr_cmnd_timeout;
        unsigned long UDP_FPIPE_mgmt_adptr_send_passed;
        unsigned long UDP_FPIPE_mgmt_adptr_send_failed;
        unsigned long UDP_FPIPE_mgmt_not_passed_to_stack;
        unsigned long UDP_FPIPE_mgmt_passed_to_stack;
        unsigned long UDP_FPIPE_mgmt_no_socket;
        unsigned long UDP_DRVSTATS_mgmt_kmalloc_err;
        unsigned long UDP_DRVSTATS_mgmt_adptr_cmnd_OK;
        unsigned long UDP_DRVSTATS_mgmt_adptr_cmnd_timeout;
        unsigned long UDP_DRVSTATS_mgmt_adptr_send_passed;
        unsigned long UDP_DRVSTATS_mgmt_adptr_send_failed;
        unsigned long UDP_DRVSTATS_mgmt_not_passed_to_stack;
        unsigned long UDP_DRVSTATS_mgmt_passed_to_stack;
        unsigned long UDP_DRVSTATS_mgmt_no_socket;
} drvstats_gen_t;

typedef struct {
        unsigned char   attr      	PACKED;
        unsigned short  time_stamp      PACKED;
        unsigned char   reserved[13]    PACKED;
} api_rx_hdr_t;

typedef struct {
        api_rx_hdr_t    api_rx_hdr      PACKED;
        void *          data            PACKED;
} api_rx_element_t;

typedef struct {
        unsigned char   attr            PACKED;
        unsigned char   reserved[15]    PACKED;
} api_tx_hdr_t;

typedef struct {
        api_tx_hdr_t    api_tx_hdr      PACKED;
        void *          data            PACKED;
} api_tx_element_t;

#ifdef		_MSC_
#  pragma	pack()
#endif
#endif	/* _SDLA_FR_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -