
/*
 ****************************************************************************
 * Copyright (c) 1990-98 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:  sdxb.h
 *
 *
 *  Author  P. Donovan
 *
 *----------------------------------------------------------------------
 */

/*
 *----------------------------------------------------------------------
 *  Definitions.
 *----------------------------------------------------------------------
 */

/*
 * S/DXB Command Header
 *
 * The first byte is common to all command types.
 * The second byte is common to almost all commands.
 */
typedef struct
{
   UCHAR    Ctype;         // Command
   UCHAR    Flags;         //
} SDXB_CMD_HEAD, *PSDXB_CMD_HEAD;

/*
 * S/DXB Command message 
 *
 */
typedef struct
{
   union {
      struct sdxb_sync_command      Sync;
      struct sdxb_bufsize_command   BufferSize;
      struct sdxb_mstat_command     ModemControl;
      struct sdxb_event_command     EventStatus;
      struct sdxb_lerr_command      LineError;
      struct sdxb_pcap_command      PortCap;
      struct sdxb_param_command     PortParameters;
      struct sdxb_wmark_command     WaterMark;
      struct sdxb_seq_command       SequenceNumber;
      struct sdxb_scimmed_command   SendImmediate;
      struct sdxb_break_command     SendBreak;
      struct sdxb_flush_command     FlushBuffers;
      struct sdxb_pause_command     Pause;
   } U;
} SDXB_CMD, *PSDXB_CMD;

//
// S/DXB Response and Indication structures
//

typedef struct sdxb_sync_response SYNC_RSP_SDXB, *PSYNC_RSP_SDXB;
typedef struct sdxb_bufsize_response BUFFER_SIZE_RSP_SDXB, *PBUFFER_SIZE_RSP_SDXB;
typedef struct sdxb_mstat_response MODEM_CTRL_RSP_SDXB, *PMODEM_CTRL_RSP_SDXB;
typedef struct sdxb_event_response EVENT_RSP_SDXB, *PEVENT_RSP_SDXB;
typedef struct sdxb_lerr_response LINE_ERR_RSP_SDXB, *PLINE_ERR_RSP_SDXB;
typedef struct sdxb_pcap_response PORT_CAP_RSP_SDXB, *PPORT_CAP_RSP_SDXB;
typedef struct sdxb_param_response PORT_PARAM_RSP_SDXB, *PPORT_PARAM_RSP_SDXB;
typedef struct sdxb_seq_response SEQ_NUM_RSP_SDXB, *PSEQ_NUM_RSP_SDXB;
typedef struct sdxb_screcv_response SPCX_IND_SDXB, *PSPCX_IND_SDXB;
typedef struct sdxb_proterr_response PROTOCOL_ERR_RSP_SDXB, *PPROTOCOL_ERR_RSP_SDXB;

//
// Port Parameters S/DXB compressed response
//
typedef struct
{
   uint8    ctype;         // Command
   uint8    fill[3];       //
   dxb_uint32   speed;         // Port Speed in BPS
} PORT_PARAM_RSP_SDXB_COMP, *PPORT_PARAM_RSP_SDXB_COMP;

/*
 * S/DXB Compressed Response/Indication structures.
 *
 * The largest, by far, S/DXB Response structure is the Port-Parameters 
 * Response.  Except for the Speed, this response is composed of data which 
 * is redundant, we already set it so we know what the other values are.
 * Thus when we reduce the size of the Port-Parameters Response, this whole
 * union is much smaller.
 */
typedef struct _SDXB_COMP_RSP
{
   union {
      SYNC_RSP_SDXB           Sync;
      BUFFER_SIZE_RSP_SDXB    Buffer;
      MODEM_CTRL_RSP_SDXB     Modem;
      EVENT_RSP_SDXB          Event;
      LINE_ERR_RSP_SDXB       Line;
      PORT_CAP_RSP_SDXB       PortCap;
      PORT_PARAM_RSP_SDXB_COMP PortParam;
      SEQ_NUM_RSP_SDXB        SeqNum;
      SPCX_IND_SDXB           SpxChar;
   } U;
} SDXB_COMP_RSP, *PSDXB_COMP_RSP;

