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 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; |
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, |
808 /* stop */ nostop, |
809 /* reset */ noreset, |
810 /* devtotty */ nodevtotty, 811 /* poll */ ttypoll, |
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 |
860static int rpparam __P((struct tty *, struct termios *)); 861static void rpstart __P((struct tty *)); |
862static void rpstop __P((struct tty *, int)); |
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; |
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; |
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} |