Home | History | Annotate | Download | only in ic
History log of /src/sys/dev/ic/mfireg.h
RevisionDateAuthorComments
 1.25  13-Feb-2024  msaitoh mfii(4): Apply two changes from OpenBSD to fix an unknown firmware state.

My own MegaRAID 946N-8i 2G", firmware 50.5.0-2594 failed to attach.

mfii0: unknown firmware state 1879048192

1879048192 equals to 0x70000000(== MFI_STATE_FW_INIT_2).
Apply following two OpenBSD commits to resolve this problem.
 1.24  16-Jul-2022  msaitoh Add max 256 VD support.
 1.23  09-Jul-2022  msaitoh Add preliminary support for Aero.

- Aero supports 32bit descriptor.
- Even if the Aero card supports 32bit descriptor, 64bit descriptor
access is required for MFI_CMD_INIT.
- Add quirk for Aero to retry register read.
- The PCI ID table for Aero is disabled. Even if it's enabled, any logical
volumes are not found. Perhaps the reason is that our mfii driver is
currently not supports more than 64 logical volumes and MR_DCMD_LD_GET_LIST
returns incorrect value. Tested by Mark Daies' H750.
 1.22  29-Jun-2022  msaitoh Add CVPM02 BBU support.
 1.21  12-May-2022  msaitoh I think MFI_BBU_STATE_LEARN_CYC_REQ is not an error.
 1.20  12-May-2022  msaitoh No functional change.

- Reduce diff against OpenBSD
- Whitespace fix.
- Sort some defines and structures.
- Add comment.
- KNF.
 1.19  12-May-2022  msaitoh Don't use MFI_PD_LIST_SIZE. Same as OpenBSD. No functional change.
 1.18  11-May-2022  msaitoh Add support for iBBU-09 to show BBU voltage, current and temp correctly.
 1.17  11-May-2022  msaitoh KNF. s/u_quad_t/uint64_t/. No functional change.
 1.16  07-May-2022  msaitoh Fix typos.
 1.15  05-May-2022  msaitoh Add some code for the SKINNY variant to make Dell PERC H310 work.
 1.14  23-Mar-2022  andvar fix few typos in comments, mainly s/paramenters/parameters/.
 1.13  22-Mar-2022  andvar fix typos in comments.
 1.12  06-Nov-2021  msaitoh s/allign/align/
 1.11  24-Jul-2021  andvar Fix all remaining typos, mainly in comments but also in few definitions and log messages, reported by me in PR kern/54889.
Also fixed some additional typos in comments, found on review of same files or typos.
 1.10  05-Oct-2019  mrg branches: 1.10.12;
remove __packed attribute from struct ieee80211_radiotap_header
and all the structures that include it.

this should not change anything while avoiding packed vs alignment
warnings from GCC 8, and potentially pessimised code generation
due to the packed marker (there are no misaligned members, just
that the per-device parts may end unaligned.)

all consumers of these members are done from the properly aligned
packet members directly, or, as a union with a 64 byte member,
also properly aligned. codegen didn't appear to change, except
for the definition of sizeof(struct driver_[rt]x_radiotap_header)
in debug info, which is not directly used anywhere.
 1.9  24-Nov-2018  bouyer branches: 1.9.4;
Add some definitions from OpenBSD, needed by the upcoming mfii driver.
No functionnal change.
 1.8  19-Sep-2012  bouyer branches: 1.8.30; 1.8.36; 1.8.38;
Add a pass-through ioctl for mfi(4), allowing userland to send raw commands
to the controller. This is compatible with the linux and FreeBSD
implementations.
Add the needed conversion for mfi ioctls in COMPAT_LINUX
Allocate a character major number, and create /dev/mfi0 by default
on amd64 and i386.
This allows (along with a hand-created /emul/linux/proc/devices file)
to run the MegaCLI linux binary provided by LSI.
 1.7  26-Aug-2012  bouyer branches: 1.7.2;
After discussion on tech-kern@, fix performance issue related to
cache flush commands from WAPBL, by skipping the cache flush if the
BBU is present and considered good. Users which still want the write back
cache with a non-working BBU can set vfs.wapbl.flush_disk_cache to 0.
- add commands to monitor the BBU state. Add a boolean BBU sensor
to monitor the BBU state via sysmon_envsys(9).
- if the BBU is considered good, turn SCSI_SYNCHRONIZE_CACHE_10 and
SCSI_SYNCHRONIZE_CACHE_16 commands from upper layer into NOOPs.
While there, handle SCSI_SYNCHRONIZE_CACHE_16 in addition to
SCSI_SYNCHRONIZE_CACHE_10.
- Add a shutdown pmf(9) handler, which flushes the cache and shutdown the
firmware
- on detach, also flush cache and shutdown firmware.
- on attach, print the firmware-provided name, and the BBU state
Tested on a LSI MegaRAID SAS 9265-8i and a PERC 5/i Integrated
 1.6  23-Aug-2012  bouyer Add support newer LSI RAID controllers based on the SAS2208 chip,
