]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/dev/amr/amr_tables.h
This commit was generated by cvs2svn to compensate for changes in r106121,
[FreeBSD/FreeBSD.git] / sys / dev / amr / amr_tables.h
1 /*-
2  * Copyright (c) 2000 Michael Smith
3  * Copyright (c) 2000 BSDi
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25  * SUCH DAMAGE.
26  *
27  * 3. The party using or redistributing the source code and binary forms
28  *    agrees to the above disclaimer and the terms and conditions set forth
29  *    herein.
30  *
31  * Additional Copyright (c) 2002 by Eric Moore under same license.
32  * Additional Copyright (c) 2002 LSI Logic Corporation
33  *
34  *      $FreeBSD$
35  */
36
37 /*
38  * Lookup table for code-to-text translations.
39  */
40 struct amr_code_lookup {
41     char        *string;
42     u_int32_t   code;
43 };
44
45 extern char     *amr_describe_code(struct amr_code_lookup *table, u_int32_t code);
46
47 #ifndef AMR_DEFINE_TABLES
48 extern struct amr_code_lookup amr_table_qinit[];
49 extern struct amr_code_lookup amr_table_sinit[];
50 extern struct amr_code_lookup amr_table_drvstate[];
51
52 #else /* AMR_DEFINE_TABLES */
53
54 /********************************************************************************
55  * Look up a text description of a numeric code and return a pointer to same.
56  */
57 char *
58 amr_describe_code(struct amr_code_lookup *table, u_int32_t code)
59 {
60     int         i;
61
62     for (i = 0; table[i].string != NULL; i++)
63         if (table[i].code == code)
64             return(table[i].string);
65     return(table[i+1].string);
66 }
67
68 struct amr_code_lookup amr_table_qinit[] = {
69     {"init scanning drives",            AMR_QINIT_SCAN},
70     {"init scanning initialising",      AMR_QINIT_SCANINIT},
71     {"init firmware initing",           AMR_QINIT_FIRMWARE},
72     {"init in progress",                AMR_QINIT_INPROG},
73     {"init spinning drives",            AMR_QINIT_SPINUP},
74     {"insufficient memory",             AMR_QINIT_NOMEM},
75     {"init flushing cache",             AMR_QINIT_CACHEFLUSH},
76     {"init successfully done",          AMR_QINIT_DONE},
77     {NULL, 0},
78     {"unknown init code", 0}
79 };
80
81 struct amr_code_lookup amr_table_sinit[] = {
82     {"init abnormal terminated",        AMR_SINIT_ABEND},
83     {"insufficient memory",             AMR_SINIT_NOMEM},
84     {"firmware flushing cache",         AMR_SINIT_CACHEFLUSH},
85     {"init in progress",                AMR_SINIT_INPROG},
86     {"firmware spinning drives",        AMR_SINIT_SPINUP},
87     {"init successfully done",          AMR_SINIT_DONE},
88     {NULL, 0},
89     {"unknown init code", 0}
90 };
91
92 struct amr_code_lookup amr_table_drvstate[] = {
93     {"offline",                 AMR_DRV_OFFLINE},
94     {"degraded",                AMR_DRV_DEGRADED},
95     {"optimal",                 AMR_DRV_OPTIMAL},
96     {"online",                  AMR_DRV_ONLINE},
97     {"failed",                  AMR_DRV_FAILED},
98     {"rebuild",                 AMR_DRV_REBUILD},
99     {"hot spare",               AMR_DRV_HOTSPARE},
100     {NULL, 0},
101     {"unknown", 0}
102 };
103
104 struct amr_code_lookup amr_table_adaptertype[] = {
105     {"Series 431",                      AMR_SIG_431},
106     {"Series 438",                      AMR_SIG_438},
107     {"Series 762",                      AMR_SIG_762},
108     {"Integrated HP NetRAID (T5)",      AMR_SIG_T5},
109     {"Series 466",                      AMR_SIG_466},
110     {"Series 467",                      AMR_SIG_467},
111     {"Integrated HP NetRAID (T7)",      AMR_SIG_T7},
112     {"Series 490",                      AMR_SIG_490},
113     {NULL, 0},
114     {"unknown adapter", 0}
115 };
116
117 #endif