sudev.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) 1990, 1991 UNIX System Laboratories, Inc. */
/* Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T */
/* All Rights Reserved */
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_SUDEV_H
#define _SYS_SUDEV_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/dditypes.h>
/*
* Definitions for INS8250 / 16550 chips
*/
/* defined as offsets from the data register */
#define DLL 0 /* divisor latch (lsb) */
/*
* INTEL 8210-A/B & 16450/16550 Registers Structure.
*/
/* Line Control Register */
#define STOP1 0x00
#define STOP2 0x04
#define PAREN 0x08
#define PAREVN 0x10
#define PARMARK 0x20
#define SNDBRK 0x40
/* baud rate definitions */
/* Line Status Register */
/* Interrupt Id Regisger */
/* Interrupt Enable Register */
/* Modem Control Register */
/* Modem Status Register */
/* flags for FCR (FIFO Control register) */
/*
*/
#define VPC_SERIAL_DOS AIOCDOSMODE
#define VPC_SERIAL_NONDOS AIOCNONDOSMODE
#define VPC_SERIAL_INFO AIOCINFO
#define VPC_SERIAL_OUT AIOCSERIALOUT
#define VPC_SERIAL_IN AIOCSERIALIN
#define SO_DIVLLSB 1
#define SO_DIVLMSB 2
#define SO_LCR 3
#define SO_MCR 4
#define SI_MSR 1
#define OVERRUN 040000
#define FRERROR 020000
#define PERROR 010000
/*
* Ring buffer and async line management definitions.
*/
#define RING_UNMARK(ap) \
/*
* Serial kstats structure and macro to increment an individual kstat
*/
struct serial_kstats {
};
/*
* Hardware channel common data. One structure per port.
* Each of the fields in this structure is required to be protected by a
* mutex lock at the highest priority at which it can be altered.
* The asy_flags, and asy_next fields can be altered by interrupt
* handling code that must be protected by the mutex whose handle is
* stored in asy_excl_hi. All others can be protected by the asy_excl
* mutex, which is lower priority and adaptive.
*/
struct asycom {
int asy_flags; /* random flags */
/* protected by asy_excl_hi lock */
long asy_unit; /* which port */
int asysoftpend; /* Flag indicating soft int pending. */
int asy_baud_divisor_factor; /* for different chips */
int asy_ocflags; /* old cflags used in asy_program() */
int asy_speed_cap; /* maximum baud rate */
};
/*
* Asychronous protocol private data structure for ASY.
* Each of the fields in the structure is required to be protected by
* the lower priority lock except the fields that are set only at
* base level but cleared (with out lock) at interrupt level.
*/
struct asyncline {
int async_flags; /* random flags */
/*
* The following fields are protected by the asy_excl_hi lock.
* Some, such as async_flowc, are set only at the base level and
* cleared (without the lock) only by the interrupt level.
*/
int async_ocnt; /* output count */
/*
* Each character stuffed into the ring has two bytes associated
* with it. The first byte is used to indicate special conditions
* and the second byte is the actual data. The ring buffer
* needs to be defined as ushort_t to accomodate this.
*/
short async_break; /* break count */
union {
struct {
} _a;
} async_uover;
short async_ext; /* modem status change count */
short async_work; /* work to do flag */
};
/* definitions for async_flags field */
/* asy_hwtype definitions */
#define ASY82510 0x1
#define ASY16550AF 0x2
/* definitions for asy_flags field */
#define ASY_NEEDSOFT 0x00000001
#define ASY_DOINGSOFT 0x00000002
#define ASY_PPS 0x00000004
#define ASY_PPS_EDGE 0x00000008
#define ASY_IGNORE_CD 0x00000040
/*
* Different devices this driver supports and what it is used to drive
* currently
*/
#define ASY_KEYBOARD 0x01
#define ASY_MOUSE 0x02
#define ASY_SERIAL 0x03
/*
* RSC_DEVICE defines the bit in the minor device number that specifies
* the tty line is to be used for console/controlling a RSC device.
*/
/*
* OUTLINE defines the high-order flag bit in the minor device number that
* controls use of a tty line for dialin and dialout simultaneously.
*/
/* suggested number of soft state instances */
#define SU_INITIAL_SOFT_ITEMS 0x02
/*
* ASYSETSOFT macro to pend a soft interrupt if one isn't already pending.
*/
#define ASYSETSOFT(asy) { \
if (!asy->asysoftpend) { \
} else \
} \
}
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SUDEV_H */