You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/10/16 06:34:04 UTC
(nuttx) branch master updated: add a flag of lin internal sleep/wakeup state
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 2a99490ed6 add a flag of lin internal sleep/wakeup state
2a99490ed6 is described below
commit 2a99490ed63b9e4c85fef08ba713cbd1af3d24a7
Author: wangxiaoxin <wa...@xiaomi.com>
AuthorDate: Wed Aug 7 16:46:36 2024 +0800
add a flag of lin internal sleep/wakeup state
Signed-off-by: wangxiaoxin <wa...@xiaomi.com>
---
include/net/if.h | 12 +++++++++---
net/netdev/netdev_ioctl.c | 2 +-
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/include/net/if.h b/include/net/if.h
index b5db231748..1992c08ed4 100644
--- a/include/net/if.h
+++ b/include/net/if.h
@@ -198,7 +198,7 @@ struct can_ioctl_filter_s
uint8_t fprio; /* See CAN_MSGPRIO_* definitions */
};
-/* Define an enumeration type that describes the CAN/LIN state */
+/* Define an struct type that describes the CAN/LIN state */
enum can_ioctl_state_e
{
@@ -208,6 +208,12 @@ enum can_ioctl_state_e
CAN_STATE_BUSY /* The can/lin bus is busy */
};
+struct can_ioctl_state_s
+{
+ uintptr_t priv; /* This is private data. */
+ enum can_ioctl_state_e state;
+};
+
/* There are two forms of the I/F request structure.
* One for IPv6 and one for IPv4.
* Notice that they are (and must be) cast compatible and really different
@@ -234,7 +240,7 @@ struct lifreq
struct mii_ioctl_data_s lifru_mii_data; /* MII request data */
struct can_ioctl_data_s lifru_can_data; /* CAN bitrate request data */
struct can_ioctl_filter_s lifru_can_filter; /* CAN filter request data */
- enum can_ioctl_state_e lifru_can_state; /* CAN/LIN controller state */
+ struct can_ioctl_state_s lifru_can_state; /* CAN/LIN controller state */
} lifr_ifru;
};
@@ -288,7 +294,7 @@ struct ifreq
struct mii_ioctl_data_s ifru_mii_data; /* MII request data */
struct can_ioctl_data_s ifru_can_data; /* CAN bitrate request data */
struct can_ioctl_filter_s ifru_can_filter; /* CAN filter request data */
- enum can_ioctl_state_e ifru_can_state; /* CAN/LIN controller state */
+ struct can_ioctl_state_s ifru_can_state; /* CAN/LIN controller state */
FAR void *ifru_data; /* For use by interface */
} ifr_ifru;
};
diff --git a/net/netdev/netdev_ioctl.c b/net/netdev/netdev_ioctl.c
index 4b5fbcb46e..e1749eedcd 100644
--- a/net/netdev/netdev_ioctl.c
+++ b/net/netdev/netdev_ioctl.c
@@ -1217,7 +1217,7 @@ static int netdev_ifr_ioctl(FAR struct socket *psock, int cmd,
case SIOCSCANSTATE: /* Set the LIN/CAN controller state */
if (dev->d_ioctl)
{
- FAR enum can_ioctl_state_e *can_state =
+ FAR struct can_ioctl_state_s *can_state =
&req->ifr_ifru.ifru_can_state;
ret = dev->d_ioctl(dev, cmd,
(unsigned long)(uintptr_t)can_state);