Skip to content

Commit 9517c84

Browse files
committed
tree: add routine to fetch subsys serial number
Add a new routine to fetch the subsystem serial number. Signed-off-by: Martin George <[email protected]>
1 parent 526bc01 commit 9517c84

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

src/libnvme.map

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# SPDX-License-Identifier: LGPL-2.1-or-later
2+
LIBNVME_1.14 {
3+
global:
4+
nvme_subsystem_get_serial;
5+
};
6+
27
LIBNVME_1.13 {
38
global:
49
nvme_subsystem_get_fw_rev;

src/nvme/tree.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,11 @@ const char *nvme_subsystem_get_model(nvme_subsystem_t s)
532532
return s->model;
533533
}
534534

535+
const char *nvme_subsystem_get_serial(nvme_subsystem_t s)
536+
{
537+
return s->serial;
538+
}
539+
535540
const char *nvme_subsystem_get_fw_rev(nvme_subsystem_t s)
536541
{
537542
return s->firmware;

src/nvme/tree.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,6 +1354,14 @@ const char *nvme_subsystem_get_iopolicy(nvme_subsystem_t s);
13541354
*/
13551355
const char *nvme_subsystem_get_model(nvme_subsystem_t s);
13561356

1357+
/**
1358+
* nvme_subsystem_get_serial() - Return the serial number of subsystem
1359+
* @s: nvme_subsystem_t object
1360+
*
1361+
* Return: Serial number of the current subsystem
1362+
*/
1363+
const char *nvme_subsystem_get_serial(nvme_subsystem_t s);
1364+
13571365
/**
13581366
* nvme_subsystem_get_fw_rev() - Return the firmware rev of subsystem
13591367
* @s: nvme_subsystem_t object

0 commit comments

Comments
 (0)