HedongGao opened a new pull request, #21501: URL: https://github.com/apache/nuttx/pull/21501
*Note: Please adhere to [Contributing Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).* ## Summary Add ethtool ioctl support for getting/setting hardware channel information on netdev upper-half (`netdev_lowerhalf_s` based) Ethernet drivers. - `include/nuttx/ethtool.h`: add `ETHTOOL_GCHANNELS2` / `ETHTOOL_SCHANNELS2` commands, `struct ethtool_chns` (count based, used with the existing `ETHTOOL_GCHANNELS` / `ETHTOOL_SCHANNELS`) and `struct ethtool_chns2` (bitmask based). - `include/nuttx/net/netdev_lowerhalf.h`: add an optional `struct ethtool_ops_s` (`get_channels`, `set_channels`, `get_channels2`, `set_channels2`) and an `eth_ops` pointer in `struct netdev_lowerhalf_s`. - `drivers/net/netdev_upperhalf.c`: dispatch `SIOCETHTOOL` requests to `eth_ops` when the lower-half driver provides it. - `net/netdev/Kconfig`: new option `CONFIG_NETDEV_ETHTOOL_IOCTL` (default `n`). The existing `SIOCETHTOOL` handling in `netdev_ethtool_ioctl()` is unchanged: `ETHTOOL_GET_TS_INFO` is still answered by the stack, other commands keep being forwarded to `d_ioctl`, which now reaches the new upper-half handler. ## Impact - New feature, disabled by default; no behavior change unless `CONFIG_NETDEV_ETHTOOL_IOCTL=y` and a lower-half driver sets `eth_ops`. - `struct netdev_lowerhalf_s` gains one pointer only when the option is enabled. - No board, build system or documentation changes required. ## Testing Host: Ubuntu 22.04 x86_64, Linux 6.8, GCC 13.1. - `./tools/checkpatch.sh -c -u -m -g apache/master..HEAD`: all checks pass. - Build test `sim:tcpblaster` (CMake + Ninja) with `CONFIG_NETDEV_ETHTOOL_IOCTL=y`: builds without warnings. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
