From owner-freebsd-usb@FreeBSD.ORG Sun Feb 4 01:06:15 2007 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 81E2416A401 for ; Sun, 4 Feb 2007 01:06:15 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe12.swip.net [212.247.155.97]) by mx1.freebsd.org (Postfix) with ESMTP id 22EED13C494 for ; Sun, 4 Feb 2007 01:06:14 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [193.217.102.48] (account mc467741@c2i.net HELO [10.0.0.249]) by mailfe12.swip.net (CommuniGate Pro SMTP 5.0.12) with ESMTPA id 231861725; Sun, 04 Feb 2007 01:04:20 +0100 From: Hans Petter Selasky To: freebsd-usb@freebsd.org, fred Date: Sun, 4 Feb 2007 01:03:59 +0100 User-Agent: KMail/1.9.5 References: <200702031650.l13GoOZR036880@freefall.freebsd.org> In-Reply-To: <200702031650.l13GoOZR036880@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200702040103.59530.hselasky@c2i.net> Cc: Subject: Re: usb/107496: USB device problem on RELENG_6_2 (SHORT_XFER) (regression) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Feb 2007 01:06:15 -0000 Hi Fred! On Saturday 03 February 2007 17:50, fred wrote: > The following reply was made to PR usb/107496; it has been noted by GNATS. > > From: fred > To: bug-followup@FreeBSD.org > Cc: > Subject: Re: usb/107496: USB device problem on RELENG_6_2 (SHORT_XFER) > (regression) Date: Sat, 03 Feb 2007 17:27:36 +0100 > > Hi, > > I submit a followup because I wan to add some useful information > concerning my problem. > > First of all, whith EHCI device disabled in kern conf, it works fine. > > Second, I have these problems with my two flash drives, Kingston & > Corsair: > > Kingston DataTraveler: 0x08ec:0008 > > Corsair FlashVoyager: 0x067b:2515/2517 > > Third, I have testet HPS fix > > (http://groups.google.com/group/lucky.freebsd.hardware/browse_frm/thread/9a >46031ab186cfa8/6237d337d9d7cb04#6237d337d9d7cb04) but it still fails. What SVN/P4 version did you test? Recently I have added a lot of sync code to help out on non-x86 processors. What kind of processor are you using? Could you do something like "sysctl hw.usb.debug=15" before you plug your memory sticks. Then afterwards "sysctl hw.usb.debug=0". Post or send me the resulting debug output. > usb2: on ehci0 > usb0: USB revision 1.0 > usb1: USB revision 1.0 > usb2: USB revision 2.0 > usbd_fill_iface_data: invalid wMaxPacketSize=0x0000, addr=126! > usbd_fill_iface_data: invalid wMaxPacketSize=0x0000, addr=126! > usbd_fill_iface_data: invalid wMaxPacketSize=0x0000, addr=126! This error clearly indicates that something is wrong. wMaxPacketSize should never be zero with a few rare exceptions. > uhub_explore: usb_new_device failed, error=USBD_TIMEOUT > uhub2: device problem (USBD_TIMEOUT), disabling port 6 > The transfer timed out. How nice. --HPS From owner-freebsd-usb@FreeBSD.ORG Sun Feb 4 01:32:39 2007 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3124D16A403 for ; Sun, 4 Feb 2007 01:32:39 +0000 (UTC) (envelope-from jessy@muenchen-mail.de) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by mx1.freebsd.org (Postfix) with ESMTP id BCD0F13C4AA for ; Sun, 4 Feb 2007 01:32:38 +0000 (UTC) (envelope-from jessy@muenchen-mail.de) Received: from mail01.m-online.net (svr21.m-online.net [192.168.3.149]) by mail-out.m-online.net (Postfix) with ESMTP id F20009893F for ; Sun, 4 Feb 2007 02:12:07 +0100 (CET) Received: from svr5.m-online.net (svr5.m-online.net [62.245.150.167]) by mail.mnet-online.de (Postfix) with ESMTP id E624990F77 for ; Sun, 4 Feb 2007 02:12:07 +0100 (CET) Received: (from wmrun@localhost) by svr5.m-online.net (8.13.6/8.12.6/Submit) id l141C7n5003526 for freebsd-usb@freebsd.org; Sun, 4 Feb 2007 02:12:07 +0100 Received: from 62.245.240.8 ( [62.245.240.8]) as user jessy@muenchen-mail.de@pop.mnet-online.de by webmail.mnet-online.de with HTTP; Sun, 04 Feb 2007 02:12:07 +0100 Message-ID: <1170551527.45c532e7906d1@webmail.mnet-online.de> Date: Sun, 04 Feb 2007 02:12:07 +0100 From: jessy@muenchen-mail.de To: freebsd-usb@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.0 X-Originating-IP: 62.245.240.8 X-Auth-Info: QIg6F5QsFFHB5B9Uh0ADRSH1OKNEJW7loYiCo1ALZqw= Subject: Sending to ulpt0 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Feb 2007 01:32:39 -0000 Good day, I have asked this question at some other places as well but haven't gotten a single useful answer. Searches made no results, besides I don't really know what to look for. My parents recently bought a Laserjet 1018 printer and I want(ed) to install it under FreeBSD 6.1. I found foo2zjs wich is a driver collection for GDI-printers. Well the driver works fine, besides a single problem, which is the worst of all: The printer needs its firmware sent every time it powers up. I can do this by booting windows and using the Windows-driver to print a page. Then the computer freezes and I need to reset. Sick :) But then the printer starts working, no matter which OS. I can plug it into the other PC and it prints. I switch it off and back on and it stops working. The manual for foo2zjs instructs to send the firmware with cat /usr/share...hp1018.lp >/dev/ulpt0 to the printer, which leads to a timeout (Device busy) I tried all possible things, recompiling without tcp over serial interface, which is said to eat up the device, plugging back and forth which doesnt make a difference. I also found a patch for ulpt.c which is supposed to fix the problem, but no avail. I just can't cat to /dev/ulpt0 or /dev/unlpt0. >From my amateur point of view I have two options: 1. Send the firmware directly to the usb-port the printer cable is attached to instead of invoking the driver or 2. detaching the driver from the usb-port, sending the firmware over a generic usb driver and re-attaching the ulpt driver Unfortunately I have no single clue how to do this :( Can somebody give me a hint if this can be done and if so, how? Or maybe there is a simple solution avoiding this problem? Thanks in advance for your efforts! Jessy From owner-freebsd-usb@FreeBSD.ORG Sun Feb 4 07:30:06 2007 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EB5A416A402 for ; Sun, 4 Feb 2007 07:30:06 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (c220-239-3-125.belrs4.nsw.optusnet.com.au [220.239.3.125]) by mx1.freebsd.org (Postfix) with ESMTP id 4BE0213C474 for ; Sun, 4 Feb 2007 07:30:06 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by turion.vk2pj.dyndns.org (8.13.8/8.13.8) with ESMTP id l146rjSH019597; Sun, 4 Feb 2007 17:53:46 +1100 (EST) (envelope-from peter@turion.vk2pj.dyndns.org) Received: (from peter@localhost) by turion.vk2pj.dyndns.org (8.13.8/8.13.8/Submit) id l146rjaw019596; Sun, 4 Feb 2007 17:53:45 +1100 (EST) (envelope-from peter) Date: Sun, 4 Feb 2007 17:53:45 +1100 From: Peter Jeremy To: jessy@muenchen-mail.de Message-ID: <20070204065345.GB19401@turion.vk2pj.dyndns.org> References: <1170551527.45c532e7906d1@webmail.mnet-online.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="a8Wt8u1KmwUX3Y2C" Content-Disposition: inline In-Reply-To: <1170551527.45c532e7906d1@webmail.mnet-online.de> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.13 (2006-08-11) Cc: freebsd-usb@freebsd.org Subject: Re: Sending to ulpt0 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Feb 2007 07:30:07 -0000 --a8Wt8u1KmwUX3Y2C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, 2007-Feb-04 02:12:07 +0100, jessy@muenchen-mail.de wrote: My >parents recently bought a Laserjet 1018 printer and I want(ed) to =2E.. >other PC and it prints. I switch it off and back on and it stops working. = The >manual for foo2zjs instructs to send the firmware with cat >/usr/share...hp1018.lp >/dev/ulpt0 to the printer, which leads to a timeout >(Device busy) I'm not aware of that printer specifically so the following is just general comments on the problem. It is possible that downloading the firmware actually requires a handshake sequence of some sort and your attempt to cat to the printer is failing because nothing is reading the return data. There is a lot of debugging infrastructure in the USB code. In order to enable this, you would need to rebuild your kernel with options USB_DEBUG in the your config file. Debug output is then controlled by a number of sysctl's but controlling and interpreting the debug output needs reference to the source code. >2. detaching the driver from the usb-port, sending the firmware over a gen= eric >usb driver and re-attaching the ulpt driver The only way to stop ulpt grabbing the printer is to remove it from the kernel. ulpt is compiled into GENERIC, making this difficult. Assuming you have ulpt as a kld, the process is: - Unplug printer from computer (releasing ultp0) - kldunload ulpt - Re-connect printer (which will attach as ugen0) - Play with printer via ugen - Unplug printer from computer (releasing ugen0) - kldload ulpt - Re-connect printer (which will attach as ulpt0) --=20 Peter Jeremy --a8Wt8u1KmwUX3Y2C Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFFxYL5/opHv/APuIcRAlMSAKCfZYWF8B+bNeKLYnQL7N4SgBBw3gCgiPxl 7OQeDEGXnGjq5du4qBzHUQA= =Ob6S -----END PGP SIGNATURE----- --a8Wt8u1KmwUX3Y2C-- From owner-freebsd-usb@FreeBSD.ORG Sun Feb 4 14:56:04 2007 Return-Path: X-Original-To: usb@freebsd.org Delivered-To: freebsd-usb@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5BF5E16A400 for ; Sun, 4 Feb 2007 14:56:04 +0000 (UTC) (envelope-from leafy7382@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.175]) by mx1.freebsd.org (Postfix) with ESMTP id E72C313C4B4 for ; Sun, 4 Feb 2007 14:56:03 +0000 (UTC) (envelope-from leafy7382@gmail.com) Received: by ug-out-1314.google.com with SMTP id o2so1059727uge for ; Sun, 04 Feb 2007 06:56:02 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=hXNKpOkjqW5e45vYyMVwag9uM1rYtFUupOfL8A+Di3BUZqJ0fjFr1tQt3iwd026keuaUBTTu1sQ4th3Qxw7C6tEjwnhsnVBAfcN1/fXR/hoz8IQY/POUYSiv0Z4MfAEaTor3PRNxr9io752QkgTvZrBVYAAooGoC/sK4agq//JA= Received: by 10.78.131.8 with SMTP id e8mr992999hud.1170599353145; Sun, 04 Feb 2007 06:29:13 -0800 (PST) Received: by 10.78.164.9 with HTTP; Sun, 4 Feb 2007 06:29:13 -0800 (PST) Message-ID: Date: Sun, 4 Feb 2007 22:29:13 +0800 From: "Jiawei Ye" To: "M. Warner Losh" In-Reply-To: <20070203.104000.756908884.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070130170443.A49225@xorpc.icir.org> <499c70c0702030850v14e02dfck7a0b91e1cc6deb9b@mail.gmail.com> <20070203.104000.756908884.imp@bsdimp.com> Cc: usb@freebsd.org, rizzo@icir.org, current@freebsd.org, almarrie@gmail.com Subject: Re: Call for Testers: FreeBSD webcam driver (and more) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Feb 2007 14:56:04 -0000 On 2/4/07, M. Warner Losh wrote: > In message: <499c70c0702030850v14e02dfck7a0b91e1cc6deb9b@mail.gmail.com> > "Abdullah Ibn Hamad Al-Marri" writes: > : and other things like CardReader for laptops ..etc, thank you for > > CardReader? What's that? > > SD/MMC support for laptops is on its way... > > Warner I guess he is referring to the smarcard readers some laptops have. Jiawei -- "If it looks like a duck, walks like a duck, and quacks like a duck, then to the end user it's a duck, and end users have made it pretty clear they want a duck; whether the duck drinks hot chocolate or coffee is irrelevant." From owner-freebsd-usb@FreeBSD.ORG Sun Feb 4 16:03:55 2007 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0100816A406 for ; Sun, 4 Feb 2007 16:03:55 +0000 (UTC) (envelope-from argentoff@rtelekom.ru) Received: from mail.rtelekom.ru (mail.rtelekom.ru [217.146.40.129]) by mx1.freebsd.org (Postfix) with ESMTP id 75F0B13C4A3 for ; Sun, 4 Feb 2007 16:03:54 +0000 (UTC) (envelope-from argentoff@rtelekom.ru) Received: from mail.rtelekom.ru (localhost.rtelekom.net [127.0.0.1]) by uranus.rtelekom.net (Postfix) with ESMTP id 73AC460A9 for ; Sun, 4 Feb 2007 18:45:53 +0300 (MSK) Received: from 40.14.dial.rtelekom.net (40.14.dial.rtelekom.net [217.146.40.14]) by uranus.rtelekom.net (Postfix) with ESMTP id DD14B606E for ; Sun, 4 Feb 2007 18:45:50 +0300 (MSK) From: Pavel Argentov Organization: Ratmir-TeleKom To: freebsd-usb@freebsd.org Date: Sun, 4 Feb 2007 18:45:50 +0300 User-Agent: KMail/1.9.4 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200702041845.51090.argentoff@rtelekom.ru> X-Virus-Scanned: ClamAV using ClamSMTP by uranus.rtelekom.net [217.146.40.129] Subject: kernel: ucom0: ucomwritecb: IOERROR X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: argentoff@rtelekom.ru List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Feb 2007 16:03:55 -0000 Hello world. It looks like I've came across a good ol' PR kern/86763. Only that now things happen under 6.2-RELEASE. http://lists.freebsd.org/pipermail/freebsd-bugs/2005-September/014921.html -- SY, Paul. From owner-freebsd-usb@FreeBSD.ORG Sun Feb 4 19:58:16 2007 Return-Path: X-Original-To: usb@freebsd.org Delivered-To: freebsd-usb@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0D49316A402; Sun, 4 Feb 2007 19:58:16 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id BCDEF13C467; Sun, 4 Feb 2007 19:58:15 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id l14Ju7uY016207; Sun, 4 Feb 2007 12:56:08 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 04 Feb 2007 12:56:41 -0700 (MST) Message-Id: <20070204.125641.1219856867.imp@bsdimp.com> To: leafy7382@gmail.com From: "M. Warner Losh" In-Reply-To: References: <499c70c0702030850v14e02dfck7a0b91e1cc6deb9b@mail.gmail.com> <20070203.104000.756908884.imp@bsdimp.com> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Sun, 04 Feb 2007 12:56:08 -0700 (MST) Cc: usb@freebsd.org, rizzo@icir.org, current@freebsd.org, almarrie@gmail.com Subject: Re: Call for Testers: FreeBSD webcam driver (and more) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Feb 2007 19:58:16 -0000 In message: "Jiawei Ye" writes: : On 2/4/07, M. Warner Losh wrote: : > In message: <499c70c0702030850v14e02dfck7a0b91e1cc6deb9b@mail.gmail.com> : > "Abdullah Ibn Hamad Al-Marri" writes: : > : and other things like CardReader for laptops ..etc, thank you for : > : > CardReader? What's that? : > : > SD/MMC support for laptops is on its way... : > : > Warner : I guess he is referring to the smarcard readers some laptops have. Not even Linux has support, AFAIK, for the flash readers on laptops that aren't SD/MMC. if you can hook me up with the docs, I'd be willing to work on it. Warner From owner-freebsd-usb@FreeBSD.ORG Sun Feb 4 21:49:09 2007 Return-Path: X-Original-To: freebsd-usb@hub.freebsd.org Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 529B816A57E; Sun, 4 Feb 2007 21:49:09 +0000 (UTC) (envelope-from le@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 1458813C47E; Sun, 4 Feb 2007 21:49:09 +0000 (UTC) (envelope-from le@FreeBSD.org) Received: from freefall.freebsd.org (le@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l14Ln8w8063745; Sun, 4 Feb 2007 21:49:08 GMT (envelope-from le@freefall.freebsd.org) Received: (from le@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l14Ln8FB063741; Sun, 4 Feb 2007 21:49:08 GMT (envelope-from le) Date: Sun, 4 Feb 2007 21:49:08 GMT From: Lukas Ertl Message-Id: <200702042149.l14Ln8FB063741@freefall.freebsd.org> To: le@FreeBSD.org, freebsd-usb@FreeBSD.org, le@FreeBSD.org Cc: Subject: Re: kern/106033: [usb] [patch] support for 3G/WCDMA cards Option Globetrotter, Novatel Merlin U740 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Feb 2007 21:49:09 -0000 Synopsis: [usb] [patch] support for 3G/WCDMA cards Option Globetrotter, Novatel Merlin U740 Responsible-Changed-From-To: freebsd-usb->le Responsible-Changed-By: le Responsible-Changed-When: Sun Feb 4 21:49:00 UTC 2007 Responsible-Changed-Why: Take care of this one. http://www.freebsd.org/cgi/query-pr.cgi?pr=106033 From owner-freebsd-usb@FreeBSD.ORG Mon Feb 5 08:05:46 2007 Return-Path: X-Original-To: usb@freebsd.org Delivered-To: freebsd-usb@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3BBE216A402 for ; Mon, 5 Feb 2007 08:05:45 +0000 (UTC) (envelope-from almarrie@gmail.com) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.232]) by mx1.freebsd.org (Postfix) with ESMTP id F1BEA13C46B for ; Mon, 5 Feb 2007 08:05:44 +0000 (UTC) (envelope-from almarrie@gmail.com) Received: by wr-out-0506.google.com with SMTP id 71so1200504wri for ; Mon, 05 Feb 2007 00:05:44 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=A+PL+iLAb2dGuRM5ROfwmKLkdm1I0N84lvvGMNAOoalZy0w0Eesaih3WHBTi9HZvXxAqUbQDLeBfOYjBtkdbJCChKb1Rok9FutB/4vusuulJnOkWqfhyRWBrqbFgH0DVEt4+znwiPdmT3QhowsJQgDe71IdQOxGLBHJqf6U3YZ8= Received: by 10.115.89.1 with SMTP id r1mr560054wal.1170662741766; Mon, 05 Feb 2007 00:05:41 -0800 (PST) Received: by 10.115.91.7 with HTTP; Mon, 5 Feb 2007 00:05:41 -0800 (PST) Message-ID: <499c70c0702050005r76338d52i790e930dfffed43a@mail.gmail.com> Date: Mon, 5 Feb 2007 11:05:41 +0300 From: "Abdullah Ibn Hamad Al-Marri" To: "M. Warner Losh" In-Reply-To: <20070204.125641.1219856867.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <499c70c0702030850v14e02dfck7a0b91e1cc6deb9b@mail.gmail.com> <20070203.104000.756908884.imp@bsdimp.com> <20070204.125641.1219856867.imp@bsdimp.com> Cc: usb@freebsd.org, rizzo@icir.org, leafy7382@gmail.com, current@freebsd.org Subject: Re: Call for Testers: FreeBSD webcam driver (and more) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2007 08:05:46 -0000 On 2/4/07, M. Warner Losh wrote: > In message: > "Jiawei Ye" writes: > : On 2/4/07, M. Warner Losh wrote: > : > In message: <499c70c0702030850v14e02dfck7a0b91e1cc6deb9b@mail.gmail.com> > : > "Abdullah Ibn Hamad Al-Marri" writes: > : > : and other things like CardReader for laptops ..etc, thank you for > : > > : > CardReader? What's that? > : > > : > SD/MMC support for laptops is on its way... > : > > : > Warner > : I guess he is referring to the smarcard readers some laptops have. > > Not even Linux has support, AFAIK, for the flash readers on laptops > that aren't SD/MMC. if you can hook me up with the docs, I'd be > willing to work on it. > > Warner Check this out please. http://www.hydromel.net/driver/gpr400/ Technical informations Due to a lack of good documentation provided by Gemplus, this driver is a complete reverse engeneering hack. The pdf documentations used to make this possible are: * The GPR400 Reference Manual (Ref: 248_E5234010.pdf) * The Windows API description (Ref: 267_E5234016.pdf) * The WinGPR software documentation (Ref: 299_E5234018.pdf) -- Regards, -Abdullah Ibn Hamad Al-Marri Arab Portal http://www.WeArab.Net/ From owner-freebsd-usb@FreeBSD.ORG Mon Feb 5 10:30:21 2007 Return-Path: X-Original-To: usb@freebsd.org Delivered-To: freebsd-usb@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8433616A401 for ; Mon, 5 Feb 2007 10:30:21 +0000 (UTC) (envelope-from almarrie@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.250]) by mx1.freebsd.org (Postfix) with ESMTP id 454E913C4A7 for ; Mon, 5 Feb 2007 10:30:21 +0000 (UTC) (envelope-from almarrie@gmail.com) Received: by an-out-0708.google.com with SMTP id c24so891624ana for ; Mon, 05 Feb 2007 02:30:20 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=cHtc4mO2kh35zFp8dLVJ8nsZtYAbMH/vBdd/covxcSurf+PWKBBe2anPEd+nu9y93BHBwNjYEZM9A8AxFbSJPTyI9q+KB/zSW1+rCLWM/IMO+d/noiT2Hezlhzh48KfCGxKimQEXqXgAcCH5kRcLRCHiPRszlJbHIwRraod+r4s= Received: by 10.115.50.1 with SMTP id c1mr574388wak.1170671415962; Mon, 05 Feb 2007 02:30:15 -0800 (PST) Received: by 10.115.91.7 with HTTP; Mon, 5 Feb 2007 02:30:15 -0800 (PST) Message-ID: <499c70c0702050230r459c3b9cv87d1828f0a18edd3@mail.gmail.com> Date: Mon, 5 Feb 2007 13:30:15 +0300 From: "Abdullah Ibn Hamad Al-Marri" To: "Bruce M. Simpson" In-Reply-To: <45C702A1.8080104@icir.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <499c70c0702030850v14e02dfck7a0b91e1cc6deb9b@mail.gmail.com> <20070203.104000.756908884.imp@bsdimp.com> <20070204.125641.1219856867.imp@bsdimp.com> <499c70c0702050005r76338d52i790e930dfffed43a@mail.gmail.com> <45C702A1.8080104@icir.org> Cc: usb@freebsd.org, rizzo@icir.org, leafy7382@gmail.com, current@freebsd.org Subject: Re: Call for Testers: FreeBSD webcam driver (and more) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2007 10:30:21 -0000 On 2/5/07, Bruce M. Simpson wrote: > Abdullah Ibn Hamad Al-Marri wrote: > > > > Check this out please. > > > > http://www.hydromel.net/driver/gpr400/ > Erm, I mostly ported this to FreeBSD already: > > http://people.freebsd.org/~bms/dump/gprsc/ > Great stuff! :) How about this one http://openfacts.berlios.de/index-en.phtml?title=TI_FlashMedia_xx12/xx21_driver ? -- Regards, -Abdullah Ibn Hamad Al-Marri Arab Portal http://www.WeArab.Net/ From owner-freebsd-usb@FreeBSD.ORG Mon Feb 5 10:35:19 2007 Return-Path: X-Original-To: usb@freebsd.org Delivered-To: freebsd-usb@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5F5DF16A4EB; Mon, 5 Feb 2007 10:35:19 +0000 (UTC) (envelope-from bms@icir.org) Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by mx1.freebsd.org (Postfix) with ESMTP id 1B4F813C4B7; Mon, 5 Feb 2007 10:35:19 +0000 (UTC) (envelope-from bms@icir.org) Received: from out1.internal (unknown [10.202.2.149]) by out1.messagingengine.com (Postfix) with ESMTP id 1421A1A900D; Mon, 5 Feb 2007 05:10:43 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by out1.internal (MEProxy); Mon, 05 Feb 2007 05:10:43 -0500 X-Sasl-enc: llwP7Dxsqqibe8TrwwuAJDvTCDifjn0lpBvlHgiWJmAu 1170670242 Received: from [192.168.123.18] (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTP id EA6762493D; Mon, 5 Feb 2007 05:10:41 -0500 (EST) Message-ID: <45C702A1.8080104@icir.org> Date: Mon, 05 Feb 2007 10:10:41 +0000 From: "Bruce M. Simpson" User-Agent: Thunderbird 1.5.0.9 (X11/20070125) MIME-Version: 1.0 To: Abdullah Ibn Hamad Al-Marri References: <499c70c0702030850v14e02dfck7a0b91e1cc6deb9b@mail.gmail.com> <20070203.104000.756908884.imp@bsdimp.com> <20070204.125641.1219856867.imp@bsdimp.com> <499c70c0702050005r76338d52i790e930dfffed43a@mail.gmail.com> In-Reply-To: <499c70c0702050005r76338d52i790e930dfffed43a@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: usb@freebsd.org, rizzo@icir.org, leafy7382@gmail.com, current@freebsd.org Subject: Re: Call for Testers: FreeBSD webcam driver (and more) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2007 10:35:19 -0000 Abdullah Ibn Hamad Al-Marri wrote: > > Check this out please. > > http://www.hydromel.net/driver/gpr400/ Erm, I mostly ported this to FreeBSD already: http://people.freebsd.org/~bms/dump/gprsc/ From owner-freebsd-usb@FreeBSD.ORG Mon Feb 5 11:12:02 2007 Return-Path: X-Original-To: freebsd-usb@FreeBSD.org Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DA50116A402 for ; Mon, 5 Feb 2007 11:12:02 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id B189E13C48E for ; Mon, 5 Feb 2007 11:12:02 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l15BC2cB026160 for ; Mon, 5 Feb 2007 11:12:02 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l15BBxIi026142 for freebsd-usb@FreeBSD.org; Mon, 5 Feb 2007 11:11:59 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 5 Feb 2007 11:11:59 GMT Message-Id: <200702051111.l15BBxIi026142@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: linimon set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-usb@FreeBSD.org Cc: Subject: Current problem reports assigned to you X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2007 11:12:03 -0000 Current FreeBSD problem reports Critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o usb/84750 usb [hang] 6-BETA2 reboot/shutdown with root_fs on externa o usb/91629 usb usbd_abort_pipe() may result in infinite loop 2 problems total. Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o usb/40792 usb signals lead to data loss on device ugen o usb/46176 usb [panic] umass causes kernel panic if device removed be o i386/46371 usb USB controller cannot be initialized on IBM Netfinity f usb/55555 usb [ums] system freezes with access to /dev/ums0 o bin/57255 usb usbd and multi-function devices o usb/62088 usb [usb] Logitech Cordless/Optical Mouse not working o usb/62309 usb [ugen] [panic] panic: ugen(4) driver o usb/63621 usb [usb] USB MemoryStick Reader stalls/crashes system o usb/69006 usb [patch] Apple Cinema Display hangs USB ports o usb/71155 usb [usb] misbehaving usb-printer hangs processes, causes o usb/73307 usb [panic] Kernel panics on USB disconnect o usb/74771 usb [umass] mounting write-protected umass device as read/ o usb/75705 usb [panic] da0 attach / Optio S4 (with backtrace) o usb/75797 usb 5.3-STABLE(2005 1/4) detect USB headset, But can not f f usb/76204 usb panic while using usb attached modem o usb/76395 usb USB printer does not work, usbdevs says "addr 0 should o usb/77184 usb kernel panic on USB device disconnect o usb/77294 usb ucom + ulpcom panic o usb/77940 usb [patch] [panic] insertion of usb keyboard panics syste f i386/78218 usb [kue] kue not detected on Sony PCG-F370 VAIO o usb/78989 usb please add USB keyboard support to install CD's o usb/79140 usb WD Firewire/USB Combo hangs under load on USB interfac o usb/79269 usb USB ohci da0 plug/unplug causes crashes and lockups. o usb/79287 usb UHCI hang after interrupt transfer o usb/79524 usb printing to Minolta PagePro 1[23]xxW via USB fails wit f usb/79656 usb [usb] RHSC interrupts lost o usb/79722 usb [usb] wrong alignments in ehci.h o usb/80040 usb [hang] Use of sound mixer causes system freeze with ua f usb/80260 usb Travan USB tape drive fails to write o usb/80361 usb mounting of usb-stick fails o usb/80373 usb usb keyboard does not respond o usb/80829 usb possible panic when loading USB-modules o usb/80862 usb [patch] USB locking issues: missing some Giant calls o usb/81308 usb [ugen] [patch] polling a ugen(4) control endpoint caus f usb/82198 usb Panic on attaching of ONKI N-338 USB MP3 player f usb/82272 usb Can not recognize Casio camera EX-Z40 as a umass devic o usb/82350 usb [usb] null pointer dereference in USB stack o usb/82520 usb Reboot when USL101 connected o usb/82569 usb [usb] USB mass storage plug/unplug causes system panic o usb/82660 usb EHCI: I/O stuck in state 'physrd'/panic o usb/83504 usb [usb] SpeedTouch USB stop working on recent current (a o usb/83563 usb [panic] Page Fault while detaching Mpman Usb device o usb/83677 usb [usb] usb controller often not detected (Sun W2100z) o usb/83756 usb Microsoft Intellimouse Explorer 4.0A doesn't work. o usb/83977 usb [ucom] [panic] ucom1: open bulk out error (addr 2): IN o usb/84326 usb [umass] Panic trying to connect SCSI tape drive via US o usb/84336 usb [usb] [reboot] instant system reboot when unmounting a o usb/84936 usb install - usb keyboard not recognized o usb/86031 usb need support usb nic rt2500 in my 5.4 STABLE o usb/86767 usb [usb] bogus "slice starts beyond end of the disk:..." o usb/87099 usb panic: ohci_add_done: addr 0x000d1bf0 not found o usb/87565 usb [PATCH] Support for Vodaphone 3G/UMTS cards o usb/88743 usb [hang] USB makes kernel hang at boot (regression in 6. o usb/88966 usb kldunload ucom.ko returns "Device busy" error. o usb/89003 usb LaCie Firewire drive not properly supported under 6.0 o usb/89218 usb flash disk o usb/89954 usb [usb] USB Disk driver race condition? f usb/89997 usb [umass] [panic] panic on iPod mini detach o usb/90162 usb [usb] [patch] Add support for the MS Wireless USB Mous o usb/90700 usb Kernel panic on connect/mount/use umass device o usb/91238 usb USB tape unit fails to write a second tape file to the o usb/91263 usb [patch] USB quirk needed for Logitec USB Hard disk LHD o usb/91283 usb booting very slow with usb devices connection (regress o usb/91538 usb Unable to print to EPSON CX3500 o usb/91906 usb FreeBSD hangs while booting with USB legacy support on o usb/92052 usb usbd causes defunct process with busy file-handle o usb/92142 usb SET_ADDR_FAILED and SHORT_XFER errors from usb drivers o usb/92171 usb [panic] panic unplugging Vodafone Mobile Connect (UMTS o usb/93155 usb /dev/ulpt0: device busy USB printer does not work o usb/93408 usb hw.acpi.cpu.cx_lowest=C3 on AMD Turion causes choppy m f usb/93496 usb USB2.0 umass stalls on VIA o usb/93640 usb device ehci causes interrupt storm on this MSI amd64 m o usb/93828 usb ohci causes panic on boot (HP Pavillion d4100e) o usb/93949 usb ugen(4)-related repeatable kernel panic in 6.1-PRERELE o usb/94166 usb btx halted with a flashcard plugged o usb/94384 usb kernel panic with usb2 hardware o usb/94717 usb Reading from /dev/ulpt can break work of a UHCI hub o usb/94742 usb [umass] [patch] umass driver does not recognise YANO e o usb/94813 usb mounting write-protected umass device freezes computer o usb/94897 usb Kernel Panic when cleanly unmounting USB disk o usb/95131 usb Boot/setup process does not accept key strokes o usb/95348 usb USB keyboard unplug causes noise on screen o usb/95562 usb Write Stress in USB Mass drive cause: [vinvalbuf: dir o usb/95636 usb [boot] 5 minute delay at boot when using VT6205 based o usb/96120 usb USB mouse not always detected o usb/96224 usb [usb] mount_msdosfs cause page fault in syncer process o usb/96457 usb fatback on umass = reboot o usb/97286 usb MS Wireless Intellimouse Explorer 2.0 doesn't work o usb/99431 usb FreeBSD on MSI 6566E (Intel 845E motherboards) doesn't o usb/101096 usb USB WLAN occasionally causes kernel-panics during larg o usb/101752 usb [panic] 6.1-RELEASE kernel panic on usb device inserti o usb/102066 usb [ukbd] usb keyboard and multimedia keys don't work o usb/102096 usb /usr/sbin/usbd does not handle multiple devices in one o i386/103025 usb [USB] the wrong in USB device for freeBSD 6.1 and AMD o usb/104292 usb system lockup on forced umount of usb-storage device o usb/104830 usb system crashes when copying data to umass devices o usb/105186 usb USB 2.0/ehci on FreeBSD 6.2-PRE/AMD64 crashes box o usb/106615 usb uftdi module does not automatically load with the FTDI o usb/106648 usb USB Floppy on D1950 10 min Hang on Insert w/o Floppy D o usb/106832 usb USB HP printer is not detected by kernel when ACPI ena o usb/107101 usb [umass] [patch] Quirk for Denver MP3 player o usb/107116 usb [usb] panic while accessing usb msdos pccard o usb/107128 usb [usb] panic while accessing usb msdos flashkey o usb/107248 usb [PATCH] scsi_da.c quirk for Cowon iAUDIO X5 MP3 player o usb/107446 usb [umass] umass problems (usb and fw disks) o usb/107827 usb [panic] ohci_add_done addr not found o usb/107848 usb problem with samsung flash o usb/107924 usb usbd does not call detach o usb/108097 usb [usbgen] [patch] ADMtek 851X USB-to-LAN adapter o usb/108513 usb umass: Creative MuVo TX FM fails in 6.2-RELEASE (regre 110 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o conf/30929 usb [usb] [patch] use usbd to initialize USB ADSL modem s usb/32653 usb Added patches to improve USB scanner supportOB o usb/40948 usb [usb] USB HP CDW8200 does not work f usb/41415 usb [usb] [patch] Some USB scanners cannot talk to uscanne o usb/48342 usb [PATCH] usbd dynamic device list. o kern/51958 usb [usb] [patch] update for urio driver o kern/52026 usb [usb] feature request: umass driver support for InSyst o usb/53025 usb [ugen] [patch] ugen does not allow O_NONBLOCK for inte o usb/56095 usb [usb] [patch] QUIRK: Apacer Pen Drive fails to work o kern/59698 usb [kbd] [patch] Rework of ukbd HID to AT code translatio f usb/60248 usb [patch] Problem with USB printer HP LaserJet 1300 o usb/61234 usb [usb] [patch] usbhidaction(1) doesn't support using an o usb/63837 usb [uhid] [patch] USB: hid_is_collection() only looks for o kern/65769 usb [usb] Call to tcflush(x, TCIFLUSH) stops input on usb- o kern/66547 usb [usb] Palm Tungsten T USB does not initialize correctl o usb/68232 usb [ugen] [patch] ugen(4) isochronous handling correction o usb/68412 usb [usb] [patch] QUIRK: Philips KEY013 USB MP3 player o usb/70523 usb [usb] [patch] umct sending/receiving wrong characters o usb/70942 usb [usb] Genius Wireless USB mouse: moused doesn't work c o usb/71416 usb [usb] Cryptoflex e-gate USB token (ugen0) detach is no o usb/71417 usb [usb] Cryptoflex e-gate USB token (ugen0) communicatio o usb/71455 usb [usb] Slow USB umass performance of 5.3 o usb/71605 usb [umass] [patch] umass doesn't recognize multiple slots o usb/72380 usb [usb] USB does not work [dual Celeron Abit] o usb/72732 usb [patch] Kyocera 7135 quirk. o usb/72733 usb Kyocera 7135 Palm OS connection problem. o usb/73056 usb [usb] Sun Microsystems Type 6 USB mouse not working in f usb/73553 usb [usb] Microsoft USB Internet Keyboard not recongized o usb/74211 usb USB flash drive causes CAM status 0x4 on 4.10Release f usb/74358 usb [umass] unplugging at boot time an umass device crashe o usb/74453 usb Q-lity CD-RW USB ECW-043 (ScanLogic SL11R chipset) doe o usb/74557 usb imation 500mb usb key can only be written halfway on f o usb/74609 usb [usb] [patch] allowing cdma modems to work at full spe o usb/74849 usb [usb] [patch] Samsung SPH-i500 does not attach properl o usb/74880 usb [usb] [patch] Samsung N400 cellphone/acm fails to atac o kern/75764 usb [umass] [patch] "umass0: Phase Error" - no device for o usb/75800 usb ucom1: init failed STALLED error in time of sync with o usb/75928 usb Cytronix SmartMedia card (SMC) reader has problems whe o usb/76461 usb [umass] disklabel of umass(4)-CAM(4)-da(4) not used by o usb/76732 usb Mouse problems with USB KVM Switch f usb/78371 usb Philips Wearable Audio Player (128) fails to attach f usb/78984 usb Creative MUVO umass failure o usb/79723 usb [usb] prepare for high speed isochronous transfers o usb/79725 usb [usb] [patch] USB device speed is not double-checked o usb/79893 usb [umass] [patch] new usbdevs/umass quirks derived from o usb/80010 usb [aue] [patch] add support for the AEI USB to LAN adapt f usb/80420 usb atapicam stops iPod functionality f usb/80773 usb "usbd_get_string()" could have taken a length paramete o usb/80774 usb have "usbd_find_desc" in line with the other "usbd_fin o usb/80776 usb [udav] UDAV device driver shouldn't use usb_add_task o usb/80777 usb usb_rem_task() should wait for callback to complete? o usb/80854 usb suggestion for new iface-no-probe mechanism o usb/80935 usb uvisor.c is not work with CLIE TH55. o usb/81191 usb Support for Curitel HX-550C USB modem to 5.4 RELEASE. f usb/81621 usb external hd hangs under load on ehci o usb/82436 usb [patch] USL101 Host-to-Host bridge support on FreeBSD o usb/83022 usb ALI USB 2.0 EHCI Controller is not detected o usb/83863 usb Communication problem between opensc/openct via USB wi o usb/85067 usb Cannot attach ScanJet 4300C to usb device o usb/85992 usb [uhid] [patch] USB stops working when trying to read f o usb/86195 usb [patch] allow USB Ethernet Adaptor "ELECOM LD-USB20" t o usb/86298 usb Known good USB mouse won't work with correct settings o usb/86438 usb Fix for non-working iPod over USB is in NetBSD CVS o usb/87224 usb Cannot mount USB Zip750 o usb/87648 usb [mouse] Logitech USB-optical mouse problem. o usb/88408 usb axe0 read PHY failed o usb/88939 usb Fix cheapy Myson USB-IDE adapter f usb/89087 usb usb external harddrive hangs with BBB reset failed, TI f usb/91191 usb HP LaserJet 1020 (USB printer) not recognized f usb/91516 usb [umass] umass0 problems, with Freecom Classic SL Hard o usb/91546 usb [umodem] [patch] Nokia 6630 mobile phone does not work o usb/91811 usb Compact Flash in HP Photosmart 2610 return " Medium n o usb/91896 usb Serial Number of USB Memory Sticks is not passed throu o usb/92306 usb [quirk] [patch] Support for iRiver U10 USB media playe o usb/92403 usb [uplcom] uplcom.c needs new entry for 4.00 revision of o usb/92852 usb Vertical scroll not working properly on A4Tech WOP-49 f usb/93011 usb HP ScanJet 6200C & uscanner problem o usb/93389 usb Digital Camera Pentax S60 don't work o usb/93872 usb [patch] SCSI quirk required for ELTA 8061 OL USB memor o usb/94132 usb USB QUIRK for CENTURY EX35QUAT disk enclosure f usb/94147 usb doesn't recognise my USB keyboard o usb/94148 usb Make if_cdce work with ARM linux handhelds o usb/94311 usb [ugen][PATCH] allow interrupt IN transactions to be af o usb/94439 usb [patch] Add support for JNC MP3 Player o usb/94946 usb [uhub][patch] code dynamic status size for status chan o usb/95037 usb USB disk didnt recognized on hot-plug. o usb/95173 usb [usb] cannot mount external usb harddisk VIA Technolog o usb/95241 usb Patch to add USB ID for OEM Pharos 360 GPS o usb/95803 usb Add support for AnyData ADU-E100H o usb/95805 usb Add Support for Siemens ES75 modem o usb/96381 usb [patch] add a quirk table entry for a flash ram usb st p usb/96546 usb [usb] [patch] Add support (quirk) for EasyMP3 EM732X U o usb/96714 usb Update uvisor to support the Fossil Abacus Wrist PDA o usb/97175 usb USB cardreader hangs system o usb/97472 usb [patch] add support for Olympus C150,D390 o usb/98343 usb BBB reset failed errors with Creative Muvo MP3 player; o usb/99419 usb external usb harddrive slow to accept o usb/99538 usb [kbd] while using USB keyboard default params of atkbd o usb/100746 usb [kbd] system does not boot due to USB keyboard problem o usb/101757 usb [patch] uhid.4: correct structure field names to match o usb/101761 usb [patch] usb.h: increase maximal size of report descrip o usb/101775 usb [libusbhid] [patch] possible error in report descripto o usb/102976 usb Casio Exilim Digital Camera cause panic o usb/103046 usb [patch] ulpt event driven I/O with select(2) and nonbl o usb/103289 usb USB 2.0 problems on AMD LX-800 CPU and CS-5536 chipset o usb/103418 usb [usb] [patch] usbhidctl: add ability to write output a o usb/103917 usb USB driver reports "Addr 0 should never happen" o usb/104290 usb QUIRK: TOSHIBA DVD-RAM drive (libretto DVD Dock) o usb/104352 usb [ural] ural driver doesnt work o usb/104645 usb QUIRK: Rave C-201 MP3 player o usb/105065 usb SATA - USB Bridge o usb/105361 usb Kernel panic during unmounting mass storage (Creative o usb/105518 usb epson perfection 3490 usb scanner def o usb/106041 usb FreeBSD does not recognise Mustek BearPaw 2400TA usb s o usb/106070 usb devd recognizes ucom, but ttyU is the device actually o usb/106462 usb Motorola U6 PEBL not recognized by system via USB [pat o usb/106538 usb [patch] Can not burn DVD on Sony DRX-820UL external US o usb/106621 usb [usb] DLINK DUB-E100 support broken o usb/106861 usb [PATCH]: usbdevs update: Add product ACER Zeevo BT-500 o usb/107243 usb [patch] Apacer USB Flash Drive quirk o usb/107388 usb [PATCH] Add utoppy device from NetBSD o usb/107496 usb USB device problem on RELENG_6_2 (SHORT_XFER) (regress o usb/107526 usb Patch to support the Crystalfontz CFA-635 20x4 USB LCD o usb/107642 usb [patch]Ralink Technology RT2501USB/RT2601USB chipset d o kern/107665 usb [usb] [patch] uscanner support for epson stylus DX5050 o usb/107701 usb usbd ignores "detach" o usb/107935 usb [uplcom] panic while accessing /dev/cuaU0 o usb/108056 usb Mouse gets powered off during device probe when plugge o usb/108344 usb kernel with atausb panics when unplugging USB Flash o usb/108427 usb QUIRK-SAMSUNG MP0402H o usb/108509 usb Freebsd hang at startup after ehci0 detected (CD Loade 131 problems total. From owner-freebsd-usb@FreeBSD.ORG Mon Feb 5 15:32:41 2007 Return-Path: X-Original-To: usb@freebsd.org Delivered-To: freebsd-usb@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D9F8816A40F; Mon, 5 Feb 2007 15:32:41 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 913C013C474; Mon, 5 Feb 2007 15:32:41 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id l15FSjwW032001; Mon, 5 Feb 2007 08:28:45 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 05 Feb 2007 08:29:17 -0700 (MST) Message-Id: <20070205.082917.-1625880357.imp@bsdimp.com> To: almarrie@gmail.com From: "M. Warner Losh" In-Reply-To: <499c70c0702050005r76338d52i790e930dfffed43a@mail.gmail.com> References: <20070204.125641.1219856867.imp@bsdimp.com> <499c70c0702050005r76338d52i790e930dfffed43a@mail.gmail.com> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Mon, 05 Feb 2007 08:28:45 -0700 (MST) Cc: usb@freebsd.org, rizzo@icir.org, leafy7382@gmail.com, current@freebsd.org Subject: Re: Call for Testers: FreeBSD webcam driver (and more) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2007 15:32:42 -0000 In message: <499c70c0702050005r76338d52i790e930dfffed43a@mail.gmail.com> "Abdullah Ibn Hamad Al-Marri" writes: : On 2/4/07, M. Warner Losh wrote: : > In message: : > "Jiawei Ye" writes: : > : On 2/4/07, M. Warner Losh wrote: : > : > In message: <499c70c0702030850v14e02dfck7a0b91e1cc6deb9b@mail.gmail.com> : > : > "Abdullah Ibn Hamad Al-Marri" writes: : > : > : and other things like CardReader for laptops ..etc, thank you for : > : > : > : > CardReader? What's that? : > : > : > : > SD/MMC support for laptops is on its way... : > : > : > : > Warner : > : I guess he is referring to the smarcard readers some laptops have. : > : > Not even Linux has support, AFAIK, for the flash readers on laptops : > that aren't SD/MMC. if you can hook me up with the docs, I'd be : > willing to work on it. : > : > Warner : : Check this out please. : : http://www.hydromel.net/driver/gpr400/ : : Technical informations : : Due to a lack of good documentation provided by Gemplus, this driver : is a complete reverse engeneering hack. The pdf documentations used to : make this possible are: : : * The GPR400 Reference Manual (Ref: 248_E5234010.pdf) : * The Windows API description (Ref: 267_E5234016.pdf) : * The WinGPR software documentation (Ref: 299_E5234018.pdf) This looks to be crypto smartcard stuff, not flash media. Still, it is cool. I was referring to the xD, MS/Pro and SmartMedia flash parts.. Warner From owner-freebsd-usb@FreeBSD.ORG Mon Feb 5 16:17:48 2007 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1DDEB16A400 for ; Mon, 5 Feb 2007 16:17:48 +0000 (UTC) (envelope-from lists@jnielsen.net) Received: from ns1.jnielsen.net (ns1.jnielsen.net [69.55.238.237]) by mx1.freebsd.org (Postfix) with ESMTP id F150C13C441 for ; Mon, 5 Feb 2007 16:17:47 +0000 (UTC) (envelope-from lists@jnielsen.net) Received: from localhost (jn@ns1 [69.55.238.237]) (authenticated bits=0) by ns1.jnielsen.net (8.12.9p2/8.12.9) with ESMTP id l15FjLAE036735; Mon, 5 Feb 2007 10:45:21 -0500 (EST) (envelope-from lists@jnielsen.net) From: John Nielsen To: freebsd-mobile@freebsd.org Date: Mon, 5 Feb 2007 10:41:23 -0500 User-Agent: KMail/1.9.5 References: <200702042340.14417.lists@jnielsen.net> In-Reply-To: X-Face: #X5#Y*q>F:]zT!DegL3z5Xo'^MN[$8k\[4^3rN~wm=s=Uw(sW}R?3b^*f1Wu*.<=?utf-8?q?of=5F4NrS=0A=09P*M/9CpxDo!D6?=)IY1w<9B1jB; tBQf[RU-R<,I)e"$q7N7 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200702051041.23665.lists@jnielsen.net> X-Virus-Scanned: ClamAV version 0.88.4, clamav-milter version 0.88.4 on ns1.jnielsen.net X-Virus-Status: Clean Cc: freebsd-usb@freebsd.org, Greg Troxel Subject: Re: Verizon V620 wireless card X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2007 16:17:48 -0000 [Adding usb@ to CC list.] On Monday 05 February 2007 09:44, Greg Troxel wrote: > I added the vendor ids to NetBSD's usbdevs and ugensa(4). (ugensa is > similar to (and I think the ancestor of) FreeBSD's ubsa.) > > Can you explain the UQ_ASSUME_CM_OVER_DATA quirk? I couldn't find it > showing up in ubsa or ucom, so I don't understand what it does (and if > anything odd should be done by NetBSD). I don't know what it does exactly. The comment in usb_quirks.h just says "modem device breaks on cm over data". I do know that it's needed for a lot of cellphone and modem-type usb devices (including my Samsung VI660 (anyone feel like committing usb/74880?)). I tried my V620 with the ubsa patch but without the quirk and it didn't work at all. > About the stall: see the following log entry in usbdevs: > > Revision 1.254 / (download) - annotate - [select for diffs], Sun Feb 19 > 14:48:02 2006 UTC (11 months, 2 weeks ago) by iedowse Branch: MAIN > Changes since 1.253: +1 -0 lines > Diff to previous 1.253 (colored) > > Add a UQ_OPEN_CLEARSTALL quirk for devices that need a clear-stall > operation when a pipe is opened, and add an entry for the ST Micro > biometric CPU. It doesn't look like this was ever MFC'ed. Who should I bug to get that taken care of? If I can test it and it takes care of the error messages then I'll add it to my patch and submit a PR. Funny coincidence. It looks like kern/106033 (the PR that led me down the ubsa path to begin with) was committed a few hours before my message yesterday. Thanks Lukas! JN From owner-freebsd-usb@FreeBSD.ORG Mon Feb 5 17:06:50 2007 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D918016A50A for ; Mon, 5 Feb 2007 17:06:44 +0000 (UTC) (envelope-from gdt@ir.bbn.com) Received: from fnord.ir.bbn.com (fnord.ir.bbn.com [192.1.100.210]) by mx1.freebsd.org (Postfix) with ESMTP id 79A0113C4F7 for ; Mon, 5 Feb 2007 17:06:30 +0000 (UTC) (envelope-from gdt@ir.bbn.com) Received: by fnord.ir.bbn.com (Postfix, from userid 10853) id 47C4652A0; Mon, 5 Feb 2007 11:44:56 -0500 (EST) From: Greg Troxel To: John Nielsen References: <200702042340.14417.lists@jnielsen.net> <200702051041.23665.lists@jnielsen.net> X-Hashcash: 1:20:070205:lists@jnielsen.net::fPEdbOvOgN+o9xJR:000000000000000000000000000000000000000000011WD X-Hashcash: 1:20:070205:freebsd-usb@freebsd.org::O7curTniGjClVcVp:0000000000000000000000000000000000000028S5 X-Hashcash: 1:20:070205:freebsd-mobile@freebsd.org::0BblnLaDT4ck9jcO:000000000000000000000000000000000007F7+ Date: Mon, 05 Feb 2007 11:44:51 -0500 In-Reply-To: <200702051041.23665.lists@jnielsen.net> (John Nielsen's message of "Mon\, 5 Feb 2007 10\:41\:23 -0500") Message-ID: User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Cc: freebsd-usb@freebsd.org, freebsd-mobile@freebsd.org Subject: Re: Verizon V620 wireless card X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2007 17:06:50 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable John Nielsen writes: > [Adding usb@ to CC list.] > > On Monday 05 February 2007 09:44, Greg Troxel wrote: >> I added the vendor ids to NetBSD's usbdevs and ugensa(4). (ugensa is >> similar to (and I think the ancestor of) FreeBSD's ubsa.) >> >> Can you explain the UQ_ASSUME_CM_OVER_DATA quirk? I couldn't find it >> showing up in ubsa or ucom, so I don't understand what it does (and if >> anything odd should be done by NetBSD). > > I don't know what it does exactly. The comment in usb_quirks.h just=20 > says "modem device breaks on cm over data". I do know that it's needed fo= r a=20 > lot of cellphone and modem-type usb devices (including my Samsung VI660=20 > (anyone feel like committing usb/74880?)). I tried my V620 with the ubsa= =20 > patch but without the quirk and it didn't work at all. I've been using a KPC650 (vz) and a sierra aircard (sprint) on NetBSD without any sign of that quirk with no issues. So, it could be that the NetBSD code doesn't provoke the behavior for some other reason. Greg Troxel --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (NetBSD) iD8DBQFFx18I+vesoDJhHiURAkf9AJ9AcOnKExSrceo5aTeU7uHObV0RIACgqifw nyiUNjejIgxI59pWFzyV4S8= =R3mU -----END PGP SIGNATURE----- --=-=-=-- From owner-freebsd-usb@FreeBSD.ORG Mon Feb 5 19:04:27 2007 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0DE6916A4E9 for ; Mon, 5 Feb 2007 19:04:23 +0000 (UTC) (envelope-from argonaut@vodafone.es) Received: from vodafone.es (back.vodafone.es [212.73.32.158]) by mx1.freebsd.org (Postfix) with ESMTP id 9FBF813C4B6 for ; Mon, 5 Feb 2007 19:04:19 +0000 (UTC) (envelope-from argonaut@vodafone.es) Received: from zurich.theworld.es ([62.87.104.154]) by mail-smtp03-p.vodafone.es (Messaging) with ESMTP id <0JD00050W3CUOR60@mail-smtp03-p.vodafone.es> for freebsd-usb@freebsd.org; Mon, 05 Feb 2007 18:31:45 +0100 (MET) Date: Mon, 05 Feb 2007 18:35:07 +0100 From: Jes In-reply-to: <45B0D4DD.3030607@vwsoft.com> To: Volker Message-id: <20070205183507.0f5b3903@zurich.theworld.es> MIME-version: 1.0 X-Mailer: Sylpheed-Claws 2.5.6 (GTK+ 2.8.20; i486-slackware-linux-gnu) Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: quoted-printable References: <20061218170041.23257117.argonaut@airtel.net> <45B0D4DD.3030607@vwsoft.com> Cc: freebsd-usb@freebsd.org Subject: Re: Huawei E220 3G devices X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2007 19:04:27 -0000 Hi Volker: I've got the usbctl printouts. First the 'dmesg': ucom0: HUAWEI Technologies HUAWEI Mobile, rev 1.10/0.00, addr 2 ucom0: Could not find interrupt in device_attach: ucom0 attach returned 6 ucom0: HUAWEI Technologies HUAWEI Mobile, rev 1.10/0.00, addr 2 ucom0: Could not find interrupt in device_attach: ucom0 attach returned 6 usbctl -f /dev/usb0 USB device 1: 9 USB device 2: 0 2 USB devices found DEVICE addr 1 DEVICE descriptor: bLength=3D18 bDescriptorType=3Ddevice(1) bcdUSB=3D1.00 bDeviceClass=3D9 bDeviceSubClass=3D0 bDeviceProtocol=3D0 bMaxPacketSize=3D64 idVendor=3D0x00= 00 idProduct=3D0x0000 bcdDevice=3D100 iManufacturer=3D1(Intel) iProduct=3D2(UH= CI root hub) iSerialNumber=3D0() bNumConfigurations=3D1 CONFIGURATION descriptor 0: bLength=3D9 bDescriptorType=3Dconfig(2) wTotalLength=3D25 bNumInterface=3D1 bConfigurationValue=3D1 iConfiguration=3D0() bmAttributes=3D40 bMaxPower=3D= 0 mA INTERFACE descriptor 0: bLength=3D9 bDescriptorType=3Dinterface(4) bInterfaceNumber=3D0 bAlternateSetting=3D0 bNumEndpoints=3D1 bInterfaceClass=3D9 bInterfaceSubClass=3D0 bInterfaceProtocol=3D0 iInterface=3D0() ENDPOINT descriptor: bLength=3D7 bDescriptorType=3Dendpoint(5) bEndpointAddress=3D1-in bmAttributes=3Dinterrupt wMaxPacketSize=3D8 bInterval=3D255 current configuration 1 HUB descriptor: bDescLength=3D9 bDescriptorType=3D41 bNbrPorts=3D2 wHubCharacteristics=3D0a bPwrOn2PwrGood=3D50 bHubContrCurrent=3D0 DeviceRemovable=3D0 Hub status 0000 0000 Port 1 status=3D0103 change=3D0000 Port 2 status=3D0100 change=3D0000 ---------- DEVICE addr 2 DEVICE descriptor: bLength=3D18 bDescriptorType=3Ddevice(1) bcdUSB=3D1.10 bDeviceClass=3D0 bDeviceSubClass=3D0 bDeviceProtocol=3D0 bMaxPacketSize=3D64 idVendor=3D0x12= d1 idProduct=3D0x1003 bcdDevice=3D0 iManufacturer=3D1(\u0c05=A4) iProduct=3D2(\u0c05=A4) iSerialNumber=3D0() bNumConfigurations=3D1 CONFIGURATION descriptor 0: bLength=3D9 bDescriptorType=3Dconfig(2) wTotalLength=3D32 bNumInterface=3D1 bConfigurationValue=3D1 iConfiguration=3D0() bmAttributes=3Da0 bMaxPower=3D= 500 mA INTERFACE descriptor 0: bLength=3D9 bDescriptorType=3Dinterface(4) bInterfaceNumber=3D0 bAlternateSetting=3D0 bNumEndpoints=3D2 bInterfaceClass=3D8 bInterfaceSubClass=3D6 bInterfaceProtocol=3D80 iInterface=3D0() ENDPOINT descriptor: bLength=3D7 bDescriptorType=3Dendpoint(5) bEndpointAddress=3D3-in bmAttributes=3Dbulk wMaxPacketSize=3D64 bInterval=3D0 ENDPOINT descriptor: bLength=3D7 bDescriptorType=3Dendpoint(5) bEndpointAddress=3D4-out bmAttributes=3Dbulk wMaxPacketSize=3D64 bInterval=3D0 current configuration 1 ---------- usbctl -f /dev/usb1 USB device 1: 9 1 USB devices found DEVICE addr 1 DEVICE descriptor: bLength=3D18 bDescriptorType=3Ddevice(1) bcdUSB=3D1.00 bDeviceClass=3D9 bDeviceSubClass=3D0 bDeviceProtocol=3D0 bMaxPacketSize=3D64 idVendor=3D0x00= 00 idProduct=3D0x0000 bcdDevice=3D100 iManufacturer=3D1(Intel) iProduct=3D2(UH= CI root hub) iSerialNumber=3D0() bNumConfigurations=3D1 CONFIGURATION descriptor 0: bLength=3D9 bDescriptorType=3Dconfig(2) wTotalLength=3D25 bNumInterface=3D1 bConfigurationValue=3D1 iConfiguration=3D0() bmAttributes=3D40 bMaxPower=3D= 0 mA INTERFACE descriptor 0: bLength=3D9 bDescriptorType=3Dinterface(4) bInterfaceNumber=3D0 bAlternateSetting=3D0 bNumEndpoints=3D1 bInterfaceClass=3D9 bInterfaceSubClass=3D0 bInterfaceProtocol=3D0 iInterface=3D0() ENDPOINT descriptor: bLength=3D7 bDescriptorType=3Dendpoint(5) bEndpointAddress=3D1-in bmAttributes=3Dinterrupt wMaxPacketSize=3D8 bInterval=3D255 current configuration 1 HUB descriptor: bDescLength=3D9 bDescriptorType=3D41 bNbrPorts=3D2 wHubCharacteristics=3D0a bPwrOn2PwrGood=3D50 bHubContrCurrent=3D0 DeviceRemovable=3D0 Hub status 0000 0000 Port 1 status=3D0100 change=3D0000 Port 2 status=3D0100 change=3D0000 ---------- usbctl -f /dev/usb2 USB device 1: 9 1 USB devices found DEVICE addr 1 DEVICE descriptor: bLength=3D18 bDescriptorType=3Ddevice(1) bcdUSB=3D1.00 bDeviceClass=3D9 bDeviceSubClass=3D0 bDeviceProtocol=3D0 bMaxPacketSize=3D64 idVendor=3D0x00= 00 idProduct=3D0x0000 bcdDevice=3D100 iManufacturer=3D1(Intel) iProduct=3D2(UH= CI root hub) iSerialNumber=3D0() bNumConfigurations=3D1 CONFIGURATION descriptor 0: bLength=3D9 bDescriptorType=3Dconfig(2) wTotalLength=3D25 bNumInterface=3D1 bConfigurationValue=3D1 iConfiguration=3D0() bmAttributes=3D40 bMaxPower=3D= 0 mA INTERFACE descriptor 0: bLength=3D9 bDescriptorType=3Dinterface(4) bInterfaceNumber=3D0 bAlternateSetting=3D0 bNumEndpoints=3D1 bInterfaceClass=3D9 bInterfaceSubClass=3D0 bInterfaceProtocol=3D0 iInterface=3D0() ENDPOINT descriptor: bLength=3D7 bDescriptorType=3Dendpoint(5) bEndpointAddress=3D1-in bmAttributes=3Dinterrupt wMaxPacketSize=3D8 bInterval=3D255 current configuration 1 HUB descriptor: bDescLength=3D9 bDescriptorType=3D41 bNbrPorts=3D2 wHubCharacteristics=3D0a bPwrOn2PwrGood=3D50 bHubContrCurrent=3D0 DeviceRemovable=3D0 Hub status 0000 0000 Port 1 status=3D0100 change=3D0000 Port 2 status=3D0100 change=3D0000 ---------- usbctl -f /dev/usb3=20 USB device 1: 9 1 USB devices found DEVICE addr 1 DEVICE descriptor: bLength=3D18 bDescriptorType=3Ddevice(1) bcdUSB=3D2.00 bDeviceClass=3D9 bDeviceSubClass=3D0 bDeviceProtocol=3D1 bMaxPacketSize=3D64 idVendor=3D0x00= 00 idProduct=3D0x0000 bcdDevice=3D100 iManufacturer=3D1(Intel) iProduct=3D2(EH= CI root hub) iSerialNumber=3D0() bNumConfigurations=3D1 CONFIGURATION descriptor 0: bLength=3D9 bDescriptorType=3Dconfig(2) wTotalLength=3D25 bNumInterface=3D1 bConfigurationValue=3D1 iConfiguration=3D0() bmAttributes=3D40 bMaxPower=3D= 0 mA INTERFACE descriptor 0: bLength=3D9 bDescriptorType=3Dinterface(4) bInterfaceNumber=3D0 bAlternateSetting=3D0 bNumEndpoints=3D1 bInterfaceClass=3D9 bInterfaceSubClass=3D0 bInterfaceProtocol=3D0 iInterface=3D0() ENDPOINT descriptor: bLength=3D7 bDescriptorType=3Dendpoint(5) bEndpointAddress=3D1-in bmAttributes=3Dinterrupt wMaxPacketSize=3D8 bInterval=3D255 current configuration 1 HUB descriptor: bDescLength=3D11 bDescriptorType=3D41 bNbrPorts=3D8 wHubCharacteristics=3D80 bPwrOn2PwrGood=3D200 bHubContrCurrent=3D0 DeviceRemovable=3D0 Hub status 0000 0000 Port 1 status=3D0500 change=3D0000 Port 2 status=3D0500 change=3D0000 Port 3 status=3D0500 change=3D0000 Port 4 status=3D0500 change=3D0000 Port 5 status=3D0500 change=3D0000 Port 6 status=3D0500 change=3D0000 Port 7 status=3D0500 change=3D0000 Port 8 status=3D0500 change=3D0000 ---------- Thanks in advance,=20 Jes On Fri, 19 Jan 2007 15:25:33 +0100 Volker wrote: > Jes, >=20 > sorry for the huge delay in respone... apologies >=20 > On 12/18/06 17:00, Jes wrote: > > Hi: > >=20 > > I have not such 'usbctl'... What is 'usbctl'? only 'usbdevs' and > > usbhidctl... and this, usbhidctl, is not very useful I guess... > > so... I put /var/log/messages and 'usbdevs'. Note that I haven't > > 'usbmass' in my kernel; it's compiled as a module and not loaded. > > Then the huawei modem cannot be interpreted as a mass-storage > > devices.... can it? >=20 > usbctl is part of a package called usbutil. >=20 > You may download a package from the website of Bernd Walter: > http://www.cosmo-project.de/~bernd/usbutil.tgz >=20 > However, I don't why such a great tool isn't part of the ports tree > (obsd + nbsd do have it in the tree). >=20 > usbctl shows the interfaces and endpoints of a usb device. You may > find a sample output of usbctl at > http://bsd.vwsoft.com/3g/merlin_u740.html >=20 > I would like to see the same output for the Huawei devices. I guess > they have different interfaces and the first driver attaching to > _and_ interface wins the whole device as the driver might return > with UMATCH_DEVCLASS*, UMATCH_VENDOR* or similar. >=20 > Greetings, >=20 > Volker >=20 From owner-freebsd-usb@FreeBSD.ORG Mon Feb 5 19:30:53 2007 Return-Path: X-Original-To: freebsd-usb@hub.freebsd.org Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B6BC916A403 for ; Mon, 5 Feb 2007 19:30:48 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id CD8F013C491 for ; Mon, 5 Feb 2007 19:30:47 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l15JUlTm064473 for ; Mon, 5 Feb 2007 19:30:47 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l15JUl1i064472; Mon, 5 Feb 2007 19:30:47 GMT (envelope-from gnats) Date: Mon, 5 Feb 2007 19:30:47 GMT Message-Id: <200702051930.l15JUl1i064472@freefall.freebsd.org> To: freebsd-usb@FreeBSD.org From: "Valery V.Chikalov" Cc: Subject: Re: usb/107642: [patch]Ralink Technology RT2501USB/RT2601USB chipset driver X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "Valery V.Chikalov" List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2007 19:30:53 -0000 The following reply was made to PR usb/107642; it has been noted by GNATS. From: "Valery V.Chikalov" To: bug-followup@FreeBSD.org Cc: Subject: Re: usb/107642: [patch]Ralink Technology RT2501USB/RT2601USB chipset driver Date: Mon, 05 Feb 2007 21:28:29 +0200 This is a multi-part message in MIME format. --------------010902060408010806040104 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit patch against RELENG_6 and sys/dev/usb/usbdevs revision 1.232.2.20 --------------010902060408010806040104 Content-Type: text/plain; name="rum.patch.RELENG_6.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="rum.patch.RELENG_6.txt" Index: sys/dev/usb/if_rum.c =================================================================== RCS file: sys/dev/usb/if_rum.c diff -N sys/dev/usb/if_rum.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sys/dev/usb/if_rum.c 5 Feb 2007 19:00:51 -0000 @@ -0,0 +1,2302 @@ +/* $OpenBSD: if_rum.c,v 1.40 2006/09/18 16:20:20 damien Exp $ */ +/* $NetBSD: if_rum.c,v 1.2 2006/11/01 08:39:25 xtraeme Exp $ */ + +/*- + * Copyright (c) 2005, 2006 Damien Bergamini + * Copyright (c) 2006 Niall O'Higgins + * Copyright (c) 2006, 2007 Valery V.Chikalov + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/*- + * Ralink Technology RT2501USB/RT2601USB chipset driver + * http://www.ralinktech.com/ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include "usbdevs.h" + +#include +#include + +#ifdef USB_DEBUG +#define RUM_DEBUG +#endif + +#ifdef RUM_DEBUG +#define DPRINTF(x) do { if (rum_debug) logprintf x; } while (0) +#define DPRINTFN(n, x) do { if (rum_debug >= (n)) logprintf x; } while (0) +int rum_debug = 0; +#else +#define DPRINTF(x) +#define DPRINTFN(n, x) +#endif + +/* various supported device vendors/products */ +static const struct usb_devno rum_devs[] = { + { USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_RT2573 }, + { USB_VENDOR_ASUS, USB_PRODUCT_ASUS_RT2573 }, + { USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5D7050A }, + { USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5D9050V3 }, + { USB_VENDOR_LINKSYS4, USB_PRODUCT_LINKSYS4_WUSB54GC }, + { USB_VENDOR_CONCEPTRONIC, USB_PRODUCT_CONCEPTRONIC_C54RU2 }, + { USB_VENDOR_DICKSMITH, USB_PRODUCT_DICKSMITH_CWD854F }, + { USB_VENDOR_DICKSMITH, USB_PRODUCT_DICKSMITH_RT2573 }, + { USB_VENDOR_DLINK2, USB_PRODUCT_DLINK2_DWLG122C1 }, + { USB_VENDOR_DLINK2, USB_PRODUCT_DLINK2_WUA1340 }, + { USB_VENDOR_GIGABYTE, USB_PRODUCT_GIGABYTE_GNWB01GS }, + { USB_VENDOR_GIGASET, USB_PRODUCT_GIGASET_RT2573 }, + { USB_VENDOR_GOODWAY, USB_PRODUCT_GOODWAY_RT2573 }, + { USB_VENDOR_HUAWEI3COM, USB_PRODUCT_HUAWEI3COM_RT2573 }, + { USB_VENDOR_MSI, USB_PRODUCT_MSI_RT2573 }, + { USB_VENDOR_MSI, USB_PRODUCT_MSI_RT2573_2 }, + { USB_VENDOR_MSI, USB_PRODUCT_MSI_RT2573_3 }, + { USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUSMM }, + { USB_VENDOR_QCOM, USB_PRODUCT_QCOM_RT2573 }, + { USB_VENDOR_QCOM, USB_PRODUCT_QCOM_RT2573_2 }, + { USB_VENDOR_RALINK, USB_PRODUCT_RALINK_RT2573 }, + { USB_VENDOR_RALINK, USB_PRODUCT_RALINK_RT2671 }, + { USB_VENDOR_SITECOMEU, USB_PRODUCT_SITECOMEU_WL113R2 }, + { USB_VENDOR_SITECOMEU, USB_PRODUCT_SITECOMEU_WL172 }, + { USB_VENDOR_SURECOM, USB_PRODUCT_SURECOM_RT2573 } +}; + +MODULE_DEPEND(rum, wlan, 1, 1, 1); +MODULE_DEPEND(rum, firmware, 1, 1, 1); + +Static void rum_attachhook(void *); + +Static void rum_start(struct ifnet *); +Static void rum_watchdog(struct ifnet *); + +Static int rum_ioctl(struct ifnet *, u_long, caddr_t); + +Static int rum_alloc_tx_list(struct rum_softc *); +Static void rum_free_tx_list(struct rum_softc *); +Static int rum_alloc_rx_list(struct rum_softc *); +Static void rum_free_rx_list(struct rum_softc *); + +Static void rum_txeof(usbd_xfer_handle, usbd_private_handle, usbd_status); +Static void rum_rxeof(usbd_xfer_handle, usbd_private_handle, usbd_status); + +Static int rum_media_change(struct ifnet *); +Static void rum_task(void *); +Static void rum_next_scan(void *); +Static int rum_newstate(struct ieee80211com *, enum ieee80211_state, int); +Static uint8_t rum_rxrate(struct rum_rx_desc *); +Static int rum_ack_rate(struct ieee80211com *, int); +Static uint16_t rum_txtime(int, int, uint32_t); +Static uint8_t rum_plcp_signal(int); +Static void rum_setup_tx_desc(struct rum_softc *, struct rum_tx_desc *, uint32_t, uint16_t, int, int); +Static int rum_tx_mgt(struct rum_softc *, struct mbuf *, struct ieee80211_node *); +Static int rum_tx_data(struct rum_softc *, struct mbuf *, struct ieee80211_node *); + +Static void rum_read_eeprom(struct rum_softc *); +Static void rum_eeprom_read(struct rum_softc *, uint16_t, void *, int); +Static uint32_t rum_read(struct rum_softc *, uint16_t); +Static void rum_read_multi(struct rum_softc *, uint16_t, void *, int); +Static void rum_write(struct rum_softc *, uint16_t, uint32_t); +Static void rum_write_multi(struct rum_softc *, uint16_t, void *, size_t); + +Static int rum_bbp_init(struct rum_softc *); +Static void rum_bbp_write(struct rum_softc *, uint8_t, uint8_t); +Static uint8_t rum_bbp_read(struct rum_softc *, uint8_t); + +Static const char *rum_get_rf(int); +Static void rum_rf_write(struct rum_softc *, uint8_t, uint32_t); +Static void rum_select_antenna(struct rum_softc *); +Static void rum_enable_mrr(struct rum_softc *); +Static void rum_set_txpreamble(struct rum_softc *); +Static void rum_set_basicrates(struct rum_softc *); +Static void rum_select_band(struct rum_softc *, struct ieee80211_channel *); +Static void rum_set_chan(struct rum_softc *, struct ieee80211_channel *); +Static void rum_enable_tsf_sync(struct rum_softc *); +Static void rum_update_slot(struct rum_softc *); +Static void rum_set_bssid(struct rum_softc *, const uint8_t *); +Static void rum_set_macaddr(struct rum_softc *, const uint8_t *); +Static void rum_update_promisc(struct rum_softc *); + +Static void rum_init(void *); +Static void rum_stop(struct ifnet *); +Static int rum_load_microcode(struct rum_softc *, const u_char *, size_t); +Static int rum_prepare_beacon(struct rum_softc *); + +Static void rum_amrr_start(struct rum_softc *, struct ieee80211_node *); +Static void rum_amrr_timeout(void *); +Static void rum_amrr_update(usbd_xfer_handle, usbd_private_handle, usbd_status status); +Static void rum_ratectl(struct rum_amrr *, struct ieee80211_node *); + +/* + * Supported rates for 802.11a/b/g modes (in 500Kbps unit). + */ +static const struct ieee80211_rateset rum_rateset_11a = + { 8, { 12, 18, 24, 36, 48, 72, 96, 108 } }; + +static const struct ieee80211_rateset rum_rateset_11b = + { 4, { 2, 4, 11, 22 } }; + +static const struct ieee80211_rateset rum_rateset_11g = + { 12, { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 } }; + +static const struct { + uint32_t reg; + uint32_t val; +} rum_def_mac[] = { + RT2573_DEF_MAC +}; + +static const struct { + uint8_t reg; + uint8_t val; +} rum_def_bbp[] = { + RT2573_DEF_BBP +}; + +static const struct rfprog { + uint8_t chan; + uint32_t r1, r2, r3, r4; +} rum_rf5226[] = { + RT2573_RF5226 +}, rum_rf5225[] = { + RT2573_RF5225 +}; + +USB_DECLARE_DRIVER(rum); + +USB_MATCH(rum) +{ + USB_MATCH_START(rum, uaa); + + if (uaa->iface != NULL) + return UMATCH_NONE; + + return (usb_lookup(rum_devs, uaa->vendor, uaa->product) != NULL) ? + UMATCH_VENDOR_PRODUCT : UMATCH_NONE; +} + +Static void +rum_attachhook(void *xsc) +{ + struct rum_softc *sc = xsc; + const char *name = "rt2573"; + struct firmware *fp; + + fp = firmware_get(name); + + if (fp == NULL || fp->datasize == 0) { + printf("%s: failed loadfirmware of file %s\n", + USBDEVNAME(sc->sc_dev), name); + return; + } else { + //MYDEBUG + printf("%s: firmware loaded: name: %s, size:%d\n", USBDEVNAME(sc->sc_dev), fp->name, fp->datasize); + } + + if (rum_load_microcode(sc, fp->data, fp->datasize) != 0) { + printf("%s: could not load 8051 microcode\n", + USBDEVNAME(sc->sc_dev)); + } + +} + +USB_ATTACH(rum) +{ + USB_ATTACH_START(rum, sc, uaa); + struct ieee80211com *ic = &sc->sc_ic; + struct ifnet *ifp = NULL; + usb_interface_descriptor_t *id; + usb_endpoint_descriptor_t *ed; + usbd_status error; + char devinfo[1024]; + int i, ntries; + uint32_t tmp; + + sc->sc_udev = uaa->device; + sc->sc_flags = 0; + + usbd_devinfo(sc->sc_udev, 0, devinfo); + USB_ATTACH_SETUP; + printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); + + if (usbd_set_config_no(sc->sc_udev, RT2573_CONFIG_NO, 0) != 0) { + printf("%s: could not set configuration no\n", + USBDEVNAME(sc->sc_dev)); + USB_ATTACH_ERROR_RETURN; + } + + /* get the first interface handle */ + error = usbd_device2interface_handle(sc->sc_udev, RT2573_IFACE_INDEX, + &sc->sc_iface); + if (error != 0) { + printf("%s: could not get interface handle\n", + USBDEVNAME(sc->sc_dev)); + USB_ATTACH_ERROR_RETURN; + } + + /* + * Find endpoints. + */ + id = usbd_get_interface_descriptor(sc->sc_iface); + + sc->sc_rx_no = sc->sc_tx_no = -1; + for (i = 0; i < id->bNumEndpoints; i++) { + ed = usbd_interface2endpoint_descriptor(sc->sc_iface, i); + if (ed == NULL) { + printf("%s: no endpoint descriptor for iface %d\n", + USBDEVNAME(sc->sc_dev), i); + USB_ATTACH_ERROR_RETURN; + } + + if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN && + UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) + sc->sc_rx_no = ed->bEndpointAddress; + else if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT && + UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) + sc->sc_tx_no = ed->bEndpointAddress; + } + if (sc->sc_rx_no == -1 || sc->sc_tx_no == -1) { + printf("%s: missing endpoint\n", USBDEVNAME(sc->sc_dev)); + USB_ATTACH_ERROR_RETURN; + } + + usb_init_task(&sc->sc_task, rum_task, sc); + callout_init(&sc->scan_ch, debug_mpsafenet ? CALLOUT_MPSAFE : 0); + callout_init(&sc->amrr_ch, 0); + + /* retrieve RT2573 rev. no */ + for (ntries = 0; ntries < 1000; ntries++) { + if ((tmp = rum_read(sc, RT2573_MAC_CSR0)) != 0) + break; + DELAY(1000); + } + if (ntries == 1000) { + printf("%s: timeout waiting for chip to settle\n", + USBDEVNAME(sc->sc_dev)); + USB_ATTACH_ERROR_RETURN; + } + + /* retrieve MAC address and various other things from EEPROM */ + rum_read_eeprom(sc); + + printf("%s: MAC/BBP RT%04x (rev 0x%05x), RF %s, address %s\n", + USBDEVNAME(sc->sc_dev), sc->macbbp_rev, tmp, + rum_get_rf(sc->rf_rev), ether_sprintf(ic->ic_myaddr)); + + ifp = sc->sc_ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) { + printf("%s: can not if_alloc()\n", USBDEVNAME(sc->sc_dev)); + USB_ATTACH_ERROR_RETURN; + } + +#if 1 + rum_attachhook(sc); +#endif + + ic->ic_ifp = ifp; + ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */ + ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */ + ic->ic_state = IEEE80211_S_INIT; + + /* set device capabilities */ + ic->ic_caps = + IEEE80211_C_IBSS | /* IBSS mode supported */ + IEEE80211_C_MONITOR | /* monitor mode supported */ + IEEE80211_C_HOSTAP | /* HostAp mode supported */ + IEEE80211_C_TXPMGT | /* tx power management */ + IEEE80211_C_SHPREAMBLE | /* short preamble supported */ + IEEE80211_C_SHSLOT | /* short slot time supported */ + IEEE80211_C_WPA; /* 802.11i */ + + if (sc->rf_rev == RT2573_RF_5225 || sc->rf_rev == RT2573_RF_5226) { + /* set supported .11a rates */ + ic->ic_sup_rates[IEEE80211_MODE_11A] = rum_rateset_11a; + + /* set supported .11a channels */ + for (i = 34; i <= 46; i += 4) { + ic->ic_channels[i].ic_freq = + ieee80211_ieee2mhz(i, IEEE80211_CHAN_5GHZ); + ic->ic_channels[i].ic_flags = IEEE80211_CHAN_A; + } + for (i = 36; i <= 64; i += 4) { + ic->ic_channels[i].ic_freq = + ieee80211_ieee2mhz(i, IEEE80211_CHAN_5GHZ); + ic->ic_channels[i].ic_flags = IEEE80211_CHAN_A; + } + for (i = 100; i <= 140; i += 4) { + ic->ic_channels[i].ic_freq = + ieee80211_ieee2mhz(i, IEEE80211_CHAN_5GHZ); + ic->ic_channels[i].ic_flags = IEEE80211_CHAN_A; + } + for (i = 149; i <= 165; i += 4) { + ic->ic_channels[i].ic_freq = + ieee80211_ieee2mhz(i, IEEE80211_CHAN_5GHZ); + ic->ic_channels[i].ic_flags = IEEE80211_CHAN_A; + } + } + + /* set supported .11b and .11g rates */ + ic->ic_sup_rates[IEEE80211_MODE_11B] = rum_rateset_11b; + ic->ic_sup_rates[IEEE80211_MODE_11G] = rum_rateset_11g; + + /* set supported .11b and .11g channels (1 through 14) */ + for (i = 1; i <= 14; i++) { + ic->ic_channels[i].ic_freq = + ieee80211_ieee2mhz(i, IEEE80211_CHAN_2GHZ); + ic->ic_channels[i].ic_flags = + IEEE80211_CHAN_CCK | IEEE80211_CHAN_OFDM | + IEEE80211_CHAN_DYN | IEEE80211_CHAN_2GHZ; + } + + ifp->if_softc = sc; + if_initname(ifp, "rum", USBDEVUNIT(sc->sc_dev)); + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_init = rum_init; + ifp->if_ioctl = rum_ioctl; + ifp->if_start = rum_start; + ifp->if_watchdog = rum_watchdog; + IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); + IFQ_SET_READY(&ifp->if_snd); + +// if_attach(ifp); + ieee80211_ifattach(ic); + + /* override state transition machine */ + sc->sc_newstate = ic->ic_newstate; + ic->ic_newstate = rum_newstate; + ieee80211_media_init(ic, rum_media_change, ieee80211_media_status); + +#if NBPFILTER > 0 + bpfattach2(ifp, DLT_IEEE802_11_RADIO, + sizeof (struct ieee80211_frame) + IEEE80211_RADIOTAP_HDRLEN, &sc->sc_drvbpf); + + sc->sc_rxtap_len = sizeof sc->sc_rxtapu; + sc->sc_rxtap.wr_ihdr.it_len = htole16(sc->sc_rxtap_len); + sc->sc_rxtap.wr_ihdr.it_present = htole32(RT2573_RX_RADIOTAP_PRESENT); + + sc->sc_txtap_len = sizeof sc->sc_txtapu; + sc->sc_txtap.wt_ihdr.it_len = htole16(sc->sc_txtap_len); + sc->sc_txtap.wt_ihdr.it_present = htole32(RT2573_TX_RADIOTAP_PRESENT); +#endif + + ieee80211_announce(ic); + + usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev, + USBDEV(sc->sc_dev)); + + USB_ATTACH_SUCCESS_RETURN; +} + +USB_DETACH(rum) +{ + USB_DETACH_START(rum, sc); + struct ieee80211com *ic = &sc->sc_ic; + struct ifnet *ifp = sc->sc_ifp; + int s; + + s = splusb(); + + rum_stop(ifp); + usb_rem_task(sc->sc_udev, &sc->sc_task); + callout_stop(&sc->scan_ch); + callout_stop(&sc->amrr_ch); + + if (sc->amrr_xfer != NULL) { + usbd_free_xfer(sc->amrr_xfer); + sc->amrr_xfer = NULL; + } + + if (sc->sc_rx_pipeh != NULL) { + usbd_abort_pipe(sc->sc_rx_pipeh); + usbd_close_pipe(sc->sc_rx_pipeh); + } + + if (sc->sc_tx_pipeh != NULL) { + usbd_abort_pipe(sc->sc_tx_pipeh); + usbd_close_pipe(sc->sc_tx_pipeh); + } + + rum_free_rx_list(sc); + rum_free_tx_list(sc); + +#if NBPFILTER > 0 + bpfdetach(ifp); +#endif + ieee80211_ifdetach(ic); /* free all nodes */ + if_detach(ifp); + + splx(s); + + usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev, + USBDEV(sc->sc_dev)); + + return 0; +} + +Static int +rum_alloc_tx_list(struct rum_softc *sc) +{ + struct rum_tx_data *data; + int i, error; + + sc->tx_queued = 0; + + for (i = 0; i < RT2573_TX_LIST_COUNT; i++) { + data = &sc->tx_data[i]; + + data->sc = sc; + + data->xfer = usbd_alloc_xfer(sc->sc_udev); + if (data->xfer == NULL) { + printf("%s: could not allocate tx xfer\n", + USBDEVNAME(sc->sc_dev)); + error = ENOMEM; + goto fail; + } + + data->buf = usbd_alloc_buffer(data->xfer, + RT2573_TX_DESC_SIZE + MCLBYTES); + if (data->buf == NULL) { + printf("%s: could not allocate tx buffer\n", + USBDEVNAME(sc->sc_dev)); + error = ENOMEM; + goto fail; + } + + /* clean Tx descriptor */ + bzero(data->buf, RT2573_TX_DESC_SIZE); + } + + return 0; + +fail: rum_free_tx_list(sc); + return error; +} + +Static void +rum_free_tx_list(struct rum_softc *sc) +{ + struct rum_tx_data *data; + int i; + + for (i = 0; i < RT2573_TX_LIST_COUNT; i++) { + data = &sc->tx_data[i]; + + if (data->xfer != NULL) { + usbd_free_xfer(data->xfer); + data->xfer = NULL; + } + + if (data->ni != NULL) { + ieee80211_free_node(data->ni); + data->ni = NULL; + } + } +} + +Static int +rum_alloc_rx_list(struct rum_softc *sc) +{ + struct rum_rx_data *data; + int i, error; + + for (i = 0; i < RT2573_RX_LIST_COUNT; i++) { + data = &sc->rx_data[i]; + + data->sc = sc; + + data->xfer = usbd_alloc_xfer(sc->sc_udev); + if (data->xfer == NULL) { + printf("%s: could not allocate rx xfer\n", + USBDEVNAME(sc->sc_dev)); + error = ENOMEM; + goto fail; + } + + if (usbd_alloc_buffer(data->xfer, MCLBYTES) == NULL) { + printf("%s: could not allocate rx buffer\n", + USBDEVNAME(sc->sc_dev)); + error = ENOMEM; + goto fail; + } + + MGETHDR(data->m, M_DONTWAIT, MT_DATA); + if (data->m == NULL) { + printf("%s: could not allocate rx mbuf\n", + USBDEVNAME(sc->sc_dev)); + error = ENOMEM; + goto fail; + } + + MCLGET(data->m, M_DONTWAIT); + if (!(data->m->m_flags & M_EXT)) { + printf("%s: could not allocate rx mbuf cluster\n", + USBDEVNAME(sc->sc_dev)); + error = ENOMEM; + goto fail; + } + + data->buf = mtod(data->m, uint8_t *); + } + + return 0; + +fail: rum_free_tx_list(sc); + return error; +} + +Static void +rum_free_rx_list(struct rum_softc *sc) +{ + struct rum_rx_data *data; + int i; + + for (i = 0; i < RT2573_RX_LIST_COUNT; i++) { + data = &sc->rx_data[i]; + + if (data->xfer != NULL) { + usbd_free_xfer(data->xfer); + data->xfer = NULL; + } + + if (data->m != NULL) { + m_freem(data->m); + data->m = NULL; + } + } +} + +Static int +rum_media_change(struct ifnet *ifp) +{ + struct rum_softc *sc = ifp->if_softc; + int error; + + error = ieee80211_media_change(ifp); + if (error != ENETRESET) + return error; + + if ((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING)) + rum_init(sc); + + return 0; +} + +/* + * This function is called periodically (every 200ms) during scanning to + * switch from one channel to another. + */ +Static void +rum_next_scan(void *arg) +{ + struct rum_softc *sc = arg; + struct ieee80211com *ic = &sc->sc_ic; + + if (ic->ic_state == IEEE80211_S_SCAN) + ieee80211_next_scan(ic); +} + +Static void +rum_task(void *arg) +{ + struct rum_softc *sc = arg; + struct ieee80211com *ic = &sc->sc_ic; + enum ieee80211_state ostate; + struct ieee80211_node *ni; + uint32_t tmp; + + ostate = ic->ic_state; + + switch (sc->sc_state) { + case IEEE80211_S_INIT: + if (ostate == IEEE80211_S_RUN) { + /* abort TSF synchronization */ + tmp = rum_read(sc, RT2573_TXRX_CSR9); + rum_write(sc, RT2573_TXRX_CSR9, tmp & ~0x00ffffff); + } + break; + + case IEEE80211_S_SCAN: + rum_set_chan(sc, ic->ic_curchan); + callout_reset(&sc->scan_ch, hz / 5, rum_next_scan, sc); + break; + + case IEEE80211_S_AUTH: + rum_set_chan(sc, ic->ic_curchan); + break; + + case IEEE80211_S_ASSOC: + rum_set_chan(sc, ic->ic_curchan); + break; + + case IEEE80211_S_RUN: + rum_set_chan(sc, ic->ic_curchan); + + ni = ic->ic_bss; + + if (ic->ic_opmode != IEEE80211_M_MONITOR) { + rum_update_slot(sc); + rum_enable_mrr(sc); + rum_set_txpreamble(sc); + rum_set_basicrates(sc); + rum_set_bssid(sc, ni->ni_bssid); + } + + if (ic->ic_opmode == IEEE80211_M_HOSTAP || + ic->ic_opmode == IEEE80211_M_IBSS) + rum_prepare_beacon(sc); + + if (ic->ic_opmode != IEEE80211_M_MONITOR) + rum_enable_tsf_sync(sc); + + /* enable automatic rate adaptation in STA mode */ + if (ic->ic_opmode == IEEE80211_M_STA && + ic->ic_fixed_rate == IEEE80211_FIXED_RATE_NONE) + rum_amrr_start(sc, ni); + + break; + } + + sc->sc_newstate(ic, sc->sc_state, -1); +} + +Static int +rum_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg) +{ + struct rum_softc *sc = ic->ic_ifp->if_softc; + + usb_rem_task(sc->sc_udev, &sc->sc_task); + callout_stop(&sc->scan_ch); + callout_stop(&sc->amrr_ch); + + /* do it in a process context */ + sc->sc_state = nstate; + usb_add_task(sc->sc_udev, &sc->sc_task); + + return 0; +} + +/* quickly determine if a given rate is CCK or OFDM */ +#define RUM_RATE_IS_OFDM(rate) ((rate) >= 12 && (rate) != 22) + +#define RUM_ACK_SIZE 14 /* 10 + 4(FCS) */ +#define RUM_CTS_SIZE 14 /* 10 + 4(FCS) */ + +Static void +rum_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) +{ + struct rum_tx_data *data = priv; + struct rum_softc *sc = data->sc; + struct ifnet *ifp = sc->sc_ifp; + int s; + + if (status != USBD_NORMAL_COMPLETION) { + if (status == USBD_NOT_STARTED || status == USBD_CANCELLED) + return; + + printf("%s: could not transmit buffer: %s\n", + USBDEVNAME(sc->sc_dev), usbd_errstr(status)); + + if (status == USBD_STALLED) + usbd_clear_endpoint_stall_async(sc->sc_tx_pipeh); + + ifp->if_oerrors++; + return; + } + + s = splnet(); + + m_freem(data->m); + data->m = NULL; + ieee80211_free_node(data->ni); + data->ni = NULL; + + sc->tx_queued--; + ifp->if_opackets++; + + DPRINTFN(10, ("tx done\n")); + + sc->sc_tx_timer = 0; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + rum_start(ifp); + + splx(s); +} + +Static void +rum_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) +{ + struct rum_rx_data *data = priv; + struct rum_softc *sc = data->sc; + struct ieee80211com *ic = &sc->sc_ic; + struct ifnet *ifp = sc->sc_ifp; + struct rum_rx_desc *desc; + struct ieee80211_frame *wh; + struct ieee80211_node *ni; + struct mbuf *mnew, *m; + int s, len; + + if (status != USBD_NORMAL_COMPLETION) { + if (status == USBD_NOT_STARTED || status == USBD_CANCELLED) + return; + + if (status == USBD_STALLED) + usbd_clear_endpoint_stall_async(sc->sc_rx_pipeh); + goto skip; + } + + usbd_get_xfer_status(xfer, NULL, NULL, &len, NULL); + + if (len < RT2573_RX_DESC_SIZE + sizeof (struct ieee80211_frame_min)) { + DPRINTF(("%s: xfer too short %d\n", USBDEVNAME(sc->sc_dev), + len)); + ifp->if_ierrors++; + goto skip; + } + + desc = (struct rum_rx_desc *)data->buf; + + if (le32toh(desc->flags) & RT2573_RX_CRC_ERROR) { + /* + * This should not happen since we did not request to receive + * those frames when we filled RT2573_TXRX_CSR0. + */ + DPRINTFN(5, ("CRC error\n")); + ifp->if_ierrors++; + goto skip; + } + + MGETHDR(mnew, M_DONTWAIT, MT_DATA); + if (mnew == NULL) { + printf("%s: could not allocate rx mbuf\n", + USBDEVNAME(sc->sc_dev)); + ifp->if_ierrors++; + goto skip; + } + + MCLGET(mnew, M_DONTWAIT); + if (!(mnew->m_flags & M_EXT)) { + printf("%s: could not allocate rx mbuf cluster\n", + USBDEVNAME(sc->sc_dev)); + m_freem(mnew); + ifp->if_ierrors++; + goto skip; + } + + m = data->m; + data->m = mnew; + data->buf = mtod(data->m, uint8_t *); + + /* finalize mbuf */ + m->m_pkthdr.rcvif = ifp; + m->m_data = (caddr_t)(desc + 1); + m->m_pkthdr.len = m->m_len = (le32toh(desc->flags) >> 16) & 0xfff; + + s = splnet(); + + if (sc->sc_drvbpf != NULL) { + struct rum_rx_radiotap_header *tap = &sc->sc_rxtap; + + tap->wr_flags = IEEE80211_RADIOTAP_F_FCS; + tap->wr_rate = rum_rxrate(desc); + tap->wr_chan_freq = htole16(ic->ic_curchan->ic_freq); + tap->wr_chan_flags = htole16(ic->ic_curchan->ic_flags); + tap->wr_antenna = sc->rx_ant; + tap->wr_antsignal = desc->rssi; + + bpf_mtap2(sc->sc_drvbpf, tap, sc->sc_rxtap_len, m); + } + + wh = mtod(m, struct ieee80211_frame *); + ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); + + /* send the frame to the 802.11 layer */ + ieee80211_input(ic, m, ni, desc->rssi, 0); + + /* node is no longer needed */ + ieee80211_free_node(ni); + + splx(s); + + DPRINTFN(15, ("rx done\n")); + +skip: /* setup a new transfer */ + usbd_setup_xfer(xfer, sc->sc_rx_pipeh, data, data->buf, MCLBYTES, + USBD_SHORT_XFER_OK, USBD_NO_TIMEOUT, rum_rxeof); + usbd_transfer(xfer); +} + +/* + * This function is only used by the Rx radiotap code. It returns the rate at + * which a given frame was received. + */ +Static uint8_t +rum_rxrate(struct rum_rx_desc *desc) +{ + if (le32toh(desc->flags) & RT2573_RX_OFDM) { + /* reverse function of rum_plcp_signal */ + switch (desc->rate) { + case 0xb: return 12; + case 0xf: return 18; + case 0xa: return 24; + case 0xe: return 36; + case 0x9: return 48; + case 0xd: return 72; + case 0x8: return 96; + case 0xc: return 108; + } + } else { + if (desc->rate == 10) + return 2; + if (desc->rate == 20) + return 4; + if (desc->rate == 55) + return 11; + if (desc->rate == 110) + return 22; + } + return 2; /* should not get there */ +} + +/* + * Return the expected ack rate for a frame transmitted at rate `rate'. + * XXX: this should depend on the destination node basic rate set. + */ +Static int +rum_ack_rate(struct ieee80211com *ic, int rate) +{ + switch (rate) { + /* CCK rates */ + case 2: + return 2; + case 4: + case 11: + case 22: + return (ic->ic_curmode == IEEE80211_MODE_11B) ? 4 : rate; + + /* OFDM rates */ + case 12: + case 18: + return 12; + case 24: + case 36: + return 24; + case 48: + case 72: + case 96: + case 108: + return 48; + } + + /* default to 1Mbps */ + return 2; +} + +/* + * Compute the duration (in us) needed to transmit `len' bytes at rate `rate'. + * The function automatically determines the operating mode depending on the + * given rate. `flags' indicates whether short preamble is in use or not. + */ +Static uint16_t +rum_txtime(int len, int rate, uint32_t flags) +{ + uint16_t txtime; + + if (RUM_RATE_IS_OFDM(rate)) { + /* IEEE Std 802.11a-1999, pp. 37 */ + txtime = (8 + 4 * len + 3 + rate - 1) / rate; + txtime = 16 + 4 + 4 * txtime + 6; + } else { + /* IEEE Std 802.11b-1999, pp. 28 */ + txtime = (16 * len + rate - 1) / rate; + if (rate != 2 && (flags & IEEE80211_F_SHPREAMBLE)) + txtime += 72 + 24; + else + txtime += 144 + 48; + } + return txtime; +} + +Static uint8_t +rum_plcp_signal(int rate) +{ + switch (rate) { + /* CCK rates (returned values are device-dependent) */ + case 2: return 0x0; + case 4: return 0x1; + case 11: return 0x2; + case 22: return 0x3; + + /* OFDM rates (cf IEEE Std 802.11a-1999, pp. 14 Table 80) */ + case 12: return 0xb; + case 18: return 0xf; + case 24: return 0xa; + case 36: return 0xe; + case 48: return 0x9; + case 72: return 0xd; + case 96: return 0x8; + case 108: return 0xc; + + /* unsupported rates (should not get there) */ + default: return 0xff; + } +} + +Static void +rum_setup_tx_desc(struct rum_softc *sc, struct rum_tx_desc *desc, + uint32_t flags, uint16_t xflags, int len, int rate) +{ + struct ieee80211com *ic = &sc->sc_ic; + uint16_t plcp_length; + int remainder; + + desc->flags = htole32(flags); + desc->flags |= htole32(RT2573_TX_VALID); + desc->flags |= htole32(len << 16); + + desc->xflags = htole16(xflags); + + desc->wme = htole16( + RT2573_QID(0) | + RT2573_AIFSN(2) | + RT2573_LOGCWMIN(4) | + RT2573_LOGCWMAX(10)); + + /* setup PLCP fields */ + desc->plcp_signal = rum_plcp_signal(rate); + desc->plcp_service = 4; + + len += IEEE80211_CRC_LEN; + if (RUM_RATE_IS_OFDM(rate)) { + desc->flags |= htole32(RT2573_TX_OFDM); + + plcp_length = len & 0xfff; + desc->plcp_length_hi = plcp_length >> 6; + desc->plcp_length_lo = plcp_length & 0x3f; + } else { + plcp_length = (16 * len + rate - 1) / rate; + if (rate == 22) { + remainder = (16 * len) % 22; + if (remainder != 0 && remainder < 7) + desc->plcp_service |= RT2573_PLCP_LENGEXT; + } + desc->plcp_length_hi = plcp_length >> 8; + desc->plcp_length_lo = plcp_length & 0xff; + + if (rate != 2 && (ic->ic_flags & IEEE80211_F_SHPREAMBLE)) + desc->plcp_signal |= 0x08; + } +} + +#define RUM_TX_TIMEOUT 5000 + +Static int +rum_tx_mgt(struct rum_softc *sc, struct mbuf *m0, struct ieee80211_node *ni) +{ + struct ieee80211com *ic = &sc->sc_ic; + struct rum_tx_desc *desc; + struct rum_tx_data *data; + struct ieee80211_frame *wh; + uint32_t flags = 0; + uint16_t dur; + usbd_status error; + int xferlen, rate; + + data = &sc->tx_data[0]; + desc = (struct rum_tx_desc *)data->buf; + + rate = IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan) ? 12 : 2; + + data->m = m0; + data->ni = ni; + + wh = mtod(m0, struct ieee80211_frame *); + + if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { + flags |= RT2573_TX_ACK; + + dur = rum_txtime(RUM_ACK_SIZE, rum_ack_rate(ic, rate), + ic->ic_flags) + sc->sifs; + *(uint16_t *)wh->i_dur = htole16(dur); + + /* tell hardware to set timestamp in probe responses */ + if ((wh->i_fc[0] & + (IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_MASK)) == + (IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_PROBE_RESP)) + flags |= RT2573_TX_TIMESTAMP; + } + +#if NBPFILTER > 0 + if (sc->sc_drvbpf != NULL) { + struct rum_tx_radiotap_header *tap = &sc->sc_txtap; + + tap->wt_flags = 0; + tap->wt_rate = rate; + tap->wt_chan_freq = htole16(ic->ic_curchan->ic_freq); + tap->wt_chan_flags = htole16(ic->ic_curchan->ic_flags); + tap->wt_antenna = sc->tx_ant; + + bpf_mtap2(sc->sc_drvbpf, tap, sc->sc_txtap_len, m0); + } +#endif + + m_copydata(m0, 0, m0->m_pkthdr.len, data->buf + RT2573_TX_DESC_SIZE); + rum_setup_tx_desc(sc, desc, flags, 0, m0->m_pkthdr.len, rate); + + /* align end on a 4-bytes boundary */ + xferlen = (RT2573_TX_DESC_SIZE + m0->m_pkthdr.len + 3) & ~3; + + /* + * No space left in the last URB to store the extra 4 bytes, force + * sending of another URB. + */ + if ((xferlen % 64) == 0) + xferlen += 4; + + DPRINTFN(10, ("sending msg frame len=%u rate=%u xfer len=%u\n", + m0->m_pkthdr.len + RT2573_TX_DESC_SIZE, rate, xferlen)); + + usbd_setup_xfer(data->xfer, sc->sc_tx_pipeh, data, data->buf, xferlen, + USBD_FORCE_SHORT_XFER | USBD_NO_COPY, RUM_TX_TIMEOUT, rum_txeof); + + error = usbd_transfer(data->xfer); + if (error != USBD_NORMAL_COMPLETION && error != USBD_IN_PROGRESS) { + m_freem(m0); + return error; + } + + sc->tx_queued++; + + return 0; +} + +Static int +rum_tx_data(struct rum_softc *sc, struct mbuf *m0, struct ieee80211_node *ni) +{ + struct ieee80211com *ic = &sc->sc_ic; + struct rum_tx_desc *desc; + struct rum_tx_data *data; + struct ieee80211_frame *wh; + struct ieee80211_key *k; + uint32_t flags = 0; + uint16_t dur; + usbd_status error; + int xferlen, rate; + + wh = mtod(m0, struct ieee80211_frame *); + + if (ic->ic_fixed_rate != IEEE80211_FIXED_RATE_NONE) + rate = ic->ic_bss->ni_rates.rs_rates[ic->ic_fixed_rate]; + else + rate = ni->ni_rates.rs_rates[ni->ni_txrate]; + rate &= IEEE80211_RATE_VAL; + + if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + k = ieee80211_crypto_encap(ic, ni, m0); + if (k == NULL) { + m_freem(m0); + return ENOBUFS; + } + + /* packet header may have moved, reset our local pointer */ + wh = mtod(m0, struct ieee80211_frame *); + } + + data = &sc->tx_data[0]; + desc = (struct rum_tx_desc *)data->buf; + + data->m = m0; + data->ni = ni; + + if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { + flags |= RT2573_TX_ACK; + + dur = rum_txtime(RUM_ACK_SIZE, rum_ack_rate(ic, rate), + ic->ic_flags) + sc->sifs; + *(uint16_t *)wh->i_dur = htole16(dur); + } + +#if NBPFILTER > 0 + if (sc->sc_drvbpf != NULL) { + struct rum_tx_radiotap_header *tap = &sc->sc_txtap; + + tap->wt_flags = 0; + tap->wt_rate = rate; + tap->wt_chan_freq = htole16(ic->ic_curchan->ic_freq); + tap->wt_chan_flags = htole16(ic->ic_curchan->ic_flags); + tap->wt_antenna = sc->tx_ant; + + bpf_mtap2(sc->sc_drvbpf, tap, sc->sc_txtap_len, m0); + } +#endif + + m_copydata(m0, 0, m0->m_pkthdr.len, data->buf + RT2573_TX_DESC_SIZE); + rum_setup_tx_desc(sc, desc, flags, 0, m0->m_pkthdr.len, rate); + + /* align end on a 4-bytes boundary */ + xferlen = (RT2573_TX_DESC_SIZE + m0->m_pkthdr.len + 3) & ~3; + + /* + * No space left in the last URB to store the extra 4 bytes, force + * sending of another URB. + */ + if ((xferlen % 64) == 0) + xferlen += 4; + + DPRINTFN(10, ("sending data frame len=%u rate=%u xfer len=%u\n", + m0->m_pkthdr.len + RT2573_TX_DESC_SIZE, rate, xferlen)); + + usbd_setup_xfer(data->xfer, sc->sc_tx_pipeh, data, data->buf, xferlen, + USBD_FORCE_SHORT_XFER | USBD_NO_COPY, RUM_TX_TIMEOUT, rum_txeof); + + error = usbd_transfer(data->xfer); + if (error != USBD_NORMAL_COMPLETION && error != USBD_IN_PROGRESS) { + m_freem(m0); + return error; + } + + sc->tx_queued++; + + return 0; +} + +Static void +rum_start(struct ifnet *ifp) +{ + struct rum_softc *sc = ifp->if_softc; + struct ieee80211com *ic = &sc->sc_ic; + struct mbuf *m0; + struct ether_header *eh; + struct ieee80211_node *ni; + + for (;;) { + IF_POLL(&ic->ic_mgtq, m0); + if (m0 != NULL) { + if (sc->tx_queued >= RT2573_TX_LIST_COUNT) { + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + break; + } + IF_DEQUEUE(&ic->ic_mgtq, m0); + + ni = (struct ieee80211_node *)m0->m_pkthdr.rcvif; + m0->m_pkthdr.rcvif = NULL; + + if (ic->ic_rawbpf != NULL) + bpf_mtap(ic->ic_rawbpf, m0); + + if (rum_tx_mgt(sc, m0, ni) != 0) + break; + + } else { + if (ic->ic_state != IEEE80211_S_RUN) + break; + IFQ_POLL(&ifp->if_snd, m0); + if (m0 == NULL) + break; + if (sc->tx_queued >= RT2573_TX_LIST_COUNT) { +//FIXME + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + break; + } + IFQ_DEQUEUE(&ifp->if_snd, m0); + if (m0->m_len < sizeof(struct ether_header) && + !(m0 = m_pullup(m0, sizeof(struct ether_header)))) + continue; + + eh = mtod(m0, struct ether_header *); + ni = ieee80211_find_txnode(ic, eh->ether_dhost); + if (ni == NULL) { + m_freem(m0); + continue; + } + if (ifp->if_bpf != NULL) + bpf_mtap(ifp->if_bpf, m0); + m0 = ieee80211_encap(ic, m0, ni); + if (m0 == NULL) { + ieee80211_free_node(ni); + continue; + } + + if (ic->ic_rawbpf != NULL) + bpf_mtap(ic->ic_rawbpf, m0); + + if (rum_tx_data(sc, m0, ni) != 0) { + ieee80211_free_node(ni); + ifp->if_oerrors++; + break; + } + } + + sc->sc_tx_timer = 5; + ifp->if_timer = 1; + } +} + +Static void +rum_watchdog(struct ifnet *ifp) +{ + struct rum_softc *sc = ifp->if_softc; + struct ieee80211com *ic = &sc->sc_ic; + + ifp->if_timer = 0; + + if (sc->sc_tx_timer > 0) { + if (--sc->sc_tx_timer == 0) { + printf("%s: device timeout\n", USBDEVNAME(sc->sc_dev)); + /*rum_init(ifp); XXX needs a process context! */ + ifp->if_oerrors++; + return; + } + ifp->if_timer = 1; + } + + ieee80211_watchdog(ic); +} + +Static int +rum_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) +{ + struct rum_softc *sc = ifp->if_softc; + struct ieee80211com *ic = &sc->sc_ic; + int s, error = 0; + + s = splnet(); + + switch (cmd) { + case SIOCSIFFLAGS: + if (ifp->if_flags & IFF_UP) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + rum_update_promisc(sc); + else + rum_init(sc); + } else { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + rum_stop(ifp); + } + break; + + default: + error = ieee80211_ioctl(ic, cmd, data); + } + + if (error == ENETRESET) { + if ((ifp->if_flags & IFF_UP) && + (ifp->if_drv_flags & IFF_DRV_RUNNING)) + rum_init(sc); + error = 0; + } + + splx(s); + + return error; +} + +Static void +rum_eeprom_read(struct rum_softc *sc, uint16_t addr, void *buf, int len) +{ + usb_device_request_t req; + usbd_status error; + + req.bmRequestType = UT_READ_VENDOR_DEVICE; + req.bRequest = RT2573_READ_EEPROM; + USETW(req.wValue, 0); + USETW(req.wIndex, addr); + USETW(req.wLength, len); + + error = usbd_do_request(sc->sc_udev, &req, buf); + if (error != 0) { + printf("%s: could not read EEPROM: %s\n", + USBDEVNAME(sc->sc_dev), usbd_errstr(error)); + } +} + +Static uint32_t +rum_read(struct rum_softc *sc, uint16_t reg) +{ + uint32_t val; + + rum_read_multi(sc, reg, &val, sizeof val); + + return le32toh(val); +} + +Static void +rum_read_multi(struct rum_softc *sc, uint16_t reg, void *buf, int len) +{ + usb_device_request_t req; + usbd_status error; + + req.bmRequestType = UT_READ_VENDOR_DEVICE; + req.bRequest = RT2573_READ_MULTI_MAC; + USETW(req.wValue, 0); + USETW(req.wIndex, reg); + USETW(req.wLength, len); + + error = usbd_do_request(sc->sc_udev, &req, buf); + if (error != 0) { + printf("%s: could not multi read MAC register: %s\n", + USBDEVNAME(sc->sc_dev), usbd_errstr(error)); + } +} + +Static void +rum_write(struct rum_softc *sc, uint16_t reg, uint32_t val) +{ + uint32_t tmp = htole32(val); + + rum_write_multi(sc, reg, &tmp, sizeof tmp); +} + +Static void +rum_write_multi(struct rum_softc *sc, uint16_t reg, void *buf, size_t len) +{ + usb_device_request_t req; + usbd_status error; + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = RT2573_WRITE_MULTI_MAC; + USETW(req.wValue, 0); + USETW(req.wIndex, reg); + USETW(req.wLength, len); + + error = usbd_do_request(sc->sc_udev, &req, buf); + if (error != 0) { + printf("%s: could not multi write MAC register: %s\n", + USBDEVNAME(sc->sc_dev), usbd_errstr(error)); + } +} + +Static void +rum_bbp_write(struct rum_softc *sc, uint8_t reg, uint8_t val) +{ + uint32_t tmp; + int ntries; + + for (ntries = 0; ntries < 5; ntries++) { + if (!(rum_read(sc, RT2573_PHY_CSR3) & RT2573_BBP_BUSY)) + break; + } + if (ntries == 5) { + printf("%s: could not write to BBP\n", USBDEVNAME(sc->sc_dev)); + return; + } + + tmp = RT2573_BBP_BUSY | (reg & 0x7f) << 8 | val; + rum_write(sc, RT2573_PHY_CSR3, tmp); +} + +Static uint8_t +rum_bbp_read(struct rum_softc *sc, uint8_t reg) +{ + uint32_t val; + int ntries; + + for (ntries = 0; ntries < 5; ntries++) { + if (!(rum_read(sc, RT2573_PHY_CSR3) & RT2573_BBP_BUSY)) + break; + } + if (ntries == 5) { + printf("%s: could not read BBP\n", USBDEVNAME(sc->sc_dev)); + return 0; + } + + val = RT2573_BBP_BUSY | RT2573_BBP_READ | reg << 8; + rum_write(sc, RT2573_PHY_CSR3, val); + + for (ntries = 0; ntries < 100; ntries++) { + val = rum_read(sc, RT2573_PHY_CSR3); + if (!(val & RT2573_BBP_BUSY)) + return val & 0xff; + DELAY(1); + } + + printf("%s: could not read BBP\n", USBDEVNAME(sc->sc_dev)); + return 0; +} + +Static void +rum_rf_write(struct rum_softc *sc, uint8_t reg, uint32_t val) +{ + uint32_t tmp; + int ntries; + + for (ntries = 0; ntries < 5; ntries++) { + if (!(rum_read(sc, RT2573_PHY_CSR4) & RT2573_RF_BUSY)) + break; + } + if (ntries == 5) { + printf("%s: could not write to RF\n", USBDEVNAME(sc->sc_dev)); + return; + } + + tmp = RT2573_RF_BUSY | RT2573_RF_20BIT | (val & 0xfffff) << 2 | + (reg & 3); + rum_write(sc, RT2573_PHY_CSR4, tmp); + + /* remember last written value in sc */ + sc->rf_regs[reg] = val; + + DPRINTFN(15, ("RF R[%u] <- 0x%05x\n", reg & 3, val & 0xfffff)); +} + +Static void +rum_select_antenna(struct rum_softc *sc) +{ + uint8_t bbp4, bbp77; + uint32_t tmp; + + bbp4 = rum_bbp_read(sc, 4); + bbp77 = rum_bbp_read(sc, 77); + + /* TBD */ + + /* make sure Rx is disabled before switching antenna */ + tmp = rum_read(sc, RT2573_TXRX_CSR0); + rum_write(sc, RT2573_TXRX_CSR0, tmp | RT2573_DISABLE_RX); + + rum_bbp_write(sc, 4, bbp4); + rum_bbp_write(sc, 77, bbp77); + + rum_write(sc, RT2573_TXRX_CSR0, tmp); +} + +/* + * Enable multi-rate retries for frames sent at OFDM rates. + * In 802.11b/g mode, allow fallback to CCK rates. + */ +Static void +rum_enable_mrr(struct rum_softc *sc) +{ + struct ieee80211com *ic = &sc->sc_ic; + uint32_t tmp; + + tmp = rum_read(sc, RT2573_TXRX_CSR4); + + tmp &= ~RT2573_MRR_CCK_FALLBACK; + if (!IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan)) + tmp |= RT2573_MRR_CCK_FALLBACK; + tmp |= RT2573_MRR_ENABLED; + + rum_write(sc, RT2573_TXRX_CSR4, tmp); +} + +Static void +rum_set_txpreamble(struct rum_softc *sc) +{ + uint32_t tmp; + + tmp = rum_read(sc, RT2573_TXRX_CSR4); + + tmp &= ~RT2573_SHORT_PREAMBLE; + if (sc->sc_ic.ic_flags & IEEE80211_F_SHPREAMBLE) + tmp |= RT2573_SHORT_PREAMBLE; + + rum_write(sc, RT2573_TXRX_CSR4, tmp); +} + +Static void +rum_set_basicrates(struct rum_softc *sc) +{ + struct ieee80211com *ic = &sc->sc_ic; + + /* update basic rate set */ + if (ic->ic_curmode == IEEE80211_MODE_11B) { + /* 11b basic rates: 1, 2Mbps */ + rum_write(sc, RT2573_TXRX_CSR5, 0x3); + } else if (IEEE80211_IS_CHAN_5GHZ(ic->ic_bss->ni_chan)) { + /* 11a basic rates: 6, 12, 24Mbps */ + rum_write(sc, RT2573_TXRX_CSR5, 0x150); + } else { + /* 11g basic rates: 1, 2, 5.5, 11, 6, 12, 24Mbps */ + rum_write(sc, RT2573_TXRX_CSR5, 0x15f); + } +} + +/* + * Reprogram MAC/BBP to switch to a new band. Values taken from the reference + * driver. + */ +Static void +rum_select_band(struct rum_softc *sc, struct ieee80211_channel *c) +{ + uint8_t bbp17, bbp35, bbp96, bbp97, bbp98, bbp104; + uint32_t tmp; + + /* update all BBP registers that depend on the band */ + bbp17 = 0x20; bbp96 = 0x48; bbp104 = 0x2c; + bbp35 = 0x50; bbp97 = 0x48; bbp98 = 0x48; + if (IEEE80211_IS_CHAN_5GHZ(c)) { + bbp17 += 0x08; bbp96 += 0x10; bbp104 += 0x0c; + bbp35 += 0x10; bbp97 += 0x10; bbp98 += 0x10; + } + if ((IEEE80211_IS_CHAN_2GHZ(c) && sc->ext_2ghz_lna) || + (IEEE80211_IS_CHAN_5GHZ(c) && sc->ext_5ghz_lna)) { + bbp17 += 0x10; bbp96 += 0x10; bbp104 += 0x10; + } + + sc->bbp17 = bbp17; + rum_bbp_write(sc, 17, bbp17); + rum_bbp_write(sc, 96, bbp96); + rum_bbp_write(sc, 104, bbp104); + + if ((IEEE80211_IS_CHAN_2GHZ(c) && sc->ext_2ghz_lna) || + (IEEE80211_IS_CHAN_5GHZ(c) && sc->ext_5ghz_lna)) { + rum_bbp_write(sc, 75, 0x80); + rum_bbp_write(sc, 86, 0x80); + rum_bbp_write(sc, 88, 0x80); + } + + rum_bbp_write(sc, 35, bbp35); + rum_bbp_write(sc, 97, bbp97); + rum_bbp_write(sc, 98, bbp98); + + tmp = rum_read(sc, RT2573_PHY_CSR0); + tmp &= ~(RT2573_PA_PE_2GHZ | RT2573_PA_PE_5GHZ); + if (IEEE80211_IS_CHAN_2GHZ(c)) + tmp |= RT2573_PA_PE_2GHZ; + else + tmp |= RT2573_PA_PE_5GHZ; + rum_write(sc, RT2573_PHY_CSR0, tmp); + + /* 802.11a uses a 16 microseconds short interframe space */ + sc->sifs = IEEE80211_IS_CHAN_5GHZ(c) ? 16 : 10; +} + +Static void +rum_set_chan(struct rum_softc *sc, struct ieee80211_channel *c) +{ + struct ieee80211com *ic = &sc->sc_ic; + const struct rfprog *rfprog; + uint8_t bbp3, bbp94 = RT2573_BBPR94_DEFAULT; + int8_t power; + u_int i, chan; + + chan = ieee80211_chan2ieee(ic, c); + if (chan == 0 || chan == IEEE80211_CHAN_ANY) + return; + + /* select the appropriate RF settings based on what EEPROM says */ + rfprog = (sc->rf_rev == RT2573_RF_5225 || + sc->rf_rev == RT2573_RF_2527) ? rum_rf5225 : rum_rf5226; + + /* find the settings for this channel (we know it exists) */ + for (i = 0; rfprog[i].chan != chan; i++); + + power = sc->txpow[i]; + if (power < 0) { + bbp94 += power; + power = 0; + } else if (power > 31) { + bbp94 += power - 31; + power = 31; + } + + /* + * If we are switching from the 2GHz band to the 5GHz band or + * vice-versa, BBP registers need to be reprogrammed. + */ + if (c->ic_flags != ic->ic_curchan->ic_flags) { + rum_select_band(sc, c); + rum_select_antenna(sc); + } + ic->ic_curchan = c; + + rum_rf_write(sc, RT2573_RF1, rfprog[i].r1); + rum_rf_write(sc, RT2573_RF2, rfprog[i].r2); + rum_rf_write(sc, RT2573_RF3, rfprog[i].r3 | power << 7); + rum_rf_write(sc, RT2573_RF4, rfprog[i].r4 | sc->rffreq << 10); + + rum_rf_write(sc, RT2573_RF1, rfprog[i].r1); + rum_rf_write(sc, RT2573_RF2, rfprog[i].r2); + rum_rf_write(sc, RT2573_RF3, rfprog[i].r3 | power << 7 | 1); + rum_rf_write(sc, RT2573_RF4, rfprog[i].r4 | sc->rffreq << 10); + + rum_rf_write(sc, RT2573_RF1, rfprog[i].r1); + rum_rf_write(sc, RT2573_RF2, rfprog[i].r2); + rum_rf_write(sc, RT2573_RF3, rfprog[i].r3 | power << 7); + rum_rf_write(sc, RT2573_RF4, rfprog[i].r4 | sc->rffreq << 10); + + DELAY(10); + + /* enable smart mode for MIMO-capable RFs */ + bbp3 = rum_bbp_read(sc, 3); + + bbp3 &= ~RT2573_SMART_MODE; + if (sc->rf_rev == RT2573_RF_5225 || sc->rf_rev == RT2573_RF_2527) + bbp3 |= RT2573_SMART_MODE; + + rum_bbp_write(sc, 3, bbp3); + + if (bbp94 != RT2573_BBPR94_DEFAULT) + rum_bbp_write(sc, 94, bbp94); +} + +/* + * Enable TSF synchronization and tell h/w to start sending beacons for IBSS + * and HostAP operating modes. + */ +Static void +rum_enable_tsf_sync(struct rum_softc *sc) +{ + struct ieee80211com *ic = &sc->sc_ic; + uint32_t tmp; + + if (ic->ic_opmode != IEEE80211_M_STA) { + /* + * Change default 16ms TBTT adjustment to 8ms. + * Must be done before enabling beacon generation. + */ + rum_write(sc, RT2573_TXRX_CSR10, 1 << 12 | 8); + } + + tmp = rum_read(sc, RT2573_TXRX_CSR9) & 0xff000000; + + /* set beacon interval (in 1/16ms unit) */ + tmp |= ic->ic_bss->ni_intval * 16; + + tmp |= RT2573_TSF_TICKING | RT2573_ENABLE_TBTT; + if (ic->ic_opmode == IEEE80211_M_STA) + tmp |= RT2573_TSF_MODE(1); + else + tmp |= RT2573_TSF_MODE(2) | RT2573_GENERATE_BEACON; + + rum_write(sc, RT2573_TXRX_CSR9, tmp); +} + +Static void +rum_update_slot(struct rum_softc *sc) +{ + struct ieee80211com *ic = &sc->sc_ic; + uint8_t slottime; + uint32_t tmp; + + slottime = (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20; + + tmp = rum_read(sc, RT2573_MAC_CSR9); + tmp = (tmp & ~0xff) | slottime; + rum_write(sc, RT2573_MAC_CSR9, tmp); + + DPRINTF(("setting slot time to %uus\n", slottime)); +} + +Static void +rum_set_bssid(struct rum_softc *sc, const uint8_t *bssid) +{ + uint32_t tmp; + + tmp = bssid[0] | bssid[1] << 8 | bssid[2] << 16 | bssid[3] << 24; + rum_write(sc, RT2573_MAC_CSR4, tmp); + + tmp = bssid[4] | bssid[5] << 8 | RT2573_ONE_BSSID << 16; + rum_write(sc, RT2573_MAC_CSR5, tmp); +} + +Static void +rum_set_macaddr(struct rum_softc *sc, const uint8_t *addr) +{ + uint32_t tmp; + + tmp = addr[0] | addr[1] << 8 | addr[2] << 16 | addr[3] << 24; + rum_write(sc, RT2573_MAC_CSR2, tmp); + + tmp = addr[4] | addr[5] << 8 | 0xff << 16; + rum_write(sc, RT2573_MAC_CSR3, tmp); +} + +Static void +rum_update_promisc(struct rum_softc *sc) +{ + struct ifnet *ifp = sc->sc_ic.ic_ifp; + uint32_t tmp; + + tmp = rum_read(sc, RT2573_TXRX_CSR0); + + tmp &= ~RT2573_DROP_NOT_TO_ME; + if (!(ifp->if_flags & IFF_PROMISC)) + tmp |= RT2573_DROP_NOT_TO_ME; + + rum_write(sc, RT2573_TXRX_CSR0, tmp); + + DPRINTF(("%s promiscuous mode\n", (ifp->if_flags & IFF_PROMISC) ? + "entering" : "leaving")); +} + +Static const char * +rum_get_rf(int rev) +{ + switch (rev) { + case RT2573_RF_2527: return "RT2527 (MIMO XR)"; + case RT2573_RF_2528: return "RT2528"; + case RT2573_RF_5225: return "RT5225 (MIMO XR)"; + case RT2573_RF_5226: return "RT5226"; + default: return "unknown"; + } +} + +Static void +rum_read_eeprom(struct rum_softc *sc) +{ + struct ieee80211com *ic = &sc->sc_ic; + uint16_t val; +#ifdef RUM_DEBUG + int i; +#endif + + /* read MAC/BBP type */ + rum_eeprom_read(sc, RT2573_EEPROM_MACBBP, &val, 2); + sc->macbbp_rev = le16toh(val); + + /* read MAC address */ + rum_eeprom_read(sc, RT2573_EEPROM_ADDRESS, ic->ic_myaddr, 6); + + rum_eeprom_read(sc, RT2573_EEPROM_ANTENNA, &val, 2); + val = le16toh(val); + sc->rf_rev = (val >> 11) & 0x1f; + sc->hw_radio = (val >> 10) & 0x1; + sc->rx_ant = (val >> 4) & 0x3; + sc->tx_ant = (val >> 2) & 0x3; + sc->nb_ant = val & 0x3; + + DPRINTF(("RF revision=%d\n", sc->rf_rev)); + + rum_eeprom_read(sc, RT2573_EEPROM_CONFIG2, &val, 2); + val = le16toh(val); + sc->ext_5ghz_lna = (val >> 6) & 0x1; + sc->ext_2ghz_lna = (val >> 4) & 0x1; + + DPRINTF(("External 2GHz LNA=%d\nExternal 5GHz LNA=%d\n", + sc->ext_2ghz_lna, sc->ext_5ghz_lna)); + + rum_eeprom_read(sc, RT2573_EEPROM_RSSI_2GHZ_OFFSET, &val, 2); + val = le16toh(val); + if ((val & 0xff) != 0xff) + sc->rssi_2ghz_corr = (int8_t)(val & 0xff); /* signed */ + + rum_eeprom_read(sc, RT2573_EEPROM_RSSI_5GHZ_OFFSET, &val, 2); + val = le16toh(val); + if ((val & 0xff) != 0xff) + sc->rssi_5ghz_corr = (int8_t)(val & 0xff); /* signed */ + + DPRINTF(("RSSI 2GHz corr=%d\nRSSI 5GHz corr=%d\n", + sc->rssi_2ghz_corr, sc->rssi_5ghz_corr)); + + rum_eeprom_read(sc, RT2573_EEPROM_FREQ_OFFSET, &val, 2); + val = le16toh(val); + if ((val & 0xff) != 0xff) + sc->rffreq = val & 0xff; + + DPRINTF(("RF freq=%d\n", sc->rffreq)); + + /* read Tx power for all a/b/g channels */ + rum_eeprom_read(sc, RT2573_EEPROM_TXPOWER, sc->txpow, 14); + /* XXX default Tx power for 802.11a channels */ + memset(sc->txpow + 14, 24, sizeof (sc->txpow) - 14); +#ifdef RUM_DEBUG + for (i = 0; i < 14; i++) + DPRINTF(("Channel=%d Tx power=%d\n", i + 1, sc->txpow[i])); +#endif + + /* read default values for BBP registers */ + rum_eeprom_read(sc, RT2573_EEPROM_BBP_BASE, sc->bbp_prom, 2 * 16); +#ifdef RUM_DEBUG + for (i = 0; i < 14; i++) { + if (sc->bbp_prom[i].reg == 0 || sc->bbp_prom[i].reg == 0xff) + continue; + DPRINTF(("BBP R%d=%02x\n", sc->bbp_prom[i].reg, + sc->bbp_prom[i].val)); + } +#endif +} + +Static int +rum_bbp_init(struct rum_softc *sc) +{ +#define N(a) (sizeof (a) / sizeof ((a)[0])) + int i, ntries; + uint8_t val; + + /* wait for BBP to be ready */ + for (ntries = 0; ntries < 100; ntries++) { + val = rum_bbp_read(sc, 0); + if (val != 0 && val != 0xff) + break; + DELAY(1000); + } + if (ntries == 100) { + printf("%s: timeout waiting for BBP\n", + USBDEVNAME(sc->sc_dev)); + return EIO; + } + + /* initialize BBP registers to default values */ + for (i = 0; i < N(rum_def_bbp); i++) + rum_bbp_write(sc, rum_def_bbp[i].reg, rum_def_bbp[i].val); + + /* write vendor-specific BBP values (from EEPROM) */ + for (i = 0; i < 16; i++) { + if (sc->bbp_prom[i].reg == 0 || sc->bbp_prom[i].reg == 0xff) + continue; + rum_bbp_write(sc, sc->bbp_prom[i].reg, sc->bbp_prom[i].val); + } + + return 0; +#undef N +} + +Static void +rum_init(void *priv) +{ +#define N(a) (sizeof (a) / sizeof ((a)[0])) + struct rum_softc *sc = priv; + struct ieee80211com *ic = &sc->sc_ic; + struct ifnet *ifp = ic->ic_ifp; + struct rum_rx_data *data; + uint32_t tmp; + usbd_status error = 0; + int i, ntries; + +// if ((sc->sc_flags & RT2573_FWLOADED) == 0) { +// rum_attachhook(sc); +// } + + rum_stop(ifp); + + /* initialize MAC registers to default values */ + for (i = 0; i < N(rum_def_mac); i++) + rum_write(sc, rum_def_mac[i].reg, rum_def_mac[i].val); + + /* set host ready */ + rum_write(sc, RT2573_MAC_CSR1, 3); + rum_write(sc, RT2573_MAC_CSR1, 0); + + /* wait for BBP/RF to wakeup */ + for (ntries = 0; ntries < 1000; ntries++) { + if (rum_read(sc, RT2573_MAC_CSR12) & 8) + break; + rum_write(sc, RT2573_MAC_CSR12, 4); /* force wakeup */ + DELAY(1000); + } + if (ntries == 1000) { + printf("%s: timeout waiting for BBP/RF to wakeup\n", + USBDEVNAME(sc->sc_dev)); + goto fail; + } + + if ((error = rum_bbp_init(sc)) != 0) + goto fail; + + /* select default channel */ + rum_select_band(sc, ic->ic_curchan); + rum_select_antenna(sc); + rum_set_chan(sc, ic->ic_curchan); + + /* clear STA registers */ + rum_read_multi(sc, RT2573_STA_CSR0, sc->sta, sizeof sc->sta); + + IEEE80211_ADDR_COPY(ic->ic_myaddr, IF_LLADDR(ifp)); + rum_set_macaddr(sc, ic->ic_myaddr); + + /* initialize ASIC */ + rum_write(sc, RT2573_MAC_CSR1, 4); + + /* + * Allocate xfer for AMRR statistics requests. + */ + sc->amrr_xfer = usbd_alloc_xfer(sc->sc_udev); + if (sc->amrr_xfer == NULL) { + printf("%s: could not allocate AMRR xfer\n", + USBDEVNAME(sc->sc_dev)); + goto fail; + } + + /* + * Open Tx and Rx USB bulk pipes. + */ + error = usbd_open_pipe(sc->sc_iface, sc->sc_tx_no, USBD_EXCLUSIVE_USE, + &sc->sc_tx_pipeh); + if (error != 0) { + printf("%s: could not open Tx pipe: %s\n", + USBDEVNAME(sc->sc_dev), usbd_errstr(error)); + goto fail; + } + + error = usbd_open_pipe(sc->sc_iface, sc->sc_rx_no, USBD_EXCLUSIVE_USE, + &sc->sc_rx_pipeh); + if (error != 0) { + printf("%s: could not open Rx pipe: %s\n", + USBDEVNAME(sc->sc_dev), usbd_errstr(error)); + goto fail; + } + + /* + * Allocate Tx and Rx xfer queues. + */ + error = rum_alloc_tx_list(sc); + if (error != 0) { + printf("%s: could not allocate Tx list\n", + USBDEVNAME(sc->sc_dev)); + goto fail; + } + + error = rum_alloc_rx_list(sc); + if (error != 0) { + printf("%s: could not allocate Rx list\n", + USBDEVNAME(sc->sc_dev)); + goto fail; + } + + /* + * Start up the receive pipe. + */ + for (i = 0; i < RT2573_RX_LIST_COUNT; i++) { + data = &sc->rx_data[i]; + + usbd_setup_xfer(data->xfer, sc->sc_rx_pipeh, data, data->buf, + MCLBYTES, USBD_SHORT_XFER_OK, USBD_NO_TIMEOUT, rum_rxeof); + usbd_transfer(data->xfer); + } + + /* update Rx filter */ + tmp = rum_read(sc, RT2573_TXRX_CSR0) & 0xffff; + + tmp |= RT2573_DROP_PHY_ERROR | RT2573_DROP_CRC_ERROR; + if (ic->ic_opmode != IEEE80211_M_MONITOR) { + tmp |= RT2573_DROP_CTL | RT2573_DROP_VER_ERROR | + RT2573_DROP_ACKCTS; + if (ic->ic_opmode != IEEE80211_M_HOSTAP) + tmp |= RT2573_DROP_TODS; + if (!(ifp->if_flags & IFF_PROMISC)) + tmp |= RT2573_DROP_NOT_TO_ME; + } + rum_write(sc, RT2573_TXRX_CSR0, tmp); + + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + + if (ic->ic_opmode == IEEE80211_M_MONITOR) + ieee80211_new_state(ic, IEEE80211_S_RUN, -1); + else + ieee80211_new_state(ic, IEEE80211_S_SCAN, -1); + + return; + +fail: rum_stop(ifp); + return; +#undef N +} + +Static void +rum_stop(struct ifnet *ifp) +{ + struct rum_softc *sc = ifp->if_softc; + struct ieee80211com *ic = &sc->sc_ic; + uint32_t tmp; + + ieee80211_new_state(ic, IEEE80211_S_INIT, -1); /* free all nodes */ + + sc->sc_tx_timer = 0; + ifp->if_timer = 0; + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + + /* disable Rx */ + tmp = rum_read(sc, RT2573_TXRX_CSR0); + rum_write(sc, RT2573_TXRX_CSR0, tmp | RT2573_DISABLE_RX); + + /* reset ASIC */ + rum_write(sc, RT2573_MAC_CSR1, 3); + rum_write(sc, RT2573_MAC_CSR1, 0); + + if (sc->sc_rx_pipeh != NULL) { + usbd_abort_pipe(sc->sc_rx_pipeh); + usbd_close_pipe(sc->sc_rx_pipeh); + sc->sc_rx_pipeh = NULL; + } + + if (sc->sc_tx_pipeh != NULL) { + usbd_abort_pipe(sc->sc_tx_pipeh); + usbd_close_pipe(sc->sc_tx_pipeh); + sc->sc_tx_pipeh = NULL; + } + + rum_free_rx_list(sc); + rum_free_tx_list(sc); +} + +Static int +rum_load_microcode(struct rum_softc *sc, const u_char *ucode, size_t size) +{ + usb_device_request_t req; + uint16_t reg = RT2573_MCU_CODE_BASE; + usbd_status error; + + /* copy firmware image into NIC */ + for (; size >= 4; reg += 4, ucode += 4, size -= 4) + rum_write(sc, reg, UGETDW(ucode)); + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = RT2573_MCU_CNTL; + USETW(req.wValue, RT2573_MCU_RUN); + USETW(req.wIndex, 0); + USETW(req.wLength, 0); + + error = usbd_do_request(sc->sc_udev, &req, NULL); + if (error != 0) { + printf("%s: could not run firmware: %s\n", + USBDEVNAME(sc->sc_dev), usbd_errstr(error)); + } + return error; +} + +Static int +rum_prepare_beacon(struct rum_softc *sc) +{ + struct ieee80211com *ic = &sc->sc_ic; + struct rum_tx_desc desc; + struct mbuf *m0; + int rate; + + m0 = ieee80211_beacon_alloc(ic, ic->ic_bss, &sc->sc_bo); + if (m0 == NULL) { + printf("%s: could not allocate beacon frame\n", + USBDEVNAME(sc->sc_dev)); + return ENOBUFS; + } + + /* send beacons at the lowest available rate */ + rate = IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan) ? 12 : 2; + + rum_setup_tx_desc(sc, &desc, RT2573_TX_TIMESTAMP, RT2573_TX_HWSEQ, + m0->m_pkthdr.len, rate); + + /* copy the first 24 bytes of Tx descriptor into NIC memory */ + rum_write_multi(sc, RT2573_HW_BEACON_BASE0, (uint8_t *)&desc, 24); + + /* copy beacon header and payload into NIC memory */ + rum_write_multi(sc, RT2573_HW_BEACON_BASE0 + 24, mtod(m0, uint8_t *), + m0->m_pkthdr.len); + + m_freem(m0); + + return 0; +} + +#define RUM_AMRR_MIN_SUCCESS_THRESHOLD 1 +#define RUM_AMRR_MAX_SUCCESS_THRESHOLD 10 + +Static void +rum_amrr_start(struct rum_softc *sc, struct ieee80211_node *ni) +{ + struct rum_amrr *amrr = &sc->amrr; + int i; + + /* clear statistic registers (STA_CSR0 to STA_CSR5) */ + rum_read_multi(sc, RT2573_STA_CSR0, sc->sta, sizeof sc->sta); + + amrr->success = 0; + amrr->recovery = 0; + amrr->txcnt = amrr->retrycnt = 0; + amrr->success_threshold = RUM_AMRR_MIN_SUCCESS_THRESHOLD; + +// ieee80211_amrr_node_init(&sc->amrr, &sc->amn); + + /* set rate to some reasonable initial value */ + for (i = ni->ni_rates.rs_nrates - 1; + i > 0 && (ni->ni_rates.rs_rates[i] & IEEE80211_RATE_VAL) > 72; + i--); + ni->ni_txrate = i; + + callout_reset(&sc->amrr_ch, hz, rum_amrr_timeout, sc); +} + +Static void +rum_amrr_timeout(void *arg) +{ + struct rum_softc *sc = arg; + usb_device_request_t req; + int s; + + s = splusb(); + + /* + * Asynchronously read statistic registers (cleared by read). + */ + req.bmRequestType = UT_READ_VENDOR_DEVICE; + req.bRequest = RT2573_READ_MULTI_MAC; + USETW(req.wValue, 0); + USETW(req.wIndex, RT2573_STA_CSR0); + USETW(req.wLength, sizeof sc->sta); + + usbd_setup_default_xfer(sc->amrr_xfer, sc->sc_udev, sc, + USBD_DEFAULT_TIMEOUT, &req, sc->sta, sizeof sc->sta, 0, + rum_amrr_update); + (void)usbd_transfer(sc->amrr_xfer); + + splx(s); +} + +Static void +rum_amrr_update(usbd_xfer_handle xfer, usbd_private_handle priv, + usbd_status status) +{ + struct rum_softc *sc = (struct rum_softc *)priv; + struct rum_amrr *amrr = &sc->amrr; + struct ifnet *ifp = sc->sc_ifp; //FIXME1 + + if (status != USBD_NORMAL_COMPLETION) { + device_printf(sc->sc_dev, "could not retrieve Tx statistics - " + "cancelling automatic rate control\n"); + return; + } + + /* count TX retry-fail as Tx errors */ + ifp->if_oerrors += le32toh(sc->sta[5]) >> 16; + + amrr->retrycnt = + (le32toh(sc->sta[4]) >> 16) + /* TX one-retry ok count */ + (le32toh(sc->sta[5]) & 0xffff) + /* TX more-retry ok count */ + (le32toh(sc->sta[5]) >> 16); /* TX retry-fail count */ + + amrr->txcnt = + amrr->retrycnt + + (le32toh(sc->sta[4]) & 0xffff); /* TX no-retry ok count */ + + rum_ratectl(amrr, sc->sc_ic.ic_bss); + + callout_reset(&sc->amrr_ch, hz, rum_amrr_timeout, sc); +} + +/*- + * Naive implementation of the Adaptive Multi Rate Retry algorithm: + * "IEEE 802.11 Rate Adaptation: A Practical Approach" + * Mathieu Lacage, Hossein Manshaei, Thierry Turletti + * INRIA Sophia - Projet Planete + * http://www-sop.inria.fr/rapports/sophia/RR-5208.html + * + * This algorithm is particularly well suited for rum since it does not + * require per-frame retry statistics. Note however that since h/w does + * not provide per-frame stats, we can't do per-node rate adaptation and + * thus automatic rate adaptation is only enabled in STA operating mode. + */ +#define is_success(amrr) \ + ((amrr)->retrycnt < (amrr)->txcnt / 10) +#define is_failure(amrr) \ + ((amrr)->retrycnt > (amrr)->txcnt / 3) +#define is_enough(amrr) \ + ((amrr)->txcnt > 10) +#define is_min_rate(ni) \ + ((ni)->ni_txrate == 0) +#define is_max_rate(ni) \ + ((ni)->ni_txrate == (ni)->ni_rates.rs_nrates - 1) +#define increase_rate(ni) \ + ((ni)->ni_txrate++) +#define decrease_rate(ni) \ + ((ni)->ni_txrate--) +#define reset_cnt(amrr) \ + do { (amrr)->txcnt = (amrr)->retrycnt = 0; } while (0) +Static void +rum_ratectl(struct rum_amrr *amrr, struct ieee80211_node *ni) +{ + int need_change = 0; + + if (is_success(amrr) && is_enough(amrr)) { + amrr->success++; + if (amrr->success >= amrr->success_threshold && + !is_max_rate(ni)) { + amrr->recovery = 1; + amrr->success = 0; + increase_rate(ni); + need_change = 1; + } else { + amrr->recovery = 0; + } + } else if (is_failure(amrr)) { + amrr->success = 0; + if (!is_min_rate(ni)) { + if (amrr->recovery) { + amrr->success_threshold *= 2; + if (amrr->success_threshold > + RUM_AMRR_MAX_SUCCESS_THRESHOLD) + amrr->success_threshold = + RUM_AMRR_MAX_SUCCESS_THRESHOLD; + } else { + amrr->success_threshold = + RUM_AMRR_MIN_SUCCESS_THRESHOLD; + } + decrease_rate(ni); + need_change = 1; + } + amrr->recovery = 0; /* original paper was incorrect */ + } + + if (is_enough(amrr) || need_change) + reset_cnt(amrr); +} + + +/* +int +rum_activate(device_ptr_t self, enum devact act) +{ + switch (act) { + case DVACT_ACTIVATE: + return EOPNOTSUPP; + + case DVACT_DEACTIVATE: + //if_deactivate(&sc->sc_ic.ic_if); + break; + } + + return 0; +} +*/ + +DRIVER_MODULE(rum, uhub, rum_driver, rum_devclass, usbd_driver_load, 0); Index: sys/dev/usb/if_rumreg.h =================================================================== RCS file: sys/dev/usb/if_rumreg.h diff -N sys/dev/usb/if_rumreg.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sys/dev/usb/if_rumreg.h 5 Feb 2007 19:00:51 -0000 @@ -0,0 +1,390 @@ +/* $OpenBSD: if_rumreg.h,v 1.12 2006/08/09 08:21:08 damien Exp $ */ + +/*- + * Copyright (c) 2005, 2006 Damien Bergamini + * Copyright (c) 2006 Niall O'Higgins + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#define RT2573_TX_DESC_SIZE (sizeof (struct rum_tx_desc)) +#define RT2573_RX_DESC_SIZE (sizeof (struct rum_rx_desc)) + +#define RT2573_CONFIG_NO 1 +#define RT2573_IFACE_INDEX 0 + +#define RT2573_MCU_CNTL 0x01 +#define RT2573_WRITE_MAC 0x02 +#define RT2573_READ_MAC 0x03 +#define RT2573_WRITE_MULTI_MAC 0x06 +#define RT2573_READ_MULTI_MAC 0x07 +#define RT2573_READ_EEPROM 0x09 +#define RT2573_WRITE_LED 0x0a + +/* + * Control and status registers. + */ +#define RT2573_AIFSN_CSR 0x0400 +#define RT2573_CWMIN_CSR 0x0404 +#define RT2573_CWMAX_CSR 0x0408 +#define RT2573_MCU_CODE_BASE 0x0800 +#define RT2573_HW_BEACON_BASE0 0x2400 +#define RT2573_MAC_CSR0 0x3000 +#define RT2573_MAC_CSR1 0x3004 +#define RT2573_MAC_CSR2 0x3008 +#define RT2573_MAC_CSR3 0x300c +#define RT2573_MAC_CSR4 0x3010 +#define RT2573_MAC_CSR5 0x3014 +#define RT2573_MAC_CSR6 0x3018 +#define RT2573_MAC_CSR7 0x301c +#define RT2573_MAC_CSR8 0x3020 +#define RT2573_MAC_CSR9 0x3024 +#define RT2573_MAC_CSR10 0x3028 +#define RT2573_MAC_CSR11 0x302c +#define RT2573_MAC_CSR12 0x3030 +#define RT2573_MAC_CSR13 0x3034 +#define RT2573_MAC_CSR14 0x3038 +#define RT2573_MAC_CSR15 0x303c +#define RT2573_TXRX_CSR0 0x3040 +#define RT2573_TXRX_CSR1 0x3044 +#define RT2573_TXRX_CSR2 0x3048 +#define RT2573_TXRX_CSR3 0x304c +#define RT2573_TXRX_CSR4 0x3050 +#define RT2573_TXRX_CSR5 0x3054 +#define RT2573_TXRX_CSR6 0x3058 +#define RT2573_TXRX_CSR7 0x305c +#define RT2573_TXRX_CSR8 0x3060 +#define RT2573_TXRX_CSR9 0x3064 +#define RT2573_TXRX_CSR10 0x3068 +#define RT2573_TXRX_CSR11 0x306c +#define RT2573_TXRX_CSR12 0x3070 +#define RT2573_TXRX_CSR13 0x3074 +#define RT2573_TXRX_CSR14 0x3078 +#define RT2573_TXRX_CSR15 0x307c +#define RT2573_PHY_CSR0 0x3080 +#define RT2573_PHY_CSR1 0x3084 +#define RT2573_PHY_CSR2 0x3088 +#define RT2573_PHY_CSR3 0x308c +#define RT2573_PHY_CSR4 0x3090 +#define RT2573_PHY_CSR5 0x3094 +#define RT2573_PHY_CSR6 0x3098 +#define RT2573_PHY_CSR7 0x309c +#define RT2573_SEC_CSR0 0x30a0 +#define RT2573_SEC_CSR1 0x30a4 +#define RT2573_SEC_CSR2 0x30a8 +#define RT2573_SEC_CSR3 0x30ac +#define RT2573_SEC_CSR4 0x30b0 +#define RT2573_SEC_CSR5 0x30b4 +#define RT2573_STA_CSR0 0x30c0 +#define RT2573_STA_CSR1 0x30c4 +#define RT2573_STA_CSR2 0x30c8 +#define RT2573_STA_CSR3 0x30cc +#define RT2573_STA_CSR4 0x30d0 +#define RT2573_STA_CSR5 0x30d4 + + +/* possible flags for register RT2573_MAC_CSR1 */ +#define RT2573_RESET_ASIC (1 << 0) +#define RT2573_RESET_BBP (1 << 1) +#define RT2573_HOST_READY (1 << 2) + +/* possible flags for register MAC_CSR5 */ +#define RT2573_ONE_BSSID 3 + +/* possible flags for register TXRX_CSR0 */ +/* Tx filter flags are in the low 16 bits */ +#define RT2573_AUTO_TX_SEQ (1 << 15) +/* Rx filter flags are in the high 16 bits */ +#define RT2573_DISABLE_RX (1 << 16) +#define RT2573_DROP_CRC_ERROR (1 << 17) +#define RT2573_DROP_PHY_ERROR (1 << 18) +#define RT2573_DROP_CTL (1 << 19) +#define RT2573_DROP_NOT_TO_ME (1 << 20) +#define RT2573_DROP_TODS (1 << 21) +#define RT2573_DROP_VER_ERROR (1 << 22) +#define RT2573_DROP_MULTICAST (1 << 23) +#define RT2573_DROP_BROADCAST (1 << 24) +#define RT2573_DROP_ACKCTS (1 << 25) + +/* possible flags for register TXRX_CSR4 */ +#define RT2573_SHORT_PREAMBLE (1 << 18) +#define RT2573_MRR_ENABLED (1 << 19) +#define RT2573_MRR_CCK_FALLBACK (1 << 22) + +/* possible flags for register TXRX_CSR9 */ +#define RT2573_TSF_TICKING (1 << 16) +#define RT2573_TSF_MODE(x) (((x) & 0x3) << 17) +/* TBTT stands for Target Beacon Transmission Time */ +#define RT2573_ENABLE_TBTT (1 << 19) +#define RT2573_GENERATE_BEACON (1 << 20) + +/* possible flags for register PHY_CSR0 */ +#define RT2573_PA_PE_2GHZ (1 << 16) +#define RT2573_PA_PE_5GHZ (1 << 17) + +/* possible flags for register PHY_CSR3 */ +#define RT2573_BBP_READ (1 << 15) +#define RT2573_BBP_BUSY (1 << 16) +/* possible flags for register PHY_CSR4 */ +#define RT2573_RF_20BIT (20 << 24) +#define RT2573_RF_BUSY (1 << 31) + +/* LED values */ +#define RT2573_LED_RADIO (1 << 8) +#define RT2573_LED_G (1 << 9) +#define RT2573_LED_A (1 << 10) +#define RT2573_LED_ON 0x1e1e +#define RT2573_LED_OFF 0x0 + +#define RT2573_MCU_RUN (1 << 3) + +#define RT2573_SMART_MODE (1 << 0) + +#define RT2573_BBPR94_DEFAULT 6 + +#define RT2573_BBP_WRITE (1 << 15) + +/* dual-band RF */ +#define RT2573_RF_5226 1 +#define RT2573_RF_5225 3 +/* single-band RF */ +#define RT2573_RF_2528 2 +#define RT2573_RF_2527 4 + +#define RT2573_BBP_VERSION 0 + +struct rum_tx_desc { + uint32_t flags; +#define RT2573_TX_BURST (1 << 0) +#define RT2573_TX_VALID (1 << 1) +#define RT2573_TX_MORE_FRAG (1 << 2) +#define RT2573_TX_ACK (1 << 3) +#define RT2573_TX_TIMESTAMP (1 << 4) +#define RT2573_TX_OFDM (1 << 5) +#define RT2573_TX_IFS_SIFS (1 << 6) +#define RT2573_TX_LONG_RETRY (1 << 7) + + uint16_t wme; +#define RT2573_QID(v) (v) +#define RT2573_AIFSN(v) ((v) << 4) +#define RT2573_LOGCWMIN(v) ((v) << 8) +#define RT2573_LOGCWMAX(v) ((v) << 12) + + uint16_t xflags; +#define RT2573_TX_HWSEQ (1 << 12) + + uint8_t plcp_signal; + uint8_t plcp_service; +#define RT2573_PLCP_LENGEXT 0x80 + + uint8_t plcp_length_lo; + uint8_t plcp_length_hi; + + uint32_t iv; + uint32_t eiv; + + uint8_t offset; + uint8_t qid; + uint8_t txpower; +#define RT2573_DEFAULT_TXPOWER 0 + + uint8_t reserved; +} __packed; + +struct rum_rx_desc { + uint32_t flags; +#define RT2573_RX_BUSY (1 << 0) +#define RT2573_RX_DROP (1 << 1) +#define RT2573_RX_CRC_ERROR (1 << 6) +#define RT2573_RX_OFDM (1 << 7) + + uint8_t rate; + uint8_t rssi; + uint8_t reserved1; + uint8_t offset; + uint32_t iv; + uint32_t eiv; + uint32_t reserved2[2]; +} __packed; + +#define RT2573_RF1 0 +#define RT2573_RF2 2 +#define RT2573_RF3 1 +#define RT2573_RF4 3 + +#define RT2573_EEPROM_MACBBP 0x0000 +#define RT2573_EEPROM_ADDRESS 0x0004 +#define RT2573_EEPROM_ANTENNA 0x0020 +#define RT2573_EEPROM_CONFIG2 0x0022 +#define RT2573_EEPROM_BBP_BASE 0x0026 +#define RT2573_EEPROM_TXPOWER 0x0046 +#define RT2573_EEPROM_FREQ_OFFSET 0x005e +#define RT2573_EEPROM_RSSI_2GHZ_OFFSET 0x009a +#define RT2573_EEPROM_RSSI_5GHZ_OFFSET 0x009c + +/* + * Default values for MAC registers; values taken from the reference driver. + */ +#define RT2573_DEF_MAC \ + { RT2573_TXRX_CSR0, 0x025fb032 }, \ + { RT2573_TXRX_CSR1, 0x9eaa9eaf }, \ + { RT2573_TXRX_CSR2, 0x8a8b8c8d }, \ + { RT2573_TXRX_CSR3, 0x00858687 }, \ + { RT2573_TXRX_CSR7, 0x2e31353b }, \ + { RT2573_TXRX_CSR8, 0x2a2a2a2c }, \ + { RT2573_TXRX_CSR15, 0x0000000f }, \ + { RT2573_MAC_CSR6, 0x00000fff }, \ + { RT2573_MAC_CSR8, 0x016c030a }, \ + { RT2573_MAC_CSR10, 0x00000718 }, \ + { RT2573_MAC_CSR12, 0x00000004 }, \ + { RT2573_MAC_CSR13, 0x00007f00 }, \ + { RT2573_SEC_CSR0, 0x00000000 }, \ + { RT2573_SEC_CSR1, 0x00000000 }, \ + { RT2573_SEC_CSR5, 0x00000000 }, \ + { RT2573_PHY_CSR1, 0x000023b0 }, \ + { RT2573_PHY_CSR5, 0x00040a06 }, \ + { RT2573_PHY_CSR6, 0x00080606 }, \ + { RT2573_PHY_CSR7, 0x00000408 }, \ + { RT2573_AIFSN_CSR, 0x00002273 }, \ + { RT2573_CWMIN_CSR, 0x00002344 }, \ + { RT2573_CWMAX_CSR, 0x000034aa } + +/* + * Default values for BBP registers; values taken from the reference driver. + */ +#define RT2573_DEF_BBP \ + { 3, 0x80 }, \ + { 15, 0x30 }, \ + { 17, 0x20 }, \ + { 21, 0xc8 }, \ + { 22, 0x38 }, \ + { 23, 0x06 }, \ + { 24, 0xfe }, \ + { 25, 0x0a }, \ + { 26, 0x0d }, \ + { 32, 0x0b }, \ + { 34, 0x12 }, \ + { 37, 0x07 }, \ + { 39, 0xf8 }, \ + { 41, 0x60 }, \ + { 53, 0x10 }, \ + { 54, 0x18 }, \ + { 60, 0x10 }, \ + { 61, 0x04 }, \ + { 62, 0x04 }, \ + { 75, 0xfe }, \ + { 86, 0xfe }, \ + { 88, 0xfe }, \ + { 90, 0x0f }, \ + { 99, 0x00 }, \ + { 102, 0x16 }, \ + { 107, 0x04 } + +/* + * Default settings for RF registers; values taken from the reference driver. + */ +#define RT2573_RF5226 \ + { 1, 0x00b03, 0x001e1, 0x1a014, 0x30282 }, \ + { 2, 0x00b03, 0x001e1, 0x1a014, 0x30287 }, \ + { 3, 0x00b03, 0x001e2, 0x1a014, 0x30282 }, \ + { 4, 0x00b03, 0x001e2, 0x1a014, 0x30287 }, \ + { 5, 0x00b03, 0x001e3, 0x1a014, 0x30282 }, \ + { 6, 0x00b03, 0x001e3, 0x1a014, 0x30287 }, \ + { 7, 0x00b03, 0x001e4, 0x1a014, 0x30282 }, \ + { 8, 0x00b03, 0x001e4, 0x1a014, 0x30287 }, \ + { 9, 0x00b03, 0x001e5, 0x1a014, 0x30282 }, \ + { 10, 0x00b03, 0x001e5, 0x1a014, 0x30287 }, \ + { 11, 0x00b03, 0x001e6, 0x1a014, 0x30282 }, \ + { 12, 0x00b03, 0x001e6, 0x1a014, 0x30287 }, \ + { 13, 0x00b03, 0x001e7, 0x1a014, 0x30282 }, \ + { 14, 0x00b03, 0x001e8, 0x1a014, 0x30284 }, \ + \ + { 34, 0x00b03, 0x20266, 0x36014, 0x30282 }, \ + { 38, 0x00b03, 0x20267, 0x36014, 0x30284 }, \ + { 42, 0x00b03, 0x20268, 0x36014, 0x30286 }, \ + { 46, 0x00b03, 0x20269, 0x36014, 0x30288 }, \ + \ + { 36, 0x00b03, 0x00266, 0x26014, 0x30288 }, \ + { 40, 0x00b03, 0x00268, 0x26014, 0x30280 }, \ + { 44, 0x00b03, 0x00269, 0x26014, 0x30282 }, \ + { 48, 0x00b03, 0x0026a, 0x26014, 0x30284 }, \ + { 52, 0x00b03, 0x0026b, 0x26014, 0x30286 }, \ + { 56, 0x00b03, 0x0026c, 0x26014, 0x30288 }, \ + { 60, 0x00b03, 0x0026e, 0x26014, 0x30280 }, \ + { 64, 0x00b03, 0x0026f, 0x26014, 0x30282 }, \ + \ + { 100, 0x00b03, 0x0028a, 0x2e014, 0x30280 }, \ + { 104, 0x00b03, 0x0028b, 0x2e014, 0x30282 }, \ + { 108, 0x00b03, 0x0028c, 0x2e014, 0x30284 }, \ + { 112, 0x00b03, 0x0028d, 0x2e014, 0x30286 }, \ + { 116, 0x00b03, 0x0028e, 0x2e014, 0x30288 }, \ + { 120, 0x00b03, 0x002a0, 0x2e014, 0x30280 }, \ + { 124, 0x00b03, 0x002a1, 0x2e014, 0x30282 }, \ + { 128, 0x00b03, 0x002a2, 0x2e014, 0x30284 }, \ + { 132, 0x00b03, 0x002a3, 0x2e014, 0x30286 }, \ + { 136, 0x00b03, 0x002a4, 0x2e014, 0x30288 }, \ + { 140, 0x00b03, 0x002a6, 0x2e014, 0x30280 }, \ + \ + { 149, 0x00b03, 0x002a8, 0x2e014, 0x30287 }, \ + { 153, 0x00b03, 0x002a9, 0x2e014, 0x30289 }, \ + { 157, 0x00b03, 0x002ab, 0x2e014, 0x30281 }, \ + { 161, 0x00b03, 0x002ac, 0x2e014, 0x30283 }, \ + { 165, 0x00b03, 0x002ad, 0x2e014, 0x30285 } + +#define RT2573_RF5225 \ + { 1, 0x00b33, 0x011e1, 0x1a014, 0x30282 }, \ + { 2, 0x00b33, 0x011e1, 0x1a014, 0x30287 }, \ + { 3, 0x00b33, 0x011e2, 0x1a014, 0x30282 }, \ + { 4, 0x00b33, 0x011e2, 0x1a014, 0x30287 }, \ + { 5, 0x00b33, 0x011e3, 0x1a014, 0x30282 }, \ + { 6, 0x00b33, 0x011e3, 0x1a014, 0x30287 }, \ + { 7, 0x00b33, 0x011e4, 0x1a014, 0x30282 }, \ + { 8, 0x00b33, 0x011e4, 0x1a014, 0x30287 }, \ + { 9, 0x00b33, 0x011e5, 0x1a014, 0x30282 }, \ + { 10, 0x00b33, 0x011e5, 0x1a014, 0x30287 }, \ + { 11, 0x00b33, 0x011e6, 0x1a014, 0x30282 }, \ + { 12, 0x00b33, 0x011e6, 0x1a014, 0x30287 }, \ + { 13, 0x00b33, 0x011e7, 0x1a014, 0x30282 }, \ + { 14, 0x00b33, 0x011e8, 0x1a014, 0x30284 }, \ + \ + { 34, 0x00b33, 0x01266, 0x26014, 0x30282 }, \ + { 38, 0x00b33, 0x01267, 0x26014, 0x30284 }, \ + { 42, 0x00b33, 0x01268, 0x26014, 0x30286 }, \ + { 46, 0x00b33, 0x01269, 0x26014, 0x30288 }, \ + \ + { 36, 0x00b33, 0x01266, 0x26014, 0x30288 }, \ + { 40, 0x00b33, 0x01268, 0x26014, 0x30280 }, \ + { 44, 0x00b33, 0x01269, 0x26014, 0x30282 }, \ + { 48, 0x00b33, 0x0126a, 0x26014, 0x30284 }, \ + { 52, 0x00b33, 0x0126b, 0x26014, 0x30286 }, \ + { 56, 0x00b33, 0x0126c, 0x26014, 0x30288 }, \ + { 60, 0x00b33, 0x0126e, 0x26014, 0x30280 }, \ + { 64, 0x00b33, 0x0126f, 0x26014, 0x30282 }, \ + \ + { 100, 0x00b33, 0x0128a, 0x2e014, 0x30280 }, \ + { 104, 0x00b33, 0x0128b, 0x2e014, 0x30282 }, \ + { 108, 0x00b33, 0x0128c, 0x2e014, 0x30284 }, \ + { 112, 0x00b33, 0x0128d, 0x2e014, 0x30286 }, \ + { 116, 0x00b33, 0x0128e, 0x2e014, 0x30288 }, \ + { 120, 0x00b33, 0x012a0, 0x2e014, 0x30280 }, \ + { 124, 0x00b33, 0x012a1, 0x2e014, 0x30282 }, \ + { 128, 0x00b33, 0x012a2, 0x2e014, 0x30284 }, \ + { 132, 0x00b33, 0x012a3, 0x2e014, 0x30286 }, \ + { 136, 0x00b33, 0x012a4, 0x2e014, 0x30288 }, \ + { 140, 0x00b33, 0x012a6, 0x2e014, 0x30280 }, \ + \ + { 149, 0x00b33, 0x012a8, 0x2e014, 0x30287 }, \ + { 153, 0x00b33, 0x012a9, 0x2e014, 0x30289 }, \ + { 157, 0x00b33, 0x012ab, 0x2e014, 0x30281 }, \ + { 161, 0x00b33, 0x012ac, 0x2e014, 0x30283 }, \ + { 165, 0x00b33, 0x012ad, 0x2e014, 0x30285 } Index: sys/dev/usb/if_rumvar.h =================================================================== RCS file: sys/dev/usb/if_rumvar.h diff -N sys/dev/usb/if_rumvar.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sys/dev/usb/if_rumvar.h 5 Feb 2007 19:00:51 -0000 @@ -0,0 +1,158 @@ +/* $OpenBSD: if_rumvar.h,v 1.6 2006/08/18 15:11:12 damien Exp $ */ + +/*- + * Copyright (c) 2005, 2006 Damien Bergamini + * Copyright (c) 2006 Niall O'Higgins + * Copyright (c) 2006, 2007 Valery V.Chikalov + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#define RT2573_RX_LIST_COUNT 1 +#define RT2573_TX_LIST_COUNT 1 + +struct rum_rx_radiotap_header { + struct ieee80211_radiotap_header wr_ihdr; + uint8_t wr_flags; + uint8_t wr_rate; + uint16_t wr_chan_freq; + uint16_t wr_chan_flags; + uint8_t wr_antenna; + uint8_t wr_antsignal; +} __packed; + +#define RT2573_RX_RADIOTAP_PRESENT \ + ((1 << IEEE80211_RADIOTAP_FLAGS) | \ + (1 << IEEE80211_RADIOTAP_RATE) | \ + (1 << IEEE80211_RADIOTAP_CHANNEL) | \ + (1 << IEEE80211_RADIOTAP_ANTENNA) | \ + (1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL)) + +struct rum_tx_radiotap_header { + struct ieee80211_radiotap_header wt_ihdr; + uint8_t wt_flags; + uint8_t wt_rate; + uint16_t wt_chan_freq; + uint16_t wt_chan_flags; + uint8_t wt_antenna; +} __packed; + +#define RT2573_TX_RADIOTAP_PRESENT \ + ((1 << IEEE80211_RADIOTAP_FLAGS) | \ + (1 << IEEE80211_RADIOTAP_RATE) | \ + (1 << IEEE80211_RADIOTAP_CHANNEL) | \ + (1 << IEEE80211_RADIOTAP_ANTENNA)) + +struct rum_softc; + +struct rum_tx_data { + struct rum_softc *sc; + usbd_xfer_handle xfer; + uint8_t *buf; + struct mbuf *m; + struct ieee80211_node *ni; +}; + +struct rum_rx_data { + struct rum_softc *sc; + usbd_xfer_handle xfer; + uint8_t *buf; + struct mbuf *m; +}; + +struct rum_amrr { + int txcnt; + int retrycnt; + int success; + int success_threshold; + int recovery; +}; + +struct rum_softc { + USBBASEDEVICE sc_dev; + struct ifnet *sc_ifp; + struct ieee80211com sc_ic; + int (*sc_newstate)(struct ieee80211com *, + enum ieee80211_state, int); + + usbd_device_handle sc_udev; + usbd_interface_handle sc_iface; + int sc_flags; +#define RT2573_FWLOADED (1 << 0) + + struct ieee80211_channel *sc_curchan; + + int sc_rx_no; + int sc_tx_no; + + uint16_t macbbp_rev; + uint8_t rf_rev; + uint8_t rffreq; + + usbd_xfer_handle amrr_xfer; + + usbd_pipe_handle sc_rx_pipeh; + usbd_pipe_handle sc_tx_pipeh; + + enum ieee80211_state sc_state; + struct usb_task sc_task; + + struct rum_amrr amrr; + + struct rum_rx_data rx_data[RT2573_RX_LIST_COUNT]; + struct rum_tx_data tx_data[RT2573_TX_LIST_COUNT]; + int tx_queued; + + struct ieee80211_beacon_offsets sc_bo; + + struct callout scan_ch; + struct callout amrr_ch; + + int sc_tx_timer; + + uint32_t sta[6]; + uint32_t rf_regs[4]; + uint8_t txpow[44]; + + struct { + uint8_t val; + uint8_t reg; + } __packed bbp_prom[16]; + + int hw_radio; + int rx_ant; + int tx_ant; + int nb_ant; + int ext_2ghz_lna; + int ext_5ghz_lna; + int rssi_2ghz_corr; + int rssi_5ghz_corr; + int sifs; + uint8_t bbp17; + + struct bpf_if *sc_drvbpf; + + union { + struct rum_rx_radiotap_header th; + uint8_t pad[64]; + } sc_rxtapu; +#define sc_rxtap sc_rxtapu.th + int sc_rxtap_len; + + union { + struct rum_tx_radiotap_header th; + uint8_t pad[64]; + } sc_txtapu; +#define sc_txtap sc_txtapu.th + int sc_txtap_len; +}; Index: sys/dev/usb/usbdevs =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/usbdevs,v retrieving revision 1.232.2.20 diff -u -r1.232.2.20 usbdevs --- sys/dev/usb/usbdevs 22 Jan 2007 17:57:30 -0000 1.232.2.20 +++ sys/dev/usb/usbdevs 5 Feb 2007 19:00:51 -0000 @@ -350,7 +350,8 @@ vendor EICON 0x0734 Eicon Networks vendor DIGITALSTREAM 0x074e Digital Stream vendor AUREAL 0x0755 Aureal -vendor MIDIMAN 0x0763 Midiman +vendor mIDIMAN 0x0763 Midiman +vendor SURECOM 0x0769 Surecom Technology vendor LINKSYS2 0x077b Linksys vendor GRIFFIN 0x077d Griffin vendor SANDISK 0x0781 SanDisk @@ -379,6 +380,7 @@ vendor AVERMEDIA 0x07ca AVerMedia vendor SIIG 0x07cc SIIG vendor CASIO 0x07cf CASIO +vendor DLINK2 0x07d1 D-Link vendor APTIO 0x07d2 Aptio vendor ARASAN 0x07da Arasan vendor ALLIEDCABLE 0x07e6 Allied Cable @@ -480,6 +482,7 @@ vendor ACDC 0x0d7e ACDC vendor ABC 0x0d8c ABC vendor MSI 0x0db0 Micro Star International +vendor SITECOMEU 0x0df6 Sitecom Europe vendor HAWKING 0x0e66 Hawking vendor GMATE 0x0e7e G.Mate, Inc vendor OTI 0x0ea0 Ours @@ -507,10 +510,12 @@ vendor CREATIVE2 0x1292 Creative Labs vendor BELKIN2 0x1293 Belkin vendor AINCOMM 0x12fd Aincomm +vendor DICKSMITH 0x1371 Dick Smith Electronics vendor MOBILITY 0x1342 Mobility vendor LINKSYS4 0x13b1 Linksys vendor SHARK 0x13d2 Shark vendor RADIOSHACK 0x1453 Radio Shack +vendor HUAWEI3COM 0x1472 Huawei 3Com vendor SILICOM 0x1485 Silicom vendor RALINK 0x148f Ralink Technology vendor IMAGINATION 0x149a Imagination Technologies @@ -520,11 +525,15 @@ vendor SOHOWARE 0x15e8 SOHOware vendor UMAX 0x1606 UMAX vendor INSIDEOUT 0x1608 Inside Out Networks +vendor GOODWAY 0x1631 Good Way Technology vendor ENTREGA 0x1645 Entrega vendor ACTIONTEC 0x1668 Actiontec +vendor GIGASET 0x1690 Gigaset vendor CMOTECH 0x16d8 CMOTECH CO., LTD. +vendor QCOM 0x18e8 Qcom vendor LINKSYS3 0x1915 Linksys vendor DLINK 0x2001 D-Link +vendor PLANEX2 0x2019 Planex Communications vendor ERICSSON 0x2282 Ericsson vendor MOTOROLA2 0x22b8 Motorola vendor TRIPPLITE 0x2478 Tripp-Lite @@ -580,6 +589,7 @@ product ABOCOM XX8 0x4102 XX8 product ABOCOM XX9 0x4104 XX9 product ABOCOM XX10 0xabc1 XX10 +product ABOCOM RT2573 0xb21d RT2573 /* Accton products */ product ACCTON USB320_EC 0x1046 USB320-EC Ethernet @@ -689,6 +699,7 @@ /* ASUS products */ product ASUS WL167G 0x1707 WL-167g wireless adapter +product ASUS RT2573 0x1723 RT2573 /* ATen products */ product ATEN UC1284 0x2001 Parallel printer @@ -719,6 +730,9 @@ product BELKIN F6C550AVR 0x0551 F6C550-AVR UPS product BELKIN F5U120 0x1203 F5U120-PC Hub product BELKIN F5D7050 0x7050 F5D7050 wireless adapter +product BELKIN F5D7050A 0x705a F5D705A 54g USB Network Adapter +product BELKIN F5D9050V3 0x905b F5D9050 ver 3 + /* Billionton products */ product BILLIONTON USB100 0x0986 USB100N 10/100 FastEthernet @@ -799,6 +813,7 @@ /* Conceptronic products */ product CONCEPTRONIC C54U 0x3c02 C54U wireless adapter +product CONCEPTRONIC C54RU2 0x3c22 C54RU /* CTX products */ product CTX EX1300 0x9999 Ex1300 hub @@ -834,6 +849,10 @@ product DIGI ACCELEPORT4 0x0004 AccelePort USB 4 product DIGI ACCELEPORT8 0x0008 AccelePort USB 8 +/* Dick Smith Electronics (really C-Net) products */ +product DICKSMITH RT2573 0x9022 RT2573 +product DICKSMITH CWD854F 0x9032 C-Net CWD-854 rev F + /* D-Link products */ /*product DLINK DSBS25 0x0100 DSB-S25 serial*/ product DLINK DUBE100 0x1a00 10/100 ethernet @@ -846,6 +865,8 @@ product DLINK DSB650TX3 0x400b 10/100 ethernet product DLINK DSB650TX2 0x4102 10/100 ethernet product DLINK DSB650 0xabc1 10/100 ethernet +product DLINK2 DWLG122C1 0x3c03 DWL-G122 rev C1 +product DLINK2 WUA1340 0x3c04 WUA-1340 /* EIZO products */ product EIZO HUB 0x0000 hub @@ -915,9 +936,15 @@ /* Extended Systems products */ product EXTENDED XTNDACCESS 0x0100 XTNDAccess IrDA +/* Gigaset products */ +product GIGASET RT2573 0x0722 RT2573 + /* GoHubs products */ product GOHUBS GOCOM232 0x1001 GoCOM232 Serial +/* Good Way Technology products */ +product GOODWAY RT2573 0xc019 RT2573 + /* Gravis products */ product GRAVIS GAMEPADPRO 0x4001 GamePad Pro @@ -955,6 +982,7 @@ product GIGABYTE GNBR402W 0x8002 GN-BR402W product GIGABYTE GNWLBM101 0x8003 GN-WLBM101 product GIGABYTE GNWBKG 0x8007 GN-WBKG +product GIGABYTE GNWB01GS 0x8008 GN-WB01GS /* G.Mate, Inc products */ product GMATE YP3X00 0x1001 YP3X00 PDA @@ -1029,6 +1057,9 @@ /* HP products */ product HP2 C500 0x6002 PhotoSmart C500 +/* HUAWEI products */ +product HUAWEI3COM RT2573 0x0009 RT2573 + /* IBM Corporation */ product IBM USBCDROMDRIVE 0x4427 USB CD-ROM Drive @@ -1169,6 +1200,7 @@ product LINKSYS4 WUSB54G 0x000d WUSB54G wireless adapter product LINKSYS4 WUSB54GP 0x0011 WUSB54GP wireless adapter product LINKSYS4 HU200TS 0x001a HU200TS wireless adapter +product LINKSYS4 WUSB54GC 0x0020 WUSB54GC /* Logitech products */ product LOGITECH M2452 0x0203 M2452 keyboard @@ -1244,6 +1276,9 @@ product MSI RT2570 0x6861 RT2570 product MSI RT2570_2 0x6865 RT2570 product MSI RT2570_3 0x6869 RT2570 +product MSI RT2573 0x6877 RT2573 +product MSI RT2573_2 0xa861 RT2573 +product MSI RT2573_3 0xa874 RT2573 /* Microsoft products */ product MICROSOFT SIDEPREC 0x0008 SideWinder Precision Pro @@ -1393,6 +1428,9 @@ /* P.I. Engineering products */ product PIENGINEERING PS2USB 0x020b PS2 to Mac USB Adapter +/* Planex Communications products */ +product PLANEX2 GWUSMM 0xed02 GW-USMM + /* Plextor Corp. */ product PLEXTOR 40_12_40U 0x0011 PlexWriter 40/12/40U @@ -1435,6 +1473,10 @@ /* Putercom products */ product PUTERCOM UPA100 0x047e USB-1284 BRIDGE +/* Qcom products */ +product QCOM RT2573 0x6196 RT2573 +product QCOM RT2573_2 0x6229 RT2573 + /* Qualcomm products */ product QUALCOMM CDMA_MSM 0x3196 CDMA Technologies MSM modem product QUALCOMM2 CDMA_MSM 0x6000 CDMA Technologies MSM phone @@ -1454,6 +1496,8 @@ /* Ralink Technology products */ product RALINK RT2570 0x1706 RT2500USB wireless adapter product RALINK RT2570_2 0x2570 RT2500USB wireless adapter +product RALINK RT2573 0x2573 RT2573 +product RALINK RT2671 0x2671 RT2671 /* ReakTek products */ product REALTEK USBKR100 0x8150 USBKR100 USB Ethernet (GREEN HOUSE) @@ -1538,6 +1582,10 @@ product SITECOM LN029 0x182d USB 2.0 Ethernet product SITECOM SERIAL 0x2068 USB to serial cable (v2) +/* Sitecom Europe products */ +product SITECOMEU WL172 0x90ac WL-172 +product SITECOMEU WL113R2 0x9712 WL-113 rev 2 + /* SmartBridges products */ product SMARTBRIDGES SMARTLINK 0x0001 SmartLink USB ethernet product SMARTBRIDGES SMARTNIC 0x0003 smartNIC 2 PnP ethernet @@ -1597,6 +1645,9 @@ /* XXX The above is a North American PC style keyboard possibly */ product SUN2 MOUSE 0x0100 Type 6 USB mouse +/* Surecom Technology products */ +product SURECOM RT2573 0x31f3 RT2573 + /* Supra products */ product DIAMOND2 SUPRAEXPRESS56K 0x07da Supra Express 56K modem product DIAMOND2 SUPRA2890 0x0b4a SupraMax 2890 56K Modem Index: sys/modules/rt2573/Makefile =================================================================== RCS file: sys/modules/rt2573/Makefile diff -N sys/modules/rt2573/Makefile --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sys/modules/rt2573/Makefile 5 Feb 2007 19:00:56 -0000 @@ -0,0 +1,3 @@ +KMOD= rt2573 +FIRMWS= rum-rt2573:rt2573:100 +.include Index: sys/modules/rum/Makefile =================================================================== RCS file: sys/modules/rum/Makefile diff -N sys/modules/rum/Makefile --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sys/modules/rum/Makefile 5 Feb 2007 19:00:56 -0000 @@ -0,0 +1,8 @@ +# $FreeBSD: src/sys/modules/ural/Makefile,v 1.1 2005/04/18 18:47:38 damien Exp $ + +.PATH: ${.CURDIR}/../../dev/usb + +KMOD = if_rum +SRCS = if_rum.c opt_bdg.h opt_usb.h device_if.h bus_if.h usbdevs.h + +.include --------------010902060408010806040104-- From owner-freebsd-usb@FreeBSD.ORG Mon Feb 5 21:30:31 2007 Return-Path: X-Original-To: freebsd-usb@hub.freebsd.org Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C415916A500 for ; Mon, 5 Feb 2007 21:30:28 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 00CA813C48E for ; Mon, 5 Feb 2007 21:30:25 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l15LUOZU076439 for ; Mon, 5 Feb 2007 21:30:24 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l15LUOLW076438; Mon, 5 Feb 2007 21:30:24 GMT (envelope-from gnats) Resent-Date: Mon, 5 Feb 2007 21:30:24 GMT Resent-Message-Id: <200702052130.l15LUOLW076438@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-usb@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jeff Anton Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 469A916A401 for ; Mon, 5 Feb 2007 21:23:32 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [69.147.83.33]) by mx1.freebsd.org (Postfix) with ESMTP id 37D6113C441 for ; Mon, 5 Feb 2007 21:23:32 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l15LNWoj053963 for ; Mon, 5 Feb 2007 21:23:32 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id l15LNVcf053962; Mon, 5 Feb 2007 21:23:31 GMT (envelope-from nobody) Message-Id: <200702052123.l15LNVcf053962@www.freebsd.org> Date: Mon, 5 Feb 2007 21:23:31 GMT From: Jeff Anton To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: usb/108810: quirk for I/O Magic USB flash drive "Giga Bank" X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2007 21:30:31 -0000 >Number: 108810 >Category: usb >Synopsis: quirk for I/O Magic USB flash drive "Giga Bank" >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-usb >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Feb 05 21:30:24 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Jeff Anton >Release: FreeBSD 6.1 >Organization: >Environment: FreeBSD paris.hesiod.org 6.1-RELEASE-p12 FreeBSD 6.1-RELEASE-p12 #7: Wed Jan 24 10:28:20 PST 2007 root@paris.hesiod.org:/usr/src/sys/i386/compile/PARIS i386 >Description: I/O Magic USB flash drive "Giga Bank" needs quirk information. This drive needs the NO_SYNC_CACHE quirk. It also is reporting itself as a fixed drive instead of a removable. Sigh. >How-To-Repeat: I/O Magic USB flash drive "Giga Bank" hangs FreeBSD when inserted. >Fix: diff cam/scsi/scsi_da.c.* 269a270,276 > { > /* > * I/O Magic USB flash - Giga Bank > */ > {T_DIRECT, SIP_MEDIA_FIXED, "GS-Magic", "stor*", "*"}, > /*quirks*/ DA_Q_NO_SYNC_CACHE > }, >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-usb@FreeBSD.ORG Tue Feb 6 00:59:32 2007 Return-Path: X-Original-To: usb@freebsd.org Delivered-To: freebsd-usb@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B3ECF16A400 for ; Tue, 6 Feb 2007 00:59:30 +0000 (UTC) (envelope-from redchin@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.190]) by mx1.freebsd.org (Postfix) with ESMTP id 4B78513C4B3 for ; Tue, 6 Feb 2007 00:59:29 +0000 (UTC) (envelope-from redchin@gmail.com) Received: by nf-out-0910.google.com with SMTP id m19so8494nfc for ; Mon, 05 Feb 2007 16:59:28 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=NbeeXWRmPWk3SnKvlkBdsfHY951EkI5M+h3wEJPU/wj0U3gg6VqNkeyfmsnciBC+Qc5nMMYjtmwwuku6hnKDl2hIdpIyhDB+C9Escn3JFO0Zre4UIwu3FT6T5BT69Lm+0qvtLhMv3/aCqbR3uNres/P/EgujqpdrryxZK2TI580= Received: by 10.82.175.2 with SMTP id x2mr1142356bue.1170721995346; Mon, 05 Feb 2007 16:33:15 -0800 (PST) Received: by 10.82.119.10 with HTTP; Mon, 5 Feb 2007 16:33:15 -0800 (PST) Message-ID: <1d3ed48c0702051633w39c52fa6kf414199e0f1f6e35@mail.gmail.com> Date: Mon, 5 Feb 2007 16:33:15 -0800 From: "Kevin Downey" To: "Luigi Rizzo" In-Reply-To: <20070130170443.A49225@xorpc.icir.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070130170443.A49225@xorpc.icir.org> Cc: usb@freebsd.org Subject: Re: Call for Testers: FreeBSD webcam driver (and more) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Feb 2007 00:59:32 -0000 On 1/30/07, Luigi Rizzo wrote: > I think I reached a first interesting milestone in my project > to build an emulation layer to compile linux device drivers on FreeBSD. > > I managed to build a FreeBSD port of the linux 'gspca' driver (which claims > to support 228 different webcams) with basically no modifications to > the original source. So it would be good if someone could give a try > to this code, either on -current or -stable, keeping in mind that > this is NOT PRODUCTION READY yet. > > More details on how the thing works are at > > http://info.iet.unipi.it/~luigi/FreeBSD/linux_bsd_kld.html > > together of course with source code, and even binary modules > for FreeBSD 6.2. > Basically I would like to know how it builds/works on -current, > have reports on cameras that work with it and those which don't > and so on. The driver supports the Video4Linux API so it should > be useful for a variety of applications. very cool. But how do you know if it works? what applications can be used with this and how do you set them to use this? I have a Quickcam Chat which apears to be supported by the linux gscpa driver(sorry I am away from it right now or I would post a dmesg). How would I access the cameras video feed? -- The biggest problem with communication is the illusion that it has occurred. From owner-freebsd-usb@FreeBSD.ORG Tue Feb 6 05:40:04 2007 Return-Path: X-Original-To: usb@freebsd.org Delivered-To: freebsd-usb@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8B15816A400; Tue, 6 Feb 2007 05:40:04 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 3ED2D13C461; Tue, 6 Feb 2007 05:40:04 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id l165btrF042898; Mon, 5 Feb 2007 22:37:56 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 05 Feb 2007 22:38:29 -0700 (MST) Message-Id: <20070205.223829.-1962670763.imp@bsdimp.com> To: almarrie@gmail.com From: "M. Warner Losh" In-Reply-To: <499c70c0702050230r459c3b9cv87d1828f0a18edd3@mail.gmail.com> References: <499c70c0702050005r76338d52i790e930dfffed43a@mail.gmail.com> <45C702A1.8080104@icir.org> <499c70c0702050230r459c3b9cv87d1828f0a18edd3@mail.gmail.com> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Mon, 05 Feb 2007 22:37:56 -0700 (MST) Cc: usb@freebsd.org, rizzo@icir.org, bms@icir.org, leafy7382@gmail.com, current@freebsd.org Subject: Re: Call for Testers: FreeBSD webcam driver (and more) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Feb 2007 05:40:05 -0000 In message: <499c70c0702050230r459c3b9cv87d1828f0a18edd3@mail.gmail.com> "Abdullah Ibn Hamad Al-Marri" writes: : On 2/5/07, Bruce M. Simpson wrote: : > Abdullah Ibn Hamad Al-Marri wrote: : > > : > > Check this out please. : > > : > > http://www.hydromel.net/driver/gpr400/ : > Erm, I mostly ported this to FreeBSD already: : > : > http://people.freebsd.org/~bms/dump/gprsc/ : > : : Great stuff! :) : : How about this one : http://openfacts.berlios.de/index-en.phtml?title=TI_FlashMedia_xx12/xx21_driver : ? Now that is cool! One can also find links to a ti binary only version, and with a little more digging to the omap datasheets that contain some hints as well... Warner From owner-freebsd-usb@FreeBSD.ORG Tue Feb 6 08:13:35 2007 Return-Path: X-Original-To: usb@freebsd.org Delivered-To: freebsd-usb@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 36B6416A400 for ; Tue, 6 Feb 2007 08:13:35 +0000 (UTC) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.freebsd.org (Postfix) with ESMTP id 2262913C441 for ; Tue, 6 Feb 2007 08:13:35 +0000 (UTC) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.13.6) with ESMTP id l168DYBH047612; Tue, 6 Feb 2007 00:13:34 -0800 (PST) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id l168DY5a047611; Tue, 6 Feb 2007 00:13:34 -0800 (PST) (envelope-from rizzo) Date: Tue, 6 Feb 2007 00:13:34 -0800 From: Luigi Rizzo To: Kevin Downey Message-ID: <20070206001334.A47591@xorpc.icir.org> References: <20070130170443.A49225@xorpc.icir.org> <1d3ed48c0702051633w39c52fa6kf414199e0f1f6e35@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <1d3ed48c0702051633w39c52fa6kf414199e0f1f6e35@mail.gmail.com>; from redchin@gmail.com on Mon, Feb 05, 2007 at 04:33:15PM -0800 Cc: usb@freebsd.org Subject: Re: Call for Testers: FreeBSD webcam driver (and more) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Feb 2007 08:13:35 -0000 On Mon, Feb 05, 2007 at 04:33:15PM -0800, Kevin Downey wrote: > On 1/30/07, Luigi Rizzo wrote: > > I think I reached a first interesting milestone in my project > > to build an emulation layer to compile linux device drivers on FreeBSD. > > > > I managed to build a FreeBSD port of the linux 'gspca' driver (which claims > > to support 228 different webcams) with basically no modifications to > > the original source. So it would be good if someone could give a try > > to this code, either on -current or -stable, keeping in mind that > > this is NOT PRODUCTION READY yet. > > > > More details on how the thing works are at > > > > http://info.iet.unipi.it/~luigi/FreeBSD/linux_bsd_kld.html > > > > together of course with source code, and even binary modules > > for FreeBSD 6.2. > > Basically I would like to know how it builds/works on -current, > > have reports on cameras that work with it and those which don't > > and so on. The driver supports the Video4Linux API so it should > > be useful for a variety of applications. > > very cool. But how do you know if it works? what applications can be a good idea would be to read the 'Trying the drivers' section of the page above and do what it says there :) As for the list of application i cannot make one because i have no idea which ones apart from ekiga (which requires a patch on FreeBSD) and the pwcview mentioned in the page. cheers luigi From owner-freebsd-usb@FreeBSD.ORG Fri Feb 9 17:38:53 2007 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A9E1E16A400 for ; Fri, 9 Feb 2007 17:38:53 +0000 (UTC) (envelope-from cao@bus.net) Received: from mail.c.bus.net (mail.c.bus.net [65.85.139.24]) by mx1.freebsd.org (Postfix) with ESMTP id 810AA13C48D for ; Fri, 9 Feb 2007 17:38:51 +0000 (UTC) (envelope-from cao@bus.net) Received: from chuckws.c.bus.net (chuckws.c.bus.net [192.168.1.20]) by mail.c.bus.net (Postfix) with ESMTP id B6C135482C for ; Fri, 9 Feb 2007 12:04:17 -0500 (EST) Received: (from cao@localhost) by chuckws.c.bus.net (8.13.4/8.13.4/Submit) id l19H7F7A003702 for freebsd-usb@freebsd.org; Fri, 9 Feb 2007 12:07:15 -0500 (EST) (envelope-from cao) Date: Fri, 9 Feb 2007 12:07:15 -0500 From: chuck odonnell To: freebsd-usb@freebsd.org Message-ID: <20070209170715.GD3387@bus.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: Verizon XV6700/HTC Apache/Audiovox UT Starcomm PPC-6700 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Feb 2007 17:38:53 -0000 hi. i have a Verizon XV6700 (aka HTC Apache aka Audiovox UT Starcomm PPC-6700). usbd loads it under the generic ugen0 device. usbd will report different vendor/device codes depending on whether you have the XV6700 in sync mode (default) or in modem mode (i.e., WMODEM running and started). but either way usbd just drops it into ugen0. this is what i tried so far: Freebsd 6.2R, kernel compiled with device ucom device umodem device umct device ubsa device ubser device uftdi device uplcom device uvisor device uvscom this would seem to indicate that the device has not been added yet. any pointers to docs on how to get this device added? i haven't done much with internals, but would be happy to do whatever is within my capability if someone can get me going. thanks. best, chuck