linux/drivers/net/wan/farsync.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 *      FarSync X21 driver for Linux
 *
 *      Actually sync driver for X.21, V.35 and V.24 on FarSync T-series cards
 *
 *      Copyright (C) 2001 FarSite Communications Ltd.
 *      www.farsite.co.uk
 *
 *      Author: R.J.Dunlop      <[email protected]>
 *
 *      For the most part this file only contains structures and information
 *      that is visible to applications outside the driver. Shared memory
 *      layout etc is internal to the driver and described within farsync.c.
 *      Overlap exists in that the values used for some fields within the
 *      ioctl interface extend into the cards firmware interface so values in
 *      this file may not be changed arbitrarily.
 */

/*      What's in a name
 *
 *      The project name for this driver is Oscar. The driver is intended to be
 *      used with the FarSite T-Series cards (T2P & T4P) running in the high
 *      speed frame shifter mode. This is sometimes referred to as X.21 mode
 *      which is a complete misnomer as the card continues to support V.24 and
 *      V.35 as well as X.21.
 *
 *      A short common prefix is useful for routines within the driver to avoid
 *      conflict with other similar drivers and I chosen to use "fst_" for this
 *      purpose (FarSite T-series).
 *
 *      Finally the device driver needs a short network interface name. Since
 *      "hdlc" is already in use I've chosen the even less informative "sync"
 *      for the present.
 */
#define FST_NAME
#define FST_NDEV_NAME
#define FST_DEV_NAME


/*      User version number
 *
 *      This version number is incremented with each official release of the
 *      package and is a simplified number for normal user reference.
 *      Individual files are tracked by the version control system and may
 *      have individual versions (or IDs) that move much faster than
 *      the release version as individual updates are tracked.
 */
#define FST_USER_VERSION


/*      Ioctl call command values
 */
#define FSTWRITE
#define FSTCPURESET
#define FSTCPURELEASE
#define FSTGETCONF
#define FSTSETCONF


/*      FSTWRITE
 *
 *      Used to write a block of data (firmware etc) before the card is running
 */
struct fstioc_write {};


/*      FSTCPURESET and FSTCPURELEASE
 *
 *      These take no additional data.
 *      FSTCPURESET forces the cards CPU into a reset state and holds it there.
 *      FSTCPURELEASE releases the CPU from this reset state allowing it to run,
 *      the reset vector should be setup before this ioctl is run.
 */

/*      FSTGETCONF and FSTSETCONF
 *
 *      Get and set a card/ports configuration.
 *      In order to allow selective setting of items and for the kernel to
 *      indicate a partial status response the first field "valid" is a bitmask
 *      indicating which other fields in the structure are valid.
 *      Many of the field names in this structure match those used in the
 *      firmware shared memory configuration interface and come originally from
 *      the NT header file Smc.h
 *
 *      When used with FSTGETCONF this structure should be zeroed before use.
 *      This is to allow for possible future expansion when some of the fields
 *      might be used to indicate a different (expanded) structure.
 */
struct fstioc_info {};

/* "valid" bitmask */
#define FSTVAL_NONE
#define FSTVAL_OMODEM
#define FSTVAL_SPEED
#define FSTVAL_CABLE
#define FSTVAL_IMODEM
#define FSTVAL_CARD
#define FSTVAL_PROTO
#define FSTVAL_MODE
#define FSTVAL_PHASE
#define FSTVAL_TE1
#define FSTVAL_DEBUG
#define FSTVAL_ALL

/* "type" */
#define FST_TYPE_NONE
#define FST_TYPE_T2P
#define FST_TYPE_T4P
#define FST_TYPE_T1U
#define FST_TYPE_T2U
#define FST_TYPE_T4U
#define FST_TYPE_TE1

/* "family" */
#define FST_FAMILY_TXP
#define FST_FAMILY_TXU

