ser_sync.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1991,1997-1998 by Sun Microsystems, Inc.
* All rights reserved.
*/
#ifndef _SYS_SER_SYNC_H
#define _SYS_SER_SYNC_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Initial port setup parameters for sync lines
*/
#include <sys/time_impl.h>
#ifdef __cplusplus
extern "C" {
#endif
/* reason codes for IOCSETMODE */
/*
* Definitions for modes of operations of
* synchronous lines, both RS-232 and RS-449
*/
struct scc_mode {
char sm_txclock; /* enum - transmit clock sources */
char sm_rxclock; /* enum - receive clock sources */
int sm_baudrate;
int sm_retval; /* SMERR codes go here, query with GETMODE */
};
/*
* defines for txclock
*/
#define TXC_IS_TXC 0 /* use incoming transmit clock */
/*
* defines for rxclock
*/
#define RXC_IS_RXC 0 /* use incoming receive clock */
/*
*/
#define TXC_IS_SYSCLK 4
#define RXC_IS_SYSCLK 4
#define TXC_IS_INVERT 5
#define RXC_IS_INVERT 5
#define TRXD_NO_INVERT 0
#define RXD_IS_INVERT 1
#define TXD_IS_INVERT 2
#define TRXD_IS_INVERT 3
/*
* defines for config
*/
struct sl_status {
int type;
int status;
};
#if defined(_SYSCALL32)
struct sl_status32 {
};
#endif /* _SYSCALL32 */
/*
* defines for type field in sl_status
*/
/*
* defines for status field in sl_status
* DO NOT change the values for CS_(DCD|CTS)_(UP|DOWN)!!!
*/
#define CS_DCD_DOWN 0x08
#define CS_DCD_UP 0x0c
#define CS_DCD_DROP 0x10
#define CS_CTS_DOWN 0x20
#define CS_CTS_UP 0x30
#define CS_CTS_DROP 0x40
#define CS_CTS_TO 0x80
#define CS_DCD CS_DCD_DOWN
#define CS_CTS CS_CTS_DOWN
/*
* Event statistics reported by hardware.
*/
struct sl_stats {
int ipack; /* input packets */
int opack; /* output packets */
int ichar; /* input bytes */
int ochar; /* output bytes */
int abort; /* abort received */
int crc; /* CRC error */
int cts; /* CTS timeouts */
int dcd; /* Carrier drops */
int overrun; /* receiver overrun */
int underrun; /* xmitter underrun */
int ierror; /* input error (rxbad) */
int oerror; /* output error (watchdog timeout) */
int nobuffers; /* no active receive block available */
};
/*
* Per-stream structure. Each of these points to only one device instance,
* but there may be more than one doing so. If marked as ST_CLONE, it has
* been opened throught the clone device, and cannot have the data path.
*/
struct ser_str {
int str_inst; /* Device instance (unit) number */
int str_state; /* see below */
};
/*
* Synchronous Protocol Private Data Structure
*/
#define ZSH_MAX_RSTANDBY 6
#define ZSH_RDONE_MAX 20
struct syncline {
/* receive: standby message blocks */
/* complete messages to be sent up */
int sl_rdone_wptr;
int sl_rdone_rptr;
int sl_wd_count; /* watchdog counter */
int sl_ocnt; /* output message size */
int sl_mru; /* Maximum Receive Unit */
int sl_bad_count_int;
};
/*
* Bit definitions for sl_txstate.
*/
/*
* Bit definitions for sl_flags.
*/
/*
* Bit definitions for str_state.
*/
extern int hz;
#ifdef __cplusplus
}
#endif
#endif /* !_SYS_SER_SYNC_H */