Merging upstream version 2.9.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
bb95f41000
commit
698d985f9d
451 changed files with 5896 additions and 2734 deletions
|
@ -18,7 +18,7 @@ static int ocp_clear_feature(int argc, char **argv, const char *desc, const __u8
|
|||
__u32 result = 0;
|
||||
__u32 clear = 1 << 31;
|
||||
struct nvme_dev *dev;
|
||||
int uuid_index = 0;
|
||||
__u8 uuid_index = 0;
|
||||
bool uuid = true;
|
||||
int err;
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ static void ocp_fw_activation_history_normal(const struct fw_activation_history
|
|||
printf(" %-22s%d\n", "activation count:",
|
||||
le16_to_cpu(entry->activation_count));
|
||||
printf(" %-22s%"PRIu64"\n", "timestamp:",
|
||||
le64_to_cpu(entry->timestamp));
|
||||
(0x0000FFFFFFFFFFFF & le64_to_cpu(entry->timestamp)));
|
||||
printf(" %-22s%"PRIu64"\n", "power cycle count:",
|
||||
le64_to_cpu(entry->power_cycle_count));
|
||||
printf(" %-22s%.*s\n", "previous firmware:", (int)sizeof(entry->previous_fw),
|
||||
|
@ -106,7 +106,7 @@ static void ocp_fw_activation_history_json(const struct fw_activation_history *f
|
|||
json_object_add_value_uint(entry_obj, "activation count",
|
||||
le16_to_cpu(entry->activation_count));
|
||||
json_object_add_value_uint64(entry_obj, "timestamp",
|
||||
le64_to_cpu(entry->timestamp));
|
||||
(0x0000FFFFFFFFFFFF & le64_to_cpu(entry->timestamp)));
|
||||
json_object_add_value_uint(entry_obj, "power cycle count",
|
||||
le64_to_cpu(entry->power_cycle_count));
|
||||
|
||||
|
@ -162,7 +162,7 @@ int ocp_fw_activation_history_log(int argc, char **argv, struct command *cmd,
|
|||
if (err)
|
||||
return err;
|
||||
|
||||
int uuid_index = 0;
|
||||
__u8 uuid_index = 0;
|
||||
|
||||
/*
|
||||
* Best effort attempt at uuid. Otherwise, assume no index (i.e. 0)
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -30,6 +30,9 @@ PLUGIN(NAME("ocp", "OCP cloud SSD extensions", NVME_VERSION),
|
|||
ENTRY("set-plp-health-check-interval", "Set PLP Health Check Interval", set_plp_health_check_interval)
|
||||
ENTRY("get-plp-health-check-interval", "Get PLP Health Check Interval", get_plp_health_check_interval)
|
||||
ENTRY("telemetry-string-log", "Retrieve Telemetry string Log Page", ocp_telemetry_str_log_format)
|
||||
ENTRY("set-telemetry-profile", "Set Telemetry Profile Feature", ocp_set_telemetry_profile_feature)
|
||||
ENTRY("set-dssd-async-event-config", "Set DSSD Async Event Config", set_dssd_async_event_config)
|
||||
ENTRY("get-dssd-async-event-config", "Get DSSD Async Event Config", get_dssd_async_event_config)
|
||||
)
|
||||
);
|
||||
|
||||
|
|
|
@ -1,19 +1,32 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* Copyright (c) 2022 Solidigm.
|
||||
* Copyright (c) 2022-2024 Solidigm.
|
||||
*
|
||||
* Author: leonardo.da.cunha@solidigm.com
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include "ocp-utils.h"
|
||||
#include "nvme-print.h"
|
||||
|
||||
const unsigned char ocp_uuid[NVME_UUID_LEN] = {
|
||||
0xc1, 0x94, 0xd5, 0x5b, 0xe0, 0x94, 0x47, 0x94, 0xa2, 0x1d,
|
||||
0x29, 0x99, 0x8f, 0x56, 0xbe, 0x6f };
|
||||
|
||||
int ocp_get_uuid_index(struct nvme_dev *dev, int *index)
|
||||
int ocp_find_uuid_index(struct nvme_id_uuid_list *uuid_list, __u8 *index)
|
||||
{
|
||||
int i = nvme_uuid_find(uuid_list, ocp_uuid);
|
||||
|
||||
*index = 0;
|
||||
if (i > 0)
|
||||
*index = i;
|
||||
else
|
||||
return -errno;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ocp_get_uuid_index(struct nvme_dev *dev, __u8 *index)
|
||||
{
|
||||
struct nvme_id_uuid_list uuid_list;
|
||||
int err = nvme_identify_uuid(dev_fd(dev), &uuid_list);
|
||||
|
@ -22,11 +35,5 @@ int ocp_get_uuid_index(struct nvme_dev *dev, int *index)
|
|||
if (err)
|
||||
return err;
|
||||
|
||||
for (int i = 0; i < NVME_ID_UUID_LIST_MAX; i++) {
|
||||
if (memcmp(ocp_uuid, &uuid_list.entry[i].uuid, NVME_UUID_LEN) == 0) {
|
||||
*index = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return err;
|
||||
return ocp_find_uuid_index(&uuid_list, index);
|
||||
}
|
||||
|
|
|
@ -1,18 +1,32 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
/*
|
||||
* Copyright (c) 2022 Solidigm.
|
||||
* Copyright (c) 2022-2024 Solidigm.
|
||||
*
|
||||
* Author: leonardo.da.cunha@solidigm.com
|
||||
*/
|
||||
|
||||
#include "nvme.h"
|
||||
|
||||
/*
|
||||
* UUID assigned for OCP.
|
||||
*/
|
||||
extern const unsigned char ocp_uuid[NVME_UUID_LEN];
|
||||
|
||||
/**
|
||||
* ocp_get_uuid_index() - Get OCP UUID index
|
||||
* @dev: nvme device
|
||||
* @index: integer pointer to here to save the index
|
||||
* @result: The command completion result from CQE dword0
|
||||
*
|
||||
* Return: Zero if nvme device has UUID list log page, or result of get uuid list otherwise.
|
||||
* Return: Zero if nvme device has UUID list identify page, or positive result of get uuid list
|
||||
* or negative POSIX error code otherwise.
|
||||
*/
|
||||
int ocp_get_uuid_index(struct nvme_dev *dev, int *index);
|
||||
int ocp_get_uuid_index(struct nvme_dev *dev, __u8 *index);
|
||||
|
||||
/**
|
||||
* ocp_find_uuid_index() - Find OCP UUID index in UUID list
|
||||
* @uuid_list: uuid_list retrieved from Identify UUID List (CNS 0x17)
|
||||
* @index: integer pointer to here to save the index
|
||||
*
|
||||
* Return: Zero if nvme device has UUID list log page, Negative POSIX error code otherwise.
|
||||
*/
|
||||
int ocp_find_uuid_index(struct nvme_id_uuid_list *uuid_list, __u8 *index);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue