From 7f4954d04026f28b0ebe65a514f06fefad8efaca Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Fri, 4 Dec 2009 11:25:09 -0500 Subject: Export ID_WWN_VENDOR_EXTENSION and ID_WWN_WITH_EXTENSION Some SCSI devices use the same WWN and have a WWN extension that we need to take into account when creating the /dev/disk/by-id/wwn symlinks. Thus, introduce ID_WWN_WITH_EXTENSION. This property will contain either the WWN (if no extension is present) or the WWN with the vendor extension appended. Example: # /lib/udev/ata_id/ata_id --export /dev/sda |grep WWN ID_WWN=0x5001517387d61905 ID_WWN_WITH_EXTENSION=0x5001517387d61905 # /lib/udev/scsi_id --whitelisted --export -d /dev/sdb |grep WWN ID_WWN=0x600508b400105df7 ID_WWN_VENDOR_EXTENSION=0x0000e00000d80000 ID_WWN_WITH_EXTENSION=0x600508b400105df70000e00000d80000 # /lib/udev/scsi_id --whitelisted --export -d /dev/sdc |grep WWN ID_WWN=0x600508b400105df7 ID_WWN_VENDOR_EXTENSION=0x0000e00000db0000 ID_WWN_WITH_EXTENSION=0x600508b400105df70000e00000db0000 Signed-off-by: David Zeuthen --- extras/ata_id/ata_id.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'extras/ata_id') diff --git a/extras/ata_id/ata_id.c b/extras/ata_id/ata_id.c index cbd3b5b8d2..25c7710127 100644 --- a/extras/ata_id/ata_id.c +++ b/extras/ata_id/ata_id.c @@ -1,4 +1,5 @@ -/* +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- + * * ata_id - reads product/serial number from ATA drives * * Copyright (C) 2005-2008 Kay Sievers @@ -520,6 +521,8 @@ int main(int argc, char *argv[]) wwwn <<= 16; wwwn |= *((uint16_t *) identify + 111); printf("ID_WWN=0x%llx\n", (unsigned long long int) wwwn); + /* ATA devices have no vendor extension */ + printf("ID_WWN_WITH_EXTENSION=0x%llx\n", (unsigned long long int) wwwn); } } else { if (serial[0] != '\0') -- cgit v1.2.3-54-g00ecf