@@ -1423,6 +1423,12 @@ int nvme_mi_admin_get_features_arbitration(nvme_mi_ctrl_t ctrl, enum nvme_get_fe
14231423 return __nvme_mi_admin_get_features (ctrl , NVME_FEAT_FID_ARBITRATION , sel , result );
14241424}
14251425
1426+ int nvme_mi_admin_get_features_power_mgmt (nvme_mi_ctrl_t ctrl , enum nvme_get_features_sel sel ,
1427+ __u32 * result )
1428+ {
1429+ return __nvme_mi_admin_get_features (ctrl , NVME_FEAT_FID_POWER_MGMT , sel , result );
1430+ }
1431+
14261432int nvme_mi_admin_set_features (nvme_mi_ctrl_t ctrl ,
14271433 struct nvme_set_features_args * args )
14281434{
@@ -1467,6 +1473,33 @@ int nvme_mi_admin_set_features(nvme_mi_ctrl_t ctrl,
14671473 return 0 ;
14681474}
14691475
1476+ static int __nvme_mi_admin_set_features (nvme_mi_ctrl_t ctrl , __u8 fid , __u32 cdw11 , bool save ,
1477+ __u32 * result )
1478+ {
1479+ struct nvme_set_features_args args = {
1480+ .args_size = sizeof (args ),
1481+ .nsid = NVME_NSID_NONE ,
1482+ .cdw11 = cdw11 ,
1483+ .cdw12 = 0 ,
1484+ .save = save ,
1485+ .uuidx = NVME_UUID_NONE ,
1486+ .cdw15 = 0 ,
1487+ .data_len = 0 ,
1488+ .data = NULL ,
1489+ .timeout = NVME_DEFAULT_IOCTL_TIMEOUT ,
1490+ .result = result ,
1491+ };
1492+ return nvme_mi_admin_set_features (ctrl , & args );
1493+ }
1494+
1495+ int nvme_mi_admin_set_features_power_mgmt (nvme_mi_ctrl_t ctrl , __u8 ps , __u8 wh , bool save ,
1496+ __u32 * result )
1497+ {
1498+ __u32 value = NVME_SET (ps , FEAT_PWRMGMT_PS ) | NVME_SET (wh , FEAT_PWRMGMT_WH );
1499+
1500+ return __nvme_mi_admin_set_features (ctrl , NVME_FEAT_FID_POWER_MGMT , value , save , result );
1501+ }
1502+
14701503int nvme_mi_admin_ns_mgmt (nvme_mi_ctrl_t ctrl ,
14711504 struct nvme_ns_mgmt_args * args )
14721505{
0 commit comments