/*
 * $Copyright:	$
 * Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
 * Sequent Computer Systems, Inc.   All rights reserved.
 *  
 * This software is furnished under a license and may be used
 * only in accordance with the terms of that license and with the
 * inclusion of the above copyright notice.   This software may not
 * be provided or otherwise made available to, or used by, any
 * other person.  No title to or ownership of the software is
 * hereby transferred.
 */

#ident "$Header: pty_space.c 1.11 90/03/07 $"

/*
 * pty_space.c
 *	pty space defintions
 */

/* $Log:	pty_space.c,v $
 */

#include "sys/types.h"
#include "sys/devsw.h"
#include "sys/session.h"
#include "sys/stream.h"
#include "sys/termio.h"
#include "sys/ptyms.h"
#include "config.h"


struct pt_ttys ptms_tty[_PTY_NUMDEV];	
int pt_cnt = _PTY_NUMDEV;

dev_t	last_pty_dev=(dev_t)-1;	/* Keeps track of the last allocated master, */
				/*      to speed the next allocation. */

/* The following are used to implement the TIOCPTYDEV master ioctl */

int ptm_major = PTM_CHARACTER;	/* major number of master driver */
int pts_major = PTS_CHARACTER;	/* major number of slave driver */

/* initial line discipline flags */
ulong ptsflags = CS8 | B300 | CREAD | HUPCL;


/* device operations */

extern	struct	streamtab	ptminfo;
extern	struct	streamtab	ptsinfo;
extern	int	nodev();
extern	int	nulldev();
extern	int	nostrmsgio();
extern	int	nostrpoll();

struct	devops	ptmdevops = {
	nulldev,		/* d_open */
	nulldev,		/* d_close */
	nulldev,		/* d_strategy */
	nulldev,		/* d_minphys */
	nulldev,		/* d_psize */
	nulldev,		/* d_print */
	nulldev,		/* d_read */
	nulldev,		/* d_write */
	nodev,			/* d_ioctl */
	nulldev,		/* d_mmap */
	nulldev,		/* d_intr */
	&ptminfo,		/* d_str */
	nostrmsgio,		/* d_strmsgio */
	nostrpoll		/* d_strpoll */
};

struct	devops	ptsdevops = {
	nulldev,		/* d_open */
	nulldev,		/* d_close */
	nulldev,		/* d_strategy */
	nulldev,		/* d_minphys */
	nulldev,		/* d_psize */
	nulldev,		/* d_print */
	nulldev,		/* d_read */
	nulldev,		/* d_write */
	nodev,			/* d_ioctl */
	nulldev,		/* d_mmap */
	nulldev,		/* d_intr */
	&ptsinfo,		/* d_str */
	nostrmsgio,		/* d_strmsgio */
	nostrpoll		/* d_strpoll */
};
