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