[PATCH 6/6] scsi_scan: Fixup scsilun_to_int()

2014-06-25 Thread Hannes Reinecke
scsilun_to_int() has an error which prevents it from generating correct LUN numbers for 64bit values. Also we should remove the misleading comment about portions of the LUN being ignored; the initiator should treat the LUN as an opaque value. And, finally, the example given should use the correct

Re: [PATCH 6/6] scsi_scan: Fixup scsilun_to_int()

2014-06-10 Thread Bart Van Assche
On 06/03/14 10:58, Hannes Reinecke wrote: + * Given a struct scsi_lun of: d2 04 0b 03 00 00 00 00, this function + * returns the integer: 0x0b03d204 + * + * This encoding will return a standard integer LUN for LUNs smaller + * than 256, which typically use a single level LUN

Re: [PATCH 6/6] scsi_scan: Fixup scsilun_to_int()

2014-06-10 Thread Douglas Gilbert
On 14-06-10 07:37 AM, Bart Van Assche wrote: On 06/03/14 10:58, Hannes Reinecke wrote: + * Given a struct scsi_lun of: d2 04 0b 03 00 00 00 00, this function + * returns the integer: 0x0b03d204 + * + * This encoding will return a standard integer LUN for LUNs smaller + * than

Re: [PATCH 6/6] scsi_scan: Fixup scsilun_to_int()

2014-06-10 Thread Bart Van Assche
On 06/10/14 16:06, James Bottomley wrote: On Tue, 2014-06-10 at 13:37 +0200, Bart Van Assche wrote: On 06/03/14 10:58, Hannes Reinecke wrote: + * Given a struct scsi_lun of: d2 04 0b 03 00 00 00 00, this function + * returns the integer: 0x0b03d204 + * + * This encoding will

Re: [PATCH 6/6] scsi_scan: Fixup scsilun_to_int()

2014-06-10 Thread Douglas Gilbert
On 14-06-10 10:06 AM, James Bottomley wrote: On Tue, 2014-06-10 at 13:37 +0200, Bart Van Assche wrote: On 06/03/14 10:58, Hannes Reinecke wrote: + * Given a struct scsi_lun of: d2 04 0b 03 00 00 00 00, this function + * returns the integer: 0x0b03d204 + * + * This encoding will

Re: [PATCH 6/6] scsi_scan: Fixup scsilun_to_int()

2014-06-10 Thread James Bottomley
On Tue, 2014-06-10 at 16:48 +0200, Bart Van Assche wrote: On 06/10/14 16:06, James Bottomley wrote: On Tue, 2014-06-10 at 13:37 +0200, Bart Van Assche wrote: On 06/03/14 10:58, Hannes Reinecke wrote: + * Given a struct scsi_lun of: d2 04 0b 03 00 00 00 00, this function + *

Re: [PATCH 6/6] scsi_scan: Fixup scsilun_to_int()

2014-06-10 Thread Bart Van Assche
On 06/10/14 17:01, James Bottomley wrote: On Tue, 2014-06-10 at 16:48 +0200, Bart Van Assche wrote: On 06/10/14 16:06, James Bottomley wrote: On Tue, 2014-06-10 at 13:37 +0200, Bart Van Assche wrote: On 06/03/14 10:58, Hannes Reinecke wrote: + * Given a struct scsi_lun of: d2 04 0b 03 00

[PATCH 6/6] scsi_scan: Fixup scsilun_to_int()

2014-06-03 Thread Hannes Reinecke
scsilun_to_int() has an error which prevents it from generating correct LUN numbers for 64bit values. Also we should remove the misleading comment about portions of the LUN being ignored; the initiator should treat the LUN as an opaque value. And, finally, the example given should use the correct

Re: [PATCH 6/6] scsi_scan: Fixup scsilun_to_int()

2014-06-02 Thread James Bottomley
On Sat, 2014-05-31 at 11:01 +0200, Hannes Reinecke wrote: scsilun_to_int() has an error which prevents it from generating correct LUN numbers for 64bit values. Also we should remove the misleading comment about portions of the LUN being ignored; the initiator should treat the LUN as an opaque

Re: [PATCH 6/6] scsi_scan: Fixup scsilun_to_int()

2014-06-02 Thread Bart Van Assche
On 05/31/14 11:01, Hannes Reinecke wrote: u64 scsilun_to_int(struct scsi_lun *scsilun) { - int i; - u64 lun; + const unsigned char * cp; + uint64_t res; - lun = 0; - for (i = 0; i sizeof(lun); i += 2) - lun = lun | (((scsilun-scsi_lun[i] 8) | -