]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h
Add SMBIOS 2.7.1 support to SmbiosView command.
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / SmbiosView / QueryTable.h
... / ...
CommitLineData
1/** @file\r
2 Build a table, each item is (key, info) pair.\r
3 and give a interface of query a string out of a table.\r
4\r
5 Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>\r
6 This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#ifndef _SMBIOS_QUERY_TABLE_H_\r
17#define _SMBIOS_QUERY_TABLE_H_\r
18\r
19#define QUERY_TABLE_UNFOUND 0xFF\r
20\r
21typedef struct TABLE_ITEM {\r
22 UINT16 Key;\r
23 CHAR16 *Info;\r
24} TABLE_ITEM;\r
25\r
26//\r
27// Print info by option\r
28//\r
29#define PRINT_INFO_OPTION(Value, Option) \\r
30 do { \\r
31 if (Option == SHOW_NONE) { \\r
32 return ; \\r
33 } \\r
34 if (Option < SHOW_DETAIL) { \\r
35 Print (L"0x%x\n", Value); \\r
36 return ; \\r
37 } \\r
38 } while (0);\r
39\r
40/**\r
41 Given a table and a Key, return the responding info.\r
42\r
43 Notes:\r
44 Table[Index].Key is change from UINT8 to UINT16,\r
45 in order to deal with "0xaa - 0xbb".\r
46\r
47 For example:\r
48 DisplaySELVariableDataFormatTypes(UINT8 Type, UINT8 Option)\r
49 has a item:\r
50 "0x07-0x7F, Unused"\r
51 Now define Key = 0x7F07, that is to say: High = 0x7F, Low = 0x07.\r
52 Then all the Key Value between Low and High gets the same string\r
53 L"Unused".\r
54\r
55 @param[in] Table The begin address of table.\r
56 @param[in] Number The number of table items.\r
57 @param[in] Key The query Key.\r
58 @param[in, out] Info Input as empty buffer; output as data buffer.\r
59 @param[in] InfoLen The max number of characters for Info.\r
60\r
61 @return the found Key and Info is valid.\r
62 @retval QUERY_TABLE_UNFOUND and Info should be NULL.\r
63**/\r
64UINT8\r
65QueryTable (\r
66 IN TABLE_ITEM *Table,\r
67 IN UINTN Number,\r
68 IN UINT8 Key,\r
69 IN OUT CHAR16 *Info,\r
70 IN UINTN InfoLen\r
71 );\r
72\r
73/**\r
74 Display the structure type information.\r
75\r
76 @param[in] Key The key of the structure.\r
77 @param[in] Option The optional information.\r
78**/\r
79VOID\r
80DisplayStructureTypeInfo (\r
81 IN UINT8 Key,\r
82 IN UINT8 Option\r
83 );\r
84\r
85/**\r
86 Display System Information (Type 1) Type.\r
87\r
88 @param[in] Type The key of the structure.\r
89 @param[in] Option The optional information.\r
90**/\r
91VOID\r
92DisplaySystemWakeupType (\r
93 IN UINT8 Type,\r
94 IN UINT8 Option\r
95 );\r
96\r
97/**\r
98 Display Base Board (Type 2) Feature Flags.\r
99\r
100 @param[in] FeatureFlags The key of the structure.\r
101 @param[in] Option The optional information.\r
102**/\r
103VOID\r
104DisplayBaseBoardFeatureFlags (\r
105 IN UINT8 FeatureFlags,\r
106 IN UINT8 Option\r
107 );\r
108\r
109/**\r
110 Display Base Board (Type 2) Board Type.\r
111\r
112 @param[in] Type The key of the structure.\r
113 @param[in] Option The optional information.\r
114**/\r
115VOID\r
116DisplayBaseBoardBoardType(\r
117 IN UINT8 Type,\r
118 IN UINT8 Option\r
119 );\r
120\r
121/**\r
122 Display System Enclosure (Type 3) Enclosure Type.\r
123\r
124 @param[in] Type The key of the structure.\r
125 @param[in] Option The optional information.\r
126**/\r
127VOID\r
128DisplaySystemEnclosureType (\r
129 IN UINT8 Type,\r
130 IN UINT8 Option\r
131 );\r
132\r
133/**\r
134 Display System Enclosure (Type 3) Enclosure Status.\r
135\r
136 @param[in] Status The key of the structure.\r
137 @param[in] Option The optional information.\r
138**/\r
139VOID\r
140DisplaySystemEnclosureStatus (\r
141 IN UINT8 Status,\r
142 IN UINT8 Option\r
143 );\r
144\r
145/**\r
146 Display System Enclosure (Type 3) Security Status.\r
147\r
148 @param[in] Status The key of the structure.\r
149 @param[in] Option The optional information.\r
150**/\r
151VOID\r
152DisplaySESecurityStatus (\r
153 IN UINT8 Status,\r
154 IN UINT8 Option\r
155 )\r
156;\r
157\r
158/**\r
159 Display Processor Information (Type 4) Type.\r
160\r
161 @param[in] Type The key of the structure.\r
162 @param[in] Option The optional information.\r
163**/\r
164VOID\r
165DisplayProcessorType (\r
166 IN UINT8 Type,\r
167 IN UINT8 Option\r
168 );\r
169\r
170/**\r
171 Display Processor Information (Type 4) Upgrade.\r
172\r
173 @param[in] Upgrade The key of the structure.\r
174 @param[in] Option The optional information.\r
175**/\r
176VOID\r
177DisplayProcessorUpgrade (\r
178 IN UINT8 Upgrade,\r
179 IN UINT8 Option\r
180 );\r
181\r
182/**\r
183 Display Processor Information (Type 4) Characteristics.\r
184\r
185 @param[in] Type The key of the structure.\r
186 @param[in] Option The optional information.\r
187**/\r
188VOID\r
189DisplayProcessorCharacteristics (\r
190 IN UINT16 Type,\r
191 IN UINT8 Option\r
192 );\r
193\r
194/**\r
195 Display Memory Controller Information (Type 5) method.\r
196\r
197 @param[in] Method The key of the structure.\r
198 @param[in] Option The optional information.\r
199**/\r
200VOID\r
201DisplayMcErrorDetectMethod (\r
202 IN UINT8 Method,\r
203 IN UINT8 Option\r
204 );\r
205\r
206/**\r
207 Display Memory Controller Information (Type 5) Capability.\r
208\r
209 @param[in] Capability The key of the structure.\r
210 @param[in] Option The optional information.\r
211**/\r
212VOID\r
213DisplayMcErrorCorrectCapability (\r
214 IN UINT8 Capability,\r
215 IN UINT8 Option\r
216 );\r
217\r
218/**\r
219 Display Memory Controller Information (Type 5) Support.\r
220\r
221 @param[in] Support The key of the structure.\r
222 @param[in] Option The optional information.\r
223**/\r
224VOID\r
225DisplayMcInterleaveSupport (\r
226 IN UINT8 Support,\r
227 IN UINT8 Option\r
228 );\r
229\r
230/**\r
231 Display Memory Controller Information (Type 5) speeds.\r
232\r
233 @param[in] Speed The key of the structure.\r
234 @param[in] Option The optional information.\r
235**/\r
236VOID\r
237DisplayMcMemorySpeeds (\r
238 IN UINT16 Speed,\r
239 IN UINT8 Option\r
240 );\r
241\r
242/**\r
243 Display Memory Controller Information (Type 5) voltage.\r
244\r
245 @param[in] Voltage The key of the structure.\r
246 @param[in] Option The optional information.\r
247**/\r
248VOID\r
249DisplayMemoryModuleVoltage (\r
250 IN UINT8 Voltage,\r
251 IN UINT8 Option\r
252 );\r
253\r
254/**\r
255 Display Memory Module Information (Type 6) type.\r
256\r
257 @param[in] Type The key of the structure.\r
258 @param[in] Option The optional information.\r
259**/\r
260VOID\r
261DisplayMmMemoryType (\r
262 IN UINT16 Type,\r
263 IN UINT8 Option\r
264 );\r
265\r
266/**\r
267 Display Memory Module Information (Type 6) status.\r
268\r
269 @param[in] Status The key of the structure.\r
270 @param[in] Option The optional information.\r
271**/\r
272VOID\r
273DisplayMmErrorStatus (\r
274 IN UINT8 Status,\r
275 IN UINT8 Option\r
276 );\r
277\r
278/**\r
279 Display Cache Information (Type 7) SRAM Type.\r
280\r
281 @param[in] Type The key of the structure.\r
282 @param[in] Option The optional information.\r
283**/\r
284VOID\r
285DisplayCacheSRAMType (\r
286 IN UINT16 Type,\r
287 IN UINT8 Option\r
288 );\r
289\r
290/**\r
291 Display Cache Information (Type 7) correcting Type.\r
292\r
293 @param[in] Type The key of the structure.\r
294 @param[in] Option The optional information.\r
295**/\r
296VOID\r
297DisplayCacheErrCorrectingType (\r
298 IN UINT8 Type,\r
299 IN UINT8 Option\r
300 );\r
301\r
302/**\r
303 Display Cache Information (Type 7) Type.\r
304\r
305 @param[in] Type The key of the structure.\r
306 @param[in] Option The optional information.\r
307**/\r
308VOID\r
309DisplayCacheSystemCacheType (\r
310 IN UINT8 Type,\r
311 IN UINT8 Option\r
312 );\r
313\r
314/**\r
315 Display Cache Information (Type 7) Associativity.\r
316\r
317 @param[in] Associativity The key of the structure.\r
318 @param[in] Option The optional information.\r
319**/\r
320VOID\r
321DisplayCacheAssociativity (\r
322 IN UINT8 Associativity,\r
323 IN UINT8 Option\r
324 );\r
325\r
326/**\r
327 Display Port Connector Information (Type 8) type.\r
328\r
329 @param[in] Type The key of the structure.\r
330 @param[in] Option The optional information.\r
331**/\r
332VOID\r
333DisplayPortConnectorType (\r
334 IN UINT8 Type,\r
335 IN UINT8 Option\r
336 );\r
337\r
338/**\r
339 Display Port Connector Information (Type 8) port type.\r
340\r
341 @param[in] Type The key of the structure.\r
342 @param[in] Option The optional information.\r
343**/\r
344VOID\r
345DisplayPortType (\r
346 IN UINT8 Type,\r
347 IN UINT8 Option\r
348 );\r
349\r
350/**\r
351 Display System Slots (Type 9) slot type.\r
352\r
353 @param[in] Type The key of the structure.\r
354 @param[in] Option The optional information.\r
355**/\r
356VOID\r
357DisplaySystemSlotType (\r
358 IN UINT8 Type,\r
359 IN UINT8 Option\r
360 );\r
361\r
362/**\r
363 Display System Slots (Type 9) data bus width.\r
364\r
365 @param[in] Width The key of the structure.\r
366 @param[in] Option The optional information.\r
367**/\r
368VOID\r
369DisplaySystemSlotDataBusWidth (\r
370 IN UINT8 Width,\r
371 IN UINT8 Option\r
372 );\r
373\r
374/**\r
375 Display System Slots (Type 9) usage information.\r
376\r
377 @param[in] Usage The key of the structure.\r
378 @param[in] Option The optional information.\r
379**/\r
380VOID\r
381DisplaySystemSlotCurrentUsage (\r
382 IN UINT8 Usage,\r
383 IN UINT8 Option\r
384 );\r
385\r
386/**\r
387 Display System Slots (Type 9) slot length.\r
388\r
389 @param[in] Length The key of the structure.\r
390 @param[in] Option The optional information.\r
391**/\r
392VOID\r
393DisplaySystemSlotLength (\r
394 IN UINT8 Length,\r
395 IN UINT8 Option\r
396 );\r
397\r
398/**\r
399 Display System Slots (Type 9) characteristics.\r
400\r
401 @param[in] Chara1 The key of the structure.\r
402 @param[in] Option The optional information.\r
403**/\r
404VOID\r
405DisplaySlotCharacteristics1 (\r
406 IN UINT8 Chara1,\r
407 IN UINT8 Option\r
408 );\r
409\r
410/**\r
411 Display System Slots (Type 9) characteristics.\r
412\r
413 @param[in] Chara2 The key of the structure.\r
414 @param[in] Option The optional information.\r
415**/\r
416VOID\r
417DisplaySlotCharacteristics2 (\r
418 IN UINT8 Chara2,\r
419 IN UINT8 Option\r
420 );\r
421\r
422/**\r
423 Display On Board Devices Information (Type 10) types.\r
424\r
425 @param[in] Type The key of the structure.\r
426 @param[in] Option The optional information.\r
427**/\r
428VOID\r
429DisplayOnboardDeviceTypes (\r
430 IN UINT8 Type,\r
431 IN UINT8 Option\r
432 );\r
433\r
434/**\r
435 Display System Event Log (Type 15) types.\r
436\r
437 @param[in] Type The key of the structure.\r
438 @param[in] Option The optional information.\r
439**/\r
440VOID\r
441DisplaySELTypes (\r
442 IN UINT8 Type,\r
443 IN UINT8 Option\r
444 );\r
445\r
446/**\r
447 Display System Event Log (Type 15) format type.\r
448\r
449 @param[in] Type The key of the structure.\r
450 @param[in] Option The optional information.\r
451**/\r
452VOID\r
453DisplaySELVarDataFormatType (\r
454 IN UINT8 Type,\r
455 IN UINT8 Option\r
456 );\r
457\r
458/**\r
459 Display System Event Log (Type 15) dw1.\r
460\r
461 @param[in] Key The key of the structure.\r
462 @param[in] Option The optional information.\r
463**/\r
464VOID\r
465DisplayPostResultsBitmapDw1 (\r
466 IN UINT32 Key,\r
467 IN UINT8 Option\r
468 );\r
469\r
470/**\r
471 Display System Event Log (Type 15) dw2.\r
472\r
473 @param[in] Key The key of the structure.\r
474 @param[in] Option The optional information.\r
475**/\r
476VOID\r
477DisplayPostResultsBitmapDw2 (\r
478 IN UINT32 Key,\r
479 IN UINT8 Option\r
480 );\r
481\r
482/**\r
483 Display System Event Log (Type 15) type.\r
484\r
485 @param[in] SMType The key of the structure.\r
486 @param[in] Option The optional information.\r
487**/\r
488VOID\r
489DisplaySELSysManagementTypes (\r
490 IN UINT32 SMType,\r
491 IN UINT8 Option\r
492 );\r
493\r
494/**\r
495 Display Physical Memory Array (Type 16) Location.\r
496\r
497 @param[in] Location The key of the structure.\r
498 @param[in] Option The optional information.\r
499**/\r
500VOID\r
501DisplayPMALocation (\r
502 IN UINT8 Location,\r
503 IN UINT8 Option\r
504 );\r
505\r
506/**\r
507 Display Physical Memory Array (Type 16) Use.\r
508\r
509 @param[in] Use The key of the structure.\r
510 @param[in] Option The optional information.\r
511**/\r
512VOID\r
513DisplayPMAUse (\r
514 IN UINT8 Use,\r
515 IN UINT8 Option\r
516 );\r
517\r
518/**\r
519 Display Physical Memory Array (Type 16) Types.\r
520\r
521 @param[in] Type The key of the structure.\r
522 @param[in] Option The optional information.\r
523**/\r
524VOID\r
525DisplayPMAErrorCorrectionTypes (\r
526 IN UINT8 Type,\r
527 IN UINT8 Option\r
528 );\r
529\r
530/**\r
531 Display Memory Device (Type 17) form factor.\r
532\r
533 @param[in] FormFactor The key of the structure.\r
534 @param[in] Option The optional information.\r
535**/\r
536VOID\r
537DisplayMemoryDeviceFormFactor (\r
538 IN UINT8 FormFactor,\r
539 IN UINT8 Option\r
540 );\r
541\r
542/**\r
543 Display Memory Device (Type 17) type.\r
544\r
545 @param[in] Type The key of the structure.\r
546 @param[in] Option The optional information.\r
547**/\r
548VOID\r
549DisplayMemoryDeviceType (\r
550 IN UINT8 Type,\r
551 IN UINT8 Option\r
552 );\r
553\r
554/**\r
555 Display Memory Device (Type 17) details.\r
556\r
557 @param[in] Para The key of the structure.\r
558 @param[in] Option The optional information.\r
559**/\r
560VOID\r
561DisplayMemoryDeviceTypeDetail (\r
562 IN UINT16 Para,\r
563 IN UINT8 Option\r
564 );\r
565\r
566/**\r
567 Display 32-bit Memory Error Information (Type 18) type.\r
568\r
569 @param[in] ErrorType The key of the structure.\r
570 @param[in] Option The optional information.\r
571**/\r
572VOID\r
573DisplayMemoryErrorType (\r
574 IN UINT8 ErrorType,\r
575 IN UINT8 Option\r
576 );\r
577\r
578/**\r
579 Display 32-bit Memory Error Information (Type 18) error granularity.\r
580\r
581 @param[in] Granularity The key of the structure.\r
582 @param[in] Option The optional information.\r
583**/\r
584VOID\r
585DisplayMemoryErrorGranularity (\r
586 IN UINT8 Granularity,\r
587 IN UINT8 Option\r
588 );\r
589\r
590/**\r
591 Display 32-bit Memory Error Information (Type 18) error information.\r
592\r
593 @param[in] Operation The key of the structure.\r
594 @param[in] Option The optional information.\r
595**/\r
596VOID\r
597DisplayMemoryErrorOperation (\r
598 IN UINT8 Operation,\r
599 IN UINT8 Option\r
600 );\r
601\r
602/**\r
603 Display Built-in Pointing Device (Type 21) type information.\r
604\r
605 @param[in] Type The key of the structure.\r
606 @param[in] Option The optional information.\r
607**/\r
608VOID\r
609DisplayPointingDeviceType (\r
610 IN UINT8 Type,\r
611 IN UINT8 Option\r
612 );\r
613\r
614/**\r
615 Display Built-in Pointing Device (Type 21) information.\r
616\r
617 @param[in] Interface The key of the structure.\r
618 @param[in] Option The optional information.\r
619**/\r
620VOID\r
621DisplayPointingDeviceInterface (\r
622 IN UINT8 Interface,\r
623 IN UINT8 Option\r
624 );\r
625\r
626/**\r
627 Display Portable Battery (Type 22) information.\r
628\r
629 @param[in] Key The key of the structure.\r
630 @param[in] Option The optional information.\r
631**/\r
632VOID\r
633DisplayPBDeviceChemistry (\r
634 IN UINT8 Key,\r
635 IN UINT8 Option\r
636 );\r
637\r
638/**\r
639 Display Voltage Probe (Type 26) location information.\r
640\r
641 @param[in] Key The key of the structure.\r
642 @param[in] Option The optional information.\r
643**/\r
644VOID\r
645DisplayVPLocation (\r
646 IN UINT8 Key,\r
647 IN UINT8 Option\r
648 );\r
649\r
650/**\r
651 Display Voltage Probe (Type 26) status ype information.\r
652\r
653 @param[in] Key The key of the structure.\r
654 @param[in] Option The optional information.\r
655**/\r
656VOID\r
657DisplayVPStatus (\r
658 IN UINT8 Key,\r
659 IN UINT8 Option\r
660 );\r
661\r
662/**\r
663 Display Cooling (Type 27) status information.\r
664\r
665 @param[in] Key The key of the structure.\r
666 @param[in] Option The optional information.\r
667**/\r
668VOID\r
669DisplayCoolingDeviceStatus (\r
670 IN UINT8 Key,\r
671 IN UINT8 Option\r
672 );\r
673\r
674/**\r
675 Display Cooling (Type 27) type information.\r
676\r
677 @param[in] Key The key of the structure.\r
678 @param[in] Option The optional information.\r
679**/\r
680VOID\r
681DisplayCoolingDeviceType (\r
682 IN UINT8 Key,\r
683 IN UINT8 Option\r
684 );\r
685\r
686/**\r
687 Display Temperature Probe (Type 28) status information.\r
688\r
689 @param[in] Key The key of the structure.\r
690 @param[in] Option The optional information.\r
691**/\r
692VOID\r
693DisplayTemperatureProbeStatus (\r
694 IN UINT8 Key,\r
695 IN UINT8 Option\r
696 );\r
697\r
698/**\r
699 Display Temperature Probe (Type 28) location information.\r
700\r
701 @param[in] Key The key of the structure.\r
702 @param[in] Option The optional information.\r
703**/\r
704VOID\r
705DisplayTemperatureProbeLoc (\r
706 IN UINT8 Key,\r
707 IN UINT8 Option\r
708 );\r
709\r
710/**\r
711 Display Electrical Current Probe (Type 29) status information.\r
712\r
713 @param[in] Key The key of the structure.\r
714 @param[in] Option The optional information.\r
715**/\r
716VOID\r
717DisplayECPStatus (\r
718 IN UINT8 Key,\r
719 IN UINT8 Option\r
720 );\r
721\r
722/**\r
723 Display Electrical Current Probe (Type 29) location information.\r
724\r
725 @param[in] Key The key of the structure.\r
726 @param[in] Option The optional information.\r
727**/\r
728VOID\r
729DisplayECPLoc (\r
730 IN UINT8 Key,\r
731 IN UINT8 Option\r
732 );\r
733\r
734/**\r
735 Display Management Device (Type 34) Type.\r
736\r
737 @param[in] Key The key of the structure.\r
738 @param[in] Option The optional information.\r
739**/\r
740VOID\r
741DisplayMDType (\r
742 IN UINT8 Key,\r
743 IN UINT8 Option\r
744 );\r
745\r
746/**\r
747 Display Management Device (Type 34) Address Type.\r
748\r
749 @param[in] Key The key of the structure.\r
750 @param[in] Option The optional information.\r
751**/\r
752VOID\r
753DisplayMDAddressType (\r
754 IN UINT8 Key,\r
755 IN UINT8 Option\r
756 );\r
757\r
758/**\r
759 Display Memory Channel (Type 37) information.\r
760\r
761 @param[in] Key The key of the structure.\r
762 @param[in] Option The optional information.\r
763**/\r
764VOID\r
765DisplayMemoryChannelType (\r
766 IN UINT8 Key,\r
767 IN UINT8 Option\r
768 );\r
769\r
770/**\r
771 Display IPMI Device Information (Type 38) information.\r
772\r
773 @param[in] Key The key of the structure.\r
774 @param[in] Option The optional information.\r
775**/\r
776VOID\r
777DisplayIPMIDIBMCInterfaceType (\r
778 IN UINT8 Key,\r
779 IN UINT8 Option\r
780 );\r
781\r
782#endif\r