From 804405e7d10525e41720216137b2551f62a0663f Mon Sep 17 00:00:00 2001 From: eric_tian Date: Mon, 30 Jun 2008 05:08:49 +0000 Subject: Port EdkUnixPkg to UnixPkg. The changes are listed as follows: 1. change *.msa to *.inf, and create platform configuration files .dec&.dsc&.fdf to comply with Edk2 build process 2. using PCD mechanism to replace macro. 3. change Sec code to cowork with PI1.0 Pei Core and produce temparory memory ppi. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5380 6f19259b-4bc3-4df7-8a09-765794883524 --- .../MiscBaseBoardManufacturer.uni | Bin 0 -> 2896 bytes .../MiscBaseBoardManufacturerData.c | 57 ++++ UnixPkg/MiscSubClassPlatformDxe/MiscBiosVendor.uni | Bin 0 -> 2260 bytes .../MiscSubClassPlatformDxe/MiscBiosVendorData.c | 88 ++++++ .../MiscBootInformationData.c | 33 ++ .../MiscChassisManufacturer.uni | Bin 0 -> 2460 bytes .../MiscChassisManufacturerData.c | 45 +++ UnixPkg/MiscSubClassPlatformDxe/MiscDevicePath.h | 175 +++++++++++ .../MiscNumberOfInstallableLanguagesData.c | 37 +++ UnixPkg/MiscSubClassPlatformDxe/MiscOemString.uni | Bin 0 -> 1996 bytes .../MiscSubClassPlatformDxe/MiscOemStringData.c | 32 ++ .../MiscPortInternalConnectorDesignator.uni | Bin 0 -> 9426 bytes .../MiscPortInternalConnectorDesignatorData.c | 99 ++++++ .../MiscPortInternalConnectorDesignatorFunction.c | 266 ++++++++++++++++ .../MiscResetCapabilitiesData.c | 42 +++ .../MiscSubClassPlatformDxe/MiscSubClassDriver.h | 119 ++++++++ .../MiscSubClassPlatformDxe/MiscSubClassDriver.inf | 100 ++++++ .../MiscSubClassPlatformDxe/MiscSubClassDriver.msa | 170 +++++++++++ .../MiscSubClassPlatformDxe/MiscSubClassDriver.uni | Bin 0 -> 2778 bytes .../MiscSubclassDriverDataTable.c | 99 ++++++ .../MiscSubclassDriverEntryPoint.c | 334 +++++++++++++++++++++ .../MiscSystemLanguageString.uni | Bin 0 -> 2014 bytes .../MiscSystemLanguageStringData.c | 33 ++ .../MiscSystemManufacturer.uni | Bin 0 -> 2456 bytes .../MiscSystemManufacturerData.c | 57 ++++ .../MiscSystemManufacturerFunction.c | 122 ++++++++ .../MiscSystemOptionString.uni | Bin 0 -> 2004 bytes .../MiscSystemOptionStringData.c | 32 ++ .../MiscSystemSlotDesignation.uni | Bin 0 -> 2030 bytes .../MiscSystemSlotDesignationData.c | 52 ++++ 30 files changed, 1992 insertions(+) create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturer.uni create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerData.c create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscBiosVendor.uni create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscBiosVendorData.c create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscBootInformationData.c create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscChassisManufacturer.uni create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscChassisManufacturerData.c create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscDevicePath.h create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesData.c create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscOemString.uni create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscOemStringData.c create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignator.uni create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorData.c create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorFunction.c create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesData.c create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.h create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.inf create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.msa create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.uni create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscSubclassDriverDataTable.c create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscSystemLanguageString.uni create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringData.c create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturer.uni create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturerData.c create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturerFunction.c create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscSystemOptionString.uni create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscSystemOptionStringData.c create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignation.uni create mode 100644 UnixPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationData.c (limited to 'UnixPkg/MiscSubClassPlatformDxe') diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturer.uni b/UnixPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturer.uni new file mode 100644 index 0000000..14a6893 Binary files /dev/null and b/UnixPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturer.uni differ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerData.c new file mode 100644 index 0000000..14c7ef0 --- /dev/null +++ b/UnixPkg/MiscSubClassPlatformDxe/MiscBaseBoardManufacturerData.c @@ -0,0 +1,57 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + MiscBaseBoardManufacturerData.c + +Abstract: + + This driver parses the mMiscSubclassDataTable structure and reports + any generated data to the DataHub. + +--*/ + +#include "MiscSubClassDriver.h" + +// +// Static (possibly build generated) Bios Vendor data. +// +MISC_SUBCLASS_TABLE_DATA(EFI_MISC_BASE_BOARD_MANUFACTURER_DATA, MiscBaseBoardManufacturer) = { + STRING_TOKEN(STR_MISC_BASE_BOARD_MANUFACTURER), + STRING_TOKEN(STR_MISC_BASE_BOARD_PRODUCT_NAME), + STRING_TOKEN(STR_MISC_BASE_BOARD_VERSION), + STRING_TOKEN(STR_MISC_BASE_BOARD_SERIAL_NUMBER), + STRING_TOKEN(STR_MISC_BASE_BOARD_ASSET_TAG), + STRING_TOKEN(STR_MISC_BASE_BOARD_CHASSIS_LOCATION), + { // BaseBoardFeatureFlags + 1, // Motherboard + 0, // RequiresDaughterCard + 0, // Removable + 1, // Replaceable, + 0, // HotSwappable + 0, // Reserved + }, + EfiBaseBoardTypeUnknown, // BaseBoardType + { // BaseBoardChassisLink + EFI_MISC_SUBCLASS_GUID, // ProducerName + 1, // Instance + 1, // SubInstance + }, + 0, // BaseBoardNumberLinks + { // LinkN + EFI_MISC_SUBCLASS_GUID, // ProducerName + 1, // Instance + 1, // SubInstance + }, +}; + +/* eof - MiscBaseBoardManufacturerData.c */ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscBiosVendor.uni b/UnixPkg/MiscSubClassPlatformDxe/MiscBiosVendor.uni new file mode 100644 index 0000000..b1e7e52 Binary files /dev/null and b/UnixPkg/MiscSubClassPlatformDxe/MiscBiosVendor.uni differ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscBiosVendorData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscBiosVendorData.c new file mode 100644 index 0000000..61d60e2 --- /dev/null +++ b/UnixPkg/MiscSubClassPlatformDxe/MiscBiosVendorData.c @@ -0,0 +1,88 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + MiscBiosVendorData.c + +Abstract: + + This driver parses the mMiscSubclassDataTable structure and reports + any generated data to the DataHub. + +--*/ + +#include "MiscSubClassDriver.h" + +// +// Static (possibly build generated) Bios Vendor data. +// +MISC_SUBCLASS_TABLE_DATA(EFI_MISC_BIOS_VENDOR_DATA, MiscBiosVendor) = { + STRING_TOKEN(STR_MISC_BIOS_VENDOR), // BiosVendor + STRING_TOKEN(STR_MISC_BIOS_VERSION), // BiosVersion + STRING_TOKEN(STR_MISC_BIOS_RELEASE_DATE), // BiosReleaseDate + 0xBABE, // BiosStartingAddress + { // BiosPhysicalDeviceSize + 2, // Value + 3, // Exponent + }, + { // BiosCharacteristics1 + 0, // Reserved1 :2 + 0, // Unknown :1 + 1, // BiosCharacteristicsNotSupported :1 + 0, // IsaIsSupported :1 + 0, // McaIsSupported :1 + 0, // EisaIsSupported :1 + 0, // PciIsSupported :1 + 0, // PcmciaIsSupported :1 + 0, // PlugAndPlayIsSupported :1 + 0, // ApmIsSupported :1 + 0, // BiosIsUpgradable :1 + 0, // BiosShadowingAllowed :1 + 0, // VlVesaIsSupported :1 + 0, // EscdSupportIsAvailable :1 + 0, // BootFromCdIsSupported :1 + 0, // SelectableBootIsSupported :1 + 0, // RomBiosIsSocketed :1 + 0, // BootFromPcmciaIsSupported :1 + 0, // EDDSpecificationIsSupported :1 + 0, // JapaneseNecFloppyIsSupported :1 + 0, // JapaneseToshibaFloppyIsSupported :1 + 0, // Floppy525_360IsSupported :1 + 0, // Floppy525_12IsSupported :1 + 0, // Floppy35_720IsSupported :1 + 0, // Floppy35_288IsSupported :1 + 0, // PrintScreenIsSupported :1 + 0, // Keyboard8042IsSupported :1 + 0, // SerialIsSupported :1 + 0, // PrinterIsSupported :1 + 0, // CgaMonoIsSupported :1 + 0, // NecPc98 :1 + 0, // AcpiIsSupported :1 + 0, // UsbLegacyIsSupported :1 + 0, // AgpIsSupported :1 + 0, // I20BootIsSupported :1 + 0, // Ls120BootIsSupported :1 + 0, // AtapiZipDriveBootIsSupported :1 + 0, // Boot1394IsSupported :1 + 0, // SmartBatteryIsSupported :1 + 0, // BiosBootSpecIsSupported :1 + 0, // FunctionKeyNetworkBootIsSupported :1 + 0 // Reserved :22 + }, + { // BiosCharacteristics2 + 0, // BiosReserved :16 + 0, // SystemReserved :16 + 0 // Reserved :32 + }, +}; + +/* eof - MiscBiosVendorData.c */ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscBootInformationData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscBootInformationData.c new file mode 100644 index 0000000..0a9cffa --- /dev/null +++ b/UnixPkg/MiscSubClassPlatformDxe/MiscBootInformationData.c @@ -0,0 +1,33 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + MiscBootInformationData.c + +Abstract: + + This driver parses the mMiscSubclassDataTable structure and reports + any generated data to the DataHub. + +--*/ + +#include "MiscSubClassDriver.h" + +// +// Static (possibly build generated) Bios Vendor data. +// +MISC_SUBCLASS_TABLE_DATA(EFI_MISC_BOOT_INFORMATION_STATUS_DATA, BootInformationStatus) = { + EfiBootInformationStatusNoError, // BootInformationStatus + {0} // BootInformationData +}; + +/* eof - MiscBootInformationData.c */ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscChassisManufacturer.uni b/UnixPkg/MiscSubClassPlatformDxe/MiscChassisManufacturer.uni new file mode 100644 index 0000000..67bee85 Binary files /dev/null and b/UnixPkg/MiscSubClassPlatformDxe/MiscChassisManufacturer.uni differ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscChassisManufacturerData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscChassisManufacturerData.c new file mode 100644 index 0000000..6a3986f --- /dev/null +++ b/UnixPkg/MiscSubClassPlatformDxe/MiscChassisManufacturerData.c @@ -0,0 +1,45 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + MiscChassisManufacturerData.c + +Abstract: + + This driver parses the mMiscSubclassDataTable structure and reports + any generated data to the DataHub. + +--*/ + +#include "MiscSubClassDriver.h" + +// +// Static (possibly build generated) Chassis Manufacturer data. +// +MISC_SUBCLASS_TABLE_DATA(EFI_MISC_CHASSIS_MANUFACTURER_DATA, MiscChassisManufacturer) = { + STRING_TOKEN(STR_MISC_CHASSIS_MANUFACTURER), // ChassisManufactrurer + STRING_TOKEN(STR_MISC_CHASSIS_VERSION), // ChassisVersion + STRING_TOKEN(STR_MISC_CHASSIS_SERIAL_NUMBER), // ChassisSerialNumber + STRING_TOKEN(STR_MISC_CHASSIS_ASSET_TAG), // ChassisAssetTag + { // ChassisTypeStatus + EfiMiscChassisTypeOther, // ChassisType + 0, // ChassisLockPresent + 0 // Reserved + }, + EfiChassisStateOther, // ChassisBootupState + EfiChassisStateOther, // ChassisPowerSupplyState + EfiChassisStateOther, // ChassisThermalState + EfiChassisSecurityStatusOther, // ChassisSecurityState + 0 // ChassisOemDefined +}; + +/* eof - MiscChassisManufacaturerData.c */ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscDevicePath.h b/UnixPkg/MiscSubClassPlatformDxe/MiscDevicePath.h new file mode 100644 index 0000000..ae0e633 --- /dev/null +++ b/UnixPkg/MiscSubClassPlatformDxe/MiscDevicePath.h @@ -0,0 +1,175 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + MiscDevicePath.h + +Abstract: + + Misc class required EFI Device Path definitions (Ports, slots & + onboard devices) + +--*/ + +#ifndef _MISC_DEVICE_PATH_H +#define _MISC_DEVICE_PATH_H + + +#pragma pack(1) +// +// USB +// + +/* For reference: +#define USB1_1_STR "ACPI(PNP0A03,0)/PCI(1D,0)." +#define USB1_2_STR "ACPI(PNP0A03,0)/PCI(1D,1)." +#define USB1_3_STR "ACPI(PNP0A03,0)/PCI(1D,2)." +#define USB2_1_STR "ACPI(PNP0A03,0)/PCI(1D,7)." +*/ + +// +// #define acpi { 0x02, 0x01, 0x00, 0x0C, 0x0a0341d0, 0x00000000 } +// #define pci( device,function) { 0x01, 0x01, 0x00, 0x06, device, function } +// #define end { 0xFF, 0xFF, 0x00, 0x04 } +// +#define DP_ACPI \ + { \ + {ACPI_DEVICE_PATH, ACPI_DP, {(UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), (UINT8) \ + ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8)}}, EISA_PNP_ID (0x0A03), 0 \ + } +#define DP_PCI(device, function) \ + { \ + {HARDWARE_DEVICE_PATH, HW_PCI_DP, {(UINT8) (sizeof (PCI_DEVICE_PATH)), (UINT8) \ + ((sizeof (PCI_DEVICE_PATH)) >> 8)}}, function, device \ + } +#define DP_END \ + { \ + END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, {END_DEVICE_PATH_LENGTH, 0} \ + } + +#define DP_LPC(eisaid, function) \ + { \ + {ACPI_DEVICE_PATH, ACPI_DP, {(UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), (UINT8) \ + ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8)}}, EISA_PNP_ID (eisaid), function \ + } + +// +// Shanmu >> moved to TianoDevicePath.h +// + +/* +typedef struct _USB_PORT_DEVICE_PATH +{ + ACPI_HID_DEVICE_PATH PciRootBridgeDevicePath; + PCI_DEVICE_PATH PciBusDevicePath; + EFI_DEVICE_PATH_PROTOCOL EndDevicePath; +} USB_PORT_DEVICE_PATH; + + +//IDE ??I am not sure. Should this be ATAPI_DEVICE_PATH +typedef struct _IDE_DEVICE_PATH +{ + ACPI_HID_DEVICE_PATH PciRootBridgeDevicePath; + PCI_DEVICE_PATH PciBusDevicePath; + EFI_DEVICE_PATH_PROTOCOL EndDevicePath; +} IDE_DEVICE_PATH; + +//RMC Connector +typedef struct _RMC_CONN_DEVICE_PATH +{ + ACPI_HID_DEVICE_PATH PciRootBridgeDevicePath; + PCI_DEVICE_PATH PciBridgeDevicePath; + PCI_DEVICE_PATH PciBusDevicePath; + EFI_DEVICE_PATH_PROTOCOL EndDevicePath; +} RMC_CONN_DEVICE_PATH; + +//static RMC_CONN_DEVICE_PATH mRmcConnDevicePath = { acpi, pci( 0x1E,0x00 ),pci( 0x0A,0x00 ), end }; + +//RIDE +typedef struct _RIDE_DEVICE_PATH +{ + ACPI_HID_DEVICE_PATH PciRootBridgeDevicePath; + PCI_DEVICE_PATH PciBridgeDevicePath; + PCI_DEVICE_PATH PciBusDevicePath; + EFI_DEVICE_PATH_PROTOCOL EndDevicePath; +} RIDE_DEVICE_PATH; + +//static RIDE_DEVICE_PATH mRideDevicePath = { acpi, pci( 0x1E,0x00 ),pci( 0x02,0x00 ), end }; + +//Gigabit NIC +//typedef struct _GB_NIC_DEVICE_PATH +//{ +// ACPI_HID_DEVICE_PATH PciRootBridgeDevicePath; +// PCI_DEVICE_PATH PciBridgeDevicePath; +// PCI_DEVICE_PATH PciXBridgeDevicePath; +// PCI_DEVICE_PATH PciXBusDevicePath; +// EFI_DEVICE_PATH_PROTOCOL EndDevicePath; +//} GB_NIC_DEVICE_PATH; + +//static GB_NIC_DEVICE_PATH mGbNicDevicePath = { acpi, pci( 0x03,0x00 ),pci( 0x1F,0x00 ),pci( 0x07,0x00 ), end }; + + +//P/S2 Connector +typedef struct _PS2_CONN_DEVICE_PATH +{ + ACPI_HID_DEVICE_PATH PciRootBridgeDevicePath; + PCI_DEVICE_PATH LpcBridgeDevicePath; + ACPI_HID_DEVICE_PATH LpcBusDevicePath; + EFI_DEVICE_PATH_PROTOCOL EndDevicePath; +} PS2_CONN_DEVICE_PATH; + +//static PS2_CONN_DEVICE_PATH mPs2KeyboardDevicePath = { acpi, pci( 0x1F,0x00 ),lpc( 0x0303,0 ), end }; +//static PS2_CONN_DEVICE_PATH mPs2MouseDevicePath = { acpi, pci( 0x1F,0x00 ),lpc( 0x0303,1 ), end }; + +//Serial Port Connector +typedef struct _SERIAL_CONN_DEVICE_PATH +{ + ACPI_HID_DEVICE_PATH PciRootBridgeDevicePath; + PCI_DEVICE_PATH LpcBridgeDevicePath; + ACPI_HID_DEVICE_PATH LpcBusDevicePath; + EFI_DEVICE_PATH_PROTOCOL EndDevicePath; +} SERIAL_CONN_DEVICE_PATH; + +//static SERIAL_CONN_DEVICE_PATH mCom1DevicePath = { acpi, pci( 0x1F,0x00 ),lpc( 0x0501,0 ), end }; +//static SERIAL_CONN_DEVICE_PATH mCom2DevicePath = { acpi, pci( 0x1F,0x00 ),lpc( 0x0501,1 ), end }; + +//Parallel Port Connector +typedef struct _PARALLEL_CONN_DEVICE_PATH +{ + ACPI_HID_DEVICE_PATH PciRootBridgeDevicePath; + PCI_DEVICE_PATH LpcBridgeDevicePath; + ACPI_HID_DEVICE_PATH LpcBusDevicePath; + EFI_DEVICE_PATH_PROTOCOL EndDevicePath; +} PARALLEL_CONN_DEVICE_PATH; + +//static PARALLEL_CONN_DEVICE_PATH mLpt1DevicePath = { acpi, pci( 0x1F,0x00 ),lpc( 0x0401,0 ), end }; + +//Floopy Connector +typedef struct _FLOOPY_CONN_DEVICE_PATH +{ + ACPI_HID_DEVICE_PATH PciRootBridgeDevicePath; + PCI_DEVICE_PATH LpcBridgeDevicePath; + ACPI_HID_DEVICE_PATH LpcBusDevicePath; + EFI_DEVICE_PATH_PROTOCOL EndDevicePath; +} FLOOPY_CONN_DEVICE_PATH; + +//static FLOOPY_CONN_DEVICE_PATH mFloopyADevicePath = { acpi, pci( 0x1F,0x00 ),lpc( 0x0604,0 ), end }; +//static FLOOPY_CONN_DEVICE_PATH mFloopyBDevicePath = { acpi, pci( 0x1F,0x00 ),lpc( 0x0604,1 ), end }; + +*/ + +// +// End Shanmu +// +#pragma pack() + +#endif diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesData.c new file mode 100644 index 0000000..48d8651 --- /dev/null +++ b/UnixPkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesData.c @@ -0,0 +1,37 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + MiscNumberOfInstallableLanguagesData.c + +Abstract: + + This driver parses the mMiscSubclassDataTable structure and reports + any generated data to the DataHub. + +--*/ + +#include "MiscSubClassDriver.h" + +// +// Static (possibly build generated) Bios Vendor data. +// +MISC_SUBCLASS_TABLE_DATA(EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES_DATA, NumberOfInstallableLanguages) = { + 1, // NumberOfInstallableLanguages + { // LanguageFlags + 0, // AbbreviatedLanguageFormat + 0 // Reserved + }, + 0, // CurrentLanguageNumber +}; + +/* eof - MiscNumberOfInstallableLanguagesData.c */ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscOemString.uni b/UnixPkg/MiscSubClassPlatformDxe/MiscOemString.uni new file mode 100644 index 0000000..fb79bdb Binary files /dev/null and b/UnixPkg/MiscSubClassPlatformDxe/MiscOemString.uni differ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscOemStringData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscOemStringData.c new file mode 100644 index 0000000..170d6dc --- /dev/null +++ b/UnixPkg/MiscSubClassPlatformDxe/MiscOemStringData.c @@ -0,0 +1,32 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + MiscOemStringData.c + +Abstract: + + This driver parses the mMiscSubclassDataTable structure and reports + any generated data to the DataHub. + +--*/ + +#include "MiscSubClassDriver.h" + +// +// Static (possibly build generated) Bios Vendor data. +// +MISC_SUBCLASS_TABLE_DATA(EFI_MISC_OEM_STRING_DATA, OemString) = { + { STRING_TOKEN(STR_MISC_OEM_STRING) } +}; + +/* eof - MiscOemStringData.c */ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignator.uni b/UnixPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignator.uni new file mode 100644 index 0000000..b6a617b Binary files /dev/null and b/UnixPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignator.uni differ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorData.c new file mode 100644 index 0000000..ac3abcc --- /dev/null +++ b/UnixPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorData.c @@ -0,0 +1,99 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + MiscPortInternalConnectorDesignatorData.c + +Abstract: + + This driver parses the mMiscSubclassDataTable structure and reports + any generated data to the DataHub. + +--*/ + +#include "MiscSubClassDriver.h" + +// +// Static (possibly build generated) Bios Vendor data. +// +MISC_SUBCLASS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortInternalConnectorDesignator) = { + STRING_TOKEN(STR_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR), // PortInternalConnectorDesignator + STRING_TOKEN(STR_MISC_PORT_EXTERNAL_CONNECTOR_DESIGNATOR), // PortExternalConnectorDesignator + EfiPortConnectorTypeOther, // PortInternalConnectorType + EfiPortConnectorTypeOther, // PortExternalConnectorType + EfiPortTypeNone, // PortType + {{{{0, 0, {0, 0}}, 0, 0}, {{0, 0, {0, 0}}, 0, 0}, {0, 0, {0, 0}}}} // PortPath +}; + +// +// Static (possibly build generated) Bios Vendor data. +// +MISC_SUBCLASS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortKeyboard) = { + STRING_TOKEN (STR_MISC_PORT_INTERNAL_KEYBOARD), // PortInternalConnectorDesignator + STRING_TOKEN (STR_MISC_PORT_EXTERNAL_KEYBOARD), // PortExternalConnectorDesignator + EfiPortConnectorTypeNone, // PortInternalConnectorType + EfiPortConnectorTypePS2, // PortExternalConnectorType + EfiPortTypeKeyboard, // PortType + // mPs2KbyboardDevicePath // PortPath + // + {{{{0, 0, {0, 0}}, 0, 0}, {{0, 0, {0, 0}}, 0, 0}, {0, 0, {0, 0}}}} // PortPath +}; + +MISC_SUBCLASS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortMouse) = { + STRING_TOKEN (STR_MISC_PORT_INTERNAL_MOUSE), // PortInternalConnectorDesignator + STRING_TOKEN (STR_MISC_PORT_EXTERNAL_MOUSE), // PortExternalConnectorDesignator + EfiPortConnectorTypeNone, // PortInternalConnectorType + EfiPortConnectorTypePS2, // PortExternalConnectorType + EfiPortTypeMouse, // PortType + // mPs2MouseDevicePath // PortPath + // + {{{{0, 0, {0, 0}}, 0, 0}, {{0, 0, {0, 0}}, 0, 0}, {0, 0, {0, 0}}}} // PortPath +}; + + +MISC_SUBCLASS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortCom1) = { + STRING_TOKEN(STR_MISC_PORT_INTERNAL_COM1), + STRING_TOKEN(STR_MISC_PORT_EXTERNAL_COM1), + EfiPortConnectorTypeNone, + EfiPortConnectorTypeDB9Female, + EfiPortTypeSerial16550ACompatible, + {{{{0, 0, {0, 0}}, 0, 0}, {{0, 0, {0, 0}}, 0, 0}, {0, 0, {0, 0}}}} // PortPath +}; + +MISC_SUBCLASS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortCom2) = { + STRING_TOKEN(STR_MISC_PORT_INTERNAL_COM2), + STRING_TOKEN(STR_MISC_PORT_EXTERNAL_COM2), + EfiPortConnectorTypeNone, + EfiPortConnectorTypeDB9Female, + EfiPortTypeSerial16550ACompatible, + {{{{0, 0, {0, 0}}, 0, 0}, {{0, 0, {0, 0}}, 0, 0}, {0, 0, {0, 0}}}} // PortPath +}; + +MISC_SUBCLASS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortExtensionPower) = { + STRING_TOKEN(STR_MISC_PORT_INTERNAL_EXTENSION_POWER), + STRING_TOKEN(STR_MISC_PORT_EXTERNAL_EXTENSION_POWER), + EfiPortConnectorTypeOther, + EfiPortConnectorTypeNone, + EfiPortTypeOther, + {{{{0, 0, {0, 0}}, 0, 0}, {{0, 0, {0, 0}}, 0, 0}, {0, 0, {0, 0}}}} // PortPath +}; + +MISC_SUBCLASS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortFloppy) = { + STRING_TOKEN(STR_MISC_PORT_INTERNAL_FLOPPY), + STRING_TOKEN(STR_MISC_PORT_EXTERNAL_FLOPPY), + EfiPortConnectorTypeOnboardFloppy, + EfiPortConnectorTypeNone, + EfiPortTypeOther, + {{{{0, 0, {0, 0}}, 0, 0}, {{0, 0, {0, 0}}, 0, 0}, {0, 0, {0, 0}}}} // PortPath +}; + +/* eof - MiscPortInternalConnectorDesignatorData.c */ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorFunction.c b/UnixPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorFunction.c new file mode 100644 index 0000000..bc3e549 --- /dev/null +++ b/UnixPkg/MiscSubClassPlatformDxe/MiscPortInternalConnectorDesignatorFunction.c @@ -0,0 +1,266 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + MiscPortInternalConnectorDesignatorFunction.c + +Abstract: + + This driver parses the mMiscSubclassDataTable structure and reports + any generated data to the DataHub. + +--*/ + +#include "MiscSubClassDriver.h" + +// +// +// +MISC_SUBCLASS_TABLE_FUNCTION ( + MiscPortInternalConnectorDesignator + ) +/*++ +Description: + + This function makes boot time changes to the contents of the + MiscPortConnectorInformation (Type 8). + +Parameters: + + RecordType + Type of record to be processed from the Data Table. + mMiscSubclassDataTable[].RecordType + + RecordLen + Size of static RecordData from the Data Table. + mMiscSubclassDataTable[].RecordLen + + RecordData + Pointer to copy of RecordData from the Data Table. Changes made + to this copy will be written to the Data Hub but will not alter + the contents of the static Data Table. + + LogRecordData + Set *LogRecordData to TRUE to log RecordData to Data Hub. + Set *LogRecordData to FALSE when there is no more data to log. + +Returns: + + EFI_SUCCESS + All parameters were valid and *RecordData and *LogRecordData have + been set. + + EFI_UNSUPPORTED + Unexpected RecordType value. + + EFI_INVALID_PARAMETER + One of the following parameter conditions was true: + RecordLen was zero. + RecordData was NULL. + LogRecordData was NULL. +--*/ +{ + STATIC BOOLEAN Done = FALSE; + STATIC PS2_CONN_DEVICE_PATH mPs2KeyboardDevicePath = { DP_ACPI, DP_PCI (0x1F, 0x00), DP_LPC (0x0303, 0), DP_END }; + STATIC PS2_CONN_DEVICE_PATH mPs2MouseDevicePath = { DP_ACPI, DP_PCI (0x1F, 0x00), DP_LPC (0x0303, 1), DP_END }; + STATIC SERIAL_CONN_DEVICE_PATH mCom1DevicePath = { DP_ACPI, DP_PCI (0x1F, 0x00), DP_LPC (0x0501, 0), DP_END }; + STATIC SERIAL_CONN_DEVICE_PATH mCom2DevicePath = { DP_ACPI, DP_PCI (0x1F, 0x00), DP_LPC (0x0501, 1), DP_END }; + //STATIC PARALLEL_CONN_DEVICE_PATH mLpt1DevicePath = { DP_ACPI, DP_PCI (0x1F, 0x00), DP_LPC (0x0401, 0), DP_END }; + STATIC FLOOPY_CONN_DEVICE_PATH mFloopyADevicePath = { DP_ACPI, DP_PCI (0x1F, 0x00), DP_LPC (0x0604, 0), DP_END }; + //STATIC FLOOPY_CONN_DEVICE_PATH mFloopyBDevicePath = { DP_ACPI, DP_PCI (0x1F, 0x00), DP_LPC (0x0604, 1), DP_END }; + //STATIC USB_PORT_DEVICE_PATH mUsb0DevicePath = { DP_ACPI, DP_PCI (0x1d, 0x00), DP_END }; + //STATIC USB_PORT_DEVICE_PATH mUsb1DevicePath = { DP_ACPI, DP_PCI (0x1d, 0x01), DP_END }; + //STATIC USB_PORT_DEVICE_PATH mUsb2DevicePath = { DP_ACPI, DP_PCI (0x1d, 0x02), DP_END }; + //STATIC USB_PORT_DEVICE_PATH mUsb3DevicePath = { DP_ACPI, DP_PCI (0x1d, 0x07), DP_END }; + //STATIC IDE_DEVICE_PATH mIdeDevicePath = { DP_ACPI, DP_PCI (0x1F, 0x01), DP_END }; + //STATIC GB_NIC_DEVICE_PATH mGbNicDevicePath = { DP_ACPI, DP_PCI( 0x03,0x00 ),DP_PCI( 0x1F,0x00 ),DP_PCI( 0x07,0x00 ), DP_END }; + EFI_DEVICE_PATH_PROTOCOL EndDevicePath = DP_END; + + // + // First check for invalid parameters. + // + // Shanmu >> to fix the Device Path Issue... + // if (RecordLen == 0 || RecordData == NULL || LogRecordData == NULL) { + // + if (*RecordLen == 0 || RecordData == NULL || LogRecordData == NULL) { + // + // End Shanmu + // + return EFI_INVALID_PARAMETER; + } + // + // Then check for unsupported RecordType. + // + if (RecordType != EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_RECORD_NUMBER) { + return EFI_UNSUPPORTED; + } + // + // Is this the first time through this function? + // + if (!Done) { + // + // Yes, this is the first time. Inspect/Change the contents of the + // RecordData structure. + // + // + // Device path is only updated here as it was not taking that in static data + // + // Shanmu >> to fix the Device Path Issue... + // + + /* + switch (((EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA *)RecordData)->PortInternalConnectorDesignator) + { + case STR_MISC_PORT_INTERNAL_MOUSE: + { + (EFI_DEVICE_PATH_PROTOCOL)((EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA *)RecordData)->PortPath = *((EFI_DEVICE_PATH_PROTOCOL*)&mPs2MouseDevicePath); + }break; + case STR_MISC_PORT_INTERNAL_KEYBOARD: + { + (EFI_DEVICE_PATH_PROTOCOL)((EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA *)RecordData)->PortPath = *((EFI_DEVICE_PATH_PROTOCOL*)&mPs2KeyboardDevicePath); + }break; + case STR_MISC_PORT_INTERNAL_COM1: + { + (EFI_DEVICE_PATH_PROTOCOL)((EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA *)RecordData)->PortPath = *((EFI_DEVICE_PATH_PROTOCOL*)&mCom1DevicePath); + }break; + case STR_MISC_PORT_INTERNAL_COM2: + { + (EFI_DEVICE_PATH_PROTOCOL)((EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA *)RecordData)->PortPath = *((EFI_DEVICE_PATH_PROTOCOL*)&mCom2DevicePath); + }break; + case STR_MISC_PORT_INTERNAL_LPT1: + { + (EFI_DEVICE_PATH_PROTOCOL)((EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA *)RecordData)->PortPath = *((EFI_DEVICE_PATH_PROTOCOL*)&mLpt1DevicePath); + }break; + case STR_MISC_PORT_INTERNAL_USB1: + { + (EFI_DEVICE_PATH_PROTOCOL)((EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA *)RecordData)->PortPath = *((EFI_DEVICE_PATH_PROTOCOL*)&mUsb0DevicePath); + }break; + case STR_MISC_PORT_INTERNAL_USB2: + { + (EFI_DEVICE_PATH_PROTOCOL)((EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA *)RecordData)->PortPath = *((EFI_DEVICE_PATH_PROTOCOL*)&mUsb1DevicePath); + }break; + case STR_MISC_PORT_INTERNAL_USB3: + { + (EFI_DEVICE_PATH_PROTOCOL)((EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA *)RecordData)->PortPath = *((EFI_DEVICE_PATH_PROTOCOL*)&mUsb2DevicePath); + }break; + case STR_MISC_PORT_INTERNAL_NETWORK: + { + (EFI_DEVICE_PATH_PROTOCOL)((EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA *)RecordData)->PortPath = *((EFI_DEVICE_PATH_PROTOCOL*)&mGbNicDevicePath); + }break; + case STR_MISC_PORT_INTERNAL_FLOPPY: + { + (EFI_DEVICE_PATH_PROTOCOL)((EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA *)RecordData)->PortPath = *((EFI_DEVICE_PATH_PROTOCOL*)&mFloopyADevicePath); + }break; + case STR_MISC_PORT_INTERNAL_IDE1: + { + (EFI_DEVICE_PATH_PROTOCOL)((EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA *)RecordData)->PortPath = *((EFI_DEVICE_PATH_PROTOCOL*)&mIdeDevicePath); + }break; + case STR_MISC_PORT_INTERNAL_IDE2: + { + (EFI_DEVICE_PATH_PROTOCOL)((EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA *)RecordData)->PortPath = *((EFI_DEVICE_PATH_PROTOCOL*)&mIdeDevicePath); + }break; + default: + { + (EFI_DEVICE_PATH_PROTOCOL)((EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA *)RecordData)->PortPath = EndDevicePath; + }break; + } + */ + switch (((EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA *) RecordData)->PortInternalConnectorDesignator) { + case STR_MISC_PORT_INTERNAL_MOUSE: + { + CopyMem ( + &((EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA *) RecordData)->PortPath, + &mPs2MouseDevicePath, + GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) &mPs2MouseDevicePath) + ); + *RecordLen = *RecordLen - sizeof (EFI_MISC_PORT_DEVICE_PATH) + GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) &mPs2MouseDevicePath); + } + break; + + case STR_MISC_PORT_INTERNAL_KEYBOARD: + { + CopyMem ( + &((EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA *) RecordData)->PortPath, + &mPs2KeyboardDevicePath, + GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) &mPs2KeyboardDevicePath) + ); + *RecordLen = *RecordLen - sizeof (EFI_MISC_PORT_DEVICE_PATH) + GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) &mPs2KeyboardDevicePath); + } + break; + + case STR_MISC_PORT_INTERNAL_COM1: + { + CopyMem ( + &((EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA *) RecordData)->PortPath, + &mCom1DevicePath, + GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) &mCom1DevicePath) + ); + *RecordLen = *RecordLen - sizeof (EFI_MISC_PORT_DEVICE_PATH) + GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) &mCom1DevicePath); + } + break; + + case STR_MISC_PORT_INTERNAL_COM2: + { + CopyMem ( + &((EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA *) RecordData)->PortPath, + &mCom2DevicePath, + GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) &mCom2DevicePath) + ); + *RecordLen = *RecordLen - sizeof (EFI_MISC_PORT_DEVICE_PATH) + GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) &mCom2DevicePath); + } + break; + + case STR_MISC_PORT_INTERNAL_FLOPPY: + { + CopyMem ( + &((EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA *) RecordData)->PortPath, + &mFloopyADevicePath, + GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) &mFloopyADevicePath) + ); + *RecordLen = *RecordLen - sizeof (EFI_MISC_PORT_DEVICE_PATH) + GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) &mFloopyADevicePath); + } + break; + + default: + { + CopyMem ( + &((EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA *) RecordData)->PortPath, + &EndDevicePath, + GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) &EndDevicePath) + ); + *RecordLen = *RecordLen - sizeof (EFI_MISC_PORT_DEVICE_PATH) + GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) &EndDevicePath); + } + break; + } + // + // End Shanmu + // + // Set Done flag to TRUE for next pass through this function. + // Set *LogRecordData to TRUE so data will get logged to Data Hub. + // + Done = TRUE; + *LogRecordData = TRUE; + } else { + // + // No, this is the second time. Reset the state of the Done flag + // to FALSE and tell the data logger that there is no more data + // to be logged for this record type. If any memory allocations + // were made by earlier passes, they must be released now. + // + Done = FALSE; + *LogRecordData = FALSE; + } + + return EFI_SUCCESS; +} + +/* eof - MiscSystemManufacturerFunction.c */ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesData.c new file mode 100644 index 0000000..c075ffd --- /dev/null +++ b/UnixPkg/MiscSubClassPlatformDxe/MiscResetCapabilitiesData.c @@ -0,0 +1,42 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + MiscResetCapabilitiesData.c + +Abstract: + + This driver parses the mMiscSubclassDataTable structure and reports + any generated data to the DataHub. + +--*/ + +#include "MiscSubClassDriver.h" + +// +// Static (possibly build generated) Bios Vendor data. +// +MISC_SUBCLASS_TABLE_DATA(EFI_MISC_RESET_CAPABILITIES, MiscResetCapabilities) = { + { // ResetCapabilities + 0, // Status + 0, // BootOption + 0, // BootOptionOnLimit + 0, // WatchdogTimerPresent + 0 // Reserved + }, + 0, // ResetCount + 0, // ResetLimit + 0, // ResetTimerInterval + 0 // ResetTimeout +}; + +/* eof - MiscResetCapabilities.c */ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.h b/UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.h new file mode 100644 index 0000000..4105266 --- /dev/null +++ b/UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.h @@ -0,0 +1,119 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + MiscSubclassDriver.h + +Abstract: + + Header file for MiscSubclass Driver. + +--*/ + +#ifndef _MISC_SUBCLASS_DRIVER_H +#define _MISC_SUBCLASS_DRIVER_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include +#include +#include +#include + +// +// Data table entry update function. +// +typedef +EFI_STATUS +(EFIAPI EFI_MISC_SUBCLASS_DATA_FUNCTION) ( + IN UINT16 RecordType, + IN UINT32 *RecordLen, + IN OUT EFI_MISC_SUBCLASS_RECORDS *RecordData, + OUT BOOLEAN *LogRecordData + ); + +// +// Data table entry definition. +// +typedef struct { + UINT16 RecordType; + UINT32 RecordLen; + VOID *RecordData; + EFI_MISC_SUBCLASS_DATA_FUNCTION *Function; +} EFI_MISC_SUBCLASS_DATA_TABLE; + +// +// Data Table extern definitions. +// +#define MISC_SUBCLASS_TABLE_EXTERNS(NAME1, NAME2) \ + extern NAME1 NAME2 ## Data; \ + extern EFI_MISC_SUBCLASS_DATA_FUNCTION NAME2 ## Function + +// +// Data Table entries +// +#define MISC_SUBCLASS_TABLE_ENTRY_DATA_ONLY(NAME1, NAME2) { \ + NAME1 ## _RECORD_NUMBER, sizeof (NAME1 ## _DATA), &NAME2 ## Data, NULL \ + } + +#define MISC_SUBCLASS_TABLE_ENTRY_FUNCTION_ONLY(NAME1, NAME2) \ + { \ + NAME1 ## _RECORD_NUMBER, 0, NULL, &NAME2 ## Function \ + } + +#define MISC_SUBCLASS_TABLE_ENTRY_DATA_AND_FUNCTION(NAME1, NAME2, NAME3) \ + { \ + NAME1 ## _RECORD_NUMBER, sizeof (NAME1 ## _DATA), &NAME2 ## Data, &NAME3 ## Function \ + } + +// +// Global definition macros. +// +#define MISC_SUBCLASS_TABLE_DATA(NAME1, NAME2) NAME1 NAME2 ## Data + +#define MISC_SUBCLASS_TABLE_FUNCTION(NAME2) \ + EFI_STATUS EFIAPI NAME2 ## Function ( \ + IN UINT16 RecordType, \ + IN UINT32 *RecordLen, \ + IN OUT EFI_MISC_SUBCLASS_RECORDS * RecordData, \ + OUT BOOLEAN *LogRecordData \ + ) + +// +// Data Table Array +// +extern EFI_MISC_SUBCLASS_DATA_TABLE mMiscSubclassDataTable[]; + +// +// Data Table Array Entries +// +extern UINTN mMiscSubclassDataTableEntries; + +#endif /* _MISC_SUBCLASS_DRIVER_H */ + +/* eof - MiscSubclassDriver.h */ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.inf b/UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.inf new file mode 100644 index 0000000..daa3ae2 --- /dev/null +++ b/UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.inf @@ -0,0 +1,100 @@ +#/** @file +# Misc Sub class driver +# +# Parses the MiscSubclassDataTable and reports any generated data to the DataHub. +# All .uni file who tagged with "ToolCode="DUMMY"" in following file list is included by +# MiscSubclassDriver.uni file, the StrGather tool will expand MiscSubclassDriver.uni file +# and parse all .uni file. +# Copyright (c) 2006, Intel Corporation +# +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# +#**/ + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = MiscSubclass + FILE_GUID = f2fbd108-8985-11db-b06a-0040d02b1835 + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + + ENTRY_POINT = MiscSubclassDriverEntryPoint + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IA32 X64 IPF EBC +# + +[Sources.common] + MiscPortInternalConnectorDesignatorFunction.c + MiscSystemSlotDesignationData.c + MiscSystemOptionStringData.c + MiscSystemManufacturerFunction.c + MiscSystemManufacturerData.c + MiscSystemLanguageStringData.c + MiscResetCapabilitiesData.c + MiscPortInternalConnectorDesignatorData.c + MiscOemStringData.c + MiscNumberOfInstallableLanguagesData.c + MiscChassisManufacturerData.c + MiscBootInformationData.c + MiscBiosVendorData.c + MiscBaseBoardManufacturerData.c + MiscSubclassDriverDataTable.c + MiscSubclassDriverEntryPoint.c + MiscSubClassDriver.uni + MiscSystemSlotDesignation.uni + MiscSystemOptionString.uni + MiscSystemManufacturer.uni + MiscSystemLanguageString.uni + MiscPortInternalConnectorDesignator.uni + MiscOemString.uni + MiscChassisManufacturer.uni + MiscBiosVendor.uni + MiscBaseBoardManufacturer.uni + + +[Packages] + MdePkg/MdePkg.dec + IntelFrameworkPkg/IntelFrameworkPkg.dec + IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + UnixPkg/UnixPkg.dec + +[LibraryClasses] + DevicePathLib + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + UefiDriverEntryPoint + UefiLib + HiiLib + DebugLib + BaseLib + + +[Guids] + gEfiMemorySubClassGuid # SOMETIMES_CONSUMED + gEfiMemoryProducerGuid # SOMETIMES_CONSUMED + gEfiProcessorSubClassGuid # SOMETIMES_CONSUMED + gEfiMiscSubClassGuid # ALWAYS_CONSUMED + + +[Protocols] + gEfiUnixIoProtocolGuid # PROTOCOL_NOTIFY SOMETIMES_CONSUMED + gEfiDataHubProtocolGuid # PROTOCOL ALWAYS_CONSUMED + +[Pcd.common] + gEfiUnixPkgTokenSpaceGuid.PcdUnixMemorySize + +[Depex] + gEfiDataHubProtocolGuid + diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.msa b/UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.msa new file mode 100644 index 0000000..b9f0992 --- /dev/null +++ b/UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.msa @@ -0,0 +1,170 @@ + + + + MiscSubclass + DXE_DRIVER + f2fbd108-8985-11db-b06a-0040d02b1835 + 1.0 + Misc Sub class driver + + Parses the MiscSubclassDataTable and reports any generated data to the DataHub. + All .uni file who tagged with "ToolCode="DUMMY"" in following file list is included by + MiscSubclassDriver.uni file, the StrGather tool will expand MiscSubclassDriver.uni file + and parse all .uni file. + + Copyright (c) 2006, Intel Corporation + All rights reserved. This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052 + + + IA32 X64 IPF EBC + false + MiscSubclass + + + + BaseLib + + + DebugLib + + + HiiLib + + + UefiLib + + + UefiDriverEntryPoint + + + BaseMemoryLib + + + MemoryAllocationLib + + + UefiBootServicesTableLib + + + DevicePathLib + + + + MiscBaseBoardManufacturer.uni + MiscBiosVendor.uni + MiscChassisManufacturer.uni + MiscOemString.uni + MiscPortInternalConnectorDesignator.uni + MiscSystemLanguageString.uni + MiscSystemManufacturer.uni + MiscSystemOptionString.uni + MiscSystemSlotDesignation.uni + MiscSubclassDriver.uni + MiscDevicePath.h + MiscSubclassDriver.h + MiscSubclassDriverEntryPoint.c + MiscSubclassDriverDataTable.c + MiscBaseBoardManufacturerData.c + MiscBiosVendorData.c + MiscBootInformationData.c + MiscChassisManufacturerData.c + MiscNumberOfInstallableLanguagesData.c + MiscOemStringData.c + MiscPortInternalConnectorDesignatorData.c + MiscResetCapabilitiesData.c + MiscSystemLanguageStringData.c + MiscSystemManufacturerData.c + MiscSystemManufacturerFunction.c + MiscSystemOptionStringData.c + MiscSystemSlotDesignationData.c + MiscPortInternalConnectorDesignatorFunction.c + MiscSubclassDriver.dxs + + + + + + + + + gEfiDataHubProtocolGuid + + + gEfiHiiProtocolGuid + + + gEfiUnixIoProtocolGuid + + + + + MiscPortKeyboard + + + MiscPortMouse + + + MiscPortCom1 + + + MiscPortCom2 + + + MiscBiosVendor + + + MiscSystemManufacturer + + + MiscBaseBoardManufacturer + + + MiscChassisManufacturer + + + MiscSystemSlotDesignation + + + OemString + + + SystemOptionString + + + ProcessorSubClassData + + + MemorySubClassData + + + + + gEfiMiscSubClassGuid + + + gEfiProcessorSubClassGuid + + + gEfiMemoryProducerGuid + + + gEfiMemorySubClassGuid + + + gEfiUnixMemoryGuid + + + + EFI_SPECIFICATION_VERSION 0x00020000 + EDK_RELEASE_VERSION 0x00020000 + + MiscSubclassDriverEntryPoint + + + diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.uni b/UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.uni new file mode 100644 index 0000000..bae6862 Binary files /dev/null and b/UnixPkg/MiscSubClassPlatformDxe/MiscSubClassDriver.uni differ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSubclassDriverDataTable.c b/UnixPkg/MiscSubClassPlatformDxe/MiscSubclassDriverDataTable.c new file mode 100644 index 0000000..06e2a80 --- /dev/null +++ b/UnixPkg/MiscSubClassPlatformDxe/MiscSubclassDriverDataTable.c @@ -0,0 +1,99 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + MiscSubclassDriverDataTable.c + +Abstract: + + This driver parses the mMiscSubclassDataTable structure and reports + any generated data to the DataHub. + +--*/ + +#include "MiscSubClassDriver.h" + +// +// External definitions referenced by Data Table entries. +// +MISC_SUBCLASS_TABLE_EXTERNS ( + EFI_MISC_CHASSIS_MANUFACTURER_DATA, + MiscChassisManufacturer + ); +MISC_SUBCLASS_TABLE_EXTERNS ( + EFI_MISC_BIOS_VENDOR_DATA, + MiscBiosVendor + ); +MISC_SUBCLASS_TABLE_EXTERNS ( + EFI_MISC_SYSTEM_MANUFACTURER_DATA, + MiscSystemManufacturer + ); +MISC_SUBCLASS_TABLE_EXTERNS ( + EFI_MISC_BASE_BOARD_MANUFACTURER_DATA, + MiscBaseBoardManufacturer + ); +MISC_SUBCLASS_TABLE_EXTERNS ( + EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, + MiscPortInternalConnectorDesignator + ); +MISC_SUBCLASS_TABLE_EXTERNS ( + EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, + MiscPortKeyboard + ); +MISC_SUBCLASS_TABLE_EXTERNS ( + EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, + MiscPortMouse + ); +MISC_SUBCLASS_TABLE_EXTERNS ( + EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, + MiscPortCom1 + ); +MISC_SUBCLASS_TABLE_EXTERNS ( + EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, + MiscPortCom2 + ); +MISC_SUBCLASS_TABLE_EXTERNS ( + EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, + MiscSystemSlotDesignation + ); +MISC_SUBCLASS_TABLE_EXTERNS ( + EFI_MISC_OEM_STRING_DATA, + OemString + ); +MISC_SUBCLASS_TABLE_EXTERNS ( + EFI_MISC_SYSTEM_OPTION_STRING_DATA, + SystemOptionString + ); + +// +// Data Table. +// +EFI_MISC_SUBCLASS_DATA_TABLE mMiscSubclassDataTable[] = { + MISC_SUBCLASS_TABLE_ENTRY_DATA_AND_FUNCTION(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortKeyboard, MiscPortInternalConnectorDesignator), + MISC_SUBCLASS_TABLE_ENTRY_DATA_AND_FUNCTION(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortMouse, MiscPortInternalConnectorDesignator), + MISC_SUBCLASS_TABLE_ENTRY_DATA_AND_FUNCTION(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortCom1, MiscPortInternalConnectorDesignator), + MISC_SUBCLASS_TABLE_ENTRY_DATA_AND_FUNCTION(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortCom2, MiscPortInternalConnectorDesignator), + MISC_SUBCLASS_TABLE_ENTRY_DATA_ONLY(EFI_MISC_BIOS_VENDOR, MiscBiosVendor), + MISC_SUBCLASS_TABLE_ENTRY_DATA_ONLY(EFI_MISC_SYSTEM_MANUFACTURER, MiscSystemManufacturer), + MISC_SUBCLASS_TABLE_ENTRY_DATA_ONLY(EFI_MISC_BASE_BOARD_MANUFACTURER, MiscBaseBoardManufacturer), + MISC_SUBCLASS_TABLE_ENTRY_DATA_ONLY(EFI_MISC_CHASSIS_MANUFACTURER, MiscChassisManufacturer), + MISC_SUBCLASS_TABLE_ENTRY_DATA_ONLY(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlotDesignation), + MISC_SUBCLASS_TABLE_ENTRY_DATA_ONLY(EFI_MISC_OEM_STRING, OemString), + MISC_SUBCLASS_TABLE_ENTRY_DATA_ONLY(EFI_MISC_SYSTEM_OPTION_STRING, SystemOptionString), +}; + +// +// Number of Data Table entries. +// +UINTN mMiscSubclassDataTableEntries = (sizeof mMiscSubclassDataTable) / sizeof (EFI_MISC_SUBCLASS_DATA_TABLE); + +/* eof - MiscSubclassDriverDataTable.c */ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c b/UnixPkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c new file mode 100644 index 0000000..de8d8ef --- /dev/null +++ b/UnixPkg/MiscSubClassPlatformDxe/MiscSubclassDriverEntryPoint.c @@ -0,0 +1,334 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + MiscSubclassDriverEntryPoint.c + +Abstract: + + This driver parses the mMiscSubclassDataTable structure and reports + any generated data to the DataHub. + +--*/ + +#include "MiscSubClassDriver.h" + + +extern UINT8 MiscSubClassStrings[]; + +// +// +// +EFI_STATUS +LogRecordDataToDataHub ( + EFI_DATA_HUB_PROTOCOL *DataHub, + UINT32 RecordType, + UINT32 RecordLen, + VOID *RecordData + ) +/*++ +Description: + +Parameters: + + DataHub + %%TBD + + RecordType + %%TBD + + RecordLen + %%TBD + + RecordData + %%TBD + +Returns: + + EFI_INVALID_PARAMETER + + EFI_SUCCESS + + Other Data Hub errors + +--*/ +{ + EFI_MISC_SUBCLASS_DRIVER_DATA MiscSubclass; + EFI_STATUS EfiStatus; + + // + // Do nothing if data parameters are not valid. + // + if (RecordLen == 0 || RecordData == NULL) { + DEBUG ( + (EFI_D_ERROR, + "RecordLen == %d RecordData == %xh\n", + RecordLen, + RecordData) + ); + + return EFI_INVALID_PARAMETER; + } + // + // Assemble Data Hub record. + // + MiscSubclass.Header.Version = EFI_MISC_SUBCLASS_VERSION; + MiscSubclass.Header.HeaderSize = sizeof (EFI_SUBCLASS_TYPE1_HEADER); + MiscSubclass.Header.Instance = 1; + MiscSubclass.Header.SubInstance = 1; + MiscSubclass.Header.RecordType = RecordType; + + CopyMem ( + &MiscSubclass.Record, + RecordData, + RecordLen + ); + + // + // Log Data Hub record. + // + EfiStatus = DataHub->LogData ( + DataHub, + &gEfiMiscSubClassGuid, + &gEfiMiscSubClassGuid, + EFI_DATA_RECORD_CLASS_DATA, + &MiscSubclass, + sizeof (EFI_SUBCLASS_TYPE1_HEADER) + RecordLen + ); + + if (EFI_ERROR (EfiStatus)) { + DEBUG ( + (EFI_D_ERROR, + "LogData(%d bytes) == %r\n", + sizeof (EFI_SUBCLASS_TYPE1_HEADER) + RecordLen, + EfiStatus) + ); + } + + return EfiStatus; +} + + +EFI_STATUS +EFIAPI +MiscSubclassDriverEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ +Description: + + Standard EFI driver point. This driver parses the mMiscSubclassDataTable + structure and reports any generated data to the DataHub. + +Arguments: + + ImageHandle + Handle for the image of this driver + + SystemTable + Pointer to the EFI System Table + +Returns: + + EFI_SUCCESS + The data was successfully reported to the Data Hub. + +--*/ +{ + EFI_MISC_SUBCLASS_DRIVER_DATA RecordData; + EFI_DATA_HUB_PROTOCOL *DataHub; + EFI_HII_HANDLE HiiHandle; + EFI_STATUS EfiStatus; + UINTN Index; + BOOLEAN LogRecordData; + EFI_MEMORY_SUBCLASS_DRIVER_DATA MemorySubClassData; + UINT64 TotalMemorySize; + CHAR16 *UnixMemString; + + + + // + // Initialize constant portion of subclass header. + // + RecordData.Header.Version = EFI_MISC_SUBCLASS_VERSION; + RecordData.Header.HeaderSize = sizeof (EFI_SUBCLASS_TYPE1_HEADER); + RecordData.Header.Instance = 1; + RecordData.Header.SubInstance = 1; + + // + // Locate data hub protocol. + // + EfiStatus = gBS->LocateProtocol (&gEfiDataHubProtocolGuid, NULL, (VOID**) &DataHub); + + if (EFI_ERROR (EfiStatus)) { + DEBUG ((EFI_D_ERROR, "Could not locate DataHub protocol. %r\n", EfiStatus)); + return EfiStatus; + } else if (DataHub == NULL) { + DEBUG ((EFI_D_ERROR, "LocateProtocol(DataHub) returned NULL pointer!\n")); + return EFI_DEVICE_ERROR; + } + + // + // Add our default strings to the HII database. They will be modified later. + // + HiiLibAddPackages (1, &gEfiMiscSubClassGuid, NULL, &HiiHandle, MiscSubclassStrings); + + if (EFI_ERROR (EfiStatus)) { + DEBUG ((EFI_D_ERROR, "Could not log default strings to Hii. %r\n", EfiStatus)); + return EfiStatus; + } + // + // + // + for (Index = 0; Index < mMiscSubclassDataTableEntries; ++Index) { + // + // Stupidity check! Do nothing if RecordLen is zero. + // %%TBD - Should this be an error or a mechanism for ignoring + // records in the Data Table? + // + if (mMiscSubclassDataTable[Index].RecordLen == 0) { + DEBUG ( + (EFI_D_ERROR, + "mMiscSubclassDataTable[%d].RecordLen == 0\n", + Index) + ); + + continue; + } + // + // Initialize per-record portion of subclass header and + // copy static data into data portion of subclass record. + // + RecordData.Header.RecordType = mMiscSubclassDataTable[Index].RecordType; + + if (mMiscSubclassDataTable[Index].RecordData == NULL) { + ZeroMem ( + &RecordData.Record, + mMiscSubclassDataTable[Index].RecordLen + ); + } else { + CopyMem ( + &RecordData.Record, + mMiscSubclassDataTable[Index].RecordData, + mMiscSubclassDataTable[Index].RecordLen + ); + } + // + // If the entry does not have a function pointer, just log the data. + // + if (mMiscSubclassDataTable[Index].Function == NULL) { + // + // Log RecordData to Data Hub. + // + EfiStatus = DataHub->LogData ( + DataHub, + &gEfiMiscSubClassGuid, + &gEfiMiscSubClassGuid, + EFI_DATA_RECORD_CLASS_DATA, + &RecordData, + sizeof (EFI_SUBCLASS_TYPE1_HEADER) + mMiscSubclassDataTable[Index].RecordLen + ); + + if (EFI_ERROR (EfiStatus)) { + DEBUG ( + (EFI_D_ERROR, + "LogData(%d bytes) == %r\n", + sizeof (EFI_SUBCLASS_TYPE1_HEADER) + mMiscSubclassDataTable[Index].RecordLen, + EfiStatus) + ); + } + + continue; + } + // + // The entry has a valid function pointer. + // Keep calling the function and logging data until there + // is no more data to log. + // + for (;;) { + EfiStatus = (*mMiscSubclassDataTable[Index].Function)(mMiscSubclassDataTable[Index].RecordType, &mMiscSubclassDataTable[Index].RecordLen, &RecordData.Record, &LogRecordData); + + if (EFI_ERROR (EfiStatus)) { + break; + } + + if (!LogRecordData) { + break; + } + // + // + // + EfiStatus = DataHub->LogData ( + DataHub, + &gEfiMiscSubClassGuid, + &gEfiMiscSubClassGuid, + EFI_DATA_RECORD_CLASS_DATA, + &RecordData, + sizeof (EFI_SUBCLASS_TYPE1_HEADER) + mMiscSubclassDataTable[Index].RecordLen + ); + + if (EFI_ERROR (EfiStatus)) { + DEBUG ( + (EFI_D_ERROR, + "LogData(%d bytes) == %r\n", + sizeof (EFI_SUBCLASS_TYPE1_HEADER) + mMiscSubclassDataTable[Index].RecordLen, + EfiStatus) + ); + } + } + } + + // + // Log Memory Size info based on PCD setting. + // + MemorySubClassData.Header.Instance = 1; + MemorySubClassData.Header.SubInstance = EFI_SUBCLASS_INSTANCE_NON_APPLICABLE; + MemorySubClassData.Header.RecordType = EFI_MEMORY_ARRAY_START_ADDRESS_RECORD_NUMBER; + + // + // Process Memory String in form size!size ... + // So 64!64 is 128 MB + // + UnixMemString = PcdGetPtr (PcdUnixMemorySize); + for (TotalMemorySize = 0; *UnixMemString != '\0';) { + TotalMemorySize += StrDecimalToUint64 (UnixMemString); + while (*UnixMemString != '\0') { + if (*UnixMemString == '!') { + UnixMemString++; + break; + } + UnixMemString++; + } + } + + MemorySubClassData.Record.ArrayStartAddress.MemoryArrayStartAddress = 0; + MemorySubClassData.Record.ArrayStartAddress.MemoryArrayEndAddress = LShiftU64 (TotalMemorySize, 20) - 1; + MemorySubClassData.Record.ArrayStartAddress.PhysicalMemoryArrayLink.ProducerName = gEfiMemoryProducerGuid; + MemorySubClassData.Record.ArrayStartAddress.PhysicalMemoryArrayLink.Instance = 1; + MemorySubClassData.Record.ArrayStartAddress.PhysicalMemoryArrayLink.SubInstance = EFI_SUBCLASS_INSTANCE_NON_APPLICABLE; + MemorySubClassData.Record.ArrayStartAddress.MemoryArrayPartitionWidth = 0; + + // + // Store memory size data record to data hub. + // + EfiStatus = DataHub->LogData ( + DataHub, + &gEfiMemorySubClassGuid, + &gEfiMemoryProducerGuid, + EFI_DATA_RECORD_CLASS_DATA, + &MemorySubClassData, + sizeof (EFI_SUBCLASS_TYPE1_HEADER) + sizeof (EFI_MEMORY_ARRAY_START_ADDRESS_DATA) + ); + + return EFI_SUCCESS; +} diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemLanguageString.uni b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemLanguageString.uni new file mode 100644 index 0000000..36dacf0 Binary files /dev/null and b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemLanguageString.uni differ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringData.c new file mode 100644 index 0000000..f904623 --- /dev/null +++ b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemLanguageStringData.c @@ -0,0 +1,33 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + MiscSystemLanguageStringData.c + +Abstract: + + This driver parses the mMiscSubclassDataTable structure and reports + any generated data to the DataHub. + +--*/ + +#include "MiscSubClassDriver.h" + +// +// Static (possibly build generated) Bios Vendor data. +// +MISC_SUBCLASS_TABLE_DATA(EFI_MISC_SYSTEM_LANGUAGE_STRING_DATA, SystemLanguageString) = { + 0, + STRING_TOKEN(STR_MISC_SYSTEM_LANGUAGE_STRING) +}; + +/* eof - MiscSystemLanguageStringData.c */ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturer.uni b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturer.uni new file mode 100644 index 0000000..204588e Binary files /dev/null and b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturer.uni differ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturerData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturerData.c new file mode 100644 index 0000000..0a9bfab --- /dev/null +++ b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturerData.c @@ -0,0 +1,57 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + MiscSystemManufacturerData.c + +Abstract: + + This driver parses the mMiscSubclassDataTable structure and reports + any generated data to the DataHub. + +--*/ + +#include "MiscSubClassDriver.h" + +// +// Static (possibly build generated) System Manufacturer data. +// +MISC_SUBCLASS_TABLE_DATA(EFI_MISC_SYSTEM_MANUFACTURER_DATA, MiscSystemManufacturer) += { + STRING_TOKEN(STR_MISC_SYSTEM_MANUFACTURER), + // SystemManufactrurer + STRING_TOKEN(STR_MISC_SYSTEM_PRODUCT_NAME), + // SystemProductName + STRING_TOKEN(STR_MISC_SYSTEM_VERSION), + // SystemVersion + STRING_TOKEN(STR_MISC_SYSTEM_SERIAL_NUMBER), + // SystemSerialNumber + { + 0xbadfaced, + 0xdead, + 0xbeef, + { + 0x13, + 0x13, + 0x13, + 0x13, + 0x13, + 0x13, + 0x13, + 0x13 + } + }, + // SystemUuid + EfiSystemWakeupTypePowerSwitch // SystemWakeupType +}; + +/* eof - MiscSystemManufacturerData.c */ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturerFunction.c b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturerFunction.c new file mode 100644 index 0000000..2cfbf61 --- /dev/null +++ b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemManufacturerFunction.c @@ -0,0 +1,122 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + MiscSystemManufacturerFunction.c + +Abstract: + + This driver parses the mMiscSubclassDataTable structure and reports + any generated data to the DataHub. + +--*/ + +#include "MiscSubClassDriver.h" + +// +// +// +MISC_SUBCLASS_TABLE_FUNCTION ( + MiscSystemManufacturer + ) +/*++ +Description: + + This function makes boot time changes to the contents of the + MiscSystemManufacturer (Type 13). + +Parameters: + + RecordType + Type of record to be processed from the Data Table. + mMiscSubclassDataTable[].RecordType + + RecordLen + Size of static RecordData from the Data Table. + mMiscSubclassDataTable[].RecordLen + + RecordData + Pointer to copy of RecordData from the Data Table. Changes made + to this copy will be written to the Data Hub but will not alter + the contents of the static Data Table. + + LogRecordData + Set *LogRecordData to TRUE to log RecordData to Data Hub. + Set *LogRecordData to FALSE when there is no more data to log. + +Returns: + + EFI_SUCCESS + All parameters were valid and *RecordData and *LogRecordData have + been set. + + EFI_UNSUPPORTED + Unexpected RecordType value. + + EFI_INVALID_PARAMETER + One of the following parameter conditions was true: + RecordLen was zero. + RecordData was NULL. + LogRecordData was NULL. +--*/ +{ + STATIC BOOLEAN Done = FALSE; + + // + // First check for invalid parameters. + // + if (*RecordLen == 0 || RecordData == NULL || LogRecordData == NULL) { + return EFI_INVALID_PARAMETER; + } + // + // Then check for unsupported RecordType. + // + if (RecordType != EFI_MISC_SYSTEM_MANUFACTURER_RECORD_NUMBER) { + return EFI_UNSUPPORTED; + } + // + // Is this the first time through this function? + // + if (!Done) { + // + // Yes, this is the first time. Inspect/Change the contents of the + // RecordData structure. + // + // + // Set system GUID. + // + // ((EFI_MISC_SYSTEM_MANUFACTURER_DATA *)RecordData)->SystemUuid = %%TBD + // + // Set power-on type. + // + // ((EFI_MISC_SYSTEM_MANUFACTURER_DATA *)RecordData)->SystemWakeupType = %%TBD + // + // Set Done flag to TRUE for next pass through this function. + // Set *LogRecordData to TRUE so data will get logged to Data Hub. + // + Done = TRUE; + *LogRecordData = TRUE; + } else { + // + // No, this is the second time. Reset the state of the Done flag + // to FALSE and tell the data logger that there is no more data + // to be logged for this record type. If any memory allocations + // were made by earlier passes, they must be released now. + // + Done = FALSE; + *LogRecordData = FALSE; + } + + return EFI_SUCCESS; +} + +/* eof - MiscSystemManufacturerFunction.c */ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemOptionString.uni b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemOptionString.uni new file mode 100644 index 0000000..617578d Binary files /dev/null and b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemOptionString.uni differ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemOptionStringData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemOptionStringData.c new file mode 100644 index 0000000..bc777ce --- /dev/null +++ b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemOptionStringData.c @@ -0,0 +1,32 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + MiscSystemOptionStringData.c + +Abstract: + + This driver parses the mMiscSubclassDataTable structure and reports + any generated data to the DataHub. + +--*/ + +#include "MiscSubClassDriver.h" + +// +// Static (possibly build generated) Bios Vendor data. +// +MISC_SUBCLASS_TABLE_DATA(EFI_MISC_SYSTEM_OPTION_STRING_DATA, SystemOptionString) = { + {STRING_TOKEN(STR_MISC_SYSTEM_OPTION_STRING)} +}; + +/* eof - MiscSystemOptionStringData.c */ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignation.uni b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignation.uni new file mode 100644 index 0000000..f279ff9 Binary files /dev/null and b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignation.uni differ diff --git a/UnixPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationData.c b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationData.c new file mode 100644 index 0000000..d076034 --- /dev/null +++ b/UnixPkg/MiscSubClassPlatformDxe/MiscSystemSlotDesignationData.c @@ -0,0 +1,52 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + MiscSystemSlotDesignationData.c + +Abstract: + + This driver parses the mMiscSubclassDataTable structure and reports + any generated data to the DataHub. + +--*/ + +#include "MiscSubClassDriver.h" + +// +// Static (possibly build generated) Bios Vendor data. +// +MISC_SUBCLASS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotDesignation) = { + STRING_TOKEN(STR_MISC_SYSTEM_SLOT_DESIGNATION), // SlotDesignation + EfiSlotTypeOther, // SlotType + EfiSlotDataBusWidthOther, // SlotDataBusWidth + EfiSlotUsageOther, // SlotUsage + EfiSlotLengthOther, // SlotLength + 0, // SlotId + { // SlotCharacteristics + 0, // CharacteristicsUnknown :1; + 0, // Provides50Volts :1; + 0, // Provides33Volts :1; + 0, // SharedSlot :1; + 0, // PcCard16Supported :1; + 0, // CardBusSupported :1; + 0, // ZoomVideoSupported :1; + 0, // ModemRingResumeSupported:1; + 0, // PmeSignalSupported :1; + 0, // HotPlugDevicesSupported :1; + 0, // SmbusSignalSupported :1; + 0 // Reserved :21; + }, + {0, 0, {0, 0}} // SlotDevicePath +}; + +/* eof - MiscSystemSlotsData.c */ -- cgit v1.1