/*
* 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 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_ZSDEV_H
#define _SYS_ZSDEV_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Onboard serial ports.
* Device dependent software definitions.
* All interfaces described in this file are private to the Sun 'zs' driver
* implementation and may change at any time without notice.
*/
/*
* Chip, buffer, and register definitions for Z8530 SCC
*/
#include <sys/dditypes.h>
#include <sys/ser_zscc.h>
#ifdef _MACHDEP
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _MACHDEP
#define ZSDELAY()
#define ZSFLUSH()
#endif
/*
* OUTLINE defines the high-order flag bit in the minor device number that
* controls use of a tty line for dialin and dialout simultaneously.
*/
extern int zs_usec_delay;
#define ZS_OFF 0
/*
* Modem control commands.
*/
#define DMSET 0
/*
* Macros to access a port
*/
((struct zscc_device *) \
ZSDELAY(); \
((struct zscc_device *) \
ZSDELAY(); \
}
((struct zscc_device *) \
ZSDELAY(); \
((struct zscc_device *) \
ZSDELAY(); \
}
ZSDELAY(); \
ZSDELAY(); \
}
((struct zscc_device *) \
ZSDELAY(); \
var = ((struct zscc_device *) \
ZSDELAY(); \
}
((struct zscc_device *) \
ZSDELAY(); \
var = ((struct zscc_device *) \
ZSDELAY(); \
}
register struct zscc_device *tmp; \
ZSDELAY(); \
ZSDELAY(); \
}
ZSDELAY(); \
ZSDELAY(); \
}
ZSDELAY(); \
ZSDELAY(); \
}
ZSDELAY(); \
ZSFLUSH(); \
}
ZSDELAY(); \
ZSFLUSH(); \
}
/*
* Protocol specific entry points for driver routines.
*/
struct zsops {
};
/*
* 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 zs_flags, zs_wreg and zs_next fields can be altered by interrupt
* handling code that runs at ZS_PL_HI (IPL 12), so they must be protected
* by the mutex whose handle is stored in zs_excl_hi. All others can be
* protected by the zs_excl mutex, which is lower priority and adaptive.
*/
struct zscom {
unsigned char *zs_wr_cur;
unsigned char *zs_wr_lim;
unsigned char *zs_rd_cur;
unsigned char *zs_rd_lim;
/*
* The zs_wreg, zs_next and zs_flags fields
* are protected by zs_excl_hi.
*/
};
/*
* Definition for zs_flags field
*
* ZS_CLOSED is for synchronizing with za_soft_active an za_kick_active.
*/
#ifdef _KERNEL
/*
* ZSSETSOFT macro to pend a level 3 interrupt if one isn't already pending.
*/
extern int zssoftpend; /* secondary interrupt pending */
extern ddi_softintr_t zs_softintr_id;
if (!zssoftpend) { \
zssoftpend = 1; \
} \
}
#endif /* _KERNEL */
/*
* Lock priority definitions.
* XXX: These should be obtained from configuration data, eventually.
*/
/*
* Definitions for generic SCC programming routine
*/
struct zs_prog {
};
/*
* Definitions for zs_prog flags field
*/
extern void setzssoft(void);
extern char *zssoftCAR;
extern int nzs;
extern struct zsops zsops_null;
extern int zs_drain_check;
#ifdef __cplusplus
}
#endif
#endif /* !_SYS_ZSDEV_H */