sys/sparc/dev/zs.c
/*
 * Close a zs serial port.
 */
Close a zs serial port.
Close a zs serial port .
int
zsclose(dev_t dev, int flags, int mode, struct proc *p)
{
	register struct zs_chanstate *cs;
	register struct tty *tp;
	struct zsinfo *zi;
	int unit = minor(dev), s;
	zi = zscd.cd_devs[unit >> 1];
	cs = &zi->zi_cs[unit & 1];
	tp = cs->cs_ttyp;
	linesw[tp->t_line].l_close(tp, flags);
	if (tp->t_cflag & HUPCL || tp->t_state & TS_WOPEN ||
	    (tp->t_state & TS_ISOPEN) == 0) {
		zs_modem(cs, 0);
		(void) tsleep((caddr_t)cs, TTIPRI, ttclos, hz);
	}
	ttyclose(tp);
#ifdef KGDB
	if (cs->cs_kgdb) {
		tp->t_ispeed = tp->t_ospeed = kgdb_rate;
		(void) zsparam(tp, &tp->t_termios);
	}
#endif
	return (0);
}
int zsclose ( dev_t dev , int flags , int mode , struct proc * p ) { register struct zs_chanstate * cs ; register struct tty * tp ; struct zsinfo * zi ; int unit = minor ( dev ) , s ; zi = zscd . cd_devs [ unit >> 1 ] ; cs = & zi -> zi_cs [ unit & 1 ] ; tp = cs -> cs_ttyp ; linesw [ tp -> t_line ] . l_close ( tp , flags ) ; if ( tp -> t_cflag & HUPCL || tp -> t_state & TS_WOPEN || ( tp -> t_state & TS_ISOPEN ) == 0 ) { zs_modem ( cs , 0 ) ; ( void ) tsleep ( ( caddr_t ) cs , TTIPRI , ttclos , hz ) ; } ttyclose ( tp ) ; #ifdef KGDB if ( cs -> cs_kgdb ) { tp -> t_ispeed = tp -> t_ospeed = kgdb_rate ; ( void ) zsparam ( tp , & tp -> t_termios ) ; } #endif return ( 0 ) ; }
Close a zs serial port.
Close a zs serial port .
/* hold low for 1 second */ /* Reset the speed if we're doing kgdb on this port */