summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/isa/cx.c23
-rw-r--r--sys/i386/isa/cy.c36
-rw-r--r--sys/i386/isa/istallion.c30
-rw-r--r--sys/i386/isa/pcvt/pcvt_drv.c18
-rw-r--r--sys/i386/isa/rc.c32
-rw-r--r--sys/i386/isa/rp.c39
-rw-r--r--sys/i386/isa/si.c32
-rw-r--r--sys/i386/isa/stallion.c30
-rw-r--r--sys/i386/linux/linux_file.c9
9 files changed, 73 insertions, 176 deletions
diff --git a/sys/i386/isa/cx.c b/sys/i386/isa/cx.c
index da7f2e8..0f5f408 100644
--- a/sys/i386/isa/cx.c
+++ b/sys/i386/isa/cx.c
@@ -14,6 +14,9 @@
* all derivative works or modified versions.
*
* Version 1.9, Wed Oct 4 18:58:15 MSK 1995
+ *
+ * $FreeBSD$
+ *
*/
#undef DEBUG
@@ -85,8 +88,6 @@ static d_close_t cxclose;
static d_read_t cxread;
static d_write_t cxwrite;
static d_ioctl_t cxioctl;
-static d_stop_t cxstop;
-static d_devtotty_t cxdevtotty;
#define CDEV_MAJOR 42
/* Don't make this static, since if_cx.c uses it. */
@@ -96,10 +97,10 @@ struct cdevsw cx_cdevsw = {
/* read */ cxread,
/* write */ cxwrite,
/* ioctl */ cxioctl,
- /* stop */ cxstop,
+ /* stop */ nostop,
/* reset */ noreset,
- /* devtotty */ cxdevtotty,
- /* poll */ ttpoll,
+ /* devtotty */ nodevtotty,
+ /* poll */ ttypoll,
/* mmap */ nommap,
/* strategy */ nostrategy,
/* name */ "cx",
@@ -116,6 +117,7 @@ struct tty *cx_tty [NCX*NCHAN]; /* tty data */
#endif
static void cxoproc (struct tty *tp);
+static void cxstop (struct tty *tp, int flag);
static int cxparam (struct tty *tp, struct termios *t);
int cxopen (dev_t dev, int flag, int mode, struct proc *p)
@@ -149,8 +151,10 @@ int cxopen (dev_t dev, int flag, int mode, struct proc *p)
c->ttyp = cx_tty[unit];
#endif
c->ttyp->t_oproc = cxoproc;
+ c->ttyp->t_stop = cxstop;
c->ttyp->t_param = cxparam;
}
+ dev->si_tty = c->ttyp;
#ifdef __bsdi__
if (! c->ttydev) {
MALLOC (c->ttydev, struct ttydevice_tmp*,
@@ -743,15 +747,6 @@ cxparam (struct tty *tp, struct termios *t)
return (0);
}
-struct tty *cxdevtotty (dev_t dev)
-{
- int unit = UNIT(dev);
-
- if (unit == UNIT_CTL || unit >= NCX*NCHAN)
- return (0);
- return (cxchan[unit]->ttyp);
-}
-
/*
* Stop output on a line
*/
diff --git a/sys/i386/isa/cy.c b/sys/i386/isa/cy.c
index 4181c44..8f2109c 100644
--- a/sys/i386/isa/cy.c
+++ b/sys/i386/isa/cy.c
@@ -123,7 +123,6 @@
#define p_com_addr p_cy_addr
#define sioattach cyattach
#define sioclose cyclose
-#define siodevtotty cydevtotty
#define siodriver cydriver
#define siodtrwakeup cydtrwakeup
#define sioinput cyinput
@@ -136,7 +135,7 @@
#define sioread cyread
#define siosettimeout cysettimeout
#define siosetwater cysetwater
-#define siostop cystop
+#define comstop cystop
#define siowrite cywrite
#define sio_registered cy_registered
#define sio_timeout cy_timeout
@@ -179,7 +178,7 @@
*
* The following com and tty flags correspond closely:
* CS_BUSY = TS_BUSY (maintained by comstart(), siopoll() and
- * siostop())
+ * comstop())
* CS_TTGO = ~TS_TTSTOP (maintained by comparam() and comstart())
* CS_CTS_OFLOW = CCTS_OFLOW (maintained by comparam())
* CS_RTS_IFLOW = CRTS_IFLOW (maintained by comparam())
@@ -347,6 +346,7 @@ static int siosetwater __P((struct com_s *com, speed_t speed));
static int comspeed __P((speed_t speed, u_long cy_clock,
int *prescaler_io));
static void comstart __P((struct tty *tp));
+static void comstop __P((struct tty *tp, int rw));
static timeout_t comwakeup;
static void disc_optim __P((struct tty *tp, struct termios *t,
struct com_s *com));
@@ -370,8 +370,6 @@ static d_close_t sioclose;
static d_read_t sioread;
static d_write_t siowrite;
static d_ioctl_t sioioctl;
-static d_stop_t siostop;
-static d_devtotty_t siodevtotty;
#define CDEV_MAJOR 48
static struct cdevsw sio_cdevsw = {
@@ -380,10 +378,10 @@ static struct cdevsw sio_cdevsw = {
/* read */ sioread,
/* write */ siowrite,
/* ioctl */ sioioctl,
- /* stop */ siostop,
+ /* stop */ nostop,
/* reset */ noreset,
- /* devtotty */ siodevtotty,
- /* poll */ ttpoll,
+ /* devtotty */ nodevtotty,
+ /* poll */ ttypoll,
/* mmap */ nommap,
/* strategy */ nostrategy,
/* name */ driver_name,
@@ -674,6 +672,7 @@ sioopen(dev, flag, mode, p)
#else
tp = com->tp = &sio_tty[unit];
#endif
+ dev->si_tty = tp;
s = spltty();
/*
* We jump to this label after all non-interrupted sleeps to pick
@@ -721,6 +720,7 @@ open_top:
* callout, and to complete a callin open after DCD rises.
*/
tp->t_oproc = comstart;
+ tp->t_stop = comstop;
tp->t_param = comparam;
tp->t_dev = dev;
tp->t_termios = mynor & CALLOUT_MASK
@@ -853,7 +853,7 @@ sioclose(dev, flag, mode, p)
cd_etc(com, CD1400_ETC_STOPBREAK);
(*linesw[tp->t_line].l_close)(tp, flag);
disc_optim(tp, &tp->t_termios, com);
- siostop(tp, FREAD | FWRITE);
+ comstop(tp, FREAD | FWRITE);
comhardclose(com);
ttyclose(tp);
siosettimeout();
@@ -2414,7 +2414,7 @@ comstart(tp)
}
static void
-siostop(tp, rw)
+comstop(tp, rw)
struct tty *tp;
int rw;
{
@@ -2454,22 +2454,6 @@ siostop(tp, rw)
comstart(tp);
}
-static struct tty *
-siodevtotty(dev)
- dev_t dev;
-{
- int mynor;
- int unit;
-
- mynor = minor(dev);
- if (mynor & CONTROL_MASK)
- return (NULL);
- unit = MINOR_TO_UNIT(mynor);
- if ((u_int) unit >= NSIO)
- return (NULL);
- return (&sio_tty[unit]);
-}
-
static int
commctl(com, bits, how)
struct com_s *com;
diff --git a/sys/i386/isa/istallion.c b/sys/i386/isa/istallion.c
index 597f927..9ca2275 100644
--- a/sys/i386/isa/istallion.c
+++ b/sys/i386/isa/istallion.c
@@ -528,13 +528,6 @@ STATIC d_close_t stliclose;
STATIC d_read_t stliread;
STATIC d_write_t stliwrite;
STATIC d_ioctl_t stliioctl;
-STATIC d_stop_t stlistop;
-
-#if VFREEBSD >= 220
-STATIC d_devtotty_t stlidevtotty;
-#else
-struct tty *stlidevtotty(dev_t dev);
-#endif
/*
* Internal function prototypes.
@@ -559,6 +552,7 @@ static long stli_mktiocm(unsigned long sigvalue);
static void stli_rxprocess(stlibrd_t *brdp, stliport_t *portp);
static void stli_flush(stliport_t *portp, int flag);
static void stli_start(struct tty *tp);
+static void stli_stop(struct tty *tp, int rw);
static int stli_param(struct tty *tp, struct termios *tiosp);
static void stli_ttyoptim(stliport_t *portp, struct termios *tiosp);
static void stli_dtrwakeup(void *arg);
@@ -646,10 +640,10 @@ static struct cdevsw stli_cdevsw = {
/* read */ stliread,
/* write */ stliwrite,
/* ioctl */ stliioctl,
- /* stop */ stlistop,
+ /* stop */ nostop,
/* reset */ noreset,
- /* devtotty */ stlidevtotty,
- /* poll */ ttpoll,
+ /* devtotty */ nodevtotty,
+ /* poll */ ttypoll,
/* mmap */ nommap,
/* strategy */ nostrategy,
/* name */ stli_drvname,
@@ -951,6 +945,7 @@ STATIC int stliopen(dev_t dev, int flag, int mode, struct proc *p)
if (portp == (stliport_t *) NULL)
return(ENXIO);
tp = &portp->tty;
+ dev->si_tty = tp;
callout = minor(dev) & STL_CALLOUTDEV;
error = 0;
@@ -986,6 +981,7 @@ stliopen_restart:
if ((tp->t_state & TS_ISOPEN) == 0) {
tp->t_oproc = stli_start;
tp->t_param = stli_param;
+ tp->t_stop = stli_stop;
tp->t_dev = dev;
tp->t_termios = callout ? portp->initouttios :
portp->initintios;
@@ -1109,10 +1105,10 @@ STATIC int stliread(dev_t dev, struct uio *uiop, int flag)
#if VFREEBSD >= 220
-STATIC void stlistop(struct tty *tp, int rw)
+STATIC void stli_stop(struct tty *tp, int rw)
{
#if DEBUG
- printf("stlistop(tp=%x,rw=%x)\n", (int) tp, rw);
+ printf("stli_stop(tp=%x,rw=%x)\n", (int) tp, rw);
#endif
stli_flush((stliport_t *) tp, rw);
@@ -1134,16 +1130,6 @@ STATIC int stlistop(struct tty *tp, int rw)
/*****************************************************************************/
-STATIC struct tty *stlidevtotty(dev_t dev)
-{
-#if DEBUG
- printf("stlidevtotty(dev=%s)\n", devtoname(dev));
-#endif
- return((struct tty *) stli_dev2port(dev));
-}
-
-/*****************************************************************************/
-
STATIC int stliwrite(dev_t dev, struct uio *uiop, int flag)
{
stliport_t *portp;
diff --git a/sys/i386/isa/pcvt/pcvt_drv.c b/sys/i386/isa/pcvt/pcvt_drv.c
index 4f0bfd6..8e5c26d 100644
--- a/sys/i386/isa/pcvt/pcvt_drv.c
+++ b/sys/i386/isa/pcvt/pcvt_drv.c
@@ -43,6 +43,8 @@
*
* @(#)pcvt_drv.c, 3.20, Last Edit-Date: [Mon Apr 19 17:10:09 1999]
*
+ * $FreeBSD$
+ *
*/
/*---------------------------------------------------------------------------*
@@ -121,7 +123,6 @@ static d_close_t pcclose;
static d_read_t pcread;
static d_write_t pcwrite;
static d_ioctl_t pcioctl;
-static d_devtotty_t pcdevtotty;
static d_mmap_t pcmmap;
#define CDEV_MAJOR 12
@@ -133,8 +134,8 @@ static struct cdevsw pc_cdevsw = {
/* ioctl */ pcioctl,
/* stop */ nostop,
/* reset */ noreset,
- /* devtotty */ pcdevtotty,
- /* poll */ ttpoll,
+ /* devtotty */ nodevtotty,
+ /* poll */ ttypoll,
/* mmap */ pcmmap,
/* strategy */ nostrategy,
/* name */ "vt",
@@ -147,15 +148,6 @@ static struct cdevsw pc_cdevsw = {
/* bmaj */ -1
};
-#if PCVT_FREEBSD > 205
-struct tty *
-pcdevtotty(Dev_t dev)
-{
- return get_pccons(dev);
-}
-
-#endif /* PCVT_FREEBSD > 205 */
-
#if PCVT_NETBSD > 100 /* NetBSD-current Feb 20 1995 */
int
pcprobe(struct device *parent, void *match, void *aux)
@@ -470,6 +462,8 @@ pcopen(Dev_t dev, int flag, int mode, struct proc *p)
if((tp = get_pccons(dev)) == NULL)
return ENXIO;
+ dev->si_tty = tp;
+
#if PCVT_EMU_MOUSE
if(i == totalscreens)
{
diff --git a/sys/i386/isa/rc.c b/sys/i386/isa/rc.c
index 78dd5f5..238a052 100644
--- a/sys/i386/isa/rc.c
+++ b/sys/i386/isa/rc.c
@@ -23,6 +23,9 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
*/
/*
@@ -87,8 +90,6 @@ static d_close_t rcclose;
static d_read_t rcread;
static d_write_t rcwrite;
static d_ioctl_t rcioctl;
-static d_stop_t rcstop;
-static d_devtotty_t rcdevtotty;
#define CDEV_MAJOR 63
static struct cdevsw rc_cdevsw = {
@@ -97,10 +98,10 @@ static struct cdevsw rc_cdevsw = {
/* read */ rcread,
/* write */ rcwrite,
/* ioctl */ rcioctl,
- /* stop */ rcstop,
+ /* stop */ nostop,
/* reset */ noreset,
- /* devtotty */ rcdevtotty,
- /* poll */ ttpoll,
+ /* devtotty */ nodevtotty,
+ /* poll */ ttypoll,
/* mmap */ nommap,
/* strategy */ nostrategy,
/* name */ "rc",
@@ -182,6 +183,7 @@ static void rc_discard_output __P((struct rc_chans *));
static void rc_hardclose __P((struct rc_chans *));
static int rc_modctl __P((struct rc_chans *, int, int));
static void rc_start __P((struct tty *));
+static void rc_stop __P((struct tty *, int rw));
static int rc_param __P((struct tty *, struct termios *));
static swihand_t rcpoll;
static void rc_reinit __P((struct rc_softc *));
@@ -682,7 +684,7 @@ done1: ;
}
static void
-rcstop(tp, rw)
+rc_stop(tp, rw)
register struct tty *tp;
int rw;
{
@@ -690,7 +692,7 @@ rcstop(tp, rw)
u_char *tptr, *eptr;
#ifdef RCDEBUG
- printf("rc%d/%d: rcstop %s%s\n", rc->rc_rcb->rcb_unit, rc->rc_chan,
+ printf("rc%d/%d: rc_stop %s%s\n", rc->rc_rcb->rcb_unit, rc->rc_chan,
(rw & FWRITE)?"FWRITE ":"", (rw & FREAD)?"FREAD":"");
#endif
if (rw & FWRITE)
@@ -732,6 +734,7 @@ rcopen(dev, flag, mode, p)
return ENXIO;
rc = &rc_chans[unit];
tp = rc->rc_tp;
+ dev->si_tty = tp;
nec = rc->rc_rcb->rcb_addr;
#ifdef RCDEBUG
printf("rc%d/%d: rcopen: dev %x\n", rc->rc_rcb->rcb_unit, unit, dev);
@@ -771,6 +774,7 @@ again:
} else {
tp->t_oproc = rc_start;
tp->t_param = rc_param;
+ tp->t_stop = rc_stop;
tp->t_dev = dev;
if (CALLOUT(dev))
@@ -828,7 +832,7 @@ rcclose(dev, flag, mode, p)
s = spltty();
(*linesw[tp->t_line].l_close)(tp, flag);
disc_optim(tp, &tp->t_termios, rc);
- rcstop(tp, FREAD | FWRITE);
+ rc_stop(tp, FREAD | FWRITE);
rc_hardclose(rc);
ttyclose(tp);
splx(s);
@@ -1407,18 +1411,6 @@ char *comment;
}
#endif /* RCDEBUG */
-static struct tty *
-rcdevtotty(dev)
- dev_t dev;
-{
- int unit;
-
- unit = GET_UNIT(dev);
- if (unit >= NRC * CD180_NCHAN)
- return NULL;
- return (&rc_tty[unit]);
-}
-
static void
rc_dtrwakeup(chan)
void *chan;
diff --git a/sys/i386/isa/rp.c b/sys/i386/isa/rp.c
index a3a4db2..d788b57 100644
--- a/sys/i386/isa/rp.c
+++ b/sys/i386/isa/rp.c
@@ -797,8 +797,6 @@ static d_close_t rpclose;
static d_read_t rpread;
static d_write_t rpwrite;
static d_ioctl_t rpioctl;
-static d_stop_t rpstop;
-static d_devtotty_t rpdevtotty;
#define CDEV_MAJOR 81
static struct cdevsw rp_cdevsw = {
@@ -807,10 +805,10 @@ static struct cdevsw rp_cdevsw = {
/* read */ rpread,
/* write */ rpwrite,
/* ioctl */ rpioctl,
- /* stop */ rpstop,
+ /* stop */ nostop,
/* reset */ noreset,
- /* devtotty */ rpdevtotty,
- /* poll */ ttpoll,
+ /* devtotty */ nodevtotty,
+ /* poll */ ttypoll,
/* mmap */ nommap,
/* strategy */ nostrategy,
/* name */ driver_name,
@@ -859,10 +857,9 @@ static struct rp_port *p_rp_table[MAX_RP_PORTS];
* The top-level routines begin here
*/
-int rpselect __P((dev_t, int, struct proc *));
-
static int rpparam __P((struct tty *, struct termios *));
static void rpstart __P((struct tty *));
+static void rpstop __P((struct tty *, int));
static void rphardclose __P((struct rp_port *));
#define rpmap nomap
#define rpreset noreset
@@ -1310,6 +1307,7 @@ rpopen(dev, flag, mode, p)
/* rp->rp_tty = &rp_tty[rp->rp_port];
*/
tp = rp->rp_tty;
+ dev->si_tty = tp;
oldspl = spltty();
@@ -1349,6 +1347,7 @@ open_top:
tp->t_dev = dev;
tp->t_param = rpparam;
tp->t_oproc = rpstart;
+ tp->t_stop = rpstop;
tp->t_line = 0;
tp->t_termios = IS_CALLOUT(dev) ? rp->it_out : rp->it_in;
flags = 0;
@@ -2017,29 +2016,3 @@ rpstop(tp, flag)
splx(spl);
rpstart(tp);
}
-
-int
-rpselect(dev, flag, p)
- dev_t dev;
- int flag;
- struct proc *p;
-{
- return(0);
-}
-
-struct tty *
-rpdevtotty(dev_t dev)
-{
- struct rp_port *rp;
- int unit, port, mynor, umynor; /* SG */
-
- umynor = (((minor(dev) >> 16) -1) * 32); /* SG */
- port = (minor(dev) & 0x1f); /* SG */
- mynor = (port + umynor); /* SG */
- unit = minor_to_unit[mynor]; /* SG */
-
- if(IS_CONTROL(dev))
- return(NULL);
- rp = rp_addr(unit) + port;
- return(rp->rp_tty);
-}
diff --git a/sys/i386/isa/si.c b/sys/i386/isa/si.c
index bc26654..a1cde6e 100644
--- a/sys/i386/isa/si.c
+++ b/sys/i386/isa/si.c
@@ -113,6 +113,7 @@ static int si_modem __P((struct si_port *, enum si_mctl, int));
static void si_write_enable __P((struct si_port *, int));
static int si_Sioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
static void si_start __P((struct tty *));
+static void si_stop __P((struct tty *, int));
static timeout_t si_lstart;
static void si_disc_optim __P((struct tty *tp, struct termios *t,
struct si_port *pp));
@@ -171,8 +172,6 @@ static d_close_t siclose;
static d_read_t siread;
static d_write_t siwrite;
static d_ioctl_t siioctl;
-static d_stop_t sistop;
-static d_devtotty_t sidevtotty;
#define CDEV_MAJOR 68
static struct cdevsw si_cdevsw = {
@@ -181,10 +180,10 @@ static struct cdevsw si_cdevsw = {
/* read */ siread,
/* write */ siwrite,
/* ioctl */ siioctl,
- /* stop */ sistop,
+ /* stop */ nostop,
/* reset */ noreset,
- /* devtotty */ sidevtotty,
- /* poll */ ttpoll,
+ /* devtotty */ nodevtotty,
+ /* poll */ ttypoll,
/* mmap */ nommap,
/* strategy */ nostrategy,
/* name */ "si",
@@ -1162,6 +1161,7 @@ siopen(dev, flag, mode, p)
pp = sc->sc_ports + port;
tp = pp->sp_tty; /* the "real" tty */
+ dev->si_tty = tp;
ccbp = pp->sp_ccb; /* Find control block */
DPRINT((pp, DBG_ENTRY|DBG_OPEN, "siopen(%s,%x,%x,%x)\n",
devtoname(dev), flag, mode, p));
@@ -1213,6 +1213,7 @@ open_top:
*/
DPRINT((pp, DBG_OPEN, "first open\n"));
tp->t_oproc = si_start;
+ tp->t_stop = si_stop;
tp->t_param = siparam;
tp->t_dev = dev;
tp->t_termios = mynor & SI_CALLOUT_MASK
@@ -1327,7 +1328,7 @@ siclose(dev, flag, mode, p)
pp->sp_state &= ~SS_LSTART;
}
- sistop(tp, FREAD | FWRITE);
+ si_stop(tp, FREAD | FWRITE);
sihardclose(pp);
ttyclose(tp);
@@ -1458,21 +1459,6 @@ out:
}
-static struct tty *
-sidevtotty(dev_t dev)
-{
- struct si_port *pp;
- int mynor = minor(dev);
- struct si_softc *sc = &si_softc[SI_CARD(mynor)];
-
- if (IS_SPECIAL(mynor))
- return(NULL);
- if (SI_PORT(mynor) >= sc->sc_nport)
- return(NULL);
- pp = MINOR2PP(mynor);
- return (pp->sp_tty);
-}
-
static int
siioctl(dev, cmd, data, flag, p)
dev_t dev;
@@ -2582,7 +2568,7 @@ si_lstart(void *arg)
* Stop output on a line. called at spltty();
*/
void
-sistop(tp, rw)
+si_stop(tp, rw)
register struct tty *tp;
int rw;
{
@@ -2592,7 +2578,7 @@ sistop(tp, rw)
pp = TP2PP(tp);
ccbp = pp->sp_ccb;
- DPRINT((TP2PP(tp), DBG_ENTRY|DBG_STOP, "sistop(%x,%x)\n", tp, rw));
+ DPRINT((TP2PP(tp), DBG_ENTRY|DBG_STOP, "si_stop(%x,%x)\n", tp, rw));
/* XXX: must check (rw & FWRITE | FREAD) etc flushing... */
if (rw & FWRITE) {
diff --git a/sys/i386/isa/stallion.c b/sys/i386/isa/stallion.c
index 628eb19b..99cef03 100644
--- a/sys/i386/isa/stallion.c
+++ b/sys/i386/isa/stallion.c
@@ -441,13 +441,6 @@ STATIC d_close_t stlclose;
STATIC d_read_t stlread;
STATIC d_write_t stlwrite;
STATIC d_ioctl_t stlioctl;
-STATIC d_stop_t stlstop;
-
-#if VFREEBSD >= 220
-STATIC d_devtotty_t stldevtotty;
-#else
-struct tty *stldevtotty(dev_t dev);
-#endif
/*
* Internal function prototypes.
@@ -458,6 +451,7 @@ static int stl_rawopen(stlport_t *portp);
static int stl_rawclose(stlport_t *portp);
static int stl_param(struct tty *tp, struct termios *tiosp);
static void stl_start(struct tty *tp);
+static void stl_stop(struct tty *tp, int);
static void stl_ttyoptim(stlport_t *portp, struct termios *tiosp);
static void stl_dotimeout(void);
static void stl_poll(void *arg);
@@ -541,10 +535,10 @@ static struct cdevsw stl_cdevsw = {
/* read */ stlread,
/* write */ stlwrite,
/* ioctl */ stlioctl,
- /* stop */ stlstop,
+ /* stop */ nostop,
/* reset */ noreset,
- /* devtotty */ stldevtotty,
- /* poll */ ttpoll,
+ /* devtotty */ nodevtotty,
+ /* poll */ ttypoll,
/* mmap */ nommap,
/* strategy */ nostrategy,
/* name */ "stl",
@@ -783,6 +777,7 @@ STATIC int stlopen(dev_t dev, int flag, int mode, struct proc *p)
if (portp == (stlport_t *) NULL)
return(ENXIO);
tp = &portp->tty;
+ dev->si_tty = tp;
callout = minor(dev) & STL_CALLOUTDEV;
error = 0;
@@ -806,6 +801,7 @@ stlopen_restart:
*/
if ((tp->t_state & TS_ISOPEN) == 0) {
tp->t_oproc = stl_start;
+ tp->t_stop = stl_stop;
tp->t_param = stl_param;
tp->t_dev = dev;
tp->t_termios = callout ? portp->initouttios :
@@ -926,10 +922,10 @@ STATIC int stlread(dev_t dev, struct uio *uiop, int flag)
#if VFREEBSD >= 220
-STATIC void stlstop(struct tty *tp, int rw)
+STATIC void stl_stop(struct tty *tp, int rw)
{
#if DEBUG
- printf("stlstop(tp=%x,rw=%x)\n", (int) tp, rw);
+ printf("stl_stop(tp=%x,rw=%x)\n", (int) tp, rw);
#endif
stl_flush((stlport_t *) tp, rw);
@@ -951,16 +947,6 @@ STATIC int stlstop(struct tty *tp, int rw)
/*****************************************************************************/
-STATIC struct tty *stldevtotty(dev_t dev)
-{
-#if DEBUG
- printf("stldevtotty(dev=%s)\n", devtoname(dev));
-#endif
- return((struct tty *) stl_dev2port(dev));
-}
-
-/*****************************************************************************/
-
STATIC int stlwrite(dev_t dev, struct uio *uiop, int flag)
{
stlport_t *portp;
diff --git a/sys/i386/linux/linux_file.c b/sys/i386/linux/linux_file.c
index 6a33e68..11ea240 100644
--- a/sys/i386/linux/linux_file.c
+++ b/sys/i386/linux/linux_file.c
@@ -204,13 +204,12 @@ linux_fcntl(struct proc *p, struct linux_fcntl_args *args)
struct vnode *vp;
long pgid;
struct pgrp *pgrp;
- struct tty *tp, *(*d_tty) __P((dev_t));
+ struct tty *tp;
caddr_t sg;
dev_t dev;
sg = stackgap_init();
bsd_flock = (struct flock *)stackgap_alloc(&sg, sizeof(struct flock));
- d_tty = NULL;
#ifdef DEBUG
printf("Linux-emul(%d): fcntl(%d, %08x, *)\n",
@@ -309,8 +308,10 @@ linux_fcntl(struct proc *p, struct linux_fcntl_args *args)
dev = vn_todev(vp);
if (vp->v_type != VCHR || dev == NODEV)
return EINVAL;
- d_tty = devsw(dev)->d_devtotty;
- if (!d_tty || (!(tp = (*d_tty)(dev))))
+ if (!(devsw(dev)->d_flags & D_TTY))
+ return EINVAL;
+ tp = dev->si_tty;
+ if (!tp)
return EINVAL;
if (args->cmd == LINUX_F_GETOWN) {
p->p_retval[0] = tp->t_pgrp ? tp->t_pgrp->pg_id : NO_PID;
OpenPOWER on IntegriCloud