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 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> |
50#ifndef BURN_BRIDGES |
51#if defined(COMPAT_43) 52#include <sys/ioctl_compat.h> 53#endif |
54#endif |
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 |
921#if defined(COMPAT_43) 922 u_long oldcmd; 923 struct termios term; 924#endif |
925#endif |
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 |
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 |
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 |
1018#ifdef COMPAT_43 1019 case TIOCSETP: 1020#endif |
1021#endif |
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 --- |