csanchezdll opened a new pull request, #16199:
URL: https://github.com/apache/nuttx/pull/16199

   ## Summary
   
   In Linux, CAN bitrate is set with netlink, not ioctl, and you need to
   set a bitrate before bringing the interface up (make sense). In Nuttx,
   you can begin the interface up (it uses a default bitrate) and then
   you can change it. My guess is calling ifup at the end is precisely to
   avoid requiring another ifdown/ifup cycle from app code.
   
   SocketCAN is a Linux thing, so we should try to mimic the behaviour.
   Implementing netlink would be overkill (and moreover, it is common in
   Linux to use libsocketcan to abstract the netlink internals anyways)
   but at least we should have similar semantics
   
   ## Impact
   
   The change makes changing bitrate on an up interface fails. This is done on 
the portable, architecture-independent section of ioctl handling, so it affects 
all the drivers and makes the semantics clear.
   Al existing SocketCAN drivers have also been updated.
   
   Now the process for setting bitrate on an open interface is:
   
   1. ifdown the interface is it's up
   2. Call SIOCSCANBITRATE
   3. ifup the interface.
   
   This requires an update in apps/canutils/slcan. PR following.
   
   ## Testing
   
   The change was tested on a custom platform using s32k148 uC, confirming 
changing the bitrate no longer brings the interface up.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to