Deleted Added
full compact
si.c (130585) si.c (130892)
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>
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 $");
36__FBSDID("$FreeBSD: head/sys/dev/si/si.c 130892 2004-06-21 22:57:16Z 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>
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#ifndef BURN_BRIDGES
50#if defined(COMPAT_43)
51#include <sys/ioctl_compat.h>
52#endif
51#if defined(COMPAT_43)
52#include <sys/ioctl_compat.h>
53#endif
54#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;
55#include <sys/tty.h>
56#include <sys/conf.h>
57#include <sys/fcntl.h>
58#include <sys/kernel.h>
59#include <sys/malloc.h>
60#include <sys/sysctl.h>
61#include <sys/bus.h>
62#include <machine/bus.h>

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

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

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

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

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

1009 * Block user-level writes to give the ttywait()
1010 * a chance to completely drain for commands
1011 * that require the port to be in a quiescent state.
1012 */
1013 switch (cmd) {
1014 case TIOCSETAW:
1015 case TIOCSETAF:
1016 case TIOCDRAIN:
1017#ifndef BURN_BRIDGES
1011#ifdef COMPAT_43
1012 case TIOCSETP:
1013#endif
1018#ifdef COMPAT_43
1019 case TIOCSETP:
1020#endif
1021#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 ---
1022 blocked++; /* block writes for ttywait() and siparam() */
1023 si_write_enable(pp, 0);
1024 }
1025
1026 error = ttyioctl(dev, cmd, data, flag, td);
1027 pp->sp_hotchar = ttyldoptim(tp);
1028 if (error != ENOTTY)
1029 goto out;

--- 1124 unchanged lines hidden ---