Added D_TTY to the cdevswitch flags for all tty drivers. This is required
for the Lite2 fix for always returning EIO in dead_read(). Cleaned up the cdevswitch initializers for all tty drivers. Removed explicit calls to ttsetwater() from all (tty) drivers. ttsetwater() is now called centrally for opens, not just for parameter changes.
This commit is contained in:
parent
87c95fa5dc
commit
cf8c7b0963
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=38485
@ -27,7 +27,7 @@
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cy.c,v 1.69 1998/08/19 04:17:38 bde Exp $
|
||||
* $Id: cy.c,v 1.70 1998/08/20 05:21:50 bde Exp $
|
||||
*/
|
||||
|
||||
#include "opt_compat.h"
|
||||
@ -378,12 +378,13 @@ static d_ioctl_t sioioctl;
|
||||
static d_stop_t siostop;
|
||||
static d_devtotty_t siodevtotty;
|
||||
|
||||
#define CDEV_MAJOR 48
|
||||
static struct cdevsw sio_cdevsw = {
|
||||
#define CDEV_MAJOR 48
|
||||
static struct cdevsw sio_cdevsw = {
|
||||
sioopen, sioclose, sioread, siowrite,
|
||||
sioioctl, siostop, noreset, siodevtotty,
|
||||
ttpoll, nommap, NULL, driver_name,
|
||||
NULL, -1,
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
static int comconsole = -1;
|
||||
|
@ -27,7 +27,7 @@
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cy.c,v 1.69 1998/08/19 04:17:38 bde Exp $
|
||||
* $Id: cy.c,v 1.70 1998/08/20 05:21:50 bde Exp $
|
||||
*/
|
||||
|
||||
#include "opt_compat.h"
|
||||
@ -378,12 +378,13 @@ static d_ioctl_t sioioctl;
|
||||
static d_stop_t siostop;
|
||||
static d_devtotty_t siodevtotty;
|
||||
|
||||
#define CDEV_MAJOR 48
|
||||
static struct cdevsw sio_cdevsw = {
|
||||
#define CDEV_MAJOR 48
|
||||
static struct cdevsw sio_cdevsw = {
|
||||
sioopen, sioclose, sioread, siowrite,
|
||||
sioioctl, siostop, noreset, siodevtotty,
|
||||
ttpoll, nommap, NULL, driver_name,
|
||||
NULL, -1,
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
static int comconsole = -1;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*-
|
||||
* dgb.c $Id: dgb.c,v 1.38 1998/08/12 23:44:22 brian Exp $
|
||||
* dgb.c $Id: dgb.c,v 1.39 1998/08/16 01:21:49 bde Exp $
|
||||
*
|
||||
* Digiboard driver.
|
||||
*
|
||||
@ -222,11 +222,14 @@ static d_ioctl_t dgbioctl;
|
||||
static d_stop_t dgbstop;
|
||||
static d_devtotty_t dgbdevtotty;
|
||||
|
||||
#define CDEV_MAJOR 58
|
||||
static struct cdevsw dgb_cdevsw =
|
||||
{ dgbopen, dgbclose, dgbread, dgbwrite, /*58*/
|
||||
dgbioctl, dgbstop, noreset, dgbdevtotty, /* dgb */
|
||||
ttpoll, nommap, NULL, "dgb", NULL, -1 };
|
||||
#define CDEV_MAJOR 58
|
||||
static struct cdevsw dgb_cdevsw = {
|
||||
dgbopen, dgbclose, dgbread, dgbwrite,
|
||||
dgbioctl, dgbstop, noreset, dgbdevtotty,
|
||||
ttpoll, nommap, NULL, "dgb",
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
static speed_t dgbdefaultrate = TTYDEF_SPEED;
|
||||
|
||||
@ -1071,8 +1074,6 @@ dgbopen(dev, flag, mode, p)
|
||||
goto out;
|
||||
}
|
||||
|
||||
ttsetwater(tp);
|
||||
|
||||
/* handle fake DCD for callout devices */
|
||||
/* and initial DCD */
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*-
|
||||
* $Id: dgm.c,v 1.3 1998/08/12 17:38:09 bde Exp $
|
||||
* $Id: dgm.c,v 1.4 1998/08/16 01:21:49 bde Exp $
|
||||
*
|
||||
* This driver and the associated header files support the ISA PC/Xem
|
||||
* Digiboards. Its evolutionary roots are described below.
|
||||
@ -227,11 +227,14 @@ static d_ioctl_t dgmioctl;
|
||||
static d_stop_t dgmstop;
|
||||
static d_devtotty_t dgmdevtotty;
|
||||
|
||||
#define CDEV_MAJOR 101
|
||||
static struct cdevsw dgm_cdevsw =
|
||||
{ dgmopen, dgmclose, dgmread, dgmwrite,
|
||||
dgmioctl, dgmstop, noreset, dgmdevtotty, /* dgm */
|
||||
ttpoll, nommap, NULL, "dgm", NULL, -1 };
|
||||
#define CDEV_MAJOR 101
|
||||
static struct cdevsw dgm_cdevsw = {
|
||||
dgmopen, dgmclose, dgmread, dgmwrite,
|
||||
dgmioctl, dgmstop, noreset, dgmdevtotty,
|
||||
ttpoll, nommap, NULL, "dgm",
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
static speed_t dgmdefaultrate = TTYDEF_SPEED;
|
||||
|
||||
@ -876,8 +879,6 @@ dgmopen(dev, flag, mode, p)
|
||||
goto out;
|
||||
}
|
||||
|
||||
ttsetwater(tp);
|
||||
|
||||
/* handle fake DCD for callout devices */
|
||||
/* and initial DCD */
|
||||
|
||||
|
@ -98,11 +98,14 @@ static d_ioctl_t rcioctl;
|
||||
static d_stop_t rcstop;
|
||||
static d_devtotty_t rcdevtotty;
|
||||
|
||||
#define CDEV_MAJOR 63
|
||||
static struct cdevsw rc_cdevsw =
|
||||
{ rcopen, rcclose, rcread, rcwrite, /*63*/
|
||||
rcioctl, rcstop, noreset, rcdevtotty,/* rc */
|
||||
ttpoll, nommap, NULL, "rc", NULL, -1 };
|
||||
#define CDEV_MAJOR 63
|
||||
static struct cdevsw rc_cdevsw = {
|
||||
rcopen, rcclose, rcread, rcwrite,
|
||||
rcioctl, rcstop, noreset, rcdevtotty,
|
||||
ttpoll, nommap, NULL, "rc",
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
/* Per-board structure */
|
||||
static struct rc_softc {
|
||||
@ -777,8 +780,6 @@ rcopen(dev, flag, mode, p)
|
||||
goto out;
|
||||
(void) rc_modctl(rc, TIOCM_RTS|TIOCM_DTR, DMSET);
|
||||
|
||||
ttsetwater(tp);
|
||||
|
||||
if ((rc->rc_msvr & MSVR_CD) || CALLOUT(dev))
|
||||
(*linesw[tp->t_line].l_modem)(tp, 1);
|
||||
}
|
||||
|
@ -788,8 +788,6 @@ struct isa_driver rpdriver = {
|
||||
rpprobe, rpattach, "rp"
|
||||
};
|
||||
|
||||
#define CDEV_MAJOR 81
|
||||
|
||||
static char driver_name[] = "rp";
|
||||
|
||||
static d_open_t rpopen;
|
||||
@ -800,11 +798,14 @@ static d_ioctl_t rpioctl;
|
||||
static d_stop_t rpstop;
|
||||
static d_devtotty_t rpdevtotty;
|
||||
|
||||
static struct cdevsw rp_cdevsw =
|
||||
{ rpopen, rpclose, rpread, rpwrite,
|
||||
rpioctl, rpstop, noreset, rpdevtotty,
|
||||
ttpoll, nommap, NULL, driver_name,
|
||||
NULL, -1};
|
||||
#define CDEV_MAJOR 81
|
||||
static struct cdevsw rp_cdevsw = {
|
||||
rpopen, rpclose, rpread, rpwrite,
|
||||
rpioctl, rpstop, noreset, rpdevtotty,
|
||||
ttpoll, nommap, NULL, driver_name,
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
static int rp_controller_port = 0;
|
||||
static int rp_num_ports_open = 0;
|
||||
@ -1400,8 +1401,6 @@ rpopen(dev, flag, mode, p)
|
||||
return(error);
|
||||
}
|
||||
|
||||
ttsetwater(tp);
|
||||
|
||||
rp_num_ports_open++;
|
||||
|
||||
IntMask = sGetChanIntID(&rp->rp_channel);
|
||||
|
@ -30,7 +30,7 @@
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE AUTHORS BE LIABLE.
|
||||
*
|
||||
* $Id: si.c,v 1.74 1998/08/16 00:57:07 bde Exp $
|
||||
* $Id: si.c,v 1.75 1998/08/16 01:04:48 bde Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@ -173,12 +173,14 @@ static d_ioctl_t siioctl;
|
||||
static d_stop_t sistop;
|
||||
static d_devtotty_t sidevtotty;
|
||||
|
||||
#define CDEV_MAJOR 68
|
||||
static struct cdevsw si_cdevsw =
|
||||
{ siopen, siclose, siread, siwrite, /*68*/
|
||||
siioctl, sistop, noreset, sidevtotty,/* si */
|
||||
ttpoll, nommap, NULL, "si", NULL, -1 };
|
||||
|
||||
#define CDEV_MAJOR 68
|
||||
static struct cdevsw si_cdevsw = {
|
||||
siopen, siclose, siread, siwrite,
|
||||
siioctl, sistop, noreset, sidevtotty,
|
||||
ttpoll, nommap, NULL, "si",
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
#ifdef SI_DEBUG /* use: ``options "SI_DEBUG"'' in your config file */
|
||||
|
||||
@ -1232,8 +1234,6 @@ siopen(dev, flag, mode, p)
|
||||
goto out;
|
||||
/* XXX: we should goto_top if siparam slept */
|
||||
|
||||
ttsetwater(tp);
|
||||
|
||||
/* set initial DCD state */
|
||||
pp->sp_last_hi_ip = ccbp->hi_ip;
|
||||
if ((pp->sp_last_hi_ip & IP_DCD) || IS_CALLOUT(mynor)) {
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
|
||||
* $Id: sio.c,v 1.211 1998/08/19 04:17:37 bde Exp $
|
||||
* $Id: sio.c,v 1.212 1998/08/20 05:12:48 bde Exp $
|
||||
*/
|
||||
|
||||
#include "opt_comconsole.h"
|
||||
@ -343,12 +343,13 @@ static d_ioctl_t sioioctl;
|
||||
static d_stop_t siostop;
|
||||
static d_devtotty_t siodevtotty;
|
||||
|
||||
#define CDEV_MAJOR 28
|
||||
static struct cdevsw sio_cdevsw = {
|
||||
#define CDEV_MAJOR 28
|
||||
static struct cdevsw sio_cdevsw = {
|
||||
sioopen, sioclose, sioread, siowrite,
|
||||
sioioctl, siostop, noreset, siodevtotty,
|
||||
ttpoll, nommap, NULL, driver_name,
|
||||
NULL, -1,
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
static int comconsole = -1;
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: syscons.c,v 1.274 1998/08/14 06:32:03 sos Exp $
|
||||
* $Id: syscons.c,v 1.275 1998/08/18 07:36:47 sos Exp $
|
||||
*/
|
||||
|
||||
#include "sc.h"
|
||||
@ -336,11 +336,14 @@ static d_ioctl_t scioctl;
|
||||
static d_devtotty_t scdevtotty;
|
||||
static d_mmap_t scmmap;
|
||||
|
||||
#define CDEV_MAJOR 12
|
||||
static struct cdevsw scdevsw = {
|
||||
#define CDEV_MAJOR 12
|
||||
static struct cdevsw sc_cdevsw = {
|
||||
scopen, scclose, scread, scwrite,
|
||||
scioctl, nullstop, noreset, scdevtotty,
|
||||
ttpoll, scmmap, nostrategy, "sc", NULL, -1 };
|
||||
ttpoll, scmmap, nostrategy, "sc",
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
/*
|
||||
* These functions need to be before calls to them so they can be inlined.
|
||||
@ -833,16 +836,16 @@ scattach(struct isa_device *dev)
|
||||
|
||||
at_shutdown(scshutdown, NULL, SHUTDOWN_PRE_SYNC);
|
||||
|
||||
cdevsw_add(&cdev, &scdevsw, NULL);
|
||||
cdevsw_add(&cdev, &sc_cdevsw, NULL);
|
||||
|
||||
#ifdef DEVFS
|
||||
for (vc = 0; vc < MAXCONS; vc++)
|
||||
sc_devfs_token[vc] = devfs_add_devswf(&scdevsw, vc, DV_CHR,
|
||||
sc_devfs_token[vc] = devfs_add_devswf(&sc_cdevsw, vc, DV_CHR,
|
||||
UID_ROOT, GID_WHEEL, 0600, "ttyv%r", vc);
|
||||
sc_vga_devfs_token = devfs_link(sc_devfs_token[0], "vga");
|
||||
sc_mouse_devfs_token = devfs_add_devswf(&scdevsw, SC_MOUSE, DV_CHR,
|
||||
sc_mouse_devfs_token = devfs_add_devswf(&sc_cdevsw, SC_MOUSE, DV_CHR,
|
||||
UID_ROOT, GID_WHEEL, 0600, "sysmouse");
|
||||
sc_console_devfs_token = devfs_add_devswf(&scdevsw, SC_CONSOLE, DV_CHR,
|
||||
sc_console_devfs_token = devfs_add_devswf(&sc_cdevsw, SC_CONSOLE, DV_CHR,
|
||||
UID_ROOT, GID_WHEEL, 0600, "consolectl");
|
||||
#endif
|
||||
return 0;
|
||||
@ -886,7 +889,6 @@ scopen(dev_t dev, int flag, int mode, struct proc *p)
|
||||
tp->t_lflag = TTYDEF_LFLAG;
|
||||
tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
|
||||
scparam(tp, &tp->t_termios);
|
||||
ttsetwater(tp);
|
||||
(*linesw[tp->t_line].l_modem)(tp, 1);
|
||||
if (minor(dev) == SC_MOUSE)
|
||||
mouse_level = 0; /* XXX */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*-
|
||||
* dgb.c $Id: dgb.c,v 1.38 1998/08/12 23:44:22 brian Exp $
|
||||
* dgb.c $Id: dgb.c,v 1.39 1998/08/16 01:21:49 bde Exp $
|
||||
*
|
||||
* Digiboard driver.
|
||||
*
|
||||
@ -222,11 +222,14 @@ static d_ioctl_t dgbioctl;
|
||||
static d_stop_t dgbstop;
|
||||
static d_devtotty_t dgbdevtotty;
|
||||
|
||||
#define CDEV_MAJOR 58
|
||||
static struct cdevsw dgb_cdevsw =
|
||||
{ dgbopen, dgbclose, dgbread, dgbwrite, /*58*/
|
||||
dgbioctl, dgbstop, noreset, dgbdevtotty, /* dgb */
|
||||
ttpoll, nommap, NULL, "dgb", NULL, -1 };
|
||||
#define CDEV_MAJOR 58
|
||||
static struct cdevsw dgb_cdevsw = {
|
||||
dgbopen, dgbclose, dgbread, dgbwrite,
|
||||
dgbioctl, dgbstop, noreset, dgbdevtotty,
|
||||
ttpoll, nommap, NULL, "dgb",
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
static speed_t dgbdefaultrate = TTYDEF_SPEED;
|
||||
|
||||
@ -1071,8 +1074,6 @@ dgbopen(dev, flag, mode, p)
|
||||
goto out;
|
||||
}
|
||||
|
||||
ttsetwater(tp);
|
||||
|
||||
/* handle fake DCD for callout devices */
|
||||
/* and initial DCD */
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*-
|
||||
* $Id: dgm.c,v 1.3 1998/08/12 17:38:09 bde Exp $
|
||||
* $Id: dgm.c,v 1.4 1998/08/16 01:21:49 bde Exp $
|
||||
*
|
||||
* This driver and the associated header files support the ISA PC/Xem
|
||||
* Digiboards. Its evolutionary roots are described below.
|
||||
@ -227,11 +227,14 @@ static d_ioctl_t dgmioctl;
|
||||
static d_stop_t dgmstop;
|
||||
static d_devtotty_t dgmdevtotty;
|
||||
|
||||
#define CDEV_MAJOR 101
|
||||
static struct cdevsw dgm_cdevsw =
|
||||
{ dgmopen, dgmclose, dgmread, dgmwrite,
|
||||
dgmioctl, dgmstop, noreset, dgmdevtotty, /* dgm */
|
||||
ttpoll, nommap, NULL, "dgm", NULL, -1 };
|
||||
#define CDEV_MAJOR 101
|
||||
static struct cdevsw dgm_cdevsw = {
|
||||
dgmopen, dgmclose, dgmread, dgmwrite,
|
||||
dgmioctl, dgmstop, noreset, dgmdevtotty,
|
||||
ttpoll, nommap, NULL, "dgm",
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
static speed_t dgmdefaultrate = TTYDEF_SPEED;
|
||||
|
||||
@ -876,8 +879,6 @@ dgmopen(dev, flag, mode, p)
|
||||
goto out;
|
||||
}
|
||||
|
||||
ttsetwater(tp);
|
||||
|
||||
/* handle fake DCD for callout devices */
|
||||
/* and initial DCD */
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)cons.c 7.2 (Berkeley) 5/9/91
|
||||
* $Id: cons.c,v 1.57 1998/03/28 10:32:56 bde Exp $
|
||||
* $Id: cons.c,v 1.58 1998/06/07 17:09:58 dfr Exp $
|
||||
*/
|
||||
|
||||
#include "opt_devfs.h"
|
||||
@ -81,11 +81,14 @@ static d_write_t cnwrite;
|
||||
static d_ioctl_t cnioctl;
|
||||
static d_poll_t cnpoll;
|
||||
|
||||
#define CDEV_MAJOR 0
|
||||
static struct cdevsw cn_cdevsw =
|
||||
{ cnopen, cnclose, cnread, cnwrite, /*0*/
|
||||
cnioctl, nullstop, nullreset, nodevtotty,/* console */
|
||||
cnpoll, nommap, NULL, "console", NULL, -1 };
|
||||
#define CDEV_MAJOR 0
|
||||
static struct cdevsw cn_cdevsw = {
|
||||
cnopen, cnclose, cnread, cnwrite,
|
||||
cnioctl, nullstop, nullreset, nodevtotty,
|
||||
cnpoll, nommap, NULL, "console",
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
static dev_t cn_dev_t; /* seems to be never really used */
|
||||
SYSCTL_OPAQUE(_machdep, CPU_CONSDEV, consdev, CTLTYPE_OPAQUE|CTLFLAG_RD,
|
||||
|
@ -88,13 +88,15 @@ static d_ioctl_t cxioctl;
|
||||
static d_stop_t cxstop;
|
||||
static d_devtotty_t cxdevtotty;
|
||||
|
||||
# define CDEV_MAJOR 42
|
||||
|
||||
/* Don't make this static. if_cx.c uses it. */
|
||||
struct cdevsw cx_cdevsw =
|
||||
{ cxopen, cxclose, cxread, cxwrite, /*42*/
|
||||
cxioctl, cxstop, nullreset, cxdevtotty,/* cronyx */
|
||||
ttpoll, nommap, NULL, "cx", NULL, -1 };
|
||||
#define CDEV_MAJOR 42
|
||||
/* Don't make this static, since if_cx.c uses it. */
|
||||
struct cdevsw cx_cdevsw = {
|
||||
cxopen, cxclose, cxread, cxwrite,
|
||||
cxioctl, cxstop, nullreset, cxdevtotty,
|
||||
ttpoll, nommap, NULL, "cx",
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
#else
|
||||
struct tty *cx_tty [NCX*NCHAN]; /* tty data */
|
||||
#endif
|
||||
|
@ -27,7 +27,7 @@
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cy.c,v 1.69 1998/08/19 04:17:38 bde Exp $
|
||||
* $Id: cy.c,v 1.70 1998/08/20 05:21:50 bde Exp $
|
||||
*/
|
||||
|
||||
#include "opt_compat.h"
|
||||
@ -378,12 +378,13 @@ static d_ioctl_t sioioctl;
|
||||
static d_stop_t siostop;
|
||||
static d_devtotty_t siodevtotty;
|
||||
|
||||
#define CDEV_MAJOR 48
|
||||
static struct cdevsw sio_cdevsw = {
|
||||
#define CDEV_MAJOR 48
|
||||
static struct cdevsw sio_cdevsw = {
|
||||
sioopen, sioclose, sioread, siowrite,
|
||||
sioioctl, siostop, noreset, siodevtotty,
|
||||
ttpoll, nommap, NULL, driver_name,
|
||||
NULL, -1,
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
static int comconsole = -1;
|
||||
|
@ -33,7 +33,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: istallion.c,v 1.19 1998/06/07 17:10:42 dfr Exp $
|
||||
* $Id: istallion.c,v 1.20 1998/08/16 01:21:49 bde Exp $
|
||||
*/
|
||||
|
||||
/*****************************************************************************/
|
||||
@ -641,12 +641,13 @@ struct isa_driver stlidriver = {
|
||||
*/
|
||||
|
||||
#define CDEV_MAJOR 75
|
||||
|
||||
static struct cdevsw stli_cdevsw =
|
||||
{ stliopen, stliclose, stliread, stliwrite,
|
||||
stliioctl, stlistop, noreset, stlidevtotty,
|
||||
ttpoll, nommap, NULL, stli_drvname,
|
||||
NULL, -1 };
|
||||
static struct cdevsw stli_cdevsw = {
|
||||
stliopen, stliclose, stliread, stliwrite,
|
||||
stliioctl, stlistop, noreset, stlidevtotty,
|
||||
ttpoll, nommap, NULL, stli_drvname,
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
static stli_devsw_installed = 0;
|
||||
|
||||
@ -988,7 +989,6 @@ STATIC int stliopen(dev_t dev, int flag, int mode, struct proc *p)
|
||||
portp->initintios;
|
||||
stli_initopen(portp);
|
||||
wakeup(&portp->state);
|
||||
ttsetwater(tp);
|
||||
if ((portp->sigs & TIOCM_CD) || callout)
|
||||
(*linesw[tp->t_line].l_modem)(tp, 1);
|
||||
} else {
|
||||
|
@ -122,11 +122,13 @@ static d_ioctl_t pcioctl;
|
||||
static d_devtotty_t pcdevtotty;
|
||||
static d_mmap_t pcmmap;
|
||||
|
||||
#define CDEV_MAJOR 12
|
||||
static struct cdevsw pcdevsw = {
|
||||
#define CDEV_MAJOR 12
|
||||
static struct cdevsw pc_cdevsw = {
|
||||
pcopen, pcclose, pcread, pcwrite,
|
||||
pcioctl, nullstop, noreset, pcdevtotty,
|
||||
ttpoll, pcmmap, nostrategy, "vt", NULL, -1
|
||||
ttpoll, pcmmap, nostrategy, "vt",
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
#if PCVT_FREEBSD > 205
|
||||
@ -356,13 +358,13 @@ pcattach(struct isa_device *dev)
|
||||
{
|
||||
dev_t dev = makedev(CDEV_MAJOR, 0);
|
||||
|
||||
cdevsw_add(&dev, &pcdevsw, NULL);
|
||||
cdevsw_add(&dev, &pc_cdevsw, NULL);
|
||||
}
|
||||
|
||||
#ifdef DEVFS
|
||||
for(vt = 0; vt < MAXCONS; vt++) {
|
||||
pcvt_devfs_token[vt] =
|
||||
devfs_add_devswf(&pcdevsw, vt,
|
||||
devfs_add_devswf(&pc_cdevsw, vt,
|
||||
DV_CHR, 0, 0, 0600, "ttyv%r", vt );
|
||||
}
|
||||
#endif DEVFS
|
||||
@ -489,7 +491,6 @@ pcopen(Dev_t dev, int flag, int mode, struct proc *p)
|
||||
tp->t_lflag = TTYDEF_LFLAG;
|
||||
tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
|
||||
pcparam(tp, &tp->t_termios);
|
||||
ttsetwater(tp);
|
||||
(*linesw[tp->t_line].l_modem)(tp, 1); /* fake connection */
|
||||
winsz = 1; /* set winsize later */
|
||||
}
|
||||
|
@ -98,11 +98,14 @@ static d_ioctl_t rcioctl;
|
||||
static d_stop_t rcstop;
|
||||
static d_devtotty_t rcdevtotty;
|
||||
|
||||
#define CDEV_MAJOR 63
|
||||
static struct cdevsw rc_cdevsw =
|
||||
{ rcopen, rcclose, rcread, rcwrite, /*63*/
|
||||
rcioctl, rcstop, noreset, rcdevtotty,/* rc */
|
||||
ttpoll, nommap, NULL, "rc", NULL, -1 };
|
||||
#define CDEV_MAJOR 63
|
||||
static struct cdevsw rc_cdevsw = {
|
||||
rcopen, rcclose, rcread, rcwrite,
|
||||
rcioctl, rcstop, noreset, rcdevtotty,
|
||||
ttpoll, nommap, NULL, "rc",
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
/* Per-board structure */
|
||||
static struct rc_softc {
|
||||
@ -777,8 +780,6 @@ rcopen(dev, flag, mode, p)
|
||||
goto out;
|
||||
(void) rc_modctl(rc, TIOCM_RTS|TIOCM_DTR, DMSET);
|
||||
|
||||
ttsetwater(tp);
|
||||
|
||||
if ((rc->rc_msvr & MSVR_CD) || CALLOUT(dev))
|
||||
(*linesw[tp->t_line].l_modem)(tp, 1);
|
||||
}
|
||||
|
@ -788,8 +788,6 @@ struct isa_driver rpdriver = {
|
||||
rpprobe, rpattach, "rp"
|
||||
};
|
||||
|
||||
#define CDEV_MAJOR 81
|
||||
|
||||
static char driver_name[] = "rp";
|
||||
|
||||
static d_open_t rpopen;
|
||||
@ -800,11 +798,14 @@ static d_ioctl_t rpioctl;
|
||||
static d_stop_t rpstop;
|
||||
static d_devtotty_t rpdevtotty;
|
||||
|
||||
static struct cdevsw rp_cdevsw =
|
||||
{ rpopen, rpclose, rpread, rpwrite,
|
||||
rpioctl, rpstop, noreset, rpdevtotty,
|
||||
ttpoll, nommap, NULL, driver_name,
|
||||
NULL, -1};
|
||||
#define CDEV_MAJOR 81
|
||||
static struct cdevsw rp_cdevsw = {
|
||||
rpopen, rpclose, rpread, rpwrite,
|
||||
rpioctl, rpstop, noreset, rpdevtotty,
|
||||
ttpoll, nommap, NULL, driver_name,
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
static int rp_controller_port = 0;
|
||||
static int rp_num_ports_open = 0;
|
||||
@ -1400,8 +1401,6 @@ rpopen(dev, flag, mode, p)
|
||||
return(error);
|
||||
}
|
||||
|
||||
ttsetwater(tp);
|
||||
|
||||
rp_num_ports_open++;
|
||||
|
||||
IntMask = sGetChanIntID(&rp->rp_channel);
|
||||
|
@ -30,7 +30,7 @@
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE AUTHORS BE LIABLE.
|
||||
*
|
||||
* $Id: si.c,v 1.74 1998/08/16 00:57:07 bde Exp $
|
||||
* $Id: si.c,v 1.75 1998/08/16 01:04:48 bde Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@ -173,12 +173,14 @@ static d_ioctl_t siioctl;
|
||||
static d_stop_t sistop;
|
||||
static d_devtotty_t sidevtotty;
|
||||
|
||||
#define CDEV_MAJOR 68
|
||||
static struct cdevsw si_cdevsw =
|
||||
{ siopen, siclose, siread, siwrite, /*68*/
|
||||
siioctl, sistop, noreset, sidevtotty,/* si */
|
||||
ttpoll, nommap, NULL, "si", NULL, -1 };
|
||||
|
||||
#define CDEV_MAJOR 68
|
||||
static struct cdevsw si_cdevsw = {
|
||||
siopen, siclose, siread, siwrite,
|
||||
siioctl, sistop, noreset, sidevtotty,
|
||||
ttpoll, nommap, NULL, "si",
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
#ifdef SI_DEBUG /* use: ``options "SI_DEBUG"'' in your config file */
|
||||
|
||||
@ -1232,8 +1234,6 @@ siopen(dev, flag, mode, p)
|
||||
goto out;
|
||||
/* XXX: we should goto_top if siparam slept */
|
||||
|
||||
ttsetwater(tp);
|
||||
|
||||
/* set initial DCD state */
|
||||
pp->sp_last_hi_ip = ccbp->hi_ip;
|
||||
if ((pp->sp_last_hi_ip & IP_DCD) || IS_CALLOUT(mynor)) {
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
|
||||
* $Id: sio.c,v 1.211 1998/08/19 04:17:37 bde Exp $
|
||||
* $Id: sio.c,v 1.212 1998/08/20 05:12:48 bde Exp $
|
||||
*/
|
||||
|
||||
#include "opt_comconsole.h"
|
||||
@ -343,12 +343,13 @@ static d_ioctl_t sioioctl;
|
||||
static d_stop_t siostop;
|
||||
static d_devtotty_t siodevtotty;
|
||||
|
||||
#define CDEV_MAJOR 28
|
||||
static struct cdevsw sio_cdevsw = {
|
||||
#define CDEV_MAJOR 28
|
||||
static struct cdevsw sio_cdevsw = {
|
||||
sioopen, sioclose, sioread, siowrite,
|
||||
sioioctl, siostop, noreset, siodevtotty,
|
||||
ttpoll, nommap, NULL, driver_name,
|
||||
NULL, -1,
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
static int comconsole = -1;
|
||||
|
@ -33,7 +33,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: stallion.c,v 1.19 1998/04/15 17:45:50 bde Exp $
|
||||
* $Id: stallion.c,v 1.20 1998/06/07 17:11:00 dfr Exp $
|
||||
*/
|
||||
|
||||
/*****************************************************************************/
|
||||
@ -534,11 +534,13 @@ DATA_SET (pcidevice_set, stlpcidriver);
|
||||
*/
|
||||
|
||||
#define CDEV_MAJOR 72
|
||||
|
||||
static struct cdevsw stl_cdevsw =
|
||||
{ stlopen, stlclose, stlread, stlwrite,
|
||||
stlioctl, stlstop, noreset, stldevtotty,
|
||||
ttpoll, nommap, NULL, "stl", NULL, -1 };
|
||||
static struct cdevsw stl_cdevsw = {
|
||||
stlopen, stlclose, stlread, stlwrite,
|
||||
stlioctl, stlstop, noreset, stldevtotty,
|
||||
ttpoll, nommap, NULL, "stl",
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
static stl_devsw_installed = 0;
|
||||
|
||||
@ -799,7 +801,6 @@ STATIC int stlopen(dev_t dev, int flag, int mode, struct proc *p)
|
||||
tp->t_termios = callout ? portp->initouttios :
|
||||
portp->initintios;
|
||||
stl_rawopen(portp);
|
||||
ttsetwater(tp);
|
||||
if ((portp->sigs & TIOCM_CD) || callout)
|
||||
(*linesw[tp->t_line].l_modem)(tp, 1);
|
||||
} else {
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: syscons.c,v 1.274 1998/08/14 06:32:03 sos Exp $
|
||||
* $Id: syscons.c,v 1.275 1998/08/18 07:36:47 sos Exp $
|
||||
*/
|
||||
|
||||
#include "sc.h"
|
||||
@ -336,11 +336,14 @@ static d_ioctl_t scioctl;
|
||||
static d_devtotty_t scdevtotty;
|
||||
static d_mmap_t scmmap;
|
||||
|
||||
#define CDEV_MAJOR 12
|
||||
static struct cdevsw scdevsw = {
|
||||
#define CDEV_MAJOR 12
|
||||
static struct cdevsw sc_cdevsw = {
|
||||
scopen, scclose, scread, scwrite,
|
||||
scioctl, nullstop, noreset, scdevtotty,
|
||||
ttpoll, scmmap, nostrategy, "sc", NULL, -1 };
|
||||
ttpoll, scmmap, nostrategy, "sc",
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
/*
|
||||
* These functions need to be before calls to them so they can be inlined.
|
||||
@ -833,16 +836,16 @@ scattach(struct isa_device *dev)
|
||||
|
||||
at_shutdown(scshutdown, NULL, SHUTDOWN_PRE_SYNC);
|
||||
|
||||
cdevsw_add(&cdev, &scdevsw, NULL);
|
||||
cdevsw_add(&cdev, &sc_cdevsw, NULL);
|
||||
|
||||
#ifdef DEVFS
|
||||
for (vc = 0; vc < MAXCONS; vc++)
|
||||
sc_devfs_token[vc] = devfs_add_devswf(&scdevsw, vc, DV_CHR,
|
||||
sc_devfs_token[vc] = devfs_add_devswf(&sc_cdevsw, vc, DV_CHR,
|
||||
UID_ROOT, GID_WHEEL, 0600, "ttyv%r", vc);
|
||||
sc_vga_devfs_token = devfs_link(sc_devfs_token[0], "vga");
|
||||
sc_mouse_devfs_token = devfs_add_devswf(&scdevsw, SC_MOUSE, DV_CHR,
|
||||
sc_mouse_devfs_token = devfs_add_devswf(&sc_cdevsw, SC_MOUSE, DV_CHR,
|
||||
UID_ROOT, GID_WHEEL, 0600, "sysmouse");
|
||||
sc_console_devfs_token = devfs_add_devswf(&scdevsw, SC_CONSOLE, DV_CHR,
|
||||
sc_console_devfs_token = devfs_add_devswf(&sc_cdevsw, SC_CONSOLE, DV_CHR,
|
||||
UID_ROOT, GID_WHEEL, 0600, "consolectl");
|
||||
#endif
|
||||
return 0;
|
||||
@ -886,7 +889,6 @@ scopen(dev_t dev, int flag, int mode, struct proc *p)
|
||||
tp->t_lflag = TTYDEF_LFLAG;
|
||||
tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
|
||||
scparam(tp, &tp->t_termios);
|
||||
ttsetwater(tp);
|
||||
(*linesw[tp->t_line].l_modem)(tp, 1);
|
||||
if (minor(dev) == SC_MOUSE)
|
||||
mouse_level = 0; /* XXX */
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
|
||||
* $Id: sio.c,v 1.211 1998/08/19 04:17:37 bde Exp $
|
||||
* $Id: sio.c,v 1.212 1998/08/20 05:12:48 bde Exp $
|
||||
*/
|
||||
|
||||
#include "opt_comconsole.h"
|
||||
@ -343,12 +343,13 @@ static d_ioctl_t sioioctl;
|
||||
static d_stop_t siostop;
|
||||
static d_devtotty_t siodevtotty;
|
||||
|
||||
#define CDEV_MAJOR 28
|
||||
static struct cdevsw sio_cdevsw = {
|
||||
#define CDEV_MAJOR 28
|
||||
static struct cdevsw sio_cdevsw = {
|
||||
sioopen, sioclose, sioread, siowrite,
|
||||
sioioctl, siostop, noreset, siodevtotty,
|
||||
ttpoll, nommap, NULL, driver_name,
|
||||
NULL, -1,
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
static int comconsole = -1;
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)cons.c 7.2 (Berkeley) 5/9/91
|
||||
* $Id: cons.c,v 1.57 1998/03/28 10:32:56 bde Exp $
|
||||
* $Id: cons.c,v 1.58 1998/06/07 17:09:58 dfr Exp $
|
||||
*/
|
||||
|
||||
#include "opt_devfs.h"
|
||||
@ -81,11 +81,14 @@ static d_write_t cnwrite;
|
||||
static d_ioctl_t cnioctl;
|
||||
static d_poll_t cnpoll;
|
||||
|
||||
#define CDEV_MAJOR 0
|
||||
static struct cdevsw cn_cdevsw =
|
||||
{ cnopen, cnclose, cnread, cnwrite, /*0*/
|
||||
cnioctl, nullstop, nullreset, nodevtotty,/* console */
|
||||
cnpoll, nommap, NULL, "console", NULL, -1 };
|
||||
#define CDEV_MAJOR 0
|
||||
static struct cdevsw cn_cdevsw = {
|
||||
cnopen, cnclose, cnread, cnwrite,
|
||||
cnioctl, nullstop, nullreset, nodevtotty,
|
||||
cnpoll, nommap, NULL, "console",
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
static dev_t cn_dev_t; /* seems to be never really used */
|
||||
SYSCTL_OPAQUE(_machdep, CPU_CONSDEV, consdev, CTLTYPE_OPAQUE|CTLFLAG_RD,
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)tty_pty.c 8.4 (Berkeley) 2/20/95
|
||||
* $Id: tty_pty.c,v 1.52 1998/06/07 17:11:43 dfr Exp $
|
||||
* $Id: tty_pty.c,v 1.53 1998/07/15 12:18:30 bde Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -79,18 +79,23 @@ static d_read_t ptcread;
|
||||
static d_write_t ptcwrite;
|
||||
static d_poll_t ptcpoll;
|
||||
|
||||
#define CDEV_MAJOR_S 5
|
||||
#define CDEV_MAJOR_C 6
|
||||
static struct cdevsw pts_cdevsw =
|
||||
{ ptsopen, ptsclose, ptsread, ptswrite, /*5*/
|
||||
ptyioctl, ptsstop, nullreset, ptydevtotty,/* ttyp */
|
||||
ttpoll, nommap, NULL, "pts", NULL, -1 };
|
||||
|
||||
static struct cdevsw ptc_cdevsw =
|
||||
{ ptcopen, ptcclose, ptcread, ptcwrite, /*6*/
|
||||
ptyioctl, nullstop, nullreset, ptydevtotty,/* ptyp */
|
||||
ptcpoll, nommap, NULL, "ptc", NULL, -1 };
|
||||
#define CDEV_MAJOR_S 5
|
||||
static struct cdevsw pts_cdevsw = {
|
||||
ptsopen, ptsclose, ptsread, ptswrite,
|
||||
ptyioctl, ptsstop, nullreset, ptydevtotty,
|
||||
ttpoll, nommap, NULL, "pts",
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
#define CDEV_MAJOR_C 6
|
||||
static struct cdevsw ptc_cdevsw = {
|
||||
ptcopen, ptcclose, ptcread, ptcwrite,
|
||||
ptyioctl, nullstop, nullreset, ptydevtotty,
|
||||
ptcpoll, nommap, NULL, "ptc",
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
#if NPTY == 1
|
||||
#undef NPTY
|
||||
@ -178,7 +183,6 @@ ptsopen(dev, flag, devtype, p)
|
||||
tp->t_lflag = TTYDEF_LFLAG;
|
||||
tp->t_cflag = TTYDEF_CFLAG;
|
||||
tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
|
||||
ttsetwater(tp); /* would be done in xxparam() */
|
||||
} else if (tp->t_state&TS_XCLUDE && p->p_ucred->cr_uid != 0)
|
||||
return (EBUSY);
|
||||
if (tp->t_oproc) /* Ctrlr still around. */
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)tty_tty.c 8.2 (Berkeley) 9/23/93
|
||||
* $Id: tty_tty.c,v 1.23 1998/02/20 13:46:56 bde Exp $
|
||||
* $Id: tty_tty.c,v 1.24 1998/06/07 17:11:44 dfr Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -58,13 +58,15 @@ static d_write_t cttywrite;
|
||||
static d_ioctl_t cttyioctl;
|
||||
static d_poll_t cttypoll;
|
||||
|
||||
#define CDEV_MAJOR 1
|
||||
/* Don't make static, fdesc_vnops uses this. */
|
||||
struct cdevsw ctty_cdevsw =
|
||||
{ cttyopen, nullclose, cttyread, cttywrite, /*1*/
|
||||
cttyioctl, nullstop, nullreset, nodevtotty,/* tty */
|
||||
cttypoll, nommap, NULL, "ctty", NULL, -1 };
|
||||
|
||||
#define CDEV_MAJOR 1
|
||||
/* Don't make this static, since fdesc_vnops uses it. */
|
||||
struct cdevsw ctty_cdevsw = {
|
||||
cttyopen, nullclose, cttyread, cttywrite,
|
||||
cttyioctl, nullstop, nullreset, nodevtotty,
|
||||
cttypoll, nommap, NULL, "ctty",
|
||||
NULL, -1, nodump, nopsize,
|
||||
D_TTY,
|
||||
};
|
||||
|
||||
#define cttyvp(p) ((p)->p_flag & P_CONTROLT ? (p)->p_session->s_ttyvp : NULL)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user