tianocore / edk2-redfish-client

Utilizes the EFI protocols provided by EDK2 Redfish Foundation to communicate with the Redfish service for creating, consuming, and updating the Redfish properties which are managed by firmware.
Other
7 stars 5 forks source link

[Design] feature driver OEM or hook support for customized attributes #24

Open nicklela opened 1 year ago

nicklela commented 1 year ago

A way of giving platform to customize attributes or support OEM attributes.

Some idea:

Discussion about data structure:

For example (protocol + JSON object version):

EFI_STAUTS 
(EFIAPI *FEATURE_DRIVER_OVERRIDE) (
 IN       PROTOCOL       *This,
 IN       CHAR8          *Uri,
 IN       CHAR8          *Schema,
 IN OUT EDKII_JSON_VALUE *Json
);

typedef struct _FEATURE_DRIVER_OVERRIDE_PROTOCOL {
  UINT64                   Revision;
  FEATURE_DRIVER_OVERRIDE  OverrideCallback;
} FEATURE_DRIVER_OVERRIDE_PROTOCOL;
nicklela commented 1 year ago
EFI_STAUTS 
(EFIAPI *EDKII_REDFISH_RESOURCE_ADDENDUM_PROVISIONING) (
 IN       PROTOCOL                *This,
 IN       CHAR8                      *Uri,
 IN       CHAR8                      *Schema,
 IN OUT EDKII_JSON_VALUE *Json
);

EFI_STAUTS 
(EFIAPI *EDKII_REDFISH_RESOURCE_ADDENDUM_OEM) (
 IN       PROTOCOL                *This,
 IN       CHAR8                      *Uri,
 IN       CHAR8                      *Schema,
 OUT    EDKII_JSON_VALUE  *Json
);

EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL {
  UINT64                                        Revision;
  EDKII_REDFISH_RESOURCE_ADDENDUM_OEM           OemCallback;
  EDKII_REDFISH_RESOURCE_ADDENDUM_PROVISIONING  ProvisioningCallback;
}

Example:

Schema { "Attributes": { } }

Provisioning BIOS -> USB over lan -> BMC HTTP PUT /redfish/v1/Systems/sys/Bios { "control-sku-guid": "aaa-dd-cc", "Attributes": { "processornum": { "value": 16, "readonly": true, }, } }

USER GET /redfish/v1/Systems/sys/Bios Redfish { "Attributes": { "processornum": 16 } }

nicklela commented 1 year ago

We need ADDENDUM protocol because there is some data that is required by BMC but the data is came from BIOS. We create this protocol to provide the data for BMC implementation. We can also define addendum items in UEFI specification.

nicklela commented 1 year ago

Code review here: