Subject: re-enumerating an USB device from within a device driver
To: None <tech-kern@netbsd.org>
From: Martijn van Buul <martijn.van.buul@gmail.com>
List: tech-kern
Date: 07/05/2004 09:43:12
Hello.

I'm trying to implement a device driver for the Atmel 76c50x series of
USB wireless LAN interfaces, and I've ran into problems. (Figures ;)

These devices lack flash for their internal firmware, and therefore
need to have it uploaded at every power cycle. For this purpose, they
use the DFU (Device Firmware Upgrade) framework, as specced in
http://www.usb.org/developers/devclass_docs/usbdfu10.pdf. So far, so
good.

I implemented a subset of the DFU protocol, enough to upload the
firmware to the device. However, the device needs to be reset and
re-enumerated after the firmware has been uploaded. How do I pull this
off under NetBSD? There are patches for FreeBSD floating around  to
achieve this, but they make use of the fact that the USB_ATTACH
routines under FreeBSD have a return value. Under Net they don't, so I
cannot go that way.

At the moment, I use a rather dirty trick to achieve the same result -
I partially remove the USB connector from the socket, disconnecting
the data lines while keeping the power lines connected. However, this
is rather inconvenient, and not easy to do when you don't have an easy
access to the host's USB ports.

Advice would be most welcome :)

-- 
Martijn van Buul, martijn.van.buul@gmail.com