[PATCH] Allow 14bit lun numbers.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jan Vesely <jvesely@xxxxxxxxxx>

Only the topmost 2 bits are reserved, and flat space addressing allows
14bit luns.
Tested by creating a target with 1500 luns.

Signed-off-by: Jan Vesely <jvesely@xxxxxxxxxx>
---
 usr/spc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr/spc.c b/usr/spc.c
index 074fdad..8b80fa8 100644
--- a/usr/spc.c
+++ b/usr/spc.c
@@ -348,7 +348,7 @@ int spc_report_luns(int host_no, struct scsi_cmd *cmd)
 		if (remain_len) {
 			lun = lu->lun;
 			lun = ((lun > 0xff) ? (0x1 << 30) : 0) |
-			      ((0x3ff & lun) << 16);
+			      ((0x3fff & lun) << 16);
 			lun = __cpu_to_be64(lun << 32);
 		}
 		actual_len += spc_memcpy((uint8_t *)plun, &remain_len,
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux