]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/mips/nlm/dev/sec/nlmrsalib.h
MFV r330591: 8984 fix for 6764 breaks ACL inheritance
[FreeBSD/FreeBSD.git] / sys / mips / nlm / dev / sec / nlmrsalib.h
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3  *
4  * Copyright (c) 2003-2012 Broadcom Corporation
5  * All Rights Reserved
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
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
15  *    the documentation and/or other materials provided with the
16  *    distribution.
17  *
18  * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR
19  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE
22  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
25  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
27  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
28  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  *
30  * $FreeBSD$
31  */
32 #ifndef _NLMRSALIB_H_
33 #define _NLMRSALIB_H_
34
35 #define XLP_RSA_SESSION(sid)    ((sid) & 0x000007ff)
36 #define XLP_RSA_SID(crd,ses)    (((crd) << 28) | ((ses) & 0x7ff))
37
38 #define RSA_ERROR(msg0)         (((msg0) >> 53) & 0x1f)
39
40 struct xlp_rsa_session {
41         uint32_t sessionid;
42         int hs_used;
43 };
44
45 struct xlp_rsa_command {
46         uint16_t session_num;
47         struct xlp_rsa_session *ses;
48         struct cryptkop *krp;
49         uint8_t *rsasrc;
50         uint32_t rsaopsize;
51         uint32_t rsatype;
52         uint32_t rsafn;
53 };
54
55 /*
56  * Holds data specific to nlm security accelerators
57  */
58 struct xlp_rsa_softc {
59         device_t sc_dev;        /* device backpointer */
60         uint64_t rsa_base;
61         int sc_cid;
62         struct xlp_rsa_session *sc_sessions;
63         int sc_nsessions;
64         int rsaecc_vc_start;
65         int rsaecc_vc_end;
66 };
67
68 void
69 nlm_xlprsaecc_msgring_handler(int vc, int size, int code, int src_id,
70     struct nlm_fmn_msg *msg, void *data);
71
72 #endif /* _NLMRSALIB_H_ */