si.c (130344) | si.c (130585) |
---|---|
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 130344 2004-06-11 11:16:26Z phk $"); | 36__FBSDID("$FreeBSD: head/sys/dev/si/si.c 130585 2004-06-16 09:47:26Z 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 unchanged lines hidden (view full) --- 90#define JET_INT_COUNT 100 /* max of 100 ints per second */ 91#define RXINT_COUNT 1 /* one rxint per 10 milliseconds */ 92 93enum si_mctl { GET, SET, BIS, BIC }; 94 95static void si_command(struct si_port *, int, int); 96static int si_modem(struct si_port *, enum si_mctl, int); 97static void si_write_enable(struct si_port *, int); | 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 unchanged lines hidden (view full) --- 90#define JET_INT_COUNT 100 /* max of 100 ints per second */ 91#define RXINT_COUNT 1 /* one rxint per 10 milliseconds */ 92 93enum si_mctl { GET, SET, BIS, BIC }; 94 95static void si_command(struct si_port *, int, int); 96static int si_modem(struct si_port *, enum si_mctl, int); 97static void si_write_enable(struct si_port *, int); |
98static int si_Sioctl(dev_t, u_long, caddr_t, int, struct thread *); | 98static int si_Sioctl(struct cdev *, u_long, caddr_t, int, struct thread *); |
99static void si_start(struct tty *); 100static void si_stop(struct tty *, int); 101static timeout_t si_lstart; 102static void sihardclose(struct si_port *pp); 103static void sidtrwakeup(void *chan); 104 105#ifdef SI_DEBUG 106static char *si_mctl2str(enum si_mctl cmd); --- 477 unchanged lines hidden (view full) --- 584 make_dev(&si_cdevsw, x + 0x20000, 0, 0, 0600, "ttylA%02d", y); 585 make_dev(&si_cdevsw, x + 0x20080, 0, 0, 0600, "cualA%02d", y); 586 } 587 make_dev(&si_cdevsw, 0x40000, 0, 0, 0600, "si_control"); 588 return (0); 589} 590 591static int | 99static void si_start(struct tty *); 100static void si_stop(struct tty *, int); 101static timeout_t si_lstart; 102static void sihardclose(struct si_port *pp); 103static void sidtrwakeup(void *chan); 104 105#ifdef SI_DEBUG 106static char *si_mctl2str(enum si_mctl cmd); --- 477 unchanged lines hidden (view full) --- 584 make_dev(&si_cdevsw, x + 0x20000, 0, 0, 0600, "ttylA%02d", y); 585 make_dev(&si_cdevsw, x + 0x20080, 0, 0, 0600, "cualA%02d", y); 586 } 587 make_dev(&si_cdevsw, 0x40000, 0, 0, 0600, "si_control"); 588 return (0); 589} 590 591static int |
592siopen(dev_t dev, int flag, int mode, struct thread *td) | 592siopen(struct cdev *dev, int flag, int mode, struct thread *td) |
593{ 594 int oldspl, error; 595 int card, port; 596 struct si_softc *sc; 597 struct tty *tp; 598 volatile struct si_channel *ccbp; 599 struct si_port *pp; 600 int mynor = minor(dev); --- 152 unchanged lines hidden (view full) --- 753 754 if (!(tp->t_state & TS_ISOPEN) && pp->sp_wopeners == 0) 755 sihardclose(pp); 756 757 return(error); 758} 759 760static int | 593{ 594 int oldspl, error; 595 int card, port; 596 struct si_softc *sc; 597 struct tty *tp; 598 volatile struct si_channel *ccbp; 599 struct si_port *pp; 600 int mynor = minor(dev); --- 152 unchanged lines hidden (view full) --- 753 754 if (!(tp->t_state & TS_ISOPEN) && pp->sp_wopeners == 0) 755 sihardclose(pp); 756 757 return(error); 758} 759 760static int |
761siclose(dev_t dev, int flag, int mode, struct thread *td) | 761siclose(struct cdev *dev, int flag, int mode, struct thread *td) |
762{ 763 struct si_port *pp; 764 struct tty *tp; 765 int oldspl; 766 int error = 0; 767 int mynor = minor(dev); 768 769 if (IS_SPECIAL(mynor)) --- 93 unchanged lines hidden (view full) --- 863 pp = (struct si_port *)chan; 864 pp->sp_state &= ~SS_DTR_OFF; 865 wakeup(&pp->sp_dtr_wait); 866 867 splx(oldspl); 868} 869 870static int | 762{ 763 struct si_port *pp; 764 struct tty *tp; 765 int oldspl; 766 int error = 0; 767 int mynor = minor(dev); 768 769 if (IS_SPECIAL(mynor)) --- 93 unchanged lines hidden (view full) --- 863 pp = (struct si_port *)chan; 864 pp->sp_state &= ~SS_DTR_OFF; 865 wakeup(&pp->sp_dtr_wait); 866 867 splx(oldspl); 868} 869 870static int |
871siwrite(dev_t dev, struct uio *uio, int flag) | 871siwrite(struct cdev *dev, struct uio *uio, int flag) |
872{ 873 struct si_port *pp; 874 struct tty *tp; 875 int error = 0; 876 int mynor = minor(dev); 877 int oldspl; 878 879 if (IS_SPECIAL(mynor)) { --- 22 unchanged lines hidden (view full) --- 902 error = ttyld_write(tp, uio, flag); 903out: 904 splx(oldspl); 905 return (error); 906} 907 908 909static int | 872{ 873 struct si_port *pp; 874 struct tty *tp; 875 int error = 0; 876 int mynor = minor(dev); 877 int oldspl; 878 879 if (IS_SPECIAL(mynor)) { --- 22 unchanged lines hidden (view full) --- 902 error = ttyld_write(tp, uio, flag); 903out: 904 splx(oldspl); 905 return (error); 906} 907 908 909static int |
910siioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) | 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; 918#if defined(COMPAT_43) --- 149 unchanged lines hidden (view full) --- 1068 si_write_enable(pp, 1); 1069 return(error); 1070} 1071 1072/* 1073 * Handle the Specialix ioctls. All MUST be called via the CONTROL device 1074 */ 1075static int | 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; 918#if defined(COMPAT_43) --- 149 unchanged lines hidden (view full) --- 1068 si_write_enable(pp, 1); 1069 return(error); 1070} 1071 1072/* 1073 * Handle the Specialix ioctls. All MUST be called via the CONTROL device 1074 */ 1075static int |
1076si_Sioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) | 1076si_Sioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) |
1077{ 1078 struct si_softc *xsc; 1079 struct si_port *xpp; 1080 volatile struct si_reg *regp; 1081 struct si_tcsi *dp; 1082 struct si_pstat *sps; 1083 int *ip, error = 0; 1084 int oldspl; --- 1061 unchanged lines hidden --- | 1077{ 1078 struct si_softc *xsc; 1079 struct si_port *xpp; 1080 volatile struct si_reg *regp; 1081 struct si_tcsi *dp; 1082 struct si_pstat *sps; 1083 int *ip, error = 0; 1084 int oldspl; --- 1061 unchanged lines hidden --- |