Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jan 2004 07:01:57 +0100
From:      Bernd Walter <ticso@cicely12.cicely.de>
To:        "Daan Vreeken [PA4DAN]" <Danovitsch@Vitsch.net>
Cc:        ticso@cicely.de
Subject:   Re: USB stack / configuration 0
Message-ID:  <20040108060156.GH47728@cicely12.cicely.de>
In-Reply-To: <200401071104.37461.Danovitsch@Vitsch.net>
References:  <3FFA04A8.30601@evilrealms.net> <200401071734.05764.doconnor@gsoft.com.au> <20040107080720.GH45569@cicely12.cicely.de> <200401071104.37461.Danovitsch@Vitsch.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040108060156.GH47728>