add a flag of lin internal sleep/wakeup state

Signed-off-by: wangxiaoxin <wangxiaoxin@xiaomi.com>
This commit is contained in:
wangxiaoxin 2024-08-07 16:46:36 +08:00 committed by Xiang Xiao
parent 43d483efc0
commit 2a99490ed6
2 changed files with 10 additions and 4 deletions

View File

@ -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;
};

View File

@ -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);