diff mbox series

[NDCTL,resend,3/5] cxl: Add get major and minor for cxl features device

Message ID 20250123002530.2762440-4-dave.jiang@intel.com
State New
Headers show
Series ndctl: Add support and test for CXL features driver | expand

Commit Message

Dave Jiang Jan. 23, 2025, 12:24 a.m. UTC
Add helper functions to retrieve the major and minor of the associated
char device for the cxl features device. The char device provides
access to issue ioctl via the FWCTL subsystem to the CXL features
driver for CXL mailbox feature commands.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
 cxl/lib/libcxl.c   | 10 ++++++++++
 cxl/lib/libcxl.sym |  2 ++
 cxl/libcxl.h       |  2 ++
 3 files changed, 14 insertions(+)
diff mbox series

Patch

diff --git a/cxl/lib/libcxl.c b/cxl/lib/libcxl.c
index 8bc0394543dc..f2da48278cb0 100644
--- a/cxl/lib/libcxl.c
+++ b/cxl/lib/libcxl.c
@@ -4874,3 +4874,13 @@  CXL_EXPORT struct cxl_features *cxl_features_get_next(struct cxl_features *featu
 
 	return list_next(&ctx->features, features, list);
 }
+
+CXL_EXPORT int cxl_features_get_major(struct cxl_features *features)
+{
+	return features->major;
+}
+
+CXL_EXPORT int cxl_features_get_minor(struct cxl_features *features)
+{
+	return features->minor;
+}
diff --git a/cxl/lib/libcxl.sym b/cxl/lib/libcxl.sym
index 9b1708d8e86a..6d70d5b90377 100644
--- a/cxl/lib/libcxl.sym
+++ b/cxl/lib/libcxl.sym
@@ -294,4 +294,6 @@  global:
 	cxl_bus_get_by_provider;
 	cxl_features_get_first;
 	cxl_features_get_next;
+	cxl_features_get_major;
+	cxl_features_get_minor;
 } LIBECXL_8;
diff --git a/cxl/libcxl.h b/cxl/libcxl.h
index 7e94eb8bce24..5dcc60c8bf1a 100644
--- a/cxl/libcxl.h
+++ b/cxl/libcxl.h
@@ -497,6 +497,8 @@  struct cxl_features;
 
 struct cxl_features *cxl_features_get_first(struct cxl_ctx *ctx);
 struct cxl_features *cxl_features_get_next(struct cxl_features *features);
+int cxl_features_get_major(struct cxl_features *features);
+int cxl_features_get_minor(struct cxl_features *features);
 
 #ifdef __cplusplus
 } /* extern "C" */