30 IN CONST VOID *PrimaryEntry,
31 IN CONST VOID *SecondaryEntry
34 CONST OC_STRING *DevPropsAddPrimaryEntry;
35 CONST OC_STRING *DevPropsAddSecondaryEntry;
36 CONST CHAR8 *DevPropsAddPrimaryDevicePathString;
37 CONST CHAR8 *DevPropsAddSecondaryDevicePathString;
39 DevPropsAddPrimaryEntry = *(CONST OC_STRING **)PrimaryEntry;
40 DevPropsAddSecondaryEntry = *(CONST OC_STRING **)SecondaryEntry;
41 DevPropsAddPrimaryDevicePathString =
OC_BLOB_GET (DevPropsAddPrimaryEntry);
42 DevPropsAddSecondaryDevicePathString =
OC_BLOB_GET (DevPropsAddSecondaryEntry);
44 return StringIsDuplicated (
"DeviceProperties->Add", DevPropsAddPrimaryDevicePathString, DevPropsAddSecondaryDevicePathString);
58 IN CONST VOID *PrimaryEntry,
59 IN CONST VOID *SecondaryEntry
62 CONST OC_STRING *DevPropsDeletePrimaryEntry;
63 CONST OC_STRING *DevPropsDeleteSecondaryEntry;
64 CONST CHAR8 *DevPropsDeletePrimaryDevicePathString;
65 CONST CHAR8 *DevPropsDeleteSecondaryDevicePathString;
67 DevPropsDeletePrimaryEntry = *(CONST OC_STRING **)PrimaryEntry;
68 DevPropsDeleteSecondaryEntry = *(CONST OC_STRING **)SecondaryEntry;
69 DevPropsDeletePrimaryDevicePathString =
OC_BLOB_GET (DevPropsDeletePrimaryEntry);
70 DevPropsDeleteSecondaryDevicePathString =
OC_BLOB_GET (DevPropsDeleteSecondaryEntry);
72 return StringIsDuplicated (
"DeviceProperties->Delete", DevPropsDeletePrimaryDevicePathString, DevPropsDeleteSecondaryDevicePathString);
78 IN OC_GLOBAL_CONFIG *Config
84 CONST CHAR8 *AsciiDevicePath;
85 CONST CHAR8 *AsciiProperty;
86 OC_ASSOC *PropertyMap;
90 for (DeviceIndex = 0; DeviceIndex < Config->DeviceProperties.Add.Count; ++DeviceIndex) {
91 AsciiDevicePath =
OC_BLOB_GET (Config->DeviceProperties.Add.Keys[DeviceIndex]);
94 DEBUG ((DEBUG_WARN,
"DeviceProperties->Add[%u]->DevicePath is borked! Please check the information above!\n", DeviceIndex));
98 PropertyMap = Config->DeviceProperties.Add.Values[DeviceIndex];
99 for (PropertyIndex = 0; PropertyIndex < PropertyMap->Count; ++PropertyIndex) {
100 AsciiProperty =
OC_BLOB_GET (PropertyMap->Keys[PropertyIndex]);
108 "DeviceProperties->Add[%u]->Property[%u] contains illegal character!\n",
122 sizeof (PropertyMap->Keys[0]),
131 Config->DeviceProperties.Add.Keys,
132 Config->DeviceProperties.Add.Count,
133 sizeof (Config->DeviceProperties.Add.Keys[0]),
143 IN OC_GLOBAL_CONFIG *Config
148 UINT32 PropertyIndex;
149 CONST CHAR8 *AsciiDevicePath;
150 CONST CHAR8 *AsciiProperty;
154 for (DeviceIndex = 0; DeviceIndex < Config->DeviceProperties.Delete.Count; ++DeviceIndex) {
155 AsciiDevicePath =
OC_BLOB_GET (Config->DeviceProperties.Delete.Keys[DeviceIndex]);
158 DEBUG ((DEBUG_WARN,
"DeviceProperties->Delete[%u]->DevicePath is borked! Please check the information above!\n", DeviceIndex));
162 for (PropertyIndex = 0; PropertyIndex < Config->DeviceProperties.Delete.Values[DeviceIndex]->Count; ++PropertyIndex) {
163 AsciiProperty =
OC_BLOB_GET (Config->DeviceProperties.Delete.Values[DeviceIndex]->Values[PropertyIndex]);
171 "DeviceProperties->Delete[%u]->Property[%u] contains illegal character!\n",
183 Config->DeviceProperties.Delete.Values[DeviceIndex]->Values,
184 Config->DeviceProperties.Delete.Values[DeviceIndex]->Count,
185 sizeof (Config->DeviceProperties.Delete.Values[DeviceIndex]->Values[0]),
194 Config->DeviceProperties.Delete.Keys,
195 Config->DeviceProperties.Delete.Count,
196 sizeof (Config->DeviceProperties.Delete.Keys[0]),
205 IN OC_GLOBAL_CONFIG *Config
215 DEBUG ((DEBUG_VERBOSE,
"config loaded into %a!\n", __func__));
219 for (Index = 0; Index <
ARRAY_SIZE (DevicePropertiesCheckers); ++Index) {
220 ErrorCount += DevicePropertiesCheckers[Index](Config);
#define ARRAY_SIZE(Array)
#define OC_BLOB_GET(Blob)
BOOLEAN AsciiDevicePathIsLegal(IN CONST CHAR8 *AsciiDevicePath)
UINT32 ReportError(IN CONST CHAR8 *FuncName, IN UINT32 ErrorCount)
BOOLEAN StringIsDuplicated(IN CONST CHAR8 *EntrySection, IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString)
UINT32 FindArrayDuplication(IN VOID *First, IN UINTN Number, IN UINTN Size, IN DUPLICATION_CHECK DupChecker)
BOOLEAN AsciiPropertyIsLegal(IN CONST CHAR8 *Property)
STATIC UINT32 CheckDevicePropertiesAdd(IN OC_GLOBAL_CONFIG *Config)
STATIC BOOLEAN DevPropsDeleteHasDuplication(IN CONST VOID *PrimaryEntry, IN CONST VOID *SecondaryEntry)
STATIC BOOLEAN DevPropsAddHasDuplication(IN CONST VOID *PrimaryEntry, IN CONST VOID *SecondaryEntry)
STATIC UINT32 CheckDevicePropertiesDelete(IN OC_GLOBAL_CONFIG *Config)
UINT32 CheckDeviceProperties(IN OC_GLOBAL_CONFIG *Config)
UINT32(* CONFIG_CHECK)(IN OC_GLOBAL_CONFIG *Config)