Deleted Added
full compact
rp.c (50477) rp.c (51654)
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

--- 15 unchanged lines hidden (view full) ---

24 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
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 *
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

--- 15 unchanged lines hidden (view full) ---

24 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
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 * $FreeBSD: head/sys/dev/rp/rp.c 50477 1999-08-28 01:08:13Z peter $
32 * $FreeBSD: head/sys/dev/rp/rp.c 51654 1999-09-25 16:21:39Z phk $
33 */
34
35/*
36 * rp.c - for RocketPort FreeBSD
37 */
38
39#include "opt_compat.h"
40

--- 751 unchanged lines hidden (view full) ---

792
793static char driver_name[] = "rp";
794
795static d_open_t rpopen;
796static d_close_t rpclose;
797static d_read_t rpread;
798static d_write_t rpwrite;
799static d_ioctl_t rpioctl;
33 */
34
35/*
36 * rp.c - for RocketPort FreeBSD
37 */
38
39#include "opt_compat.h"
40

--- 751 unchanged lines hidden (view full) ---

792
793static char driver_name[] = "rp";
794
795static d_open_t rpopen;
796static d_close_t rpclose;
797static d_read_t rpread;
798static d_write_t rpwrite;
799static d_ioctl_t rpioctl;
800static d_stop_t rpstop;
801static d_devtotty_t rpdevtotty;
802
803#define CDEV_MAJOR 81
804static struct cdevsw rp_cdevsw = {
805 /* open */ rpopen,
806 /* close */ rpclose,
807 /* read */ rpread,
808 /* write */ rpwrite,
809 /* ioctl */ rpioctl,
800
801#define CDEV_MAJOR 81
802static struct cdevsw rp_cdevsw = {
803 /* open */ rpopen,
804 /* close */ rpclose,
805 /* read */ rpread,
806 /* write */ rpwrite,
807 /* ioctl */ rpioctl,
810 /* stop */ rpstop,
808 /* stop */ nostop,
811 /* reset */ noreset,
809 /* reset */ noreset,
812 /* devtotty */ rpdevtotty,
813 /* poll */ ttpoll,
810 /* devtotty */ nodevtotty,
811 /* poll */ ttypoll,
814 /* mmap */ nommap,
815 /* strategy */ nostrategy,
816 /* name */ driver_name,
817 /* parms */ noparms,
818 /* maj */ CDEV_MAJOR,
819 /* dump */ nodump,
820 /* psize */ nopsize,
821 /* flags */ D_TTY,

--- 32 unchanged lines hidden (view full) ---

854static struct rp_port *p_rp_table[MAX_RP_PORTS];
855#define rp_addr(unit) (p_rp_addr[unit])
856#define rp_table(port) (p_rp_table[port])
857
858/*
859 * The top-level routines begin here
860 */
861
812 /* mmap */ nommap,
813 /* strategy */ nostrategy,
814 /* name */ driver_name,
815 /* parms */ noparms,
816 /* maj */ CDEV_MAJOR,
817 /* dump */ nodump,
818 /* psize */ nopsize,
819 /* flags */ D_TTY,

--- 32 unchanged lines hidden (view full) ---

852static struct rp_port *p_rp_table[MAX_RP_PORTS];
853#define rp_addr(unit) (p_rp_addr[unit])
854#define rp_table(port) (p_rp_table[port])
855
856/*
857 * The top-level routines begin here
858 */
859
862int rpselect __P((dev_t, int, struct proc *));
863
864static int rpparam __P((struct tty *, struct termios *));
865static void rpstart __P((struct tty *));
860static int rpparam __P((struct tty *, struct termios *));
861static void rpstart __P((struct tty *));
862static void rpstop __P((struct tty *, int));
866static void rphardclose __P((struct rp_port *));
867#define rpmap nomap
868#define rpreset noreset
869#define rpstrategy nostrategy
870static void rp_disc_optim __P((struct tty *tp, struct termios *t,
871 struct rp_port *rp));
872
873static _INLINE_ void rp_do_receive(struct rp_port *rp, struct tty *tp,

--- 431 unchanged lines hidden (view full) ---

1305 mynor = (port + umynor); /* SG */
1306 unit = minor_to_unit[mynor];
1307 if(IS_CONTROL(dev))
1308 return(0);
1309 rp = rp_addr(unit) + port;
1310/* rp->rp_tty = &rp_tty[rp->rp_port];
1311*/
1312 tp = rp->rp_tty;
863static void rphardclose __P((struct rp_port *));
864#define rpmap nomap
865#define rpreset noreset
866#define rpstrategy nostrategy
867static void rp_disc_optim __P((struct tty *tp, struct termios *t,
868 struct rp_port *rp));
869
870static _INLINE_ void rp_do_receive(struct rp_port *rp, struct tty *tp,

--- 431 unchanged lines hidden (view full) ---

1302 mynor = (port + umynor); /* SG */
1303 unit = minor_to_unit[mynor];
1304 if(IS_CONTROL(dev))
1305 return(0);
1306 rp = rp_addr(unit) + port;
1307/* rp->rp_tty = &rp_tty[rp->rp_port];
1308*/
1309 tp = rp->rp_tty;
1310 dev->si_tty = tp;
1313
1314 oldspl = spltty();
1315
1316open_top:
1317 while(rp->state & ~SET_DTR) {
1318 error = tsleep(&rp->dtr_wait, TTIPRI | PCATCH, "rpdtr", 0);
1319 if(error != 0)
1320 goto out;

--- 23 unchanged lines hidden (view full) ---

1344 splx(oldspl);
1345 return(EBUSY);
1346 }
1347 }
1348 else {
1349 tp->t_dev = dev;
1350 tp->t_param = rpparam;
1351 tp->t_oproc = rpstart;
1311
1312 oldspl = spltty();
1313
1314open_top:
1315 while(rp->state & ~SET_DTR) {
1316 error = tsleep(&rp->dtr_wait, TTIPRI | PCATCH, "rpdtr", 0);
1317 if(error != 0)
1318 goto out;

--- 23 unchanged lines hidden (view full) ---

1342 splx(oldspl);
1343 return(EBUSY);
1344 }
1345 }
1346 else {
1347 tp->t_dev = dev;
1348 tp->t_param = rpparam;
1349 tp->t_oproc = rpstart;
1350 tp->t_stop = rpstop;
1352 tp->t_line = 0;
1353 tp->t_termios = IS_CALLOUT(dev) ? rp->it_out : rp->it_in;
1354 flags = 0;
1355 flags |= SET_RTS;
1356 flags |= SET_DTR;
1357 rp->rp_channel.TxControl[3] =
1358 ((rp->rp_channel.TxControl[3]
1359 & ~(SET_RTS | SET_DTR)) | flags);

--- 652 unchanged lines hidden (view full) ---

2012 sDisTransmit(cp);
2013 rp->rp_xmit_stopped = 1;
2014 }
2015 }
2016 }
2017 splx(spl);
2018 rpstart(tp);
2019}
1351 tp->t_line = 0;
1352 tp->t_termios = IS_CALLOUT(dev) ? rp->it_out : rp->it_in;
1353 flags = 0;
1354 flags |= SET_RTS;
1355 flags |= SET_DTR;
1356 rp->rp_channel.TxControl[3] =
1357 ((rp->rp_channel.TxControl[3]
1358 & ~(SET_RTS | SET_DTR)) | flags);

--- 652 unchanged lines hidden (view full) ---

2011 sDisTransmit(cp);
2012 rp->rp_xmit_stopped = 1;
2013 }
2014 }
2015 }
2016 splx(spl);
2017 rpstart(tp);
2018}
2020
2021int
2022rpselect(dev, flag, p)
2023 dev_t dev;
2024 int flag;
2025 struct proc *p;
2026{
2027 return(0);
2028}
2029
2030struct tty *
2031rpdevtotty(dev_t dev)
2032{
2033 struct rp_port *rp;
2034 int unit, port, mynor, umynor; /* SG */
2035
2036 umynor = (((minor(dev) >> 16) -1) * 32); /* SG */
2037 port = (minor(dev) & 0x1f); /* SG */
2038 mynor = (port + umynor); /* SG */
2039 unit = minor_to_unit[mynor]; /* SG */
2040
2041 if(IS_CONTROL(dev))
2042 return(NULL);
2043 rp = rp_addr(unit) + port;
2044 return(rp->rp_tty);
2045}