Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev Add some code for the SKINNY variant to make Dell PE...



details:   https://anonhg.NetBSD.org/src/rev/7f82c2986008
branches:  trunk
changeset: 365953:7f82c2986008
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu May 05 07:18:02 2022 +0000

description:
Add some code for the SKINNY variant to make Dell PERC H310 work.

diffstat:

 sys/dev/ic/mfi.c      |  11 +++++++----
 sys/dev/ic/mfireg.h   |   7 ++++---
 sys/dev/pci/mfi_pci.c |   5 +++--
 3 files changed, 14 insertions(+), 9 deletions(-)

diffs (96 lines):

diff -r 948c8d2bb3e9 -r 7f82c2986008 sys/dev/ic/mfi.c
--- a/sys/dev/ic/mfi.c  Wed May 04 15:49:55 2022 +0000
+++ b/sys/dev/ic/mfi.c  Thu May 05 07:18:02 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mfi.c,v 1.68 2022/04/16 18:15:21 andvar Exp $ */
+/* $NetBSD: mfi.c,v 1.69 2022/05/05 07:18:02 msaitoh Exp $ */
 /* $OpenBSD: mfi.c,v 1.66 2006/11/28 23:59:45 dlg Exp $ */
 
 /*
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mfi.c,v 1.68 2022/04/16 18:15:21 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mfi.c,v 1.69 2022/05/05 07:18:02 msaitoh Exp $");
 
 #include "bio.h"
 
@@ -582,7 +582,7 @@
                case MFI_STATE_OPERATIONAL:
                        if (sc->sc_ioptype == MFI_IOP_SKINNY ||
                            sc->sc_ioptype == MFI_IOP_TBOLT)
-                               mfi_write(sc, MFI_SKINNY_IDB, MFI_INIT_READY);
+                               mfi_write(sc, MFI_SKINNY_IDB, MFI_RESET_FLAGS);
                        else
                                mfi_write(sc, MFI_IDB, MFI_INIT_READY);
                        max_wait = 10;
@@ -1059,6 +1059,8 @@
                sc->sc_max_sgl = max_sgl;
                sc->sc_sgl_size = sizeof(struct mfi_sg32);
        }
+       if (sc->sc_ioptype == MFI_IOP_SKINNY)
+               sc->sc_sgl_size = sizeof(struct mfi_sg_ieee);
        DNPRINTF(MFI_D_MISC, "%s: max commands: %u, max sgl: %u\n",
            DEVNAME(sc), sc->sc_max_cmds, sc->sc_max_sgl);
 
@@ -1779,7 +1781,8 @@
        sgl = ccb->ccb_sgl;
        sgd = ccb->ccb_dmamap->dm_segs;
        for (i = 0; i < ccb->ccb_dmamap->dm_nsegs; i++) {
-               if (sc->sc_ioptype == MFI_IOP_TBOLT &&
+               if (((sc->sc_ioptype == MFI_IOP_SKINNY) ||
+                       (sc->sc_ioptype == MFI_IOP_TBOLT)) &&
                    (hdr->mfh_cmd == MFI_CMD_PD_SCSI_IO ||
                     hdr->mfh_cmd == MFI_CMD_LD_READ ||
                     hdr->mfh_cmd == MFI_CMD_LD_WRITE)) {
diff -r 948c8d2bb3e9 -r 7f82c2986008 sys/dev/ic/mfireg.h
--- a/sys/dev/ic/mfireg.h       Wed May 04 15:49:55 2022 +0000
+++ b/sys/dev/ic/mfireg.h       Thu May 05 07:18:02 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mfireg.h,v 1.14 2022/03/23 11:08:27 andvar Exp $ */
+/* $NetBSD: mfireg.h,v 1.15 2022/05/05 07:18:02 msaitoh Exp $ */
 /* $OpenBSD: mfireg.h,v 1.24 2006/06/19 19:05:45 marco Exp $ */
 /*
  * Copyright (c) 2006 Marco Peereboom <marco%peereboom.us@localhost>
@@ -125,11 +125,12 @@
 #define MFI_STATE_TB_FAULT             0x40000000
 
 /* command reset register */
-#define MFI_INIT_ABORT                 0x00000000
+#define MFI_INIT_ABORT                 0x00000001
 #define MFI_INIT_READY                 0x00000002
 #define MFI_INIT_MFIMODE               0x00000004
 #define MFI_INIT_CLEAR_HANDSHAKE       0x00000008
-#define MFI_RESET_FLAGS                        MFI_INIT_READY|MFI_INIT_MFIMODE
+#define MFI_RESET_FLAGS                        MFI_INIT_READY | MFI_INIT_MFIMODE | \
+                                       MFI_INIT_ABORT
 #define MFI_INIT_HOTPLUG               0x00000010
 
 /* ADP reset flags */
diff -r 948c8d2bb3e9 -r 7f82c2986008 sys/dev/pci/mfi_pci.c
--- a/sys/dev/pci/mfi_pci.c     Wed May 04 15:49:55 2022 +0000
+++ b/sys/dev/pci/mfi_pci.c     Thu May 05 07:18:02 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mfi_pci.c,v 1.20 2018/12/09 11:14:02 jdolecek Exp $ */
+/* $NetBSD: mfi_pci.c,v 1.21 2022/05/05 07:18:03 msaitoh Exp $ */
 /* $OpenBSD: mfi_pci.c,v 1.11 2006/08/06 04:40:08 brad Exp $ */
 /*
  * Copyright (c) 2006 Marco Peereboom <marco%peereboom.us@localhost>
@@ -17,7 +17,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mfi_pci.c,v 1.20 2018/12/09 11:14:02 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mfi_pci.c,v 1.21 2022/05/05 07:18:03 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -99,6 +99,7 @@
 
 static const struct mfi_pci_subtype mfi_skinny_subtypes[] = {
        { PCI_VENDOR_IBM,       0x03b1,         "IBM ServeRAID M1015 SAS/SATA" },
+       { PCI_VENDOR_DELL,      0x1f78,         "Dell PERC H310" },
        { 0x0,                  0,              "" }
 };
 



Home | Main Index | Thread Index | Old Index