Skip to content

Commit 7af7e42

Browse files
martin-gpyigaw
authored andcommitted
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 97f4883 commit 7af7e42

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/libnvme.map

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# SPDX-License-Identifier: LGPL-2.1-or-later
22
LIBNVME_UNRELEASED {
3+
global:
4+
nvme_subsystem_get_serial;
35
};
46

57
LIBNVME_1.13 {

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)