1/* SPDX-License-Identifier: BSD-2-Clause-NetBSD AND BSD-3-Clause */
2/*	$NetBSD: qat_hw17var.h,v 1.1 2019/11/20 09:37:46 hikaru Exp $	*/
3
4/*
5 * Copyright (c) 2019 Internet Initiative Japan, Inc.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 *    notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 *    notice, this list of conditions and the following disclaimer in the
15 *    documentation and/or other materials provided with the distribution.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
18 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
21 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 * POSSIBILITY OF SUCH DAMAGE.
28 */
29
30/*
31 *   Copyright(c) 2014 Intel Corporation.
32 *   Redistribution and use in source and binary forms, with or without
33 *   modification, are permitted provided that the following conditions
34 *   are met:
35 *
36 *     * Redistributions of source code must retain the above copyright
37 *       notice, this list of conditions and the following disclaimer.
38 *     * Redistributions in binary form must reproduce the above copyright
39 *       notice, this list of conditions and the following disclaimer in
40 *       the documentation and/or other materials provided with the
41 *       distribution.
42 *     * Neither the name of Intel Corporation nor the names of its
43 *       contributors may be used to endorse or promote products derived
44 *       from this software without specific prior written permission.
45 *
46 *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
47 *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
48 *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
49 *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
50 *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
51 *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
52 *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
53 *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
54 *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
55 *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
56 *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
57 */
58
59/* $FreeBSD$ */
60
61#ifndef _DEV_PCI_QAT_HW17VAR_H_
62#define _DEV_PCI_QAT_HW17VAR_H_
63
64CTASSERT(CONTENT_DESC_MAX_SIZE >=
65    roundup(sizeof(union hw_cipher_algo_blk), 8) +
66    roundup(sizeof(union hw_auth_algo_blk), 8));
67
68int		qat_adm_mailbox_init(struct qat_softc *);
69int		qat_adm_mailbox_send_init(struct qat_softc *);
70int		qat_arb_init(struct qat_softc *);
71int		qat_set_ssm_wdtimer(struct qat_softc *);
72int		qat_check_slice_hang(struct qat_softc *);
73
74void		qat_hw17_crypto_setup_desc(struct qat_crypto *,
75		    struct qat_session *, struct qat_crypto_desc *);
76void		qat_hw17_crypto_setup_req_params(struct qat_crypto_bank *,
77		    struct qat_session *, struct qat_crypto_desc const *,
78		    struct qat_sym_cookie *, struct cryptodesc *,
79		    struct cryptodesc *);
80
81#endif
82