-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Minor can driver improvement #12078
base: master
Are you sure you want to change the base?
Minor can driver improvement #12078
Conversation
3b4461e
to
de1cc86
Compare
to avoid the duplication in include/nuttx/can/can.h. Signed-off-by: Xiang Xiao <[email protected]>
Signed-off-by: Xiang Xiao <[email protected]>
so the error could dispath to each client without interference Signed-off-by: Xiang Xiao <[email protected]>
since routines called by IRQ need to be protected in SMP too Signed-off-by: Xiang Xiao <[email protected]>
@xiaoxiang781216 could you please share your internal test? We need to confirm this modification will not break existing applications using CAN |
@xiaoxiang781216 I think include/nuttx/can.h is legacy code, when I created the mcp2515 driver I needed to create a drivers/can and moved can.c to there, but I think this header file was left behind. Maybe we could merge it into include/nuttx/can/can.h |
include/nuttx/can/can.h contains more ioctl than include/nuttx/can.h. This is the reason why I remove ioctl from include/nuttx/can.h. |
Right, but maybe it makes more sense to have only include/nuttx/can/can.h |
Your mean merge include/nuttx/can.h into include/nuttx/can/can.h? |
Yes! |
That is not trivial. Having two |
Maybe we could separate it in include/nuttx/can/can.h and include/nuttx/can/socketcan.h since technically they are different |
|
Right, but for NuttX it is important to keep support for CAN char driver because some boards don't have enough memory to support SocketCAN. |
I rather keep the Char Device CAN and SocketCAN separate, they're both fundamentally different subsystems with their own API's. |
Agree! |
Yes, I would suggest that we write a general net driver on top of can driver, so the user just need write char driver and expose char or socketcan interface in defconfig. |
That would incur a lot of overhead (Zephyr is doing it and their SocketCAN performance isn't that great due to it) It isn't hard to support both back-ends for a can driver I did it for the LPC17XX. |
Summary
Impact
can driver
Testing
internal test case