Add some code for the SKINNY variant to make Dell PERC H310 work.diff -r1.68 -r1.69 src/sys/dev/ic/mfi.c
(msaitoh)
--- src/sys/dev/ic/mfi.c 2022/04/16 18:15:21 1.68
+++ src/sys/dev/ic/mfi.c 2022/05/05 07:18:02 1.69
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: mfi.c,v 1.68 2022/04/16 18:15:21 andvar Exp $ */ | 1 | /* $NetBSD: mfi.c,v 1.69 2022/05/05 07:18:02 msaitoh Exp $ */ | |
2 | /* $OpenBSD: mfi.c,v 1.66 2006/11/28 23:59:45 dlg Exp $ */ | 2 | /* $OpenBSD: mfi.c,v 1.66 2006/11/28 23:59:45 dlg Exp $ */ | |
3 | 3 | |||
4 | /* | 4 | /* | |
5 | * Copyright (c) 2012 Manuel Bouyer. | 5 | * Copyright (c) 2012 Manuel Bouyer. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -63,27 +63,27 @@ | @@ -63,27 +63,27 @@ | |||
63 | * EXEMPLARY,OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 63 | * EXEMPLARY,OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
64 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 64 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | |
65 | * PROFITS; OR BUSINESS INTERRUPTION)HOWEVER CAUSED AND ON ANY THEORY | 65 | * PROFITS; OR BUSINESS INTERRUPTION)HOWEVER CAUSED AND ON ANY THEORY | |
66 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | 66 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | |
67 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 67 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | |
68 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 68 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
69 | * | 69 | * | |
70 | * The views and conclusions contained in the software and documentation | 70 | * The views and conclusions contained in the software and documentation | |
71 | * are those of the authors and should not be interpreted as representing | 71 | * are those of the authors and should not be interpreted as representing | |
72 | * official policies,either expressed or implied, of the FreeBSD Project. | 72 | * official policies,either expressed or implied, of the FreeBSD Project. | |
73 | */ | 73 | */ | |
74 | 74 | |||
75 | #include <sys/cdefs.h> | 75 | #include <sys/cdefs.h> | |
76 | __KERNEL_RCSID(0, "$NetBSD: mfi.c,v 1.68 2022/04/16 18:15:21 andvar Exp $"); | 76 | __KERNEL_RCSID(0, "$NetBSD: mfi.c,v 1.69 2022/05/05 07:18:02 msaitoh Exp $"); | |
77 | 77 | |||
78 | #include "bio.h" | 78 | #include "bio.h" | |
79 | 79 | |||
80 | #include <sys/param.h> | 80 | #include <sys/param.h> | |
81 | #include <sys/systm.h> | 81 | #include <sys/systm.h> | |
82 | #include <sys/buf.h> | 82 | #include <sys/buf.h> | |
83 | #include <sys/ioctl.h> | 83 | #include <sys/ioctl.h> | |
84 | #include <sys/device.h> | 84 | #include <sys/device.h> | |
85 | #include <sys/kernel.h> | 85 | #include <sys/kernel.h> | |
86 | #include <sys/malloc.h> | 86 | #include <sys/malloc.h> | |
87 | #include <sys/proc.h> | 87 | #include <sys/proc.h> | |
88 | #include <sys/cpu.h> | 88 | #include <sys/cpu.h> | |
89 | #include <sys/conf.h> | 89 | #include <sys/conf.h> | |
@@ -572,27 +572,27 @@ mfi_transition_firmware(struct mfi_softc | @@ -572,27 +572,27 @@ mfi_transition_firmware(struct mfi_softc | |||
572 | aprint_error_dev(sc->sc_dev, "firmware fault\n"); | 572 | aprint_error_dev(sc->sc_dev, "firmware fault\n"); | |
573 | return 1; | 573 | return 1; | |
574 | case MFI_STATE_WAIT_HANDSHAKE: | 574 | case MFI_STATE_WAIT_HANDSHAKE: | |
575 | if (sc->sc_ioptype == MFI_IOP_SKINNY || | 575 | if (sc->sc_ioptype == MFI_IOP_SKINNY || | |
576 | sc->sc_ioptype == MFI_IOP_TBOLT) | 576 | sc->sc_ioptype == MFI_IOP_TBOLT) | |
577 | mfi_write(sc, MFI_SKINNY_IDB, MFI_INIT_CLEAR_HANDSHAKE); | 577 | mfi_write(sc, MFI_SKINNY_IDB, MFI_INIT_CLEAR_HANDSHAKE); | |
578 | else | 578 | else | |
579 | mfi_write(sc, MFI_IDB, MFI_INIT_CLEAR_HANDSHAKE); | 579 | mfi_write(sc, MFI_IDB, MFI_INIT_CLEAR_HANDSHAKE); | |
580 | max_wait = 2; | 580 | max_wait = 2; | |
581 | break; | 581 | break; | |
582 | case MFI_STATE_OPERATIONAL: | 582 | case MFI_STATE_OPERATIONAL: | |
583 | if (sc->sc_ioptype == MFI_IOP_SKINNY || | 583 | if (sc->sc_ioptype == MFI_IOP_SKINNY || | |
584 | sc->sc_ioptype == MFI_IOP_TBOLT) | 584 | sc->sc_ioptype == MFI_IOP_TBOLT) | |
585 | mfi_write(sc, MFI_SKINNY_IDB, MFI_INIT_READY); | 585 | mfi_write(sc, MFI_SKINNY_IDB, MFI_RESET_FLAGS); | |
586 | else | 586 | else | |
587 | mfi_write(sc, MFI_IDB, MFI_INIT_READY); | 587 | mfi_write(sc, MFI_IDB, MFI_INIT_READY); | |
588 | max_wait = 10; | 588 | max_wait = 10; | |
589 | break; | 589 | break; | |
590 | case MFI_STATE_UNDEFINED: | 590 | case MFI_STATE_UNDEFINED: | |
591 | case MFI_STATE_BB_INIT: | 591 | case MFI_STATE_BB_INIT: | |
592 | max_wait = 2; | 592 | max_wait = 2; | |
593 | break; | 593 | break; | |
594 | case MFI_STATE_FW_INIT: | 594 | case MFI_STATE_FW_INIT: | |
595 | case MFI_STATE_DEVICE_SCAN: | 595 | case MFI_STATE_DEVICE_SCAN: | |
596 | case MFI_STATE_FLUSH_CACHE: | 596 | case MFI_STATE_FLUSH_CACHE: | |
597 | max_wait = 20; | 597 | max_wait = 20; | |
598 | break; | 598 | break; | |
@@ -1049,26 +1049,28 @@ mfi_attach(struct mfi_softc *sc, enum mf | @@ -1049,26 +1049,28 @@ mfi_attach(struct mfi_softc *sc, enum mf | |||
1049 | status = mfi_fw_state(sc); | 1049 | status = mfi_fw_state(sc); | |
1050 | sc->sc_max_cmds = status & MFI_STATE_MAXCMD_MASK; | 1050 | sc->sc_max_cmds = status & MFI_STATE_MAXCMD_MASK; | |
1051 | max_sgl = (status & MFI_STATE_MAXSGL_MASK) >> 16; | 1051 | max_sgl = (status & MFI_STATE_MAXSGL_MASK) >> 16; | |
1052 | if (sc->sc_ioptype == MFI_IOP_TBOLT) { | 1052 | if (sc->sc_ioptype == MFI_IOP_TBOLT) { | |
1053 | sc->sc_max_sgl = uimin(max_sgl, (128 * 1024) / PAGE_SIZE + 1); | 1053 | sc->sc_max_sgl = uimin(max_sgl, (128 * 1024) / PAGE_SIZE + 1); | |
1054 | sc->sc_sgl_size = sizeof(struct mfi_sg_ieee); | 1054 | sc->sc_sgl_size = sizeof(struct mfi_sg_ieee); | |
1055 | } else if (sc->sc_64bit_dma) { | 1055 | } else if (sc->sc_64bit_dma) { | |
1056 | sc->sc_max_sgl = uimin(max_sgl, (128 * 1024) / PAGE_SIZE + 1); | 1056 | sc->sc_max_sgl = uimin(max_sgl, (128 * 1024) / PAGE_SIZE + 1); | |
1057 | sc->sc_sgl_size = sizeof(struct mfi_sg64); | 1057 | sc->sc_sgl_size = sizeof(struct mfi_sg64); | |
1058 | } else { | 1058 | } else { | |
1059 | sc->sc_max_sgl = max_sgl; | 1059 | sc->sc_max_sgl = max_sgl; | |
1060 | sc->sc_sgl_size = sizeof(struct mfi_sg32); | 1060 | sc->sc_sgl_size = sizeof(struct mfi_sg32); | |
1061 | } | 1061 | } | |
1062 | if (sc->sc_ioptype == MFI_IOP_SKINNY) | |||
1063 | sc->sc_sgl_size = sizeof(struct mfi_sg_ieee); | |||
1062 | DNPRINTF(MFI_D_MISC, "%s: max commands: %u, max sgl: %u\n", | 1064 | DNPRINTF(MFI_D_MISC, "%s: max commands: %u, max sgl: %u\n", | |
1063 | DEVNAME(sc), sc->sc_max_cmds, sc->sc_max_sgl); | 1065 | DEVNAME(sc), sc->sc_max_cmds, sc->sc_max_sgl); | |
1064 | 1066 | |||
1065 | if (sc->sc_ioptype == MFI_IOP_TBOLT) { | 1067 | if (sc->sc_ioptype == MFI_IOP_TBOLT) { | |
1066 | uint32_t tb_mem_size; | 1068 | uint32_t tb_mem_size; | |
1067 | /* for Alignment */ | 1069 | /* for Alignment */ | |
1068 | tb_mem_size = MEGASAS_THUNDERBOLT_MSG_ALIGNMENT; | 1070 | tb_mem_size = MEGASAS_THUNDERBOLT_MSG_ALIGNMENT; | |
1069 | 1071 | |||
1070 | tb_mem_size += | 1072 | tb_mem_size += | |
1071 | MEGASAS_THUNDERBOLT_NEW_MSG_SIZE * (sc->sc_max_cmds + 1); | 1073 | MEGASAS_THUNDERBOLT_NEW_MSG_SIZE * (sc->sc_max_cmds + 1); | |
1072 | sc->sc_reply_pool_size = | 1074 | sc->sc_reply_pool_size = | |
1073 | ((sc->sc_max_cmds + 1 + 15) / 16) * 16; | 1075 | ((sc->sc_max_cmds + 1 + 15) / 16) * 16; | |
1074 | tb_mem_size += | 1076 | tb_mem_size += | |
@@ -1769,27 +1771,28 @@ mfi_create_sgl(struct mfi_ccb *ccb, int | @@ -1769,27 +1771,28 @@ mfi_create_sgl(struct mfi_ccb *ccb, int | |||
1769 | aprint_error_dev(sc->sc_dev, "more than %d dma segs\n", | 1771 | aprint_error_dev(sc->sc_dev, "more than %d dma segs\n", | |
1770 | sc->sc_max_sgl); | 1772 | sc->sc_max_sgl); | |
1771 | } else { | 1773 | } else { | |
1772 | aprint_error_dev(sc->sc_dev, | 1774 | aprint_error_dev(sc->sc_dev, | |
1773 | "error %d loading dma map\n", error); | 1775 | "error %d loading dma map\n", error); | |
1774 | } | 1776 | } | |
1775 | return 1; | 1777 | return 1; | |
1776 | } | 1778 | } | |
1777 | 1779 | |||
1778 | hdr = &ccb->ccb_frame->mfr_header; | 1780 | hdr = &ccb->ccb_frame->mfr_header; | |
1779 | sgl = ccb->ccb_sgl; | 1781 | sgl = ccb->ccb_sgl; | |
1780 | sgd = ccb->ccb_dmamap->dm_segs; | 1782 | sgd = ccb->ccb_dmamap->dm_segs; | |
1781 | for (i = 0; i < ccb->ccb_dmamap->dm_nsegs; i++) { | 1783 | for (i = 0; i < ccb->ccb_dmamap->dm_nsegs; i++) { | |
1782 | if (sc->sc_ioptype == MFI_IOP_TBOLT && | 1784 | if (((sc->sc_ioptype == MFI_IOP_SKINNY) || | |
1785 | (sc->sc_ioptype == MFI_IOP_TBOLT)) && | |||
1783 | (hdr->mfh_cmd == MFI_CMD_PD_SCSI_IO || | 1786 | (hdr->mfh_cmd == MFI_CMD_PD_SCSI_IO || | |
1784 | hdr->mfh_cmd == MFI_CMD_LD_READ || | 1787 | hdr->mfh_cmd == MFI_CMD_LD_READ || | |
1785 | hdr->mfh_cmd == MFI_CMD_LD_WRITE)) { | 1788 | hdr->mfh_cmd == MFI_CMD_LD_WRITE)) { | |
1786 | sgl->sg_ieee[i].addr = htole64(sgd[i].ds_addr); | 1789 | sgl->sg_ieee[i].addr = htole64(sgd[i].ds_addr); | |
1787 | sgl->sg_ieee[i].len = htole32(sgd[i].ds_len); | 1790 | sgl->sg_ieee[i].len = htole32(sgd[i].ds_len); | |
1788 | sgl->sg_ieee[i].flags = 0; | 1791 | sgl->sg_ieee[i].flags = 0; | |
1789 | DNPRINTF(MFI_D_DMA, "%s: addr: %#" PRIx64 " len: %#" | 1792 | DNPRINTF(MFI_D_DMA, "%s: addr: %#" PRIx64 " len: %#" | |
1790 | PRIx32 "\n", | 1793 | PRIx32 "\n", | |
1791 | DEVNAME(sc), sgl->sg64[i].addr, sgl->sg64[i].len); | 1794 | DEVNAME(sc), sgl->sg64[i].addr, sgl->sg64[i].len); | |
1792 | hdr->mfh_flags |= MFI_FRAME_IEEE_SGL | MFI_FRAME_SGL64; | 1795 | hdr->mfh_flags |= MFI_FRAME_IEEE_SGL | MFI_FRAME_SGL64; | |
1793 | } else if (sc->sc_64bit_dma) { | 1796 | } else if (sc->sc_64bit_dma) { | |
1794 | sgl->sg64[i].addr = htole64(sgd[i].ds_addr); | 1797 | sgl->sg64[i].addr = htole64(sgd[i].ds_addr); | |
1795 | sgl->sg64[i].len = htole32(sgd[i].ds_len); | 1798 | sgl->sg64[i].len = htole32(sgd[i].ds_len); |
--- src/sys/dev/ic/mfireg.h 2022/03/23 11:08:27 1.14
+++ src/sys/dev/ic/mfireg.h 2022/05/05 07:18:02 1.15
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: mfireg.h,v 1.14 2022/03/23 11:08:27 andvar Exp $ */ | 1 | /* $NetBSD: mfireg.h,v 1.15 2022/05/05 07:18:02 msaitoh Exp $ */ | |
2 | /* $OpenBSD: mfireg.h,v 1.24 2006/06/19 19:05:45 marco Exp $ */ | 2 | /* $OpenBSD: mfireg.h,v 1.24 2006/06/19 19:05:45 marco Exp $ */ | |
3 | /* | 3 | /* | |
4 | * Copyright (c) 2006 Marco Peereboom <marco@peereboom.us> | 4 | * Copyright (c) 2006 Marco Peereboom <marco@peereboom.us> | |
5 | * | 5 | * | |
6 | * Permission to use, copy, modify, and distribute this software for any | 6 | * Permission to use, copy, modify, and distribute this software for any | |
7 | * purpose with or without fee is hereby granted, provided that the above | 7 | * purpose with or without fee is hereby granted, provided that the above | |
8 | * copyright notice and this permission notice appear in all copies. | 8 | * copyright notice and this permission notice appear in all copies. | |
9 | * | 9 | * | |
10 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | 10 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
11 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | 11 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
12 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | 12 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
13 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | 13 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
14 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 14 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
@@ -115,31 +115,32 @@ | @@ -115,31 +115,32 @@ | |||
115 | #define MFI_STATE_MAXCMD_MASK 0x0000ffff | 115 | #define MFI_STATE_MAXCMD_MASK 0x0000ffff | |
116 | #define MFI_STATE_HOSTMEMREQD_MASK 0x08000000 | 116 | #define MFI_STATE_HOSTMEMREQD_MASK 0x08000000 | |
117 | #define MFI_STATE_BOOT_MESSAGE_PENDING 0x90000000 | 117 | #define MFI_STATE_BOOT_MESSAGE_PENDING 0x90000000 | |
118 | #define MFI_RESET_REQUIRED 0x00000001 | 118 | #define MFI_RESET_REQUIRED 0x00000001 | |
119 | 119 | |||
120 | /* ThunderBolt Support */ | 120 | /* ThunderBolt Support */ | |
121 | #define MFI_STATE_TB_MASK 0xf0000000 | 121 | #define MFI_STATE_TB_MASK 0xf0000000 | |
122 | #define MFI_STATE_TB_RESET 0x00000000 | 122 | #define MFI_STATE_TB_RESET 0x00000000 | |
123 | #define MFI_STATE_TB_READY 0x10000000 | 123 | #define MFI_STATE_TB_READY 0x10000000 | |
124 | #define MFI_STATE_TB_OPERATIONAL 0x20000000 | 124 | #define MFI_STATE_TB_OPERATIONAL 0x20000000 | |
125 | #define MFI_STATE_TB_FAULT 0x40000000 | 125 | #define MFI_STATE_TB_FAULT 0x40000000 | |
126 | 126 | |||
127 | /* command reset register */ | 127 | /* command reset register */ | |
128 | #define MFI_INIT_ABORT 0x00000000 | 128 | #define MFI_INIT_ABORT 0x00000001 | |
129 | #define MFI_INIT_READY 0x00000002 | 129 | #define MFI_INIT_READY 0x00000002 | |
130 | #define MFI_INIT_MFIMODE 0x00000004 | 130 | #define MFI_INIT_MFIMODE 0x00000004 | |
131 | #define MFI_INIT_CLEAR_HANDSHAKE 0x00000008 | 131 | #define MFI_INIT_CLEAR_HANDSHAKE 0x00000008 | |
132 | #define MFI_RESET_FLAGS MFI_INIT_READY|MFI_INIT_MFIMODE | 132 | #define MFI_RESET_FLAGS MFI_INIT_READY | MFI_INIT_MFIMODE | \ | |
133 | MFI_INIT_ABORT | |||
133 | #define MFI_INIT_HOTPLUG 0x00000010 | 134 | #define MFI_INIT_HOTPLUG 0x00000010 | |
134 | 135 | |||
135 | /* ADP reset flags */ | 136 | /* ADP reset flags */ | |
136 | #define MFI_STOP_ADP 0x00000020 | 137 | #define MFI_STOP_ADP 0x00000020 | |
137 | #define MFI_ADP_RESET 0x00000040 | 138 | #define MFI_ADP_RESET 0x00000040 | |
138 | #define DIAG_WRITE_ENABLE 0x00000080 | 139 | #define DIAG_WRITE_ENABLE 0x00000080 | |
139 | #define DIAG_RESET_ADAPTER 0x00000004 | 140 | #define DIAG_RESET_ADAPTER 0x00000004 | |
140 | 141 | |||
141 | /* mfi Frame flags */ | 142 | /* mfi Frame flags */ | |
142 | #define MFI_FRAME_POST_IN_REPLY_QUEUE 0x0000 | 143 | #define MFI_FRAME_POST_IN_REPLY_QUEUE 0x0000 | |
143 | #define MFI_FRAME_DONT_POST_IN_REPLY_QUEUE 0x0001 | 144 | #define MFI_FRAME_DONT_POST_IN_REPLY_QUEUE 0x0001 | |
144 | #define MFI_FRAME_SGL32 0x0000 | 145 | #define MFI_FRAME_SGL32 0x0000 | |
145 | #define MFI_FRAME_SGL64 0x0002 | 146 | #define MFI_FRAME_SGL64 0x0002 |
--- src/sys/dev/pci/mfi_pci.c 2018/12/09 11:14:02 1.20
+++ src/sys/dev/pci/mfi_pci.c 2022/05/05 07:18:03 1.21
@@ -1,33 +1,33 @@ | @@ -1,33 +1,33 @@ | |||
1 | /* $NetBSD: mfi_pci.c,v 1.20 2018/12/09 11:14:02 jdolecek Exp $ */ | 1 | /* $NetBSD: mfi_pci.c,v 1.21 2022/05/05 07:18:03 msaitoh Exp $ */ | |
2 | /* $OpenBSD: mfi_pci.c,v 1.11 2006/08/06 04:40:08 brad Exp $ */ | 2 | /* $OpenBSD: mfi_pci.c,v 1.11 2006/08/06 04:40:08 brad Exp $ */ | |
3 | /* | 3 | /* | |
4 | * Copyright (c) 2006 Marco Peereboom <marco@peereboom.us> | 4 | * Copyright (c) 2006 Marco Peereboom <marco@peereboom.us> | |
5 | * | 5 | * | |
6 | * Permission to use, copy, modify, and distribute this software for any | 6 | * Permission to use, copy, modify, and distribute this software for any | |
7 | * purpose with or without fee is hereby granted, provided that the above | 7 | * purpose with or without fee is hereby granted, provided that the above | |
8 | * copyright notice and this permission notice appear in all copies. | 8 | * copyright notice and this permission notice appear in all copies. | |
9 | * | 9 | * | |
10 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | 10 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
11 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | 11 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
12 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | 12 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
13 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | 13 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
14 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 14 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
15 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 15 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
16 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 16 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
17 | */ | 17 | */ | |
18 | 18 | |||
19 | #include <sys/cdefs.h> | 19 | #include <sys/cdefs.h> | |
20 | __KERNEL_RCSID(0, "$NetBSD: mfi_pci.c,v 1.20 2018/12/09 11:14:02 jdolecek Exp $"); | 20 | __KERNEL_RCSID(0, "$NetBSD: mfi_pci.c,v 1.21 2022/05/05 07:18:03 msaitoh Exp $"); | |
21 | 21 | |||
22 | #include <sys/param.h> | 22 | #include <sys/param.h> | |
23 | #include <sys/systm.h> | 23 | #include <sys/systm.h> | |
24 | #include <sys/kernel.h> | 24 | #include <sys/kernel.h> | |
25 | #include <sys/malloc.h> | 25 | #include <sys/malloc.h> | |
26 | #include <sys/device.h> | 26 | #include <sys/device.h> | |
27 | 27 | |||
28 | #include <dev/pci/pcidevs.h> | 28 | #include <dev/pci/pcidevs.h> | |
29 | #include <dev/pci/pcivar.h> | 29 | #include <dev/pci/pcivar.h> | |
30 | 30 | |||
31 | #include <sys/bus.h> | 31 | #include <sys/bus.h> | |
32 | 32 | |||
33 | #include <dev/scsipi/scsipi_all.h> | 33 | #include <dev/scsipi/scsipi_all.h> | |
@@ -89,26 +89,27 @@ static const struct mfi_pci_subtype mfi_ | @@ -89,26 +89,27 @@ static const struct mfi_pci_subtype mfi_ | |||
89 | { PCI_VENDOR_IBM, 0x03c7, "IBM ServeRAID M5014 SAS/SATA" }, | 89 | { PCI_VENDOR_IBM, 0x03c7, "IBM ServeRAID M5014 SAS/SATA" }, | |
90 | { PCI_VENDOR_DELL, 0x1f15, "Dell PERC H800 Adapter" }, | 90 | { PCI_VENDOR_DELL, 0x1f15, "Dell PERC H800 Adapter" }, | |
91 | { PCI_VENDOR_DELL, 0x1f16, "Dell PERC H700 Adapter" }, | 91 | { PCI_VENDOR_DELL, 0x1f16, "Dell PERC H700 Adapter" }, | |
92 | { PCI_VENDOR_DELL, 0x1f17, "Dell PERC H700 Integrated" }, | 92 | { PCI_VENDOR_DELL, 0x1f17, "Dell PERC H700 Integrated" }, | |
93 | { PCI_VENDOR_DELL, 0x1f18, "Dell PERC H700 Modular" }, | 93 | { PCI_VENDOR_DELL, 0x1f18, "Dell PERC H700 Modular" }, | |
94 | { PCI_VENDOR_DELL, 0x1f19, "Dell PERC H700" }, | 94 | { PCI_VENDOR_DELL, 0x1f19, "Dell PERC H700" }, | |
95 | { PCI_VENDOR_DELL, 0x1f1a, "Dell PERC H800 Proto Adapter" }, | 95 | { PCI_VENDOR_DELL, 0x1f1a, "Dell PERC H800 Proto Adapter" }, | |
96 | { PCI_VENDOR_DELL, 0x1f1b, "Dell PERC H800" }, | 96 | { PCI_VENDOR_DELL, 0x1f1b, "Dell PERC H800" }, | |
97 | { 0x0, 0, "" } | 97 | { 0x0, 0, "" } | |
98 | }; | 98 | }; | |
99 | 99 | |||
100 | static const struct mfi_pci_subtype mfi_skinny_subtypes[] = { | 100 | static const struct mfi_pci_subtype mfi_skinny_subtypes[] = { | |
101 | { PCI_VENDOR_IBM, 0x03b1, "IBM ServeRAID M1015 SAS/SATA" }, | 101 | { PCI_VENDOR_IBM, 0x03b1, "IBM ServeRAID M1015 SAS/SATA" }, | |
102 | { PCI_VENDOR_DELL, 0x1f78, "Dell PERC H310" }, | |||
102 | { 0x0, 0, "" } | 103 | { 0x0, 0, "" } | |
103 | }; | 104 | }; | |
104 | 105 | |||
105 | static const struct mfi_pci_subtype mfi_tbolt_subtypes[] = { | 106 | static const struct mfi_pci_subtype mfi_tbolt_subtypes[] = { | |
106 | { PCI_VENDOR_SYMBIOS, 0x9265, "SAS 9265-8i" }, | 107 | { PCI_VENDOR_SYMBIOS, 0x9265, "SAS 9265-8i" }, | |
107 | { PCI_VENDOR_DELL, 0x1f2d, "Dell PERC H810 Adapter" }, | 108 | { PCI_VENDOR_DELL, 0x1f2d, "Dell PERC H810 Adapter" }, | |
108 | { PCI_VENDOR_DELL, 0x1f30, "Dell PERC H710 Embedded" }, | 109 | { PCI_VENDOR_DELL, 0x1f30, "Dell PERC H710 Embedded" }, | |
109 | { PCI_VENDOR_DELL, 0x1f31, "Dell PERC H710P Adapter" }, | 110 | { PCI_VENDOR_DELL, 0x1f31, "Dell PERC H710P Adapter" }, | |
110 | { PCI_VENDOR_DELL, 0x1f33, "Dell PERC H710P Mini (blades)" }, | 111 | { PCI_VENDOR_DELL, 0x1f33, "Dell PERC H710P Mini (blades)" }, | |
111 | { PCI_VENDOR_DELL, 0x1f34, "Dell PERC H710P Mini (blades)" }, | 112 | { PCI_VENDOR_DELL, 0x1f34, "Dell PERC H710P Mini (blades)" }, | |
112 | { PCI_VENDOR_DELL, 0x1f35, "Dell PERC H710 Adapter" }, | 113 | { PCI_VENDOR_DELL, 0x1f35, "Dell PERC H710 Adapter" }, | |
113 | { PCI_VENDOR_DELL, 0x1f37, "Dell PERC H710 Mini (blades)" }, | 114 | { PCI_VENDOR_DELL, 0x1f37, "Dell PERC H710 Mini (blades)" }, | |
114 | { PCI_VENDOR_DELL, 0x1f38, "Dell PERC H710 Mini (monolithics)" }, | 115 | { PCI_VENDOR_DELL, 0x1f38, "Dell PERC H710 Mini (monolithics)" }, |