1
0
Fork 0

[WAN]: Remove broken and unmaintained Sangoma drivers.

The in-kernel Sangoma drivers are both not compiling and marked as BROKEN
since at least kernel 2.6.0.

Sangoma offers out-of-tree drivers, and David Mandelstam told me Sangoma
does no longer maintain the in-kernel drivers and prefers to provide them
as a separate installation package.

This patch therefore removes these drivers.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
hifive-unleashed-5.1
Adrian Bunk 2006-04-11 17:28:33 -07:00 committed by David S. Miller
parent 7ad4d2f690
commit 8db60bcf30
20 changed files with 0 additions and 28009 deletions

View File

@ -3058,13 +3058,6 @@ M: khali@linux-fr.org
L: lm-sensors@lm-sensors.org
S: Odd Fixes
WAN ROUTER & SANGOMA WANPIPE DRIVERS & API (X.25, FRAME RELAY, PPP, CISCO HDLC)
P: Nenad Corbic
M: ncorbic@sangoma.com
M: dm@sangoma.com
W: http://www.sangoma.com
S: Supported
WATCHDOG DEVICE DRIVERS
P: Wim Van Sebroeck
M: wim@iguana.be

View File

@ -410,103 +410,6 @@ config WAN_ROUTER_DRIVERS
If unsure, say N.
config VENDOR_SANGOMA
tristate "Sangoma WANPIPE(tm) multiprotocol cards"
depends on WAN_ROUTER_DRIVERS && WAN_ROUTER && (PCI || ISA) && BROKEN
---help---
Driver for S514-PCI/ISA Synchronous Data Link Adapters (SDLA).
WANPIPE from Sangoma Technologies Inc. <http://www.sangoma.com/>
is a family of intelligent multiprotocol WAN adapters with data
transfer rates up to 4Mbps. Cards support:
- X.25, Frame Relay, PPP, Cisco HDLC protocols.
- API for protocols like HDLC (LAPB), HDLC Streaming, X.25,
Frame Relay and BiSync.
- Ethernet Bridging over Frame Relay protocol.
- MULTILINK PPP
- Async PPP (Modem Dialup)
The next questions will ask you about the protocols you want
the driver to support.
If you have one or more of these cards, say M to this option;
and read <file:Documentation/networking/wan-router.txt>.
To compile this driver as a module, choose M here: the
module will be called wanpipe.
config WANPIPE_CHDLC
bool "WANPIPE Cisco HDLC support"
depends on VENDOR_SANGOMA
---help---
Connect a WANPIPE card to a leased line using the Cisco HDLC.
- Supports Dual Port Cisco HDLC on the S514-PCI/S508-ISA cards
which allows user to build applications using the HDLC streaming API.
- CHDLC Streaming MULTILINK PPP that can bind multiple WANPIPE T1
cards into a single logical channel.
Say Y and the Cisco HDLC support, HDLC streaming API and
MULTILINK PPP will be included in the driver.
config WANPIPE_FR
bool "WANPIPE Frame Relay support"
depends on VENDOR_SANGOMA
help
Connect a WANPIPE card to a Frame Relay network, or use Frame Relay
API to develop custom applications.
Contains the Ethernet Bridging over Frame Relay feature, where
a WANPIPE frame relay link can be directly connected to the Linux
kernel bridge. The Frame Relay option is supported on S514-PCI
and S508-ISA cards.
Say Y and the Frame Relay support will be included in the driver.
config WANPIPE_X25
bool "WANPIPE X.25 support"
depends on VENDOR_SANGOMA
help
Connect a WANPIPE card to an X.25 network.
Includes the X.25 API support for custom applications over the
X.25 protocol. The X.25 option is supported on S514-PCI and
S508-ISA cards.
Say Y and the X.25 support will be included in the driver.
config WANPIPE_PPP
bool "WANPIPE PPP support"
depends on VENDOR_SANGOMA
help
Connect a WANPIPE card to a leased line using Point-to-Point
Protocol (PPP).
The PPP option is supported on S514-PCI/S508-ISA cards.
Say Y and the PPP support will be included in the driver.
config WANPIPE_MULTPPP
bool "WANPIPE Multi-Port PPP support"
depends on VENDOR_SANGOMA
help
Connect a WANPIPE card to a leased line using Point-to-Point
Protocol (PPP).
Uses in-kernel SyncPPP protocol over the Sangoma HDLC Streaming
adapter. In this case each Sangoma adapter port can support an
independent PPP connection. For example, a single Quad-Port PCI
adapter can support up to four independent PPP links. The PPP
option is supported on S514-PCI/S508-ISA cards.
Say Y and the Multi-Port PPP support will be included in the driver.
config CYCLADES_SYNC
tristate "Cyclom 2X(tm) cards (EXPERIMENTAL)"
depends on WAN_ROUTER_DRIVERS && (PCI || ISA)

View File

@ -5,14 +5,6 @@
# Rewritten to use lists instead of if-statements.
#
wanpipe-y := sdlamain.o sdla_ft1.o
wanpipe-$(CONFIG_WANPIPE_X25) += sdla_x25.o
wanpipe-$(CONFIG_WANPIPE_FR) += sdla_fr.o
wanpipe-$(CONFIG_WANPIPE_CHDLC) += sdla_chdlc.o
wanpipe-$(CONFIG_WANPIPE_PPP) += sdla_ppp.o
wanpipe-$(CONFIG_WANPIPE_MULTPPP) += wanpipe_multppp.o
wanpipe-objs := $(wanpipe-y)
cyclomx-y := cycx_main.o
cyclomx-$(CONFIG_CYCLOMX_X25) += cycx_x25.o
cyclomx-objs := $(cyclomx-y)
@ -43,11 +35,6 @@ obj-$(CONFIG_LANMEDIA) += lmc/
obj-$(CONFIG_DLCI) += dlci.o
obj-$(CONFIG_SDLA) += sdla.o
ifeq ($(CONFIG_WANPIPE_MULTPPP),y)
obj-$(CONFIG_VENDOR_SANGOMA) += sdladrv.o wanpipe.o syncppp.o
else
obj-$(CONFIG_VENDOR_SANGOMA) += sdladrv.o wanpipe.o
endif
obj-$(CONFIG_CYCLADES_SYNC) += cycx_drv.o cyclomx.o
obj-$(CONFIG_LAPBETHER) += lapbether.o
obj-$(CONFIG_SBNI) += sbni.o

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,345 +0,0 @@
/*****************************************************************************
* sdla_chdlc.c WANPIPE(tm) Multiprotocol WAN Link Driver. Cisco HDLC module.
*
* Authors: Nenad Corbic <ncorbic@sangoma.com>
* Gideon Hack
*
* Copyright: (c) 1995-1999 Sangoma Technologies Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
* ============================================================================
* Sep 30, 1999 Nenad Corbic Fixed dynamic IP and route setup.
* Sep 23, 1999 Nenad Corbic Added SMP support, fixed tracing
* Sep 13, 1999 Nenad Corbic Split up Port 0 and 1 into separate devices.
* Jun 02, 1999 Gideon Hack Added support for the S514 adapter.
* Oct 30, 1998 Jaspreet Singh Added Support for CHDLC API (HDLC STREAMING).
* Oct 28, 1998 Jaspreet Singh Added Support for Dual Port CHDLC.
* Aug 07, 1998 David Fong Initial version.
*****************************************************************************/
#include <linux/module.h>
#include <linux/kernel.h> /* printk(), and other useful stuff */
#include <linux/stddef.h> /* offsetof(), etc. */
#include <linux/errno.h> /* return codes */
#include <linux/string.h> /* inline memset(), etc. */
#include <linux/slab.h> /* kmalloc(), kfree() */
#include <linux/wanrouter.h> /* WAN router definitions */
#include <linux/wanpipe.h> /* WANPIPE common user API definitions */
#include <linux/if_arp.h> /* ARPHRD_* defines */
#include <linux/jiffies.h> /* time_after() macro */
#include <linux/inetdevice.h>
#include <asm/uaccess.h>
#include <linux/in.h> /* sockaddr_in */
#include <linux/inet.h>
#include <linux/if.h>
#include <asm/byteorder.h> /* htons(), etc. */
#include <linux/sdlapci.h>
#include <asm/io.h>
#include <linux/sdla_chdlc.h> /* CHDLC firmware API definitions */
/****** Defines & Macros ****************************************************/
/* reasons for enabling the timer interrupt on the adapter */
#define TMR_INT_ENABLED_UDP 0x0001
#define TMR_INT_ENABLED_UPDATE 0x0002
#define CHDLC_DFLT_DATA_LEN 1500 /* default MTU */
#define CHDLC_HDR_LEN 1
#define IFF_POINTTOPOINT 0x10
#define WANPIPE 0x00
#define API 0x01
#define CHDLC_API 0x01
#define PORT(x) (x == 0 ? "PRIMARY" : "SECONDARY" )
/******Data Structures*****************************************************/
/* This structure is placed in the private data area of the device structure.
* The card structure used to occupy the private area but now the following
* structure will incorporate the card structure along with CHDLC specific data
*/
typedef struct chdlc_private_area
{
struct net_device *slave;
sdla_t *card;
int TracingEnabled; /* For enabling Tracing */
unsigned long curr_trace_addr; /* Used for Tracing */
unsigned long start_trace_addr;
unsigned long end_trace_addr;
unsigned long base_addr_trace_buffer;
unsigned long end_addr_trace_buffer;
unsigned short number_trace_elements;
unsigned available_buffer_space;
unsigned long router_start_time;
unsigned char route_status;
unsigned char route_removed;
unsigned long tick_counter; /* For 5s timeout counter */
unsigned long router_up_time;
u32 IP_address; /* IP addressing */
u32 IP_netmask;
unsigned char mc; /* Mulitcast support on/off */
unsigned short udp_pkt_lgth; /* udp packet processing */
char udp_pkt_src;
char udp_pkt_data[MAX_LGTH_UDP_MGNT_PKT];
unsigned short timer_int_enabled;
char update_comms_stats; /* updating comms stats */
//FIXME: add driver stats as per frame relay!
} chdlc_private_area_t;
/* Route Status options */
#define NO_ROUTE 0x00
#define ADD_ROUTE 0x01
#define ROUTE_ADDED 0x02
#define REMOVE_ROUTE 0x03
/****** Function Prototypes *************************************************/
/* WAN link driver entry points. These are called by the WAN router module. */
static int wpft1_exec (struct sdla *card, void *u_cmd, void *u_data);
static int chdlc_read_version (sdla_t* card, char* str);
static int chdlc_error (sdla_t *card, int err, CHDLC_MAILBOX_STRUCT *mb);
/****** Public Functions ****************************************************/
/*============================================================================
* Cisco HDLC protocol initialization routine.
*
* This routine is called by the main WANPIPE module during setup. At this
* point adapter is completely initialized and firmware is running.
* o read firmware version (to make sure it's alive)
* o configure adapter
* o initialize protocol-specific fields of the adapter data space.
*
* Return: 0 o.k.
* < 0 failure.
*/
int wpft1_init (sdla_t* card, wandev_conf_t* conf)
{
unsigned char port_num;
int err;
union
{
char str[80];
} u;
volatile CHDLC_MAILBOX_STRUCT* mb;
CHDLC_MAILBOX_STRUCT* mb1;
unsigned long timeout;
/* Verify configuration ID */
if (conf->config_id != WANCONFIG_CHDLC) {
printk(KERN_INFO "%s: invalid configuration ID %u!\n",
card->devname, conf->config_id);
return -EINVAL;
}
/* Use primary port */
card->u.c.comm_port = 0;
/* Initialize protocol-specific fields */
if(card->hw.type != SDLA_S514){
card->mbox = (void *) card->hw.dpmbase;
}else{
card->mbox = (void *) card->hw.dpmbase + PRI_BASE_ADDR_MB_STRUCT;
}
mb = mb1 = card->mbox;
if (!card->configured){
/* The board will place an 'I' in the return code to indicate that it is
ready to accept commands. We expect this to be completed in less
than 1 second. */
timeout = jiffies;
while (mb->return_code != 'I') /* Wait 1s for board to initialize */
if (time_after(jiffies, timeout + 1*HZ)) break;
if (mb->return_code != 'I') {
printk(KERN_INFO
"%s: Initialization not completed by adapter\n",
card->devname);
printk(KERN_INFO "Please contact Sangoma representative.\n");
return -EIO;
}
}
/* Read firmware version. Note that when adapter initializes, it
* clears the mailbox, so it may appear that the first command was
* executed successfully when in fact it was merely erased. To work
* around this, we execute the first command twice.
*/
if (chdlc_read_version(card, u.str))
return -EIO;
printk(KERN_INFO "%s: Running FT1 Configuration firmware v%s\n",
card->devname, u.str);
card->isr = NULL;
card->poll = NULL;
card->exec = &wpft1_exec;
card->wandev.update = NULL;
card->wandev.new_if = NULL;
card->wandev.del_if = NULL;
card->wandev.state = WAN_DUALPORT;
card->wandev.udp_port = conf->udp_port;
card->wandev.new_if_cnt = 0;
/* This is for the ports link state */
card->u.c.state = WAN_DISCONNECTED;
/* reset the number of times the 'update()' proc has been called */
card->u.c.update_call_count = 0;
card->wandev.ttl = 0x7F;
card->wandev.interface = 0;
card->wandev.clocking = 0;
port_num = card->u.c.comm_port;
/* Setup Port Bps */
card->wandev.bps = 0;
card->wandev.mtu = MIN_LGTH_CHDLC_DATA_CFG;
/* Set up the interrupt status area */
/* Read the CHDLC Configuration and obtain:
* Ptr to shared memory infor struct
* Use this pointer to calculate the value of card->u.c.flags !
*/
mb1->buffer_length = 0;
mb1->command = READ_CHDLC_CONFIGURATION;
err = sdla_exec(mb1) ? mb1->return_code : CMD_TIMEOUT;
if(err != COMMAND_OK) {
chdlc_error(card, err, mb1);
return -EIO;
}
if(card->hw.type == SDLA_S514){
card->u.c.flags = (void *)(card->hw.dpmbase +
(((CHDLC_CONFIGURATION_STRUCT *)mb1->data)->
ptr_shared_mem_info_struct));
}else{
card->u.c.flags = (void *)(card->hw.dpmbase +
(((CHDLC_CONFIGURATION_STRUCT *)mb1->data)->
ptr_shared_mem_info_struct % SDLA_WINDOWSIZE));
}
card->wandev.state = WAN_FT1_READY;
printk(KERN_INFO "%s: FT1 Config Ready !\n",card->devname);
return 0;
}
static int wpft1_exec(sdla_t *card, void *u_cmd, void *u_data)
{
CHDLC_MAILBOX_STRUCT* mbox = card->mbox;
int len;
if (copy_from_user((void*)&mbox->command, u_cmd, sizeof(ft1_exec_cmd_t))){
return -EFAULT;
}
len = mbox->buffer_length;
if (len) {
if( copy_from_user((void*)&mbox->data, u_data, len)){
return -EFAULT;
}
}
/* execute command */
if (!sdla_exec(mbox)){
return -EIO;
}
/* return result */
if( copy_to_user(u_cmd, (void*)&mbox->command, sizeof(ft1_exec_cmd_t))){
return -EFAULT;
}
len = mbox->buffer_length;
if (len && u_data && copy_to_user(u_data, (void*)&mbox->data, len)){
return -EFAULT;
}
return 0;
}
/*============================================================================
* Read firmware code version.
* Put code version as ASCII string in str.
*/
static int chdlc_read_version (sdla_t* card, char* str)
{
CHDLC_MAILBOX_STRUCT* mb = card->mbox;
int len;
char err;
mb->buffer_length = 0;
mb->command = READ_CHDLC_CODE_VERSION;
err = sdla_exec(mb) ? mb->return_code : CMD_TIMEOUT;
if(err != COMMAND_OK) {
chdlc_error(card,err,mb);
}
else if (str) { /* is not null */
len = mb->buffer_length;
memcpy(str, mb->data, len);
str[len] = '\0';
}
return (err);
}
/*============================================================================
* Firmware error handler.
* This routine is called whenever firmware command returns non-zero
* return code.
*
* Return zero if previous command has to be cancelled.
*/
static int chdlc_error (sdla_t *card, int err, CHDLC_MAILBOX_STRUCT *mb)
{
unsigned cmd = mb->command;
switch (err) {
case CMD_TIMEOUT:
printk(KERN_ERR "%s: command 0x%02X timed out!\n",
card->devname, cmd);
break;
case S514_BOTH_PORTS_SAME_CLK_MODE:
if(cmd == SET_CHDLC_CONFIGURATION) {
printk(KERN_INFO
"%s: Configure both ports for the same clock source\n",
card->devname);
break;
}
default:
printk(KERN_INFO "%s: command 0x%02X returned 0x%02X!\n",
card->devname, cmd, err);
}
return 0;
}
MODULE_LICENSE("GPL");

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,226 +0,0 @@
/*****************************************************************************
* sdla_asy.h Header file for the Sangoma S508/S514 asynchronous code API
*
* Author: Gideon Hack
*
* Copyright: (c) 2000 Sangoma Technologies Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
* ============================================================================
*
* Jan 28, 2000 Gideon Hack Initial Version
*
*****************************************************************************/
#ifndef _WANPIPE_ASYNC_H
#define _WANPIPE_ASYNC_H
/* ----------------------------------------------------------------------------
* Interface commands
* --------------------------------------------------------------------------*/
#define SET_ASY_CONFIGURATION 0xE2 /* set the asychronous operational configuration */
#define READ_ASY_CONFIGURATION 0xE3 /* read the current asychronous operational configuration */
#define ENABLE_ASY_COMMUNICATIONS 0xE4 /* enable asychronous communications */
#define DISABLE_ASY_COMMUNICATIONS 0xE5 /* disable asychronous communications */
#define READ_ASY_OPERATIONAL_STATS 0xE7 /* retrieve the asychronous operational statistics */
#define FLUSH_ASY_OPERATIONAL_STATS 0xE8 /* flush the asychronous operational statistics */
#define TRANSMIT_ASY_BREAK_SIGNAL 0xEC /* transmit an asychronous break signal */
/* ----------------------------------------------------------------------------
* Return codes from interface commands
* --------------------------------------------------------------------------*/
#define COMMAND_INVALID_FOR_PORT 0x50 /* the command is invalid for the selected port */
#define DISABLE_ASY_COMMS_BEFORE_CFG 0xE1 /* communications must be disabled before setting the configuration */
#define ASY_COMMS_ENABLED 0xE1 /* communications are currently enabled */
#define ASY_COMMS_DISABLED 0xE1 /* communications are currently disabled */
#define ASY_CFG_BEFORE_COMMS_ENABLED 0xE2 /* perform a SET_ASY_CONFIGURATION before enabling comms */
#define LGTH_ASY_CFG_DATA_INVALID 0xE2 /* the length of the passed configuration data is invalid */
#define INVALID_ASY_CFG_DATA 0xE3 /* the passed configuration data is invalid */
#define ASY_BREAK_SIGNAL_BUSY 0xEC /* a break signal is being transmitted */
/* ----------------------------------------------------------------------------
* Constants for the SET_ASY_CONFIGURATION/READ_ASY_CONFIGURATION command
* --------------------------------------------------------------------------*/
/* the asynchronous configuration structure */
typedef struct {
unsigned long baud_rate PACKED; /* the baud rate */
unsigned short line_config_options PACKED; /* line configuration options */
unsigned short modem_config_options PACKED; /* modem configuration options */
unsigned short asy_API_options PACKED; /* asynchronous API options */
unsigned short asy_protocol_options PACKED; /* asynchronous protocol options */
unsigned short Tx_bits_per_char PACKED; /* number of bits per tx character */
unsigned short Rx_bits_per_char PACKED; /* number of bits per received character */
unsigned short stop_bits PACKED; /* number of stop bits per character */
unsigned short parity PACKED; /* parity definition */
unsigned short break_timer PACKED; /* the break signal timer */
unsigned short asy_Rx_inter_char_timer PACKED; /* the receive inter-character timer */
unsigned short asy_Rx_complete_length PACKED; /* the receive 'buffer complete' length */
unsigned short XON_char PACKED; /* the XON character */
unsigned short XOFF_char PACKED; /* the XOFF character */
unsigned short asy_statistics_options PACKED; /* async operational stat options */
unsigned long ptr_shared_mem_info_struct PACKED;/* ptr to the shared memory area information structure */
unsigned long ptr_asy_Tx_stat_el_cfg_struct PACKED;/* ptr to the transmit status element configuration structure */
unsigned long ptr_asy_Rx_stat_el_cfg_struct PACKED;/* ptr to the receive status element configuration structure */
} ASY_CONFIGURATION_STRUCT;
/* permitted minimum and maximum values for setting the asynchronous configuration */
#define MIN_ASY_BAUD_RATE 50 /* maximum baud rate */
#define MAX_ASY_BAUD_RATE 250000 /* minimum baud rate */
#define MIN_ASY_BITS_PER_CHAR 5 /* minimum number of bits per character */
#define MAX_ASY_BITS_PER_CHAR 8 /* maximum number of bits per character */
#define MIN_BREAK_TMR_VAL 0 /* minimum break signal timer */
#define MAX_BREAK_TMR_VAL 5000 /* maximum break signal timer */
#define MIN_ASY_RX_INTER_CHAR_TMR 0 /* minimum receive inter-character timer */
#define MAX_ASY_RX_INTER_CHAR_TMR 30000 /* maximum receive inter-character timer */
#define MIN_ASY_RX_CPLT_LENGTH 0 /* minimum receive 'length complete' value */
#define MAX_ASY_RX_CPLT_LENGTH 2000 /* maximum receive 'length complete' value */
/* bit settings for the 'asy_API_options' */
#define ASY_RX_DATA_TRANSPARENT 0x0001 /* do not strip parity and unused bits from received characters */
/* bit settings for the 'asy_protocol_options' */
#define ASY_RTS_HS_FOR_RX 0x0001 /* RTS handshaking is used for reception control */
#define ASY_XON_XOFF_HS_FOR_RX 0x0002 /* XON/XOFF handshaking is used for reception control */
#define ASY_XON_XOFF_HS_FOR_TX 0x0004 /* XON/XOFF handshaking is used for transmission control */
#define ASY_DCD_HS_FOR_TX 0x0008 /* DCD handshaking is used for transmission control */
#define ASY_CTS_HS_FOR_TX 0x0020 /* CTS handshaking is used for transmission control */
/* bit settings for the 'stop_bits' definition */
#define ONE_STOP_BIT 1 /* representation for 1 stop bit */
#define TWO_STOP_BITS 2 /* representation for 2 stop bits */
#define ONE_AND_A_HALF_STOP_BITS 3 /* representation for 1.5 stop bits */
/* bit settings for the 'parity' definition */
#define NO_PARITY 0 /* representation for no parity */
#define ODD_PARITY 1 /* representation for odd parity */
#define EVEN_PARITY 2 /* representation for even parity */
/* ----------------------------------------------------------------------------
* Constants for the READ_COMMS_ERROR_STATS command (asynchronous mode)
* --------------------------------------------------------------------------*/
/* the communications error statistics structure */
typedef struct {
unsigned short Rx_overrun_err_count PACKED; /* receiver overrun error count */
unsigned short Rx_parity_err_count PACKED; /* parity errors received count */
unsigned short Rx_framing_err_count PACKED; /* framing errors received count */
unsigned short comms_err_stat_reserved_1 PACKED;/* reserved for later use */
unsigned short comms_err_stat_reserved_2 PACKED;/* reserved for later use */
unsigned short comms_err_stat_reserved_3 PACKED;/* reserved for later use */
unsigned short comms_err_stat_reserved_4 PACKED;/* reserved for later use */
unsigned short comms_err_stat_reserved_5 PACKED;/* reserved for later use */
unsigned short DCD_state_change_count PACKED; /* DCD state change count */
unsigned short CTS_state_change_count PACKED; /* CTS state change count */
} ASY_COMMS_ERROR_STATS_STRUCT;
/* ----------------------------------------------------------------------------
* Constants for the READ_ASY_OPERATIONAL_STATS command
* --------------------------------------------------------------------------*/
/* the asynchronous operational statistics structure */
typedef struct {
/* Data transmission statistics */
unsigned long Data_blocks_Tx_count PACKED;/* number of blocks transmitted */
unsigned long Data_bytes_Tx_count PACKED;/* number of bytes transmitted */
unsigned long Data_Tx_throughput PACKED;/* transmit throughput */
unsigned long no_ms_for_Data_Tx_thruput_comp PACKED;/* millisecond time used for the Tx throughput computation */
unsigned long Tx_Data_discard_lgth_err_count PACKED;/* number of Data blocks discarded (length error) */
unsigned long reserved_Data_frm_Tx_stat1 PACKED;/* reserved for later use */
unsigned long reserved_Data_frm_Tx_stat2 PACKED;/* reserved for later use */
unsigned long reserved_Data_frm_Tx_stat3 PACKED;/* reserved for later use */
/* Data reception statistics */
unsigned long Data_blocks_Rx_count PACKED;/* number of blocks received */
unsigned long Data_bytes_Rx_count PACKED;/* number of bytes received */
unsigned long Data_Rx_throughput PACKED;/* receive throughput */
unsigned long no_ms_for_Data_Rx_thruput_comp PACKED;/* millisecond time used for the Rx throughput computation */
unsigned long Rx_Data_bytes_discard_count PACKED;/* received Data bytes discarded */
unsigned long reserved_Data_frm_Rx_stat1 PACKED;/* reserved for later use */
/* handshaking protocol statistics */
unsigned short XON_chars_Tx_count PACKED; /* number of XON characters transmitted */
unsigned short XOFF_chars_Tx_count PACKED; /* number of XOFF characters transmitted */
unsigned short XON_chars_Rx_count PACKED; /* number of XON characters received */
unsigned short XOFF_chars_Rx_count PACKED; /* number of XOFF characters received */
unsigned short Tx_halt_modem_low_count PACKED; /* number of times Tx halted (modem line low) */
unsigned short Rx_halt_RTS_low_count PACKED; /* number of times Rx halted by setting RTS low */
unsigned long reserved_handshaking_stat1 PACKED;/* reserved for later use */
/* break statistics */
unsigned short break_Tx_count PACKED; /* number of break sequences transmitted */
unsigned short break_Rx_count PACKED; /* number of break sequences received */
unsigned long reserved_break_stat1 PACKED;/* reserved for later use */
/* miscellaneous statistics */
unsigned long reserved_misc_stat1 PACKED; /* reserved for later use */
unsigned long reserved_misc_stat2 PACKED; /* reserved for later use */
} ASY_OPERATIONAL_STATS_STRUCT;
/* ----------------------------------------------------------------------------
* Constants for Data transmission
* --------------------------------------------------------------------------*/
/* the Data block transmit status element configuration structure */
typedef struct {
unsigned short number_Tx_status_elements PACKED; /* number of transmit status elements */
unsigned long base_addr_Tx_status_elements PACKED; /* base address of the transmit element list */
unsigned long next_Tx_status_element_to_use PACKED; /* pointer to the next transmit element to be used */
} ASY_TX_STATUS_EL_CFG_STRUCT;
/* the Data block transmit status element structure */
typedef struct {
unsigned char opp_flag PACKED; /* opp flag */
unsigned short data_length PACKED; /* length of the block to be transmitted */
unsigned char reserved_1 PACKED; /* reserved for internal use */
unsigned long reserved_2 PACKED; /* reserved for internal use */
unsigned long reserved_3 PACKED; /* reserved for internal use */
unsigned long ptr_data_bfr PACKED; /* pointer to the data area */
} ASY_DATA_TX_STATUS_EL_STRUCT;
/* ----------------------------------------------------------------------------
* Constants for Data reception
* --------------------------------------------------------------------------*/
/* the Data block receive status element configuration structure */
typedef struct {
unsigned short number_Rx_status_elements PACKED;/* number of receive status elements */
unsigned long base_addr_Rx_status_elements PACKED;/* base address of the receive element list */
unsigned long next_Rx_status_element_to_use PACKED;/* pointer to the next receive element to be used */
unsigned long base_addr_Rx_buffer PACKED;/* base address of the receive data buffer */
unsigned long end_addr_Rx_buffer PACKED;/* end address of the receive data buffer */
} ASY_RX_STATUS_EL_CFG_STRUCT;
/* the Data block receive status element structure */
typedef struct {
unsigned char opp_flag PACKED; /* opp flag */
unsigned short data_length PACKED; /* length of the received data block */
unsigned char reserved_1 PACKED; /* reserved for internal use */
unsigned short time_stamp PACKED; /* receive time stamp (HDLC_STREAMING_MODE) */
unsigned short data_buffered PACKED; /* the number of data bytes still buffered */
unsigned long reserved_2 PACKED; /* reserved for internal use */
unsigned long ptr_data_bfr PACKED; /* pointer to the data area */
} ASY_DATA_RX_STATUS_EL_STRUCT;
#endif

