From owner-freebsd-usb@FreeBSD.ORG Fri Dec 2 08:59:52 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B3B5316A41F; Fri, 2 Dec 2005 08:59:52 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2342443D4C; Fri, 2 Dec 2005 08:59:52 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.3/8.13.3) with ESMTP id jB28ux6V067404; Fri, 2 Dec 2005 01:57:00 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 02 Dec 2005 01:57:36 -0700 (MST) Message-Id: <20051202.015736.66169514.imp@bsdimp.com> To: fierykylin@gmail.com From: "M. Warner Losh" In-Reply-To: <87ab37ab0512020030u2dcdc3ecj69fa27ec6840ca3b@mail.gmail.com> References: <20051201.231433.32736713.imp@bsdimp.com> <20051202.003353.21274600.imp@bsdimp.com> <87ab37ab0512020030u2dcdc3ecj69fa27ec6840ca3b@mail.gmail.com> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Fri, 02 Dec 2005 01:57:00 -0700 (MST) Cc: jhb@freebsd.org, freebsd-usb@freebsd.org Subject: Re: the mechanism of USB hotplug 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: Fri, 02 Dec 2005 08:59:52 -0000 In message: <87ab37ab0512020030u2dcdc3ecj69fa27ec6840ca3b@mail.gmail.com> kylin writes: : thank u,sir :) : i have been reading ur pccbb code for a long time . really : elegant.here I think my ignorace is partly because the lack of reading : to the doc about the generic device architecture .but frankly ,i : still haven't fount the newbus-draft :( Your best best is to look at the source and understand it. I'll be the first to admit, however, that better docs would help here. The FreeBSD handbook has good info on this topic, even if it is a little dated. : mention to pccbb ,i wonder the reason why pccard driver is so : different from the cardbus and still attach to the same pci carbus : bridge level . pccard and cardbus are way different. The interfaces for talking to them are different, the configuraiton is different, etc. CardBus cards are just PCI cards, with a few rare exceptions. So rare, in fact, that no one has brought one to my attention as needing special handling for CardBus vs PCI. Since we inheret from the pci bus for cardbus, that makes cardbus very small. It should be a little smaller than it is today, but I've not had the time to do that. pccard has to do it all on its own, as it is nothing like PCI. Since it is basically ISA in a hotplug form factor that also allows other similar cards (memory only), there are a number of warts in the code. Since ISA has no notion of hot plug or announcing its resource needs or device activation, the CIS has to be parsed to get these details (this predates the isapnp go, but even that doesn't support hotplug). I suspect that if one were to write a hot-plug PCI bus bridge that it would mostly work similar to cbb, but with some differences due to API differences. The USB stuff, btw, is confusingly located in uhub.c. There are a number of bugs in the newbus integration of usb, and various people have tried to fix it. In usbland uhub is the bus, not the usb device, which is confusing at first, and poorly documented. The usb_port.h obfuscation also doesn't help. Warner