@@ -361,6 +361,16 @@ CXL_EXPORT size_t cxl_memdev_get_lsa_size(struct cxl_memdev *memdev)
return memdev->lsa_size;
}
+CXL_EXPORT int cxl_memdev_is_active(struct cxl_memdev *memdev)
+{
+ /*
+ * TODO: Currently memdevs are always considered inactive. Once we have
+ * cxl_bus drivers that are bound/unbound to memdevs, we'd use that to
+ * determine the active/inactive state.
+ */
+ return 0;
+}
+
CXL_EXPORT void cxl_cmd_unref(struct cxl_cmd *cmd)
{
if (!cmd)
@@ -43,6 +43,7 @@ unsigned long long cxl_memdev_get_pmem_size(struct cxl_memdev *memdev);
unsigned long long cxl_memdev_get_ram_size(struct cxl_memdev *memdev);
const char *cxl_memdev_get_firmware_verison(struct cxl_memdev *memdev);
size_t cxl_memdev_get_lsa_size(struct cxl_memdev *memdev);
+int cxl_memdev_is_active(struct cxl_memdev *memdev);
#define cxl_memdev_foreach(ctx, memdev) \
for (memdev = cxl_memdev_get_first(ctx); \
@@ -59,4 +59,5 @@ global:
LIBCXL_4 {
global:
cxl_memdev_get_lsa_size;
+ cxl_memdev_is_active;
} LIBCXL_3;
Add an interface to determine whether a memdev is bound to a region driver and therefore is currently active. For now, this just returns '0' all the time - i.e. devices are always considered inactive. Flesh this out fully once the region driver is available. Cc: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com> --- cxl/lib/libcxl.c | 10 ++++++++++ cxl/libcxl.h | 1 + cxl/lib/libcxl.sym | 1 + 3 files changed, 12 insertions(+)