From owner-freebsd-emulation@FreeBSD.ORG Sat May 7 09:48:49 2011 Return-Path: Delivered-To: emulation@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 945FD1065672 for ; Sat, 7 May 2011 09:48:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id BFD438FC17 for ; Sat, 7 May 2011 09:48:48 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id MAA06032 for ; Sat, 07 May 2011 12:48:47 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1QIe7z-0004Ba-6S for emulation@FreeBSD.org; Sat, 07 May 2011 12:48:47 +0300 Message-ID: <4DC5157E.2020606@FreeBSD.org> Date: Sat, 07 May 2011 12:48:46 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110503 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: emulation@FreeBSD.org X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=X-VIET-VPS Content-Transfer-Encoding: 7bit Cc: Subject: pls review: dummy handlers for linux wlan ioctls X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2011 09:48:49 -0000 The purpose of this code is just to reduce amount of noise produced when some software uses those ioctls (e.g. newer Skype). All ioctls return ENOTSUP. linux emu: add dummy handler for ioctls related to wireless interfaces diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index 63f6888..7d90402 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -110,6 +110,7 @@ static linux_ioctl_function_t linux_ioctl_v4l; static linux_ioctl_function_t linux_ioctl_v4l2; static linux_ioctl_function_t linux_ioctl_special; static linux_ioctl_function_t linux_ioctl_fbsd_usb; +static linux_ioctl_function_t linux_ioctl_wlan; static struct linux_ioctl_handler cdrom_handler = { linux_ioctl_cdrom, LINUX_IOCTL_CDROM_MIN, LINUX_IOCTL_CDROM_MAX }; @@ -139,6 +140,8 @@ static struct linux_ioctl_handler video2_handler = { linux_ioctl_v4l2, LINUX_IOCTL_VIDEO2_MIN, LINUX_IOCTL_VIDEO2_MAX }; static struct linux_ioctl_handler fbsd_usb = { linux_ioctl_fbsd_usb, FBSD_LUSB_MIN, FBSD_LUSB_MAX }; +static struct linux_ioctl_handler wlan_handler = +{ linux_ioctl_wlan, LINUX_IOCTL_WLAN_MIN, LINUX_IOCTL_WLAN_MAX }; DATA_SET(linux_ioctl_handler_set, cdrom_handler); DATA_SET(linux_ioctl_handler_set, vfat_handler); @@ -154,6 +157,7 @@ DATA_SET(linux_ioctl_handler_set, sg_handler); DATA_SET(linux_ioctl_handler_set, video_handler); DATA_SET(linux_ioctl_handler_set, video2_handler); DATA_SET(linux_ioctl_handler_set, fbsd_usb); +DATA_SET(linux_ioctl_handler_set, wlan_handler); struct handler_element { @@ -2598,6 +2602,24 @@ linux_ioctl_private(struct thread *td, struct linux_ioctl_args *args) } /* + * Wireless interface ioctl handler + */ +static int +linux_ioctl_wlan(struct thread *td, struct linux_ioctl_args *args) +{ + struct file *fp; + int error, type; + + if ((error = fget(td, args->fd, &fp)) != 0) + return (error); + type = fp->f_type; + fdrop(fp, td); + if (type == DTYPE_SOCKET) + return (ENOTSUP); + return (ENOIOCTL); +} + +/* * DRM ioctl handler (sys/dev/drm) */ static int diff --git a/sys/compat/linux/linux_ioctl.h b/sys/compat/linux/linux_ioctl.h index a7ecbab..24b8d88f 100644 --- a/sys/compat/linux/linux_ioctl.h +++ b/sys/compat/linux/linux_ioctl.h @@ -257,6 +257,13 @@ #define LINUX_IOCTL_PRIVATE_MAX LINUX_SIOCDEVPRIVATE+0xf /* + * Wireless interfaces ioctl calls + */ +#define SIOCGIWNAME 0x8b01 +#define LINUX_IOCTL_WLAN_MIN 0x8b00 +#define LINUX_IOCTL_WLAN_MAX 0x8bff + +/* * sound */ #define LINUX_SOUND_MIXER_WRITE_VOLUME 0x4d00 -- Andriy Gapon