Linux CXL
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: linux-cxl@vger.kernel.org
Cc: alison.schofield@intel.com
Subject: [NDCTL PATCH resend 3/5] cxl: Add get major and minor for cxl features device
Date: Wed, 22 Jan 2025 17:24:52 -0700	[thread overview]
Message-ID: <20250123002530.2762440-4-dave.jiang@intel.com> (raw)
In-Reply-To: <20250123002530.2762440-1-dave.jiang@intel.com>

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 --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" */
-- 
2.47.1


  parent reply	other threads:[~2025-01-23  0:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-23  0:24 [NDCTL PATCH resend 0/5] ndctl: Add support and test for CXL features driver Dave Jiang
2025-01-23  0:24 ` [NDCTL PATCH resend 1/5] cxl: Add cxl_bus_get_by_provider() Dave Jiang
2025-01-23  0:24 ` [NDCTL PATCH resend 2/5] cxl: Enumerate features 'devices' Dave Jiang
2025-01-23  0:24 ` Dave Jiang [this message]
2025-01-23  0:24 ` [NDCTL PATCH resend 4/5] cxl: Associate CXL features device with CXL endpoint Dave Jiang
2025-01-23  0:24 ` [NDCTL PATCH resend 5/5] cxl/test: Add test for cxl features device Dave Jiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250123002530.2762440-4-dave.jiang@intel.com \
    --to=dave.jiang@intel.com \
    --cc=alison.schofield@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox