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