USB stack / configuration 0

Bernd Walter ticso at cicely12.cicely.de
Wed Jan 7 22:02:29 PST 2004


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 at bwct.de                                  info at bwct.de



More information about the freebsd-hackers mailing list