Sync usage with man page.
[netbsd-mini2440.git] / sys / dev / pci / n8 / include_private / nsp_ioctl.h
blob48b7186c87a4829aa331b156b4985d0db91785d8
1 /*-
2 * Copyright (C) 2001-2003 by NBMK Encryption Technologies.
3 * All rights reserved.
5 * NBMK Encryption Technologies provides no support of any kind for
6 * this software. Questions or concerns about it may be addressed to
7 * the members of the relevant open-source community at
8 * <tech-crypto@netbsd.org>.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions are
12 * met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above
18 * copyright notice, this list of conditions and the following
19 * disclaimer in the documentation and/or other materials provided
20 * with the distribution.
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 /*****************************************************************************
36 * @(#) nsp_ioctl.h 1.34@(#)
37 *****************************************************************************/
39 /*****************************************************************************/
40 /** @file nsp_ioctl.h
41 * @brief NSP2000 Device Driver IOCtl handler
43 * This header contains the prototype of the common IOCtl handler.
45 *****************************************************************************/
47 /*****************************************************************************
48 * Revision history:
49 * 04/21/03 brr Added support for multiple memory banks.
50 * 03/20/03 brr Added debug message selector for queue manager information.
51 * 09/18/02 brr Added IOCTL codes for diagnostics & wait on request complete.
52 * 07/17/02 brr Eliminate unused ioctl codes.
53 * 07/02/02 brr Added IOCTL code for memory statistics.
54 * 05/30/02 brr Moved queue stat structure to n8_enqueue_common & removed
55 * #defines for obsolete ioctl's.
56 * 05/20/02 brr Added stat for preempted requests.
57 * 05/15/02 brr Removed obsolete Ioctl code NSP_IOCTL_QMGR_CHECK_REQ.
58 * 04/03/02 spm Removed remnants of the reverse-ioctl that the daemon
59 * formerly used (start, finish, shutdown).
60 * 03/29/02 brr Removed obsolete defines & strutures.
61 * 03/29/02 hml Added ioctl N8_IOCTL_VALIDATE_CONTEXT.
62 * 03/25/02 hml Deleted obsolete debug bits.
63 * 03/22/02 hml Added new Debug bit for displaying context.
64 * 03/21/02 mmd Added N8_QueueStatistics_t, NSP_IOCTL_QUERY_QUEUE_STATS,
65 * and N8_DBG_QUERY_QUEUE_STATS.
66 * 02/18/02 brr Added new IOCTL's for QMgr functions.
67 * 01/22/02 spm Added sys init ioctl for handling inits that need
68 * the N8 userspace daemon to be connected to the driver.
69 * 01/17/02 spm Added shutdown ioctl for handling shutdown requests
70 * from userspace (uninstall script). Also added
71 * test ioctls for testing N8 daemon capabilities.
72 * 01/15/02 spm Added NSP_IOCTL_N8_DAEMON_START, NSP_IOCTL_N8_DAEMON_FINISH
73 * ioctls for N8 daemon support.
74 * 01/02/02 hml Modified N8_API_Parms_t structure.
75 * 11/10/01 brr Modified to support static allocations of persistant data
76 * by the driver.
77 * 10/16/01 mmd Revised debug info to a single parm - debug.
78 * 09/25/01 mmd Eliminated FPGAflag parameter.
79 * 09/19/01 mmd Creation.
80 ****************************************************************************/
81 /** @defgroup NSP2000Driver NSP2000 Device Driver IOCtl handler
84 #ifndef NSP_IOCTL_H
85 #define NSP_IOCTL_H
88 #include "n8_device_info.h"
89 #include "n8_pub_common.h"
92 /******************************************************************************
93 * IOCTL HANDLER RESOURCES - *
94 * *
95 * ParmStruct is a basic data structure used for passing paramters and *
96 * results between a user process and the ioctl handler on an ioctl call. *
97 * Each supported IOCTL code uses a different combination of the fields, so *
98 * the fields don't necessarily have any intrinsic significance. *
99 * *
100 * Three additional parameter structures are used in the same way, for some *
101 * of the legacy routines appropriated from Alpha-Data's sample driver, and *
102 * are only used in FPGA mode. *
104 * The supported IOCTL codes are defined here as constants. There's no *
105 * particular significance to their actual values, beyond each constant being *
106 * unique. *
108 ******************************************************************************/
111 /* GENERIC IOCtl PARAMETER STRUCTURE */
112 typedef struct
114 unsigned char coretype;
115 unsigned long bitmask;
116 unsigned long timeout;
117 N8_Unit_t chip;
118 unsigned char invalid_handle;
119 unsigned long contextIndex;
120 unsigned long irqstatus;
121 } PARMSTRUCT_t;
124 /* IOCtl COMMAND CODES */
125 #define NSP_IOCTL_GET_DEVICE_RESOURCES 21
126 #define NSP_IOCTL_ALLOCATE_USER_POOL 26
127 #define NSP_IOCTL_ALLOCATE_BUFFER 27
128 #define NSP_IOCTL_FREE_BUFFER 28
129 #define NSP_IOCTL_MEMORY_STATS 30
130 #define NSP_IOCTL_WAIT_ON_INTERRUPT 31
131 #define NSP_IOCTL_WAIT_ON_REQUEST 32
132 #define NSP_IOCTL_DEBUG_MESSAGES 34
134 #define NSP_IOCTL_ALLOCATE_BUFFER_PK 35
135 #define NSP_IOCTL_FREE_BUFFER_PK 36
137 #define NSP_IOCTL_N8_DAEMON_SYS_INIT 39
138 #define NSP_IOCTL_ALLOCATE_CONTEXT 40
139 #define NSP_IOCTL_FREE_CONTEXT 41
140 #define NSP_IOCTL_QMGR_QUEUE 42
141 #define NSP_IOCTL_RN_QUEUE 44
142 #define NSP_IOCTL_RN_SET_PARMS 45
143 #define NSP_IOCTL_RN_GET_PARMS 46
144 #define NSP_IOCTL_SKS_WRITE 47
145 #define NSP_IOCTL_SKS_RESET_UNIT 48
146 #define NSP_IOCTL_SKS_ALLOCATE 49
147 #define NSP_IOCTL_SKS_SET_STATUS 50
148 #define NSP_IOCTL_QUERY_QUEUE_STATS 51
149 #define NSP_IOCTL_VALIDATE_CONTEXT 52
150 #define NSP_IOCTL_DIAGNOSTIC 53
153 /* CORE SELECTORS FOR IOCtl PARAMETERS */
154 #define N8_DAPI_PKE 1
155 #define N8_DAPI_RNG 2
156 #define N8_DAPI_EA 4
157 #define N8_DAPI_AMBA 8
161 /* DEBUG MESSAGE BIT SELECTORS */
162 #define N8_DBG_GENERAL 1
163 #define N8_DBG_IRQ 2
164 #define N8_DBG_BIGALLOC 4
165 #define N8_DBG_DISPLAY_MEMORY 8
166 #define N8_DBG_DISPLAY_CONTEXT 16
167 #define N8_DBG_DISPLAY_REGISTERS 32
168 #define N8_DBG_DISPLAY_QMGR 64
171 #endif /* NSP_IOCTL_H */