4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
30 * Deimos - cryptographic acceleration based upon Broadcom 582x.
33 #include <sys/types.h>
35 #include <sys/sunddi.h>
36 #include <sys/cmn_err.h>
37 #include <sys/varargs.h>
38 #include <sys/crypto/dca.h>
41 * Debugging and messaging.
44 static int dca_debug
= 0;
47 dca_dprintf(dca_t
*dca
, int level
, const char *fmt
, ...)
52 if (dca_debug
& level
) {
55 (void) sprintf(buf
, "%s\n", fmt
);
57 (void) sprintf(buf
, "%s/%d: %s\n",
58 ddi_driver_name(dca
->dca_dip
),
59 ddi_get_instance(dca
->dca_dip
), fmt
);
68 dca_error(dca_t
*dca
, const char *fmt
, ...)
72 dca_dipverror(dca
->dca_dip
, fmt
, ap
);
77 dca_diperror(dev_info_t
*dip
, const char *fmt
, ...)
81 dca_dipverror(dip
, fmt
, ap
);
86 dca_dipverror(dev_info_t
*dip
, const char *fmt
, va_list ap
)
89 (void) sprintf(buf
, "%s%d: %s", ddi_driver_name(dip
),
90 ddi_get_instance(dip
), fmt
);
91 vcmn_err(CE_WARN
, buf
, ap
);