Skip to content

Commit

Permalink
Support DOE Discovery Version
Browse files Browse the repository at this point in the history
DOE Discovery Version is first introduced in PCIE Spec 6.1 Section
6.30.1.1. After libspdm support this feature, spdm-emu shall be updated
as well.

Signed-off-by: Min M Xu <[email protected]>
  • Loading branch information
mxu9 committed Jul 31, 2024
1 parent 0b37fda commit a1be978
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion include/library/pci_doe_requester_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

libspdm_return_t pci_doe_discovery (const void *pci_doe_context,
pci_doe_data_object_protocol_t *data_object_protocol,
size_t *data_object_protocol_size);
size_t *data_object_protocol_size,
uint8_t version);

/* external provided function */

Expand Down
4 changes: 3 additions & 1 deletion library/pci_doe_requester_lib/pci_doe_req_discovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ typedef struct {

libspdm_return_t pci_doe_discovery (const void *pci_doe_context,
pci_doe_data_object_protocol_t *data_object_protocol,
size_t *data_object_protocol_size)
size_t *data_object_protocol_size,
uint8_t version)
{
doe_discovery_request_mine_t doe_request;
doe_discovery_response_mine_t doe_response;
Expand All @@ -52,6 +53,7 @@ libspdm_return_t pci_doe_discovery (const void *pci_doe_context,
doe_request.doe_header.data_object_type = PCI_DOE_DATA_OBJECT_TYPE_DOE_DISCOVERY;
doe_request.doe_header.length = sizeof(doe_discovery_request_mine_t) / sizeof(uint32_t);
doe_request.doe_discovery_request.index = 0;
doe_request.doe_discovery_request.version = version;

do {
if (total_index <
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "spdm_device_attester_sample.h"

void *m_pci_doe_context;
#define DOE_DISCOVERY_VERSION 0

libspdm_return_t pci_doe_init_request()
{
Expand All @@ -17,7 +18,7 @@ libspdm_return_t pci_doe_init_request()

data_object_protocol_size = sizeof(data_object_protocol);
status =
pci_doe_discovery (m_pci_doe_context, data_object_protocol, &data_object_protocol_size);
pci_doe_discovery (m_pci_doe_context, data_object_protocol, &data_object_protocol_size, DOE_DISCOVERY_VERSION);
if (LIBSPDM_STATUS_IS_ERROR(status)) {
return status;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "spdm_device_validator_sample.h"

void *m_pci_doe_context;
#define DOE_DISCOVERY_VERSION 0

libspdm_return_t pci_doe_init_request()
{
Expand All @@ -17,7 +18,7 @@ libspdm_return_t pci_doe_init_request()

data_object_protocol_size = sizeof(data_object_protocol);
status =
pci_doe_discovery (m_pci_doe_context, data_object_protocol, &data_object_protocol_size);
pci_doe_discovery (m_pci_doe_context, data_object_protocol, &data_object_protocol_size, DOE_DISCOVERY_VERSION);
if (LIBSPDM_STATUS_IS_ERROR(status)) {
return status;
}
Expand Down
3 changes: 2 additions & 1 deletion spdm_emu/spdm_requester_emu/spdm_requester_pci_doe.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "spdm_requester_emu.h"

void *m_pci_doe_context;
#define DOE_DISCOVERY_VERSION 0

libspdm_return_t pci_doe_init_requester()
{
Expand All @@ -17,7 +18,7 @@ libspdm_return_t pci_doe_init_requester()

data_object_protocol_size = sizeof(data_object_protocol);
status =
pci_doe_discovery (m_pci_doe_context, data_object_protocol, &data_object_protocol_size);
pci_doe_discovery (m_pci_doe_context, data_object_protocol, &data_object_protocol_size, DOE_DISCOVERY_VERSION);
if (LIBSPDM_STATUS_IS_ERROR(status)) {
return status;
}
Expand Down

0 comments on commit a1be978

Please sign in to comment.