|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
From 244862cbbfecda9b6b638eccaca526f4daba2795 Mon Sep 17 00:00:00 2001
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
From: Vishal Verma <vishal.l.verma@intel.com>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
Date: Thu, 7 Oct 2021 02:21:28 -0600
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
Subject: [PATCH 036/217] libcxl: add support for the 'Identify Device' command
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
Add APIs to allocate and send an 'Identify Device' command, and
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
accessors to retrieve some of the fields from the resulting data.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
Only add a handful accessor functions; more can be added as the need
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
arises. The fields added are fw_revision, partition_align, and
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
lsa_size.
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
Cc: Ben Widawsky <ben.widawsky@intel.com>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
Cc: Dan Williams <dan.j.williams@intel.com>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
---
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
cxl/lib/libcxl.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
cxl/lib/libcxl.sym | 4 ++++
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
cxl/lib/private.h | 19 +++++++++++++++++
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
cxl/libcxl.h | 4 ++++
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
4 files changed, 79 insertions(+)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/cxl/lib/libcxl.c b/cxl/lib/libcxl.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index 727d599..ed21670 100644
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/cxl/lib/libcxl.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ b/cxl/lib/libcxl.c
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -13,7 +13,10 @@
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
#include <sys/sysmacros.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
#include <uuid/uuid.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
#include <ccan/list/list.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+#include <ccan/endian/endian.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+#include <ccan/minmax/minmax.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
#include <ccan/array_size/array_size.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+#include <ccan/short_types/short_types.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
#include <util/log.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
#include <util/size.h>
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -674,6 +677,55 @@ CXL_EXPORT const char *cxl_cmd_get_devname(struct cxl_cmd *cmd)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
return cxl_memdev_get_devname(cmd->memdev);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+CXL_EXPORT struct cxl_cmd *cxl_cmd_new_identify(struct cxl_memdev *memdev)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ return cxl_cmd_new_generic(memdev, CXL_MEM_COMMAND_ID_IDENTIFY);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+CXL_EXPORT int cxl_cmd_identify_get_fw_rev(struct cxl_cmd *cmd, char *fw_rev,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ int fw_len)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ struct cxl_cmd_identify *id =
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ (struct cxl_cmd_identify *)cmd->send_cmd->out.payload;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ if (cmd->send_cmd->id != CXL_MEM_COMMAND_ID_IDENTIFY)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ return -EINVAL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ if (cmd->status < 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ return cmd->status;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ if (fw_len > 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ memcpy(fw_rev, id->fw_revision,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ min(fw_len, CXL_CMD_IDENTIFY_FW_REV_LENGTH));
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ return 0;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+CXL_EXPORT unsigned long long cxl_cmd_identify_get_partition_align(
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ struct cxl_cmd *cmd)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ struct cxl_cmd_identify *id =
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ (struct cxl_cmd_identify *)cmd->send_cmd->out.payload;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ if (cmd->send_cmd->id != CXL_MEM_COMMAND_ID_IDENTIFY)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ return -EINVAL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ if (cmd->status < 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ return cmd->status;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ return le64_to_cpu(id->partition_align);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+CXL_EXPORT unsigned int cxl_cmd_identify_get_label_size(struct cxl_cmd *cmd)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ struct cxl_cmd_identify *id =
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ (struct cxl_cmd_identify *)cmd->send_cmd->out.payload;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ if (cmd->send_cmd->id != CXL_MEM_COMMAND_ID_IDENTIFY)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ return -EINVAL;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ if (cmd->status < 0)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ return cmd->status;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ return le32_to_cpu(id->lsa_size);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+}
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
CXL_EXPORT struct cxl_cmd *cxl_cmd_new_raw(struct cxl_memdev *memdev,
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
int opcode)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/cxl/lib/libcxl.sym b/cxl/lib/libcxl.sym
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index 3900f90..1dc45f4 100644
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/cxl/lib/libcxl.sym
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ b/cxl/lib/libcxl.sym
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -29,6 +29,10 @@ global:
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
cxl_cmd_submit;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
cxl_cmd_get_mbox_status;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
cxl_cmd_get_out_size;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ cxl_cmd_new_identify;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ cxl_cmd_identify_get_fw_rev;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ cxl_cmd_identify_get_partition_align;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ cxl_cmd_identify_get_label_size;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
local:
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
*;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
};
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/cxl/lib/private.h b/cxl/lib/private.h
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index 87ca17e..3273f21 100644
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/cxl/lib/private.h
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ b/cxl/lib/private.h
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -54,6 +54,25 @@ struct cxl_cmd {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
int status;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
};
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+#define CXL_CMD_IDENTIFY_FW_REV_LENGTH 0x10
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+struct cxl_cmd_identify {
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ char fw_revision[CXL_CMD_IDENTIFY_FW_REV_LENGTH];
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ le64 total_capacity;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ le64 volatile_capacity;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ le64 persistent_capacity;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ le64 partition_align;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ le16 info_event_log_size;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ le16 warning_event_log_size;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ le16 failure_event_log_size;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ le16 fatal_event_log_size;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ le32 lsa_size;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ u8 poison_list_max_mer[3];
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ le16 inject_poison_limit;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ u8 poison_caps;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+ u8 qos_telemetry_caps;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+} __attribute__((packed));
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
static inline int check_kmod(struct kmod_ctx *kmod_ctx)
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
{
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
return kmod_ctx ? 0 : -ENXIO;
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
diff --git a/cxl/libcxl.h b/cxl/libcxl.h
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
index 6e87b80..0f2d5e9 100644
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--- a/cxl/libcxl.h
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+++ b/cxl/libcxl.h
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
@@ -58,6 +58,10 @@ void cxl_cmd_unref(struct cxl_cmd *cmd);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
int cxl_cmd_submit(struct cxl_cmd *cmd);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
int cxl_cmd_get_mbox_status(struct cxl_cmd *cmd);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
int cxl_cmd_get_out_size(struct cxl_cmd *cmd);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+struct cxl_cmd *cxl_cmd_new_identify(struct cxl_memdev *memdev);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+int cxl_cmd_identify_get_fw_rev(struct cxl_cmd *cmd, char *fw_rev, int fw_len);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+unsigned long long cxl_cmd_identify_get_partition_align(struct cxl_cmd *cmd);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
+unsigned int cxl_cmd_identify_get_label_size(struct cxl_cmd *cmd);
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
#ifdef __cplusplus
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
} /* extern "C" */
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
--
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
2.27.0
|
|
![](https://seccdn.libravatar.org/avatar/e9a507678aa95ef1a85b8d3939d526545e03c5d44f3a7d4e5247de29fff9c563?s=16&d=retro) |
e0018b |
|