Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Aug 2020 19:38:03 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r365005 - head/sys/dev/nvme
Message-ID:  <202008311938.07VJc3NO064814@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Mon Aug 31 19:38:03 2020
New Revision: 365005
URL: https://svnweb.freebsd.org/changeset/base/365005

Log:
  Use symbolic names for asych events
  
  Rather than |= 0x300, define and use asyn event names for the name
  space changes and the firmware activations that we're asking for.

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

Modified: head/sys/dev/nvme/nvme.h
==============================================================================
--- head/sys/dev/nvme/nvme.h	Mon Aug 31 18:47:56 2020	(r365004)
+++ head/sys/dev/nvme/nvme.h	Mon Aug 31 19:38:03 2020	(r365005)
@@ -454,6 +454,8 @@ enum nvme_critical_warning_state {
 	NVME_CRIT_WARN_ST_VOLATILE_MEMORY_BACKUP	= 0x10,
 };
 #define NVME_CRIT_WARN_ST_RESERVED_MASK			(0xE0)
+#define	NVME_ASYNC_EVENT_NS_ATTRIBUTE			(0x100)
+#define	NVME_ASYNC_EVENT_FW_ACTIVATE			(0x200)
 
 /* slot for current FW */
 #define NVME_FIRMWARE_PAGE_AFI_SLOT_SHIFT		(0)

Modified: head/sys/dev/nvme/nvme_ctrlr.c
==============================================================================
--- head/sys/dev/nvme/nvme_ctrlr.c	Mon Aug 31 18:47:56 2020	(r365004)
+++ head/sys/dev/nvme/nvme_ctrlr.c	Mon Aug 31 19:38:03 2020	(r365005)
@@ -835,7 +835,8 @@ nvme_ctrlr_configure_aer(struct nvme_controller *ctrlr
 	    NVME_CRIT_WARN_ST_READ_ONLY |
 	    NVME_CRIT_WARN_ST_VOLATILE_MEMORY_BACKUP;
 	if (ctrlr->cdata.ver >= NVME_REV(1, 2))
-		ctrlr->async_event_config |= 0x300;
+		ctrlr->async_event_config |= NVME_ASYNC_EVENT_NS_ATTRIBUTE |
+		    NVME_ASYNC_EVENT_FW_ACTIVATE;
 
 	status.done = 0;
 	nvme_ctrlr_cmd_get_feature(ctrlr, NVME_FEAT_TEMPERATURE_THRESHOLD,



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