-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LMS: WMI Provider: Add unique platform ID WMI Provider APIs
Add unique platform ID WMI Provider APIs. Signed-off-by: Riki Sharon <riki.sharon@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
- Loading branch information
1 parent
0be683a
commit 82fe708
Showing
22 changed files
with
1,003 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* SPDX-License-Identifier: Apache-2.0 */ | ||
/* | ||
* Copyright (C) 2020 Intel Corporation | ||
*/ | ||
/*++ | ||
@file: GetUPIDCommand.h | ||
--*/ | ||
|
||
#ifndef __GET_UPID_COMMAND_H__ | ||
#define __GET_UPID_COMMAND_H__ | ||
|
||
#include "UPIDCommand.h" | ||
#include "MEIparser.h" | ||
|
||
|
||
namespace Intel | ||
{ | ||
namespace MEI_Client | ||
{ | ||
namespace UPID_Client | ||
{ | ||
typedef enum | ||
{ | ||
UPID_OEM_PLATFORM_ID_TYPE_NOT_SET = 0, | ||
UPID_OEM_PLATFORM_ID_TYPE_BINARY = 1, | ||
UPID_OEM_PLATFORM_ID_TYPE_PRINTABLE_STRING = 2, | ||
} UPID_OEM_PLATFORM_ID_TYPE; | ||
|
||
typedef struct | ||
{ | ||
uint32_t PlatformIdType; //UPID_OEM_PLATFORM_ID_TYPE | ||
uint8_t OEMPlatformId[UPID_LEN]; | ||
uint8_t CSMEPlatformId[UPID_LEN]; | ||
|
||
void parse(std::vector<uint8_t>::const_iterator& itr, const std::vector<uint8_t>::const_iterator &end) | ||
{ | ||
parseData(PlatformIdType, itr, end); | ||
parseData(OEMPlatformId, itr, end); | ||
parseData(CSMEPlatformId, itr, end); | ||
} | ||
|
||
} UPID_PLATFORM_ID_GET_Response; | ||
|
||
|
||
class GetUPIDRequest; | ||
class GetUPIDCommand : public UPIDCommand | ||
{ | ||
public: | ||
|
||
GetUPIDCommand(); | ||
virtual ~GetUPIDCommand() {} | ||
|
||
UPID_PLATFORM_ID_GET_Response getResponse(); | ||
|
||
private: | ||
virtual void parseResponse(const std::vector<uint8_t>& buffer); | ||
|
||
std::shared_ptr<UPIDCommandResponse<UPID_PLATFORM_ID_GET_Response>> m_response; | ||
}; | ||
|
||
|
||
class GetUPIDRequest : public UPIDRequest | ||
{ | ||
public: | ||
GetUPIDRequest() {} | ||
virtual ~GetUPIDRequest() {} | ||
|
||
private: | ||
virtual uint8_t requestHeaderFeatureID() | ||
{ | ||
return UPID_COMMAND_FEATURE_PLATFORM_ID; | ||
} | ||
virtual uint8_t requestHeaderCommandID() | ||
{ | ||
return UPID_COMMAND_PLATFORM_ID_GET; | ||
} | ||
virtual uint16_t requestDataSize() | ||
{ | ||
return 0; | ||
} | ||
virtual std::vector<uint8_t> SerializeData(); | ||
}; | ||
} // namespace UPID_Client | ||
} // namespace MEI_Client | ||
} // namespace Intel | ||
|
||
#endif //__GET_UPID_COMMAND_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* SPDX-License-Identifier: Apache-2.0 */ | ||
/* | ||
* Copyright (C) 2020 Intel Corporation | ||
*/ | ||
/*++ | ||
@file: GetUPIDFeatureStateCommand.h | ||
--*/ | ||
|
||
#ifndef __GET_UPID_FEATURE_STATE_COMMAND_H__ | ||
#define __GET_UPID_FEATURE_STATE_COMMAND_H__ | ||
|
||
#include "UPIDCommand.h" | ||
#include "MEIparser.h" | ||
|
||
|
||
namespace Intel | ||
{ | ||
namespace MEI_Client | ||
{ | ||
namespace UPID_Client | ||
{ | ||
typedef struct _UPID_PLATFORM_ID_FEATURE_STATE_GET_Response | ||
{ | ||
uint8_t FeatureEnabled; | ||
|
||
void parse(std::vector<uint8_t>::const_iterator& itr, const std::vector<uint8_t>::const_iterator &end) | ||
{ | ||
parseData(FeatureEnabled, itr, end); | ||
} | ||
} UPID_PLATFORM_ID_FEATURE_STATE_GET_Response; | ||
|
||
|
||
class GetUPIDFeatureStateRequest; | ||
class GetUPIDFeatureStateCommand : public UPIDCommand | ||
{ | ||
public: | ||
|
||
GetUPIDFeatureStateCommand(); | ||
virtual ~GetUPIDFeatureStateCommand() {} | ||
|
||
UPID_PLATFORM_ID_FEATURE_STATE_GET_Response getResponse(); | ||
|
||
private: | ||
virtual void parseResponse(const std::vector<uint8_t>& buffer); | ||
|
||
std::shared_ptr<UPIDCommandResponse<UPID_PLATFORM_ID_FEATURE_STATE_GET_Response>> m_response; | ||
}; | ||
|
||
|
||
class GetUPIDFeatureStateRequest : public UPIDRequest | ||
{ | ||
public: | ||
GetUPIDFeatureStateRequest() {} | ||
virtual ~GetUPIDFeatureStateRequest() {} | ||
|
||
private: | ||
virtual uint8_t requestHeaderFeatureID() | ||
{ | ||
return UPID_COMMAND_FEATURE_PLATFORM_ID; | ||
} | ||
virtual uint8_t requestHeaderCommandID() | ||
{ | ||
return UPID_COMMAND_PLATFORM_ID_FEATURE_STATE_GET; | ||
} | ||
virtual uint16_t requestDataSize() | ||
{ | ||
return 0; | ||
} | ||
virtual std::vector<uint8_t> SerializeData(); | ||
}; | ||
} // namespace UPID_Client | ||
} // namespace MEI_Client | ||
} // namespace Intel | ||
|
||
#endif //__GET_UPID_FEATURE_STATE_COMMAND_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* SPDX-License-Identifier: Apache-2.0 */ | ||
/* | ||
* Copyright (C) 2020 Intel Corporation | ||
*/ | ||
/*++ | ||
@file: SetUPIDFeatureStateCommand.h | ||
--*/ | ||
|
||
#ifndef __SET_UPID_FEATURE_STATE_COMMAND_H__ | ||
#define __SET_UPID_FEATURE_STATE_COMMAND_H__ | ||
|
||
#include "UPIDCommand.h" | ||
#include "MEIparser.h" | ||
|
||
namespace Intel | ||
{ | ||
namespace MEI_Client | ||
{ | ||
namespace UPID_Client | ||
{ | ||
typedef struct _UPID_PLATFORM_ID_FEATURE_STATE_SET_Response | ||
{ | ||
void parse(std::vector<uint8_t>::const_iterator&, const std::vector<uint8_t>::const_iterator&) | ||
{ | ||
return; | ||
} | ||
} UPID_PLATFORM_ID_FEATURE_STATE_SET_Response; | ||
|
||
|
||
typedef struct | ||
{ | ||
uint8_t featureState; | ||
} UPID_PLATFORM_ID_FEATURE_STATE_SET_Request; | ||
|
||
class SetUPIDFeatureStateRequest; | ||
class SetUPIDFeatureStateCommand : public UPIDCommand | ||
{ | ||
public: | ||
|
||
SetUPIDFeatureStateCommand(bool fetaureState); | ||
virtual ~SetUPIDFeatureStateCommand() {} | ||
|
||
UPID_PLATFORM_ID_FEATURE_STATE_SET_Response getResponse(); | ||
|
||
private: | ||
virtual void parseResponse(const std::vector<uint8_t>& buffer); | ||
|
||
std::shared_ptr<UPIDCommandResponse<UPID_PLATFORM_ID_FEATURE_STATE_SET_Response>> m_response; | ||
}; | ||
|
||
|
||
class SetUPIDFeatureStateRequest : public UPIDRequest | ||
{ | ||
public: | ||
SetUPIDFeatureStateRequest(bool featureState) : _featureState(featureState) {} | ||
virtual ~SetUPIDFeatureStateRequest() {} | ||
|
||
private: | ||
virtual uint8_t requestHeaderFeatureID() | ||
{ | ||
return UPID_COMMAND_FEATURE_PLATFORM_ID; | ||
} | ||
virtual uint8_t requestHeaderCommandID() | ||
{ | ||
return UPID_COMMAND_PLATFORM_ID_FEATURE_STATE_SET; | ||
} | ||
virtual uint16_t requestDataSize() | ||
{ | ||
return sizeof(UPID_PLATFORM_ID_FEATURE_STATE_SET_Request); | ||
} | ||
virtual std::vector<uint8_t> SerializeData(); | ||
bool _featureState; | ||
|
||
}; | ||
} // namespace UPID_Client | ||
} // namespace MEI_Client | ||
} // namespace Intel | ||
|
||
#endif //__SET_UPID_FEATURE_STATE_COMMAND_H__ |
Oops, something went wrong.