View File

@ -1,813 +0,0 @@
/*************************************************************************
sdla_chdlc.h Sangoma Cisco HDLC firmware API definitions
Author: Gideon Hack
Nenad Corbic <ncorbic@sangoma.com>
Copyright: (c) 1995-2000 Sangoma Technologies Inc.
This program is free software; you can redistribute it and/or
modify it under the term of the GNU General Public License
as published by the Free Software Foundation; either version
2 of the License, or (at your option) any later version.
===========================================================================
Oct 04, 1999 Nenad Corbic Updated API support
Jun 02, 1999 Gideon Hack Changes for S514 usage.
Oct 28, 1998 Jaspreet Singh Made changes for Dual Port CHDLC.
Jun 11, 1998 David Fong Initial version.
===========================================================================
Organization
- Compatibility notes
- Constants defining the shared memory control block (mailbox)
- Interface commands
- Return code from interface commands
- Constants for the commands (structures for casting data)
- UDP Management constants and structures
*************************************************************************/
#ifndef _SDLA_CHDLC_H
# define _SDLC_CHDLC_H
/*------------------------------------------------------------------------
Notes:
All structres defined in this file are byte-aligned.
Compiler Platform
------------------------
GNU C Linux
------------------------------------------------------------------------*/
#ifndef PACKED
#define PACKED __attribute__((packed))
#endif /* PACKED */
/* ----------------------------------------------------------------------------
* Constants defining the shared memory control block (mailbox)
* --------------------------------------------------------------------------*/
#define PRI_BASE_ADDR_MB_STRUCT 0xE000 /* the base address of the mailbox structure on the adapter */
#define SEC_BASE_ADDR_MB_STRUCT 0xE800 /* the base address of the mailbox structure on the adapter */
#define SIZEOF_MB_DATA_BFR 2032 /* the size of the actual mailbox data area */
#define NUMBER_MB_RESERVED_BYTES 0x0B /* the number of reserved bytes in the mailbox header area */
#define MIN_LGTH_CHDLC_DATA_CFG 300 /* min length of the CHDLC data field (for configuration purposes) */
#define PRI_MAX_NO_DATA_BYTES_IN_FRAME 15354 /* PRIMARY - max length of the CHDLC data field */
typedef struct {
unsigned char opp_flag PACKED; /* the opp flag */
unsigned char command PACKED; /* the user command */
unsigned short buffer_length PACKED; /* the data length */
unsigned char return_code PACKED; /* the return code */
unsigned char MB_reserved[NUMBER_MB_RESERVED_BYTES] PACKED; /* reserved for later */
unsigned char data[SIZEOF_MB_DATA_BFR] PACKED; /* the data area */
} CHDLC_MAILBOX_STRUCT;
typedef struct {
pid_t pid_num PACKED;
CHDLC_MAILBOX_STRUCT cmdarea PACKED;
} CMDBLOCK_STRUCT;
/* ----------------------------------------------------------------------------
* Interface commands
* --------------------------------------------------------------------------*/
/* global interface commands */
#define READ_GLOBAL_EXCEPTION_CONDITION 0x01
#define SET_GLOBAL_CONFIGURATION 0x02
#define READ_GLOBAL_CONFIGURATION 0x03
#define READ_GLOBAL_STATISTICS 0x04
#define FLUSH_GLOBAL_STATISTICS 0x05
#define SET_MODEM_STATUS 0x06 /* set status of DTR or RTS */
#define READ_MODEM_STATUS 0x07 /* read status of CTS and DCD */
#define READ_COMMS_ERROR_STATS 0x08
#define FLUSH_COMMS_ERROR_STATS 0x09
#define SET_TRACE_CONFIGURATION 0x0A /* set the line trace config */
#define READ_TRACE_CONFIGURATION 0x0B /* read the line trace config */
#define READ_TRACE_STATISTICS 0x0C /* read the trace statistics */
#define FLUSH_TRACE_STATISTICS 0x0D /* flush the trace statistics */
#define FT1_MONITOR_STATUS_CTRL 0x1C /* set the status of the S508/FT1 monitoring */
#define SET_FT1_CONFIGURATION 0x18 /* set the FT1 configuration */
#define READ_FT1_CONFIGURATION 0x19 /* read the FT1 configuration */
#define TRANSMIT_ASYNC_DATA_TO_FT1 0x1A /* output asynchronous data to the FT1 */
#define RECEIVE_ASYNC_DATA_FROM_FT1 0x1B /* receive asynchronous data from the FT1 */
#define FT1_MONITOR_STATUS_CTRL 0x1C /* set the status of the FT1 monitoring */
#define READ_FT1_OPERATIONAL_STATS 0x1D /* read the S508/FT1 operational statistics */
#define SET_FT1_MODE 0x1E /* set the operational mode of the S508/FT1 module */
/* CHDLC-level interface commands */
#define READ_CHDLC_CODE_VERSION 0x20
#define READ_CHDLC_EXCEPTION_CONDITION 0x21 /* read exception condition from the adapter */
#define SET_CHDLC_CONFIGURATION 0x22
#define READ_CHDLC_CONFIGURATION 0x23
#define ENABLE_CHDLC_COMMUNICATIONS 0x24
#define DISABLE_CHDLC_COMMUNICATIONS 0x25
#define READ_CHDLC_LINK_STATUS 0x26
#define READ_CHDLC_OPERATIONAL_STATS 0x27
#define FLUSH_CHDLC_OPERATIONAL_STATS 0x28
#define SET_CHDLC_INTERRUPT_TRIGGERS 0x30 /* set application interrupt triggers */
#define READ_CHDLC_INTERRUPT_TRIGGERS 0x31 /* read application interrupt trigger configuration */
/* Special UDP drivers management commands */
#define CPIPE_ENABLE_TRACING 0x50
#define CPIPE_DISABLE_TRACING 0x51
#define CPIPE_GET_TRACE_INFO 0x52
#define CPIPE_GET_IBA_DATA 0x53
#define CPIPE_FT1_READ_STATUS 0x54
#define CPIPE_DRIVER_STAT_IFSEND 0x55
#define CPIPE_DRIVER_STAT_INTR 0x56
#define CPIPE_DRIVER_STAT_GEN 0x57
#define CPIPE_FLUSH_DRIVER_STATS 0x58
#define CPIPE_ROUTER_UP_TIME 0x59
/* Driver specific commands for API */
#define CHDLC_READ_TRACE_DATA 0xE4 /* read trace data */
#define TRACE_ALL 0x00
#define TRACE_PROT 0x01
#define TRACE_DATA 0x02
#define DISCARD_RX_ERROR_FRAMES 0x0001
/* ----------------------------------------------------------------------------
* Return codes from interface commands
* --------------------------------------------------------------------------*/
#define COMMAND_OK 0x00
/* return codes from global interface commands */
#define NO_GLOBAL_EXCEP_COND_TO_REPORT 0x01 /* there is no CHDLC exception condition to report */
#define LGTH_GLOBAL_CFG_DATA_INVALID 0x01 /* the length of the passed global configuration data is invalid */
#define LGTH_TRACE_CFG_DATA_INVALID 0x01 /* the length of the passed trace configuration data is invalid */
#define IRQ_TIMEOUT_VALUE_INVALID 0x02 /* an invalid application IRQ timeout value was selected */
#define TRACE_CONFIG_INVALID 0x02 /* the passed line trace configuration is invalid */
#define ADAPTER_OPERATING_FREQ_INVALID 0x03 /* an invalid adapter operating frequency was selected */
#define TRC_DEAC_TMR_INVALID 0x03 /* the trace deactivation timer is invalid */
#define S508_FT1_ADPTR_NOT_PRESENT 0x0C /* the S508/FT1 adapter is not present */
#define INVALID_FT1_STATUS_SELECTION 0x0D /* the S508/FT1 status selection is invalid */
#define FT1_OP_STATS_NOT_ENABLED 0x0D /* the FT1 operational statistics have not been enabled */
#define FT1_OP_STATS_NOT_AVAILABLE 0x0E /* the FT1 operational statistics are not currently available */
#define S508_FT1_MODE_SELECTION_BUSY 0x0E /* the S508/FT1 adapter is busy selecting the operational mode */
/* return codes from command READ_GLOBAL_EXCEPTION_CONDITION */
#define EXCEP_MODEM_STATUS_CHANGE 0x10 /* a modem status change occurred */
#define EXCEP_TRC_DISABLED 0x11 /* the trace has been disabled */
#define EXCEP_IRQ_TIMEOUT 0x12 /* IRQ timeout */
/* return codes from CHDLC-level interface commands */
#define NO_CHDLC_EXCEP_COND_TO_REPORT 0x21 /* there is no CHDLC exception condition to report */
#define CHDLC_COMMS_DISABLED 0x21 /* communications are not currently enabled */
#define CHDLC_COMMS_ENABLED 0x21 /* communications are currently enabled */
#define DISABLE_CHDLC_COMMS_BEFORE_CFG 0x21 /* CHDLC communications must be disabled before setting the configuration */
#define ENABLE_CHDLC_COMMS_BEFORE_CONN 0x21 /* communications must be enabled before using the CHDLC_CONNECT conmmand */
#define CHDLC_CFG_BEFORE_COMMS_ENABLED 0x22 /* perform a SET_CHDLC_CONFIGURATION before enabling comms */
#define LGTH_CHDLC_CFG_DATA_INVALID 0x22 /* the length of the passed CHDLC configuration data is invalid */
#define LGTH_INT_TRIGGERS_DATA_INVALID 0x22 /* the length of the passed interrupt trigger data is invalid */
#define INVALID_IRQ_SELECTED 0x23 /* in invalid IRQ was selected in the SET_CHDLC_INTERRUPT_TRIGGERS */
#define INVALID_CHDLC_CFG_DATA 0x23 /* the passed CHDLC configuration data is invalid */
#define IRQ_TMR_VALUE_INVALID 0x24 /* an invalid application IRQ timer value was selected */
#define LARGER_PERCENT_TX_BFR_REQUIRED 0x24 /* a larger Tx buffer percentage is required */
#define LARGER_PERCENT_RX_BFR_REQUIRED 0x25 /* a larger Rx buffer percentage is required */
#define S514_BOTH_PORTS_SAME_CLK_MODE 0x26 /* S514 - both ports must have same clock mode */
#define INVALID_CMND_HDLC_STREAM_MODE 0x4E /* the CHDLC interface command is invalid for HDLC streaming mode */
#define INVALID_CHDLC_COMMAND 0x4F /* the defined CHDLC interface command is invalid */
/* return codes from command READ_CHDLC_EXCEPTION_CONDITION */
#define EXCEP_LINK_ACTIVE 0x30 /* the CHDLC link has become active */
#define EXCEP_LINK_INACTIVE_MODEM 0x31 /* the CHDLC link has become inactive (modem status) */
#define EXCEP_LINK_INACTIVE_KPALV 0x32 /* the CHDLC link has become inactive (keepalive status) */
#define EXCEP_IP_ADDRESS_DISCOVERED 0x33 /* the IP address has been discovered */
#define EXCEP_LOOPBACK_CONDITION 0x34 /* a loopback condition has occurred */
/* return code from command CHDLC_SEND_WAIT and CHDLC_SEND_NO_WAIT */
#define LINK_DISCONNECTED 0x21
#define NO_TX_BFRS_AVAIL 0x24
/* ----------------------------------------------------------------------------
* Constants for the SET_GLOBAL_CONFIGURATION/READ_GLOBAL_CONFIGURATION commands
* --------------------------------------------------------------------------*/
/* the global configuration structure */
typedef struct {
unsigned short adapter_config_options PACKED; /* adapter config options */
unsigned short app_IRQ_timeout PACKED; /* application IRQ timeout */
unsigned long adapter_operating_frequency PACKED; /* adapter operating frequency */
} GLOBAL_CONFIGURATION_STRUCT;
/* settings for the 'app_IRQ_timeout' */
#define MAX_APP_IRQ_TIMEOUT_VALUE 5000 /* the maximum permitted IRQ timeout */
/* ----------------------------------------------------------------------------
* Constants for the READ_GLOBAL_STATISTICS command
* --------------------------------------------------------------------------*/
/* the global statistics structure */
typedef struct {
unsigned short app_IRQ_timeout_count PACKED;
} GLOBAL_STATS_STRUCT;
/* ----------------------------------------------------------------------------
* Constants for the READ_COMMS_ERROR_STATS command
* --------------------------------------------------------------------------*/
/* the communications error statistics structure */
typedef struct {
unsigned short Rx_overrun_err_count PACKED;
unsigned short CRC_err_count PACKED; /* receiver CRC error count */
unsigned short Rx_abort_count PACKED; /* abort frames recvd count */
unsigned short Rx_dis_pri_bfrs_full_count PACKED;/* receiver disabled */
unsigned short comms_err_stat_reserved_1 PACKED;/* reserved for later */
unsigned short sec_Tx_abort_msd_Tx_int_count PACKED; /* secondary - abort frames transmitted count (missed Tx interrupt) */
unsigned short missed_Tx_und_int_count PACKED; /* missed tx underrun interrupt count */
unsigned short sec_Tx_abort_count PACKED; /*secondary-abort frames tx count */
unsigned short DCD_state_change_count PACKED; /* DCD state change */
unsigned short CTS_state_change_count PACKED; /* CTS state change */
} COMMS_ERROR_STATS_STRUCT;
/* ----------------------------------------------------------------------------
* Constants used for line tracing
* --------------------------------------------------------------------------*/
/* the trace configuration structure (SET_TRACE_CONFIGURATION/READ_TRACE_CONFIGURATION commands) */
typedef struct {
unsigned char trace_config PACKED; /* trace configuration */
unsigned short trace_deactivation_timer PACKED; /* trace deactivation timer */
unsigned long ptr_trace_stat_el_cfg_struct PACKED; /* a pointer to the line trace element configuration structure */
} LINE_TRACE_CONFIG_STRUCT;
/* 'trace_config' bit settings */
#define TRACE_INACTIVE 0x00 /* trace is inactive */
#define TRACE_ACTIVE 0x01 /* trace is active */
#define TRACE_DELAY_MODE 0x04 /* operate the trace in delay mode */
#define TRACE_DATA_FRAMES 0x08 /* trace Data frames */
#define TRACE_SLARP_FRAMES 0x10 /* trace SLARP frames */
#define TRACE_CDP_FRAMES 0x20 /* trace CDP frames */
/* the line trace status element configuration structure */
typedef struct {
unsigned short number_trace_status_elements PACKED; /* number of line trace elements */
unsigned long base_addr_trace_status_elements PACKED; /* base address of the trace element list */
unsigned long next_trace_element_to_use PACKED; /* pointer to the next trace element to be used */
unsigned long base_addr_trace_buffer PACKED; /* base address of the trace data buffer */
unsigned long end_addr_trace_buffer PACKED; /* end address of the trace data buffer */
} TRACE_STATUS_EL_CFG_STRUCT;
/* the line trace status element structure */
typedef struct {
unsigned char opp_flag PACKED; /* opp flag */
unsigned short trace_length PACKED; /* trace length */
unsigned char trace_type PACKED; /* trace type */
unsigned short trace_time_stamp PACKED; /* time stamp */
unsigned short trace_reserved_1 PACKED; /* reserved for later use */
unsigned long trace_reserved_2 PACKED; /* reserved for later use */
unsigned long ptr_data_bfr PACKED; /* ptr to the trace data buffer */
} TRACE_STATUS_ELEMENT_STRUCT;
/* "trace_type" bit settings */
#define TRACE_INCOMING 0x00
#define TRACE_OUTGOINGING 0x01
#define TRACE_INCOMING_ABORTED 0x10
#define TRACE_INCOMING_CRC_ERROR 0x20
#define TRACE_INCOMING_OVERRUN_ERROR 0x40
/* the line trace statistics structure */
typedef struct {
unsigned long frames_traced_count PACKED; /* number of frames traced */
unsigned long trc_frms_not_recorded_count PACKED; /* number of trace frames discarded */
} LINE_TRACE_STATS_STRUCT;
/* ----------------------------------------------------------------------------
* Constants for the FT1_MONITOR_STATUS_CTRL command
* --------------------------------------------------------------------------*/
#define DISABLE_FT1_STATUS_STATISTICS 0x00 /* disable the FT1 status and statistics monitoring */
#define ENABLE_READ_FT1_STATUS 0x01 /* read the FT1 operational status */
#define ENABLE_READ_FT1_OP_STATS 0x02 /* read the FT1 operational statistics */
#define FLUSH_FT1_OP_STATS 0x04 /* flush the FT1 operational statistics */
/* ----------------------------------------------------------------------------
* Constants for the SET_CHDLC_CONFIGURATION command
* --------------------------------------------------------------------------*/
/* the CHDLC configuration structure */
typedef struct {
unsigned long baud_rate PACKED; /* the baud rate */
unsigned short line_config_options PACKED; /* line configuration options */
unsigned short modem_config_options PACKED; /* modem configration options */
unsigned short modem_status_timer PACKED; /* timer for monitoring modem status changes */
unsigned short CHDLC_API_options PACKED; /* CHDLC API options */
unsigned short CHDLC_protocol_options PACKED; /* CHDLC protocol options */
unsigned short percent_data_buffer_for_Tx PACKED; /* percentage data buffering used for Tx */
unsigned short CHDLC_statistics_options PACKED; /* CHDLC operational statistics options */
unsigned short max_CHDLC_data_field_length PACKED; /* the maximum length of the CHDLC Data field */
unsigned short transmit_keepalive_timer PACKED; /* the transmit keepalive timer */
unsigned short receive_keepalive_timer PACKED; /* the receive keepalive timer */
unsigned short keepalive_error_tolerance PACKED; /* the receive keepalive error tolerance */
unsigned short SLARP_request_timer PACKED; /* the SLARP request timer */
unsigned long IP_address PACKED; /* the IP address */
unsigned long IP_netmask PACKED; /* the IP netmask */
unsigned long ptr_shared_mem_info_struct PACKED; /* a pointer to the shared memory area information structure */
unsigned long ptr_CHDLC_Tx_stat_el_cfg_struct PACKED; /* a pointer to the transmit status element configuration structure */
unsigned long ptr_CHDLC_Rx_stat_el_cfg_struct PACKED; /* a pointer to the receive status element configuration structure */
} CHDLC_CONFIGURATION_STRUCT;
/* settings for the 'line_config_options' */
#define INTERFACE_LEVEL_V35 0x0000 /* V.35 interface level */
#define INTERFACE_LEVEL_RS232 0x0001 /* RS-232 interface level */
/* settings for the 'modem_config_options' */
#define DONT_RAISE_DTR_RTS_ON_EN_COMMS 0x0001
/* don't automatically raise DTR and RTS when performing an
ENABLE_CHDLC_COMMUNICATIONS command */
#define DONT_REPORT_CHG_IN_MODEM_STAT 0x0002
/* don't report changes in modem status to the application */
/* bit settings for the 'CHDLC_protocol_options' byte */
#define IGNORE_DCD_FOR_LINK_STAT 0x0001
/* ignore DCD in determining the CHDLC link status */
#define IGNORE_CTS_FOR_LINK_STAT 0x0002
/* ignore CTS in determining the CHDLC link status */
#define IGNORE_KPALV_FOR_LINK_STAT 0x0004
/* ignore keepalive frames in determining the CHDLC link status */
#define SINGLE_TX_BUFFER 0x4000
/* configure a single transmit buffer */
#define HDLC_STREAMING_MODE 0x8000
/* settings for the 'CHDLC_statistics_options' */
#define CHDLC_TX_DATA_BYTE_COUNT_STAT 0x0001
/* record the number of Data bytes transmitted */
#define CHDLC_RX_DATA_BYTE_COUNT_STAT 0x0002
/* record the number of Data bytes received */
#define CHDLC_TX_THROUGHPUT_STAT 0x0004
/* compute the Data frame transmit throughput */
#define CHDLC_RX_THROUGHPUT_STAT 0x0008
/* compute the Data frame receive throughput */
/* permitted minimum and maximum values for setting the CHDLC configuration */
#define PRI_MAX_BAUD_RATE_S508 2666666 /* PRIMARY - maximum baud rate (S508) */
#define SEC_MAX_BAUD_RATE_S508 258064 /* SECONDARY - maximum baud rate (S508) */
#define PRI_MAX_BAUD_RATE_S514 2750000 /* PRIMARY - maximum baud rate (S508) */
#define SEC_MAX_BAUD_RATE_S514 515625 /* SECONDARY - maximum baud rate (S508) */
#define MIN_MODEM_TIMER 0 /* minimum modem status timer */
#define MAX_MODEM_TIMER 5000 /* maximum modem status timer */
#define SEC_MAX_NO_DATA_BYTES_IN_FRAME 2048 /* SECONDARY - max length of the CHDLC data field */
#define MIN_Tx_KPALV_TIMER 0 /* minimum transmit keepalive timer */
#define MAX_Tx_KPALV_TIMER 60000 /* maximum transmit keepalive timer */
#define DEFAULT_Tx_KPALV_TIMER 10000 /* default transmit keepalive timer */
#define MIN_Rx_KPALV_TIMER 10 /* minimum receive keepalive timer */
#define MAX_Rx_KPALV_TIMER 60000 /* maximum receive keepalive timer */
#define DEFAULT_Rx_KPALV_TIMER 10000 /* default receive keepalive timer */
#define MIN_KPALV_ERR_TOL 1 /* min kpalv error tolerance count */
#define MAX_KPALV_ERR_TOL 20 /* max kpalv error tolerance count */
#define DEFAULT_KPALV_ERR_TOL 3 /* default value */
#define MIN_SLARP_REQ_TIMER 0 /* min transmit SLARP Request timer */
#define MAX_SLARP_REQ_TIMER 60000 /* max transmit SLARP Request timer */
#define DEFAULT_SLARP_REQ_TIMER 0 /* default value -- no SLARP */
/* ----------------------------------------------------------------------------
* Constants for the READ_CHDLC_LINK_STATUS command
* --------------------------------------------------------------------------*/
/* the CHDLC status structure */
typedef struct {
unsigned char CHDLC_link_status PACKED; /* CHDLC link status */
unsigned char no_Data_frms_for_app PACKED; /* number of Data frames available for the application */
unsigned char receiver_status PACKED; /* enabled/disabled */
unsigned char SLARP_state PACKED; /* internal SLARP state */
} CHDLC_LINK_STATUS_STRUCT;
/* settings for the 'CHDLC_link_status' variable */
#define CHDLC_LINK_INACTIVE 0x00 /* the CHDLC link is inactive */
#define CHDLC_LINK_ACTIVE 0x01 /* the CHDLC link is active */
/* ----------------------------------------------------------------------------
* Constants for the READ_CHDLC_OPERATIONAL_STATS command
* --------------------------------------------------------------------------*/
/* the CHDLC operational statistics structure */
typedef struct {
/* Data frame transmission statistics */
unsigned long Data_frames_Tx_count PACKED; /* # of frames transmitted */
unsigned long Data_bytes_Tx_count PACKED; /* # of bytes transmitted */
unsigned long Data_Tx_throughput PACKED; /* transmit throughput */
unsigned long no_ms_for_Data_Tx_thruput_comp PACKED; /* millisecond time used for the Tx throughput computation */
unsigned long Tx_Data_discard_lgth_err_count PACKED; /* number of Data frames discarded (length error) */
unsigned long reserved_Data_frm_Tx_stat1 PACKED; /* reserved for later */
unsigned long reserved_Data_frm_Tx_stat2 PACKED; /* reserved for later */
unsigned long reserved_Data_frm_Tx_stat3 PACKED; /* reserved for later */
/* Data frame reception statistics */
unsigned long Data_frames_Rx_count PACKED; /* number of frames received */
unsigned long Data_bytes_Rx_count PACKED; /* number of bytes received */
unsigned long Data_Rx_throughput PACKED; /* receive throughput */
unsigned long no_ms_for_Data_Rx_thruput_comp PACKED; /* millisecond time used for the Rx throughput computation */
unsigned long Rx_Data_discard_short_count PACKED; /* received Data frames discarded (too short) */
unsigned long Rx_Data_discard_long_count PACKED; /* received Data frames discarded (too long) */
unsigned long Rx_Data_discard_inactive_count PACKED; /* received Data frames discarded (link inactive) */
unsigned long reserved_Data_frm_Rx_stat1 PACKED; /* reserved for later */
/* SLARP frame transmission/reception statistics */
unsigned long CHDLC_SLARP_REQ_Tx_count PACKED; /* number of SLARP Request frames transmitted */
unsigned long CHDLC_SLARP_REQ_Rx_count PACKED; /* number of SLARP Request frames received */
unsigned long CHDLC_SLARP_REPLY_Tx_count PACKED; /* number of SLARP Reply frames transmitted */
unsigned long CHDLC_SLARP_REPLY_Rx_count PACKED; /* number of SLARP Reply frames received */
unsigned long CHDLC_SLARP_KPALV_Tx_count PACKED; /* number of SLARP keepalive frames transmitted */
unsigned long CHDLC_SLARP_KPALV_Rx_count PACKED; /* number of SLARP keepalive frames received */
unsigned long reserved_SLARP_stat1 PACKED; /* reserved for later */
unsigned long reserved_SLARP_stat2 PACKED; /* reserved for later */
/* CDP frame transmission/reception statistics */
unsigned long CHDLC_CDP_Tx_count PACKED; /* number of CDP frames transmitted */
unsigned long CHDLC_CDP_Rx_count PACKED; /* number of CDP frames received */
unsigned long reserved_CDP_stat1 PACKED; /* reserved for later */
unsigned long reserved_CDP_stat2 PACKED; /* reserved for later */
unsigned long reserved_CDP_stat3 PACKED; /* reserved for later */
unsigned long reserved_CDP_stat4 PACKED; /* reserved for later */
unsigned long reserved_CDP_stat5 PACKED; /* reserved for later */
unsigned long reserved_CDP_stat6 PACKED; /* reserved for later */
/* Incoming frames with a format error statistics */
unsigned short Rx_frm_incomp_CHDLC_hdr_count PACKED; /* frames received of with incomplete Cisco HDLC header */
unsigned short Rx_frms_too_long_count PACKED; /* frames received of excessive length count */
unsigned short Rx_invalid_CHDLC_addr_count PACKED; /* frames received with an invalid CHDLC address count */
unsigned short Rx_invalid_CHDLC_ctrl_count PACKED; /* frames received with an invalid CHDLC control field count */
unsigned short Rx_invalid_CHDLC_type_count PACKED; /* frames received of an invalid CHDLC frame type count */
unsigned short Rx_SLARP_invalid_code_count PACKED; /* SLARP frame received with an invalid packet code */
unsigned short Rx_SLARP_Reply_bad_IP_addr PACKED; /* SLARP Reply received - bad IP address */
unsigned short Rx_SLARP_Reply_bad_netmask PACKED; /* SLARP Reply received - bad netmask */
unsigned long reserved_frm_format_err1 PACKED; /* reserved for later */
unsigned long reserved_frm_format_err2 PACKED; /* reserved for later */
unsigned long reserved_frm_format_err3 PACKED; /* reserved for later */
unsigned long reserved_frm_format_err4 PACKED; /* reserved for later */
/* CHDLC timeout/retry statistics */
unsigned short SLARP_Rx_keepalive_TO_count PACKED; /* timeout count for incoming SLARP frames */
unsigned short SLARP_Request_TO_count PACKED; /* timeout count for SLARP Request frames */
unsigned long To_retry_reserved_stat1 PACKED; /* reserved for later */
unsigned long To_retry_reserved_stat2 PACKED; /* reserved for later */
unsigned long To_retry_reserved_stat3 PACKED; /* reserved for later */
/* CHDLC link active/inactive and loopback statistics */
unsigned short link_active_count PACKED; /* number of times that the link went active */
unsigned short link_inactive_modem_count PACKED; /* number of times that the link went inactive (modem failure) */
unsigned short link_inactive_keepalive_count PACKED; /* number of times that the link went inactive (keepalive failure) */
unsigned short link_looped_count PACKED; /* link looped count */
unsigned long link_status_reserved_stat1 PACKED; /* reserved for later use */
unsigned long link_status_reserved_stat2 PACKED; /* reserved for later use */
/* miscellaneous statistics */
unsigned long reserved_misc_stat1 PACKED; /* reserved for later */
unsigned long reserved_misc_stat2 PACKED; /* reserved for later */
unsigned long reserved_misc_stat3 PACKED; /* reserved for later */
unsigned long reserved_misc_stat4 PACKED; /* reserved for later */
} CHDLC_OPERATIONAL_STATS_STRUCT;
/* ----------------------------------------------------------------------------
* Constants for using application interrupts
* --------------------------------------------------------------------------*/
/* the structure used for the SET_CHDLC_INTERRUPT_TRIGGERS/READ_CHDLC_INTERRUPT_TRIGGERS command */
typedef struct {
unsigned char CHDLC_interrupt_triggers PACKED; /* CHDLC interrupt trigger configuration */
unsigned char IRQ PACKED; /* IRQ to be used */
unsigned short interrupt_timer PACKED; /* interrupt timer */
unsigned short misc_interrupt_bits PACKED; /* miscellaneous bits */
} CHDLC_INT_TRIGGERS_STRUCT;
/* 'CHDLC_interrupt_triggers' bit settings */
#define APP_INT_ON_RX_FRAME 0x01 /* interrupt on Data frame reception */
#define APP_INT_ON_TX_FRAME 0x02 /* interrupt when an Data frame may be transmitted */
#define APP_INT_ON_COMMAND_COMPLETE 0x04 /* interrupt when an interface command is complete */
#define APP_INT_ON_TIMER 0x08 /* interrupt on a defined millisecond timeout */
#define APP_INT_ON_GLOBAL_EXCEP_COND 0x10 /* interrupt on a global exception condition */
#define APP_INT_ON_CHDLC_EXCEP_COND 0x20 /* interrupt on an CHDLC exception condition */
#define APP_INT_ON_TRACE_DATA_AVAIL 0x80 /* interrupt when trace data is available */
/* interrupt types indicated at 'interrupt_type' byte of the INTERRUPT_INFORMATION_STRUCT */
#define NO_APP_INTS_PEND 0x00 /* no interrups are pending */
#define RX_APP_INT_PEND 0x01 /* a receive interrupt is pending */
#define TX_APP_INT_PEND 0x02 /* a transmit interrupt is pending */
#define COMMAND_COMPLETE_APP_INT_PEND 0x04 /* a 'command complete' interrupt is pending */
#define TIMER_APP_INT_PEND 0x08 /* a timer interrupt is pending */
#define GLOBAL_EXCEP_COND_APP_INT_PEND 0x10 /* a global exception condition interrupt is pending */
#define CHDLC_EXCEP_COND_APP_INT_PEND 0x20 /* an CHDLC exception condition interrupt is pending */
#define TRACE_DATA_AVAIL_APP_INT_PEND 0x80 /* a trace data available interrupt is pending */
/* modem status changes */
#define DCD_HIGH 0x08
#define CTS_HIGH 0x20
/* ----------------------------------------------------------------------------
* Constants for Data frame transmission
* --------------------------------------------------------------------------*/
/* the Data frame transmit status element configuration structure */
typedef struct {
unsigned short number_Tx_status_elements PACKED; /* number of transmit status elements */
unsigned long base_addr_Tx_status_elements PACKED; /* base address of the transmit element list */
unsigned long next_Tx_status_element_to_use PACKED; /* pointer to the next transmit element to be used */
} CHDLC_TX_STATUS_EL_CFG_STRUCT;
/* the Data frame transmit status element structure */
typedef struct {
unsigned char opp_flag PACKED; /* opp flag */
unsigned short frame_length PACKED; /* length of the frame to be transmitted */
unsigned char reserved_1 PACKED; /* reserved for internal use */
unsigned long reserved_2 PACKED; /* reserved for internal use */
unsigned long reserved_3 PACKED; /* reserved for internal use */
unsigned long ptr_data_bfr PACKED; /* pointer to the data area */
} CHDLC_DATA_TX_STATUS_EL_STRUCT;
/* ----------------------------------------------------------------------------
* Constants for Data frame reception
* --------------------------------------------------------------------------*/
/* the Data frame receive status element configuration structure */
typedef struct {
unsigned short number_Rx_status_elements PACKED; /* number of receive status elements */
unsigned long base_addr_Rx_status_elements PACKED; /* base address of the receive element list */
unsigned long next_Rx_status_element_to_use PACKED; /* pointer to the next receive element to be used */
unsigned long base_addr_Rx_buffer PACKED; /* base address of the receive data buffer */
unsigned long end_addr_Rx_buffer PACKED; /* end address of the receive data buffer */
} CHDLC_RX_STATUS_EL_CFG_STRUCT;
/* the Data frame receive status element structure */
typedef struct {
unsigned char opp_flag PACKED; /* opp flag */
unsigned short frame_length PACKED; /* length of the received frame */
unsigned char error_flag PACKED; /* frame errors (HDLC_STREAMING_MODE)*/
unsigned short time_stamp PACKED; /* receive time stamp (HDLC_STREAMING_MODE) */
unsigned long reserved_1 PACKED; /* reserved for internal use */
unsigned short reserved_2 PACKED; /* reserved for internal use */
unsigned long ptr_data_bfr PACKED; /* pointer to the data area */
} CHDLC_DATA_RX_STATUS_EL_STRUCT;
/* ----------------------------------------------------------------------------
* Constants defining the shared memory information area
* --------------------------------------------------------------------------*/
/* the global information structure */
typedef struct {
unsigned char global_status PACKED; /* global status */
unsigned char modem_status PACKED; /* current modem status */
unsigned char global_excep_conditions PACKED; /* global exception conditions */
unsigned char glob_info_reserved[5] PACKED; /* reserved */
unsigned char codename[4] PACKED; /* Firmware name */
unsigned char codeversion[4] PACKED; /* Firmware version */
} GLOBAL_INFORMATION_STRUCT;
/* the CHDLC information structure */
typedef struct {
unsigned char CHDLC_status PACKED; /* CHDLC status */
unsigned char CHDLC_excep_conditions PACKED; /* CHDLC exception conditions */
unsigned char CHDLC_info_reserved[14] PACKED; /* reserved */
} CHDLC_INFORMATION_STRUCT;
/* the interrupt information structure */
typedef struct {
unsigned char interrupt_type PACKED; /* type of interrupt triggered */
unsigned char interrupt_permission PACKED; /* interrupt permission mask */
unsigned char int_info_reserved[14] PACKED; /* reserved */
} INTERRUPT_INFORMATION_STRUCT;
/* the S508/FT1 information structure */
typedef struct {
unsigned char parallel_port_A_input PACKED; /* input - parallel port A */
unsigned char parallel_port_B_input PACKED; /* input - parallel port B */
unsigned char FT1_info_reserved[14] PACKED; /* reserved */
} FT1_INFORMATION_STRUCT;
/* the shared memory area information structure */
typedef struct {
GLOBAL_INFORMATION_STRUCT global_info_struct PACKED; /* the global information structure */
CHDLC_INFORMATION_STRUCT CHDLC_info_struct PACKED; /* the CHDLC information structure */
INTERRUPT_INFORMATION_STRUCT interrupt_info_struct PACKED; /* the interrupt information structure */
FT1_INFORMATION_STRUCT FT1_info_struct PACKED; /* the S508/FT1 information structure */
} SHARED_MEMORY_INFO_STRUCT;
/* ----------------------------------------------------------------------------
* UDP Management constants and structures
* --------------------------------------------------------------------------*/
/* 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; /* the user command */
unsigned short buffer_length PACKED; /* the data length */
unsigned char return_code PACKED; /* the return code */
unsigned char MB_reserved[NUMBER_MB_RESERVED_BYTES] PACKED; /* reserved for later */
} cblock_t;
/* UDP management packet layout (data area of ip packet) */
/*
typedef struct {
unsigned char signature[8] PACKED;
unsigned char request_reply PACKED;
unsigned char id PACKED;
unsigned char reserved[6] PACKED;
cblock_t cblock PACKED;
unsigned char num_frames PACKED;
unsigned char ismoredata PACKED;
unsigned char data[SIZEOF_MB_DATA_BFR] PACKED;
} udp_management_packet_t;
*/
typedef struct {
unsigned char num_frames PACKED;
unsigned char ismoredata PACKED;
} trace_info_t;
typedef struct {
ip_pkt_t ip_pkt PACKED;
udp_pkt_t udp_pkt PACKED;
wp_mgmt_t wp_mgmt PACKED;
cblock_t cblock PACKED;
trace_info_t trace_info PACKED;
unsigned char data[SIZEOF_MB_DATA_BFR] PACKED;
} chdlc_udp_pkt_t;
typedef struct ft1_exec_cmd{
unsigned char command PACKED; /* the user command */
unsigned short buffer_length PACKED; /* the data length */
unsigned char return_code PACKED; /* the return code */
unsigned char MB_reserved[NUMBER_MB_RESERVED_BYTES] PACKED;
} ft1_exec_cmd_t;
typedef struct {
unsigned char opp_flag PACKED;
ft1_exec_cmd_t cmd PACKED;
unsigned char data[SIZEOF_MB_DATA_BFR] PACKED;
} ft1_exec_t;
#define UDPMGMT_SIGNATURE "CTPIPEAB"
/* UDP/IP packet (for UDP management) layout */
/*
typedef struct {
unsigned char reserved[2] PACKED;
unsigned short ip_length PACKED;
unsigned char reserved2[4] PACKED;
unsigned char ip_ttl PACKED;
unsigned char ip_protocol PACKED;
unsigned short ip_checksum PACKED;
unsigned long ip_src_address PACKED;
unsigned long ip_dst_address PACKED;
unsigned short udp_src_port PACKED;
unsigned short udp_dst_port PACKED;
unsigned short udp_length PACKED;
unsigned short udp_checksum PACKED;
udp_management_packet_t um_packet PACKED;
} ip_packet_t;
*/
/* valid ip_protocol for UDP management */
#define UDPMGMT_UDP_PROTOCOL 0x11
typedef struct {
unsigned char status PACKED;
unsigned char data_avail PACKED;
unsigned short real_length PACKED;
unsigned short time_stamp PACKED;
unsigned char data[1] PACKED;
} trace_pkt_t;
typedef struct {
unsigned char error_flag 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;
/* ----------------------------------------------------------------------------
* Constants for the SET_FT1_CONFIGURATION/READ_FT1_CONFIGURATION command
* --------------------------------------------------------------------------*/
/* the FT1 configuration structure */
typedef struct {
unsigned short framing_mode;
unsigned short encoding_mode;
unsigned short line_build_out;
unsigned short channel_base;
unsigned short baud_rate_kbps; /* the baud rate (in kbps) */
unsigned short clock_mode;
} ft1_config_t;
/* settings for the 'framing_mode' */
#define ESF_FRAMING 0x00 /* ESF framing */
#define D4_FRAMING 0x01 /* D4 framing */
/* settings for the 'encoding_mode' */
#define B8ZS_ENCODING 0x00 /* B8ZS encoding */
#define AMI_ENCODING 0x01 /* AMI encoding */
/* settings for the 'line_build_out' */
#define LN_BLD_CSU_0dB_DSX1_0_to_133 0x00 /* set build out to CSU (0db) or DSX-1 (0-133ft) */
#define LN_BLD_DSX1_133_to_266 0x01 /* set build out DSX-1 (133-266ft) */
#define LN_BLD_DSX1_266_to_399 0x02 /* set build out DSX-1 (266-399ft) */
#define LN_BLD_DSX1_399_to_533 0x03 /* set build out DSX-1 (399-533ft) */
#define LN_BLD_DSX1_533_to_655 0x04 /* set build out DSX-1 (533-655ft) */
#define LN_BLD_CSU_NEG_7dB 0x05 /* set build out to CSU (-7.5db) */
#define LN_BLD_CSU_NEG_15dB 0x06 /* set build out to CSU (-15db) */
#define LN_BLD_CSU_NEG_22dB 0x07 /* set build out to CSU (-22.5db) */
/* settings for the 'channel_base' */
#define MIN_CHANNEL_BASE_VALUE 1 /* the minimum permitted channel base value */
#define MAX_CHANNEL_BASE_VALUE 24 /* the maximum permitted channel base value */
/* settings for the 'baud_rate_kbps' */
#define MIN_BAUD_RATE_KBPS 0 /* the minimum permitted baud rate (kbps) */
#define MAX_BAUD_RATE_KBPS 1536 /* the maximum permitted baud rate (kbps) */
#define BAUD_RATE_FT1_AUTO_CONFIG 0xFFFF /* the baud rate used to trigger an automatic FT1 configuration */
/* settings for the 'clock_mode' */
#define CLOCK_MODE_NORMAL 0x00 /* clock mode set to normal (slave) */
#define CLOCK_MODE_MASTER 0x01 /* clock mode set to master */
#define BAUD_RATE_FT1_AUTO_CONFIG 0xFFFF
#define AUTO_FT1_CONFIG_NOT_COMPLETE 0x08
#define AUTO_FT1_CFG_FAIL_OP_MODE 0x0C
#define AUTO_FT1_CFG_FAIL_INVALID_LINE 0x0D
#ifdef _MSC_
# pragma pack()
#endif
#endif /* _SDLA_CHDLC_H */

View File

@ -1,575 +0,0 @@
/*****************************************************************************
* sdla_ppp.h Sangoma PPP firmware API definitions.
*
* Author: Nenad Corbic <ncorbic@sangoma.com>
*
* Copyright: (c) 1995-1997 Sangoma Technologies Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
* ============================================================================
* Feb 24, 2000 Nenad Corbic v2.1.2
* Jan 06, 1997 Gene Kozin v2.0
* Apr 11, 1996 Gene Kozin Initial version.
*****************************************************************************/
#ifndef _SDLA_PPP_H
#define _SDLA_PPP_H
/*----------------------------------------------------------------------------
* Notes:
* ------
* 1. All structures defined in this file are byte-alined.
*
* Compiler Platform
* -------- --------
* GNU C Linux
*/
#ifndef PACKED
# define PACKED __attribute__((packed))
#endif /* PACKED */
/* Adapter memory layout and important constants */
#define PPP508_MB_VECT 0xE000 /* mailbox window vector */
#define PPP508_MB_OFFS 0 /* mailbox offset */
#define PPP508_FLG_OFFS 0x1000 /* status flags offset */
#define PPP508_BUF_OFFS 0x1100 /* buffer info block offset */
#define PPP514_MB_OFFS 0xE000 /* mailbox offset */
#define PPP514_FLG_OFFS 0xF000 /* status flags offset */
#define PPP514_BUF_OFFS 0xF100 /* buffer info block offset */
#define PPP_MAX_DATA 1008 /* command block data buffer length */
/****** Data Structures *****************************************************/
/*----------------------------------------------------------------------------
* PPP Command Block.
*/
typedef struct ppp_cmd{
unsigned char command PACKED; /* command code */
unsigned short length PACKED; /* length of data buffer */
unsigned char result PACKED; /* return code */
unsigned char rsrv[11] PACKED; /* reserved for future use */
} ppp_cmd_t;
typedef struct cblock{
unsigned char opp_flag PACKED;
unsigned char command PACKED; /* command code */
unsigned short length PACKED; /* length of data buffer */
unsigned char result PACKED; /* return code */
unsigned char rsrv[11] PACKED; /* reserved for future use */
} cblock_t;
typedef struct ppp_udp_pkt{
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[MAX_LGTH_UDP_MGNT_PKT] PACKED;
} ppp_udp_pkt_t;
typedef struct {
unsigned char status PACKED;
unsigned char data_avail PACKED;
unsigned short real_length PACKED;
unsigned short time_stamp PACKED;
unsigned char data[1] PACKED;
} trace_pkt_t;
typedef struct {
unsigned char opp_flag PACKED;
unsigned char trace_type PACKED;
unsigned short trace_length PACKED;
unsigned short trace_data_ptr PACKED;
unsigned short trace_time_stamp PACKED;
} trace_element_t;
/* 'command' field defines */
#define PPP_READ_CODE_VERSION 0x10 /* configuration commands */
#define PPP_SET_CONFIG 0x05
#define PPP_READ_CONFIG 0x06
#define PPP_SET_INTR_FLAGS 0x20
#define PPP_READ_INTR_FLAGS 0x21
#define PPP_SET_INBOUND_AUTH 0x30
#define PPP_SET_OUTBOUND_AUTH 0x31
#define PPP_GET_CONNECTION_INFO 0x32
#define PPP_COMM_ENABLE 0x03 /* operational commands */
#define PPP_COMM_DISABLE 0x04
#define PPP_SEND_SIGN_FRAME 0x23
#define PPP_READ_SIGN_RESPONSE 0x24
#define PPP_DATALINE_MONITOR 0x33
#define PPP_READ_STATISTICS 0x07 /* statistics commands */
#define PPP_FLUSH_STATISTICS 0x08
#define PPP_READ_ERROR_STATS 0x09
#define PPP_FLUSH_ERROR_STATS 0x0A
#define PPP_READ_PACKET_STATS 0x12
#define PPP_FLUSH_PACKET_STATS 0x13
#define PPP_READ_LCP_STATS 0x14
#define PPP_FLUSH_LCP_STATS 0x15
#define PPP_READ_LPBK_STATS 0x16
#define PPP_FLUSH_LPBK_STATS 0x17
#define PPP_READ_IPCP_STATS 0x18
#define PPP_FLUSH_IPCP_STATS 0x19
#define PPP_READ_IPXCP_STATS 0x1A
#define PPP_FLUSH_IPXCP_STATS 0x1B
#define PPP_READ_PAP_STATS 0x1C
#define PPP_FLUSH_PAP_STATS 0x1D
#define PPP_READ_CHAP_STATS 0x1E
#define PPP_FLUSH_CHAP_STATS 0x1F
/* 'result' field defines */
#define PPPRES_OK 0x00 /* command executed successfully */
#define PPPRES_INVALID_STATE 0x09 /* invalid command in this context */
/*----------------------------------------------------------------------------
* PPP Mailbox.
* This structure is located at offset PPP???_MB_OFFS into PPP???_MB_VECT
*/
typedef struct ppp_mbox
{
unsigned char flag PACKED; /* 00h: command execution flag */
ppp_cmd_t cmd PACKED; /* 01h: command block */
unsigned char data[1] PACKED; /* 10h: variable length data buffer */
} ppp_mbox_t;
/*----------------------------------------------------------------------------
* PPP Status Flags.
* This structure is located at offset PPP???_FLG_OFFS into
* PPP???_MB_VECT.
*/
typedef struct ppp_flags
{
unsigned char iflag PACKED; /* 00: interrupt flag */
unsigned char imask PACKED; /* 01: interrupt mask */
unsigned char resrv PACKED;
unsigned char mstatus PACKED; /* 03: modem status */
unsigned char lcp_state PACKED; /* 04: LCP state */
unsigned char ppp_phase PACKED; /* 05: PPP phase */
unsigned char ip_state PACKED; /* 06: IPCP state */
unsigned char ipx_state PACKED; /* 07: IPXCP state */
unsigned char pap_state PACKED; /* 08: PAP state */
unsigned char chap_state PACKED; /* 09: CHAP state */
unsigned short disc_cause PACKED; /* 0A: disconnection cause */
} ppp_flags_t;
/* 'iflag' defines */
#define PPP_INTR_RXRDY 0x01 /* Rx ready */
#define PPP_INTR_TXRDY 0x02 /* Tx ready */
#define PPP_INTR_MODEM 0x04 /* modem status change (DCD, CTS) */
#define PPP_INTR_CMD 0x08 /* interface command completed */
#define PPP_INTR_DISC 0x10 /* data link disconnected */
#define PPP_INTR_OPEN 0x20 /* data link open */
#define PPP_INTR_DROP_DTR 0x40 /* DTR drop timeout expired */
#define PPP_INTR_TIMER 0x80 /* timer interrupt */
/* 'mstatus' defines */
#define PPP_MDM_DCD 0x08 /* mdm_status: DCD */
#define PPP_MDM_CTS 0x20 /* mdm_status: CTS */
/* 'disc_cause' defines */
#define PPP_LOCAL_TERMINATION 0x0001 /* Local Request by PPP termination phase */
#define PPP_DCD_CTS_DROP 0x0002 /* DCD and/or CTS dropped. Link down */
#define PPP_REMOTE_TERMINATION 0x0800 /* Remote Request by PPP termination phase */
/* 'misc_config_bits' defines */
#define DONT_RE_TX_ABORTED_I_FRAMES 0x01
#define TX_FRM_BYTE_COUNT_STATS 0x02
#define RX_FRM_BYTE_COUNT_STATS 0x04
#define TIME_STAMP_IN_RX_FRAMES 0x08
#define NON_STD_ADPTR_FREQ 0x10
#define INTERFACE_LEVEL_RS232 0x20
#define AUTO_LINK_RECOVERY 0x100
#define DONT_TERMINATE_LNK_MAX_CONFIG 0x200
/* 'authentication options' defines */
#define NO_AUTHENTICATION 0x00
#define INBOUND_AUTH 0x80
#define PAP_AUTH 0x01
#define CHAP_AUTH 0x02
/* 'ip options' defines */
#define L_AND_R_IP_NO_ASSIG 0x00
#define L_IP_LOCAL_ASSIG 0x01
#define L_IP_REMOTE_ASSIG 0x02
#define R_IP_LOCAL_ASSIG 0x04
#define R_IP_REMOTE_ASSIG 0x08
#define ENABLE_IP 0x80
/* 'ipx options' defines */
#define ROUTING_PROT_DEFAULT 0x20
#define ENABLE_IPX 0x80
#define DISABLE_IPX 0x00
/*----------------------------------------------------------------------------
* PPP Buffer Info.
* This structure is located at offset PPP508_BUF_OFFS into
* PPP508_MB_VECT.
*/
typedef struct ppp508_buf_info
{
unsigned short txb_num PACKED; /* 00: number of transmit buffers */
unsigned long txb_ptr PACKED; /* 02: pointer to the buffer ctl. */
unsigned long txb_nxt PACKED;
unsigned char rsrv1[22] PACKED;
unsigned short rxb_num PACKED; /* 20: number of receive buffers */
unsigned long rxb_ptr PACKED; /* 22: pointer to the buffer ctl. */
unsigned long rxb1_ptr PACKED; /* 26: pointer to the first buf.ctl. */
unsigned long rxb_base PACKED; /* 2A: pointer to the buffer base */
unsigned char rsrv2[2] PACKED;
unsigned long rxb_end PACKED; /* 30: pointer to the buffer end */
} ppp508_buf_info_t;
/*----------------------------------------------------------------------------
* Transmit/Receive Buffer Control Block.
*/
typedef struct ppp_buf_ctl
{
unsigned char flag PACKED; /* 00: 'buffer ready' flag */
unsigned short length PACKED; /* 01: length of data */
unsigned char reserved1[1] PACKED; /* 03: */
unsigned char proto PACKED; /* 04: protocol */
unsigned short timestamp PACKED; /* 05: time stamp (Rx only) */
unsigned char reserved2[5] PACKED; /* 07: */
union
{
unsigned short o_p[2]; /* 1C: buffer offset & page (S502) */
unsigned long ptr; /* 1C: buffer pointer (S508) */
} buf PACKED;
} ppp_buf_ctl_t;
/*----------------------------------------------------------------------------
* S508 Adapter Configuration Block (passed to the PPP_SET_CONFIG command).
*/
typedef struct ppp508_conf
{
unsigned long line_speed PACKED; /* 00: baud rate, bps */
unsigned short txbuf_percent PACKED; /* 04: % of Tx buffer */
unsigned short conf_flags PACKED; /* 06: configuration bits */
unsigned short mtu_local PACKED; /* 08: local MTU */
unsigned short mtu_remote PACKED; /* 0A: remote MTU */
unsigned short restart_tmr PACKED; /* 0C: restart timer */
unsigned short auth_rsrt_tmr PACKED; /* 0E: authentication timer */
unsigned short auth_wait_tmr PACKED; /* 10: authentication timer */
unsigned short mdm_fail_tmr PACKED; /* 12: modem failure timer */
unsigned short dtr_drop_tmr PACKED; /* 14: DTR drop timer */
unsigned short connect_tmout PACKED; /* 16: connection timeout */
unsigned short conf_retry PACKED; /* 18: max. retry */
unsigned short term_retry PACKED; /* 1A: max. retry */
unsigned short fail_retry PACKED; /* 1C: max. retry */
unsigned short auth_retry PACKED; /* 1E: max. retry */
unsigned char auth_options PACKED; /* 20: authentication opt. */
unsigned char ip_options PACKED; /* 21: IP options */
unsigned long ip_local PACKED; /* 22: local IP address */
unsigned long ip_remote PACKED; /* 26: remote IP address */
unsigned char ipx_options PACKED; /* 2A: IPX options */
unsigned char ipx_netno[4] PACKED; /* 2B: IPX net number */
unsigned char ipx_local[6] PACKED; /* 2F: local IPX node number*/
unsigned char ipx_remote[6] PACKED; /* 35: remote IPX node num.*/
unsigned char ipx_router[48] PACKED; /* 3B: IPX router name*/
unsigned long alt_cpu_clock PACKED; /* 6B: */
} ppp508_conf_t;
/*----------------------------------------------------------------------------
* S508 Adapter Read Connection Information Block
* Returned by the PPP_GET_CONNECTION_INFO command
*/
typedef struct ppp508_connect_info
{
unsigned short mru PACKED; /* 00-01 Remote Max Rec' Unit */
unsigned char ip_options PACKED; /* 02: Negotiated ip options */
unsigned long ip_local PACKED; /* 03-06: local IP address */
unsigned long ip_remote PACKED; /* 07-0A: remote IP address */
unsigned char ipx_options PACKED; /* 0B: Negotiated ipx options */
unsigned char ipx_netno[4] PACKED; /* 0C-0F: IPX net number */
unsigned char ipx_local[6] PACKED; /* 10-1F: local IPX node # */
unsigned char ipx_remote[6] PACKED; /* 16-1B: remote IPX node # */
unsigned char ipx_router[48] PACKED; /* 1C-4B: IPX router name */
unsigned char auth_status PACKED; /* 4C: Authentication Status */
unsigned char inbd_auth_peerID[1] PACKED; /* 4D: variable length inbound authenticated peer ID */
} ppp508_connect_info_t;
/* 'line_speed' field */
#define PPP_BITRATE_1200 0x01
#define PPP_BITRATE_2400 0x02
#define PPP_BITRATE_4800 0x03
#define PPP_BITRATE_9600 0x04
#define PPP_BITRATE_19200 0x05
#define PPP_BITRATE_38400 0x06
#define PPP_BITRATE_45000 0x07
#define PPP_BITRATE_56000 0x08
#define PPP_BITRATE_64000 0x09
#define PPP_BITRATE_74000 0x0A
#define PPP_BITRATE_112000 0x0B
#define PPP_BITRATE_128000 0x0C
#define PPP_BITRATE_156000 0x0D
/* Defines for the 'conf_flags' field */
#define PPP_IGNORE_TX_ABORT 0x01 /* don't re-transmit aborted frames */
#define PPP_ENABLE_TX_STATS 0x02 /* enable Tx statistics */
#define PPP_ENABLE_RX_STATS 0x04 /* enable Rx statistics */
#define PPP_ENABLE_TIMESTAMP 0x08 /* enable timestamp */
/* 'ip_options' defines */
#define PPP_LOCAL_IP_LOCAL 0x01
#define PPP_LOCAL_IP_REMOTE 0x02
#define PPP_REMOTE_IP_LOCAL 0x04
#define PPP_REMOTE_IP_REMOTE 0x08
/* 'ipx_options' defines */
#define PPP_REMOTE_IPX_NETNO 0x01
#define PPP_REMOTE_IPX_LOCAL 0x02
#define PPP_REMOTE_IPX_REMOTE 0x04
#define PPP_IPX_ROUTE_RIP_SAP 0x08
#define PPP_IPX_ROUTE_NLSP 0x10
#define PPP_IPX_ROUTE_DEFAULT 0x20
#define PPP_IPX_CONF_COMPLETE 0x40
#define PPP_IPX_ENABLE 0x80
/*----------------------------------------------------------------------------
* S508 Adapter Configuration Block (returned by the PPP_READ_CONFIG command).
*/
typedef struct ppp508_get_conf
{
unsigned long bps PACKED; /* 00: baud rate, bps */
ppp508_conf_t conf PACKED; /* 04: requested config. */
unsigned short txb_num PACKED; /* 6F: number of Tx buffers */
unsigned short rxb_num PACKED; /* 71: number of Rx buffers */
} ppp508_get_conf_t;
/*----------------------------------------------------------------------------
* S508 Operational Statistics (returned by the PPP_READ_STATISTIC command).
*/
typedef struct ppp508_stats
{
unsigned short reserved1 PACKED; /* 00: */
unsigned short rx_bad_len PACKED; /* 02: */
unsigned short reserved2 PACKED; /* 04: */
unsigned long tx_frames PACKED; /* 06: */
unsigned long tx_bytes PACKED; /* 0A: */
unsigned long rx_frames PACKED; /* 0E: */
unsigned long rx_bytes PACKED; /* 12: */
} ppp508_stats_t;
/*----------------------------------------------------------------------------
* Adapter Error Statistics (returned by the PPP_READ_ERROR_STATS command).
*/
typedef struct ppp_err_stats
{
unsigned char rx_overrun PACKED; /* 00: Rx overrun errors */
unsigned char rx_bad_crc PACKED; /* 01: Rx CRC errors */
unsigned char rx_abort PACKED; /* 02: Rx aborted frames */
unsigned char rx_lost PACKED; /* 03: Rx frames lost */
unsigned char tx_abort PACKED; /* 04: Tx aborted frames */
unsigned char tx_underrun PACKED; /* 05: Tx underrun errors */
unsigned char tx_missed_intr PACKED; /* 06: Tx underruns missed */
unsigned char reserved PACKED; /* 07: Tx underruns missed */
unsigned char dcd_trans PACKED; /* 08: DCD transitions */
unsigned char cts_trans PACKED; /* 09: CTS transitions */
} ppp_err_stats_t;
/*----------------------------------------------------------------------------
* Packet Statistics (returned by the PPP_READ_PACKET_STATS command).
*/
typedef struct ppp_pkt_stats
{
unsigned short rx_bad_header PACKED; /* 00: */
unsigned short rx_prot_unknwn PACKED; /* 02: */
unsigned short rx_too_large PACKED; /* 04: */
unsigned short rx_lcp PACKED; /* 06: */
unsigned short tx_lcp PACKED; /* 08: */
unsigned short rx_ipcp PACKED; /* 0A: */
unsigned short tx_ipcp PACKED; /* 0C: */
unsigned short rx_ipxcp PACKED; /* 0E: */
unsigned short tx_ipxcp PACKED; /* 10: */
unsigned short rx_pap PACKED; /* 12: */
unsigned short tx_pap PACKED; /* 14: */
unsigned short rx_chap PACKED; /* 16: */
unsigned short tx_chap PACKED; /* 18: */
unsigned short rx_lqr PACKED; /* 1A: */
unsigned short tx_lqr PACKED; /* 1C: */
unsigned short rx_ip PACKED; /* 1E: */
unsigned short tx_ip PACKED; /* 20: */
unsigned short rx_ipx PACKED; /* 22: */
unsigned short tx_ipx PACKED; /* 24: */
} ppp_pkt_stats_t;
/*----------------------------------------------------------------------------
* LCP Statistics (returned by the PPP_READ_LCP_STATS command).
*/
typedef struct ppp_lcp_stats
{
unsigned short rx_unknown PACKED; /* 00: unknown LCP type */
unsigned short rx_conf_rqst PACKED; /* 02: Configure-Request */
unsigned short rx_conf_ack PACKED; /* 04: Configure-Ack */
unsigned short rx_conf_nak PACKED; /* 06: Configure-Nak */
unsigned short rx_conf_rej PACKED; /* 08: Configure-Reject */
unsigned short rx_term_rqst PACKED; /* 0A: Terminate-Request */
unsigned short rx_term_ack PACKED; /* 0C: Terminate-Ack */
unsigned short rx_code_rej PACKED; /* 0E: Code-Reject */
unsigned short rx_proto_rej PACKED; /* 10: Protocol-Reject */
unsigned short rx_echo_rqst PACKED; /* 12: Echo-Request */
unsigned short rx_echo_reply PACKED; /* 14: Echo-Reply */
unsigned short rx_disc_rqst PACKED; /* 16: Discard-Request */
unsigned short tx_conf_rqst PACKED; /* 18: Configure-Request */
unsigned short tx_conf_ack PACKED; /* 1A: Configure-Ack */
unsigned short tx_conf_nak PACKED; /* 1C: Configure-Nak */
unsigned short tx_conf_rej PACKED; /* 1E: Configure-Reject */
unsigned short tx_term_rqst PACKED; /* 20: Terminate-Request */
unsigned short tx_term_ack PACKED; /* 22: Terminate-Ack */
unsigned short tx_code_rej PACKED; /* 24: Code-Reject */
unsigned short tx_proto_rej PACKED; /* 26: Protocol-Reject */
unsigned short tx_echo_rqst PACKED; /* 28: Echo-Request */
unsigned short tx_echo_reply PACKED; /* 2A: Echo-Reply */
unsigned short tx_disc_rqst PACKED; /* 2E: Discard-Request */
unsigned short rx_too_large PACKED; /* 30: packets too large */
unsigned short rx_ack_inval PACKED; /* 32: invalid Conf-Ack */
unsigned short rx_rej_inval PACKED; /* 34: invalid Conf-Reject */
unsigned short rx_rej_badid PACKED; /* 36: Conf-Reject w/bad ID */
} ppp_lcp_stats_t;
/*----------------------------------------------------------------------------
* Loopback Error Statistics (returned by the PPP_READ_LPBK_STATS command).
*/
typedef struct ppp_lpbk_stats
{
unsigned short conf_magic PACKED; /* 00: */
unsigned short loc_echo_rqst PACKED; /* 02: */
unsigned short rem_echo_rqst PACKED; /* 04: */
unsigned short loc_echo_reply PACKED; /* 06: */
unsigned short rem_echo_reply PACKED; /* 08: */
unsigned short loc_disc_rqst PACKED; /* 0A: */
unsigned short rem_disc_rqst PACKED; /* 0C: */
unsigned short echo_tx_collsn PACKED; /* 0E: */
unsigned short echo_rx_collsn PACKED; /* 10: */
} ppp_lpbk_stats_t;
/*----------------------------------------------------------------------------
* Protocol Statistics (returned by the PPP_READ_IPCP_STATS and
* PPP_READ_IPXCP_STATS commands).
*/
typedef struct ppp_prot_stats
{
unsigned short rx_unknown PACKED; /* 00: unknown type */
unsigned short rx_conf_rqst PACKED; /* 02: Configure-Request */
unsigned short rx_conf_ack PACKED; /* 04: Configure-Ack */
unsigned short rx_conf_nak PACKED; /* 06: Configure-Nak */
unsigned short rx_conf_rej PACKED; /* 08: Configure-Reject */
unsigned short rx_term_rqst PACKED; /* 0A: Terminate-Request */
unsigned short rx_term_ack PACKED; /* 0C: Terminate-Ack */
unsigned short rx_code_rej PACKED; /* 0E: Code-Reject */
unsigned short reserved PACKED; /* 10: */
unsigned short tx_conf_rqst PACKED; /* 12: Configure-Request */
unsigned short tx_conf_ack PACKED; /* 14: Configure-Ack */
unsigned short tx_conf_nak PACKED; /* 16: Configure-Nak */
unsigned short tx_conf_rej PACKED; /* 18: Configure-Reject */
unsigned short tx_term_rqst PACKED; /* 1A: Terminate-Request */
unsigned short tx_term_ack PACKED; /* 1C: Terminate-Ack */
unsigned short tx_code_rej PACKED; /* 1E: Code-Reject */
unsigned short rx_too_large PACKED; /* 20: packets too large */
unsigned short rx_ack_inval PACKED; /* 22: invalid Conf-Ack */
unsigned short rx_rej_inval PACKED; /* 24: invalid Conf-Reject */
unsigned short rx_rej_badid PACKED; /* 26: Conf-Reject w/bad ID */
} ppp_prot_stats_t;
/*----------------------------------------------------------------------------
* PAP Statistics (returned by the PPP_READ_PAP_STATS command).
*/
typedef struct ppp_pap_stats
{
unsigned short rx_unknown PACKED; /* 00: unknown type */
unsigned short rx_auth_rqst PACKED; /* 02: Authenticate-Request */
unsigned short rx_auth_ack PACKED; /* 04: Authenticate-Ack */
unsigned short rx_auth_nak PACKED; /* 06: Authenticate-Nak */
unsigned short reserved PACKED; /* 08: */
unsigned short tx_auth_rqst PACKED; /* 0A: Authenticate-Request */
unsigned short tx_auth_ack PACKED; /* 0C: Authenticate-Ack */
unsigned short tx_auth_nak PACKED; /* 0E: Authenticate-Nak */
unsigned short rx_too_large PACKED; /* 10: packets too large */
unsigned short rx_bad_peerid PACKED; /* 12: invalid peer ID */
unsigned short rx_bad_passwd PACKED; /* 14: invalid password */
} ppp_pap_stats_t;
/*----------------------------------------------------------------------------
* CHAP Statistics (returned by the PPP_READ_CHAP_STATS command).
*/
typedef struct ppp_chap_stats
{
unsigned short rx_unknown PACKED; /* 00: unknown type */
unsigned short rx_challenge PACKED; /* 02: Authenticate-Request */
unsigned short rx_response PACKED; /* 04: Authenticate-Ack */
unsigned short rx_success PACKED; /* 06: Authenticate-Nak */
unsigned short rx_failure PACKED; /* 08: Authenticate-Nak */
unsigned short reserved PACKED; /* 0A: */
unsigned short tx_challenge PACKED; /* 0C: Authenticate-Request */
unsigned short tx_response PACKED; /* 0E: Authenticate-Ack */
unsigned short tx_success PACKED; /* 10: Authenticate-Nak */
unsigned short tx_failure PACKED; /* 12: Authenticate-Nak */
unsigned short rx_too_large PACKED; /* 14: packets too large */
unsigned short rx_bad_peerid PACKED; /* 16: invalid peer ID */
unsigned short rx_bad_passwd PACKED; /* 18: invalid password */
unsigned short rx_bad_md5 PACKED; /* 1A: invalid MD5 format */
unsigned short rx_bad_resp PACKED; /* 1C: invalid response */
} ppp_chap_stats_t;
/*----------------------------------------------------------------------------
* Connection Information (returned by the PPP_GET_CONNECTION_INFO command).
*/
typedef struct ppp_conn_info
{
unsigned short remote_mru PACKED; /* 00: */
unsigned char ip_options PACKED; /* 02: */
unsigned char ip_local[4] PACKED; /* 03: */
unsigned char ip_remote[4] PACKED; /* 07: */
unsigned char ipx_options PACKED; /* 0B: */
unsigned char ipx_network[4] PACKED; /* 0C: */
unsigned char ipx_local[6] PACKED; /* 10: */
unsigned char ipx_remote[6] PACKED; /* 16: */
unsigned char ipx_router[48] PACKED; /* 1C: */
unsigned char auth_status PACKED; /* 4C: */
unsigned char peer_id[0] PACKED; /* 4D: */
} ppp_conn_info_t;
/* Data structure for SET_TRIGGER_INTR command
*/
typedef struct ppp_intr_info{
unsigned char i_enable PACKED; /* 0 Interrupt enable bits */
unsigned char irq PACKED; /* 1 Irq number */
unsigned short timer_len PACKED; /* 2 Timer delay */
} ppp_intr_info_t;
#define FT1_MONITOR_STATUS_CTRL 0x80
#define SET_FT1_MODE 0x81
/* Special UDP drivers management commands */
#define PPIPE_ENABLE_TRACING 0x20
#define PPIPE_DISABLE_TRACING 0x21
#define PPIPE_GET_TRACE_INFO 0x22
#define PPIPE_GET_IBA_DATA 0x23
#define PPIPE_KILL_BOARD 0x24
#define PPIPE_FT1_READ_STATUS 0x25
#define PPIPE_DRIVER_STAT_IFSEND 0x26
#define PPIPE_DRIVER_STAT_INTR 0x27
#define PPIPE_DRIVER_STAT_GEN 0x28
#define PPIPE_FLUSH_DRIVER_STATS 0x29
#define PPIPE_ROUTER_UP_TIME 0x30
#define DISABLE_TRACING 0x00
#define TRACE_SIGNALLING_FRAMES 0x01
#define TRACE_DATA_FRAMES 0x02
#ifdef _MSC_
# pragma pack()
#endif
#endif /* _SDLA_PPP_H */

View File

@ -1,772 +0,0 @@
/*****************************************************************************
* sdla_x25.h Sangoma X.25 firmware API definitions.
*
* Author: Nenad Corbic <ncorbic@sangoma.com>
*
* Copyright: (c) 1995-2000 Sangoma Technologies Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
2 of the License, or (at your option) any later version.
* ============================================================================
* Feb 28, 2000 Nenad Corbic Updated for socket based x25api
* Dec 13, 1996 Gene Kozin Initial version
*****************************************************************************/
#ifndef _SDLA_X25_H
#define _SDLA_X25_H
/*----------------------------------------------------------------------------
* Notes:
* ------
* 1. All structures defined in this file are byte-alined.
* Compiler Platform
* -------- --------
* GNU C Linux
*
*/
#ifndef PACKED
# define PACKED __attribute__((packed))
#endif /* PACKED */
/****** CONSTANTS DEFINITIONS ***********************************************/
#define X25_MAX_CHAN 255 /* max number of open X.25 circuits */
#define X25_MAX_DATA 1024 /* max length of X.25 data buffer */
/*
* X.25 shared memory layout.
*/
#define X25_MBOX_OFFS 0x16B0 /* general mailbox block */
#define X25_RXMBOX_OFFS 0x1AD0 /* receive mailbox */
#define X25_STATUS_OFFS 0x1EF0 /* X.25 status structure */
#define X25_MB_VECTOR 0xE000 /* S514 mailbox window vecotr */
#define X25_MISC_HDLC_BITS 0x1F00 /*X.25 miscallaneous HDLC bits */
/* code levels */
#define HDLC_LEVEL 0x01
#define X25_LEVEL 0x02
#define X25_AND_HDLC_LEVEL 0x03
#define DO_HDLC_LEVEL_ERROR_CHECKING 0x04
/****** DATA STRUCTURES *****************************************************/
/*----------------------------------------------------------------------------
* X.25 Command Block.
*/
typedef struct X25Cmd
{
unsigned char command PACKED; /* command code */
unsigned short length PACKED; /* transfer data length */
unsigned char result PACKED; /* return code */
unsigned char pf PACKED; /* P/F bit */
unsigned short lcn PACKED; /* logical channel */
unsigned char qdm PACKED; /* Q/D/M bits */
unsigned char cause PACKED; /* cause field */
unsigned char diagn PACKED; /* diagnostics */
unsigned char pktType PACKED; /* packet type */
unsigned char resrv[4] PACKED; /* reserved */
} TX25Cmd;
/*
* Defines for the 'command' field.
*/
/*----- General commands --------------*/
#define X25_SET_GLOBAL_VARS 0x0B /* set global variables */
#define X25_READ_MODEM_STATUS 0x0C /* read modem status */
#define X25_READ_CODE_VERSION 0x15 /* read firmware version number */
#define X25_TRACE_CONFIGURE 0x14 /* configure trace facility */
#define X25_READ_TRACE_DATA 0x16 /* read trace data */
#define X25_SET_INTERRUPT_MODE 0x17 /* set interrupt generation mode */
#define X25_READ_INTERRUPT_MODE 0x18 /* read interrupt generation mode */
/*----- HDLC-level commands -----------*/
#define X25_HDLC_LINK_CONFIGURE 0x01 /* configure HDLC link level */
#define X25_HDLC_LINK_OPEN 0x02 /* open HDLC link */
#define X25_HDLC_LINK_CLOSE 0x03 /* close HDLC link */
#define X25_HDLC_LINK_SETUP 0x04 /* set up HDLC link */
#define X25_HDLC_LINK_DISC 0x05 /* disconnect DHLC link */
#define X25_HDLC_LINK_STATUS 0x06 /* read DHLC link status */
#define X25_HDLC_READ_STATS 0x07 /* read operational statistics */
#define X25_HDLC_FLUSH_STATS 0x08 /* flush operational statistics */
#define X25_HDLC_READ_COMM_ERR 0x09 /* read error statistics */
#define X25_HDLC_FLUSH_COMM_ERR 0x0A /* flush error statistics */
#define X25_HDLC_FLUSH_BUFFERS 0x0D /* flush HDLC-level data buffers */
#define X25_HDLC_SPRVS_CNT_STAT 0x0F /* read surervisory count status */
#define X25_HDLC_SEND_UI_FRAME 0x10 /* send unnumbered information frame */
#define X25_HDLC_WRITE 0x11 /* send HDLC information frame */
#define X25_HDLC_READ 0x21 /* read HDLC information frame */
#define X25_HDLC_READ_CONFIG 0x12 /* read HDLC configuration */
#define X25_HDLC_SET_CONFIG 0x13 /* set HDLC configuration */
#define SET_PROTOCOL_LEVEL 0x1F /* set protocol level */
/*----- X.25-level commands -----------*/
#define X25_READ 0x22 /* read X.25 packet */
#define X25_WRITE 0x23 /* send X.25 packet */
#define X25_PLACE_CALL 0x30 /* place a call on SVC */
#define X25_ACCEPT_CALL 0x31 /* accept incomming call */
#define X25_CLEAR_CALL 0x32 /* clear call */
#define X25_CLEAR_CONFRM 0x33 /* send clear confirmation packet */
#define X25_RESET 0x34 /* send reset request packet */
#define X25_RESET_CONFRM 0x35 /* send reset confirmation packet */
#define X25_RESTART 0x36 /* send restart request packet */
#define X25_RESTART_CONFRM 0x37 /* send restart confirmation packet */
#define X25_INTERRUPT 0x38 /* send interrupt request packet */
#define X25_INTERRUPT_CONFRM 0x39 /* send interrupt confirmation pkt */
#define X25_REGISTRATION_RQST 0x3A /* send registration request packet */
#define X25_REGISTRATION_CONFRM 0x3B /* send registration confirmation */
#define X25_IS_DATA_AVAILABLE 0x40 /* querry receive queue */
#define X25_INCOMMING_CALL_CTL 0x41 /* select incomming call options */
#define X25_CONFIGURE_PVC 0x42 /* configure PVC */
#define X25_GET_ACTIVE_CHANNELS 0x43 /* get a list of active circuits */
#define X25_READ_CHANNEL_CONFIG 0x44 /* read virt. circuit configuration */
#define X25_FLUSH_DATA_BUFFERS 0x45 /* flush X.25-level data buffers */
#define X25_READ_HISTORY_TABLE 0x46 /* read asynchronous event log */
#define X25_HISTORY_TABLE_CTL 0x47 /* control asynchronous event log */
#define X25_GET_TX_D_BIT_STATUS 0x48 /* is packet with D-bit acknowleged */
#define X25_READ_STATISTICS 0x49 /* read X.25-level statistics */
#define X25_FLUSH_STATISTICS 0x4A /* flush X.25-level statistics */
#define X25_READ_CONFIGURATION 0x50 /* read HDLC & X.25 configuration */
#define X25_SET_CONFIGURATION 0x51 /* set HDLC & X.25 configuration */
/*
* Defines for the 'result' field.
*/
/*----- General results ---------------*/
#define X25RES_OK 0x00
#define X25RES_ERROR 0x01
#define X25RES_LINK_NOT_IN_ABM 0x02 /* link is not in ABM mode */
#define X25RES_LINK_CLOSED 0x03
#define X25RES_INVAL_LENGTH 0x04
#define X25RES_INVAL_CMD 0x05
#define X25RES_UNNUMBERED_FRAME 0x06 /* unnunbered frame received */
#define X25RES_FRM_REJECT_MODE 0x07 /* link is in Frame Reject mode */
#define X25RES_MODEM_FAILURE 0x08 /* DCD and/or CTS dropped */
#define X25RES_N2_RETRY_LIMIT 0x09 /* N2 retry limit has been exceeded */
#define X25RES_INVAL_LCN 0x30 /* invalid logical channel number */
#define X25RES_INVAL_STATE 0x31 /* channel is not in data xfer mode */
#define X25RES_INVAL_DATA_LEN 0x32 /* invalid data length */
#define X25RES_NOT_READY 0x33 /* no data available / buffers full */
#define X25RES_NETWORK_DOWN 0x34
#define X25RES_CHANNEL_IN_USE 0x35 /* there is data queued on this LCN */
#define X25RES_REGST_NOT_SUPPRT 0x36 /* registration not supported */
#define X25RES_INVAL_FORMAT 0x37 /* invalid packet format */
#define X25RES_D_BIT_NOT_SUPPRT 0x38 /* D-bit pragmatics not supported */
#define X25RES_FACIL_NOT_SUPPRT 0x39 /* Call facility not supported */
#define X25RES_INVAL_CALL_ARG 0x3A /* errorneous call arguments */
#define X25RES_INVAL_CALL_DATA 0x3B /* errorneous call user data */
#define X25RES_ASYNC_PACKET 0x40 /* asynchronous packet received */
#define X25RES_PROTO_VIOLATION 0x41 /* protocol violation occurred */
#define X25RES_PKT_TIMEOUT 0x42 /* X.25 packet time out */
#define X25RES_PKT_RETRY_LIMIT 0x43 /* X.25 packet retry limit exceeded */
/*----- Command-dependent results -----*/
#define X25RES_LINK_DISC 0x00 /* HDLC_LINK_STATUS */
#define X25RES_LINK_IN_ABM 0x01 /* HDLC_LINK_STATUS */
#define X25RES_NO_DATA 0x01 /* HDLC_READ/READ_TRACE_DATA*/
#define X25RES_TRACE_INACTIVE 0x02 /* READ_TRACE_DATA */
#define X25RES_LINK_IS_OPEN 0x01 /* HDLC_LINK_OPEN */
#define X25RES_LINK_IS_DISC 0x02 /* HDLC_LINK_DISC */
#define X25RES_LINK_IS_CLOSED 0x03 /* HDLC_LINK_CLOSE */
#define X25RES_INVAL_PARAM 0x31 /* INCOMMING_CALL_CTL */
#define X25RES_INVAL_CONFIG 0x35 /* REGISTR_RQST/CONFRM */
/*
* Defines for the 'qdm_bits' field.
*/
#define X25CMD_Q_BIT_MASK 0x04
#define X25CMD_D_BIT_MASK 0x02
#define X25CMD_M_BIT_MASK 0x01
/*
* Defines for the 'pkt_type' field.
*/
/*----- Asynchronous events ------*/
#define ASE_CLEAR_RQST 0x02
#define ASE_RESET_RQST 0x04
#define ASE_RESTART_RQST 0x08
#define ASE_INTERRUPT 0x10
#define ASE_DTE_REGISTR_RQST 0x20
#define ASE_CALL_RQST 0x30
#define ASE_CALL_ACCEPTED 0x31
#define ASE_CLEAR_CONFRM 0x32
#define ASE_RESET_CONFRM 0x33
#define ASE_RESTART_CONFRM 0x34
#define ASE_INTERRUPT_CONFRM 0x35
#define ASE_DCE_REGISTR_CONFRM 0x36
#define ASE_DIAGNOSTIC 0x37
#define ASE_CALL_AUTO_CLEAR 0x38
#define AUTO_RESPONSE_FLAG 0x80
/*----- Time-Out events ----------*/
#define TOE_RESTART_RQST 0x03
#define TOE_CALL_RQST 0x05
#define TOE_CLEAR_RQST 0x08
#define TOE_RESET_RQST 0x0A
/*----- Protocol Violation events */
#define PVE_CLEAR_RQST 0x32
#define PVE_RESET_RQST 0x33
#define PVE_RESTART_RQST 0x34
#define PVE_DIAGNOSTIC 0x37
#define INTR_ON_RX_FRAME 0x01
#define INTR_ON_TX_FRAME 0x02
#define INTR_ON_MODEM_STATUS_CHANGE 0x04
#define INTR_ON_COMMAND_COMPLETE 0x08
#define INTR_ON_X25_ASY_TRANSACTION 0x10
#define INTR_ON_TIMER 0x40
#define DIRECT_RX_INTR_USAGE 0x80
#define NO_INTR_PENDING 0x00
#define RX_INTR_PENDING 0x01
#define TX_INTR_PENDING 0x02
#define MODEM_INTR_PENDING 0x04
#define COMMAND_COMPLETE_INTR_PENDING 0x08
#define X25_ASY_TRANS_INTR_PENDING 0x10
#define TIMER_INTR_PENDING 0x40
/*----------------------------------------------------------------------------
* X.25 Mailbox.
* This structure is located at offsets X25_MBOX_OFFS and X25_RXMBOX_OFFS
* into shared memory window.
*/
typedef struct X25Mbox
{
unsigned char opflag PACKED; /* 00h: execution flag */
TX25Cmd cmd PACKED; /* 01h: command block */
unsigned char data[1] PACKED; /* 10h: data buffer */
} TX25Mbox;
/*----------------------------------------------------------------------------
* X.25 Time Stamp Structure.
*/
typedef struct X25TimeStamp
{
unsigned char month PACKED;
unsigned char date PACKED;
unsigned char sec PACKED;
unsigned char min PACKED;
unsigned char hour PACKED;
} TX25TimeStamp;
/*----------------------------------------------------------------------------
* X.25 Status Block.
* This structure is located at offset X25_STATUS_OFF into shared memory
* window.
*/
typedef struct X25Status
{
unsigned short pvc_map PACKED; /* 00h: PVC map */
unsigned short icc_map PACKED; /* 02h: Incomming Chan. map */
unsigned short twc_map PACKED; /* 04h: Two-way Cnan. map */
unsigned short ogc_map PACKED; /* 06h: Outgoing Chan. map */
TX25TimeStamp tstamp PACKED; /* 08h: timestamp (BCD) */
unsigned char iflags PACKED; /* 0Dh: interrupt flags */
unsigned char imask PACKED; /* 0Eh: interrupt mask */
unsigned char resrv PACKED; /* 0Eh: */
unsigned char gflags PACKED; /* 10h: misc. HDLC/X25 flags */
unsigned char cflags[X25_MAX_CHAN] PACKED; /* channel status bytes */
} TX25Status;
/*
* Bitmasks for the 'iflags' field.
*/
#define X25_RX_INTR 0x01 /* receive interrupt */
#define X25_TX_INTR 0x02 /* transmit interrupt */
#define X25_MODEM_INTR 0x04 /* modem status interrupt (CTS/DCD) */
#define X25_EVENT_INTR 0x10 /* asyncronous event encountered */
#define X25_CMD_INTR 0x08 /* interface command complete */
/*
* Bitmasks for the 'gflags' field.
*/
#define X25_HDLC_ABM 0x01 /* HDLC is in ABM mode */
#define X25_RX_READY 0x02 /* X.25 data available */
#define X25_TRACE_READY 0x08 /* trace data available */
#define X25_EVENT_IND 0x20 /* asynchronous event indicator */
#define X25_TX_READY 0x40 /* space is available in Tx buf.*/
/*
* Bitmasks for the 'cflags' field.
*/
#define X25_XFER_MODE 0x80 /* channel is in data transfer mode */
#define X25_TXWIN_OPEN 0x40 /* transmit window open */
#define X25_RXBUF_MASK 0x3F /* number of data buffers available */
/*****************************************************************************
* Following definitions structurize contents of the TX25Mbox.data field for
* different X.25 interface commands.
****************************************************************************/
/* ---------------------------------------------------------------------------
* X25_SET_GLOBAL_VARS Command.
*/
typedef struct X25GlobalVars
{
unsigned char resrv PACKED; /* 00h: reserved */
unsigned char dtrCtl PACKED; /* 01h: DTR control code */
unsigned char resErr PACKED; /* 01h: '1' - reset modem error */
} TX25GlobalVars;
/*
* Defines for the 'dtrCtl' field.
*/
#define X25_RAISE_DTR 0x01
#define X25_DROP_DTR 0x02
/* ---------------------------------------------------------------------------
* X25_READ_MODEM_STATUS Command.
*/
typedef struct X25ModemStatus
{
unsigned char status PACKED; /* 00h: modem status */
} TX25ModemStatus;
/*
* Defines for the 'status' field.
*/
#define X25_CTS_MASK 0x20
#define X25_DCD_MASK 0x08
/* ---------------------------------------------------------------------------
* X25_HDLC_LINK_STATUS Command.
*/
typedef struct X25LinkStatus
{
unsigned char txQueued PACKED; /* 00h: queued Tx I-frames*/
unsigned char rxQueued PACKED; /* 01h: queued Rx I-frames*/
unsigned char station PACKED; /* 02h: DTE/DCE config. */
unsigned char reserved PACKED; /* 03h: reserved */
unsigned char sfTally PACKED; /* 04h: supervisory frame tally */
} TX25LinkStatus;
/*
* Defines for the 'station' field.
*/
#define X25_STATION_DTE 0x01 /* station configured as DTE */
#define X25_STATION_DCE 0x02 /* station configured as DCE */
/* ---------------------------------------------------------------------------
* X25_HDLC_READ_STATS Command.
*/
typedef struct HdlcStats
{ /* a number of ... */
unsigned short rxIFrames PACKED; /* 00h: ready Rx I-frames */
unsigned short rxNoseq PACKED; /* 02h: frms out-of-sequence */
unsigned short rxNodata PACKED; /* 04h: I-frms without data */
unsigned short rxDiscarded PACKED; /* 06h: discarded frames */
unsigned short rxTooLong PACKED; /* 08h: frames too long */
unsigned short rxBadAddr PACKED; /* 0Ah: frms with inval.addr*/
unsigned short txAcked PACKED; /* 0Ch: acknowledged I-frms */
unsigned short txRetransm PACKED; /* 0Eh: re-transmit. I-frms */
unsigned short t1Timeout PACKED; /* 10h: T1 timeouts */
unsigned short rxSABM PACKED; /* 12h: received SABM frames */
unsigned short rxDISC PACKED; /* 14h: received DISC frames */
unsigned short rxDM PACKED; /* 16h: received DM frames */
unsigned short rxFRMR PACKED; /* 18h: FRMR frames received */
unsigned short txSABM PACKED; /* 1Ah: transm. SABM frames*/
unsigned short txDISC PACKED; /* 1Ch: transm. DISC frames*/
unsigned short txDM PACKED; /* 1Eh: transm. DM frames */
unsigned short txFRMR PACKED; /* 20h: transm. FRMR frames*/
} THdlcStats;
/* ---------------------------------------------------------------------------
* X25_HDLC_READ_COMM_ERR Command.
*/
typedef struct HdlcCommErr
{ /* a number of ... */
unsigned char rxOverrun PACKED; /* 00h: Rx overrun errors */
unsigned char rxBadCrc PACKED; /* 01h: Rx CRC errors */
unsigned char rxAborted PACKED; /* 02h: Rx aborted frames */
unsigned char rxDropped PACKED; /* 03h: frames lost */
unsigned char txAborted PACKED; /* 04h: Tx aborted frames */
unsigned char txUnderrun PACKED; /* 05h: Tx underrun errors */
unsigned char txMissIntr PACKED; /* 06h: missed underrun ints */
unsigned char reserved PACKED; /* 07h: reserved */
unsigned char droppedDCD PACKED; /* 08h: times DCD dropped */
unsigned char droppedCTS PACKED; /* 09h: times CTS dropped */
} THdlcCommErr;
/* ---------------------------------------------------------------------------
* X25_SET_CONFIGURATION & X25_READ_CONFIGURATION Commands.
*/
typedef struct X25Config
{
unsigned char baudRate PACKED; /* 00h: */
unsigned char t1 PACKED; /* 01h: */
unsigned char t2 PACKED; /* 02h: */
unsigned char n2 PACKED; /* 03h: */
unsigned short hdlcMTU PACKED; /* 04h: */
unsigned char hdlcWindow PACKED; /* 06h: */
unsigned char t4 PACKED; /* 07h: */
unsigned char autoModem PACKED; /* 08h: */
unsigned char autoHdlc PACKED; /* 09h: */
unsigned char hdlcOptions PACKED; /* 0Ah: */
unsigned char station PACKED; /* 0Bh: */
unsigned char pktWindow PACKED; /* 0Ch: */
unsigned short defPktSize PACKED; /* 0Dh: */
unsigned short pktMTU PACKED; /* 0Fh: */
unsigned short loPVC PACKED; /* 11h: */
unsigned short hiPVC PACKED; /* 13h: */
unsigned short loIncommingSVC PACKED; /* 15h: */
unsigned short hiIncommingSVC PACKED; /* 17h: */
unsigned short loTwoWaySVC PACKED; /* 19h: */
unsigned short hiTwoWaySVC PACKED; /* 1Bh: */
unsigned short loOutgoingSVC PACKED; /* 1Dh: */
unsigned short hiOutgoingSVC PACKED; /* 1Fh: */
unsigned short options PACKED; /* 21h: */
unsigned char responseOpt PACKED; /* 23h: */
unsigned short facil1 PACKED; /* 24h: */
unsigned short facil2 PACKED; /* 26h: */
unsigned short ccittFacil PACKED; /* 28h: */
unsigned short otherFacil PACKED; /* 2Ah: */
unsigned short ccittCompat PACKED; /* 2Ch: */
unsigned char t10t20 PACKED; /* 2Eh: */
unsigned char t11t21 PACKED; /* 2Fh: */
unsigned char t12t22 PACKED; /* 30h: */
unsigned char t13t23 PACKED; /* 31h: */
unsigned char t16t26 PACKED; /* 32H: */
unsigned char t28 PACKED; /* 33h: */
unsigned char r10r20 PACKED; /* 34h: */
unsigned char r12r22 PACKED; /* 35h: */
unsigned char r13r23 PACKED; /* 36h: */
} TX25Config;
/* ---------------------------------------------------------------------------
* X25_READ_CHANNEL_CONFIG Command.
*/
typedef struct X25ChanAlloc /*----- Channel allocation -*/
{
unsigned short loPVC PACKED; /* 00h: lowest PVC number */
unsigned short hiPVC PACKED; /* 02h: highest PVC number */
unsigned short loIncommingSVC PACKED; /* 04h: lowest incoming SVC */
unsigned short hiIncommingSVC PACKED; /* 06h: highest incoming SVC */
unsigned short loTwoWaySVC PACKED; /* 08h: lowest two-way SVC */
unsigned short hiTwoWaySVC PACKED; /* 0Ah: highest two-way SVC */
unsigned short loOutgoingSVC PACKED; /* 0Ch: lowest outgoing SVC */
unsigned short hiOutgoingSVC PACKED; /* 0Eh: highest outgoing SVC */
} TX25ChanAlloc;
typedef struct X25ChanCfg /*------ Channel configuration -----*/
{
unsigned char type PACKED; /* 00h: channel type */
unsigned char txConf PACKED; /* 01h: Tx packet and window sizes */
unsigned char rxConf PACKED; /* 01h: Rx packet and window sizes */
} TX25ChanCfg;
/*
* Defines for the 'type' field.
*/
#define X25_PVC 0x01 /* PVC */
#define X25_SVC_IN 0x03 /* Incoming SVC */
#define X25_SVC_TWOWAY 0x07 /* Two-way SVC */
#define X25_SVC_OUT 0x0B /* Outgoing SVC */
/*----------------------------------------------------------------------------
* X25_READ_STATISTICS Command.
*/
typedef struct X25Stats
{ /* number of packets Tx/Rx'ed */
unsigned short txRestartRqst PACKED; /* 00h: Restart Request */
unsigned short rxRestartRqst PACKED; /* 02h: Restart Request */
unsigned short txRestartConf PACKED; /* 04h: Restart Confirmation */
unsigned short rxRestartConf PACKED; /* 06h: Restart Confirmation */
unsigned short txResetRqst PACKED; /* 08h: Reset Request */
unsigned short rxResetRqst PACKED; /* 0Ah: Reset Request */
unsigned short txResetConf PACKED; /* 0Ch: Reset Confirmation */
unsigned short rxResetConf PACKED; /* 0Eh: Reset Confirmation */
unsigned short txCallRequest PACKED; /* 10h: Call Request */
unsigned short rxCallRequest PACKED; /* 12h: Call Request */
unsigned short txCallAccept PACKED; /* 14h: Call Accept */
unsigned short rxCallAccept PACKED; /* 16h: Call Accept */
unsigned short txClearRqst PACKED; /* 18h: Clear Request */
unsigned short rxClearRqst PACKED; /* 1Ah: Clear Request */
unsigned short txClearConf PACKED; /* 1Ch: Clear Confirmation */
unsigned short rxClearConf PACKED; /* 1Eh: Clear Confirmation */
unsigned short txDiagnostic PACKED; /* 20h: Diagnostic */
unsigned short rxDiagnostic PACKED; /* 22h: Diagnostic */
unsigned short txRegRqst PACKED; /* 24h: Registration Request */
unsigned short rxRegRqst PACKED; /* 26h: Registration Request */
unsigned short txRegConf PACKED; /* 28h: Registration Confirm.*/
unsigned short rxRegConf PACKED; /* 2Ah: Registration Confirm.*/
unsigned short txInterrupt PACKED; /* 2Ch: Interrupt */
unsigned short rxInterrupt PACKED; /* 2Eh: Interrupt */
unsigned short txIntrConf PACKED; /* 30h: Interrupt Confirm. */
unsigned short rxIntrConf PACKED; /* 32h: Interrupt Confirm. */
unsigned short txData PACKED; /* 34h: Data */
unsigned short rxData PACKED; /* 36h: Data */
unsigned short txRR PACKED; /* 38h: RR */
unsigned short rxRR PACKED; /* 3Ah: RR */
unsigned short txRNR PACKED; /* 3Ch: RNR */
unsigned short rxRNR PACKED; /* 3Eh: RNR */
} TX25Stats;
/*----------------------------------------------------------------------------
* X25_READ_HISTORY_TABLE Command.
*/
typedef struct X25EventLog
{
unsigned char type PACKED; /* 00h: transaction type */
unsigned short lcn PACKED; /* 01h: logical channel num */
unsigned char packet PACKED; /* 03h: async packet type */
unsigned char cause PACKED; /* 04h: X.25 cause field */
unsigned char diag PACKED; /* 05h: X.25 diag field */
TX25TimeStamp ts PACKED; /* 06h: time stamp */
} TX25EventLog;
/*
* Defines for the 'type' field.
*/
#define X25LOG_INCOMMING 0x00
#define X25LOG_APPLICATION 0x01
#define X25LOG_AUTOMATIC 0x02
#define X25LOG_ERROR 0x04
#define X25LOG_TIMEOUT 0x08
#define X25LOG_RECOVERY 0x10
/*
* Defines for the 'packet' field.
*/
#define X25LOG_CALL_RQST 0x0B
#define X25LOG_CALL_ACCEPTED 0x0F
#define X25LOG_CLEAR_RQST 0x13
#define X25LOG_CLEAR_CONFRM 0x17
#define X25LOG_RESET_RQST 0x1B
#define X25LOG_RESET_CONFRM 0x1F
#define X25LOG_RESTART_RQST 0xFB
#define X25LOG_RESTART_COMFRM 0xFF
#define X25LOG_DIAGNOSTIC 0xF1
#define X25LOG_DTE_REG_RQST 0xF3
#define X25LOG_DTE_REG_COMFRM 0xF7
/* ---------------------------------------------------------------------------
* X25_TRACE_CONFIGURE Command.
*/
typedef struct X25TraceCfg
{
unsigned char flags PACKED; /* 00h: trace configuration flags */
unsigned char timeout PACKED; /* 01h: timeout for trace delay mode*/
} TX25TraceCfg;
/*
* Defines for the 'flags' field.
*/
#define X25_TRC_ENABLE 0x01 /* bit0: '1' - trace enabled */
#define X25_TRC_TIMESTAMP 0x02 /* bit1: '1' - time stamping enabled*/
#define X25_TRC_DELAY 0x04 /* bit2: '1' - trace delay enabled */
#define X25_TRC_DATA 0x08 /* bit3: '1' - trace data packets */
#define X25_TRC_SUPERVISORY 0x10 /* bit4: '1' - trace suprvisory pkts*/
#define X25_TRC_ASYNCHRONOUS 0x20 /* bit5: '1' - trace asynch. packets*/
#define X25_TRC_HDLC 0x40 /* bit6: '1' - trace all packets */
#define X25_TRC_READ 0x80 /* bit7: '1' - get current config. */
/* ---------------------------------------------------------------------------
* X25_READ_TRACE_DATA Command.
*/
typedef struct X25Trace /*----- Trace data structure -------*/
{
unsigned short length PACKED; /* 00h: trace data length */
unsigned char type PACKED; /* 02h: trace type */
unsigned char lost_cnt PACKED; /* 03h: N of traces lost */
TX25TimeStamp tstamp PACKED; /* 04h: mon/date/sec/min/hour */
unsigned short millisec PACKED; /* 09h: ms time stamp */
unsigned char data[0] PACKED; /* 0Bh: traced frame */
} TX25Trace;
/*
* Defines for the 'type' field.
*/
#define X25_TRC_TYPE_MASK 0x0F /* bits 0..3: trace type */
#define X25_TRC_TYPE_RX_FRAME 0x00 /* received frame trace */
#define X25_TRC_TYPE_TX_FRAME 0x01 /* transmitted frame */
#define X25_TRC_TYPE_ERR_FRAME 0x02 /* error frame */
#define X25_TRC_ERROR_MASK 0xF0 /* bits 4..7: error code */
#define X25_TRCERR_RX_ABORT 0x10 /* receive abort error */
#define X25_TRCERR_RX_BADCRC 0x20 /* receive CRC error */
#define X25_TRCERR_RX_OVERRUN 0x30 /* receiver overrun error */
#define X25_TRCERR_RX_TOO_LONG 0x40 /* excessive frame length error */
#define X25_TRCERR_TX_ABORT 0x70 /* aborted frame transmittion error */
#define X25_TRCERR_TX_UNDERRUN 0x80 /* transmit underrun error */
/*****************************************************************************
* Following definitions describe HDLC frame and X.25 packet formats.
****************************************************************************/
typedef struct HDLCFrame /*----- DHLC Frame Format ----------*/
{
unsigned char addr PACKED; /* address field */
unsigned char cntl PACKED; /* control field */
unsigned char data[0] PACKED;
} THDLCFrame;
typedef struct X25Pkt /*----- X.25 Paket Format ----------*/
{
unsigned char lcn_hi PACKED; /* 4 MSB of Logical Channel Number */
unsigned char lcn_lo PACKED; /* 8 LSB of Logical Channel Number */
unsigned char type PACKED;
unsigned char data[0] PACKED;
} TX25Pkt;
/*
* Defines for the 'lcn_hi' field.
*/
#define X25_Q_BIT_MASK 0x80 /* Data Qualifier Bit mask */
#define X25_D_BIT_MASK 0x40 /* Delivery Confirmation Bit mask */
#define X25_M_BITS_MASK 0x30 /* Modulo Bits mask */
#define X25_LCN_MSB_MASK 0x0F /* LCN most significant bits mask */
/*
* Defines for the 'type' field.
*/
#define X25PKT_DATA 0x01 /* Data packet mask */
#define X25PKT_SUPERVISORY 0x02 /* Supervisory packet mask */
#define X25PKT_CALL_RQST 0x0B /* Call Request/Incoming */
#define X25PKT_CALL_ACCEPTED 0x0F /* Call Accepted/Connected */
#define X25PKT_CLEAR_RQST 0x13 /* Clear Request/Indication */
#define X25PKT_CLEAR_CONFRM 0x17 /* Clear Confirmation */
#define X25PKT_RESET_RQST 0x1B /* Reset Request/Indication */
#define X25PKT_RESET_CONFRM 0x1F /* Reset Confirmation */
#define X25PKT_RESTART_RQST 0xFB /* Restart Request/Indication */
#define X25PKT_RESTART_CONFRM 0xFF /* Restart Confirmation */
#define X25PKT_INTERRUPT 0x23 /* Interrupt */
#define X25PKT_INTERRUPT_CONFRM 0x27 /* Interrupt Confirmation */
#define X25PKT_DIAGNOSTIC 0xF1 /* Diagnostic */
#define X25PKT_REGISTR_RQST 0xF3 /* Registration Request */
#define X25PKT_REGISTR_CONFRM 0xF7 /* Registration Confirmation */
#define X25PKT_RR_MASKED 0x01 /* Receive Ready packet after masking */
#define X25PKT_RNR_MASKED 0x05 /* Receive Not Ready after masking */
typedef struct {
TX25Cmd cmd PACKED;
char data[X25_MAX_DATA] PACKED;
} mbox_cmd_t;
typedef struct {
unsigned char qdm PACKED; /* Q/D/M bits */
unsigned char cause PACKED; /* cause field */
unsigned char diagn PACKED; /* diagnostics */
unsigned char pktType PACKED;
unsigned short length PACKED;
unsigned char result PACKED;
unsigned short lcn PACKED;
char reserved[7] PACKED;
}x25api_hdr_t;
typedef struct {
x25api_hdr_t hdr PACKED;
char data[X25_MAX_DATA] PACKED;
}x25api_t;
/*
* XPIPEMON Definitions
*/
/* valid ip_protocol for UDP management */
#define UDPMGMT_UDP_PROTOCOL 0x11
#define UDPMGMT_XPIPE_SIGNATURE "XLINK8ND"
#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 char opp_flag PACKED; /* the opp flag */
unsigned char command PACKED; /* command code */
unsigned short length PACKED; /* transfer data length */
unsigned char result PACKED; /* return code */
unsigned char pf PACKED; /* P/F bit */
unsigned short lcn PACKED; /* logical channel */
unsigned char qdm PACKED; /* Q/D/M bits */
unsigned char cause PACKED; /* cause field */
unsigned char diagn PACKED; /* diagnostics */
unsigned char pktType PACKED; /* packet type */
unsigned char resrv[4] PACKED; /* reserved */
} cblock_t;
typedef struct {
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;
} x25_udp_pkt_t;
typedef struct read_hdlc_stat {
unsigned short inf_frames_rx_ok PACKED;
unsigned short inf_frames_rx_out_of_seq PACKED;
unsigned short inf_frames_rx_no_data PACKED;
unsigned short inf_frames_rx_dropped PACKED;
unsigned short inf_frames_rx_data_too_long PACKED;
unsigned short inf_frames_rx_invalid_addr PACKED;
unsigned short inf_frames_tx_ok PACKED;
unsigned short inf_frames_tx_retransmit PACKED;
unsigned short T1_timeouts PACKED;
unsigned short SABM_frames_rx PACKED;
unsigned short DISC_frames_rx PACKED;
unsigned short DM_frames_rx PACKED;
unsigned short FRMR_frames_rx PACKED;
unsigned short SABM_frames_tx PACKED;
unsigned short DISC_frames_tx PACKED;
unsigned short DM_frames_tx PACKED;
unsigned short FRMR_frames_tx PACKED;
} read_hdlc_stat_t;
typedef struct read_comms_err_stats{
unsigned char overrun_err_rx PACKED;
unsigned char CRC_err PACKED;
unsigned char abort_frames_rx PACKED;
unsigned char frames_dropped_buf_full PACKED;
unsigned char abort_frames_tx PACKED;
unsigned char transmit_underruns PACKED;
unsigned char missed_tx_underruns_intr PACKED;
unsigned char reserved PACKED;
unsigned char DCD_drop PACKED;
unsigned char CTS_drop PACKED;
} read_comms_err_stats_t;
typedef struct trace_data {
unsigned short length PACKED;
unsigned char type PACKED;
unsigned char trace_dropped PACKED;
unsigned char reserved[5] PACKED;
unsigned short timestamp PACKED;
unsigned char data PACKED;
} trace_data_t;
enum {UDP_XPIPE_TYPE};
#define XPIPE_ENABLE_TRACING 0x14
#define XPIPE_DISABLE_TRACING 0x14
#define XPIPE_GET_TRACE_INFO 0x16
#define XPIPE_FT1_READ_STATUS 0x74
#define XPIPE_DRIVER_STAT_IFSEND 0x75
#define XPIPE_DRIVER_STAT_INTR 0x76
#define XPIPE_DRIVER_STAT_GEN 0x77
#define XPIPE_FLUSH_DRIVER_STATS 0x78
#define XPIPE_ROUTER_UP_TIME 0x79
#define XPIPE_SET_FT1_MODE 0x81
#define XPIPE_FT1_STATUS_CTRL 0x80
/* error messages */
#define NO_BUFFS_OR_CLOSED_WIN 0x33
#define DATA_LENGTH_TOO_BIG 0x32
#define NO_DATA_AVAILABLE 0x33
#define Z80_TIMEOUT_ERROR 0x0a
#define NO_BUFFS 0x08
/* Trace options */
#define TRACE_DEFAULT 0x03
#define TRACE_SUPERVISOR_FRMS 0x10
#define TRACE_ASYNC_FRMS 0x20
#define TRACE_ALL_HDLC_FRMS 0x40
#define TRACE_DATA_FRMS 0x08
#endif /* _SDLA_X25_H */

