Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tree: add routines to fetch additional subsystem attributes #972

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/libnvme.map
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ LIBNVME_1.12 {
nvme_lm_set_features_ctrl_data_queue;
nvme_lm_get_features_ctrl_data_queue;
nvmf_exat_ptr_next;
nvme_subsystem_get_model;
nvme_subsystem_get_fw_rev;
};

LIBNVME_1.11 {
Expand Down
10 changes: 10 additions & 0 deletions src/nvme/tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,16 @@ const char *nvme_subsystem_get_iopolicy(nvme_subsystem_t s)
return s->iopolicy;
}

const char *nvme_subsystem_get_model(nvme_subsystem_t s)
{
return s->model;
}

const char *nvme_subsystem_get_fw_rev(nvme_subsystem_t s)
{
return s->firmware;
}

nvme_ctrl_t nvme_subsystem_first_ctrl(nvme_subsystem_t s)
{
return list_top(&s->ctrls, struct nvme_ctrl, entry);
Expand Down
16 changes: 16 additions & 0 deletions src/nvme/tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -1346,6 +1346,22 @@ void nvme_subsystem_set_application(nvme_subsystem_t s, const char *a);
*/
const char *nvme_subsystem_get_iopolicy(nvme_subsystem_t s);

/**
* nvme_subsystem_get_model() - Return the model of subsystem
* @s: nvme_subsystem_t object
*
* Return: Model of the current subsystem
*/
const char *nvme_subsystem_get_model(nvme_subsystem_t s);

/**
* nvme_subsystem_get_fw_rev() - Return the firmware rev of subsystem
* @s: nvme_subsystem_t object
*
* Return: Firmware revision of the current subsystem
*/
const char *nvme_subsystem_get_fw_rev(nvme_subsystem_t s);

/**
* nvme_scan_topology() - Scan NVMe topology and apply filter
* @r: nvme_root_t object
Expand Down