From owner-freebsd-current@FreeBSD.ORG Fri Sep 21 17:39:47 2007 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D06316A41A for ; Fri, 21 Sep 2007 17:39:47 +0000 (UTC) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.freebsd.org (Postfix) with ESMTP id 36EDC13C4AA for ; Fri, 21 Sep 2007 17:39:47 +0000 (UTC) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.13.6) with ESMTP id l8LHcTR8044165 for ; Fri, 21 Sep 2007 10:38:29 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id l8LHcTsM044164 for current@freebsd.org; Fri, 21 Sep 2007 10:38:29 -0700 (PDT) (envelope-from rizzo) Date: Fri, 21 Sep 2007 10:38:29 -0700 From: Luigi Rizzo To: current@freebsd.org Message-ID: <20070921103829.A43801@xorpc.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Cc: Subject: Why USB must be so hard to use ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2007 17:39:47 -0000 i recently tried to attach one of the Openbeacon USB devices http://wiki.openbeacon.org/wiki/OpenBeacon_USB to a -stable box, and "of course" attach failed, even though the same thing is claimed to work right away on Linux and XP without any special driver. It wasn't too hard to convince umodem.c to attach to the device, but i had to put the ids in the list of devices explicitly recognised, and further disable the extra check for capabilities at the end of umodem.c::USB_MATCH (or umodem_match in -current). The device itself returns a class UICLASS_CDC, but subclass and protocol are 0, i.e. this is a very basic serial device as probably many gadget we are going to see in the future. Now i wonder: why dealing with usb peripherals in FreeBSD must be so hard, and nothing works out of the box ? In many cases it is really because we are too strict in making checks, or because our system to embed device IDs in the driver is unaccessible to the average user/sysadmin. Can we try to relax a bit the checks in the code (inherited from some other BSD) that probes peripherals so it is more tolerant to small differences in the features of peripherals, and provides an easier way to tweak device tables ? Over the last year, once i have gathered a bit more familiarity with the USB code, i managed to make a number of peripherals (cameras, scanners, various usb memory or mp3 players) work on FreeBSD and in several cases it was just a matter of a few lines of code. Hopefully, my patches are going in the tree in some way (linux_kmod_compat) or another (patches waiting to be committed), but the process is slow because, I suppose, all of us are still a bit nervous about relaxing checks in the code. I understand being careful, but if we keep being so strict in what our driver accept (and sometimes i wonder if they ever worked on more than a single specific device!) FreeBSD will get a reputation for having an unusable USB subsystem, and this drives away many workstation users. cheers luigi