svn commit: r273982 - stable/10/sys/cam/ctl
Alexander Motin
mav at FreeBSD.org
Sun Nov 2 17:31:46 UTC 2014
Author: mav
Date: Sun Nov 2 17:31:45 2014
New Revision: 273982
URL: https://svnweb.freebsd.org/changeset/base/273982
Log:
MFC r273708: Fix support for LUN flat space addressing.
Modified:
stable/10/sys/cam/ctl/ctl.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/cam/ctl/ctl.c
==============================================================================
--- stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:31:10 2014 (r273981)
+++ stable/10/sys/cam/ctl/ctl.c Sun Nov 2 17:31:45 2014 (r273982)
@@ -9405,17 +9405,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-stable
mailing list