From e0024d9ea688ee91a77abc0e28c5ea24b13ca67d Mon Sep 17 00:00:00 2001 From: Amlal Date: Mon, 28 Oct 2024 07:01:58 +0100 Subject: IMP: Refactor whole source code to make it even. - That is because previously the source was both in lowercase and lettercase. Signed-off-by: Amlal --- dev/Modules/MBCI/Interface.h | 10 +++++ dev/Modules/MBCI/MBCI.h | 99 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 dev/Modules/MBCI/Interface.h create mode 100644 dev/Modules/MBCI/MBCI.h (limited to 'dev/Modules/MBCI') diff --git a/dev/Modules/MBCI/Interface.h b/dev/Modules/MBCI/Interface.h new file mode 100644 index 00000000..1ce345a6 --- /dev/null +++ b/dev/Modules/MBCI/Interface.h @@ -0,0 +1,10 @@ +/* ------------------------------------------- + + Copyright ZKA Web Services Co. + +------------------------------------------- */ + +#pragma once + +#include +#include diff --git a/dev/Modules/MBCI/MBCI.h b/dev/Modules/MBCI/MBCI.h new file mode 100644 index 00000000..c2630779 --- /dev/null +++ b/dev/Modules/MBCI/MBCI.h @@ -0,0 +1,99 @@ +/* ------------------------------------------- + + Copyright ZKA Web Services Co. + +------------------------------------------- */ + +#ifndef _INC_MODULE_MBCI_H_ +#define _INC_MODULE_MBCI_H_ + +#include +#include + +/** +- VCC (IN) (OUT for MCU) +- CLK (IN) (OUT for MCU) +- ACK (BI) (Contains an Acknowledge Packet Frame) +- D0- (IN) (Starts with the Host Interface Packet Frame) +- D1- (IN) (Starts with the Host Interface Packet Frame) +- D0+ (OUT) (Starts with the Host Interface Packet Frame) +- D1+ (OUT) (Starts with the Host Interface Packet Frame) +- GND (IN) (OUT for MCU) + */ + +#define cMBCIZeroSz (8) +#define cMBCIMagic "MBCI " + +namespace Kernel +{ + struct IMBCIHost; + struct IMBCIHostPacketFrame; + + /// @brief MBCI Packet frame header + struct PACKED IMBCIHostPacketFrame final + { + UInt32 Magic; + UInt32 HostId; + UInt32 Flags; + UInt32 VendorId; + UInt32 DeviceId; + UInt32 DeviceSpeed; + Bool Acknowledge; + Char Zero[cMBCIZeroSz]; + }; + + enum + { + eMBCISpeedDeviceInvalid, + eMBCILowSpeedDevice, + eMBCIHighSpeedDevice, + eMBCISpeedDeviceCount, + }; + + /// @brief MBCI Host Interface header. + struct PACKED IMBCIHost final + { + UInt32 Magic; + UInt32 HostId; + UInt16 VendorId; + UInt16 DeviceId; + UInt8 MemoryType; + UInt16 HostType; + UInt16 HostFlags; + UInt8 Error; + UInt8 Status; + UInt8 InterruptEnable; + UInt64 BaseAddressRegister; + UInt64 BaseAddressRegisterSize; + Char Zero[cMBCIZeroSz]; + }; + + /// @brief MBCI host flags. + enum MBCIHostFlags + { + eMBCIHostFlagsSupportsNothing, // Invalid MBCI device. + eMBCIHostFlagsSupportsAPM, // Advanced Power Management. + eMBCIHostFlagsSupportsDaisyChain, // Is daisy chained. + eMBCIHostFlagsSupportsHWInterrupts, // Has HW interrupts. + eMBCIHostFlagsSupportsDMA, // Has DMA. + eMBCIHostFlagsExtended = __UINT16_MAX__, // Extended flags table. + }; + + enum MBCIHostKind + { + eMBCIHostKindHardDisk, + eMBCIHostKindOpticalDisk, + eMBCIHostKindKeyboardLow, + eMBCIHostKindMouseLow, + eMBCIHostKindMouseHigh, + eMBCIHostKindKeyboardHigh, + eMBCIHostKindNetworkInterface, + eMBCIHostKindDaisyChain, + eMBCIHostKindStartExtended = __UINT16_MAX__, // Extended vendor table. + }; + + /// @brief An AuthKey is a context used to decrpy data from an MBCI packet. + typedef UInt64 MBCIAuthyKeyType; +} // namespace Kernel + +#endif // ifndef _INC_MODULE_MBCI_H_ -- cgit v1.2.3