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