From owner-freebsd-usb@FreeBSD.ORG Wed Jul 24 20:09:56 2013 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0F4A770F for ; Wed, 24 Jul 2013 20:09:56 +0000 (UTC) (envelope-from damjan.jov@gmail.com) Received: from mail-we0-x230.google.com (mail-we0-x230.google.com [IPv6:2a00:1450:400c:c03::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9F0182949 for ; Wed, 24 Jul 2013 20:09:55 +0000 (UTC) Received: by mail-we0-f176.google.com with SMTP id q56so2506889wes.7 for ; Wed, 24 Jul 2013 13:09:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=CxVh4FM37XFA89y9A30gUaIX3U6k1Z9hqX4LVExcaZs=; b=IW/4p1eQ3d0biIsHhKTRId94ce9j9ioBMpO1rw3Ydk0EgGy+nZ1/ADdY36i9QltzvI y/m4DOa0a1BDgCL8/AsUmtzRzUwkd3fWVwQUk7GKT9PCmGmyEe1/prbDTTd1Yo6jh4SN Mhp/aopqGGHqJ7pxnc+XS+LOuePImop205xCwfqMhAKG6s86G3WGJh+2MrOFxhSs6TiS qwA3uGELf+05M4Xu8KQQw0zgLE4td1twRKpSpbL7k6MDNLVwjQn+nh52vlHwFGqHsK4C 8u3ABonm6vnjiuKTVHWdw/TYOb6yhV0rCRE/iGIbn3ox1Uk8MLWqstyt4o4b4gbtC2MX 6EDQ== X-Received: by 10.180.39.136 with SMTP id p8mr3950367wik.11.1374696593659; Wed, 24 Jul 2013 13:09:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.181.10 with HTTP; Wed, 24 Jul 2013 13:09:33 -0700 (PDT) From: Damjan Jovanovic Date: Wed, 24 Jul 2013 20:09:33 +0000 Message-ID: Subject: COMPAT_32BIT libusb ABI problem To: freebsd-usb@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 20:09:56 -0000 Hi The ioctl: #define USB_FS_INIT _IOW ('U', 195, struct usb_fs_init) when used by a COMPAT_32BIT libusb on amd64, fails (causing libusb_open() to fail) due to: freebsd32_ioctl(0x6,0x800c55c3,0xffffc710,0x0,0x0,0x0) ERR#25 'Inappropriate ioctl for device' but when hacked a bit: freebsd32_ioctl(0x6,0x801055c3,0xffffc710,0x0,0x0,0x0) = 0 (0x0) because sizeof(struct usb_fs_init) is 12 bytes on i386, and 16 bytes on amd64. But the failure of even libusb_open() - a fundamental libusb function - must mean that the COMPAT_32BIT libusb never worked. Can we please take this opportunity to kill it and do a real 32 bit compatibility layer in the kernel that will work from 32 bit chroots and statically linked 32 bit binaries? I'll help. Regards Damjan