smb.c (813548fa2cbb53437372812192074f07ca2baf09) | smb.c (f1d19042b082d95f07a0027e596ba2405aa8a9a5) |
---|---|
1/*- 2 * Copyright (c) 1998 Nicolas Souchu 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 --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 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 * | 1/*- 2 * Copyright (c) 1998 Nicolas Souchu 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 --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 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 * $Id: smb.c,v 1.2 1998/09/04 17:53:42 nsouch Exp $ | 26 * $Id: smb.c,v 1.3 1998/09/09 18:57:38 nsouch Exp $ |
27 * 28 */ 29#include <sys/param.h> 30#include <sys/kernel.h> 31#include <sys/systm.h> 32#include <sys/module.h> 33#include <sys/bus.h> 34#include <sys/conf.h> --- 79 unchanged lines hidden (view full) --- 114} 115 116/* 117 * smbattach() 118 */ 119static int 120smb_attach(device_t dev) 121{ | 27 * 28 */ 29#include <sys/param.h> 30#include <sys/kernel.h> 31#include <sys/systm.h> 32#include <sys/module.h> 33#include <sys/bus.h> 34#include <sys/conf.h> --- 79 unchanged lines hidden (view full) --- 114} 115 116/* 117 * smbattach() 118 */ 119static int 120smb_attach(device_t dev) 121{ |
122 struct smb_softc *sc = (struct smb_softc *)device_get_softc(dev); 123 | |
124 return (0); 125} 126 127static int 128smbopen (dev_t dev, int flags, int fmt, struct proc *p) 129{ 130 struct smb_softc *sc = IIC_SOFTC(minor(dev)); 131 --- 24 unchanged lines hidden (view full) --- 156 return (0); 157} 158 159static int 160smbwrite(dev_t dev, struct uio * uio, int ioflag) 161{ 162 device_t smbdev = IIC_DEVICE(minor(dev)); 163 struct smb_softc *sc = IIC_SOFTC(minor(dev)); | 122 return (0); 123} 124 125static int 126smbopen (dev_t dev, int flags, int fmt, struct proc *p) 127{ 128 struct smb_softc *sc = IIC_SOFTC(minor(dev)); 129 --- 24 unchanged lines hidden (view full) --- 154 return (0); 155} 156 157static int 158smbwrite(dev_t dev, struct uio * uio, int ioflag) 159{ 160 device_t smbdev = IIC_DEVICE(minor(dev)); 161 struct smb_softc *sc = IIC_SOFTC(minor(dev)); |
164 int error, count; | 162 int count; |
165 166 if (!sc || !smbdev) 167 return (EINVAL); 168 169 if (sc->sc_count == 0) 170 return (EINVAL); 171 172 count = min(uio->uio_resid, BUFSIZE); --- 115 unchanged lines hidden --- | 163 164 if (!sc || !smbdev) 165 return (EINVAL); 166 167 if (sc->sc_count == 0) 168 return (EINVAL); 169 170 count = min(uio->uio_resid, BUFSIZE); --- 115 unchanged lines hidden --- |