debug: mipi_stp_decoder: Align naming to 2.4 standard

Align naming to STP v2.4. Changing Master to Major.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruściński 2024-06-11 09:35:00 +02:00 committed by Anas Nashif
commit fc162f74c0
3 changed files with 12 additions and 12 deletions

View file

@ -27,7 +27,7 @@ enum mipi_stp_decoder_ctrl_type {
STP_DATA32 = 8,
STP_DATA64 = 16,
STP_DECODER_NULL = 128,
STP_DECODER_MASTER,
STP_DECODER_MAJOR,
STP_DECODER_MERROR,
STP_DECODER_CHANNEL,
STP_DECODER_VERSION,
@ -50,7 +50,7 @@ enum mipi_stp_decoder_ctrl_type {
_type == STP_DATA32 ? "DATA32" : (\
_type == STP_DATA64 ? "DATA64" : (\
_type == STP_DECODER_NULL ? "NULL" : (\
_type == STP_DECODER_MASTER ? "MASTER" : (\
_type == STP_DECODER_MAJOR ? "MAJOR" : (\
_type == STP_DECODER_MERROR ? "MERROR" : (\
_type == STP_DECODER_CHANNEL ? "CHANNEL" : (\
_type == STP_DECODER_VERSION ? "VERSION" : (\
@ -62,7 +62,7 @@ enum mipi_stp_decoder_ctrl_type {
/** @brief Union with data associated with a given STP opcode. */
union mipi_stp_decoder_data {
/** ID - used for master and channel. */
/** ID - used for major and channel. */
uint16_t id;
/** Frequency. */

View file

@ -257,7 +257,7 @@ static void data64_mts_cb(uint64_t data, uint64_t ts)
cfg.cb(STP_DATA64, d, &ts, true);
}
static void master_cb(uint64_t id, uint64_t ts)
static void major_cb(uint64_t id, uint64_t ts)
{
ARG_UNUSED(ts);
uint16_t m_id = (uint16_t)id;
@ -265,7 +265,7 @@ static void master_cb(uint64_t id, uint64_t ts)
curr_ch = 0;
cfg.cb(STP_DECODER_MASTER, data, NULL, false);
cfg.cb(STP_DECODER_MAJOR, data, NULL, false);
}
static void channel16_cb(uint64_t id, uint64_t ts)
@ -383,7 +383,7 @@ static void async_cb(uint64_t data, uint64_t ts)
static const struct stp_item items[] = {
STP_ITEM(STP_NULL, (0x0), 1, 0, false, null_cb),
STP_ITEM(STP_M8, (0x1), 1, 2, false, master_cb),
STP_ITEM(STP_M8, (0x1), 1, 2, false, major_cb),
STP_ITEM(STP_MERR, (0x2), 1, 2, false, merror_cb),
STP_ITEM(STP_C8, (0x3), 1, 2, false, channel_cb),
STP_ITEM(STP_D8, (0x4), 1, 2, false, data8_cb),
@ -412,7 +412,7 @@ static const struct stp_item items[] = {
STP_ITEM(STP_FREQ_40, (0xf0, 0xf0), 4, 10, false, freq_cb),
STP_ITEM(STP_FREQ_40_TS, (0xf0, 0xf1), 4, 0, true, notsup_cb),
STP_ITEM(STP_DIP, (0xf0, 0xf2), 4, 0, false, notsup_cb),
STP_ITEM(STP_M16, (0xf1), 2, 4, false, master_cb),
STP_ITEM(STP_M16, (0xf1), 2, 4, false, major_cb),
STP_ITEM(STP_GERR, (0xf2), 2, 2, false, gerror_cb),
STP_ITEM(STP_C16, (0xf3), 2, 4, false, channel16_cb),
STP_ITEM(STP_D8TS, (0xf4), 2, 2, true, data8_ts_cb),

View file

@ -59,14 +59,14 @@ ZTEST(mipi_stp_decoder_test, test_chunk_null)
zassert_equal(cnt, d_cnt, NULL);
}
ZTEST(mipi_stp_decoder_test, test_chunk_master)
ZTEST(mipi_stp_decoder_test, test_chunk_major)
{
/* 0x1(m8) 0xab 0x0 (null) 0xf1(m16) 0x3412 */
uint8_t data[] = {0xa1, 0x0b, 0x1f, 0x34, 0x12};
ADD_ITEM(cnt, STP_DECODER_MASTER, UINT64_MAX, false, (uint8_t)0xab);
ADD_ITEM(cnt, STP_DECODER_MAJOR, UINT64_MAX, false, (uint8_t)0xab);
ADD_ITEM(cnt, STP_DECODER_NULL, UINT64_MAX, false, (uint8_t)0);
ADD_ITEM(cnt, STP_DECODER_MASTER, UINT64_MAX, false, (uint16_t)0x4321);
ADD_ITEM(cnt, STP_DECODER_MAJOR, UINT64_MAX, false, (uint16_t)0x4321);
mipi_stp_decoder_decode(data, sizeof(data));
zassert_equal(cnt, d_cnt, NULL);
@ -78,12 +78,12 @@ ZTEST(mipi_stp_decoder_test, test_chunk_channel)
uint8_t data[] = {0x10, 0xba, 0xa3, 0xfb, 0x63, 0x44, 0x36, 0xbb, 0x01, 0x3b, 0xaa};
ADD_ITEM(cnt, STP_DECODER_NULL, UINT64_MAX, false, (uint8_t)0);
ADD_ITEM(cnt, STP_DECODER_MASTER, UINT64_MAX, false, (uint8_t)0xab);
ADD_ITEM(cnt, STP_DECODER_MAJOR, UINT64_MAX, false, (uint8_t)0xab);
ADD_ITEM(cnt, STP_DECODER_CHANNEL, UINT64_MAX, false, (uint8_t)0xab);
ADD_ITEM(cnt, STP_DECODER_CHANNEL, UINT64_MAX, false, (uint16_t)0x6446);
/* MSB byte is taken from previous C16 */
ADD_ITEM(cnt, STP_DECODER_CHANNEL, UINT64_MAX, false, (uint16_t)0x64bb);
ADD_ITEM(cnt, STP_DECODER_MASTER, UINT64_MAX, false, (uint8_t)0x0b);
ADD_ITEM(cnt, STP_DECODER_MAJOR, UINT64_MAX, false, (uint8_t)0x0b);
/* M8 resets current channel */
ADD_ITEM(cnt, STP_DECODER_CHANNEL, UINT64_MAX, false, (uint8_t)0xaa);