ncs.h revision 4496171313bed39e96f21bc2f9faf2868e267ae3
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_NCS_H
#define _SYS_NCS_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _ASM
#endif /* !_ASM */
/*
* NCS HV API v1.0
*/
#define HV_NCS_REQUEST 0x110
/*
* NCS HV API v2.0
*/
#define HV_NCS_QCONF 0x111
#define HV_NCS_QINFO 0x112
#define HV_NCS_GETHEAD 0x113
#define HV_NCS_GETTAIL 0x114
#define HV_NCS_SETTAIL 0x115
#define HV_NCS_QHANDLE_TO_DEVINO 0x116
#define HV_NCS_SETHEAD_MARKER 0x117
#ifndef _ASM
/* Forward typedefs */
/*
* Modulare Arithmetic Unit (MA) control register definition.
*/
union ma_ctl {
union {
struct {
} n1;
struct {
} n2;
} bits;
};
typedef struct {
union {
struct {
} _s;
} _u;
union {
} _ux;
} cwq_cw_t;
#endif /* _ASM */
/* Values for ma_ctl operation field */
#define MA_OP_LOAD 0x0
#define MA_OP_STORE 0x1
#define MA_OP_MULTIPLY 0x2
#define MA_OP_REDUCE 0x3
#define MA_OP_EXPONENTIATE 0x4
/* The MA memory is 1280 bytes (160 8 byte words) */
#define MA_SIZE 1280
/* Make driver MA buffer the next power of 2 */
#define MA_BUF_SIZE 2048
/* We can only load 64 8 byte words at a time */
#define MA_LOAD_MAX 64
#ifndef _ASM
union ma_mpa {
struct {
} bits;
};
union ma_ma {
struct {
} bits;
};
#endif /* !_ASM */
/*
* NCS API definitions
*/
/*
* NCS HV API v1.0 definitions (PSARC/2005/125)
*/
/*
* NCS Crtypo Function Numbers
*/
#define NCS_QCONF 0x1
#define NCS_QTAIL_UPDATE 0x2
/*
* The following are parameters to the NCS_QTAIL_UPDATE call:
*
* i.e. wait for each enqueued operation
* to complete before progressing to
* next one.
* without waiting for its completion.
*/
#define NCS_SYNC 0
#define NCS_ASYNC 1
#ifndef _ASM
typedef struct ncs_qconf_arg {
typedef struct ncs_qtail_update_arg {
/*
* The interface to the MAU is via the following data structures. The
* structure consists of a copy of all relevant registers required to perform
* the requested operation.
*/
typedef struct ma_regs {
} ma_regs_t;
#define ND_TYPE_UNASSIGNED 0
#define ND_STATE_FREE 0
#define ND_STATE_PENDING 1
#define ND_STATE_BUSY 2
#define ND_STATE_DONE 3
#define ND_STATE_ERROR 4
/*
* The ncs_hvdesc structure MUST MATCH corresponding one in HV.
* Structure padded to the next power of 2.
*/
typedef struct ncs_hvdesc {
} ncs_hvdesc_t;
#define NCS_HVDESC_SIZE_ACTUAL (sizeof (ncs_hvdesc_t))
#endif /* !_ASM */
/*
* NCS HV API v2.0 definitions (FWARC/2006/174, FWARC/2006/425)
*
* Some of the structures above (v1.0) are inherited for v2.0
*/
/*
* In v2.0, the nhd_type field has the following values
* when non-zero (unassigned). The nhd_type field indicates
* whether the descriptor is the beginning of a crypto job,
* A job may be comprised of multiple descriptors.
*/
#define ND_TYPE_START 0x01
#define ND_TYPE_CONT 0x02
#define ND_TYPE_END 0x80
/*
* nhd_errstatus
*/
#define ND_ERR_OK 0x00
/*
* Types of queues supported by NCS
*/
#define NCS_QTYPE_MAU 0x1
#define NCS_QTYPE_CWQ 0x2
/*
* Any changes to this structure will require updates to
*/
#ifndef _ASM
typedef struct ncs_qinfo {
} ncs_qinfo_t;
#endif /* !_ASM */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_NCS_H */