1
0
Fork 0

Adding upstream version 2.3.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-16 12:20:36 +01:00
parent 8dc527e3df
commit a7aa0c3253
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
444 changed files with 5289 additions and 1980 deletions

30
plugins/ocp/ocp-utils.c Normal file
View file

@ -0,0 +1,30 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (c) 2022 Solidigm.
*
* Author: leonardo.da.cunha@solidigm.com
*/
#include "ocp-utils.h"
const unsigned char ocp_uuid[NVME_UUID_LEN] = {
0x6f, 0xbe, 0x56, 0x8f, 0x99, 0x29, 0x1d, 0xa2, 0x94, 0x47,
0x94, 0xe0, 0x5b, 0xd5, 0x94, 0xc1 };
int ocp_get_uuid_index(struct nvme_dev *dev, int *index)
{
struct nvme_id_uuid_list uuid_list;
int err = nvme_identify_uuid(dev_fd(dev), &uuid_list);
*index = 0;
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;
}