| @@ -1,36 +1,36 @@ | | | @@ -1,36 +1,36 @@ |
1 | /* $NetBSD: mpii.c,v 1.1 2012/04/19 17:50:51 bouyer Exp $ */ | | 1 | /* $NetBSD: mpii.c,v 1.2 2013/08/08 07:06:13 kardel Exp $ */ |
2 | /* OpenBSD: mpii.c,v 1.51 2012/04/11 13:29:14 naddy Exp */ | | 2 | /* OpenBSD: mpii.c,v 1.51 2012/04/11 13:29:14 naddy Exp */ |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2010 Mike Belopuhov <mkb@crypt.org.ru> | | 4 | * Copyright (c) 2010 Mike Belopuhov <mkb@crypt.org.ru> |
5 | * Copyright (c) 2009 James Giannoules | | 5 | * Copyright (c) 2009 James Giannoules |
6 | * Copyright (c) 2005 - 2010 David Gwynne <dlg@openbsd.org> | | 6 | * Copyright (c) 2005 - 2010 David Gwynne <dlg@openbsd.org> |
7 | * Copyright (c) 2005 - 2010 Marco Peereboom <marco@openbsd.org> | | 7 | * Copyright (c) 2005 - 2010 Marco Peereboom <marco@openbsd.org> |
8 | * | | 8 | * |
9 | * Permission to use, copy, modify, and distribute this software for any | | 9 | * Permission to use, copy, modify, and distribute this software for any |
10 | * purpose with or without fee is hereby granted, provided that the above | | 10 | * purpose with or without fee is hereby granted, provided that the above |
11 | * copyright notice and this permission notice appear in all copies. | | 11 | * copyright notice and this permission notice appear in all copies. |
12 | * | | 12 | * |
13 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | | 13 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
14 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | | 14 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
15 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | | 15 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
16 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | | 16 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
17 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | | 17 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
18 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | | 18 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
19 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | | 19 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
20 | */ | | 20 | */ |
21 | | | 21 | |
22 | #include <sys/cdefs.h> | | 22 | #include <sys/cdefs.h> |
23 | __KERNEL_RCSID(0, "$NetBSD: mpii.c,v 1.1 2012/04/19 17:50:51 bouyer Exp $"); | | 23 | __KERNEL_RCSID(0, "$NetBSD: mpii.c,v 1.2 2013/08/08 07:06:13 kardel Exp $"); |
24 | | | 24 | |
25 | #include "bio.h" | | 25 | #include "bio.h" |
26 | | | 26 | |
27 | #include <sys/param.h> | | 27 | #include <sys/param.h> |
28 | #include <sys/systm.h> | | 28 | #include <sys/systm.h> |
29 | #include <sys/buf.h> | | 29 | #include <sys/buf.h> |
30 | #include <sys/device.h> | | 30 | #include <sys/device.h> |
31 | #include <sys/ioctl.h> | | 31 | #include <sys/ioctl.h> |
32 | #include <sys/malloc.h> | | 32 | #include <sys/malloc.h> |
33 | #include <sys/kernel.h> | | 33 | #include <sys/kernel.h> |
34 | #include <sys/mutex.h> | | 34 | #include <sys/mutex.h> |
35 | #include <sys/condvar.h> | | 35 | #include <sys/condvar.h> |
36 | #include <sys/dkio.h> | | 36 | #include <sys/dkio.h> |
| @@ -2286,27 +2286,27 @@ mpii_attach(device_t parent, device_t se | | | @@ -2286,27 +2286,27 @@ mpii_attach(device_t parent, device_t se |
2286 | memset(adapt, 0, sizeof(*adapt)); | | 2286 | memset(adapt, 0, sizeof(*adapt)); |
2287 | adapt->adapt_dev = sc->sc_dev; | | 2287 | adapt->adapt_dev = sc->sc_dev; |
2288 | adapt->adapt_nchannels = 1; | | 2288 | adapt->adapt_nchannels = 1; |
2289 | adapt->adapt_openings = sc->sc_request_depth - 1; | | 2289 | adapt->adapt_openings = sc->sc_request_depth - 1; |
2290 | adapt->adapt_max_periph = adapt->adapt_openings; | | 2290 | adapt->adapt_max_periph = adapt->adapt_openings; |
2291 | adapt->adapt_request = mpii_scsipi_request; | | 2291 | adapt->adapt_request = mpii_scsipi_request; |
2292 | adapt->adapt_minphys = mpii_minphys; | | 2292 | adapt->adapt_minphys = mpii_minphys; |
2293 | | | 2293 | |
2294 | memset(chan, 0, sizeof(*chan)); | | 2294 | memset(chan, 0, sizeof(*chan)); |
2295 | chan->chan_adapter = adapt; | | 2295 | chan->chan_adapter = adapt; |
2296 | chan->chan_bustype = &scsi_sas_bustype; | | 2296 | chan->chan_bustype = &scsi_sas_bustype; |
2297 | chan->chan_channel = 0; | | 2297 | chan->chan_channel = 0; |
2298 | chan->chan_flags = 0; | | 2298 | chan->chan_flags = 0; |
2299 | chan->chan_nluns = 1; | | 2299 | chan->chan_nluns = 8; |
2300 | chan->chan_ntargets = sc->sc_max_devices; | | 2300 | chan->chan_ntargets = sc->sc_max_devices; |
2301 | chan->chan_id = -1; | | 2301 | chan->chan_id = -1; |
2302 | | | 2302 | |
2303 | mpii_rescan(self, "scsi", NULL); | | 2303 | mpii_rescan(self, "scsi", NULL); |
2304 | | | 2304 | |
2305 | /* enable interrupts */ | | 2305 | /* enable interrupts */ |
2306 | mpii_write(sc, MPII_INTR_MASK, MPII_INTR_MASK_DOORBELL | | 2306 | mpii_write(sc, MPII_INTR_MASK, MPII_INTR_MASK_DOORBELL |
2307 | | MPII_INTR_MASK_RESET); | | 2307 | | MPII_INTR_MASK_RESET); |
2308 | | | 2308 | |
2309 | #if NBIO > 0 | | 2309 | #if NBIO > 0 |
2310 | if (ISSET(sc->sc_flags, MPII_F_RAID)) { | | 2310 | if (ISSET(sc->sc_flags, MPII_F_RAID)) { |
2311 | if (bio_register(sc->sc_dev, mpii_ioctl) != 0) | | 2311 | if (bio_register(sc->sc_dev, mpii_ioctl) != 0) |
2312 | panic("%s: controller registration failed", | | 2312 | panic("%s: controller registration failed", |