aacraid_linux.c (250963) | aacraid_linux.c (255240) |
---|---|
1/*- 2 * Copyright (c) 2002 Scott Long 3 * Copyright (c) 2002-2010 Adaptec, Inc. 4 * Copyright (c) 2010-2012 PMC-Sierra, Inc. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 13 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2002 Scott Long 3 * Copyright (c) 2002-2010 Adaptec, Inc. 4 * Copyright (c) 2010-2012 PMC-Sierra, Inc. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 13 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/dev/aacraid/aacraid_linux.c 250963 2013-05-24 09:22:43Z achim $"); | 30__FBSDID("$FreeBSD: head/sys/dev/aacraid/aacraid_linux.c 255240 2013-09-05 11:58:12Z pjd $"); |
31 32/* 33 * Linux ioctl handler for the aac device driver 34 */ 35 36#include <sys/param.h> | 31 32/* 33 * Linux ioctl handler for the aac device driver 34 */ 35 36#include <sys/param.h> |
37#if __FreeBSD_version >= 900000 38#include <sys/capability.h> 39#endif |
|
37#include <sys/systm.h> 38#include <sys/conf.h> 39#include <sys/kernel.h> 40#include <sys/module.h> 41#include <sys/file.h> 42#include <sys/proc.h> 43#ifdef __amd64__ 44#include <machine/../linux32/linux.h> --- 27 unchanged lines hidden (view full) --- 72 73DEV_MODULE(aacraid_linux, aacraid_linux_modevent, NULL); 74MODULE_DEPEND(aacraid_linux, linux, 1, 1, 1); 75 76static int 77aacraid_linux_ioctl(struct thread *td, struct linux_ioctl_args *args) 78{ 79 struct file *fp; | 40#include <sys/systm.h> 41#include <sys/conf.h> 42#include <sys/kernel.h> 43#include <sys/module.h> 44#include <sys/file.h> 45#include <sys/proc.h> 46#ifdef __amd64__ 47#include <machine/../linux32/linux.h> --- 27 unchanged lines hidden (view full) --- 75 76DEV_MODULE(aacraid_linux, aacraid_linux_modevent, NULL); 77MODULE_DEPEND(aacraid_linux, linux, 1, 1, 1); 78 79static int 80aacraid_linux_ioctl(struct thread *td, struct linux_ioctl_args *args) 81{ 82 struct file *fp; |
83#if __FreeBSD_version >= 900000 84 cap_rights_t rights; 85#endif |
|
80 u_long cmd; 81 int error; 82 | 86 u_long cmd; 87 int error; 88 |
89 if ((error = fget(td, args->fd, |
|
83#if __FreeBSD_version >= 900000 | 90#if __FreeBSD_version >= 900000 |
84 if ((error = fget(td, args->fd, 0, &fp)) != 0) 85#else 86 if ((error = fget(td, args->fd, &fp)) != 0) | 91 cap_rights_init(&rights, CAP_IOCTL), |
87#endif | 92#endif |
93 &fp)) != 0) { |
|
88 return (error); | 94 return (error); |
95 } |
|
89 cmd = args->cmd; 90 91 /* 92 * Pass the ioctl off to our standard handler. 93 */ 94 error = (fo_ioctl(fp, cmd, (caddr_t)args->arg, td->td_ucred, td)); 95 fdrop(fp, td); 96 return (error); 97} | 96 cmd = args->cmd; 97 98 /* 99 * Pass the ioctl off to our standard handler. 100 */ 101 error = (fo_ioctl(fp, cmd, (caddr_t)args->arg, td->td_ucred, td)); 102 fdrop(fp, td); 103 return (error); 104} |