/*
** vi:set ts=4 sw=4 ai sm aw
*/

/*****************************************************************************
* Copyright (c) 1998 Digi International Inc., All Rights Reserved
* 
* This software contains proprietary and confidential information of Digi
* International Inc.  By accepting transfer of this copy, Recipient agrees
* to retain this software in confidence, to prevent disclosure to others,
* and to make no use of this software other than that for which it was
* delivered.  This is an unpublished copyrighted work of Digi International
* Inc.  Except as permitted by federal law, 17 USC 117, copying is strictly
* prohibited.
* 
* Restricted Rights Legend
*
* Use, duplication, or disclosure by the Government is subject to
* restrictions set forth in sub-paragraph (c)(1)(ii) of The Rights in
* Technical Data and Computer Software clause at DFARS 252.227-7031 or
* subparagraphs (c)(1) and (2) of the Commercial Computer Software -
* Restricted Rights at 48 CFR 52.227-19, as applicable.
*
* Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
*
*****************************************************************************/

/*
**----------------------------------------------------------------------
**  Include File:  @@(#) $Id: layer1_stats.h,v 1.3 1998/09/24 20:16:54 jruf Exp $
**
**  Purpose:
**
**      Layer 1 statistic structures and definitions.
**
**
**  Revision History:
**
**      Date   Revision  Author          Modification Notes
**
**    01/25/98  1.0.0.0  J. Ruf          Initial Release
**
**----------------------------------------------------------------------
*/

#ifndef LAYER1_STATSH
#define LAYER1_STATSH

/*
**----------------------------------------------------------------------
** Originally defined in common/wan_control.h.
**
** wan driver statistics.
**----------------------------------------------------------------------
*/
typedef struct hstats
{
    uint32           hc_txgood;     /* Number of good frames transmitted    */
    uint32           hc_txgdbytes;  /* Number of good bytes transmitted     */
    uint32           hc_txurun;     /* Number of transmit underruns         */
    uint32           hc_rxgood;     /* Number of good frames received       */
    uint32           hc_rxgdbytes;  /* Number of good bytes received        */
    uint32           hc_rxorun;     /* Number of receive overruns           */
    uint32           hc_rxcrc;      /* Number of receive CRC/Framing errors */
    uint32           hc_rxnobuf;    /* Number of Rx frames with no buffer   */
    uint32           hc_rxnflow;    /* Number of Rx frames with no flow ctl */
    uint32           hc_rxoflow;    /* Number of receive buffer overflows   */
    uint32           hc_rxabort;    /* Number of receive aborts             */
    uint32           hc_txabort;    /* Number of tx aborts (hdplx only)     */
    uint32           hc_noclock;    /* Number of "clock missing" timeouts   */
    uint32           hc_rxbiterr;   /* Number of short frame/bit count errs */
    uint32           hc_rxnomp;     /* Number of frames w/o buffers avail.  */
} hdlcstats_t;

/*
**----------------------------------------------------------------------
** Originally defined in iwan/iwan_control.h.
**
** iwan driver statistics.
**----------------------------------------------------------------------
*/
typedef struct isdnstats
{
    uint32 hc_txoctets;   /* Number of octets transmitted         */
    uint32 hc_txgood;     /* Number of good frames transmitted    */
    uint32 hc_txclass1;   /* Number of priority 1 frames tx       */
    uint32 hc_txclass2;   /* Number of priority 2 frames tx       */
    uint32 hc_txdef;      /* Number of transmit deferrals         */
    uint32 hc_txurun;     /* Number of transmit underruns         */
    uint32 hc_rxoctets;   /* Number of octets received            */
    uint32 hc_rxgood;     /* Number of good frames received       */
    uint32 hc_rxerr;      /* Number of error frames received      */
    uint32 hc_rxorun;     /* Number of receive overruns           */
    uint32 hc_rxcrc;      /* Number of receive CRC/Framing errors */
    uint32 hc_rxnobuf;    /* Number of Rx frames with no buffer   */
    uint32 hc_rxnflow;    /* Number of Rx frames with no flow ctl */
    uint32 hc_rxoflow;    /* Number of receive buffer overflows   */
    uint32 hc_rxabort;    /* Number of receive aborts             */
    uint32 hc_txcps;      /* Running tx flow rate in char/sec.    */
    uint32 hc_rxcps;      /* Running rx flow rate in char/sec.    */
} isdnstats_t;

/*
**----------------------------------------------------------------------
** Originally defined in iwan/m32.h.
**
** Munich HDLC controller.
**----------------------------------------------------------------------
*/
typedef struct iwan_channel_stats {
    int sf_err ;
    int loss_err ;
    int crc_err ;
    int nob_err ;
    int lfd_err ;
    int ra_err ;
    int rof_err ;
    int no_inn_space ;
    int no_wan_mp ;
    int no_fe_and_no_c ;
    int tx_size_err;
    int rx_size_err;
    int tx_prep;
    int tx_good;
    int rx_good;
    int t_hi ;
    int t_fi ;
    int t_ifc ;
    int t_sf ;
    int t_err ;
    int t_fo ;
    int r_hi ;
    int r_fi ;
    int r_ifc ;
    int r_sf ;
    int r_err ;
    int r_fo ;
} iwan_channel_stats_t ;

/*
**----------------------------------------------------------------------
** Structure used to differentiate the wan statistic structure being used.
** Structure was added for the Houston/London product family. [J.Ruf 11/13/97]
**----------------------------------------------------------------------
*/
typedef struct
{
    uint32  stype_type;

#define L1_STATS_WAN_HDLC       0x00000001
#define L1_STATS_IWAN_ISDN      0x00000002
#define L1_STATS_IWAN_MUNICH    0x00000003

    union
    {
        hdlcstats_t             wan_hdlc;
        isdnstats_t             iwan_isdn;
        iwan_channel_stats_t    iwan_munich;
    } style;

} layer1_stats_t;

#endif /* LAYER1_STATSH */
