2 * Copyright (c) 2002 Scott Long
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
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
26 * $FreeBSD: src/sys/dev/aac/aac_linux.c,v 1.4 2006/12/20 17:10:53 delphij Exp $
30 * Linux ioctl handler for the aac device driver
33 #include <sys/param.h>
34 #include <sys/systm.h>
36 #include <sys/kernel.h>
37 #include <sys/module.h>
39 #include <sys/mapped_ioctl.h>
42 #include <machine/../linux32/linux.h>
43 #include <machine/../linux32/linux32_proto.h>
45 #include <emulation/linux/i386/linux.h>
46 #include <emulation/linux/i386/linux_proto.h>
48 #include <emulation/linux/linux_ioctl.h>
50 #include <dev/raid/aac/aacreg.h> /* needed by aac_ioctl.h */
51 #include <dev/raid/aac/aac_ioctl.h>
53 /* Define ioctl mappings */
54 static struct ioctl_map_range aac_linux_ioctl_cmds[] = {
55 MAPPED_IOCTL_MAP(FSACTL_LNX_SENDFIB, FSACTL_SENDFIB),
56 MAPPED_IOCTL_MAP(FSACTL_LNX_GET_COMM_PERF_DATA, FSACTL_GET_COMM_PERF_DATA),
57 MAPPED_IOCTL_MAP(FSACTL_LNX_OPENCLS_COMM_PERF_DATA, FSACTL_OPENCLS_COMM_PERF_DATA),
58 MAPPED_IOCTL_MAP(FSACTL_LNX_OPEN_GET_ADAPTER_FIB, FSACTL_OPEN_GET_ADAPTER_FIB),
59 MAPPED_IOCTL_MAP(FSACTL_LNX_GET_NEXT_ADAPTER_FIB, FSACTL_GET_NEXT_ADAPTER_FIB),
60 MAPPED_IOCTL_MAP(FSACTL_LNX_CLOSE_GET_ADAPTER_FIB, FSACTL_CLOSE_GET_ADAPTER_FIB),
61 MAPPED_IOCTL_MAP(FSACTL_LNX_CLOSE_ADAPTER_CONFIG, FSACTL_CLOSE_ADAPTER_CONFIG),
62 MAPPED_IOCTL_MAP(FSACTL_LNX_OPEN_ADAPTER_CONFIG, FSACTL_OPEN_ADAPTER_CONFIG),
63 MAPPED_IOCTL_MAP(FSACTL_LNX_MINIPORT_REV_CHECK, FSACTL_MINIPORT_REV_CHECK),
64 MAPPED_IOCTL_MAP(FSACTL_LNX_QUERY_ADAPTER_CONFIG, FSACTL_QUERY_ADAPTER_CONFIG),
65 MAPPED_IOCTL_MAP(FSACTL_LNX_GET_PCI_INFO, FSACTL_GET_PCI_INFO),
66 MAPPED_IOCTL_MAP(FSACTL_LNX_FORCE_DELETE_DISK, FSACTL_FORCE_DELETE_DISK),
67 MAPPED_IOCTL_MAP(FSACTL_LNX_AIF_THREAD, FSACTL_AIF_THREAD),
68 MAPPED_IOCTL_MAP(FSACTL_LNX_NULL_IO_TEST, FSACTL_NULL_IO_TEST),
69 MAPPED_IOCTL_MAP(FSACTL_LNX_SIM_IO_TEST, FSACTL_SIM_IO_TEST),
70 MAPPED_IOCTL_MAP(FSACTL_LNX_DOWNLOAD, FSACTL_DOWNLOAD),
71 MAPPED_IOCTL_MAP(FSACTL_LNX_GET_VAR, FSACTL_GET_VAR),
72 MAPPED_IOCTL_MAP(FSACTL_LNX_SET_VAR, FSACTL_SET_VAR),
73 MAPPED_IOCTL_MAP(FSACTL_LNX_GET_FIBTIMES, FSACTL_GET_FIBTIMES),
74 MAPPED_IOCTL_MAP(FSACTL_LNX_ZERO_FIBTIMES, FSACTL_ZERO_FIBTIMES),
75 MAPPED_IOCTL_MAP(FSACTL_LNX_DELETE_DISK, FSACTL_DELETE_DISK),
76 MAPPED_IOCTL_MAP(FSACTL_LNX_QUERY_DISK, FSACTL_QUERY_DISK),
77 MAPPED_IOCTL_MAP(FSACTL_LNX_PROBE_CONTAINERS, FSACTL_PROBE_CONTAINERS),
78 MAPPED_IOCTL_MAPF(0 ,0, NULL)
81 static struct ioctl_map_handler aac_linux_ioctl_handler = {
87 SYSINIT (aac_register, SI_BOOT2_KLD, SI_ORDER_MIDDLE,
88 mapped_ioctl_register_handler, &aac_linux_ioctl_handler);
89 SYSUNINIT(aac_unregister, SI_BOOT2_KLD, SI_ORDER_MIDDLE,
90 mapped_ioctl_unregister_handler, &aac_linux_ioctl_handler);
93 aac_linux_modevent(module_t mod, int type, void *data)
95 /* Do we care about any specific load/unload actions? */
99 DEV_MODULE(aac_linux, aac_linux_modevent, NULL);
100 MODULE_DEPEND(aac_linux, linux, 1, 1, 1);