Le 17/08/2019 à 02:07, Shu-Chun Weng via Qemu-devel a écrit : > The ioctl numeric values are platform-independent and determined by > the file include/uapi/linux/sockios.h in Linux kernel source code: > > #define SIOCETHTOOL 0x8946 > > These ioctls get (or set) the field ifr_data of type char* in the > structure ifreq. Such functionality is achieved in QEMU by using > MK_STRUCT() and MK_PTR() macros with an appropriate argument, as > it was done for existing similar cases.
I think it's a little bit more complicated... According to kernel code in dev_ethtool(), ifr_data points to 32bit value which is a sub-command (ETHTOOL_*), so this value must be converted to the good endianness. Then this sub-command can have parameters and thus these parameters must be converted too. Thanks, Laurent