Skip to content

Commit 1e95376

Browse files
committed
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 b952563 commit 1e95376

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
@@ -9,6 +9,7 @@ LIBNVME_1.12 {
99
nvme_lm_get_features_ctrl_data_queue;
1010
nvmf_exat_ptr_next;
1111
nvme_subsystem_get_model;
12+
nvme_subsystem_get_fw_rev;
1213
};
1314

1415
LIBNVME_1.11 {

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)