base: Reinforce some symbol names
This commit renames some symbol names for base APIs to reinforce API
naming convention defined here [1]. The list of change includes:
1. `encode_base_multipart_receive_req()` to
`encode_pldm_base_multipart_receive_req()`
2. `decode_base_multipart_receive_resp()` to
`decode_pldm_base_multipart_receive_resp()`
3. `struct pldm_multipart_receive_resp` to
`struct pldm_base_multipart_receive_resp`
4. `struct pldm_multipart_receive_req` to
`struct pldm_base_multipart_receive_req`
This also removes `__attribute__((packed))` from
`struct pldm_base_multipart_receive_req` to adapt [1].
[1]: https://github.com/openbmc/libpldm/blob/main/docs/checklists/changes.md#adding-a-new-api
Change-Id: Iefbec44efd48923fa4458228d80678a3995742e6
Signed-off-by: Chau Ly <chaul@amperecomputing.com>
diff --git a/tests/dsp/base.cpp b/tests/dsp/base.cpp
index d073ac4..fbecd60 100644
--- a/tests/dsp/base.cpp
+++ b/tests/dsp/base.cpp
@@ -753,7 +753,7 @@
{
uint8_t instance_id = 0;
- const struct pldm_multipart_receive_req req_data = {
+ const struct pldm_base_multipart_receive_req req_data = {
PLDM_BASE, PLDM_XFER_FIRST_PART, 0x01, 0x10, 0x00, 0x10};
std::array<uint8_t, PLDM_MULTIPART_RECEIVE_REQ_BYTES> requestMsg = {
@@ -768,7 +768,7 @@
0x00, 0x00};
PLDM_MSG_DEFINE_P(requestPtr, PLDM_MULTIPART_RECEIVE_REQ_BYTES);
- auto rc = encode_base_multipart_receive_req(
+ auto rc = encode_pldm_base_multipart_receive_req(
instance_id, &req_data, requestPtr, PLDM_MULTIPART_RECEIVE_REQ_BYTES);
ASSERT_EQ(rc, 0);
@@ -783,16 +783,16 @@
uint8_t instance_id = 0;
int rc;
- const struct pldm_multipart_receive_req req_data = {
+ const struct pldm_base_multipart_receive_req req_data = {
PLDM_BASE, PLDM_XFER_FIRST_PART, 0x01, 0x10, 0x00, 0x10};
PLDM_MSG_DEFINE_P(requestPtr, PLDM_MULTIPART_RECEIVE_REQ_BYTES);
- rc = encode_base_multipart_receive_req(instance_id, nullptr, requestPtr,
- PLDM_MULTIPART_RECEIVE_REQ_BYTES);
+ rc = encode_pldm_base_multipart_receive_req(
+ instance_id, nullptr, requestPtr, PLDM_MULTIPART_RECEIVE_REQ_BYTES);
EXPECT_EQ(rc, -EINVAL);
- rc = encode_base_multipart_receive_req(instance_id, &req_data, nullptr,
- PLDM_MULTIPART_RECEIVE_REQ_BYTES);
+ rc = encode_pldm_base_multipart_receive_req(
+ instance_id, &req_data, nullptr, PLDM_MULTIPART_RECEIVE_REQ_BYTES);
EXPECT_EQ(rc, -EINVAL);
}
#endif
@@ -803,13 +803,13 @@
uint8_t instance_id = 0;
int rc;
- const struct pldm_multipart_receive_req req_data = {
+ const struct pldm_base_multipart_receive_req req_data = {
PLDM_BASE, PLDM_XFER_FIRST_PART, 0x01, 0x10, 0x00, 0x10};
PLDM_MSG_DEFINE_P(requestPtr, PLDM_MULTIPART_RECEIVE_REQ_BYTES);
- rc = encode_base_multipart_receive_req(instance_id, &req_data, requestPtr,
- 1);
+ rc = encode_pldm_base_multipart_receive_req(instance_id, &req_data,
+ requestPtr, 1);
EXPECT_EQ(rc, -EOVERFLOW);
}
#endif
@@ -824,7 +824,7 @@
std::vector<uint8_t> data = {1, 2, 3, 4, 5, 6, 7, 8, 9};
uint32_t dataIntegrityChecksum = 0x3C;
- struct pldm_multipart_receive_resp resp_data = {};
+ struct pldm_base_multipart_receive_resp resp_data = {};
PLDM_MSGBUF_DEFINE_P(buf);
int rc;
@@ -850,7 +850,7 @@
uint32_t respDataIntegrityChecksum = 0;
- rc = decode_base_multipart_receive_resp(
+ rc = decode_pldm_base_multipart_receive_resp(
responseMsg, payload_length, &resp_data, &respDataIntegrityChecksum);
ASSERT_EQ(rc, 0);
@@ -874,7 +874,7 @@
std::vector<uint8_t> data = {1, 2, 3, 4, 5, 6, 7, 8, 9};
uint32_t dataIntegrityChecksum = 0x3C;
- struct pldm_multipart_receive_resp resp_data = {};
+ struct pldm_base_multipart_receive_resp resp_data = {};
PLDM_MSGBUF_DEFINE_P(buf);
int rc;
@@ -900,12 +900,12 @@
uint32_t respDataIntegrityChecksum = 0;
- rc = decode_base_multipart_receive_resp(nullptr, payload_length, &resp_data,
- &respDataIntegrityChecksum);
+ rc = decode_pldm_base_multipart_receive_resp(
+ nullptr, payload_length, &resp_data, &respDataIntegrityChecksum);
EXPECT_EQ(rc, -EINVAL);
- rc = decode_base_multipart_receive_resp(
+ rc = decode_pldm_base_multipart_receive_resp(
responseMsg, payload_length, nullptr, &respDataIntegrityChecksum);
EXPECT_EQ(rc, -EINVAL);
@@ -922,7 +922,7 @@
std::vector<uint8_t> data = {1, 2, 3, 4, 5, 6, 7, 8, 9};
uint32_t dataIntegrityChecksum = 0x3C;
- struct pldm_multipart_receive_resp resp_data = {};
+ struct pldm_base_multipart_receive_resp resp_data = {};
PLDM_MSGBUF_DEFINE_P(buf);
int rc;
@@ -948,8 +948,8 @@
uint32_t respDataIntegrityChecksum = 0;
- rc = decode_base_multipart_receive_resp(responseMsg, 0, &resp_data,
- &respDataIntegrityChecksum);
+ rc = decode_pldm_base_multipart_receive_resp(responseMsg, 0, &resp_data,
+ &respDataIntegrityChecksum);
EXPECT_EQ(rc, -EOVERFLOW);
}
@@ -972,7 +972,7 @@
size_t payload_length = responseMsgLength;
struct variable_field payload = {data.data(), dataLength};
- struct pldm_multipart_receive_resp resp_data = {
+ struct pldm_base_multipart_receive_resp resp_data = {
completionCode, transferFlag, nextDataTransferHandle, payload};
std::array<uint8_t, responseMsgLength> responseMsg = {
completionCode,
@@ -1027,7 +1027,7 @@
size_t payload_length = responseMsgLength;
struct variable_field payload = {data.data(), dataLength};
- struct pldm_multipart_receive_resp resp_data = {
+ struct pldm_base_multipart_receive_resp resp_data = {
completionCode, transferFlag, nextDataTransferHandle, payload};
std::array<uint8_t, responseMsgLength> responseMsg = {
completionCode,
@@ -1077,7 +1077,7 @@
size_t payload_length = responseMsgLength;
struct variable_field payload = {data.data(), dataLength};
- struct pldm_multipart_receive_resp resp_data = {
+ struct pldm_base_multipart_receive_resp resp_data = {
completionCode, transferFlag, nextDataTransferHandle, payload};
std::array<uint8_t, 1> responseMsg = {completionCode};
@@ -1111,7 +1111,7 @@
size_t payload_length = responseMsgLength;
struct variable_field payload = {data.data(), dataLength};
- struct pldm_multipart_receive_resp resp_data = {
+ struct pldm_base_multipart_receive_resp resp_data = {
completionCode, transferFlag, nextDataTransferHandle, payload};
PLDM_MSG_DEFINE_P(responsePtr, responseMsgLength);
@@ -1153,7 +1153,7 @@
size_t payload_length = responseMsgLength;
struct variable_field payload = {data.data(), dataLength};
- struct pldm_multipart_receive_resp resp_data = {
+ struct pldm_base_multipart_receive_resp resp_data = {
completionCode, transferFlag, nextDataTransferHandle, payload};
PLDM_MSG_DEFINE_P(responsePtr, responseMsgLength);