1/*-
2 * cyclades cyclom-y serial driver
3 * Andrew Herbert <andrew@werple.apana.org.au>, 17 August 1993
4 *
5 * Copyright (c) 1993 Andrew Herbert.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
--- 15 unchanged lines hidden (view full) ---
24 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sys/dev/cy/cy.c 130640 2004-06-17 17:16:53Z phk $");
33
34#include "opt_compat.h"
35
36/*
37 * TODO:
38 * Atomic COR change.
39 * Consoles.
40 */
--- 1493 unchanged lines hidden (view full) ---
1534 int flag;
1535 struct thread *td;
1536{
1537 struct com_s *com;
1538 int error;
1539 int mynor;
1540 int s;
1541 struct tty *tp;
1542#if defined(COMPAT_43)
1543 int oldcmd;
1544 struct termios term;
1545#endif
1546
1547 mynor = minor(dev);
1548 com = com_addr(MINOR_TO_UNIT(mynor));
1549 if (mynor & CONTROL_MASK) {
1550 struct termios *ct;
1551
1552 switch (mynor & CONTROL_MASK) {
1553 case CONTROL_INIT_STATE:
--- 21 unchanged lines hidden (view full) ---
1575 case TIOCGWINSZ:
1576 bzero(data, sizeof(struct winsize));
1577 return (0);
1578 default:
1579 return (ENOTTY);
1580 }
1581 }
1582 tp = com->tp;
1583#if defined(COMPAT_43)
1584 term = tp->t_termios;
1585 oldcmd = cmd;
1586 error = ttsetcompat(tp, &cmd, data, &term);
1587 if (error != 0)
1588 return (error);
1589 if (cmd != oldcmd)
1590 data = (caddr_t)&term;
1591#endif
1592 if (cmd == TIOCSETA || cmd == TIOCSETAW || cmd == TIOCSETAF) {
1593 int cc;
1594 struct termios *dt = (struct termios *)data;
1595 struct termios *lt = mynor & CALLOUT_MASK
1596 ? &com->lt_out : &com->lt_in;
1597
1598 dt->c_iflag = (tp->t_iflag & lt->c_iflag)
1599 | (dt->c_iflag & ~lt->c_iflag);
--- 1276 unchanged lines hidden ---
2 * cyclades cyclom-y serial driver
3 * Andrew Herbert <andrew@werple.apana.org.au>, 17 August 1993
4 *
5 * Copyright (c) 1993 Andrew Herbert.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
--- 15 unchanged lines hidden (view full) ---
24 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sys/dev/cy/cy.c 130640 2004-06-17 17:16:53Z phk $");
33
34#include "opt_compat.h"
35
36/*
37 * TODO:
38 * Atomic COR change.
39 * Consoles.
40 */
--- 1493 unchanged lines hidden (view full) ---
1534 int flag;
1535 struct thread *td;
1536{
1537 struct com_s *com;
1538 int error;
1539 int mynor;
1540 int s;
1541 struct tty *tp;
1542#if defined(COMPAT_43)
1543 int oldcmd;
1544 struct termios term;
1545#endif
1546
1547 mynor = minor(dev);
1548 com = com_addr(MINOR_TO_UNIT(mynor));
1549 if (mynor & CONTROL_MASK) {
1550 struct termios *ct;
1551
1552 switch (mynor & CONTROL_MASK) {
1553 case CONTROL_INIT_STATE:
--- 21 unchanged lines hidden (view full) ---
1575 case TIOCGWINSZ:
1576 bzero(data, sizeof(struct winsize));
1577 return (0);
1578 default:
1579 return (ENOTTY);
1580 }
1581 }
1582 tp = com->tp;
1583#if defined(COMPAT_43)
1584 term = tp->t_termios;
1585 oldcmd = cmd;
1586 error = ttsetcompat(tp, &cmd, data, &term);
1587 if (error != 0)
1588 return (error);
1589 if (cmd != oldcmd)
1590 data = (caddr_t)&term;
1591#endif
1592 if (cmd == TIOCSETA || cmd == TIOCSETAW || cmd == TIOCSETAF) {
1593 int cc;
1594 struct termios *dt = (struct termios *)data;
1595 struct termios *lt = mynor & CALLOUT_MASK
1596 ? &com->lt_out : &com->lt_in;
1597
1598 dt->c_iflag = (tp->t_iflag & lt->c_iflag)
1599 | (dt->c_iflag & ~lt->c_iflag);
--- 1276 unchanged lines hidden ---