codenamed "ThunderBolt". Add tagged queuing support for all adapters
supported by mfi(4).
Tested with a MegaRAID SAS 9265-8i adapter, and an older Dell PERC 5/i.
 1.5  21-Mar-2012  sborrill Add support for skinny variants (e.g. IBM ServeRAID M1015). Based on OpenBSD
changes with some improvements. Tested on IBM x3550M3 with RAID0 and RAID1
volumes including bioctl(8) operation.
 1.4  09-Feb-2010  msaitoh branches: 1.4.10; 1.4.14; 1.4.16;
Add newer cars supports. Tested on MegaRAID SAS 9260-8i.
- Add MFI gen2 support from OpenBSD.
- Add entry for MegaRAID SAS 9260-8i
 1.3  25-Feb-2008  xtraeme branches: 1.3.4; 1.3.14; 1.3.22; 1.3.24;
Added support for the mfi(4) controllers with powerpc IOPs such as
LSI SAS1078 or Dell PERC 6, from OpenBSD.

Tested by Akira Kato on current-users@.
 1.2  20-Dec-2006  bouyer branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8; 1.2.28; 1.2.44; 1.2.48;
Add missing $NetBSD: $
 1.1  17-Dec-2006  bouyer branches: 1.1.2;
Add mfi(4), a driver for LSI Logic & Dell MegaRAID SAS RAID controller.
Ported from OpenBSD, tested on i386 and amd64.
 1.1.2.3  21-Dec-2006  yamt sync with head.
 1.1.2.2  18-Dec-2006  yamt sync with head.
 1.1.2.1  17-Dec-2006  yamt file mfireg.h was added on branch yamt-splraiseipl on 2006-12-18 11:42:13 +0000
 1.2.48.1  03-Apr-2008  mjf Sync with HEAD.
 1.2.44.1  24-Mar-2008  keiichi sync with head.
 1.2.28.1  23-Mar-2008  matt sync with HEAD
 1.2.8.2  12-Jan-2007  ad Sync with head.
 1.2.8.1  20-Dec-2006  ad file mfireg.h was added on branch newlock2 on 2007-01-12 00:57:36 +0000
 1.2.6.3  27-Feb-2008  yamt sync with head.
 1.2.6.2  30-Dec-2006  yamt sync with head.
 1.2.6.1  20-Dec-2006  yamt file mfireg.h was added on branch yamt-lazymbuf on 2006-12-30 20:48:03 +0000
 1.2.4.2  23-Dec-2006  ghen Pull up following revision(s) (requested by bouyer in ticket #1609):
sys/arch/i386/conf/INSTALL: revision 1.298
sys/arch/i386/conf/GENERIC: revision 1.802
sys/dev/pci/files.pci: revision 1.274
sys/arch/amd64/conf/GENERIC: revision 1.122
sys/dev/pci/mfi_pci.c: revision 1.1 via patch
distrib/sets/lists/man/mi: revision 1.958
sys/arch/amd64/conf/INSTALL: revision 1.61
sys/dev/ic/mfireg.h: revision 1.1
share/man/man4/Makefile: revision 1.416 via patch
sys/dev/ic/mfi.c: revision 1.1
sys/arch/i386/conf/XEN2_DOM0: revision 1.19
sys/dev/ic/mfivar.h: revision 1.1
sys/conf/files: revision 1.821
share/man/man4/mfi.4: revision 1.1
share/man/man4/mfi.4: revision 1.2
sys/dev/pci/pcidevs via patch
Add mfi(4), a driver for LSI Logic & Dell MegaRAID SAS RAID controller.
Ported from OpenBSD, tested on i386 and amd64.
Punctuation issues.
 1.2.4.1  20-Dec-2006  ghen file mfireg.h was added on branch netbsd-3 on 2006-12-23 16:43:19 +0000
 1.2.2.3  21-Dec-2006  tron Pull up following revision(s) (requested by bouyer in ticket #286):
sys/dev/pci/mfi_pci.c: revision 1.2
sys/dev/ic/mfireg.h: revision 1.2
sys/dev/ic/mfi.c: revision 1.2
sys/dev/ic/mfivar.h: revision 1.2
Add missing $NetBSD: $
 1.2.2.2  21-Dec-2006  tron Pull up following revision(s) (requested by bouyer in ticket #286):
sys/arch/i386/conf/INSTALL: revision 1.298
sys/arch/i386/conf/GENERIC: revision 1.802
sys/dev/pci/files.pci: revision 1.274
sys/arch/amd64/conf/GENERIC: revision 1.122
sys/dev/pci/mfi_pci.c: revision 1.1
distrib/sets/lists/man/mi: revision 1.958
sys/arch/amd64/conf/INSTALL: revision 1.61
sys/arch/i386/conf/ALL: revision 1.75
sys/dev/ic/mfireg.h: revision 1.1
share/man/man4/Makefile: revision 1.416
sys/dev/ic/mfi.c: revision 1.1
sys/arch/i386/conf/XEN2_DOM0: revision 1.19
sys/dev/ic/mfivar.h: revision 1.1
sys/conf/files: revision 1.821
share/man/man4/mfi.4: revision 1.1
Add mfi(4), a driver for LSI Logic & Dell MegaRAID SAS RAID controller.
Ported from OpenBSD, tested on i386 and amd64.
 1.2.2.1  20-Dec-2006  tron file mfireg.h was added on branch netbsd-4 on 2006-12-21 12:46:21 +0000
 1.3.24.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.3.22.1  21-Apr-2010  matt sync to netbsd-5
 1.3.14.1  28-Mar-2010  snj Apply patch (requested by msaitoh in ticket #1326):
Add support for MFI gen2 devices. Mention newer devices, RAID 6 and
RAID60 in mfi.4.
 1.3.4.1  11-Mar-2010  yamt sync with head
 1.4.16.3  24-Oct-2012  riz Pull up following revision(s) (requested by bouyer in ticket #629):
sys/compat/linux/common/linux_ioctl.c: revision 1.57
sys/dev/ic/mfi.c: revision 1.47
sys/conf/majors: revision 1.62
etc/etc.i386/MAKEDEV.conf: revision 1.24
sys/dev/ic/mfivar.h: revision 1.20
etc/MAKEDEV.tmpl: revision 1.159
sys/dev/ic/mfiio.h: revision 1.1
etc/etc.amd64/MAKEDEV.conf: revision 1.19
sys/dev/ic/mfireg.h: revision 1.8
Add a pass-through ioctl for mfi(4), allowing userland to send raw commands
to the controller. This is compatible with the linux and FreeBSD
implementations.
Add the needed conversion for mfi ioctls in COMPAT_LINUX
Allocate a character major number, and create /dev/mfi0 by default
on amd64 and i386.
This allows (along with a hand-created /emul/linux/proc/devices file)
to run the MegaCLI linux binary provided by LSI.
 1.4.16.2  24-Oct-2012  riz Pull up following revision(s) (requested by bouyer in ticket #628):
sys/dev/ic/mfi.c: revision 1.40
sys/dev/ic/mfi.c: revision 1.41
sys/dev/ic/mfi.c: revision 1.42
sys/dev/ic/mfi.c: revision 1.43
sys/dev/ic/mfi.c: revision 1.44
sys/dev/ic/mfi.c: revision 1.45
sys/dev/ic/mfi.c: revision 1.46
sys/dev/pci/pcidevs: revision 1.1128
sys/dev/pci/mfi_pci.c: revision 1.15
sys/dev/pci/mfi_pci.c: revision 1.16
sys/dev/ic/mfi.c: revision 1.39
sys/dev/ic/mfivar.h: revision 1.16
sys/dev/ic/mfireg.h: revision 1.6
sys/dev/ic/mfivar.h: revision 1.17
sys/dev/ic/mfireg.h: revision 1.7
sys/dev/ic/mfivar.h: revision 1.18
sys/dev/ic/mfivar.h: revision 1.19
Add some support for 64bit DMA but stick to 32bit DMA for now.
From OpenBSD mfi.c rev 1.119.
Add LSI MegaRAID SAS2208
MFI_IOP_SKINNY is an enum not a single bit value, so it can't be used as
a bit flag. As sc_flags is really used to hold an enum mfi_iop value,
change it to enum mfi_iop and rename to sc_ioptype. While there init it
in mfi_attach() instead of mfi_pci_attach().
sg64.len is 32bits, so use htole32()
Really init sc_ioptype in mfi_attach()
Add support newer LSI RAID controllers based on the SAS2208 chip,
codenamed "ThunderBolt". Add tagged queuing support for all adapters
supported by mfi(4).
Tested with a MegaRAID SAS 9265-8i adapter, and an older Dell PERC 5/i.
Avoid "unused variable" warning for non-DIAGNOSTIC kernels.
Pointed out by Havard Eidnes
After discussion on tech-kern@, fix performance issue related to
cache flush commands from WAPBL, by skipping the cache flush if the
BBU is present and considered good. Users which still want the write back
cache with a non-working BBU can set vfs.wapbl.flush_disk_cache to 0.
- add commands to monitor the BBU state. Add a boolean BBU sensor
to monitor the BBU state via sysmon_envsys(9).
- if the BBU is considered good, turn SCSI_SYNCHRONIZE_CACHE_10 and
SCSI_SYNCHRONIZE_CACHE_16 commands from upper layer into NOOPs.
While there, handle SCSI_SYNCHRONIZE_CACHE_16 in addition to
SCSI_SYNCHRONIZE_CACHE_10.
- Add a shutdown pmf(9) handler, which flushes the cache and shutdown the
firmware
- on detach, also flush cache and shutdown firmware.
- on attach, print the firmware-provided name, and the BBU state
Tested on a LSI MegaRAID SAS 9265-8i and a PERC 5/i Integrated
Make MFI_DEBUG build on i386.
Report BBU state changes with aprint_normal(), it seems that sysmon_envsys()
doens't report changes for ENVSYS_INDICATOR as it does for ENVSYS_DRIVE.
 1.4.16.1  22-Mar-2012  riz Pull up following revision(s) (requested by sborrill in ticket #138):
sys/dev/pci/mfi_pci.c: revision 1.13
sys/dev/ic/mfi.c: revision 1.38
sys/dev/ic/mfivar.h: revision 1.15
sys/dev/ic/mfireg.h: revision 1.5
Add support for skinny variants (e.g. IBM ServeRAID M1015). Based on OpenBSD
changes with some improvements. Tested on IBM x3550M3 with RAID0 and RAID1
volumes including bioctl(8) operation.
 1.4.14.1  05-Apr-2012  mrg sync to latest -current.
 1.4.10.2  30-Oct-2012  yamt sync with head
 1.4.10.1  17-Apr-2012  yamt sync with head
 1.7.2.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.8.38.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.8.38.1  10-Jun-2019  christos Sync with HEAD
 1.8.36.1  26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.8.30.3  16-Sep-2022  martin Pull up the following, requested by msaitoh in ticket #1764:

sys/dev/ic/mfireg.h 1.22
sys/dev/pci/mfii.c 1.16-1.22,1.27 via patch
share/man/man4/mfii.4 1.3 via patch

- Fix wrong access in mfii_start().
- Add SAS3216,SAS3224,SAS3316 and SAS3324 support.
- Add CVPM02 BBU support.
- Use bus_space_write_8() if available.
- Don't panic on detach if no any sensor device.
- Add comment. Sort entries. KNF.
 1.8.30.2  17-May-2022  bouyer Pull up following revision(s) via patch (requested by msaitoh in ticket #1454):
sys/dev/ic/mfi.c: revisions 1.63, 1.66-77
sys/dev/ic/mfireg.h: revisions 1.11-1.20 via patch
sys/dev/pci/mfi_pci.c: revision 1.21
sys/dev/pci/mfii.c: revisions 1.6-1.7, 1.10-1.15
share/man/man4/mfi.4: revision 1.13

Improve mfi(4) and mfii(4):
- Set 'ld_sync' to NULL as part of 'again', to prevent use-after-free.
- Add some code for the SKINNY variant to make Dell PERC H310 work.
- Print the percentage correctly when the background initialization is
running.
- Clear mailbox to not to pass garbage data.
- Use union mbox instead of unit8_t xxx[] to avoid unaligned access.
- Set stripe size for BIOCVOL to show the size correctly in bioctl.
- Add support for iBBU-09 to show BBU voltage, current and temperature
correctly.
- Fix typos in comments.
- Sprinkle static.
- Improve debug printf()s.
- KNF. Remove extra semicolon. Whitespace fixes.
 1.8.30.1  07-Dec-2018  martin Pull up following revision(s) (requested by bouyer in ticket #1129):

sys/arch/amd64/conf/XEN3_DOM0: revision 1.159
sys/arch/amd64/conf/GENERIC: revision 1.508
sys/arch/i386/conf/ALL: revision 1.458
sys/dev/ic/mfi.c: revision 1.60
sys/dev/pci/mpiireg.h: revision 1.1
distrib/sets/lists/man/mi: revision 1.1628
sys/dev/pci/mfii.c: revision 1.1,1.2 (adapted)
sys/arch/i386/conf/GENERIC: revision 1.1194
sys/dev/pci/mpii.c: revision 1.13
sys/dev/ic/mfireg.h: revision 1.9
share/man/man4/mfii.4: revision 1.1
share/man/man4/Makefile: revision 1.673 (patch)
sys/dev/pci/files.pci: revision 1.410
share/man/man4/mfii.4: revision 1.2
sys/arch/amd64/conf/ALL: revision 1.108
sys/arch/i386/conf/XEN3PAE_DOM0: revision 1.8 (patch, in XEN3_DOM0)

Add some definitions from OpenBSD, needed by the upcoming mfii driver.
No functionnal change.

-

Move registers definitions to a separate file, needed for the upcomning mpii
driver. No functionnal change.

-

Add mpii(4), a driver for LSI Megaraid Fusion controllers.
Ported from OpenBSD. This driver is MP-safe.

Note that the earlier fusion controllers (Megaraid 2208, codenamed Thunderbold)
are also supported by mfi(4). mpii will take precedence if both drivers
are enabled.

Tested on a
mfii0 at pci6 dev 0 function 0: "PERC H740P Adapter ", firmware 50.3.0-1512, 819
2MB cache
mfii0: interrupting at ioapic2 pin 2
scsibus0 at mfii0: 64 targets, 8 luns per target
scsibus0: waiting 2 seconds for devices to settle...
sd0 at scsibus0 target 0 lun 0: <DELL, PERC H740P Adp, 5.03> disk fixed
sd0: fabricating a geometry
sd0: 99 GB, 102399 cyl, 64 head, 32 sec, 512 bytes/sect x 209714688 sectors
sd0: tagged queueing
sd1 at scsibus0 target 1 lun 0: <DELL, PERC H740P Adp, 5.03> disk fixed
sd1: fabricating a geometry
sd1: 22254 GB, 22788608 cyl, 64 head, 32 sec, 512 bytes/sect x 46671069696 sectors
sd1: fabricating a geometry

It supports bioctl(8) ioctls, as well as sensors for the BBU and logical
drives.

Sponsored by LIP6.

-

Add my name in copyright list

-

add a man page for the new mpii, mostly from OpenBSD.

-

Sort SEE ALSO. Fix date. Whitespace fixes.
 1.9.4.2  16-Sep-2022  martin Pull up the following, requested by msaitoh in ticket #1524:

sys/dev/ic/mfireg.h 1.22
sys/dev/pci/mfii.c 1.16-1.22,1.27 via patch
share/man/man4/mfii.4 1.3 via patch

- Fix wrong access in mfii_start().
- Add SAS3216,SAS3224,SAS3316 and SAS3324 support.
- Add CVPM02 BBU support.
- Use bus_space_write_8() if available.
- Don't panic on detach if no any sensor device.
- Add comment. Sort entries. KNF.
 1.9.4.1  17-May-2022  bouyer Pull up following revision(s) via patch (requested by msaitoh in ticket #1454):
sys/dev/ic/mfi.c: revisions 1.63, 1.66-77
sys/dev/ic/mfireg.h: revisions 1.11-1.20 via patch
sys/dev/pci/mfi_pci.c: revision 1.21
sys/dev/pci/mfii.c: revisions 1.6-1.7, 1.10-1.15
share/man/man4/mfi.4: revision 1.13

Improve mfi(4) and mfii(4):
- Set 'ld_sync' to NULL as part of 'again', to prevent use-after-free.
- Add some code for the SKINNY variant to make Dell PERC H310 work.
- Print the percentage correctly when the background initialization is
running.
- Clear mailbox to not to pass garbage data.
- Use union mbox instead of unit8_t xxx[] to avoid unaligned access.
- Set stripe size for BIOCVOL to show the size correctly in bioctl.
- Add support for iBBU-09 to show BBU voltage, current and temperature
correctly.
- Fix typos in comments.
- Sprinkle static.
- Improve debug printf()s.
- KNF. Remove extra semicolon. Whitespace fixes.
 1.10.12.1  01-Aug-2021  thorpej Sync with HEAD.

RSS XML Feed