From owner-freebsd-usb@FreeBSD.ORG Wed May 28 05:13:45 2008 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 7755C106567B for ; Wed, 28 May 2008 05:13:45 +0000 (UTC) (envelope-from mwm-dated-1212814036.fceb38@mired.org) Received: from mired.org (five.mired.org [66.92.153.75]) by mx1.freebsd.org (Postfix) with ESMTP id 1814A8FC13 for ; Wed, 28 May 2008 05:13:44 +0000 (UTC) (envelope-from mwm-dated-1212814036.fceb38@mired.org) Received: (qmail 76980 invoked by uid 1001); 28 May 2008 00:47:16 -0400 Received: from bhuda.mired.org (bhuda [192.168.195.1]) by bhuda (tmda-ofmipd) with ESMTP; Wed, 28 May 2008 00:47:15 -0400 Date: Wed, 28 May 2008 00:47:14 -0400 To: freebsd-usb@FreeBSD.org Message-ID: <20080528004714.09b6cb44@bhuda.mired.org> Organization: Meyer Consulting X-Mailer: Claws Mail 3.4.0 (GTK+ 2.12.9; amd64-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Mike Meyer Cc: Subject: Need a ugen instead of a umass.... 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, 28 May 2008 05:13:45 -0000 I have a problem with the way devices are assigned to interfaces in FreeBSD (through -7, anyway). In usb_subr.c, usb_probe_and_attach loops through the interfaces trying various drivers. When that's done, if no drivers attached to any interfaces, it attaches a generic interface to the device. This is probably fine for most devices, but creates problems for modern multi-purpose printers (probably among others). In particular, the hplip port drives the hp multipurpose printer/scanners, letting you print and scan from any of the. The scanner has to have the ugen interface. Not a serious problem for some of the printers, assuming you don't have any other ulpt devices - you can just make sure you don't enable ulpt, and the hplip port will drive the printer through ugen as well. But things could be better. However, for some of the hp printers - the PhotoSmart line - come with builtin card readers, and magic in the printer to print sheets of thumbnails from the cards. Personally, I don't find it all that useful - but it means the printer has a umass interface. So if I disable ulpt, I *still* don't get a ugen device, because the printer gets the umass device. Turning off USB disks is quite a bit more inconvenient than turning off usb printers. Ok, first question, but a long shot: is there some other way around this? I.e. - can I get a da device out of a ugen that's actually a umass without the umass driver? Which leads to the real question: it looks like it shouldn't be hard to change usb_probe_and_attach to either 1) allocate a ugen for every interface, whether something else has it or not, or 2) allocate a ugen for every interface that didn't have another driver attach to it. What would break if I did #1 (multiple devices using the same interface sounds like a recipe for trouble)? How about #2? That looks safe enough - I'd have a ugen & umass where I now have a ulpt and a umass. But maybe there's some deep reason that things behave the way they do, and I really need to understand that before working on this? Thanks, http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. O< ascii ribbon campaign - stop html mail - www.asciiribbon.org