From owner-freebsd-usb@FreeBSD.ORG Wed Jul 20 08:59:50 2011 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5512C106564A for ; Wed, 20 Jul 2011 08:59:50 +0000 (UTC) (envelope-from matt@chronos.org.uk) Received: from chronos.org.uk (chronos-pt.tunnel.tserv5.lon1.ipv6.he.net [IPv6:2001:470:1f08:12b::2]) by mx1.freebsd.org (Postfix) with ESMTP id B00A58FC1A for ; Wed, 20 Jul 2011 08:59:48 +0000 (UTC) Received: from workstation1.localnet (workstation1.local.chronos.org.uk [IPv6:2001:470:1f09:12b::20]) (authenticated bits=0) by chronos.org.uk (8.14.4/8.14.4) with ESMTP id p6K8xbud033705 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 20 Jul 2011 09:59:37 +0100 (BST) (envelope-from matt@chronos.org.uk) X-DKIM: Sendmail DKIM Filter v2.8.3 chronos.org.uk p6K8xbud033705 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=chronos.org.uk; s=mail; t=1311152378; bh=0nmdWO83lI3uON0q+wUh/o8CQTG70yTVMuNem8UaGEQ=; h=From:To:Subject:Date:Cc:References:In-Reply-To:MIME-Version: Content-Type:Content-Transfer-Encoding:Message-Id; b=JGLOw970a6cvs8SPNVIFAUhxJNC1P9KFeZpETNQGnUbJ8MnOxLEii3vwp/8xdhpzn zOaV3jNZ4OgYuWsHlGGAWQo1c9+WwEs1LMX2aCjyKsUV4ICcl8HmfMoCR5Yf0sUv81 DNxBt9tZds7xBuZWgJNDNhMS6FIS8A8meyOtxQk4= From: Matt Dawson To: Hans Petter Selasky Date: Wed, 20 Jul 2011 09:59:35 +0100 User-Agent: KMail/1.13.7 (FreeBSD/8.2-RELEASE; KDE/4.6.4; amd64; ; ) References: <201107191356.36832.matt@chronos.org.uk> <201107191513.17906.hselasky@c2i.net> In-Reply-To: <201107191513.17906.hselasky@c2i.net> X-Face: -a*{KS?gYyH>pt=1?H+(>B2Z'>b6WxX:^O@+VaMV>l\tOh@[x`#&AHSdl`m<-EEhk=1%t9iRthI|; ~8)mN@qxJ}x5l:zhDO( =?iso-8859-1?q?=2Eas=0A?= NeO!\oL7huHfsoF'I5,0G+Yo[G-G"FG,l`QJ$IgwH/[\a]vRH^'=`; cY+*_{Or` MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201107200959.36056.matt@chronos.org.uk> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (chronos.org.uk [IPv6:2001:470:1f09:12b::1]); Wed, 20 Jul 2011 09:59:38 +0100 (BST) X-Virus-Scanned: clamav-milter 0.97.1 at central.local.chronos.org.uk X-Virus-Status: Clean X-Spam-Status: No, score=-100.0 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_24_48,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_PASS, T_RP_MATCHES_RCVD,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on central.local.chronos.org.uk Cc: freebsd-usb@freebsd.org Subject: Re: Porting op to FreeBSD X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2011 08:59:50 -0000 On Tuesday 19 July 2011 14:13:17 Hans Petter Selasky wrote: > > http://sourceforge.net/projects/openprogrammer/files/OP/op_0.7.9. > > tar.gz > > > > to FreeBSD and have run into a brick wall (my lack of knowledge, > > basically). It uses Linux' hiddev to communicate with the > > OpenProgrammer hardware, which isn't compatible with our usbhid. > > The ioctls and structs are very different. The programmer itself > > has a uhidX device node and seems to be fine under FreeBSD. > > There are many ways to achieve your goal. The simplest one might be > to compile the Linux HID layer into the webcamd deamon and have a > compatible interface. This means no porting effort. Interesting, although it does introduce a dependency on webcamd which, for an otherwise small program, seems a little mad. > You will have to checkout and install the linux_make tool from the > I4B SVN, referred to from the webcamd > (/usr/ports/multimedia/webcamd) homepage: > > http://www.selasky.org/hans_petter/video4bsd/ > > And add some config entries to the config file for the HID layer, > and possibly also resolve a few compile issues. I suspect this is going to be the main issue. It pulls in hiddev.h for Linux directly and has no configure stage, so it expects those headers to be where they should be on a vanilla Linux box. It does compile under Windows/Cygwin with a conditional in the defines, so the dependency on hiddev is obviously portable. I'd much rather make it native and throw my changes back upstream. The whole point of this device is that it's open so it needs to run everywhere and that little CLI really is the bare bones. I have been in contact with the developer and he thinks getting read() and write() working is the main step and everything else is trivial. It's just translating those ioctl calls and structs to our usbhid that stumping me, simply because I don't understand what they do in either OS. I have an idea that the ioctls are simply to pull in the packet size for read and write operations but, beyond that, my clue chest is empty. I'll probably have to just bite the bullet, sit down and compare what it does in both Linux and Windows/Cygwin and then try to work out how to get the same results on FreeBSD. There's no being lazy, it seems! -- Matt Dawson MTD15-RIPE matt@chronos.org.uk