From owner-svn-src-head@FreeBSD.ORG Tue Mar 26 19:52:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D4F70B83; Tue, 26 Mar 2013 19:52:58 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AF115A27; Tue, 26 Mar 2013 19:52:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2QJqw7x088328; Tue, 26 Mar 2013 19:52:58 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2QJqw3Q088323; Tue, 26 Mar 2013 19:52:58 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201303261952.r2QJqw3Q088323@svn.freebsd.org> From: Jim Harris Date: Tue, 26 Mar 2013 19:52:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248747 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Mar 2013 19:52:58 -0000 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) {