| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
#ifdef HAVE_CONFIG_H |
| 20 |
#include "config.h" |
| 21 |
#endif |
| 22 |
|
| 23 |
#include <stdio.h> |
| 24 |
#include <stdlib.h> |
| 25 |
#if STDC_HEADERS |
| 26 |
#include <string.h> |
| 27 |
#include <stdarg.h> |
| 28 |
#endif |
| 29 |
#include <assert.h> |
| 30 |
#include <errno.h> |
| 31 |
|
| 32 |
#include "freeipmi/sel/ipmi-sel.h" |
| 33 |
|
| 34 |
#include "freeipmi/record-format/ipmi-sel-record-format.h" |
| 35 |
#include "freeipmi/spec/ipmi-event-reading-type-code-spec.h" |
| 36 |
#include "freeipmi/spec/ipmi-iana-enterprise-numbers-spec.h" |
| 37 |
#include "freeipmi/spec/ipmi-product-id-spec.h" |
| 38 |
#include "freeipmi/spec/ipmi-sensor-and-event-code-tables-spec.h" |
| 39 |
#include "freeipmi/spec/ipmi-sensor-types-spec.h" |
| 40 |
#include "freeipmi/spec/oem/ipmi-sensor-and-event-code-tables-oem-gigabyte-spec.h" |
| 41 |
|
| 42 |
#include "ipmi-sel-common.h" |
| 43 |
#include "ipmi-sel-defs.h" |
| 44 |
#include "ipmi-sel-string.h" |
| 45 |
#include "ipmi-sel-string-gigabyte-common.h" |
| 46 |
#include "ipmi-sel-trace.h" |
| 47 |
#include "ipmi-sel-util.h" |
| 48 |
|
| 49 |
#include "freeipmi-portability.h" |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
int |
| 56 |
sel_string_output_gigabyte_md90fs0zb_event_data2_discrete_oem (ipmi_sel_ctx_t ctx, |
| 57 |
struct ipmi_sel_entry *sel_entry, |
| 58 |
uint8_t sel_record_type, |
| 59 |
char *tmpbuf, |
| 60 |
unsigned int tmpbuflen, |
| 61 |
unsigned int flags, |
| 62 |
unsigned int *wlen, |
| 63 |
struct ipmi_sel_system_event_record_data *system_event_record_data) |
| 64 |
{ |
| 65 |
int ret; |
| 66 |
|
| 67 |
assert (ctx); |
| 68 |
assert (ctx->magic == IPMI_SEL_CTX_MAGIC); |
| 69 |
assert (ctx->manufacturer_id == IPMI_IANA_ENTERPRISE_ID_GIGABYTE); |
| 70 |
assert (sel_entry); |
| 71 |
assert (tmpbuf); |
| 72 |
assert (tmpbuflen); |
| 73 |
assert (!(flags & ~IPMI_SEL_STRING_FLAGS_MASK)); |
| 74 |
assert (flags & IPMI_SEL_STRING_FLAGS_INTERPRET_OEM_DATA); |
| 75 |
assert (wlen); |
| 76 |
assert (system_event_record_data); |
| 77 |
assert (system_event_record_data->event_data2_flag == IPMI_SEL_EVENT_DATA_OEM_CODE); |
| 78 |
assert (ctx->product_id == IPMI_GIGABYTE_PRODUCT_ID_MD90_FS0_ZB); |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
if ((ret = sel_string_output_gigabyte_common_event_data2_discrete_oem (ctx, |
| 84 |
sel_entry, |
| 85 |
sel_record_type, |
| 86 |
tmpbuf, |
| 87 |
tmpbuflen, |
| 88 |
flags, |
| 89 |
wlen, |
| 90 |
system_event_record_data)) < 0) |
| 91 |
return (-1); |
| 92 |
|
| 93 |
if (ret) |
| 94 |
return (ret); |
| 95 |
|
| 96 |
return (0); |
| 97 |
} |
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
int |
| 104 |
sel_string_output_gigabyte_md90fs0zb_event_data3_discrete_oem (ipmi_sel_ctx_t ctx, |
| 105 |
struct ipmi_sel_entry *sel_entry, |
| 106 |
uint8_t sel_record_type, |
| 107 |
char *tmpbuf, |
| 108 |
unsigned int tmpbuflen, |
| 109 |
unsigned int flags, |
| 110 |
unsigned int *wlen, |
| 111 |
struct ipmi_sel_system_event_record_data *system_event_record_data) |
| 112 |
{ |
| 113 |
int ret; |
| 114 |
|
| 115 |
assert (ctx); |
| 116 |
assert (ctx->magic == IPMI_SEL_CTX_MAGIC); |
| 117 |
assert (ctx->manufacturer_id == IPMI_IANA_ENTERPRISE_ID_GIGABYTE); |
| 118 |
assert (sel_entry); |
| 119 |
assert (tmpbuf); |
| 120 |
assert (tmpbuflen); |
| 121 |
assert (!(flags & ~IPMI_SEL_STRING_FLAGS_MASK)); |
| 122 |
assert (flags & IPMI_SEL_STRING_FLAGS_INTERPRET_OEM_DATA); |
| 123 |
assert (wlen); |
| 124 |
assert (system_event_record_data); |
| 125 |
assert (system_event_record_data->event_data3_flag == IPMI_SEL_EVENT_DATA_OEM_CODE); |
| 126 |
assert (ctx->product_id == IPMI_GIGABYTE_PRODUCT_ID_MD90_FS0_ZB); |
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
if ((ret = sel_string_output_gigabyte_common_event_data3_discrete_oem (ctx, |
| 133 |
sel_entry, |
| 134 |
sel_record_type, |
| 135 |
tmpbuf, |
| 136 |
tmpbuflen, |
| 137 |
flags, |
| 138 |
wlen, |
| 139 |
system_event_record_data)) < 0) |
| 140 |
return (-1); |
| 141 |
|
| 142 |
if (ret) |
| 143 |
return (ret); |
| 144 |
|
| 145 |
return (0); |
| 146 |
} |
| 147 |
|
| 148 |
struct sel_string_oem sel_string_oem_gigabyte_md90fs0zb = |
| 149 |
{ |
| 150 |
NULL, |
| 151 |
NULL, |
| 152 |
NULL, |
| 153 |
NULL, |
| 154 |
sel_string_output_gigabyte_md90fs0zb_event_data2_discrete_oem, |
| 155 |
NULL, |
| 156 |
NULL, |
| 157 |
sel_string_output_gigabyte_md90fs0zb_event_data3_discrete_oem, |
| 158 |
NULL, |
| 159 |
NULL, |
| 160 |
NULL, |
| 161 |
NULL, |
| 162 |
}; |