Subject: patch to fix TIOCSBRK and TIOCCBRK ..
To: None <port-sparc@sun-lamp.cs.berkeley.edu>
From: matthew green <mrgreen@mame.mu.OZ.AU>
List: port-sparc
Date: 05/13/1994 22:14:17
i finally felt brave enough to try and work out what
the hell needed to be done for this, and so i did.
included below is the patch to sys/arch/sparc/dev/zs.c
to add the TIOCSBRK and TIOCCBRK ioclt's ..
i may look in to implimenting the few remaining ioctls
that aren't handled ...
*** zs.c.orig Thu Mar 24 20:57:07 1994
--- zs.c Fri May 13 21:55:28 1994
***************
*** 961,967 ****
int unit = minor(dev);
struct zsinfo *zi = zscd.cd_devs[unit >> 1];
register struct tty *tp = zi->zi_cs[unit & 1].cs_ttyp;
! register int error;
error = linesw[tp->t_line].l_ioctl(tp, cmd, data, flag, p);
if (error >= 0)
--- 961,968 ----
int unit = minor(dev);
struct zsinfo *zi = zscd.cd_devs[unit >> 1];
register struct tty *tp = zi->zi_cs[unit & 1].cs_ttyp;
! register int error, s;
! register struct zs_chanstate *cs = &zi->zi_cs[unit & 1];
error = linesw[tp->t_line].l_ioctl(tp, cmd, data, flag, p);
if (error >= 0)
***************
*** 973,981 ****
switch (cmd) {
case TIOCSBRK:
! /* FINISH ME ... need implicit TIOCCBRK in zsclose as well */
case TIOCCBRK:
case TIOCSDTR:
--- 974,997 ----
switch (cmd) {
case TIOCSBRK:
! {
! s = splzs();
! cs->cs_preg[5] |= ZSWR5_BREAK;
! cs->cs_creg[5] |= ZSWR5_BREAK;
! ZS_WRITE(cs->cs_zc, 5, cs->cs_creg[5]);
! splx(s);
! break;
! }
case TIOCCBRK:
+ {
+ s = splzs();
+ cs->cs_preg[5] &= ~ZSWR5_BREAK;
+ cs->cs_creg[5] &= ~ZSWR5_BREAK;
+ ZS_WRITE(cs->cs_zc, 5, cs->cs_creg[5]);
+ splx(s);
+ break;
+ }
case TIOCSDTR:
------------------------------------------------------------------------------