summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2014-10-26 20:13:46 +0000
committermav <mav@FreeBSD.org>2014-10-26 20:13:46 +0000
commitbe81b72040e8d5829a1a9f3453e9f89e3d985aa7 (patch)
tree38c4f464806e5255b4c9eaf11880e5a9eb67f1eb /sys
parenta9faac8f4b75a3a8c3d752a2c56e3709438f5a94 (diff)
downloadFreeBSD-src-be81b72040e8d5829a1a9f3453e9f89e3d985aa7.zip
FreeBSD-src-be81b72040e8d5829a1a9f3453e9f89e3d985aa7.tar.gz
Fix support for LUN flat space addressing.
MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r--sys/cam/ctl/ctl.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c
index 6206a15..2a7ed7f 100644
--- a/sys/cam/ctl/ctl.c
+++ b/sys/cam/ctl/ctl.c
@@ -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, "
OpenPOWER on IntegriCloud