-
Notifications
You must be signed in to change notification settings - Fork 55
Support diag ltssm cmd for gen5 #342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support diag ltssm cmd for gen5 #342
Conversation
lsgunth
left a comment
There was a problem hiding this 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); | ||
| } |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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); | ||
| } |
There was a problem hiding this comment.
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.
b7b9ab1 to
4f86533
Compare
No description provided.