Deleted Added
sdiff udiff text old ( 130585 ) new ( 130892 )
full compact
1/*
2 * Device driver for Specialix range (SI/XIO) of serial line multiplexors.
3 *
4 * Copyright (C) 1990, 1992, 1998 Specialix International,
5 * Copyright (C) 1993, Andy Rutter <andy@acronym.co.uk>
6 * Copyright (C) 2000, Peter Wemm <peter@netplex.com.au>
7 *
8 * Originally derived from: SunOS 4.x version

--- 19 unchanged lines hidden (view full) ---

28 * THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY EXPRESS OR IMPLIED
29 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
31 * NO EVENT SHALL THE AUTHORS BE LIABLE.
32 *
33 */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sys/dev/si/si.c 130585 2004-06-16 09:47:26Z phk $");
37
38#ifndef lint
39static const char si_copyright1[] = "@(#) Copyright (C) Specialix International, 1990,1992,1998",
40 si_copyright2[] = "@(#) Copyright (C) Andy Rutter 1993",
41 si_copyright3[] = "@(#) Copyright (C) Peter Wemm 2000";
42#endif /* not lint */
43
44#include "opt_compat.h"
45#include "opt_debug_si.h"
46#include "opt_tty.h"
47
48#include <sys/param.h>
49#include <sys/systm.h>
50#if defined(COMPAT_43)
51#include <sys/ioctl_compat.h>
52#endif
53#include <sys/tty.h>
54#include <sys/conf.h>
55#include <sys/fcntl.h>
56#include <sys/kernel.h>
57#include <sys/malloc.h>
58#include <sys/sysctl.h>
59#include <sys/bus.h>
60#include <machine/bus.h>

--- 849 unchanged lines hidden (view full) ---

910siioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
911{
912 struct si_port *pp;
913 struct tty *tp;
914 int error;
915 int mynor = minor(dev);
916 int oldspl;
917 int blocked = 0;
918#if defined(COMPAT_43)
919 u_long oldcmd;
920 struct termios term;
921#endif
922
923 if (IS_SI_IOCTL(cmd))
924 return(si_Sioctl(dev, cmd, data, flag, td));
925
926 pp = MINOR2PP(mynor);
927 tp = pp->sp_tty;
928
929 DPRINT((pp, DBG_ENTRY|DBG_IOCTL, "siioctl(%s,%lx,%x,%x)\n",

--- 29 unchanged lines hidden (view full) ---

959 return (0);
960 default:
961 return (ENOTTY);
962 }
963 }
964 /*
965 * Do the old-style ioctl compat routines...
966 */
967#if defined(COMPAT_43)
968 term = tp->t_termios;
969 oldcmd = cmd;
970 error = ttsetcompat(tp, &cmd, data, &term);
971 if (error != 0)
972 return (error);
973 if (cmd != oldcmd)
974 data = (caddr_t)&term;
975#endif
976 /*
977 * Do the initial / lock state business
978 */
979 if (cmd == TIOCSETA || cmd == TIOCSETAW || cmd == TIOCSETAF) {
980 int cc;
981 struct termios *dt = (struct termios *)data;
982 struct termios *lt = mynor & SI_CALLOUT_MASK
983 ? &pp->sp_lout : &pp->sp_lin;

--- 19 unchanged lines hidden (view full) ---

1003 * Block user-level writes to give the ttywait()
1004 * a chance to completely drain for commands
1005 * that require the port to be in a quiescent state.
1006 */
1007 switch (cmd) {
1008 case TIOCSETAW:
1009 case TIOCSETAF:
1010 case TIOCDRAIN:
1011#ifdef COMPAT_43
1012 case TIOCSETP:
1013#endif
1014 blocked++; /* block writes for ttywait() and siparam() */
1015 si_write_enable(pp, 0);
1016 }
1017
1018 error = ttyioctl(dev, cmd, data, flag, td);
1019 pp->sp_hotchar = ttyldoptim(tp);
1020 if (error != ENOTTY)
1021 goto out;

--- 1124 unchanged lines hidden ---