1/*
2 * Copyright (c) Comtrol Corporation <support@comtrol.com>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted prodived that the follwoing conditions
7 * are met.
8 * 1. Redistributions of source code must retain the above copyright
--- 18 unchanged lines hidden (view full) ---
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 */
33
34#include <sys/cdefs.h>
35__FBSDID("$FreeBSD: head/sys/dev/rp/rp.c 130841 2004-06-21 13:02:25Z gallatin $");
36
37/*
38 * rp.c - for RocketPort FreeBSD
39 */
40
41#include "opt_compat.h"
42
43#include <sys/param.h>
--- 1192 unchanged lines hidden (view full) ---
1236 struct rp_port *rp;
1237 CHANNEL_t *cp;
1238 struct tty *tp;
1239 int unit, mynor, port, umynor; /* SG */
1240 int oldspl;
1241 int error = 0;
1242 int arg, flags, result, ChanStatus;
1243 struct termios *t;
1244#if defined(COMPAT_43)
1245 u_long oldcmd;
1246 struct termios term;
1247#endif
1248
1249 umynor = (((minor(dev) >> 16) -1) * 32); /* SG */
1250 port = (minor(dev) & 0x1f); /* SG */
1251 mynor = (port + umynor); /* SG */
1252 unit = minor_to_unit[mynor];
1253 rp = rp_addr(unit) + port;
1254
1255 if(IS_CONTROL(dev)) {
--- 28 unchanged lines hidden (view full) ---
1284 default:
1285 return(ENOTTY);
1286 }
1287 }
1288
1289 tp = rp->rp_tty;
1290 cp = &rp->rp_channel;
1291
1292#if defined(COMPAT_43)
1293 term = tp->t_termios;
1294 oldcmd = cmd;
1295 error = ttsetcompat(tp, &cmd, data, &term);
1296 if(error != 0)
1297 return(error);
1298 if(cmd != oldcmd) {
1299 data = (caddr_t)&term;
1300 }
1301#endif
1302 if((cmd == TIOCSETA) || (cmd == TIOCSETAW) || (cmd == TIOCSETAF)) {
1303 int cc;
1304 struct termios *dt = (struct termios *)data;
1305 struct termios *lt = IS_CALLOUT(dev)
1306 ? &rp->lt_out : &rp->lt_in;
1307
1308 dt->c_iflag = (tp->t_iflag & lt->c_iflag)
1309 | (dt->c_iflag & ~lt->c_iflag);
--- 353 unchanged lines hidden ---
2 * Copyright (c) Comtrol Corporation <support@comtrol.com>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted prodived that the follwoing conditions
7 * are met.
8 * 1. Redistributions of source code must retain the above copyright
--- 18 unchanged lines hidden (view full) ---
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 */
33
34#include <sys/cdefs.h>
35__FBSDID("$FreeBSD: head/sys/dev/rp/rp.c 130841 2004-06-21 13:02:25Z gallatin $");
36
37/*
38 * rp.c - for RocketPort FreeBSD
39 */
40
41#include "opt_compat.h"
42
43#include <sys/param.h>
--- 1192 unchanged lines hidden (view full) ---
1236 struct rp_port *rp;
1237 CHANNEL_t *cp;
1238 struct tty *tp;
1239 int unit, mynor, port, umynor; /* SG */
1240 int oldspl;
1241 int error = 0;
1242 int arg, flags, result, ChanStatus;
1243 struct termios *t;
1244#if defined(COMPAT_43)
1245 u_long oldcmd;
1246 struct termios term;
1247#endif
1248
1249 umynor = (((minor(dev) >> 16) -1) * 32); /* SG */
1250 port = (minor(dev) & 0x1f); /* SG */
1251 mynor = (port + umynor); /* SG */
1252 unit = minor_to_unit[mynor];
1253 rp = rp_addr(unit) + port;
1254
1255 if(IS_CONTROL(dev)) {
--- 28 unchanged lines hidden (view full) ---
1284 default:
1285 return(ENOTTY);
1286 }
1287 }
1288
1289 tp = rp->rp_tty;
1290 cp = &rp->rp_channel;
1291
1292#if defined(COMPAT_43)
1293 term = tp->t_termios;
1294 oldcmd = cmd;
1295 error = ttsetcompat(tp, &cmd, data, &term);
1296 if(error != 0)
1297 return(error);
1298 if(cmd != oldcmd) {
1299 data = (caddr_t)&term;
1300 }
1301#endif
1302 if((cmd == TIOCSETA) || (cmd == TIOCSETAW) || (cmd == TIOCSETAF)) {
1303 int cc;
1304 struct termios *dt = (struct termios *)data;
1305 struct termios *lt = IS_CALLOUT(dev)
1306 ? &rp->lt_out : &rp->lt_in;
1307
1308 dt->c_iflag = (tp->t_iflag & lt->c_iflag)
1309 | (dt->c_iflag & ~lt->c_iflag);
--- 353 unchanged lines hidden ---