]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: Add scsi_vpd_lun_id()
authorHannes Reinecke <hare@suse.de>
Tue, 1 Dec 2015 09:16:55 +0000 (10:16 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 2 Dec 2015 21:40:19 +0000 (16:40 -0500)
commit6d58abcb77d9ace427659693689a64cc252f5a84
treeb9b437dc4baaf07b3ced70ea0eaceee855022795
parent6cf7d33c7a17893ba6992d113d7d7c9ea3566002
scsi: Add scsi_vpd_lun_id()

Add a function scsi_vpd_lun_id() to return a unique device
identifcation based on the designation descriptors of
VPD page 0x83.

As devices might implement several descriptors the order
of preference is:
- NAA IEE Registered Extended
- EUI-64 based 16-byte
- EUI-64 based 12-byte
- NAA IEEE Registered
- NAA IEEE Extended
A SCSI name string descriptor is preferred to all of them
if the identification is longer than 16 bytes.

The returned unique device identification will be formatted
as a SCSI Name string to avoid clashes between different
designator types.

[mkp: Fixed up kernel doc comment from Johannes]

Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Ewan Milne <emilne@redhat.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_lib.c
include/scsi/scsi_device.h