Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions arch/arm/src/imx9/imx9_flexcan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1601,15 +1601,13 @@ static int imx9_ioctl(struct net_driver_s *dev, int cmd,

if (ret == OK)
{
/* Reset CAN controller and start with new timings */
/* Apply the new timings (interface is guaranteed to be down) */

priv->arbi_timing = arbi_timing;
if (priv->canfd_capable)
{
priv->data_timing = data_timing;
}

imx9_ifup(dev);
}
}
break;
Expand Down
4 changes: 1 addition & 3 deletions arch/arm/src/imxrt/imxrt_flexcan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1569,15 +1569,13 @@ static int imxrt_ioctl(struct net_driver_s *dev, int cmd,

if (ret == OK)
{
/* Reset CAN controller and start with new timings */
/* Apply the new timings (interface is guaranteed to be down) */

priv->arbi_timing = arbi_timing;
if (priv->canfd_capable)
{
priv->data_timing = data_timing;
}

imxrt_ifup(dev);
}
}
break;
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/src/kinetis/kinetis_flexcan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1533,13 +1533,12 @@ static int kinetis_ioctl(struct net_driver_s *dev, int cmd,

if (ret == OK)
{
/* Reset CAN controller and start with new timings */
/* Apply the new timings (interface is guaranteed to be down) */

priv->arbi_timing = arbi_timing;
#ifdef CONFIG_NET_CAN_CANFD
priv->data_timing = data_timing;
#endif
kinetis_ifup(dev);
}
}
break;
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/src/s32k1xx/s32k1xx_flexcan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1516,13 +1516,12 @@ static int s32k1xx_ioctl(struct net_driver_s *dev, int cmd,

if (ret == OK)
{
/* Reset CAN controller and start with new timings */
/* Apply the new timings (interface is guaranteed to be down) */

priv->arbi_timing = arbi_timing;
#ifdef CONFIG_NET_CAN_CANFD
priv->data_timing = data_timing;
#endif
s32k1xx_ifup(dev);
}
}
break;
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/src/s32k3xx/s32k3xx_flexcan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1707,13 +1707,12 @@ static int s32k3xx_ioctl(struct net_driver_s *dev, int cmd,

if (ret == OK)
{
/* Reset CAN controller and start with new timings */
/* Apply the new timings (interface is guaranteed to be down) */

priv->arbi_timing = arbi_timing;
#ifdef CONFIG_NET_CAN_CANFD
priv->data_timing = data_timing;
#endif
s32k3xx_ifup(dev);
}
}
break;
Expand Down
11 changes: 2 additions & 9 deletions arch/arm/src/stm32h7/stm32_fdcan_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1966,19 +1966,12 @@ static int fdcan_netdev_ioctl(struct net_driver_s *dev, int cmd,
struct can_ioctl_data_s *req =
(struct can_ioctl_data_s *)((uintptr_t)arg);

/* Apply the new timings (interface is guaranteed to be down) */

priv->arbi_timing.bitrate = req->arbi_bitrate * 1000;
#ifdef CONFIG_NET_CAN_CANFD
priv->data_timing.bitrate = req->data_bitrate * 1000;
#endif

/* Reset CAN controller and start with new timings */

ret = fdcan_initialize(priv);

if (ret == OK)
{
ret = fdcan_ifup(dev);
}
}
break;
#endif /* CONFIG_NETDEV_CAN_BITRATE_IOCTL */
Expand Down
4 changes: 1 addition & 3 deletions arch/arm64/src/imx9/imx9_flexcan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1634,15 +1634,13 @@ static int imx9_ioctl(struct net_driver_s *dev, int cmd,

if (ret == OK)
{
/* Reset CAN controller and start with new timings */
/* Apply the new timings (interface is guaranteed to be down) */

priv->arbi_timing = arbi_timing;
if (priv->canfd_capable)
{
priv->data_timing = data_timing;
}

imx9_ifup(dev);
}
}
break;
Expand Down
12 changes: 11 additions & 1 deletion net/netdev/netdev_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1176,8 +1176,18 @@ static int netdev_ifr_ioctl(FAR struct socket *psock, int cmd,
#endif

#if defined(CONFIG_NETDEV_IOCTL) && defined(CONFIG_NETDEV_CAN_BITRATE_IOCTL)
case SIOCGCANBITRATE: /* Get bitrate from a CAN controller */
case SIOCSCANBITRATE: /* Set bitrate of a CAN controller */
if (dev->d_flags & IFF_UP)
{
/* Cannot set bitrate if the interface is up. */

ret = -EBUSY;
break;
}

/* If down, fall-through to common code in SIOCGCANBITRATE. */

case SIOCGCANBITRATE: /* Get bitrate from a CAN controller */
if (dev->d_ioctl)
{
FAR struct can_ioctl_data_s *can_bitrate_data =
Expand Down