/*
* 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
* 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 (c) 2004-2012 Emulex. All rights reserved.
* Use is subject to license terms.
*/
#include <emlxs.h>
{
/* Check if log is already created */
return (0);
}
/* Clear the log */
/* Allocate the memory needed for the log file */
/* Initialize */
/* Get the current interrupt block cookie */
&iblock);
/* Create the log mutex lock */
}
#ifdef MSI_SUPPORT
else {
/* Create the temporary log mutex lock */
}
#endif
return (1);
} /* emlxs_msg_log_create() */
void
{
/* Check if log is already destroyed */
"?%s%d: message log already destroyed. log=%p",
return;
}
/* Destroy the temporary lock */
/* Re-create the log mutex lock */
return;
} /* emlxs_msg_lock_reinit() */
void
{
/* Check if log is already destroyed */
"?%s%d: message log already destroyed. log=%p",
return;
}
/* Destroy the lock */
/* Free the log buffer */
/* Clear the log */
return;
} /* emlxs_msg_log_destroy() */
{
/* Get the log file for this instance */
/* Check if log is initialized */
return (0);
}
/* Get the pointer to the last log entry */
} else {
}
/* Check if this matches the last message */
/* If the same message is being logged then increment */
return (0);
/* Get the pointer to the next log entry */
/* Increment and check the next entry index */
}
case EMLXS_NOTICE:
msg2 = &emlxs_notice_msg;
break;
case EMLXS_WARNING:
break;
case EMLXS_ERROR:
msg2 = &emlxs_error_msg;
break;
case EMLXS_PANIC:
msg2 = &emlxs_panic_msg;
break;
case EMLXS_DEBUG:
default:
msg2 = &emlxs_debug_msg;
break;
}
/* Initialize */
/* Save the additional info buffer */
"Last message repeated %d time(s).",
/* Set the entry time stamp */
}
/* Get the pointer to the next log entry */
/* Increment and check the next entry index */
}
/* Initialize */
/* Save the additional info buffer */
/* Set the entry time stamp */
return (0);
} /* emlxs_msg_log() */
/*ARGSUSED*/
static uint32_t
{
case EMLXS_DEBUG:
return (1);
}
break;
case EMLXS_NOTICE:
return (1);
}
break;
case EMLXS_WARNING:
return (1);
}
break;
case EMLXS_ERROR:
return (1);
}
break;
case EMLXS_PANIC:
return (1);
}
return (0);
} /* emlxs_msg_log_check() */
static uint32_t
{
case EMLXS_DEBUG:
rval |= 2;
}
rval |= 1;
}
break;
case EMLXS_NOTICE:
rval |= 2;
}
rval |= 1;
}
break;
case EMLXS_WARNING:
rval |= 2;
}
rval |= 1;
}
break;
case EMLXS_ERROR:
rval |= 2;
}
rval |= 1;
}
break;
case EMLXS_PANIC:
default:
rval |= 1;
}
return (rval);
} /* emlxs_msg_print_check() */
void
const char *fmt, ...)
{
char *level;
va_str[0] = 0;
if (fmt) {
}
#ifdef FMA_SUPPORT
if (msg->fm_ereport_code) {
}
if (msg->fm_impact_code) {
}
#endif /* FMA_SUPPORT */
/* Check if msg should be logged */
/* Log the message */
return;
}
}
/* Check if msg should be printed */
case EMLXS_DEBUG:
level = " DEBUG";
break;
case EMLXS_NOTICE:
level = " NOTICE";
break;
case EMLXS_WARNING:
level = "WARNING";
break;
case EMLXS_ERROR:
level = " ERROR";
break;
case EMLXS_PANIC:
level = " PANIC";
break;
default:
level = "UNKNOWN";
break;
}
} else {
}
/* Generate the message string */
if (va_str[0] != 0) {
"[%2X.%04X]%s:%7s:%4d: %s (%s)\n", fileno,
va_str);
} else {
"[%2X.%04X]%s:%7s:%4d: %s\n",
}
} else {
if (va_str[0] != 0) {
"[%2X.%04X]%s:%7s:%4d: (%s)\n", fileno,
} else {
"[%2X.%04X]%s:%7s:%4d\n",
}
}
switch (rval) {
case 1: /* MESSAGE LOG ONLY */
/* Message log & console, if system booted in */
/* verbose mode (CE_CONT only) */
break;
case 2: /* CONSOLE ONLY */
break;
case 3: /* CONSOLE AND MESSAGE LOG */
break;
}
}
return;
} /* emlxs_msg_printf() */
{
uint32_t i;
char *resp_buf;
/* Check if buffer is empty */
/* If so, exit now */
return (1);
}
/* Get current log entry ranges */
/* Get last entry id saved */
/* Check if request is out of current range */
/* if so, exit now */
return (0);
}
/* Get oldest entry id and its index */
/* Check if buffer has already been filled once */
} else { /* Buffer not yet filled */
first = 0;
index = 0;
}
/* Check if requested first message is greater than actual. */
/* If so, adjust for it. */
/* Adjust entry index to first requested message */
}
}
/* Get the total number of messages available for return */
/* Check if requested count is less than actual. If so, adjust it. */
}
/* Fill in the response header */
/* Fill the response buffer */
for (i = 0; i < count; i++) {
/* Increment the response buffer */
/* Increment index */
index = 0;
}
}
return (1);
} /* emlxs_msg_log_get() */
static void
{
char *level;
case EMLXS_DEBUG:
level = " DEBUG";
break;
case EMLXS_NOTICE:
level = " NOTICE";
break;
case EMLXS_WARNING:
level = "WARNING";
break;
case EMLXS_ERROR:
level = " ERROR";
break;
case EMLXS_PANIC:
level = " PANIC";
break;
default:
level = "UNKNOWN";
break;
}
} else {
}
/* Generate the message string */
"%8d.%02d: %6d:[%2X.%04X]%s:%7s:%4d: %s (%s)\n",
} else {
"%8d.%02d: %6d:[%2X.%04X]%s:%7s:%4d: %s\n", secs,
}
} else {
"%8d.%02d: %6d:[%2X.%04X]%s:%7s:%4d: (%s)\n",
} else {
"%8d.%02d: %6d:[%2X.%04X]%s:%7s:%4d\n",
}
}
} else {
}
return;
} /* emlxs_msg_sprintf() */