nuttx/net/netdev
Jacob Dahl eb40eed248 arch/arm/src/imxrt: Unify FlexCAN TX work and add SIOCGCANERRORS.
TX-complete and the deadline watchdog each queued their own callback on
the same work_s, and work_queue() cancels whatever is pending when a
work_s is reused, so whichever ran second was dropped: deadlines were
left set, the TX interrupt mask stayed off, or expired frames were never
aborted. Both now queue imxrt_tx_work(), which retires completions
before it aborts expired mailboxes.

Add SIOCGCANERRORS so a socket can read fault confinement, TEC/REC, a
monotonic bus error count and the RX mailbox overrun count. SIOCGCANSTATE
reports sleep/operational, not fault confinement, hence a new command.
The error count is sampled from the clear-on-read ESR1 error flags at
every driver entry rather than from ERRINT, which fires per error frame
and storms at bus rate once the bus is dead. Frames the CAN socket layer
drops for want of an IOB now count as rx_dropped in the netdev
statistics as well as in the global CAN statistics.

Tested on an i.MX RT1176 (ARK FMU-v6XRT) running PX4 with two DroneCAN
nodes: unplugging one node the ioctl reports error-passive, TEC 128,
REC 0 and a monotonic error count, matching ECR/ESR1 read over SWD at
20 Hz, while the other interface stays error-active with zero errors.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-09-01 17:40:47 +08:00
..
CMakeLists.txt netdev: delete macro CONFIG_NETDEV_CHECKSUM with nuttx 2026-01-19 23:22:46 +08:00
Kconfig arch/arm/src/imxrt: Unify FlexCAN TX work and add SIOCGCANERRORS. 2026-09-01 17:40:47 +08:00
Make.defs netdev: delete macro CONFIG_NETDEV_CHECKSUM with nuttx 2026-01-19 23:22:46 +08:00
netdev.h net: skip TCP/UDP pseudo-header checksum with hardware offload 2026-01-19 23:22:46 +08:00
netdev_carrier.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
netdev_checksum.c netdev: delete macro CONFIG_NETDEV_CHECKSUM with nuttx 2026-01-19 23:22:46 +08:00
netdev_count.c net/netdev: separate netdev_list_lock from net_lock 2025-12-29 09:42:18 +08:00
netdev_default.c netdev:When running, proto stack can exchange packets with device 2026-01-06 16:04:03 +08:00
netdev_findbyaddr.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
netdev_findbyindex.c net/netdev: separate netdev_list_lock from net_lock 2025-12-29 09:42:18 +08:00
netdev_findbyname.c net/netdev: separate netdev_list_lock from net_lock 2025-12-29 09:42:18 +08:00
netdev_foreach.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
netdev_ifconf.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
netdev_input.c style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
netdev_iob.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
netdev_ioctl.c arch/arm/src/imxrt: Unify FlexCAN TX work and add SIOCGCANERRORS. 2026-09-01 17:40:47 +08:00
netdev_ipv6.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
netdev_lladdrsize.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
netdev_lock.c net/utils/net_lock.c: add api to lock conn and netdev 2025-12-29 09:42:18 +08:00
netdev_notify_recvcpu.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
netdev_register.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
netdev_stats.c net: migrate to SPDX identifier 2024-09-12 01:08:11 +08:00
netdev_txnotify.c net/netdev/netdev_txnotify.c: add debug log with interface name 2026-05-06 01:16:40 +08:00
netdev_unregister.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
netdev_verify.c net/netdev: separate netdev_list_lock from net_lock 2025-12-29 09:42:18 +08:00
netdown_notifier.c net:modify check condition from IFF_UP to IFF_RUNNING in the sending process 2026-01-09 21:48:18 +08:00