ioat_test.h revision 289733
1287117Scem/*-
2287117Scem * Copyright (C) 2012 Intel Corporation
3287117Scem * All rights reserved.
4287117Scem *
5287117Scem * Redistribution and use in source and binary forms, with or without
6287117Scem * modification, are permitted provided that the following conditions
7287117Scem * are met:
8287117Scem * 1. Redistributions of source code must retain the above copyright
9287117Scem *    notice, this list of conditions and the following disclaimer.
10287117Scem * 2. Redistributions in binary form must reproduce the above copyright
11287117Scem *    notice, this list of conditions and the following disclaimer in the
12287117Scem *    documentation and/or other materials provided with the distribution.
13287117Scem *
14287117Scem * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15287117Scem * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16287117Scem * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17287117Scem * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18287117Scem * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19287117Scem * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20287117Scem * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21287117Scem * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22287117Scem * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23287117Scem * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24287117Scem * SUCH DAMAGE.
25287117Scem */
26287117Scem
27287117Scem__FBSDID("$FreeBSD: head/sys/dev/ioat/ioat_test.h 289733 2015-10-22 04:38:05Z cem $");
28287117Scem
29287117Scem#ifndef __IOAT_TEST_H__
30287117Scem#define __IOAT_TEST_H__
31287117Scem
32289733Scemenum ioat_res {
33289733Scem	IOAT_TEST_OK = 0,
34289733Scem	IOAT_TEST_NO_DMA_ENGINE,
35289733Scem	IOAT_TEST_NO_MEMORY,
36289733Scem	IOAT_TEST_MISCOMPARE,
37289733Scem	IOAT_NUM_RES
38289733Scem};
39289733Scem
40289733Scemstruct test_transaction;
41289733Scem
42287117Scemstruct ioat_test {
43289733Scem	volatile uint32_t status[IOAT_NUM_RES];
44287117Scem	uint32_t channel_index;
45289733Scem
46289733Scem	/* HW max of 1MB */
47289733Scem	uint32_t buffer_size;
48289733Scem	uint32_t chain_depth;
49289733Scem	uint32_t transactions;
50289733Scem
51289733Scem	/*
52289733Scem	 * If non-zero, duration is time in ms;
53289733Scem	 * If zero, bounded by 'transactions' above.
54289733Scem	 */
55289733Scem	uint32_t duration;
56289733Scem
57289733Scem	/* If true, check for miscompares after a copy. */
58289733Scem	bool verify;
59289733Scem
60289733Scem	/* Internal usage -- not test inputs */
61289733Scem	TAILQ_HEAD(, test_transaction) free_q;
62289733Scem	TAILQ_HEAD(, test_transaction) pend_q;
63289733Scem	volatile bool too_late;
64287117Scem};
65287117Scem
66287117Scem#define	IOAT_DMATEST	_IOWR('i', 0, struct ioat_test)
67287117Scem
68287117Scem#endif /* __IOAT_TEST_H__ */
69