From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 7 22:02:29 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 09A8716A4CE for ; Wed, 7 Jan 2004 22:02:29 -0800 (PST) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 95D6743D45 for ; Wed, 7 Jan 2004 22:02:26 -0800 (PST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [IPv6:3ffe:400:8d0:301:200:92ff:fe9b:20e7]) (authenticated bits=0) i0862AN1014665 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Thu, 8 Jan 2004 07:02:17 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [IPv6:3ffe:400:8d0:301::12]) by cicely5.cicely.de (8.12.10/8.12.10) with ESMTP id i086204H010888 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 8 Jan 2004 07:02:01 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.10/8.12.10) with ESMTP id i08620BE050977; Thu, 8 Jan 2004 07:02:00 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.10/8.12.10/Submit) id i0861vt4050976; Thu, 8 Jan 2004 07:01:57 +0100 (CET) (envelope-from ticso) Date: Thu, 8 Jan 2004 07:01:57 +0100 From: Bernd Walter To: "Daan Vreeken [PA4DAN]" Message-ID: <20040108060156.GH47728@cicely12.cicely.de> References: <3FFA04A8.30601@evilrealms.net> <200401071734.05764.doconnor@gsoft.com.au> <20040107080720.GH45569@cicely12.cicely.de> <200401071104.37461.Danovitsch@Vitsch.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200401071104.37461.Danovitsch@Vitsch.net> X-Operating-System: FreeBSD cicely12.cicely.de 5.2-CURRENT alpha User-Agent: Mutt/1.5.4i X-Spam-Status: No, hits=-4.9 required=3.0 tests=BAYES_00 autolearn=ham version=2.61 X-Spam-Report: * -4.9 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] X-Spam-Checker-Version: SpamAssassin 2.61 (1.212.2.1-2003-12-09-exp) on cicely5.cicely.de cc: Bernd Walter cc: FreeBSD-hackers@freebsd.org cc: ticso@cicely.de Subject: Re: USB stack / configuration 0 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jan 2004 06:02:29 -0000 On Wed, Jan 07, 2004 at 11:04:37AM +0100, Daan Vreeken [PA4DAN] wrote: > For the device this means having to switch the ROM image with the RAM image > which is impossible while running in the specific processor. Thus the > processor tells it's core to map RAM into code-space and resets itself. After > that the device will apear again with address = 0. > The host then needs to set the address, re-read the device descriptor (it has > changes, the device now offers endpoints etc), attach a driver. > > Btw, a reset can be sent down to a usb device from within a driver with this > line of code : > > usb_port_status_t stat; > > usbd_reset_port(sc->atuwi_udev->myhub, > sc->atuwi_udev->powersrc->portno, &stat); Im mostly worried about having more than a single device with address 0. You can't do this as long as another device gets initialized. Therefor I thought disabling/enabling the port would be better, but I'm wrong as the result is be the same. > For my device driver I have made a small change to the USB Stack and I have > introduced the return code "USB_ATTACH_NEED_RESET" for drivers to tell the > USB Stack thee device needs to be re-enumerated. The stack then automatically > re-assigns the device it's address, and re-probes for drivers. This way even > two seperate drivers could be made : one with the firmware and one with the > real driver. > Is anyone interrested in a patch maybe? Sounds interesting. -- B.Walter BWCT http://www.bwct.de ticso@bwct.de info@bwct.de