From owner-freebsd-multimedia@FreeBSD.ORG Tue Jan 11 12:27:41 2011 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EA831065672 for ; Tue, 11 Jan 2011 12:27:41 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id C1A9D8FC13 for ; Tue, 11 Jan 2011 12:27:40 +0000 (UTC) Received: from outgoing.leidinger.net (p57B3B1C7.dip.t-dialin.net [87.179.177.199]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 120A7844012; Tue, 11 Jan 2011 13:12:27 +0100 (CET) Received: from webmail.leidinger.net (unknown [IPv6:fd73:10c7:2053:1::2:102]) by outgoing.leidinger.net (Postfix) with ESMTP id C688E28B0; Tue, 11 Jan 2011 13:12:18 +0100 (CET) Received: (from www@localhost) by webmail.leidinger.net (8.14.4/8.13.8/Submit) id p0BCBriX095767; Tue, 11 Jan 2011 13:11:53 +0100 (CET) (envelope-from Alexander@Leidinger.net) Received: from pslux.ec.europa.eu (pslux.ec.europa.eu [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Tue, 11 Jan 2011 13:11:53 +0100 Message-ID: <20110111131153.48321lqz8kxrsetc@webmail.leidinger.net> Date: Tue, 11 Jan 2011 13:11:53 +0100 From: Alexander Leidinger To: Hans Petter Selasky References: <20091204223126.00005392@unknown> <201001081650.14189.hselasky@c2i.net> <20100108114130.1cfe88c5@shibato.opal.com> <201101110947.46399.hselasky@c2i.net> In-Reply-To: <201101110947.46399.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4) X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 120A7844012.A807B X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=2.474, required 6, autolearn=disabled, J_CHICKENPOX_43 0.60, J_CHICKENPOX_52 0.60, RDNS_NONE 1.27) X-EBL-MailScanner-SpamScore: ss X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1295352748.28226@Dl+Jyo7m2AleW6J2evAyVA X-EBL-Spam-Status: No Cc: freebsd-multimedia@freebsd.org, emulation@freebsd.org, "J.R. Oldroyd" Subject: Re: FYI: v4l-linuxulator support in FreeBSD-current now X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jan 2011 12:27:41 -0000 Quoting Hans Petter Selasky (from Tue, 11 Jan 2011 09:47:46 +0100): > Hi, > > I've received the following patch for my cuse4bsd module. Could this be From Andrew Gallatin (gallatin@)? > included in the kernel's linux.ko ? This patch allows for linux DVB > applications running under FreeBSD linux emulation. Yes, but I would prefer the person who submitted it could test it before it is committed. Semi-OT: Are you sure the MODULE_DEPEND is not necessary for your module and should be included? Bye, Alexander. > --HPS > > Index: cuse4bsd_kmod.c > =================================================================== > --- cuse4bsd_kmod.c (revision 1700) > +++ cuse4bsd_kmod.c (working copy) > @@ -1689,3 +1689,49 @@ > > return (0); > } > + > + > +#include > +#if defined (__amd64__) > +#include > +#include > +#else > +#include > +#include > +#endif > + > +#include > +MODULE_DEPEND(cuse4bsd, linux, 1, 1, 1); > + > +#define DVB_LINUX_IOCTL_MIN 0x6f00 > +#define DVB_LINUX_IOCTL_MAX 0x6fff > + > + > +static linux_ioctl_function_t cuse4bsd_linux_ioctl; > +static struct linux_ioctl_handler cuse4bsd_linux_handler = > + {cuse4bsd_linux_ioctl, DVB_LINUX_IOCTL_MIN, DVB_LINUX_IOCTL_MAX}; > + > +SYSINIT (cuse4bsd_linux_register, SI_SUB_KLD, SI_ORDER_MIDDLE, > + linux_ioctl_register_handler, &cuse4bsd_linux_handler); > +SYSUNINIT(cuse4bsd_linux_unregister, SI_SUB_KLD, SI_ORDER_MIDDLE, > + linux_ioctl_unregister_handler, &cuse4bsd_linux_handler); > + > +static int > +cuse4bsd_linux_ioctl(struct thread *td, struct linux_ioctl_args *args) > +{ > + unsigned long cmd; > + > + /* swap the read/write bits, due to differences in bsd & linux ioctls*/ > + cmd = (unsigned long)args->cmd; > + if (cmd & (0x40 << 24)) { > + cmd &= 0xffffff; > + cmd |= (0x80 << 24); > + } else if (cmd & (0x80 << 24)) { > + cmd &= 0xffffff; > + cmd |= (0x40 << 24); > + } > + args->cmd = (l_uint)cmd; > + > + /* Pass the ioctl off to our standard handler, now that its valid */ > + return(ioctl(td, (struct ioctl_args *)args)); > +} > > -- Seems this guy showed up at a party, and all of his friends jumped for Joy. But she sidestepped, and they missed. http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137