opnsense-src/sys/dev/isp
Kenneth D. Merry ff9458b30f Fix the isp(4) driver with 9.x firmware.
The isp(4) driver (and ispfw(4) firmware) previously only included
firmware for Qlogic controllers up to 8Gb.  It recently gained
firmware for the 27XX and 28XX series controllers along with
improved firmware loading capabilities.

The 9.x firmware available for the 27XX and 28XX controllers in
ispfw(4) adds login state for NVMe devices in the top nibble of
the login state in the port database (isp_pdb_24xx_t in ispmbox.h).

This breaks the check at the end of isp_getpdb() to make sure the
device is in the right login state.  As a result, it breaks device
discovery for many (perhaps all?) FC devices.  In my testing with
IBM LTO-6 drives attached to a quad port 16Gb Qlogic 2714, they
don't show up when they are directly connected (and in loop mode)
or connected via a switch (and in fabric mode).

So, mask off the top bits of of the login state before checking it.
This shouldn't break anything, because all of the existing login
states defined in ispmbox.h are in the low nibble.

sys/dev/isp/ispmbox.h:
	Add a FCP login state mask define, and a NVMe login state
	shift.

sys/dev/isp/isp.c:
	In isp_getpdb(), make sure we're only looking at the FCP
	login state bits when we try to determine whether a device
	is in the right login state.

MFC after:	1 week
Sponsored by:	Spectra Logic
Reviewed by:	mav
Differential Revision:	<https://reviews.freebsd.org/D45660>

(cherry picked from commit 137b004e2b7ab504abf98c4aad9d52607df47b9a)
2024-07-16 16:04:29 -04:00
..
DriverManual.txt sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
Hardware.txt sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
isp.c Fix the isp(4) driver with 9.x firmware. 2024-07-16 16:04:29 -04:00
isp_freebsd.c isp(4): Rework firmware handling/loading 2024-01-19 11:47:35 -05:00
isp_freebsd.h isp(4): Rework firmware handling/loading 2024-01-19 11:47:35 -05:00
isp_ioctl.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
isp_library.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
isp_library.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
isp_pci.c isp(4): Rework firmware handling/loading 2024-01-19 11:47:35 -05:00
isp_stds.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
isp_target.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
isp_target.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
ispmbox.h Fix the isp(4) driver with 9.x firmware. 2024-07-16 16:04:29 -04:00
ispreg.h isp(4): Rework firmware handling/loading 2024-01-19 11:47:35 -05:00
ispvar.h isp(4): Rework firmware handling/loading 2024-01-19 11:47:35 -05:00