1/*- 2 * Copyright (c) 2001 Michael Smith 3 * Copyright (c) 2004 Paul Saab 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * |
27 * $FreeBSD: head/sys/dev/ciss/ciss.c 192450 2009-05-20 17:29:21Z imp $ |
28 */ 29 30/* 31 * Common Interface for SCSI-3 Support driver. 32 * 33 * CISS claims to provide a common interface between a generic SCSI 34 * transport and an intelligent host adapter. 35 * --- 4401 unchanged lines hidden (view full) --- 4437 } 4438 return("unknown status"); 4439} 4440 4441/************************************************************************ 4442 * Handle an open on the control device. 4443 */ 4444static int |
4445ciss_open(struct cdev *dev, int flags, int fmt, struct thread *p) |
4446{ 4447 struct ciss_softc *sc; 4448 4449 debug_called(1); 4450 4451 sc = (struct ciss_softc *)dev->si_drv1; 4452 4453 /* we might want to veto if someone already has us open */ 4454 4455 mtx_lock(&sc->ciss_mtx); 4456 sc->ciss_flags |= CISS_FLAG_CONTROL_OPEN; 4457 mtx_unlock(&sc->ciss_mtx); 4458 return(0); 4459} 4460 4461/************************************************************************ 4462 * Handle the last close on the control device. 4463 */ 4464static int |
4465ciss_close(struct cdev *dev, int flags, int fmt, struct thread *p) |
4466{ 4467 struct ciss_softc *sc; 4468 4469 debug_called(1); 4470 4471 sc = (struct ciss_softc *)dev->si_drv1; 4472 4473 mtx_lock(&sc->ciss_mtx); --- 4 unchanged lines hidden (view full) --- 4478 4479/******************************************************************************** 4480 * Handle adapter-specific control operations. 4481 * 4482 * Note that the API here is compatible with the Linux driver, in order to 4483 * simplify the porting of Compaq's userland tools. 4484 */ 4485static int |
4486ciss_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag, struct thread *p) |
4487{ 4488 struct ciss_softc *sc; 4489 IOCTL_Command_struct *ioc = (IOCTL_Command_struct *)addr; 4490#ifdef __amd64__ 4491 IOCTL_Command_struct32 *ioc32 = (IOCTL_Command_struct32 *)addr; 4492 IOCTL_Command_struct ioc_swab; 4493#endif 4494 int error; --- 146 unchanged lines hidden --- |