]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r257345,257382,257388:
authornwhitehorn <nwhitehorn@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 10 Dec 2013 22:55:22 +0000 (22:55 +0000)
committernwhitehorn <nwhitehorn@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 10 Dec 2013 22:55:22 +0000 (22:55 +0000)
commit4cc228a6f4144bb0cf8eefa628096bfa7e882d61
treea62a3ba1c112ab79fb456e1d6a5ccc8a5acf663c
parent707e61bd16eaae2f7d6237f9fda1f28299ce44c9
MFC r257345,257382,257388:

Implement extended LUN support. If PIM_EXTLUNS is set by a SIM, encode
the upper 32-bits of the LUN, if possible, into the target_lun field as
passed directly from the REPORT LUNs response. This allows extended LUN
support to work for all LUNs with zeros in the lower 32-bits, which covers
most addressing modes without breaking KBI. Behavior for drivers not
setting PIM_EXTLUNS is unchanged. No user-facing interfaces are modified.

Extended LUNs are stored with swizzled 16-bit word order so that, for
devices implementing LUN addressing (like SCSI-2), the numerical
representation of the LUN is identical with and without PIM_EXTLUNS. Thus
setting PIM_EXTLUNS keeps most behavior, and user-facing LUN IDs, unchanged.
This follows the strategy used in Solaris. A macro (CAM_EXTLUN_BYTE_SWIZZLE)
is provided to transform a lun_id_t into a uint64_t ordered for the wire.

This is the second part of work for full 64-bit extended LUN support and is
designed to a bridge for stable/10 to the final 64-bit LUN code. The
third and final part will involve widening lun_id_t to 64 bits and will
not be MFCed. This third part will break the KBI but will keep the KPI
unchanged so that all drivers that will care about this can be updated now
and not require code changes between HEAD and stable/10.

Reviewed by: scottl

git-svn-id: svn://svn.freebsd.org/base/stable/10@259204 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
lib/libcam/camlib.c
sbin/camcontrol/camcontrol.c
sys/cam/cam.h
sys/cam/cam_xpt.c
sys/cam/scsi/scsi_xpt.c
sys/powerpc/pseries/phyp_vscsi.c