From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 28 10:15:40 2003 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 A66A116A4C0 for ; Thu, 28 Aug 2003 10:15:40 -0700 (PDT) Received: from Danovitsch.dnsq.org (b74143.upc-b.chello.nl [212.83.74.143]) by mx1.FreeBSD.org (Postfix) with ESMTP id D1F1643FBD for ; Thu, 28 Aug 2003 10:15:37 -0700 (PDT) (envelope-from Danovitsch@Vitsch.net) Received: from FreeBSD.Danovitsch.LAN (b83007.upc-b.chello.nl [212.83.83.7]) by Danovitsch.dnsq.org (8.12.3p2/8.11.3) with ESMTP id h7SH9Hqr096146; Thu, 28 Aug 2003 19:09:18 +0200 (CEST) (envelope-from Danovitsch@Vitsch.net) Content-Type: text/plain; charset="iso-8859-1" From: "Daan Vreeken [PA4DAN]" To: Stuart Walsh Date: Thu, 28 Aug 2003 19:15:44 +0200 User-Agent: KMail/1.4.3 References: <20030828132653.GD817@icecold.stu> In-Reply-To: <20030828132653.GD817@icecold.stu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200308281915.44317.Danovitsch@Vitsch.net> cc: FreeBSD-Hackers@FreeBSD.org Subject: Re: Atmel USB Wireless devices X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Aug 2003 17:15:40 -0000 On Thursday 28 August 2003 15:26, Stuart Walsh wrote: > Hi, > > Firstly, it would be interesting to know if anyone else is working on > support for these devices before I get too far into it :) Yes, I have bought a bunch of them about a month ago, and at this moment = I=20 have a working driver for them. At this moment it's still a "beta" which = can=20 only do ad-hoc mode, but it works. > I've started working on support for the above devices and have had some > limited success so far. The device requires two sets of firmware to be > uploaded for it to work and I have managed to upload the first firmware > but it doesnt seem to want to boot. Any attempts to read the device > after uploading firmware result in error code 13(IOERROR). The Linux > driver calls usb_reset_device() after uploading the firmware but I can'= t > seem to find an equivelant in FreeBSD. The problem is that the device really dies after uploading the internal=20 firmware. It really needs a reset before it will communicate again. A usb-hub can send a reset signal down it's ports with a call to : usbd_reset_port(sc->atuwi_udev->myhub,sc->atuwi_udev->powersrc->portno,&T= ); After that the atmel processor will start communicating again. But it's=20 usb-address will be set to 0 (as always after a reset). So you will have to (re)set it's address back to what it was before the r= eset=20 with a call to : usbd_set_address(sc->atuwi_udev,my_old_address); The story gets more complex since the descriptors of the device have chan= ged=20 by the reset. (first it only had a control endpoint, now it also has 2 bu= lk=20 endpoints). Somehow you'll have to reload the new descriptor to please th= e=20 kernel. I have come very far in this process, but I am doing something wrong with= =20 releasing the old descriptors... So at this moment I use a trick to reset= the=20 device. After uploading the internal firmware I unplug the USB connector just far= =20 enough for the data-lines to disconnect, but without disconnecting the=20 power-lines. After plugging the device back in the kernel recognizes it a= gain=20 and uploads the external firmware. I'll come back to this thread tomorrow and post some links to my code, bu= t I=20 have to run now. grtz, Daan