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))
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to