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
This commit is contained in:
Conrad Meyer 2015-10-22 04:33:05 +00:00
parent 01d591d45b
commit b81eee4a22
3 changed files with 3 additions and 4 deletions

View File

@ -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 */

View File

@ -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

View File

@ -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))