Skip to content

Commit 961fe33

Browse files
martin-gpyigaw
authored andcommitted
tree: add routine to fetch subsys firmware rev
Add a new routine to fetch the subsystem firmware revision. Signed-off-by: Martin George <[email protected]>
1 parent ca46a81 commit 961fe33

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

src/libnvme.map

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SPDX-License-Identifier: LGPL-2.1-or-later
22
LIBNVME_1.13 {
33
global:
4+
nvme_subsystem_get_fw_rev;
45
nvme_subsystem_get_model;
56
};
67

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_fw_rev(nvme_subsystem_t s)
536+
{
537+
return s->firmware;
538+
}
539+
535540
nvme_ctrl_t nvme_subsystem_first_ctrl(nvme_subsystem_t s)
536541
{
537542
return list_top(&s->ctrls, struct nvme_ctrl, entry);

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_fw_rev() - Return the firmware rev of subsystem
1359+
* @s: nvme_subsystem_t object
1360+
*
1361+
* Return: Firmware revision of the current subsystem
1362+
*/
1363+
const char *nvme_subsystem_get_fw_rev(nvme_subsystem_t s);
1364+
13571365
/**
13581366
* nvme_scan_topology() - Scan NVMe topology and apply filter
13591367
* @r: nvme_root_t object

0 commit comments

Comments
 (0)