Skip to content

Commit

Permalink
bugfix: return corresponding port_index in QUERY_RESP.
Browse files Browse the repository at this point in the history
fix #291

Signed-off-by: Yang, Longlong <longlong.yang@intel.com>
  • Loading branch information
longlongyang committed Oct 13, 2023
1 parent d2c59c1 commit 6696f93
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions library/pci_ide_km_responder_lib/pci_ide_km_rsp_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ libspdm_return_t pci_ide_km_get_response_query (const void *pci_doe_context,

libspdm_zero_mem (response, *response_size);
ide_km_response->header.object_id = PCI_IDE_KM_OBJECT_ID_QUERY_RESP;
ide_km_response->port_index = ide_km_request->port_index;

status = pci_ide_km_device_query (pci_doe_context, spdm_context, session_id,
ide_km_request->port_index,
Expand Down
14 changes: 7 additions & 7 deletions spdm_emu/spdm_requester_emu/spdm_requester_pci_doe.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ libspdm_return_t pci_ide_km_process_session_message(void *spdm_context, uint32_t

ide_reg_block_count = PCI_IDE_KM_IDE_REG_BLOCK_SUPPORTED_COUNT;
status = pci_ide_km_query (m_pci_doe_context, spdm_context, &session_id,
0, &dev_func_num, &bus_num, &segment, &max_port_index,
1, &dev_func_num, &bus_num, &segment, &max_port_index,
ide_reg_block, &ide_reg_block_count);
if (LIBSPDM_STATUS_IS_ERROR(status)) {
return status;
Expand All @@ -67,7 +67,7 @@ libspdm_return_t pci_ide_km_process_session_message(void *spdm_context, uint32_t
key_buffer.iv[0] = 0;
key_buffer.iv[1] = 1;
status = pci_ide_km_key_prog (m_pci_doe_context, spdm_context, &session_id,
0, PCI_IDE_KM_KEY_SET_K0 | PCI_IDE_KM_KEY_DIRECTION_RX, 0,
0, PCI_IDE_KM_KEY_SET_K0 | PCI_IDE_KM_KEY_DIRECTION_RX, 1,
&key_buffer, &kp_ack_status);
if (LIBSPDM_STATUS_IS_ERROR(status)) {
return status;
Expand All @@ -81,37 +81,37 @@ libspdm_return_t pci_ide_km_process_session_message(void *spdm_context, uint32_t
key_buffer.iv[0] = 0;
key_buffer.iv[1] = 1;
status = pci_ide_km_key_prog (m_pci_doe_context, spdm_context, &session_id,
0, PCI_IDE_KM_KEY_SET_K0 | PCI_IDE_KM_KEY_DIRECTION_TX, 0,
0, PCI_IDE_KM_KEY_SET_K0 | PCI_IDE_KM_KEY_DIRECTION_TX, 1,
&key_buffer, &kp_ack_status);
if (LIBSPDM_STATUS_IS_ERROR(status)) {
return status;
}
LIBSPDM_DEBUG((LIBSPDM_DEBUG_INFO, "key_prog K0|TX - %02x\n", kp_ack_status));

status = pci_ide_km_key_set_go (m_pci_doe_context, spdm_context, &session_id,
0, PCI_IDE_KM_KEY_SET_K0 | PCI_IDE_KM_KEY_DIRECTION_RX, 0);
0, PCI_IDE_KM_KEY_SET_K0 | PCI_IDE_KM_KEY_DIRECTION_RX, 1);
if (LIBSPDM_STATUS_IS_ERROR(status)) {
return status;
}
LIBSPDM_DEBUG((LIBSPDM_DEBUG_INFO, "key_set_go K0|RX\n"));

status = pci_ide_km_key_set_go (m_pci_doe_context, spdm_context, &session_id,
0, PCI_IDE_KM_KEY_SET_K0 | PCI_IDE_KM_KEY_DIRECTION_TX, 0);
0, PCI_IDE_KM_KEY_SET_K0 | PCI_IDE_KM_KEY_DIRECTION_TX, 1);
if (LIBSPDM_STATUS_IS_ERROR(status)) {
return status;
}
LIBSPDM_DEBUG((LIBSPDM_DEBUG_INFO, "key_set_go K0|TX\n"));


status = pci_ide_km_key_set_stop (m_pci_doe_context, spdm_context, &session_id,
0, PCI_IDE_KM_KEY_SET_K0 | PCI_IDE_KM_KEY_DIRECTION_RX, 0);
0, PCI_IDE_KM_KEY_SET_K0 | PCI_IDE_KM_KEY_DIRECTION_RX, 1);
if (LIBSPDM_STATUS_IS_ERROR(status)) {
return status;
}
LIBSPDM_DEBUG((LIBSPDM_DEBUG_INFO, "key_set_stop K0|RX\n"));

status = pci_ide_km_key_set_stop (m_pci_doe_context, spdm_context, &session_id,
0, PCI_IDE_KM_KEY_SET_K0 | PCI_IDE_KM_KEY_DIRECTION_TX, 0);
0, PCI_IDE_KM_KEY_SET_K0 | PCI_IDE_KM_KEY_DIRECTION_TX, 1);
if (LIBSPDM_STATUS_IS_ERROR(status)) {
return status;
}
Expand Down

0 comments on commit 6696f93

Please sign in to comment.