-/*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
* scsi_id.c
*
* Main section of the scsi_id program
}
if (dev_scsi.wwn[0] != '\0') {
printf("ID_WWN=0x%s\n", dev_scsi.wwn);
+ if (dev_scsi.wwn_vendor_extension[0] != '\0') {
+ printf("ID_WWN_VENDOR_EXTENSION=0x%s\n", dev_scsi.wwn_vendor_extension);
+ printf("ID_WWN_WITH_EXTENSION=0x%s%s\n", dev_scsi.wwn, dev_scsi.wwn_vendor_extension);
+ } else {
+ printf("ID_WWN_WITH_EXTENSION=0x%s\n", dev_scsi.wwn);
+ }
}
if (dev_scsi.unit_serial_number[0] != '\0') {
printf("ID_SCSI_SERIAL=%s\n", dev_scsi.unit_serial_number);
-/*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
* scsi_serial.c
*
* Code related to requesting and getting an id from a scsi device
unsigned char *page_83,
const struct scsi_id_search_values
*id_search, char *serial, char *serial_short, int max_len,
- char *wwn)
+ char *wwn,
+ char *wwn_vendor_extension)
{
int i, j, s, len;
if (id_search->id_type == SCSI_ID_NAA && wwn != NULL) {
strncpy(wwn, &serial[s], 16);
+ if (wwn_vendor_extension != NULL) {
+ strncpy(wwn_vendor_extension, &serial[s + 16], 16);
+ }
}
return 0;
}
static int do_scsi_page83_inquiry(struct udev *udev,
struct scsi_id_device *dev_scsi, int fd,
char *serial, char *serial_short, int len,
- char *unit_serial_number, char *wwn)
+ char *unit_serial_number, char *wwn,
+ char *wwn_vendor_extension)
{
int retval;
unsigned int id_ind, j;
dev_scsi, &page_83[j],
&id_search_list[id_ind],
serial, serial_short, len,
- wwn);
+ wwn,
+ wwn_vendor_extension);
dbg(udev, "%s id desc %d/%d/%d\n", dev_scsi->kernel,
id_search_list[id_ind].id_type,
id_search_list[id_ind].naa_type,
goto completed;
}
} else if (page_code == PAGE_83) {
- if (do_scsi_page83_inquiry(udev, dev_scsi, fd, dev_scsi->serial, dev_scsi->serial_short, len, dev_scsi->unit_serial_number, dev_scsi->wwn)) {
+ if (do_scsi_page83_inquiry(udev, dev_scsi, fd, dev_scsi->serial, dev_scsi->serial_short, len, dev_scsi->unit_serial_number, dev_scsi->wwn, dev_scsi->wwn_vendor_extension)) {
retval = 1;
goto completed;
} else {
* conform to pre-SPC3 expectations.
*/
if (retval == 2) {
- if (do_scsi_page83_inquiry(udev, dev_scsi, fd, dev_scsi->serial, dev_scsi->serial_short, len, dev_scsi->unit_serial_number, dev_scsi->wwn)) {
+ if (do_scsi_page83_inquiry(udev, dev_scsi, fd, dev_scsi->serial, dev_scsi->serial_short, len, dev_scsi->unit_serial_number, dev_scsi->wwn, dev_scsi->wwn_vendor_extension)) {
retval = 1;
goto completed;
} else {
for (ind = 4; ind <= page0[3] + 3; ind++)
if (page0[ind] == PAGE_83)
if (!do_scsi_page83_inquiry(udev, dev_scsi, fd,
- dev_scsi->serial, dev_scsi->serial_short, len, dev_scsi->unit_serial_number, dev_scsi->wwn)) {
+ dev_scsi->serial, dev_scsi->serial_short, len, dev_scsi->unit_serial_number, dev_scsi->wwn, dev_scsi->wwn_vendor_extension)) {
/*
* Success
*/
ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"
# by-id (World Wide Name)
-ENV{DEVTYPE}=="disk", ENV{ID_WWN}=="?*", SYMLINK+="disk/by-id/wwn-$env{ID_WWN}"
-ENV{DEVTYPE}=="partition", ENV{ID_WWN}=="?*", SYMLINK+="disk/by-id/wwn-$env{ID_WWN}-part%n"
+ENV{DEVTYPE}=="disk", ENV{ID_WWN_WITH_EXTENSION}=="?*", SYMLINK+="disk/by-id/wwn-$env{ID_WWN_WITH_EXTENSION}"
+ENV{DEVTYPE}=="partition", ENV{ID_WWN_WITH_EXTENSION}=="?*", SYMLINK+="disk/by-id/wwn-$env{ID_WWN_WITH_EXTENSION}-part%n"
LABEL="persistent_storage_end"