12.4.4 Making configuration data available to other drivers

Configuration data is stored in NVRAM. The data structures that contain the static and configurable data for the driver are typically part of the package published to the HII database. In order to make configuration data available to other drivers, make sure to do the following:

  1. Extract the forms from the form database.
  2. Parse the forms for the names of the configurable options.
  3. Use the HII Config Access Protocol to extract the data from all drivers.

12.4.4.1 Check validity of configuration options for a specific device

The UEFI Specification defines a CallBack() service in the HII Config Access Protocol. This protocol interfaces with the VFR language. The callback protocol includes an action, QuestionId, type, value, and action request. When the user changes a configuration setting, this causes a call back to the driver. The driver then needs to check to see if the value entered is valid.

The data structure for configuration options is initialized via the driver's init entry point. The init reads the configuration data out of NVRAM and makes sure the data is valid. If any particular variable is invalid, the value for that variable is reset to its default.

The platform vendor can validate the configuration of all devices in the system before booting. In addition, the devices can be reset to their default configurations. If the firmware detects a corrupt configuration then a default configuration may be selected automatically. The platform vendor may choose to allow the user to select a menu item to force defaults on a specific device or all devices at once.