From owner-svn-src-all@freebsd.org Thu Oct 22 04:33:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AF1BA1BDF3; Thu, 22 Oct 2015 04:33:07 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD7A91B93; Thu, 22 Oct 2015 04:33:06 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9M4X5bH041501; Thu, 22 Oct 2015 04:33:05 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9M4X5hL041498; Thu, 22 Oct 2015 04:33:05 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201510220433.t9M4X5hL041498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 22 Oct 2015 04:33:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289732 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2015 04:33:07 -0000 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))