View File

@ -1,66 +0,0 @@
/*****************************************************************************
* sdladrv.h SDLA Support Module. Kernel API Definitions.
*
* Author: Gideon Hack
*
* Copyright: (c) 1995-2000 Sangoma Technologies Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
* ============================================================================
* Jun 02, 1999 Gideon Hack Added support for the S514 PCI adapter.
* Dec 11, 1996 Gene Kozin Complete overhaul.
* Oct 17, 1996 Gene Kozin Minor bug fixes.
* Jun 12, 1996 Gene Kozin Added support for S503 card.
* Dec 06, 1995 Gene Kozin Initial version.
*****************************************************************************/
#ifndef _SDLADRV_H
#define _SDLADRV_H
#define SDLA_MAXIORANGE 4 /* maximum I/O port range */
#define SDLA_WINDOWSIZE 0x2000 /* default dual-port memory window size */
/****** Data Structures *****************************************************/
/*----------------------------------------------------------------------------
* Adapter hardware configuration. Pointer to this structure is passed to all
* APIs.
*/
typedef struct sdlahw
{
unsigned type; /* adapter type */
unsigned fwid; /* firmware ID */
unsigned port; /* adapter I/O port base */
int irq; /* interrupt request level */
char S514_cpu_no[1]; /* PCI CPU Number */
unsigned char S514_slot_no; /* PCI Slot Number */
char auto_pci_cfg; /* Autodetect PCI Slot */
struct pci_dev *pci_dev; /* PCI device */
void * dpmbase; /* dual-port memory base */
unsigned dpmsize; /* dual-port memory size */
unsigned pclk; /* CPU clock rate, kHz */
unsigned long memory; /* memory size */
unsigned long vector; /* local offset of the DPM window */
unsigned io_range; /* I/O port range */
unsigned char regs[SDLA_MAXIORANGE]; /* was written to registers */
unsigned reserved[5];
} sdlahw_t;
/****** Function Prototypes *************************************************/
extern int sdla_setup (sdlahw_t* hw, void* sfm, unsigned len);
extern int sdla_down (sdlahw_t* hw);
extern void S514_intack (sdlahw_t* hw, u32 int_status);
extern void read_S514_int_stat (sdlahw_t* hw, u32* int_status);
extern int sdla_mapmem (sdlahw_t* hw, unsigned long addr);
extern int sdla_peek (sdlahw_t* hw, unsigned long addr, void* buf,
unsigned len);
extern int sdla_poke (sdlahw_t* hw, unsigned long addr, void* buf,
unsigned len);
extern int sdla_exec (void* opflag);
extern unsigned wanpipe_hw_probe(void);
#endif /* _SDLADRV_H */

