1 // SPDX-License-Identifier: GPL-2.0+
10 #include <efi_selftest.h>
12 struct efi_st_translate {
17 static struct efi_st_translate efi_st_control_characters[] = {
26 static u16 efi_st_ch[] = u"' '";
27 static u16 efi_st_unknown[] = u"unknown";
29 static struct efi_st_translate efi_st_scan_codes[] = {
68 {0x81, u"Volume Down"},
69 {0x100, u"Brightness Up"},
70 {0x101, u"Brightness Down"},
72 {0x103, u"Hibernate"},
73 {0x104, u"Toggle Display"},
79 u16 *efi_st_translate_char(u16 code)
81 struct efi_st_translate *tr;
87 for (tr = efi_st_control_characters; tr->text; ++tr) {
91 return efi_st_unknown;
94 u16 *efi_st_translate_code(u16 code)
96 struct efi_st_translate *tr;
98 for (tr = efi_st_scan_codes; tr->text; ++tr) {
102 return efi_st_unknown;
105 int efi_st_strcmp_16_8(const u16 *buf1, const unsigned char *buf2)
107 for (; *buf1 || *buf2; ++buf1, ++buf2) {
109 return *buf1 - *buf2;
114 void *efi_st_get_config_table(const efi_guid_t *guid)
118 for (i = 0; i < st_systable->nr_tables; i++) {
119 if (!guidcmp(guid, &st_systable->tables[i].guid))
120 return st_systable->tables[i].table;