4864 update emlxs from source provided by Emulex for 16G FC
[unleashed.git] / usr / src / uts / common / sys / fibre-channel / fca / emlxs / emlxs_msg.h
blobb7b221d5e2685f305eebae0756e68883d4439a2f
1 /*
2 * CDDL HEADER START
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
9 * http://www.opensource.org/licenses/cddl1.txt.
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]
19 * CDDL HEADER END
23 * Copyright (c) 2004-2011 Emulex. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _EMLXS_MSG_H
28 #define _EMLXS_MSG_H
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
34 /* Define the actual driver messages */
35 #include <emlxs_messages.h>
37 /* File identification numbers */
38 #define EMLXS_MSG_DEF(_number) static const uint32_t _FILENO_ = _number
39 #define EMLXS_CLOCK_C 1
40 #define EMLXS_DIAG_C 2
41 #define EMLXS_DOWNLOAD_C 3
42 #define EMLXS_ELS_C 4
43 #define EMLXS_FCP_C 5
44 #define EMLXS_HBA_C 6
45 #define EMLXS_MBOX_C 7
46 #define EMLXS_MEM_C 8
47 #define EMLXS_NODE_C 9
48 #define EMLXS_PKT_C 10
49 #define EMLXS_SOLARIS_C 11
50 #define EMLXS_MSG_C 12
51 #define EMLXS_IP_C 13
52 #define EMLXS_THREAD_C 14
53 #define EMLXS_DFC_C 15
54 #define EMLXS_DHCHAP_C 16
55 #define EMLXS_FCT_C 17
56 #define EMLXS_DUMP_C 18
57 #define EMLXS_SLI3_C 19
58 #define EMLXS_SLI4_C 20
59 #define EMLXS_EVENT_C 21
60 #define EMLXS_FCF_C 22
62 #define EMLXS_CONTEXT port, _FILENO_, __LINE__
63 #define EMLXS_MSGF emlxs_msg_printf
65 #ifdef EMLXS_DBG
66 #define EMLXS_DEBUGF emlxs_msg_printf
67 #else /* EMLXS_DBG */
68 #define EMLXS_DEBUGF
69 #endif /* EMLXS_DBG */
71 #define MAX_LOG_INFO_LENGTH 96
73 typedef struct emlxs_msg_entry
75 uint32_t id; /* entry id */
76 clock_t time; /* timestamp */
77 timespec_t id_time; /* high res timestamp */
79 emlxs_msg_t *msg; /* Msg pointer */
81 uint32_t vpi;
82 uint32_t instance; /* Adapter instance */
83 uint32_t fileno; /* File number */
84 uint32_t line; /* Line number */
86 char buffer[MAX_LOG_INFO_LENGTH]; /* Additional info */
87 /* buffer */
88 } emlxs_msg_entry_t;
91 typedef struct emlxs_msg_log
93 kmutex_t lock;
95 clock_t start_time;
96 uint32_t instance;
98 uint32_t size; /* Maximum entries in */
99 /* circular buffer */
100 uint32_t count; /* Total number of entries */
101 /* recorded */
102 uint32_t next; /* Next index into circular */
103 /* buffer */
104 uint32_t repeat; /* repeat counter */
106 emlxs_msg_entry_t *entry; /* pointer to entry buffer */
107 } emlxs_msg_log_t;
109 #ifdef __cplusplus
111 #endif
113 #endif /* _EMLXS_MSG_H */