Unleashed v1.4
[unleashed.git] / kernel / drivers / net / ixgbe / ixgbe_log.c
blob312c082c161fa3cba96d1a8a3875f6e490edd910
1 /*
2 * CDDL HEADER START
4 * Copyright(c) 2007-2008 Intel Corporation. All rights reserved.
5 * The contents of this file are subject to the terms of the
6 * Common Development and Distribution License (the "License").
7 * You may not use this file except in compliance with the License.
9 * You can obtain a copy of the license at:
10 * http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When using or redistributing this file, you may do so under the
15 * License only. No other modification of this header is permitted.
17 * If applicable, add the following below this CDDL HEADER, with the
18 * fields enclosed by brackets "[]" replaced with your own identifying
19 * information: Portions Copyright [yyyy] [name of copyright owner]
21 * CDDL HEADER END
25 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms of the CDDL.
29 #pragma ident "%Z%%M% %I% %E% SMI"
31 #include "ixgbe_sw.h"
33 #define LOG_BUF_LEN 128
36 * ixgbe_notice - Report a run-time event (CE_NOTE, to console & log)
38 void
39 ixgbe_notice(void *arg, const char *fmt, ...)
41 ixgbe_t *ixgbep = (ixgbe_t *)arg;
42 char buf[LOG_BUF_LEN];
43 va_list ap;
45 va_start(ap, fmt);
46 (void) vsnprintf(buf, sizeof (buf), fmt, ap);
47 va_end(ap);
49 if (ixgbep != NULL)
50 cmn_err(CE_NOTE, "%s%d: %s", MODULE_NAME, ixgbep->instance,
51 buf);
52 else
53 cmn_err(CE_NOTE, "%s: %s", MODULE_NAME, buf);
57 * ixgbe_log - Log a run-time event (CE_NOTE, to log only)
59 void
60 ixgbe_log(void *arg, const char *fmt, ...)
62 ixgbe_t *ixgbep = (ixgbe_t *)arg;
63 char buf[LOG_BUF_LEN];
64 va_list ap;
66 va_start(ap, fmt);
67 (void) vsnprintf(buf, sizeof (buf), fmt, ap);
68 va_end(ap);
70 if (ixgbep != NULL)
71 cmn_err(CE_NOTE, "!%s%d: %s", MODULE_NAME, ixgbep->instance,
72 buf);
73 else
74 cmn_err(CE_NOTE, "!%s: %s", MODULE_NAME, buf);
78 * ixgbe_error - Log a run-time problem (CE_WARN, to log only)
80 void
81 ixgbe_error(void *arg, const char *fmt, ...)
83 ixgbe_t *ixgbep = (ixgbe_t *)arg;
84 char buf[LOG_BUF_LEN];
85 va_list ap;
87 va_start(ap, fmt);
88 (void) vsnprintf(buf, sizeof (buf), fmt, ap);
89 va_end(ap);
91 if (ixgbep != NULL)
92 cmn_err(CE_WARN, "!%s%d: %s", MODULE_NAME, ixgbep->instance,
93 buf);
94 else
95 cmn_err(CE_WARN, "!%s: %s", MODULE_NAME, buf);