Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Mar 2013 19:52:58 +0000 (UTC)
From:      Jim Harris <jimharris@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r248747 - head/sys/dev/nvme
Message-ID:  <201303261952.r2QJqw3Q088323@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jimharris
Date: Tue Mar 26 19:52:57 2013
New Revision: 248747
URL: http://svnweb.freebsd.org/changeset/base/248747

Log:
  Add API for nvme consumers to access controller and namespace identify data.
  
  Sponsored by:	Intel
  Reviewed by:	carl

Modified:
  head/sys/dev/nvme/nvme.h
  head/sys/dev/nvme/nvme_ctrlr.c
  head/sys/dev/nvme/nvme_ns.c

Modified: head/sys/dev/nvme/nvme.h
==============================================================================
--- head/sys/dev/nvme/nvme.h	Tue Mar 26 19:50:46 2013	(r248746)
+++ head/sys/dev/nvme/nvme.h	Tue Mar 26 19:52:57 2013	(r248747)
@@ -740,6 +740,8 @@ void		nvme_unregister_consumer(struct nv
 
 /* Controller helper functions */
 device_t	nvme_ctrlr_get_device(struct nvme_controller *ctrlr);
+const struct nvme_controller_data *
+		nvme_ctrlr_get_data(struct nvme_controller *ctrlr);
 
 /* Namespace helper functions */
 uint32_t	nvme_ns_get_max_io_xfer_size(struct nvme_namespace *ns);
@@ -749,6 +751,8 @@ uint64_t	nvme_ns_get_size(struct nvme_na
 uint32_t	nvme_ns_get_flags(struct nvme_namespace *ns);
 const char *	nvme_ns_get_serial_number(struct nvme_namespace *ns);
 const char *	nvme_ns_get_model_number(struct nvme_namespace *ns);
+const struct nvme_namespace_data *
+		nvme_ns_get_data(struct nvme_namespace *ns);
 
 int	nvme_ns_bio_process(struct nvme_namespace *ns, struct bio *bp,
 			    nvme_cb_fn_t cb_fn);

Modified: head/sys/dev/nvme/nvme_ctrlr.c
==============================================================================
--- head/sys/dev/nvme/nvme_ctrlr.c	Tue Mar 26 19:50:46 2013	(r248746)
+++ head/sys/dev/nvme/nvme_ctrlr.c	Tue Mar 26 19:52:57 2013	(r248747)
@@ -942,3 +942,10 @@ nvme_ctrlr_get_device(struct nvme_contro
 
 	return (ctrlr->dev);
 }
+
+const struct nvme_controller_data *
+nvme_ctrlr_get_data(struct nvme_controller *ctrlr)
+{
+
+	return (&ctrlr->cdata);
+}

Modified: head/sys/dev/nvme/nvme_ns.c
==============================================================================
--- head/sys/dev/nvme/nvme_ns.c	Tue Mar 26 19:50:46 2013	(r248746)
+++ head/sys/dev/nvme/nvme_ns.c	Tue Mar 26 19:52:57 2013	(r248747)
@@ -221,6 +221,13 @@ nvme_ns_get_model_number(struct nvme_nam
 	return ((const char *)ns->ctrlr->cdata.mn);
 }
 
+const struct nvme_namespace_data *
+nvme_ns_get_data(struct nvme_namespace *ns)
+{
+
+	return (&ns->data);
+}
+
 static void
 nvme_ns_bio_done(void *arg, const struct nvme_completion *status)
 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201303261952.r2QJqw3Q088323>