nuttx/net/netdev/Kconfig
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

87 lines
2.2 KiB
Text

#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
menu "Network Device Operations"
config NETDEV_IOCTL
bool
default n
config NETDEV_PHY_IOCTL
bool "Enable PHY ioctl()"
default n
select NETDEV_IOCTL
---help---
Enable support for ioctl() commands to access PHY registers
config NETDEV_CAN_IOCTL
bool "Enable CAN ioctl()"
default n
select NETDEV_IOCTL
depends on NET_CAN
---help---
Enable support for the CAN network device ioctl() commands:
bitrate, hardware-level filters, CAN/LIN controller state and
error counters
(NOTE: Not every command is supported by every driver)
config NETDEV_WIRELESS_IOCTL
bool "Enable Wireless ioctl()"
default n
select NETDEV_IOCTL
depends on DRIVERS_WIRELESS
---help---
Enable support for wireless device ioctl() commands
config NETDEV_MODEM_LTE_IOCTL
bool "Enable LTE ioctl()"
default n
select NETDEV_IOCTL
depends on MODEM
---help---
Enable support for modem device ioctl() commands
config NETDEV_IFINDEX
bool "Enable IF index support"
default n
---help---
Enable support for references devices by an interface index.
This feature is automatically enabled when raw, PACKET sockets
are enabled.
When enabled, these option also enables the user interfaces:
if_nametoindex() and if_indextoname().
config NETDEV_MULTIPLE_IPv6
bool "Enable multiple IPv6 addresses support"
default n
select NETDEV_IFINDEX
depends on NET_IPv6
---help---
Enable support for multiple IPv6 addresses per network device.
config NETDEV_MAX_IPv6_ADDR
int "Maximum number of IPv6 addresses per network device"
range 2 255
default 2
depends on NETDEV_MULTIPLE_IPv6
---help---
Maximum number of IPv6 addresses that can be assigned to a single
network device. Normally a link-local address and a global address
are needed.
config NETDOWN_NOTIFIER
bool "Support network down notifications"
default n
depends on SCHED_WORKQUEUE
select WQUEUE_NOTIFIER
---help---
Enable building of logic that will execute on the low priority work
thread when the network is taken down. This is is a general purpose
notifier, but was developed specifically to support SIGHUP poll()
logic.
endmenu # Network Device Operations