svn commit: r273708 - head/sys/cam/ctl

Alexander Motin mav at FreeBSD.org
Sun Oct 26 20:13:46 UTC 2014


Author: mav
Date: Sun Oct 26 20:13:46 2014
New Revision: 273708
URL: https://svnweb.freebsd.org/changeset/base/273708

Log:
  Fix support for LUN flat space addressing.
  
  MFC after:	1 week

Modified:
  head/sys/cam/ctl/ctl.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Sun Oct 26 19:42:44 2014	(r273707)
+++ head/sys/cam/ctl/ctl.c	Sun Oct 26 20:13:46 2014	(r273708)
@@ -9403,17 +9403,18 @@ ctl_report_luns(struct ctl_scsiio *ctsio
 			 * Flat addressing method.
 			 */
 			lun_data->luns[num_filled].lundata[0] =
-				RPL_LUNDATA_ATYP_FLAT |
-				(targ_lun_id & RPL_LUNDATA_FLAT_LUN_MASK);
-#ifdef OLDCTLHEADERS
-				(SRLD_ADDR_FLAT << SRLD_ADDR_SHIFT) |
-				(targ_lun_id & SRLD_BUS_LUN_MASK);
-#endif
+				RPL_LUNDATA_ATYP_FLAT | (targ_lun_id >> 8);
 			lun_data->luns[num_filled].lundata[1] =
-#ifdef OLDCTLHEADERS
-				targ_lun_id >> SRLD_BUS_LUN_BITS;
-#endif
-				targ_lun_id >> RPL_LUNDATA_FLAT_LUN_BITS;
+				(targ_lun_id & 0xff);
+			num_filled++;
+		} else if (targ_lun_id <= 0xffffff) {
+			/*
+			 * Extended flat addressing method.
+			 */
+			lun_data->luns[num_filled].lundata[0] =
+			    RPL_LUNDATA_ATYP_EXTLUN | 0x12;
+			scsi_ulto3b(targ_lun_id,
+			    &lun_data->luns[num_filled].lundata[1]);
 			num_filled++;
 		} else {
 			printf("ctl_report_luns: bogus LUN number %jd, "


More information about the svn-src-head mailing list