View File

@ -1,72 +0,0 @@
/*****************************************************************************
* sdlapci.h WANPIPE(tm) Multiprotocol WAN Link Driver.
* Definitions for the SDLA PCI adapter.
*
* Author: Gideon Hack <ghack@sangoma.com>
*
* Copyright: (c) 1999-2000 Sangoma Technologies Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
* ============================================================================
* Jun 02, 1999 Gideon Hack Initial version.
*****************************************************************************/
#ifndef _SDLAPCI_H
#define _SDLAPCI_H
/****** Defines *************************************************************/
/* Definitions for identifying and finding S514 PCI adapters */
#define V3_VENDOR_ID 0x11B0 /* V3 vendor ID number */
#define V3_DEVICE_ID 0x0002 /* V3 device ID number */
#define SANGOMA_SUBSYS_VENDOR 0x4753 /* ID for Sangoma */
#define PCI_DEV_SLOT_MASK 0x1F /* mask for slot numbering */
#define PCI_IRQ_NOT_ALLOCATED 0xFF /* interrupt line for no IRQ */
/* Local PCI register offsets */
#define PCI_VENDOR_ID_WORD 0x00 /* vendor ID */
#define PCI_IO_BASE_DWORD 0x10 /* IO base */
#define PCI_MEM_BASE0_DWORD 0x14 /* memory base - apperture 0 */
#define PCI_MEM_BASE1_DWORD 0x18 /* memory base - apperture 1 */
#define PCI_SUBSYS_VENDOR_WORD 0x2C /* subsystem vendor ID */
#define PCI_INT_LINE_BYTE 0x3C /* interrupt line */
#define PCI_INT_PIN_BYTE 0x3D /* interrupt pin */
#define PCI_MAP0_DWORD 0x40 /* PCI to local bus address 0 */
#define PCI_MAP1_DWORD 0x44 /* PCI to local bus address 1 */
#define PCI_INT_STATUS 0x48 /* interrupt status */
#define PCI_INT_CONFIG 0x4C /* interrupt configuration */
/* Local PCI register usage */
#define PCI_MEMORY_ENABLE 0x00000003 /* enable PCI memory */
#define PCI_CPU_A_MEM_DISABLE 0x00000002 /* disable CPU A memory */
#define PCI_CPU_B_MEM_DISABLE 0x00100002 /* disable CPU B memory */
#define PCI_ENABLE_IRQ_CPU_A 0x005A0004 /* enable IRQ for CPU A */
#define PCI_ENABLE_IRQ_CPU_B 0x005A0008 /* enable IRQ for CPU B */
#define PCI_DISABLE_IRQ_CPU_A 0x00000004 /* disable IRQ for CPU A */
#define PCI_DISABLE_IRQ_CPU_B 0x00000008 /* disable IRQ for CPU B */
/* Setting for the Interrupt Status register */
#define IRQ_CPU_A 0x04 /* IRQ for CPU A */
#define IRQ_CPU_B 0x08 /* IRQ for CPU B */
/* The maximum size of the S514 memory */
#define MAX_SIZEOF_S514_MEMORY (256 * 1024)
/* S514 control register offsets within the memory address space */
#define S514_CTRL_REG_BYTE 0x80000
/* S514 adapter control bytes */
#define S514_CPU_HALT 0x00
#define S514_CPU_START 0x01
/* The maximum number of S514 adapters supported */
#define MAX_S514_CARDS 20
#define PCI_CARD_TYPE 0x2E
#define S514_DUAL_CPU 0x12
#define S514_SINGLE_CPU 0x11
#endif /* _SDLAPCI_H */

