Skip to content

Commit

Permalink
LMS: WMI Provider: Add unique platform ID WMI Provider APIs
Browse files Browse the repository at this point in the history
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
RikiSharon authored and Tomas Winkler committed Oct 1, 2020
1 parent 0be683a commit 82fe708
Show file tree
Hide file tree
Showing 22 changed files with 1,003 additions and 16 deletions.
9 changes: 9 additions & 0 deletions MEIClient/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ file (GLOB MKHIClient
MKHIClient/Src/MKHICommand.cpp
)

file (GLOB UPIDClient
UPIDClient/Src/GetUPIDCommand.cpp
UPIDClient/Src/GetUPIDFeatureStateCommand.cpp
UPIDClient/Src/SetUPIDFeatureStateCommand.cpp
UPIDClient/Src/UPIDCommand.cpp
)

add_library (LmsMEIClient STATIC
src/MEICommand.cpp
src/MEIparser.cpp
Expand All @@ -86,6 +93,7 @@ add_library (LmsMEIClient STATIC
${HOTHAMClient}
${ManageabilityClient}
${MKHIClient}
${UPIDClient}
)

set_target_properties (LmsMEIClient PROPERTIES VERSION ${LMS_VERSION_STRING})
Expand All @@ -104,6 +112,7 @@ target_include_directories (LmsMEIClient PUBLIC
"HOTHAMClient/Include/"
"ManageabilityClient/Include/"
"MKHIClient/Include/"
"UPIDClient/Include/"
)
if (BUILD_TESTS)
add_subdirectory ("AMTHITestProject" "AMTHITestProject")
Expand Down
4 changes: 2 additions & 2 deletions MEIClient/FWUpdateClient/Include/FWUpdateCommand.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: Apache-2.0 */
/*
* Copyright (C) 2010-2019 Intel Corporation
* Copyright (C) 2010-2020 Intel Corporation
*/
/*++
Expand Down Expand Up @@ -109,7 +109,7 @@ class FWUpdateCommandResponse : public Intel::MEI_Client::MEICommandResponse
{
if (buffer.size() < sizeof(FWUpdate_MESSAGE_HEADER) + sizeof(FWUpdate_STATUS))
{
throw MEIClientException("Error: response buffer to short.");
throw MEIClientException("Error: response buffer too short.");
}

FWUpdate_MESSAGE_HEADER *header = (FWUpdate_MESSAGE_HEADER *)&buffer[0];
Expand Down
7 changes: 6 additions & 1 deletion MEIClient/Include/HECI_if.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: Apache-2.0 */
/*
* Copyright (C) 2005-2007, 2009-2019 Intel Corporation
* Copyright (C) 2005-2007, 2009-2020 Intel Corporation
*/
/*++
Expand Down Expand Up @@ -42,4 +42,9 @@ DEFINE_GUID(HECI_HOTHAM_GUID,
DEFINE_GUID(LME_GUID,
0x6733a4db, 0x0476, 0x4e7b, 0xb3, 0xaf, 0xbc, 0xfc, 0x29, 0xbe, 0xe7, 0xa7);

// Define GUID used to connect to the Unique Platform ID client (via the HECI device)
// {92136C79-5FEA-4CFD-980e-23BE07FA5E9F}
DEFINE_GUID(HECI_UPID_GUID,
0x92136C79, 0x5FEA, 0x4CFD, 0x98, 0x0e, 0x23, 0xBE, 0x07, 0xFA, 0x5E, 0x9F);

#endif // __INTRFACE_H__
89 changes: 89 additions & 0 deletions MEIClient/UPIDClient/Include/GetUPIDCommand.h
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__
77 changes: 77 additions & 0 deletions MEIClient/UPIDClient/Include/GetUPIDFeatureStateCommand.h
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__
81 changes: 81 additions & 0 deletions MEIClient/UPIDClient/Include/SetUPIDFeatureStateCommand.h
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__
Loading

0 comments on commit 82fe708

Please sign in to comment.