snp.c (196452) | snp.c (223575) |
---|---|
1/*- 2 * Copyright (c) 2008 Ed Schouten <ed@FreeBSD.org> 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 --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2008 Ed Schouten <ed@FreeBSD.org> 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 --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/dev/snp/snp.c 196452 2009-08-23 08:04:40Z ed $"); | 28__FBSDID("$FreeBSD: head/sys/dev/snp/snp.c 223575 2011-06-26 18:26:20Z ed $"); |
29 30#include <sys/param.h> 31#include <sys/conf.h> 32#include <sys/fcntl.h> 33#include <sys/filio.h> 34#include <sys/kernel.h> 35#include <sys/malloc.h> 36#include <sys/module.h> --- 116 unchanged lines hidden (view full) --- 153 struct tty *tp; 154 155 if (uio->uio_resid == 0) 156 return (0); 157 158 error = devfs_get_cdevpriv((void **)&ss); 159 if (error != 0) 160 return (error); | 29 30#include <sys/param.h> 31#include <sys/conf.h> 32#include <sys/fcntl.h> 33#include <sys/filio.h> 34#include <sys/kernel.h> 35#include <sys/malloc.h> 36#include <sys/module.h> --- 116 unchanged lines hidden (view full) --- 153 struct tty *tp; 154 155 if (uio->uio_resid == 0) 156 return (0); 157 158 error = devfs_get_cdevpriv((void **)&ss); 159 if (error != 0) 160 return (error); |
161 | 161 |
162 tp = ss->snp_tty; 163 if (tp == NULL || tty_gone(tp)) 164 return (EIO); 165 166 tty_lock(tp); 167 for (;;) { 168 error = ttyoutq_read_uio(&ss->snp_outq, tp, uio); 169 if (error != 0 || uio->uio_resid != oresid) --- 23 unchanged lines hidden (view full) --- 193 struct snp_softc *ss; 194 struct tty *tp; 195 int error, len; 196 char in[SNP_INPUT_BUFSIZE]; 197 198 error = devfs_get_cdevpriv((void **)&ss); 199 if (error != 0) 200 return (error); | 162 tp = ss->snp_tty; 163 if (tp == NULL || tty_gone(tp)) 164 return (EIO); 165 166 tty_lock(tp); 167 for (;;) { 168 error = ttyoutq_read_uio(&ss->snp_outq, tp, uio); 169 if (error != 0 || uio->uio_resid != oresid) --- 23 unchanged lines hidden (view full) --- 193 struct snp_softc *ss; 194 struct tty *tp; 195 int error, len; 196 char in[SNP_INPUT_BUFSIZE]; 197 198 error = devfs_get_cdevpriv((void **)&ss); 199 if (error != 0) 200 return (error); |
201 | 201 |
202 tp = ss->snp_tty; 203 if (tp == NULL || tty_gone(tp)) 204 return (EIO); 205 206 while (uio->uio_resid > 0) { 207 /* Read new data. */ 208 len = imin(uio->uio_resid, sizeof in); 209 error = uiomove(in, len, uio); --- 149 unchanged lines hidden --- | 202 tp = ss->snp_tty; 203 if (tp == NULL || tty_gone(tp)) 204 return (EIO); 205 206 while (uio->uio_resid > 0) { 207 /* Read new data. */ 208 len = imin(uio->uio_resid, sizeof in); 209 error = uiomove(in, len, uio); --- 149 unchanged lines hidden --- |