aboutsummaryrefslogtreecommitdiff
path: root/sys/sys
diff options
context:
space:
mode:
authorPaul Traina <pst@FreeBSD.org>1995-02-25 20:09:44 +0000
committerPaul Traina <pst@FreeBSD.org>1995-02-25 20:09:44 +0000
commit77f77631e75f6858d00b61473e49b7c8906c5aa8 (patch)
tree1f0482b969de4dd457ac5b450c026dcaab6317e2 /sys/sys
parent686c46d225921363fb8749fd74457ecbf8a9e987 (diff)
downloadsrc-77f77631e75f6858d00b61473e49b7c8906c5aa8.tar.gz
src-77f77631e75f6858d00b61473e49b7c8906c5aa8.zip
(a) remove the pointer to each driver's tty structure array from cdevsw
(b) add a function callback vector to tty drivers that will return a pointer to a valid tty structure based upon a dev_t (c) make syscons structures the same size whether or not APM is enabled so utilities don't crash if NAPM changes (and make the damn kernel compile!) (d) rewrite /dev/snp ioctl interface so that it is device driver and i386 independant
Notes
Notes: svn path=/head/; revision=6712
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/conf.h5
-rw-r--r--sys/sys/linedisc.h5
-rw-r--r--sys/sys/snoop.h29
-rw-r--r--sys/sys/tty.h4
4 files changed, 14 insertions, 29 deletions
diff --git a/sys/sys/conf.h b/sys/sys/conf.h
index 63455a5095a5..17844b165a4c 100644
--- a/sys/sys/conf.h
+++ b/sys/sys/conf.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)conf.h 8.3 (Berkeley) 1/21/94
- * $Id: conf.h,v 1.7 1995/01/23 02:52:28 phk Exp $
+ * $Id: conf.h,v 1.8 1995/02/09 13:51:25 davidg Exp $
*/
#ifndef _SYS_CONF_H_
@@ -66,6 +66,7 @@ typedef int d_stop_t __P((struct tty *, int));
typedef int d_reset_t __P((int));
typedef int d_select_t __P((dev_t, int, struct proc *));
typedef int d_mmap_t __P((/* XXX */));
+typedef struct tty * d_ttycv_t __P((dev_t));
struct bdevsw {
d_open_t *d_open;
@@ -89,7 +90,7 @@ struct cdevsw {
d_ioctl_t *d_ioctl;
d_stop_t *d_stop;
d_reset_t *d_reset;
- struct tty *d_ttys;
+ d_ttycv_t *d_devtotty;
d_select_t *d_select;
d_mmap_t *d_mmap;
d_strategy_t *d_strategy;
diff --git a/sys/sys/linedisc.h b/sys/sys/linedisc.h
index 63455a5095a5..17844b165a4c 100644
--- a/sys/sys/linedisc.h
+++ b/sys/sys/linedisc.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)conf.h 8.3 (Berkeley) 1/21/94
- * $Id: conf.h,v 1.7 1995/01/23 02:52:28 phk Exp $
+ * $Id: conf.h,v 1.8 1995/02/09 13:51:25 davidg Exp $
*/
#ifndef _SYS_CONF_H_
@@ -66,6 +66,7 @@ typedef int d_stop_t __P((struct tty *, int));
typedef int d_reset_t __P((int));
typedef int d_select_t __P((dev_t, int, struct proc *));
typedef int d_mmap_t __P((/* XXX */));
+typedef struct tty * d_ttycv_t __P((dev_t));
struct bdevsw {
d_open_t *d_open;
@@ -89,7 +90,7 @@ struct cdevsw {
d_ioctl_t *d_ioctl;
d_stop_t *d_stop;
d_reset_t *d_reset;
- struct tty *d_ttys;
+ d_ttycv_t *d_devtotty;
d_select_t *d_select;
d_mmap_t *d_mmap;
d_strategy_t *d_strategy;
diff --git a/sys/sys/snoop.h b/sys/sys/snoop.h
index 3790b0006a67..6da28a84b319 100644
--- a/sys/sys/snoop.h
+++ b/sys/sys/snoop.h
@@ -33,11 +33,11 @@
*/
struct snoop {
- int snp_unit; /* Pty unit number to snoop on */
- int snp_type; /* Type same as st_type later */
- u_long snp_len,snp_base; /* Buffer data len and base */
+ dev_t snp_target; /* major/minor number of device*/
+ u_long snp_len; /* buffer data length */
+ u_long snp_base; /* buffer data base */
u_long snp_blen; /* Overall buffer len */
- char *snp_buf; /* Data buffer */
+ caddr_t snp_buf; /* Data buffer */
int snp_flags; /* Flags place */
#define SNOOP_NBIO 0x0001
#define SNOOP_ASYNC 0x0002
@@ -48,22 +48,6 @@ struct snoop {
struct selinfo snp_sel; /* Selection info */
};
-
-
-/*
- * This is structure to be passed
- * to ioctl() so we can define different
- * types of tty's..
- */
-struct snptty {
- int st_unit;
- int st_type;
-#define ST_PTY 0 /* Regular Pty */
-#define ST_VTY 1 /* Vty for SysCons.. */
-#define ST_SIO 2 /* Serial lines */
-#define ST_MAXTYPE 2
-};
-
/*
* Theese are snoop io controls
* SNPSTTY accepts 'struct snptty' as input.
@@ -71,8 +55,8 @@ struct snptty {
* detached from it's current tty.
*/
-#define SNPSTTY _IOW('T', 90, struct snptty)
-#define SNPGTTY _IOR('T', 89, struct snptty)
+#define SNPSTTY _IOW('T', 90, dev_t)
+#define SNPGTTY _IOR('T', 89, dev_t)
/*
* Theese values would be returned by FIONREAD ioctl
@@ -84,4 +68,3 @@ struct snptty {
#define SNP_DETACH -3
#endif
-
diff --git a/sys/sys/tty.h b/sys/sys/tty.h
index 277c074662a6..cb7a667fe1c3 100644
--- a/sys/sys/tty.h
+++ b/sys/sys/tty.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)tty.h 8.6 (Berkeley) 1/21/94
- * $Id: tty.h,v 1.9 1995/02/09 11:14:19 jkh Exp $
+ * $Id: tty.h,v 1.10 1995/02/14 21:23:48 ugen Exp $
*/
#ifndef _SYS_TTY_H_
@@ -208,7 +208,7 @@ int ttioctl __P((struct tty *tp, int com, void *data, int flag));
int ttread __P((struct tty *tp, struct uio *uio, int flag));
int ttnread __P((struct tty *));
void ttrstrt __P((void *tp));
-int ttselect __P((dev_t device, int rw, struct proc *p));
+int ttyselect __P((struct tty *tp, int rw, struct proc *p));
void ttsetwater __P((struct tty *tp));
int ttspeedtab __P((int speed, struct speedtab *table));
int ttstart __P((struct tty *tp));