| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: twe.c,v 1.108.10.2 2021/03/22 16:23:46 thorpej Exp $ */ | | 1 | /* $NetBSD: twe.c,v 1.108.10.3 2021/03/28 20:38:04 thorpej Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2000, 2001, 2002, 2003, 2004 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2000, 2001, 2002, 2003, 2004 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Andrew Doran; and by Jason R. Thorpe of Wasabi Systems, Inc. | | 8 | * by Andrew Doran; and by Jason R. Thorpe of Wasabi Systems, Inc. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -53,27 +53,27 @@ | | | @@ -53,27 +53,27 @@ |
53 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 53 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
54 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 54 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
55 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 55 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
56 | * SUCH DAMAGE. | | 56 | * SUCH DAMAGE. |
57 | * | | 57 | * |
58 | * from FreeBSD: twe.c,v 1.1 2000/05/24 23:35:23 msmith Exp | | 58 | * from FreeBSD: twe.c,v 1.1 2000/05/24 23:35:23 msmith Exp |
59 | */ | | 59 | */ |
60 | | | 60 | |
61 | /* | | 61 | /* |
62 | * Driver for the 3ware Escalade family of RAID controllers. | | 62 | * Driver for the 3ware Escalade family of RAID controllers. |
63 | */ | | 63 | */ |
64 | | | 64 | |
65 | #include <sys/cdefs.h> | | 65 | #include <sys/cdefs.h> |
66 | __KERNEL_RCSID(0, "$NetBSD: twe.c,v 1.108.10.2 2021/03/22 16:23:46 thorpej Exp $"); | | 66 | __KERNEL_RCSID(0, "$NetBSD: twe.c,v 1.108.10.3 2021/03/28 20:38:04 thorpej Exp $"); |
67 | | | 67 | |
68 | #include <sys/param.h> | | 68 | #include <sys/param.h> |
69 | #include <sys/systm.h> | | 69 | #include <sys/systm.h> |
70 | #include <sys/kernel.h> | | 70 | #include <sys/kernel.h> |
71 | #include <sys/device.h> | | 71 | #include <sys/device.h> |
72 | #include <sys/queue.h> | | 72 | #include <sys/queue.h> |
73 | #include <sys/proc.h> | | 73 | #include <sys/proc.h> |
74 | #include <sys/buf.h> | | 74 | #include <sys/buf.h> |
75 | #include <sys/endian.h> | | 75 | #include <sys/endian.h> |
76 | #include <sys/malloc.h> | | 76 | #include <sys/malloc.h> |
77 | #include <sys/conf.h> | | 77 | #include <sys/conf.h> |
78 | #include <sys/disk.h> | | 78 | #include <sys/disk.h> |
79 | #include <sys/sysctl.h> | | 79 | #include <sys/sysctl.h> |
| @@ -441,27 +441,27 @@ twe_attach(device_t parent, device_t sel | | | @@ -441,27 +441,27 @@ twe_attach(device_t parent, device_t sel |
441 | rv = twe_reset(sc); | | 441 | rv = twe_reset(sc); |
442 | splx(s); | | 442 | splx(s); |
443 | if (rv) { | | 443 | if (rv) { |
444 | aprint_error_dev(self, "reset failed\n"); | | 444 | aprint_error_dev(self, "reset failed\n"); |
445 | return; | | 445 | return; |
446 | } | | 446 | } |
447 | | | 447 | |
448 | /* Initialise connection with controller. */ | | 448 | /* Initialise connection with controller. */ |
449 | twe_init_connection(sc); | | 449 | twe_init_connection(sc); |
450 | | | 450 | |
451 | twe_describe_controller(sc); | | 451 | twe_describe_controller(sc); |
452 | | | 452 | |
453 | /* Find and attach RAID array units. */ | | 453 | /* Find and attach RAID array units. */ |
454 | twe_rescan(self, "twe", 0); | | 454 | twe_rescan(self, NULL, NULL); |
455 | | | 455 | |
456 | /* ...and finally, enable interrupts. */ | | 456 | /* ...and finally, enable interrupts. */ |
457 | twe_outl(sc, TWE_REG_CTL, TWE_CTL_CLEAR_ATTN_INTR | | | 457 | twe_outl(sc, TWE_REG_CTL, TWE_CTL_CLEAR_ATTN_INTR | |
458 | TWE_CTL_UNMASK_RESP_INTR | | | 458 | TWE_CTL_UNMASK_RESP_INTR | |
459 | TWE_CTL_ENABLE_INTRS); | | 459 | TWE_CTL_ENABLE_INTRS); |
460 | | | 460 | |
461 | /* sysctl set-up for 3ware cli */ | | 461 | /* sysctl set-up for 3ware cli */ |
462 | if (sysctl_createv(NULL, 0, NULL, &node, | | 462 | if (sysctl_createv(NULL, 0, NULL, &node, |
463 | 0, CTLTYPE_NODE, device_xname(self), | | 463 | 0, CTLTYPE_NODE, device_xname(self), |
464 | SYSCTL_DESCR("twe driver information"), | | 464 | SYSCTL_DESCR("twe driver information"), |
465 | NULL, 0, NULL, 0, | | 465 | NULL, 0, NULL, 0, |
466 | CTL_HW, CTL_CREATE, CTL_EOL) != 0) { | | 466 | CTL_HW, CTL_CREATE, CTL_EOL) != 0) { |
467 | aprint_error_dev(self, "could not create %s.%s sysctl node\n", | | 467 | aprint_error_dev(self, "could not create %s.%s sysctl node\n", |
| @@ -472,27 +472,27 @@ twe_attach(device_t parent, device_t sel | | | @@ -472,27 +472,27 @@ twe_attach(device_t parent, device_t sel |
472 | 0, CTLTYPE_STRING, "driver_version", | | 472 | 0, CTLTYPE_STRING, "driver_version", |
473 | SYSCTL_DESCR("twe0 driver version"), | | 473 | SYSCTL_DESCR("twe0 driver version"), |
474 | NULL, 0, __UNCONST(&twever), 0, | | 474 | NULL, 0, __UNCONST(&twever), 0, |
475 | CTL_HW, node->sysctl_num, CTL_CREATE, CTL_EOL)) | | 475 | CTL_HW, node->sysctl_num, CTL_CREATE, CTL_EOL)) |
476 | != 0) { | | 476 | != 0) { |
477 | aprint_error_dev(self, | | 477 | aprint_error_dev(self, |
478 | "could not create %s.%s.driver_version sysctl\n", | | 478 | "could not create %s.%s.driver_version sysctl\n", |
479 | "hw", device_xname(self)); | | 479 | "hw", device_xname(self)); |
480 | return; | | 480 | return; |
481 | } | | 481 | } |
482 | } | | 482 | } |
483 | | | 483 | |
484 | static int | | 484 | static int |
485 | twe_rescan(device_t self, const char *attr, const int *flags) | | 485 | twe_rescan(device_t self, const char *ifattr, const int *locs) |
486 | { | | 486 | { |
487 | struct twe_softc *sc; | | 487 | struct twe_softc *sc; |
488 | int i; | | 488 | int i; |
489 | | | 489 | |
490 | sc = device_private(self); | | 490 | sc = device_private(self); |
491 | sc->sc_nunits = 0; | | 491 | sc->sc_nunits = 0; |
492 | for (i = 0; i < TWE_MAX_UNITS; i++) | | 492 | for (i = 0; i < TWE_MAX_UNITS; i++) |
493 | (void) twe_add_unit(sc, i); | | 493 | (void) twe_add_unit(sc, i); |
494 | return 0; | | 494 | return 0; |
495 | } | | 495 | } |
496 | | | 496 | |
497 | | | 497 | |
498 | void | | 498 | void |