1/*-
2 * Copyright (c) 1991 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 17 unchanged lines hidden (view full) ---
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * from: @(#)com.c 7.5 (Berkeley) 5/16/91
30 * from: i386/isa sio.c,v 1.234
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/dev/sio/sio.c 130096 2004-06-04 21:55:55Z phk $");
35
36#include "opt_comconsole.h"
37#include "opt_compat.h"
38#include "opt_ddb.h"
39#include "opt_sio.h"
40
41/*
42 * Serial driver, based on 386BSD-0.1 com driver.
--- 1924 unchanged lines hidden (view full) ---
1967 int flag;
1968 struct thread *td;
1969{
1970 struct com_s *com;
1971 int error;
1972 int mynor;
1973 int s;
1974 struct tty *tp;
1975#if defined(COMPAT_43) || defined(COMPAT_SUNOS)
1976 u_long oldcmd;
1977 struct termios term;
1978#endif
1979
1980 mynor = minor(dev);
1981 com = com_addr(MINOR_TO_UNIT(mynor));
1982 if (com == NULL || com->gone)
1983 return (ENODEV);
--- 26 unchanged lines hidden (view full) ---
2010 case TIOCGWINSZ:
2011 bzero(data, sizeof(struct winsize));
2012 return (0);
2013 default:
2014 return (ENOTTY);
2015 }
2016 }
2017 tp = com->tp;
2018#if defined(COMPAT_43) || defined(COMPAT_SUNOS)
2019 term = tp->t_termios;
2020 oldcmd = cmd;
2021 error = ttsetcompat(tp, &cmd, data, &term);
2022 if (error != 0)
2023 return (error);
2024 if (cmd != oldcmd)
2025 data = (caddr_t)&term;
2026#endif
--- 1206 unchanged lines hidden ---
2 * Copyright (c) 1991 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 17 unchanged lines hidden (view full) ---
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * from: @(#)com.c 7.5 (Berkeley) 5/16/91
30 * from: i386/isa sio.c,v 1.234
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/dev/sio/sio.c 130096 2004-06-04 21:55:55Z phk $");
35
36#include "opt_comconsole.h"
37#include "opt_compat.h"
38#include "opt_ddb.h"
39#include "opt_sio.h"
40
41/*
42 * Serial driver, based on 386BSD-0.1 com driver.
--- 1924 unchanged lines hidden (view full) ---
1967 int flag;
1968 struct thread *td;
1969{
1970 struct com_s *com;
1971 int error;
1972 int mynor;
1973 int s;
1974 struct tty *tp;
1975#if defined(COMPAT_43) || defined(COMPAT_SUNOS)
1976 u_long oldcmd;
1977 struct termios term;
1978#endif
1979
1980 mynor = minor(dev);
1981 com = com_addr(MINOR_TO_UNIT(mynor));
1982 if (com == NULL || com->gone)
1983 return (ENODEV);
--- 26 unchanged lines hidden (view full) ---
2010 case TIOCGWINSZ:
2011 bzero(data, sizeof(struct winsize));
2012 return (0);
2013 default:
2014 return (ENOTTY);
2015 }
2016 }
2017 tp = com->tp;
2018#if defined(COMPAT_43) || defined(COMPAT_SUNOS)
2019 term = tp->t_termios;
2020 oldcmd = cmd;
2021 error = ttsetcompat(tp, &cmd, data, &term);
2022 if (error != 0)
2023 return (error);
2024 if (cmd != oldcmd)
2025 data = (caddr_t)&term;
2026#endif
--- 1206 unchanged lines hidden ---