/* "state" */
#define FST_UNINIT
#define FST_RESET
#define FST_DOWNLOAD
#define FST_STARTING
#define FST_RUNNING
#define FST_BADVERSION
#define FST_HALTED
#define FST_IFAILED
/* "lineInterface" */
#define V24
#define X21
#define V35
#define X21D
#define T1
#define E1
#define J1

/* "proto" */
#define FST_RAW
#define FST_GEN_HDLC

/* "internalClock" */
#define INTCLK
#define EXTCLK

/* "v24IpSts" bitmask */
#define IPSTS_CTS
#define IPSTS_INDICATE
#define IPSTS_DSR
#define IPSTS_DCD
#define IPSTS_RI
#define IPSTS_TMI

/* "v24OpSts" bitmask */
#define OPSTS_RTS
#define OPSTS_CONTROL
#define OPSTS_DTR
#define OPSTS_DSRS
#define OPSTS_SS
#define OPSTS_LL

/* "cardMode" bitmask */
#define CARD_MODE_IDENTIFY

/* 
 * Constants for T1/E1 configuration
 */

/*
 * Clock source
 */
#define CLOCKING_SLAVE
#define CLOCKING_MASTER

/*
 * Framing
 */
#define FRAMING_E1
#define FRAMING_J1
#define FRAMING_T1

/*
 * Structure
 */
#define STRUCTURE_UNFRAMED
#define STRUCTURE_E1_DOUBLE
#define STRUCTURE_E1_CRC4
#define STRUCTURE_E1_CRC4M
#define STRUCTURE_T1_4
#define STRUCTURE_T1_12
#define STRUCTURE_T1_24
#define STRUCTURE_T1_72

/*
 * Interface
 */
#define INTERFACE_RJ48C
#define INTERFACE_BNC

/*
 * Coding
 */

#define CODING_HDB3
#define CODING_NRZ
#define CODING_CMI
#define CODING_CMI_HDB3
#define CODING_CMI_B8ZS
#define CODING_AMI
#define CODING_AMI_ZCS
#define CODING_B8ZS

/*
 * Line Build Out
 */
#define LBO_0dB
#define LBO_7dB5
#define LBO_15dB
#define LBO_22dB5

/*
 * Range for long haul t1 > 655ft
 */
#define RANGE_0_133_FT
#define RANGE_0_40_M
#define RANGE_133_266_FT
#define RANGE_40_81_M
#define RANGE_266_399_FT
#define RANGE_81_122_M
#define RANGE_399_533_FT
#define RANGE_122_162_M
#define RANGE_533_655_FT
#define RANGE_162_200_M
/*
 * Receive Equaliser
 */
#define EQUALIZER_SHORT
#define EQUALIZER_LONG

/*
 * Loop modes
 */
#define LOOP_NONE
#define LOOP_LOCAL
#define LOOP_PAYLOAD_EXC_TS0
#define LOOP_PAYLOAD_INC_TS0
#define LOOP_REMOTE

/*
 * Buffer modes
 */
#define BUFFER_2_FRAME
#define BUFFER_1_FRAME
#define BUFFER_96_BIT
#define BUFFER_NONE

/*      Debug support
 *
 *      These should only be enabled for development kernels, production code
 *      should define FST_DEBUG=0 in order to exclude the code.
 *      Setting FST_DEBUG=1 will include all the debug code but in a disabled
 *      state, use the FSTSETCONF ioctl to enable specific debug actions, or
 *      FST_DEBUG can be set to prime the debug selection.
 */
#define FST_DEBUG
#if FST_DEBUG

extern int fst_debug_mask;              /* Bit mask of actions to debug, bits
                                         * listed below. Note: Bit 0 is used
                                         * to trigger the inclusion of this
                                         * code, without enabling any actions.
                                         */
#define DBG_INIT
#define DBG_OPEN
#define DBG_PCI
#define DBG_IOCTL
#define DBG_INTR
#define DBG_TX
#define DBG_RX
#define DBG_CMD

#define DBG_ASS
#endif  /* FST_DEBUG */