-
Notifications
You must be signed in to change notification settings - Fork 8.2k
driver: can: add new filter to match CAN-FD frames #52483
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
driver: can: add new filter to match CAN-FD frames #52483
Conversation
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.
Still evaluating the idea of this API change, but if we are to add it we need the existing in-tree CAN-FD driver (yes, there's only one: Bosch M_CAN) adapted to support this and a test case added to prove it.
I think we should only add the filter type frame to can drivers which require eg. NXP S32 CANEXCEL. I see Bosch M_CAN doesn't require this. |
No. That will lead to different APIs for different CAN controllers, making it difficult to write portable application code. This is not an acceptable solution.
It doesn't require it, but it could support it. The above is exactly why I still hesitate in accepting this API change. We need to think carefully about user applications, portability, and support from more than just one driver/hardware peripheral. |
But in Bosch M_CAN driver, mcan filter no has field to configure filter type frame. |
It doesn't have a field for RTR either, but that is handled in software. Something similar can be done for FDF. |
Great ! I handled in software as you said. |
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.
You need to update can_utils_filter_match() in drivers/can/can_utils.h to handle the new flag as well.
I updated for handling it |
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.
Thanks! Looks good. Apologies for the review delay.
Thank you. |
Add support FD frame filter to configure type frame for each Rx msg to receive corresponding frames (classic, FD frames). The Bosch M_CAN driver does not support FD frame filter, so inmplement driver to handle it in software. Signed-off-by: Cong Nguyen Huu <[email protected]>
Add new filter to configure correctly FD frame. Signed-off-by: Cong Nguyen Huu <[email protected]>
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.
Looks good. Thanks for the fix.
Add support FD frame filter to configure type frame for each Rx msg to receive corresponding frames (classic, FD frames).
I have a PR #52450 which introduces support for NXP S32 CANEXCEL, it need to implement this.