Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Oct 2015 04:33:05 +0000 (UTC)
From:      "Conrad E. Meyer" <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r289732 - head/sys/dev/ioat
Message-ID:  <201510220433.t9M4X5hL041498@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem
Date: Thu Oct 22 04:33:05 2015
New Revision: 289732
URL: https://svnweb.freebsd.org/changeset/base/289732

Log:
  ioat: Define IOAT_XFERCAP_VALID_MASK and use in ioat_read_xfercap
  
  Instead of ANDing a magic constant later.
  
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/sys/dev/ioat/ioat.c
  head/sys/dev/ioat/ioat_hw.h
  head/sys/dev/ioat/ioat_internal.h

Modified: head/sys/dev/ioat/ioat.c
==============================================================================
--- head/sys/dev/ioat/ioat.c	Thu Oct 22 04:28:22 2015	(r289731)
+++ head/sys/dev/ioat/ioat.c	Thu Oct 22 04:33:05 2015	(r289732)
@@ -341,9 +341,6 @@ ioat3_attach(device_t device)
 	capabilities = ioat_read_dmacapability(ioat);
 
 	xfercap = ioat_read_xfercap(ioat);
-
-	/* Only bits [4:0] are valid. */
-	xfercap &= 0x1f;
 	ioat->max_xfer_size = 1 << xfercap;
 
 	/* TODO: need to check DCA here if we ever do XOR/PQ */

Modified: head/sys/dev/ioat/ioat_hw.h
==============================================================================
--- head/sys/dev/ioat/ioat_hw.h	Thu Oct 22 04:28:22 2015	(r289731)
+++ head/sys/dev/ioat/ioat_hw.h	Thu Oct 22 04:33:05 2015	(r289732)
@@ -34,6 +34,8 @@ __FBSDID("$FreeBSD$");
 #define	IOAT_CHANCNT_OFFSET		0x00
 
 #define	IOAT_XFERCAP_OFFSET		0x01
+/* Only bits [4:0] are valid. */
+#define	IOAT_XFERCAP_VALID_MASK		0x1f
 
 #define	IOAT_GENCTRL_OFFSET		0x02
 

Modified: head/sys/dev/ioat/ioat_internal.h
==============================================================================
--- head/sys/dev/ioat/ioat_internal.h	Thu Oct 22 04:28:22 2015	(r289731)
+++ head/sys/dev/ioat/ioat_internal.h	Thu Oct 22 04:33:05 2015	(r289732)
@@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$");
 	ioat_read_1((ioat), IOAT_CHANCNT_OFFSET)
 
 #define	ioat_read_xfercap(ioat) \
-	ioat_read_1((ioat), IOAT_XFERCAP_OFFSET)
+	(ioat_read_1((ioat), IOAT_XFERCAP_OFFSET) & IOAT_XFERCAP_VALID_MASK)
 
 #define	ioat_write_intrctrl(ioat, value) \
 	ioat_write_1((ioat), IOAT_INTRCTRL_OFFSET, (value))



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