Skip to content

Commit 1c7472e

Browse files
ikegami-tigaw
authored andcommitted
mi: add arbitration feature get function
The set feature is prohibited for the management endpoint support. Signed-off-by: Tokunori Ikegami <[email protected]>
1 parent 69e2440 commit 1c7472e

3 files changed

Lines changed: 39 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_mi_admin_get_features_arbitration;
35
};
46

57
LIBNVME_1_14 {

src/nvme/mi.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,6 +1398,31 @@ int nvme_mi_admin_get_features(nvme_mi_ctrl_t ctrl,
13981398
return 0;
13991399
}
14001400

1401+
static int __nvme_mi_admin_get_features(nvme_mi_ctrl_t ctrl, enum nvme_features_id fid,
1402+
enum nvme_get_features_sel sel, __u32 *result)
1403+
{
1404+
struct nvme_get_features_args args = {
1405+
.args_size = sizeof(args),
1406+
.fid = fid,
1407+
.nsid = NVME_NSID_NONE,
1408+
.sel = sel,
1409+
.cdw11 = 0,
1410+
.uuidx = NVME_UUID_NONE,
1411+
.data_len = 0,
1412+
.data = NULL,
1413+
.timeout = NVME_DEFAULT_IOCTL_TIMEOUT,
1414+
.result = result,
1415+
};
1416+
1417+
return nvme_mi_admin_get_features(ctrl, &args);
1418+
}
1419+
1420+
int nvme_mi_admin_get_features_arbitration(nvme_mi_ctrl_t ctrl, enum nvme_get_features_sel sel,
1421+
__u32 *result)
1422+
{
1423+
return __nvme_mi_admin_get_features(ctrl, NVME_FEAT_FID_ARBITRATION, sel, result);
1424+
}
1425+
14011426
int nvme_mi_admin_set_features(nvme_mi_ctrl_t ctrl,
14021427
struct nvme_set_features_args *args)
14031428
{

src/nvme/mi.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3137,6 +3137,18 @@ int nvme_mi_admin_security_recv(nvme_mi_ctrl_t ctrl,
31373137
int nvme_mi_admin_get_features(nvme_mi_ctrl_t ctrl,
31383138
struct nvme_get_features_args *args);
31393139

3140+
/**
3141+
* nvme_mi_admin_get_features_arbitration() - Get arbitration feature
3142+
* @ctrl: Controller to send command to
3143+
* @sel: Select which type of attribute to return, see &enum nvme_get_features_sel
3144+
* @result: The feature data is returned in this argument
3145+
*
3146+
* Return: The nvme command status if a response was received (see
3147+
* &enum nvme_status_field) or -1 with errno set otherwise.
3148+
*/
3149+
int nvme_mi_admin_get_features_arbitration(nvme_mi_ctrl_t ctrl, enum nvme_get_features_sel sel,
3150+
__u32 *result);
3151+
31403152
/**
31413153
* nvme_mi_admin_get_features_data() - Helper function for &nvme_mi_admin_get_features()
31423154
* @ctrl: Controller to send command to

0 commit comments

Comments
 (0)