@@ -62,6 +62,17 @@ void dmi_set_vendor(const char *s)
62
62
dmi_vendor = VENDOR_ACER ;
63
63
}
64
64
65
+ static int is_printable (const u8 * data , int len )
66
+ {
67
+ int i ;
68
+
69
+ for (i = 0 ; i < len ; i ++ )
70
+ if (data [i ] < 32 || data [i ] >= 127 )
71
+ return 0 ;
72
+
73
+ return 1 ;
74
+ }
75
+
65
76
/*
66
77
* HP-specific data structures are decoded here.
67
78
*
@@ -72,6 +83,7 @@ static int dmi_decode_hp(const struct dmi_header *h)
72
83
{
73
84
u8 * data = h -> data ;
74
85
int nic , ptr ;
86
+ u32 feat ;
75
87
76
88
switch (h -> type )
77
89
{
@@ -124,6 +136,49 @@ static int dmi_decode_hp(const struct dmi_header *h)
124
136
}
125
137
break ;
126
138
139
+ case 212 :
140
+ /*
141
+ * Vendor Specific: HP 64-bit CRU Information
142
+ *
143
+ * Source: hpwdt kernel driver
144
+ */
145
+ printf ("HP 64-bit CRU Information\n" );
146
+ if (h -> length < 0x18 ) break ;
147
+ printf ("\tSignature: 0x%08x" , DWORD (data + 0x04 ));
148
+ if (is_printable (data + 0x04 , 4 ))
149
+ printf (" (%c%c%c%c)" , data [0x04 ], data [0x05 ],
150
+ data [0x06 ], data [0x07 ]);
151
+ printf ("\n" );
152
+ if (DWORD (data + 0x04 ) == 0x55524324 )
153
+ {
154
+ u64 paddr = QWORD (data + 0x08 );
155
+ paddr .l += DWORD (data + 0x14 );
156
+ if (paddr .l < DWORD (data + 0x14 ))
157
+ paddr .h ++ ;
158
+ printf ("\tPhysical Address: 0x%08x%08x\n" ,
159
+ paddr .h , paddr .l );
160
+ printf ("\tLength: 0x%08x\n" , DWORD (data + 0x10 ));
161
+ }
162
+ break ;
163
+
164
+ case 219 :
165
+ /*
166
+ * Vendor Specific: HP ProLiant Information
167
+ *
168
+ * Source: hpwdt kernel driver
169
+ */
170
+ printf ("HP ProLiant Information\n" );
171
+ if (h -> length < 0x08 ) break ;
172
+ printf ("\tPower Features: 0x%08x\n" , DWORD (data + 0x04 ));
173
+ if (h -> length < 0x0C ) break ;
174
+ printf ("\tOmega Features: 0x%08x\n" , DWORD (data + 0x08 ));
175
+ if (h -> length < 0x14 ) break ;
176
+ feat = DWORD (data + 0x10 );
177
+ printf ("\tMisc. Features: 0x%08x\n" , feat );
178
+ printf ("\t\tiCRU: %s\n" , feat & 0x0001 ? "Yes" : "No" );
179
+ printf ("\t\tUEFI: %s\n" , feat & 0x0408 ? "Yes" : "No" );
180
+ break ;
181
+
127
182
default :
128
183
return 0 ;
129
184
}
0 commit comments