From owner-freebsd-hackers@FreeBSD.ORG Fri Mar 28 10:57:23 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 17C8F37B401; Fri, 28 Mar 2003 10:57:23 -0800 (PST) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 67C1D43F93; Fri, 28 Mar 2003 10:57:21 -0800 (PST) (envelope-from ticso@cicely9.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [IPv6:3ffe:400:8d0:301:200:92ff:fe9b:20e7]) by srv1.cosmo-project.de (8.12.8/8.12.8) with ESMTP id h2SIv1gt095727 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Fri, 28 Mar 2003 19:57:15 +0100 (CET) (envelope-from ticso@cicely9.cicely.de) Received: from cicely9.cicely.de (cicely9.cicely.de [IPv6:3ffe:400:8d0:301:210:5aff:fe30:1c1a]) by cicely5.cicely.de (8.12.8/8.12.8) with ESMTP id h2SIuvGA050896 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 28 Mar 2003 19:56:58 +0100 (CET) (envelope-from ticso@cicely9.cicely.de) Received: from cicely9.cicely.de (localhost [127.0.0.1]) by cicely9.cicely.de (8.12.8/8.12.8) with ESMTP id h2SIuqkv033668; Fri, 28 Mar 2003 19:56:53 +0100 (CET) (envelope-from ticso@cicely9.cicely.de) Received: (from ticso@localhost) by cicely9.cicely.de (8.12.8/8.12.8/Submit) id h2SIupCg033667; Fri, 28 Mar 2003 19:56:52 +0100 (CET) Date: Fri, 28 Mar 2003 19:56:50 +0100 From: Bernd Walter To: Bill Paul Message-ID: <20030328185650.GK23168@cicely9.cicely.de> References: <20030328183858.7B2DB37B401@hub.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030328183858.7B2DB37B401@hub.freebsd.org> X-Operating-System: FreeBSD cicely9.cicely.de 5.0-CURRENT alpha User-Agent: Mutt/1.5.3i X-Spam-Status: No, hits=-32.5 required=5.0 tests=EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_MUTT autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) cc: ticso@cicely9.cicely.de cc: hackers@FreeBSD.ORG Subject: Re: Ax88172 vs FreeBSD USB stack 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: Fri, 28 Mar 2003 18:57:26 -0000 On Fri, Mar 28, 2003 at 10:38:58AM -0800, Bill Paul wrote: > > So. I picked up a Linksys USB200M USB 2.0 ethernet adapter that uses > the ASIX Electronics AX88172 chip, and I started cobbling together a > driver. This chip uses a series of vendor specific commands to do > things like read/write the MII management interface on the MAC, > read/write the SROM, set the RX filter, multicast hash table, etc. > I can do all this no problem. The Linksys NIC uses a RealTek 8201L > PHY, and I can attach it and negotiate a link. > > However I can't send or receive any packets. > > Like all the other USB NICs, packet transfer is supposed to done > via bulk in/bulk out endpoints, and I can open these endpoints > and initiate transfers just fine, but nothing ever happens. Transmit > attempts don't yield any packets on the wire, and I never get any > RX transfer completions. (I can see the activity LED on the NIC > blink when a frame arrives though.) One thing I have not attempted > to do yet (but may try this weekend) is to directly read the RX or > TX SRAM (there are commands to let you do this). > > Frankly, I'm a bit stumped. It looks as though I'm doing everything > correctly, but I can't explain why the bulk transfers don't work. > Clearly, the control endpoint works, since I can issue commands. There > doesn't appear to be any special command that one has to issue to > enable/disable the receiver or transmitter on the MAC. > > I have only one possible explanation. The manual for the AX88172 > (http://www.freebsd.org/~wpaul/ASIX/Ax88172.PDF) says the following: > > "The AX88172 supports 2 interfaces, the interface 0 is Data Interface > and interface 1 is for Communication interface." If that is true - the device has a strange design. Normaly devices use single interfaces with multiple commucations channels. An interface in USB wording is something like a virtual device - similar to functions on pci. E.g. you can have an umass device on interface 0 and a keyboard on interface 1. The FreeBSD USB stack supports mutltiple interfaces, but currently doesn't support probing different drivers for different interfaces on the same device. However you can try usbctl from usbutils to get an overview of the device. I have made a port, it is actually being reviewed by a port commiter, which you can get on: http://www.cosmo-project.de/~bernd/usbutil.tgz > However the USB stack disagrees with the manual on this point: it > steadfastly insists that configuration 1 has only 1 interface. So > my question, for any USB gurus out there, is: is it possible that > the USB stack is wrong on this point, and I really need to be > using interface 1 for bulk in/out transfers? I'm a little suspicious > at this point, because the stack can't seem to even read the > device ID string correctly. (It identifies the chip only as "vendor > 0x77b, device 0x2226".) Strange - let us see what usbctl says - it never failed for me. BTW: I doubt that USB 1.x vs USB 2.0 make a difference in the problem you are seeing, but in case you want to test later. The EHCI patch is available under: http://www.cosmo-project.de/~bernd/ehci.patch It is currently not tested against any device, but the controller probes fine and scanning the root hub (without devices) did not fail. -- B.Walter BWCT http://www.bwct.de ticso@bwct.de info@bwct.de