--- linux-2.6.22.14/drivers/net/wan/farsync.h 2008-01-22 14:02:50.000000000 +0200 +++ linux/drivers/net/wan/farsync.h 2008-01-15 11:03:50.000000000 +0200 @@ -3,7 +3,7 @@ * * Actually sync driver for X.21, V.35 and V.24 on FarSync T-series cards * - * Copyright (C) 2001 FarSite Communications Ltd. + * Copyright (C) 2001-2004 FarSite Communications Ltd. * www.farsite.co.uk * * This program is free software; you can redistribute it and/or @@ -21,27 +21,10 @@ * 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 "fst" /* In debug/info etc */ #define FST_NDEV_NAME "sync" /* For net interface */ #define FST_DEV_NAME "farsync" /* For misc interfaces */ - /* User version number * * This version number is incremented with each official release of the @@ -50,19 +33,29 @@ * have individual versions (or IDs) that move much faster than the * the release version as individual updates are tracked. */ -#define FST_USER_VERSION "1.04" +#define FST_USER_VERSION "1.06" +#define FST_PATCH_LEVEL "04" +#define FST_PLATFORM "ia32" +#define FST_ADDITIONAL "" +#define FST_INCLUDES_CHAR /* Ioctl call command values * * The first three private ioctls are used by the sync-PPP module, * allowing a little room for expansion we start our numbering at 10. */ -#define FSTWRITE (SIOCDEVPRIVATE+10) -#define FSTCPURESET (SIOCDEVPRIVATE+11) -#define FSTCPURELEASE (SIOCDEVPRIVATE+12) -#define FSTGETCONF (SIOCDEVPRIVATE+13) -#define FSTSETCONF (SIOCDEVPRIVATE+14) +#define FSTWRITE (SIOCDEVPRIVATE+4) +#define FSTCPURESET (SIOCDEVPRIVATE+5) +#define FSTCPURELEASE (SIOCDEVPRIVATE+6) +#define FSTGETCONF (SIOCDEVPRIVATE+7) +#define FSTSETCONF (SIOCDEVPRIVATE+8) +#define FSTSNOTIFY (SIOCDEVPRIVATE+9) +#define FSTGSTATE (SIOCDEVPRIVATE+10) +#define FSTSYSREQ (SIOCDEVPRIVATE+11) +#define FSTGETSHELL (SIOCDEVPRIVATE+12) +#define FSTSETMON (SIOCDEVPRIVATE+13) +#define FSTSETPORT (SIOCDEVPRIVATE+14) /* FSTWRITE @@ -110,6 +103,7 @@ struct fstioc_info { unsigned char proto; /* Line protocol */ unsigned char internalClock; /* 1 => internal clock, 0 => external */ unsigned int lineSpeed; /* Speed in bps */ + unsigned int estLineSpeed; /* Estimated speed in bps */ unsigned int v24IpSts; /* V.24 control input status */ unsigned int v24OpSts; /* V.24 control output status */ unsigned short clockStatus; /* lsb: 0=> present, 1=> absent */ @@ -118,6 +112,8 @@ struct fstioc_info { unsigned short debug; /* Debug flags */ unsigned char transparentMode; /* Not used always 0 */ unsigned char invertClock; /* Invert clock feature for syncing */ + unsigned char asyncAbility ; /* The ability to do async */ + unsigned char synthAbility; /* The ability to syth a clock */ unsigned char startingSlot; /* Time slot to use for start of tx */ unsigned char clockSource; /* External or internal */ unsigned char framing; /* E1, T1 or J1 */ @@ -141,8 +137,113 @@ struct fstioc_info { unsigned short lossOfSignal; unsigned short receiveRemoteAlarm; unsigned short alarmIndicationSignal; + unsigned short _reserved[64]; + unsigned char ignoreCarrier; /* If set transmit regardless of carrier state */ + unsigned char numTxBuffers; /* No of tx buffers in card window */ + unsigned char numRxBuffers; /* No of rx buffers in card window */ + unsigned int txBufferSize; /* Size of tx buffers in card window */ + unsigned int rxBufferSize; /* Size of rx buffers in card window */ + unsigned char terminalType; /* Additional hdsl */ + unsigned char annexType; + unsigned char encap; + unsigned char testMode; + unsigned char backoff; + unsigned char bLineProbingEnable; + unsigned char snrth; + unsigned char lpath; + unsigned short vpi; + unsigned short vci; + unsigned char activationStatus; + unsigned char noCommonModeStatus; + unsigned char transceiverStatus1; + unsigned char transceiverStatus2; + unsigned char lineLoss; + char signalQuality; + unsigned char nearEndBlockErrorCount; + char signalToNoiseRatio; + unsigned char erroredSecondCount; + unsigned char severelyErroredSecondCount; + unsigned char lossOfSyncWordSecondCount; + unsigned char unavailableSecondCount; + char frequencyDeviation; + char negotiatedPowerBackOff; + unsigned char negotiatedPSD; + unsigned char negotiatedBChannels; + unsigned char negotiatedZBits; + unsigned short negotiatedSyncWord; + unsigned char negotiatedStuffBits; + unsigned char chipVersion; + unsigned char firmwareVersion; + unsigned char romVersion; + unsigned short atmTxCellCount; + unsigned short atmRxCellCount; + unsigned short atmHecErrorCount; + unsigned int atmCellsDropped; + unsigned char transmitMSBFirst; + unsigned char receiveMSBFirst; + unsigned char xpldVersion; + unsigned char farEndCountryCode[2]; + unsigned char farEndProviderCode[4]; + unsigned char farEndVendorInfo[2]; }; +/* FSTGSTATE + * + * Used to query why a state change message has been issued by the driver + * It could be because there was a change in line states or that the txq + * has reached an empty state + */ +struct fstioc_status { + int carrier_state; + int txq_length; +}; + +/* FSTSYSREQ + * + * Used to provide a simple transparent command/repsonse interface between + * an application and the firmware running on the card + */ +struct fstioc_req { + unsigned short msg_type; + unsigned short msg_len; + unsigned short ret_code; + unsigned short i_reg_idx; + unsigned short value; + unsigned char u_msg[16]; + unsigned char u_msg_reserved[16]; + unsigned char u_reserved[4]; +}; + + +#define MSG_FIFO_EEPROM_RD 0x769b +#define MSG_FIFO_EEPROM_WR 0xcd4a +#define RSP_FIFO_SUCCESS 0x0000 +#define RSP_FIFO_FAILURE 0x0001 + + +/* FSTSETMON + * + * Used to provide a simple monitoring data + */ +#define FSTIOC_MON_VERSION 0 +#define FST_MON_RX 0 +#define FST_MON_TX 1 + +struct fstioc_mon { + unsigned char version; + unsigned char tx_rx_ind; + unsigned int sequence; + unsigned long timestamp; + unsigned int length; +}; + +/* FSTSETPORT + * + * Used to provide a DSL port control + */ +#define FST_DSL_PORT_NORMAL 0 +#define FST_DSL_PORT_ACTIVE 1 + /* "valid" bitmask */ #define FSTVAL_NONE 0x00000000 /* Nothing valid (firmware not running). * Slight misnomer. In fact nports, @@ -164,8 +265,11 @@ struct fstioc_info { #define FSTVAL_MODE 0x00000400 /* cardMode */ #define FSTVAL_PHASE 0x00000800 /* Clock phase */ #define FSTVAL_TE1 0x00001000 /* T1E1 Configuration */ +#define FSTVAL_BUFFERS 0x00002000 /* Tx and Rx buffer settings */ +#define FSTVAL_DSL_S1 0x00004000 /* DSL-S1 Configuration */ +#define FSTVAL_T4E 0x00008000 /* T4E Mk II Configuration */ #define FSTVAL_DEBUG 0x80000000 /* debug */ -#define FSTVAL_ALL 0x00001FFF /* Note: does not include DEBUG flag */ +#define FSTVAL_ALL 0x0000FFFF /* Note: does not include DEBUG flag */ /* "type" */ #define FST_TYPE_NONE 0 /* Probably should never happen */ @@ -175,6 +279,8 @@ struct fstioc_info { #define FST_TYPE_T2U 4 /* T2U X21 2 port card */ #define FST_TYPE_T4U 5 /* T4U X21 4 port card */ #define FST_TYPE_TE1 6 /* T1E1 X21 1 port card */ +#define FST_TYPE_DSL_S1 7 /* DSL-S1 card */ +#define FST_TYPE_T4E 8 /* T4E Mk II */ /* "family" */ #define FST_FAMILY_TXP 0 /* T2P or T4P */ @@ -197,9 +303,12 @@ struct fstioc_info { #define X21 2 #define V35 3 #define X21D 4 -#define T1 5 -#define E1 6 -#define J1 7 +#define NOCABLE 5 +#define RS530_449 6 +#define T1 7 +#define E1 8 +#define J1 9 +#define SHDSL 10 /* "proto" */ #define FST_HDLC 1 /* Cisco compatible HDLC */ @@ -233,6 +342,14 @@ struct fstioc_info { #define CARD_MODE_IDENTIFY 0x0001 /* + * TxRx Start Parameters + */ +#define START_TX 1 +#define START_RX 2 +#define START_TX_AND_RX (START_TX | START_RX) +#define START_DEFAULT START_TX_AND_RX + +/* * Constants for T1/E1 configuration */ @@ -324,6 +441,42 @@ struct fstioc_info { #define BUFFER_96_BIT 2 #define BUFFER_NONE 3 +/* + * DSL Equipment types + */ +#define EQUIP_TYPE_REMOTE 0 +#define EQUIP_TYPE_CENTRAL 1 + +/* + * DSL Operating modes + */ +#define ANNEX_A 1 /* US */ +#define ANNEX_B 0 /* EU */ + +/* + * DSL ATM Encapsulation methods + */ +#define ENCAP_PPP 0 +#define ENCAP_MPOA 1 +#define MPOA_HEADER_LEN 8 + +/* + * DSL Test Modes + */ +#define TEST_MODE_NONE 0 +#define TEST_MODE_DEFAULT TEST_MODE_NONE + +#define TEST_MODE_ALTERNATING_SINGLE_PULSE 1 +#define TEST_MODE_ANALOG_TRANSPARENT_LOOP 4 +#define TEST_MODE_ANALOG_NON_TRANSPARENT_LOOP 8 +#define TEST_MODE_TRANSMIT_SC_SR 9 +#define TEST_MODE_TRANSMIT_TC_PAM_SCRONE 10 +#define TEST_MODE_LINE_DRIVER_NO_SIGNAL 11 +#define TEST_MODE_AGC_TO_LINE_DRIVER_LOOP 12 + +#define TEST_MODE_LOOP_TDM_TO_LINE 16 +#define TEST_MODE_LOOP_PAYLOAD_TO_LINE 17 + /* Debug support * * These should only be enabled for development kernels, production code @@ -348,8 +501,9 @@ extern int fst_debug_mask; #define DBG_TX 0x0040 /* Packet transmission */ #define DBG_RX 0x0080 /* Packet reception */ #define DBG_CMD 0x0100 /* Port command issuing */ - -#define DBG_ASS 0xFFFF /* Assert like statements. Code that +#define DBG_ATM 0x0200 /* ATM processing */ +#define DBG_TTY 0x0400 /* PPPd processing */ +#define DBG_ASS 0x0001 /* Assert like statements. Code that * should never be reached, if you see * one of these then I've been an ass */