Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Mar 2013 21:03:03 +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: r248758 - head/sys/dev/nvme
Message-ID:  <201303262103.r2QL330p010962@svn.freebsd.org>

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

Log:
  Add structure definitions and controller command function for firmware
  log pages.
  
  Sponsored by:	Intel
  Reviewed by:	carl

Modified:
  head/sys/dev/nvme/nvme.h
  head/sys/dev/nvme/nvme_ctrlr_cmd.c
  head/sys/dev/nvme/nvme_private.h

Modified: head/sys/dev/nvme/nvme.h
==============================================================================
--- head/sys/dev/nvme/nvme.h	Tue Mar 26 21:01:53 2013	(r248757)
+++ head/sys/dev/nvme/nvme.h	Tue Mar 26 21:03:03 2013	(r248758)
@@ -682,6 +682,18 @@ struct nvme_health_information_page {
 	uint8_t			reserved2[320];
 } __packed __aligned(4);
 
+struct nvme_firmware_page {
+
+	struct {
+		uint8_t	slot		: 3; /* slot for current FW */
+		uint8_t	reserved	: 5;
+	} __packed afi;
+
+	uint8_t			reserved[7];
+	uint64_t		revision[7]; /* revisions for 7 slots */
+	uint8_t			reserved2[448];
+} __packed __aligned(4);
+
 #define NVME_TEST_MAX_THREADS	128
 
 struct nvme_io_test {

Modified: head/sys/dev/nvme/nvme_ctrlr_cmd.c
==============================================================================
--- head/sys/dev/nvme/nvme_ctrlr_cmd.c	Tue Mar 26 21:01:53 2013	(r248757)
+++ head/sys/dev/nvme/nvme_ctrlr_cmd.c	Tue Mar 26 21:03:03 2013	(r248758)
@@ -298,6 +298,16 @@ nvme_ctrlr_cmd_get_health_information_pa
 }
 
 void
+nvme_ctrlr_cmd_get_firmware_page(struct nvme_controller *ctrlr,
+    struct nvme_firmware_page *payload, nvme_cb_fn_t cb_fn, void *cb_arg)
+{
+
+	nvme_ctrlr_cmd_get_log_page(ctrlr, NVME_LOG_FIRMWARE_SLOT, 
+	    NVME_GLOBAL_NAMESPACE_TAG, payload, sizeof(*payload), cb_fn,
+	    cb_arg);
+}
+
+void
 nvme_ctrlr_cmd_abort(struct nvme_controller *ctrlr, uint16_t cid,
     uint16_t sqid, nvme_cb_fn_t cb_fn, void *cb_arg)
 {

Modified: head/sys/dev/nvme/nvme_private.h
==============================================================================
--- head/sys/dev/nvme/nvme_private.h	Tue Mar 26 21:01:53 2013	(r248757)
+++ head/sys/dev/nvme/nvme_private.h	Tue Mar 26 21:03:03 2013	(r248758)
@@ -352,6 +352,10 @@ void	nvme_ctrlr_cmd_get_health_informati
 						   struct nvme_health_information_page *payload,
 						   nvme_cb_fn_t cb_fn,
 						   void *cb_arg);
+void	nvme_ctrlr_cmd_get_firmware_page(struct nvme_controller *ctrlr,
+					 struct nvme_firmware_page *payload,
+					 nvme_cb_fn_t cb_fn,
+					 void *cb_arg);
 void	nvme_ctrlr_cmd_create_io_cq(struct nvme_controller *ctrlr,
 				    struct nvme_qpair *io_que, uint16_t vector,
 				    nvme_cb_fn_t cb_fn, void *cb_arg);



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