Skip to content

Conversation

@BenReed161
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@lsgunth lsgunth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did a quick review, didn't find any issues. Thanks for many of the cleanups!

lib/diag.c Outdated
log_data[curr_idx + i].timestamp = timestamp;
log_data[curr_idx + i].link_rate = switchtec_gen_transfers[rate+1];
log_data[curr_idx + i].link_state = major | (minor << 8);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic of issuing MRPC and assigning retrieved log to log_data repeated several times in the code, possible to extract it to make it a helper function?

lib/diag.c Outdated

rate = (dw0 >> 13) & SWITCHTEC_LTSSM_LOG_MASK_RATE;
major = (dw0 >> 7) & SWITCHTEC_LTSSM_LOG_MASK_MAJOR;
minor = (dw0 >> 3) & SWITCHTEC_LTSSM_LOG_MASK_MINOR;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a helper function is possible, we probably can remove the mask macros and just expand the value in the statement, just as we put shift offset values here.

lib/diag.c Outdated
int ret;
if (switchtec_is_gen5(dev)) {
ret = switchtec_diag_ltssm_log_gen5(dev, port, log_count, log_data);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surrounding {} not necessary.

Added new set of function to handle gen5 ltssm log requests.
Data structures to handle I/O of the MRPC data have been updated to
gen5 structures and offsets. Sub command ID has been updated to
gen5 subcommand IDs. Added buffering option for logs larger than 61
entries to send multiple ltssm MRPC commands as per the spec.
@BenReed161 BenReed161 force-pushed the support-diag-ltssm-cmd-for-gen5 branch from b7b9ab1 to 4f86533 Compare April 3, 2025 22:35
@kelvin-cao kelvin-cao merged commit 1cf1ddc into Microsemi:master Apr 3, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants