Deleted Added
full compact
aac.c (102602) aac.c (103952)
1/*-
2 * Copyright (c) 2000 Michael Smith
3 * Copyright (c) 2001 Scott Long
4 * Copyright (c) 2000 BSDi
5 * Copyright (c) 2001 Adaptec, Inc.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 12 unchanged lines hidden (view full) ---

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
1/*-
2 * Copyright (c) 2000 Michael Smith
3 * Copyright (c) 2001 Scott Long
4 * Copyright (c) 2000 BSDi
5 * Copyright (c) 2001 Adaptec, Inc.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 12 unchanged lines hidden (view full) ---

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $FreeBSD: head/sys/dev/aac/aac.c 102602 2002-08-30 05:02:07Z scottl $
29 * $FreeBSD: head/sys/dev/aac/aac.c 103952 2002-09-25 05:00:25Z scottl $
30 */
31
32/*
33 * Driver for the Adaptec 'FSA' family of PCI/SCSI RAID adapters.
34 */
35
36#include "opt_aac.h"
37

--- 14 unchanged lines hidden (view full) ---

52#endif
53
54#include <dev/aac/aac_compat.h>
55
56#include <sys/bus.h>
57#include <sys/conf.h>
58#include <sys/devicestat.h>
59#include <sys/disk.h>
30 */
31
32/*
33 * Driver for the Adaptec 'FSA' family of PCI/SCSI RAID adapters.
34 */
35
36#include "opt_aac.h"
37

--- 14 unchanged lines hidden (view full) ---

52#endif
53
54#include <dev/aac/aac_compat.h>
55
56#include <sys/bus.h>
57#include <sys/conf.h>
58#include <sys/devicestat.h>
59#include <sys/disk.h>
60#include <sys/file.h>
61#include <sys/signalvar.h>
62#include <sys/time.h>
63#include <sys/eventhandler.h>
64
65#include <machine/bus_memio.h>
66#include <machine/bus.h>
67#include <machine/resource.h>
68

--- 2419 unchanged lines hidden (view full) ---

2488 selwakeup(&sc->rcv_select);
2489 }
2490 AAC_LOCK_RELEASE(&sc->aac_aifq_lock);
2491
2492 return;
2493}
2494
2495/*
60#include <sys/signalvar.h>
61#include <sys/time.h>
62#include <sys/eventhandler.h>
63
64#include <machine/bus_memio.h>
65#include <machine/bus.h>
66#include <machine/resource.h>
67

--- 2419 unchanged lines hidden (view full) ---

2487 selwakeup(&sc->rcv_select);
2488 }
2489 AAC_LOCK_RELEASE(&sc->aac_aifq_lock);
2490
2491 return;
2492}
2493
2494/*
2496 * Linux Management Interface
2497 * This is soon to be removed!
2498 */
2499
2500#ifdef AAC_COMPAT_LINUX
2501
2502#include <sys/proc.h>
2503#include <machine/../linux/linux.h>
2504#include <machine/../linux/linux_proto.h>
2505#include <compat/linux/linux_ioctl.h>
2506
2507/* There are multiple ioctl number ranges that need to be handled */
2508#define AAC_LINUX_IOCTL_MIN 0x0000
2509#define AAC_LINUX_IOCTL_MAX 0x21ff
2510
2511static linux_ioctl_function_t aac_linux_ioctl;
2512static struct linux_ioctl_handler aac_handler = {aac_linux_ioctl,
2513 AAC_LINUX_IOCTL_MIN,
2514 AAC_LINUX_IOCTL_MAX};
2515
2516SYSINIT (aac_register, SI_SUB_KLD, SI_ORDER_MIDDLE,
2517 linux_ioctl_register_handler, &aac_handler);
2518SYSUNINIT(aac_unregister, SI_SUB_KLD, SI_ORDER_MIDDLE,
2519 linux_ioctl_unregister_handler, &aac_handler);
2520
2521MODULE_DEPEND(aac, linux, 1, 1, 1);
2522
2523static int
2524aac_linux_ioctl(struct thread *td, struct linux_ioctl_args *args)
2525{
2526 struct file *fp;
2527 u_long cmd;
2528 int error;
2529
2530 debug_called(2);
2531
2532 if ((error = fget(td, args->fd, &fp)) != 0)
2533 return (error);
2534 cmd = args->cmd;
2535
2536 /*
2537 * Pass the ioctl off to our standard handler.
2538 */
2539 error = (fo_ioctl(fp, cmd, (caddr_t)args->arg, td->td_ucred, td));
2540 fdrop(fp, td);
2541 return (error);
2542}
2543
2544#endif
2545
2546/*
2547 * Return the Revision of the driver to userspace and check to see if the
2548 * userspace app is possibly compatible. This is extremely bogus since
2549 * our driver doesn't follow Adaptec's versioning system. Cheat by just
2550 * returning what the card reported.
2551 */
2552static int
2553aac_rev_check(struct aac_softc *sc, caddr_t udata)
2554{

--- 254 unchanged lines hidden ---
2495 * Return the Revision of the driver to userspace and check to see if the
2496 * userspace app is possibly compatible. This is extremely bogus since
2497 * our driver doesn't follow Adaptec's versioning system. Cheat by just
2498 * returning what the card reported.
2499 */
2500static int
2501aac_rev_check(struct aac_softc *sc, caddr_t udata)
2502{

--- 254 unchanged lines hidden ---