All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: Aleksandar Rikalo <arikalo@wavecomp.com>,
	Riku Voipio <riku.voipio@iki.fi>,
	Laurent Vivier <laurent@vivier.eu>,
	Aleksandar Markovic <amarkovic@wavecomp.com>,
	Neng Chen <nchen@wavecomp.com>,
	Aurelien Jarno <aurelien@aurel32.net>
Subject: [Qemu-devel] [PULL v2 5/9] linux-user: Add support for SIOC<G|S>IFPFLAGS ioctls for all targets
Date: Fri, 24 May 2019 13:25:16 +0200	[thread overview]
Message-ID: <20190524112520.17684-6-laurent@vivier.eu> (raw)
In-Reply-To: <20190524112520.17684-1-laurent@vivier.eu>

From: Neng Chen <nchen@wavecomp.com>

Add support for getting and setting extended private flags of a
network device via SIOCSIFPFLAGS and SIOCGIFPFLAGS ioctls.

The ioctl numeric values are platform-independent and determined by
the file include/uapi/linux/sockios.h in Linux kernel source code:

  #define SIOCSIFPFLAGS 0x8934
  #define SIOCGIFPFLAGS	0x8935

These ioctls get (or set) the field ifr_flags of type short 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: Neng Chen <nchen@wavecomp.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <1554839486-3527-1-git-send-email-aleksandar.markovic@rt-rk.com>
Message-Id: <1558282527-22183-4-git-send-email-aleksandar.markovic@rt-rk.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 linux-user/ioctls.h       | 2 ++
 linux-user/syscall_defs.h | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
index 99ed9d982568..5e84dc7c3a77 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -206,6 +206,8 @@
   IOCTL(SIOCADDMULTI, IOC_W, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
   IOCTL(SIOCDELMULTI, IOC_W, MK_PTR(MK_STRUCT(STRUCT_sockaddr_ifreq)))
   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(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 9470a5ce965b..cb40620114f8 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -782,6 +782,8 @@ struct target_pollfd {
 #define TARGET_SIOCADDMULTI    0x8931          /* Multicast address lists      */
 #define TARGET_SIOCDELMULTI    0x8932
 #define TARGET_SIOCGIFINDEX    0x8933
+#define TARGET_SIOCSIFPFLAGS   0x8934          /* set extended flags          */
+#define TARGET_SIOCGIFPFLAGS   0x8935          /* get extended flags          */
 
 /* Bridging control calls */
 #define TARGET_SIOCGIFBR       0x8940          /* Bridging support             */
-- 
2.20.1



  parent reply	other threads:[~2019-05-24 11:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-24 11:25 [Qemu-devel] [PULL v2 0/9] Linux user for 4.1 patches Laurent Vivier
2019-05-24 11:25 ` [Qemu-devel] [PULL v2 1/9] linux-user: add pseudo /proc/cpuinfo for sparc Laurent Vivier
2019-05-24 11:25 ` [Qemu-devel] [PULL v2 2/9] linux-user: add pseudo /proc/hardware for m68k Laurent Vivier
2019-05-24 11:25 ` [Qemu-devel] [PULL v2 3/9] linux-user: Fix support for SIOCATMARK and SIOCGPGRP ioctls for xtensa Laurent Vivier
2019-05-24 11:25 ` [Qemu-devel] [PULL v2 4/9] linux-user: Add support for SIOCSPGRP ioctl for all targets Laurent Vivier
2019-05-24 11:25 ` Laurent Vivier [this message]
2019-05-24 11:25 ` [Qemu-devel] [PULL v2 6/9] linux-user: Sanitize interp_info and, for mips only, init field fp_abi Laurent Vivier
2019-05-24 11:25 ` [Qemu-devel] [PULL v2 7/9] linux-user: Fix shmat emulation by honoring host SHMLBA Laurent Vivier
2019-05-24 11:25 ` [Qemu-devel] [PULL v2 8/9] linux-user: Align mmap_find_vma to host page size Laurent Vivier
2019-05-24 11:25 ` [Qemu-devel] [PULL v2 9/9] linux-user: Pass through nanosecond timestamp components for stat syscalls Laurent Vivier
2019-05-24 12:27 ` [Qemu-devel] [PULL v2 0/9] Linux user for 4.1 patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190524112520.17684-6-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=amarkovic@wavecomp.com \
    --cc=arikalo@wavecomp.com \
    --cc=aurelien@aurel32.net \
    --cc=nchen@wavecomp.com \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.