qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Add support for ethtool via TARGET_SIOCETHTOOL ioctls.
@ 2019-08-16 21:13 Shu-Chun Weng via Qemu-devel
  2019-08-16 21:45 ` no-reply
  2019-08-16 22:37 ` Aleksandar Markovic
  0 siblings, 2 replies; 8+ messages in thread
From: Shu-Chun Weng via Qemu-devel @ 2019-08-16 21:13 UTC (permalink / raw)
  To: Riku Voipio, Laurent Vivier; +Cc: arunkaly, qemu-devel, Shu-Chun Weng

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 <scw@google.com>
---
 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



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-08-23 15:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-16 21:13 [Qemu-devel] [PATCH] Add support for ethtool via TARGET_SIOCETHTOOL ioctls Shu-Chun Weng via Qemu-devel
2019-08-16 21:45 ` no-reply
2019-08-16 22:37 ` Aleksandar Markovic
2019-08-17  0:04   ` Shu-Chun Weng via Qemu-devel
2019-08-17  0:05     ` mailer
2019-08-17  0:07   ` [Qemu-devel] [PATCH v2] linux-user: Add support for SIOCETHTOOL ioctl Shu-Chun Weng via Qemu-devel
2019-08-17  0:25     ` no-reply
2019-08-23 15:52     ` Laurent Vivier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).