mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 05:58:57 +00:00
Make the remaining serial drivers call ttyioctl() rather than calling
the linedisc directly.
This commit is contained in:
parent
d1afdc6644
commit
e451f9b758
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=130057
@ -2117,6 +2117,15 @@ static int cx_ioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct threa
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (c->mode == M_ASYNC) {
|
if (c->mode == M_ASYNC) {
|
||||||
|
#if __FreeBSD_version >= 502113
|
||||||
|
error = ttyioctl (dev, cmd, data, flag, td);
|
||||||
|
disc_optim (&d->tty, &d->tty.t_termios);
|
||||||
|
if (error != ENOTTY) {
|
||||||
|
if (error)
|
||||||
|
CX_DEBUG2 (d, ("ttioctl: 0x%lx, error %d\n", cmd, error));
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
#else
|
||||||
#if __FreeBSD_version >= 500000
|
#if __FreeBSD_version >= 500000
|
||||||
error = (*linesw[d->tty.t_line].l_ioctl) (&d->tty, cmd, data, flag, td);
|
error = (*linesw[d->tty.t_line].l_ioctl) (&d->tty, cmd, data, flag, td);
|
||||||
#else
|
#else
|
||||||
@ -2135,6 +2144,7 @@ static int cx_ioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct threa
|
|||||||
CX_DEBUG2 (d, ("ttioctl: 0x%lx, error %d\n", cmd, error));
|
CX_DEBUG2 (d, ("ttioctl: 0x%lx, error %d\n", cmd, error));
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
@ -1611,16 +1611,11 @@ sioioctl(dev, cmd, data, flag, td)
|
|||||||
if (lt->c_ospeed != 0)
|
if (lt->c_ospeed != 0)
|
||||||
dt->c_ospeed = tp->t_ospeed;
|
dt->c_ospeed = tp->t_ospeed;
|
||||||
}
|
}
|
||||||
error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, td);
|
error = ttyioctl(dev, cmd, data, flag, td);
|
||||||
if (error != ENOIOCTL)
|
disc_optim(tp, &tp->t_termios, com);
|
||||||
|
if (error != ENOTTY)
|
||||||
return (error);
|
return (error);
|
||||||
s = spltty();
|
s = spltty();
|
||||||
error = ttioctl(tp, cmd, data, flag);
|
|
||||||
disc_optim(tp, &tp->t_termios, com);
|
|
||||||
if (error != ENOIOCTL) {
|
|
||||||
splx(s);
|
|
||||||
return (error);
|
|
||||||
}
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case TIOCSBRK:
|
case TIOCSBRK:
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -1275,22 +1275,13 @@ digiioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
|
|||||||
if (lt->c_ospeed != 0)
|
if (lt->c_ospeed != 0)
|
||||||
dt->c_ospeed = tp->t_ospeed;
|
dt->c_ospeed = tp->t_ospeed;
|
||||||
}
|
}
|
||||||
error = linesw[tp->t_line].l_ioctl(tp, cmd, data, flag, td);
|
error = ttyioctl(dev, cmd, data, flag, td);
|
||||||
if (error == 0 && cmd == TIOCGETA)
|
if (error == 0 && cmd == TIOCGETA)
|
||||||
((struct termios *)data)->c_iflag |= port->c_iflag;
|
((struct termios *)data)->c_iflag |= port->c_iflag;
|
||||||
|
digi_disc_optim(tp, &tp->t_termios, port);
|
||||||
if (error >= 0 && error != ENOIOCTL)
|
if (error >= 0 && error != ENOTTY)
|
||||||
return (error);
|
return (error);
|
||||||
s = spltty();
|
s = spltty();
|
||||||
error = ttioctl(tp, cmd, data, flag);
|
|
||||||
if (error == 0 && cmd == TIOCGETA)
|
|
||||||
((struct termios *)data)->c_iflag |= port->c_iflag;
|
|
||||||
|
|
||||||
digi_disc_optim(tp, &tp->t_termios, port);
|
|
||||||
if (error >= 0 && error != ENOIOCTL) {
|
|
||||||
splx(s);
|
|
||||||
return (error);
|
|
||||||
}
|
|
||||||
sc->setwin(sc, 0);
|
sc->setwin(sc, 0);
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case DIGIIO_RING:
|
case DIGIIO_RING:
|
||||||
|
@ -1207,12 +1207,9 @@ rcioctl(dev_t dev, u_long cmd, caddr_t data, int flag, d_thread_t *td)
|
|||||||
|
|
||||||
rc = DEV_TO_RC(dev);
|
rc = DEV_TO_RC(dev);
|
||||||
tp = &rc->rc_tp;
|
tp = &rc->rc_tp;
|
||||||
error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, td);
|
error = ttyioctl(dev, cmd, data, flag, td);
|
||||||
if (error != ENOIOCTL)
|
|
||||||
return (error);
|
|
||||||
error = ttioctl(tp, cmd, data, flag);
|
|
||||||
disc_optim(tp, &tp->t_termios, rc);
|
disc_optim(tp, &tp->t_termios, rc);
|
||||||
if (error != ENOIOCTL)
|
if (error != ENOTTY)
|
||||||
return (error);
|
return (error);
|
||||||
s = spltty();
|
s = spltty();
|
||||||
|
|
||||||
|
@ -1320,21 +1320,14 @@ rpioctl(dev, cmd, data, flag, td)
|
|||||||
|
|
||||||
t = &tp->t_termios;
|
t = &tp->t_termios;
|
||||||
|
|
||||||
error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, td);
|
error = ttyioctl(dev, cmd, data, flag, td);
|
||||||
if(error != ENOIOCTL) {
|
rp_disc_optim(tp, &tp->t_termios);
|
||||||
|
if(error != ENOTTY)
|
||||||
return(error);
|
return(error);
|
||||||
}
|
|
||||||
oldspl = spltty();
|
oldspl = spltty();
|
||||||
|
|
||||||
flags = rp->rp_channel.TxControl[3];
|
flags = rp->rp_channel.TxControl[3];
|
||||||
|
|
||||||
error = ttioctl(tp, cmd, data, flag);
|
|
||||||
flags = rp->rp_channel.TxControl[3];
|
|
||||||
rp_disc_optim(tp, &tp->t_termios);
|
|
||||||
if(error != ENOIOCTL) {
|
|
||||||
splx(oldspl);
|
|
||||||
return(error);
|
|
||||||
}
|
|
||||||
switch(cmd) {
|
switch(cmd) {
|
||||||
case TIOCSBRK:
|
case TIOCSBRK:
|
||||||
sSendBreak(&rp->rp_channel);
|
sSendBreak(&rp->rp_channel);
|
||||||
|
@ -731,12 +731,8 @@ sabttyioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td)
|
|||||||
sc = dev->si_drv1;
|
sc = dev->si_drv1;
|
||||||
tp = dev->si_tty;
|
tp = dev->si_tty;
|
||||||
|
|
||||||
error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flags, td);
|
error = ttyioctl(dev, cmd, data, flags, td);
|
||||||
if (error != ENOIOCTL)
|
if (error != ENOTTY)
|
||||||
return (error);
|
|
||||||
|
|
||||||
error = ttioctl(tp, cmd, data, flags);
|
|
||||||
if (error != ENOIOCTL)
|
|
||||||
return (error);
|
return (error);
|
||||||
|
|
||||||
error = 0;
|
error = 0;
|
||||||
|
@ -1016,19 +1016,13 @@ siioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
|
|||||||
si_write_enable(pp, 0);
|
si_write_enable(pp, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, td);
|
error = ttyioctl(dev, cmd, data, flag, td);
|
||||||
if (error != ENOIOCTL)
|
si_disc_optim(tp, &tp->t_termios, pp);
|
||||||
|
if (error != ENOTTY)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
oldspl = spltty();
|
oldspl = spltty();
|
||||||
|
|
||||||
error = ttioctl(tp, cmd, data, flag);
|
|
||||||
si_disc_optim(tp, &tp->t_termios, pp);
|
|
||||||
if (error != ENOIOCTL) {
|
|
||||||
splx(oldspl);
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
error = 0;
|
error = 0;
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case TIOCSBRK:
|
case TIOCSBRK:
|
||||||
|
@ -2048,16 +2048,11 @@ sioioctl(dev, cmd, data, flag, td)
|
|||||||
if (lt->c_ospeed != 0)
|
if (lt->c_ospeed != 0)
|
||||||
dt->c_ospeed = tp->t_ospeed;
|
dt->c_ospeed = tp->t_ospeed;
|
||||||
}
|
}
|
||||||
error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, td);
|
error = ttyioctl(dev, cmd, data, flag, td);
|
||||||
if (error != ENOIOCTL)
|
disc_optim(tp, &tp->t_termios, com);
|
||||||
|
if (error != ENOTTY)
|
||||||
return (error);
|
return (error);
|
||||||
s = spltty();
|
s = spltty();
|
||||||
error = ttioctl(tp, cmd, data, flag);
|
|
||||||
disc_optim(tp, &tp->t_termios, com);
|
|
||||||
if (error != ENOIOCTL) {
|
|
||||||
splx(s);
|
|
||||||
return (error);
|
|
||||||
}
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case TIOCSBRK:
|
case TIOCSBRK:
|
||||||
sio_setreg(com, com_cfcr, com->cfcr_image |= CFCR_SBREAK);
|
sio_setreg(com, com_cfcr, com->cfcr_image |= CFCR_SBREAK);
|
||||||
|
@ -804,18 +804,13 @@ sxioctl(
|
|||||||
sx_write_enable(pp, 0);
|
sx_write_enable(pp, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
|
error = ttyioctl(dev, cmd, data, flag, p);
|
||||||
if (error != ENOIOCTL)
|
sx_disc_optim(tp, &tp->t_termios, pp);
|
||||||
|
if (error != ENOTTY)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
oldspl = spltty();
|
oldspl = spltty();
|
||||||
|
|
||||||
error = ttioctl(tp, cmd, data, flag);
|
|
||||||
sx_disc_optim(tp, &tp->t_termios, pp);
|
|
||||||
if (error != ENOIOCTL) {
|
|
||||||
splx(oldspl);
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
sc = PP2SC(pp); /* Need this to do I/O to the card. */
|
sc = PP2SC(pp); /* Need this to do I/O to the card. */
|
||||||
error = 0;
|
error = 0;
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
@ -497,11 +497,8 @@ uart_tty_ioctl(dev_t dev, u_long cmd, caddr_t data, int flags,
|
|||||||
return (ENODEV);
|
return (ENODEV);
|
||||||
|
|
||||||
tp = dev->si_tty;
|
tp = dev->si_tty;
|
||||||
error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flags, td);
|
error = ttyioctl(dev, cmd, data, flags, td);
|
||||||
if (error != ENOIOCTL)
|
if (error != ENOTTY)
|
||||||
return (error);
|
|
||||||
error = ttioctl(tp, cmd, data, flags);
|
|
||||||
if (error != ENOIOCTL)
|
|
||||||
return (error);
|
return (error);
|
||||||
|
|
||||||
error = 0;
|
error = 0;
|
||||||
|
@ -971,18 +971,12 @@ ubser_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
|
|||||||
if (sc->sc_dying)
|
if (sc->sc_dying)
|
||||||
return (EIO);
|
return (EIO);
|
||||||
|
|
||||||
error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
|
error = ttyioctl(dev, cmd, data, flag, p);
|
||||||
if (error >= 0) {
|
if (error != ENOTTY) {
|
||||||
DPRINTF(("ubser_ioctl: l_ioctl: error = %d\n", error));
|
DPRINTF(("ubser_ioctl: l_ioctl: error = %d\n", error));
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
error = ttioctl(tp, cmd, data, flag);
|
|
||||||
if (error >= 0) {
|
|
||||||
DPRINTF(("ubser_ioctl: ttioctl: error = %d\n", error));
|
|
||||||
return (error);
|
|
||||||
}
|
|
||||||
|
|
||||||
error = 0;
|
error = 0;
|
||||||
|
|
||||||
s = spltty();
|
s = spltty();
|
||||||
|
@ -563,22 +563,15 @@ ucomioctl(dev_t dev, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
|
|||||||
data = (caddr_t)&term;
|
data = (caddr_t)&term;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
|
error = ttyioctl(dev, cmd, data, flag, p);
|
||||||
if (error != ENOIOCTL) {
|
disc_optim(tp, &tp->t_termios, sc);
|
||||||
|
if (error != ENOTTY) {
|
||||||
DPRINTF(("ucomioctl: l_ioctl: error = %d\n", error));
|
DPRINTF(("ucomioctl: l_ioctl: error = %d\n", error));
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
s = spltty();
|
s = spltty();
|
||||||
|
|
||||||
error = ttioctl(tp, cmd, data, flag);
|
|
||||||
disc_optim(tp, &tp->t_termios, sc);
|
|
||||||
if (error != ENOIOCTL) {
|
|
||||||
splx(s);
|
|
||||||
DPRINTF(("ucomioctl: ttioctl: error = %d\n", error));
|
|
||||||
return (error);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sc->sc_callback->ucom_ioctl != NULL) {
|
if (sc->sc_callback->ucom_ioctl != NULL) {
|
||||||
error = sc->sc_callback->ucom_ioctl(sc->sc_parent,
|
error = sc->sc_callback->ucom_ioctl(sc->sc_parent,
|
||||||
sc->sc_portno,
|
sc->sc_portno,
|
||||||
|
@ -528,12 +528,8 @@ zsttyioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td)
|
|||||||
sc = dev->si_drv1;
|
sc = dev->si_drv1;
|
||||||
tp = dev->si_tty;
|
tp = dev->si_tty;
|
||||||
|
|
||||||
error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flags, td);
|
error = ttyioctl(dev, cmd, data, flags, td);
|
||||||
if (error != ENOIOCTL)
|
if (error != ENOTTY)
|
||||||
return (error);
|
|
||||||
|
|
||||||
error = ttioctl(tp, cmd, data, flags);
|
|
||||||
if (error != ENOIOCTL)
|
|
||||||
return (error);
|
return (error);
|
||||||
|
|
||||||
error = 0;
|
error = 0;
|
||||||
|
@ -3021,16 +3021,11 @@ sioioctl(dev, cmd, data, flag, td)
|
|||||||
if (lt->c_ospeed != 0)
|
if (lt->c_ospeed != 0)
|
||||||
dt->c_ospeed = tp->t_ospeed;
|
dt->c_ospeed = tp->t_ospeed;
|
||||||
}
|
}
|
||||||
error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, td);
|
error = ttyioctl(dev, cmd, data, flag, td);
|
||||||
if (error != ENOIOCTL)
|
disc_optim(tp, &tp->t_termios, com);
|
||||||
|
if (error != ENOTTY)
|
||||||
return (error);
|
return (error);
|
||||||
s = spltty();
|
s = spltty();
|
||||||
error = ttioctl(tp, cmd, data, flag);
|
|
||||||
disc_optim(tp, &tp->t_termios, com);
|
|
||||||
if (error != ENOIOCTL) {
|
|
||||||
splx(s);
|
|
||||||
return (error);
|
|
||||||
}
|
|
||||||
#ifdef PC98
|
#ifdef PC98
|
||||||
if (IS_8251(com->pc98_if_type)) {
|
if (IS_8251(com->pc98_if_type)) {
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
@ -3021,16 +3021,11 @@ sioioctl(dev, cmd, data, flag, td)
|
|||||||
if (lt->c_ospeed != 0)
|
if (lt->c_ospeed != 0)
|
||||||
dt->c_ospeed = tp->t_ospeed;
|
dt->c_ospeed = tp->t_ospeed;
|
||||||
}
|
}
|
||||||
error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, td);
|
error = ttyioctl(dev, cmd, data, flag, td);
|
||||||
if (error != ENOIOCTL)
|
disc_optim(tp, &tp->t_termios, com);
|
||||||
|
if (error != ENOTTY)
|
||||||
return (error);
|
return (error);
|
||||||
s = spltty();
|
s = spltty();
|
||||||
error = ttioctl(tp, cmd, data, flag);
|
|
||||||
disc_optim(tp, &tp->t_termios, com);
|
|
||||||
if (error != ENOIOCTL) {
|
|
||||||
splx(s);
|
|
||||||
return (error);
|
|
||||||
}
|
|
||||||
#ifdef PC98
|
#ifdef PC98
|
||||||
if (IS_8251(com->pc98_if_type)) {
|
if (IS_8251(com->pc98_if_type)) {
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
* scheme is: <major><two digit minor><0 if release branch, otherwise 1>xx
|
* scheme is: <major><two digit minor><0 if release branch, otherwise 1>xx
|
||||||
*/
|
*/
|
||||||
#undef __FreeBSD_version
|
#undef __FreeBSD_version
|
||||||
#define __FreeBSD_version 502112 /* Master, propagated to newvers */
|
#define __FreeBSD_version 502113 /* Master, propagated to newvers */
|
||||||
|
|
||||||
#ifndef LOCORE
|
#ifndef LOCORE
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
Loading…
Reference in New Issue
Block a user