[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] Add support for ethtool via TARGET_SIOCETHTOOL ioct
From: |
Shu-Chun Weng |
Subject: |
[Qemu-devel] [PATCH] Add support for ethtool via TARGET_SIOCETHTOOL ioctls. |
Date: |
Fri, 16 Aug 2019 14:13:56 -0700 |
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.
Signed-off-by: Shu-Chun Weng <address@hidden>
---
linux-user/ioctls.h | 1 +
linux-user/syscall_defs.h | 2 ++
2 files changed, 3 insertions(+)
diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
index 3281c97ca2..9d231df665 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -208,6 +208,7 @@
IOCTL(SIOCGIFINDEX, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_int_ifreq)))
IOCTL(SIOCSIFPFLAGS, IOC_W, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
IOCTL(SIOCGIFPFLAGS, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_short_ifreq)))
+ IOCTL(SIOCETHTOOL, IOC_R | IOC_W, MK_PTR(MK_STRUCT(STRUCT_ptr_ifreq)))
IOCTL(SIOCSIFLINK, 0, TYPE_NULL)
IOCTL_SPECIAL(SIOCGIFCONF, IOC_W | IOC_R, do_ioctl_ifconf,
MK_PTR(MK_STRUCT(STRUCT_ifconf)))
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 0662270300..276f96039f 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -819,6 +819,8 @@ struct target_pollfd {
#define TARGET_SIOCGIFTXQLEN 0x8942 /* Get the tx queue length
*/
#define TARGET_SIOCSIFTXQLEN 0x8943 /* Set the tx queue length
*/
+#define TARGET_SIOCETHTOOL 0x8946 /* Ethtool interface
*/
+
/* ARP cache control calls. */
#define TARGET_OLD_SIOCDARP 0x8950 /* old delete ARP table entry
*/
#define TARGET_OLD_SIOCGARP 0x8951 /* old get ARP table entry
*/
--
2.23.0.rc1.153.gdeed80330f-goog
- [Qemu-devel] [PATCH] Add support for ethtool via TARGET_SIOCETHTOOL ioctls.,
Shu-Chun Weng <=