View File

@ -1,104 +0,0 @@
/*****************************************************************************
* sdlasfm.h WANPIPE(tm) Multiprotocol WAN Link Driver.
* Definitions for the SDLA Firmware Module (SFM).
*
* Author: Gideon Hack
*
* Copyright: (c) 1995-1999 Sangoma Technologies Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
* ============================================================================
* Jun 02, 1999 Gideon Hack Added support for the S514 adapter.
* Dec 11, 1996 Gene Kozin Cosmetic changes
* Apr 16, 1996 Gene Kozin Changed adapter & firmware IDs. Version 2
* Dec 15, 1995 Gene Kozin Structures chaned
* Nov 09, 1995 Gene Kozin Initial version.
*****************************************************************************/
#ifndef _SDLASFM_H
#define _SDLASFM_H
/****** Defines *************************************************************/
#define SFM_VERSION 2
#define SFM_SIGNATURE "SFM - Sangoma SDLA Firmware Module"
/* min/max */
#define SFM_IMAGE_SIZE 0x8000 /* max size of SDLA code image file */
#define SFM_DESCR_LEN 256 /* max length of description string */
#define SFM_MAX_SDLA 16 /* max number of compatible adapters */
/* Adapter types */
#define SDLA_S502A 5020
#define SDLA_S502E 5021
#define SDLA_S503 5030
#define SDLA_S508 5080
#define SDLA_S507 5070
#define SDLA_S509 5090
#define SDLA_S514 5140
/* S514 PCI adapter CPU numbers */
#define S514_CPU_A 'A'
#define S514_CPU_B 'B'
/* Firmware identification numbers:
* 0 .. 999 Test & Diagnostics
* 1000 .. 1999 Streaming HDLC
* 2000 .. 2999 Bisync
* 3000 .. 3999 SDLC
* 4000 .. 4999 HDLC
* 5000 .. 5999 X.25
* 6000 .. 6999 Frame Relay
* 7000 .. 7999 PPP
* 8000 .. 8999 Cisco HDLC
*/
#define SFID_CALIB502 200
#define SFID_STRM502 1200
#define SFID_STRM508 1800
#define SFID_BSC502 2200
#define SFID_SDLC502 3200
#define SFID_HDLC502 4200
#define SFID_HDLC508 4800
#define SFID_X25_502 5200
#define SFID_X25_508 5800
#define SFID_FR502 6200
#define SFID_FR508 6800
#define SFID_PPP502 7200
#define SFID_PPP508 7800
#define SFID_PPP514 7140
#define SFID_CHDLC508 8800
#define SFID_CHDLC514 8140
/****** Data Types **********************************************************/
typedef struct sfm_info /* firmware module information */
{
unsigned short codeid; /* firmware ID */
unsigned short version; /* firmaware version number */
unsigned short adapter[SFM_MAX_SDLA]; /* compatible adapter types */
unsigned long memsize; /* minimum memory size */
unsigned short reserved[2]; /* reserved */
unsigned short startoffs; /* entry point offset */
unsigned short winoffs; /* dual-port memory window offset */
unsigned short codeoffs; /* code load offset */
unsigned short codesize; /* code size */
unsigned short dataoffs; /* configuration data load offset */
unsigned short datasize; /* configuration data size */
} sfm_info_t;
typedef struct sfm /* SDLA firmware file structire */
{
char signature[80]; /* SFM file signature */
unsigned short version; /* file format version */
unsigned short checksum; /* info + image */
unsigned short reserved[6]; /* reserved */
char descr[SFM_DESCR_LEN]; /* description string */
sfm_info_t info; /* firmware module info */
unsigned char image[1]; /* code image (variable size) */
} sfm_t;
#endif /* _SDLASFM_H */

