This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 9d3abe8b71 socket can : support ioctl cmd SIOCCANRECOVERY
9d3abe8b71 is described below

commit 9d3abe8b712e46d254326c094c012acb7c47afff
Author: xucheng5 <[email protected]>
AuthorDate: Fri Aug 11 11:14:13 2023 +0800

    socket can : support ioctl cmd SIOCCANRECOVERY
    
    send CMD to restart controller in state bus-off
    
    Signed-off-by: xucheng5 <[email protected]>
---
 include/nuttx/net/ioctl.h | 1 +
 net/netdev/netdev_ioctl.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/include/nuttx/net/ioctl.h b/include/nuttx/net/ioctl.h
index d84733a20e..7400a38a65 100644
--- a/include/nuttx/net/ioctl.h
+++ b/include/nuttx/net/ioctl.h
@@ -121,6 +121,7 @@
 #define SIOCDCANEXTFILTER  _SIOC(0x002F)  /* Delete hardware-level exteneded 
ID filter */
 #define SIOCACANSTDFILTER  _SIOC(0x0030)  /* Add hardware-level standard ID 
filter */
 #define SIOCDCANSTDFILTER  _SIOC(0x0031)  /* Delete hardware-level standard ID 
filter */
+#define SIOCCANRECOVERY    _SIOC(0x0032)  /* Recovery can, work only when 
bus-off state */
 
 /* Network socket control ***************************************************/
 
diff --git a/net/netdev/netdev_ioctl.c b/net/netdev/netdev_ioctl.c
index f906f6af9c..24bbfd18c9 100644
--- a/net/netdev/netdev_ioctl.c
+++ b/net/netdev/netdev_ioctl.c
@@ -710,6 +710,7 @@ static ssize_t net_ioctl_ifreq_arglen(int cmd)
       case SIOCDCANEXTFILTER:
       case SIOCACANSTDFILTER:
       case SIOCDCANSTDFILTER:
+      case SIOCCANRECOVERY:
       case SIOCSIFNAME:
       case SIOCGIFNAME:
       case SIOCGIFINDEX:
@@ -1106,6 +1107,7 @@ static int netdev_ifr_ioctl(FAR struct socket *psock, int 
cmd,
       case SIOCDCANEXTFILTER:  /* Delete an extended-ID filter */
       case SIOCACANSTDFILTER:  /* Add a standard-ID filter */
       case SIOCDCANSTDFILTER:  /* Delete a standard-ID filter */
+      case SIOCCANRECOVERY:    /* Recovery can controller when bus-off */
         if (dev->d_ioctl)
           {
             FAR struct can_ioctl_filter_s *can_filter =

Reply via email to