zconf/lscss: show device number from pmcw

lscss shows device number as 'None' if the corresponding device in the
subchannel is non-operational or not connected. Instead, show the
device-no derived from the new dev_busid attribute which provides the
value of device_id irrespective of the device availability.

i.e the current lscss shows

Device   Subchan.  DevType CU Type Use  PIM PAM POM  CHPIDs
----------------------------------------------------------------------
0.0.0000 0.0.0000  3390/0c 3990/e9      f0  a0  ff   32333435 00000000
none     0.0.00c7                       f0  a0  5f   32333435 00000000
none     0.0.00c8                       f0  a0  5f   32333435 00000000

here the subchannels 0.0.00c7 and 0.0.00c8 do not have an operational
device on them. Hence the device is shown as none.

With this patch,

Device   Subchan.  DevType CU Type Use  PIM PAM POM  CHPIDs
----------------------------------------------------------------------
0.0.0000 0.0.0000  3390/0c 3990/e9      f0  a0  ff   32333435 00000000
0.0.74c8 0.0.00c7                       f0  a0  5f   32333435 00000000
0.0.74c9 0.0.00c8                       f0  a0  5f   32333435 00000000

The device-no is shown as 0.0.74c8; Where the DevType field still
indicates that the device is not present.

Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Vineeth Vijayan
2021-07-18 15:43:44 +02:00
committed by Jan Höppner
parent 890b15d158
commit 761a185938

View File

@@ -463,7 +463,15 @@ static int fill_io_devid(struct util_rec *rec, char *path)
util_scandir_free(de_vec, count);
return 1;
}
strncpy(buf, "none", sizeof(buf));
if (util_file_read_line(buf, sizeof(buf), "%s/dev_busid",
path) == 0) {
if (cmd.opt_short) {
if (strncmp(buf, "0.0.", PREFIX_ID_LENGTH) != 0)
return 1;
memmove(buf, buf + PREFIX_ID_LENGTH,
(sizeof(buf) - PREFIX_ID_LENGTH));
}
}
fill_device_info(rec, NULL, NULL);
}
if (cmd.opt_uppercase)