View File

@ -1,483 +0,0 @@
/*****************************************************************************
* wanpipe.h WANPIPE(tm) Multiprotocol WAN Link Driver.
* User-level API definitions.
*
* Author: Nenad Corbic <ncorbic@sangoma.com>
* Gideon Hack
*
* Copyright: (c) 1995-2000 Sangoma Technologies Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
* ============================================================================
* Nov 3, 2000 Nenad Corbic Added config_id to sdla_t structure.
* Used to determine the protocol running.
* Jul 13, 2000 Nenad Corbic Added SyncPPP Support
* Feb 24, 2000 Nenad Corbic Added support for x25api driver
* Oct 04, 1999 Nenad Corbic New CHDLC and FRAME RELAY code, SMP support
* Jun 02, 1999 Gideon Hack Added 'update_call_count' for Cisco HDLC
* support
* Jun 26, 1998 David Fong Added 'ip_mode' in sdla_t.u.p for dynamic IP
* routing mode configuration
* Jun 12, 1998 David Fong Added Cisco HDLC union member in sdla_t
* Dec 08, 1997 Jaspreet Singh Added 'authenticator' in union of 'sdla_t'
* Nov 26, 1997 Jaspreet Singh Added 'load_sharing' structure. Also added
* 'devs_struct','dev_to_devtint_next' to 'sdla_t'
* Nov 24, 1997 Jaspreet Singh Added 'irq_dis_if_send_count',
* 'irq_dis_poll_count' to 'sdla_t'.
* Nov 06, 1997 Jaspreet Singh Added a define called 'INTR_TEST_MODE'
* Oct 20, 1997 Jaspreet Singh Added 'buff_intr_mode_unbusy' and
* 'dlci_intr_mode_unbusy' to 'sdla_t'
* Oct 18, 1997 Jaspreet Singh Added structure to maintain global driver
* statistics.
* Jan 15, 1997 Gene Kozin Version 3.1.0
* o added UDP management stuff
* Jan 02, 1997 Gene Kozin Version 3.0.0
*****************************************************************************/
#ifndef _WANPIPE_H
#define _WANPIPE_H
#include <linux/wanrouter.h>
/* Defines */
#ifndef PACKED
#define PACKED __attribute__((packed))
#endif
#define WANPIPE_MAGIC 0x414C4453L /* signature: 'SDLA' reversed */
/* IOCTL numbers (up to 16) */
#define WANPIPE_DUMP (ROUTER_USER+0) /* dump adapter's memory */
#define WANPIPE_EXEC (ROUTER_USER+1) /* execute firmware command */
#define TRACE_ALL 0x00
#define TRACE_PROT 0x01
#define TRACE_DATA 0x02
/* values for request/reply byte */
#define UDPMGMT_REQUEST 0x01
#define UDPMGMT_REPLY 0x02
#define UDP_OFFSET 12
#define MAX_CMD_BUFF 10
#define MAX_X25_LCN 255 /* Maximum number of x25 channels */
#define MAX_LCN_NUM 4095 /* Maximum lcn number */
#define MAX_FT1_RETRY 100
#ifndef AF_WANPIPE
#define AF_WANPIPE 25
#ifndef PF_WANPIPE
#define PF_WANPIPE AF_WANPIPE
#endif
#endif
#define TX_TIMEOUT 5*HZ
/* General Critical Flags */
#define SEND_CRIT 0x00
#define PERI_CRIT 0x01
/* Chdlc and PPP polling critical flag */
#define POLL_CRIT 0x03
/* Frame Relay Tx IRQ send critical flag */
#define SEND_TXIRQ_CRIT 0x02
/* Frame Relay ARP critical flag */
#define ARP_CRIT 0x03
/* Bit maps for dynamic interface configuration
* DYN_OPT_ON : turns this option on/off
* DEV_DOWN : device was shutdown by the driver not
* by user
*/
#define DYN_OPT_ON 0x00
#define DEV_DOWN 0x01
/*
* Data structures for IOCTL calls.
*/
typedef struct sdla_dump /* WANPIPE_DUMP */
{
unsigned long magic; /* for verification */
unsigned long offset; /* absolute adapter memory address */
unsigned long length; /* block length */
void* ptr; /* -> buffer */
} sdla_dump_t;
typedef struct sdla_exec /* WANPIPE_EXEC */
{
unsigned long magic; /* for verification */
void* cmd; /* -> command structure */
void* data; /* -> data buffer */
} sdla_exec_t;
/* UDP management stuff */
typedef struct wum_header
{
unsigned char signature[8]; /* 00h: signature */
unsigned char type; /* 08h: request/reply */
unsigned char command; /* 09h: commnand */
unsigned char reserved[6]; /* 0Ah: reserved */
} wum_header_t;
/*************************************************************************
Data Structure for global statistics
*************************************************************************/
typedef struct global_stats
{
unsigned long isr_entry;
unsigned long isr_already_critical;
unsigned long isr_rx;
unsigned long isr_tx;
unsigned long isr_intr_test;
unsigned long isr_spurious;
unsigned long isr_enable_tx_int;
unsigned long rx_intr_corrupt_rx_bfr;
unsigned long rx_intr_on_orphaned_DLCI;
unsigned long rx_intr_dev_not_started;
unsigned long tx_intr_dev_not_started;
unsigned long poll_entry;
unsigned long poll_already_critical;
unsigned long poll_processed;
unsigned long poll_tbusy_bad_status;
unsigned long poll_host_disable_irq;
unsigned long poll_host_enable_irq;
} global_stats_t;
typedef struct{
unsigned short udp_src_port PACKED;
unsigned short udp_dst_port PACKED;
unsigned short udp_length PACKED;
unsigned short udp_checksum PACKED;
} udp_pkt_t;
typedef struct {
unsigned char ver_inet_hdr_length PACKED;
unsigned char service_type PACKED;
unsigned short total_length PACKED;
unsigned short identifier PACKED;
unsigned short flags_frag_offset PACKED;
unsigned char ttl PACKED;
unsigned char protocol PACKED;
unsigned short hdr_checksum PACKED;
unsigned long ip_src_address PACKED;
unsigned long ip_dst_address PACKED;
} ip_pkt_t;
typedef struct {
unsigned char signature[8] PACKED;
unsigned char request_reply PACKED;
unsigned char id PACKED;
unsigned char reserved[6] PACKED;
} wp_mgmt_t;
/*************************************************************************
Data Structure for if_send statistics
*************************************************************************/
typedef struct if_send_stat{
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_tbusy;
unsigned long if_send_tbusy_timeout;
unsigned long if_send_PIPE_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_bfr_passed_to_adptr;
unsigned long if_send_protocol_error;
unsigned long if_send_bfr_not_passed_to_adptr;
unsigned long if_send_tx_int_enabled;
unsigned long if_send_consec_send_fail;
} if_send_stat_t;
typedef struct rx_intr_stat{
unsigned long rx_intr_no_socket;
unsigned long rx_intr_dev_not_started;
unsigned long rx_intr_PIPE_request;
unsigned long rx_intr_bfr_not_passed_to_stack;
unsigned long rx_intr_bfr_passed_to_stack;
} rx_intr_stat_t;
typedef struct pipe_mgmt_stat{
unsigned long UDP_PIPE_mgmt_kmalloc_err;
unsigned long UDP_PIPE_mgmt_direction_err;
unsigned long UDP_PIPE_mgmt_adptr_type_err;
unsigned long UDP_PIPE_mgmt_adptr_cmnd_OK;
unsigned long UDP_PIPE_mgmt_adptr_cmnd_timeout;
unsigned long UDP_PIPE_mgmt_adptr_send_passed;
unsigned long UDP_PIPE_mgmt_adptr_send_failed;
unsigned long UDP_PIPE_mgmt_not_passed_to_stack;
unsigned long UDP_PIPE_mgmt_passed_to_stack;
unsigned long UDP_PIPE_mgmt_no_socket;
unsigned long UDP_PIPE_mgmt_passed_to_adptr;
} pipe_mgmt_stat_t;
typedef struct {
struct sk_buff *skb;
} bh_data_t, cmd_data_t;
#define MAX_LGTH_UDP_MGNT_PKT 2000
/* This is used for interrupt testing */
#define INTR_TEST_MODE 0x02
#define WUM_SIGNATURE_L 0x50495046
#define WUM_SIGNATURE_H 0x444E3845
#define WUM_KILL 0x50
#define WUM_EXEC 0x51
#define WANPIPE 0x00
#define API 0x01
#define BRIDGE 0x02
#define BRIDGE_NODE 0x03
#ifdef __KERNEL__
/****** Kernel Interface ****************************************************/
#include <linux/sdladrv.h> /* SDLA support module API definitions */
#include <linux/sdlasfm.h> /* SDLA firmware module definitions */
#include <linux/workqueue.h>
#include <linux/serial.h>
#include <linux/serialP.h>
#include <linux/serial_reg.h>
#include <asm/serial.h>
#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/tty_flip.h>
/****** Data Structures *****************************************************/
/* Adapter Data Space.
* This structure is needed because we handle multiple cards, otherwise
* static data would do it.
*/
typedef struct sdla
{
char devname[WAN_DRVNAME_SZ+1]; /* card name */
sdlahw_t hw; /* hardware configuration */
struct wan_device wandev; /* WAN device data space */
unsigned open_cnt; /* number of open interfaces */
unsigned long state_tick; /* link state timestamp */
unsigned intr_mode; /* Type of Interrupt Mode */
char in_isr; /* interrupt-in-service flag */
char buff_int_mode_unbusy; /* flag for carrying out dev_tint */
char dlci_int_mode_unbusy; /* flag for carrying out dev_tint */
long configured; /* flag for previous configurations */
unsigned short irq_dis_if_send_count; /* Disabling irqs in if_send*/
unsigned short irq_dis_poll_count; /* Disabling irqs in poll routine*/
unsigned short force_enable_irq;
char TracingEnabled; /* flag for enabling trace */
global_stats_t statistics; /* global statistics */
void* mbox; /* -> mailbox */
void* rxmb; /* -> receive mailbox */
void* flags; /* -> adapter status flags */
void (*isr)(struct sdla* card); /* interrupt service routine */
void (*poll)(struct sdla* card); /* polling routine */
int (*exec)(struct sdla* card, void* u_cmd, void* u_data);
/* Used by the listen() system call */
/* Wanpipe Socket Interface */
int (*func) (struct sk_buff *, struct sock *);
struct sock *sk;
/* Shutdown function */
void (*disable_comm) (struct sdla *card);
/* Secondary Port Device: Piggibacking */
struct sdla *next;
/* TTY driver variables */
unsigned char tty_opt;
struct tty_struct *tty;
unsigned int tty_minor;
unsigned int tty_open;
unsigned char *tty_buf;
unsigned char *tty_rx;
struct work_struct tty_work;
union
{
struct
{ /****** X.25 specific data **********/
u32 lo_pvc;
u32 hi_pvc;
u32 lo_svc;
u32 hi_svc;
struct net_device *svc_to_dev_map[MAX_X25_LCN];
struct net_device *pvc_to_dev_map[MAX_X25_LCN];
struct net_device *tx_dev;
struct net_device *cmd_dev;
u32 no_dev;
volatile u8 *hdlc_buf_status;
u32 tx_interrupts_pending;
u16 timer_int_enabled;
struct net_device *poll_device;
atomic_t command_busy;
u16 udp_pkt_lgth;
u32 udp_type;
u8 udp_pkt_src;
u32 udp_lcn;
struct net_device *udp_dev;
s8 udp_pkt_data[MAX_LGTH_UDP_MGNT_PKT];
u8 LAPB_hdlc; /* Option to turn off X25 and run only LAPB */
u8 logging; /* Option to log call messages */
u8 oob_on_modem; /* Option to send modem status to the api */
u16 num_of_ch; /* Number of channels configured by the user */
struct work_struct x25_poll_work;
struct timer_list x25_timer;
} x;
struct
{ /****** frame relay specific data ***/
void* rxmb_base; /* -> first Rx buffer */
void* rxmb_last; /* -> last Rx buffer */
unsigned rx_base; /* S508 receive buffer base */
unsigned rx_top; /* S508 receive buffer end */
unsigned short node_dlci[100];
unsigned short dlci_num;
struct net_device *dlci_to_dev_map[991 + 1];
unsigned tx_interrupts_pending;
unsigned short timer_int_enabled;
unsigned short udp_pkt_lgth;
int udp_type;
char udp_pkt_src;
unsigned udp_dlci;
char udp_pkt_data[MAX_LGTH_UDP_MGNT_PKT];
void* trc_el_base; /* first trace element */
void* trc_el_last; /* last trace element */
void *curr_trc_el; /* current trace element */
unsigned short trc_bfr_space; /* trace buffer space */
unsigned char update_comms_stats;
struct net_device *arp_dev;
spinlock_t if_send_lock;
} f;
struct /****** PPP-specific data ***********/
{
char if_name[WAN_IFNAME_SZ+1]; /* interface name */
void* txbuf; /* -> current Tx buffer */
void* txbuf_base; /* -> first Tx buffer */
void* txbuf_last; /* -> last Tx buffer */
void* rxbuf_base; /* -> first Rx buffer */
void* rxbuf_last; /* -> last Rx buffer */
unsigned rx_base; /* S508 receive buffer base */
unsigned rx_top; /* S508 receive buffer end */
char ip_mode; /* STATIC/HOST/PEER IP Mode */
char authenticator; /* Authenticator for PAP/CHAP */
unsigned char comm_enabled; /* Is comm enabled or not */
unsigned char peer_route; /* Process Peer Route */
unsigned long *txbuf_next; /* Next Tx buffer to use */
unsigned long *rxbuf_next; /* Next Rx buffer to use */
} p;
struct /* Cisco HDLC-specific data */
{
char if_name[WAN_IFNAME_SZ+1]; /* interface name */
unsigned char comm_port;/* Communication Port O or 1 */
unsigned char usedby; /* Used by WANPIPE or API */
void* rxmb; /* Receive mail box */
void* flags; /* flags */
void* tx_status; /* Tx status element */
void* rx_status; /* Rx status element */
void* txbuf; /* -> current Tx buffer */
void* txbuf_base; /* -> first Tx buffer */
void* txbuf_last; /* -> last Tx buffer */
void* rxbuf_base; /* -> first Rx buffer */
void* rxbuf_last; /* -> last Rx buffer */
unsigned rx_base; /* S508 receive buffer base */
unsigned rx_top; /* S508 receive buffer end */
unsigned char receive_only; /* high speed receivers */
unsigned short protocol_options;
unsigned short kpalv_tx; /* Tx kpalv timer */
unsigned short kpalv_rx; /* Rx kpalv timer */
unsigned short kpalv_err; /* Error tolerance */
unsigned short slarp_timer; /* SLARP req timer */
unsigned state; /* state of the link */
unsigned char api_status;
unsigned char update_call_count;
unsigned short api_options; /* for async config */
unsigned char async_mode;
unsigned short tx_bits_per_char;
unsigned short rx_bits_per_char;
unsigned short stop_bits;
unsigned short parity;
unsigned short break_timer;
unsigned short inter_char_timer;
unsigned short rx_complete_length;
unsigned short xon_char;
unsigned short xoff_char;
unsigned char comm_enabled; /* Is comm enabled or not */
unsigned char backup;
} c;
struct
{
void* tx_status; /* Tx status element */
void* rx_status; /* Rx status element */
void* trace_status; /* Trace status element */
void* txbuf; /* -> current Tx buffer */
void* txbuf_base; /* -> first Tx buffer */
void* txbuf_last; /* -> last Tx buffer */
void* rxbuf_base; /* -> first Rx buffer */
void* rxbuf_last; /* -> last Rx buffer */
void* tracebuf; /* -> current Trace buffer */
void* tracebuf_base; /* -> current Trace buffer */
void* tracebuf_last; /* -> current Trace buffer */
unsigned rx_base; /* receive buffer base */
unsigned rx_end; /* receive buffer end */
unsigned trace_base; /* trace buffer base */
unsigned trace_end; /* trace buffer end */
} h;
} u;
} sdla_t;
/****** Public Functions ****************************************************/
void wanpipe_open (sdla_t* card); /* wpmain.c */
void wanpipe_close (sdla_t* card); /* wpmain.c */
void wanpipe_set_state (sdla_t* card, int state); /* wpmain.c */
int wpx_init (sdla_t* card, wandev_conf_t* conf); /* wpx.c */
int wpf_init (sdla_t* card, wandev_conf_t* conf); /* wpf.c */
int wpp_init (sdla_t* card, wandev_conf_t* conf); /* wpp.c */
int wpc_init (sdla_t* card, wandev_conf_t* conf); /* Cisco HDLC */
int bsc_init (sdla_t* card, wandev_conf_t* conf); /* BSC streaming */
int hdlc_init(sdla_t* card, wandev_conf_t* conf); /* HDLC support */
int wpft1_init (sdla_t* card, wandev_conf_t* conf); /* FT1 Config support */
int wsppp_init (sdla_t* card, wandev_conf_t* conf); /* Sync PPP on top of RAW CHDLC */
extern sdla_t * wanpipe_find_card(char *);
extern sdla_t * wanpipe_find_card_num (int);
extern void wanpipe_queue_work (struct work_struct *);
extern void wanpipe_mark_bh (void);
extern void wakeup_sk_bh(struct net_device *dev);
extern int change_dev_flags(struct net_device *dev, unsigned flags);
extern unsigned long get_ip_address(struct net_device *dev, int option);
extern void add_gateway(sdla_t *card, struct net_device *dev);
#endif /* __KERNEL__ */
#endif /* _WANPIPE_H */

View File

@ -55,12 +55,10 @@
#include <asm/uaccess.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/wanpipe.h>
#include <linux/if_wanpipe.h>
#include <linux/pkt_sched.h>
#include <linux/tcp_states.h>
#include <linux/if_wanpipe_common.h>
#include <linux/sdla_x25.h>
#ifdef CONFIG_INET
#include <net/inet_common.h>