Skip to content

Commit

Permalink
add a flag of lin internal sleep/wakeup state
Browse files Browse the repository at this point in the history
Signed-off-by: wangxiaoxin <[email protected]>
  • Loading branch information
wangxiaoxin1 authored and xiaoxiang781216 committed Oct 16, 2024
1 parent 43d483e commit 2a99490
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions include/net/if.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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
Expand All @@ -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;
};

Expand Down Expand Up @@ -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;
};
Expand Down
2 changes: 1 addition & 1 deletion net/netdev/netdev_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2a99490

Please sign in to comment.