From owner-freebsd-drivers@FreeBSD.ORG Sun Jan 7 13:36:45 2007 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AD8AA16A40F; Sun, 7 Jan 2007 13:36:45 +0000 (UTC) (envelope-from Benjamin.Close@clearchain.com) Received: from ipmail01.adl2.internode.on.net (ipmail01.adl2.internode.on.net [203.16.214.140]) by mx1.freebsd.org (Postfix) with ESMTP id 5D29F13C44C; Sun, 7 Jan 2007 13:36:43 +0000 (UTC) (envelope-from Benjamin.Close@clearchain.com) Received: from ppp225-225.lns2.adl4.internode.on.net (HELO mail.clearchain.com) ([203.122.225.225]) by ipmail01.adl2.internode.on.net with ESMTP; 08 Jan 2007 00:06:41 +1030 X-IronPort-AV: i="4.13,157,1167571800"; d="scan'208"; a="70609416:sNHT26384540" Received: from [192.168.155.249] ([192.168.155.249]) (authenticated bits=0) by mail.clearchain.com (8.13.8/8.13.8) with ESMTP id l07DaVPL003024 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 8 Jan 2007 00:06:37 +1030 (CST) (envelope-from Benjamin.Close@clearchain.com) Message-ID: <45A0F739.3030202@clearchain.com> Date: Mon, 08 Jan 2007 00:05:53 +1030 From: Benjamin Close User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: Massimo Lusetti References: <459E6477.2010508@clearchain.com> <200701051634.00293.max@love2party.net> <459E75A5.7000309@FreeBSD.org> <200701051732.27176.max@love2party.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.88.7/2418/Sun Jan 7 20:12:41 2007 on pegasus.clearchain.com X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (mail.clearchain.com [192.168.155.1]); Mon, 08 Jan 2007 00:06:39 +1030 (CST) Cc: Florent Thoumie , freebsd-hackers@freebsd.org, freebsd-drivers@freebsd.org, Attilio Rao , damien.bergamini@free.fr, sam@freebsd.org, gabor@freebsd.org, Max Laier Subject: Re: Updated Driver for 3945ABG Intel 3945ABG Wireless LAN controller X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jan 2007 13:36:45 -0000 Massimo Lusetti wrote: > On 1/5/07, Max Laier wrote: >> Thoughts? Volunteers? > I can say that the first attempt still running fine here on my laptop > on a -STABLE as of yesterday. I use it on a daily basis without any > glitch. I must say i don't do or tried to do nothing special or > network intensive job, but for reading emails, doing a lot of ssh and > http/https the drivers is working smoothly. > > I will try to compile this new one on my stable during the week end > and will see on Monday how it will perform on my office wi-lan. > > For the records: my wpi doesn't still work on OpenBSD-current cause > it's integrated and the switch used to turn it on seems an acpi one > which OpenBSD doesn't attach very well yet. Hi Folks, I did the port as my searching led me to believe that progress on a driver had stagnated. Port 1: was done by Damien himself (http://lists.freebsd.org/pipermail/freebsd-mobile/2006-July/008768.html) Port 2: was an updated version by Daminen: http://osdir.com/ml/freebsd-hackers@freebsd.org/msg58154.html which seems to be duplicated here: http://people.freebsd.org/~flz/local/wpi/ (http://www.mail-archive.com/freebsd-net@freebsd.org/msg20710.html) With version 2 being minor bug fixes to version 1 to try and get it working. Since then the driver has come a long way in netbsd with the FreeBSD version just getting older. To others working on a wpi driver, please post something indicating what you've done and even a sample of what your up to so we can one build one driver that just works. I also did the driver port as everything I found failed to work on a 64bit kernel, most the time wouldn't even compile. I'm happy to try and maintain this driver. I have the hardware. The main bugs I know about in this driver port are: * The use of the iee80211_amrr code The files exist in -current in /usr/src/sys/net80211 but the required symbols are not in a GENERIC kernel build. There is a wlan_amrr module which uses this code, though I'm not sure how to make use of this, it appears a simple dependency on the module is not enough. The use of the 80211_amrr code also means that use under -stable requires quite a bit more work as Rink pointed out. * Bus resource allocation issues Mainly related to: "bus_dmamem_alloc failed to align memory properly." I'm hoping Mike (http://lists.freebsd.org/pipermail/freebsd-stable/2006-June/026262.html) might be able to help resolve these. These allocation issues are caused while allocating of the rx & tx ring buffers - which if they are broken explain why things don't work. I'm still coming to grips to how the whole bus_dma_tag_create works. The Netbsd bus_dma_map_alloc seems much more intuitive. I've found if the module failed the first time, unloading it, then reloading it would often make the allocation issues disappear and the driver just work. Though I've also found sometimes that even though the allocation issues are reported, things still work, I'm guessing the alignment is pulled into line by higher levels of bus_dma. * ifconfig down causes timeouts reseting the tx ring I'm still chasing the cause of this. It seems non critical as the driver still works with an ifconfig up * Watch dog timer uses an obsolete interface I'm looking into the correct way to do watchdog timing * A lock order reversal in wpi_intr lock order reversal: 1st 0xffffffff812d9e20 wpi0 (network driver) @ if_wpi.c:1554 2nd 0xffffff003cee32f0 radix node head (radix node head) @ net/route.c:147 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x3a witness_checkorder() at witness_checkorder+0x4f9 _mtx_lock_flags() at _mtx_lock_flags+0x75 rtalloc1() at rtalloc1+0x7a arplookup() at arplookup+0x5c arpintr() at arpintr+0x255 ether_demux() at ether_demux+0x2d3 ether_input() at ether_input+0x1e9 ieee80211_input() at ieee80211_input+0xd05 wpi_intr() at wpi_intr+0x9d7 ithread_loop() at ithread_loop+0xfe fork_exit() at fork_exit+0xaa fork_trampoline() at fork_trampoline+0xe --- trap 0, rip = 0, rsp = 0xffffffffa0698d40, rbp = 0 --- For those wishing to help debug the driver and get it working, I've posted a new version http://www.clearchain.com/~benjsc/download/20070107-wpi-freebsd.tar.gz To help debug: kldload wpi_ucode kldload if_wpi wlandebug -i wpi0 0xffffff (I've included a copy of the -current tool to save having to checkout the tree) sysctl debug.wpi=10 (Debug levels are explained in if_wpi.c) ifconfig wpi0 up ... wait 30 seconds then... ifconfig wpi0 down Then put /var/log/messages somewhere on the web & let me know This will dump lots of debug info to syslog but should help me work out whats happening. If the driver works for you, stick to debug level 5 max, else you'll be bombarded with logs. I'll try to install FBSD 32 -current & -stable (32/64) on the laptop in the next week to see what might be different. ANY feedback is helpful. Finally, for those who see "rx tail flags error xxx" this is caused by a 802.11 frame with an invalid CRC. Hence seeing the occasional one (with debug level 4 or higher) is quiet normal. If you see floods of them then chances are the rx ring is really out of alignment and things will just be busted. Cheers, Benjamin From owner-freebsd-drivers@FreeBSD.ORG Sun Jan 7 15:52:33 2007 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6A80A16A407; Sun, 7 Jan 2007 15:52:33 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177]) by mx1.freebsd.org (Postfix) with ESMTP id 4377D13C44C; Sun, 7 Jan 2007 15:52:32 +0000 (UTC) (envelope-from max@love2party.net) Received: from [88.64.178.23] (helo=amd64.laiers.local) by mrelayeu.kundenserver.de (node=mrelayeu4) with ESMTP (Nemesis), id 0ML21M-1H3aJt3IbO-0000RV; Sun, 07 Jan 2007 16:52:26 +0100 From: Max Laier Organization: FreeBSD To: freebsd-hackers@freebsd.org Date: Sun, 7 Jan 2007 16:52:14 +0100 User-Agent: KMail/1.9.5 References: <459E6477.2010508@clearchain.com> <45A0F739.3030202@clearchain.com> In-Reply-To: <45A0F739.3030202@clearchain.com> X-Face: ,,8R(x[kmU]tKN@>gtH1yQE4aslGdu+2]; R]*pL,U>^H?)gW@49@wdJ`H<=?utf-8?q?=25=7D*=5FBD=0A=09U=5For=3D=5CmOZf764=26nYj=3DJYbR1PW0ud?=>|!~,,CPC.1-D$FG@0h3#'5"k{V]a~.<=?utf-8?q?mZ=7D44=23Se=7Em=0A=09Fe=7E=5C=5DX5B=5D=5Fxj?=(ykz9QKMw_l0C2AQ]}Ym8)fU MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart12044061.EdYQbaGecM"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200701071652.24674.max@love2party.net> X-Provags-ID: kundenserver.de abuse@kundenserver.de login:61c499deaeeba3ba5be80f48ecc83056 Cc: Massimo Lusetti , Benjamin Close , Florent Thoumie , freebsd-drivers@freebsd.org, Attilio Rao , damien.bergamini@free.fr, sam@freebsd.org, gabor@freebsd.org Subject: Re: Updated Driver for 3945ABG Intel 3945ABG Wireless LAN controller X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jan 2007 15:52:33 -0000 --nextPart12044061.EdYQbaGecM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sunday 07 January 2007 14:35, Benjamin Close wrote: > Massimo Lusetti wrote: > > On 1/5/07, Max Laier wrote: > >> Thoughts? Volunteers? > > > > I can say that the first attempt still running fine here on my laptop > > on a -STABLE as of yesterday. I use it on a daily basis without any > > glitch. I must say i don't do or tried to do nothing special or > > network intensive job, but for reading emails, doing a lot of ssh and > > http/https the drivers is working smoothly. > > > > I will try to compile this new one on my stable during the week end > > and will see on Monday how it will perform on my office wi-lan. > > > > For the records: my wpi doesn't still work on OpenBSD-current cause > > it's integrated and the switch used to turn it on seems an acpi one > > which OpenBSD doesn't attach very well yet. > > Hi Folks, > I did the port as my searching led me to believe that progress on a > driver had stagnated. > Port 1: was done by Damien himself > (http://lists.freebsd.org/pipermail/freebsd-mobile/2006-July/008768.htm >l) Port 2: was an updated version by Daminen: > http://osdir.com/ml/freebsd-hackers@freebsd.org/msg58154.html > which seems to be duplicated here: > http://people.freebsd.org/~flz/local/wpi/ > (http://www.mail-archive.com/freebsd-net@freebsd.org/msg20710.html) > With version 2 being minor bug fixes to version 1 to try and get it > working. Since then the driver has come a long way in netbsd with the > FreeBSD version just getting older. > > To others working on a wpi driver, please post something indicating > what you've done and even a sample of what your up to so we can one > build one driver that just works. I also did the driver port as > everything I found failed to work on a 64bit kernel, most the time > wouldn't even compile. > > I'm happy to try and maintain this driver. I have the hardware. Excellent! > The main bugs I know about in this driver port are: > > * The use of the iee80211_amrr code > The files exist in -current in /usr/src/sys/net80211 but the required > symbols are not in a GENERIC kernel build. There is a wlan_amrr module > which uses this code, though I'm not sure how to make use of this, it > appears a simple dependency on the module is not enough. The use of the > 80211_amrr code also means that use under -stable requires quite a bit > more work as Rink pointed out. > > * Bus resource allocation issues > Mainly related to: "bus_dmamem_alloc failed to align memory properly." > I'm hoping Mike > (http://lists.freebsd.org/pipermail/freebsd-stable/2006-June/026262.htm >l) might be able to help resolve these. > > These allocation issues are caused while allocating of the rx & tx ring > buffers - which if they are broken explain why things don't work. > I'm still coming to grips to how the whole bus_dma_tag_create works. > The Netbsd bus_dma_map_alloc seems much more intuitive. > I've found if the module failed the first time, unloading it, then > reloading it would often make the allocation issues disappear and the > driver just work. > Though I've also found sometimes that even though the allocation issues > are reported, things still work, I'm guessing the alignment is pulled > into line by higher levels of bus_dma. > > * ifconfig down causes timeouts reseting the tx ring > I'm still chasing the cause of this. It seems non critical as the > driver still works with an ifconfig up > > * Watch dog timer uses an obsolete interface > I'm looking into the correct way to do watchdog timing I have patches for iwi(4) somewhere and should finally get to doing=20 something with them ... > * A lock order reversal in wpi_intr > lock order reversal: > 1st 0xffffffff812d9e20 wpi0 (network driver) @ if_wpi.c:1554 > 2nd 0xffffff003cee32f0 radix node head (radix node head) @ > net/route.c:147 KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x3a > witness_checkorder() at witness_checkorder+0x4f9 > _mtx_lock_flags() at _mtx_lock_flags+0x75 > rtalloc1() at rtalloc1+0x7a > arplookup() at arplookup+0x5c > arpintr() at arpintr+0x255 > ether_demux() at ether_demux+0x2d3 > ether_input() at ether_input+0x1e9 > ieee80211_input() at ieee80211_input+0xd05 > wpi_intr() at wpi_intr+0x9d7 > ithread_loop() at ithread_loop+0xfe > fork_exit() at fork_exit+0xaa > fork_trampoline() at fork_trampoline+0xe > --- trap 0, rip =3D 0, rsp =3D 0xffffffffa0698d40, rbp =3D 0 --- This one looks like the same issue as if_iwi.c, 1.43:=20 http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/iwi/if_iwi.c#rev1.43 i.e. just drop the driver lock when calling back into the (net80211)=20 stack. There is some discussion about how the "ic" is protected, but for=20 now dropping the lock is the right thing to do. > For those wishing to help debug the driver and get it working, I've > posted a new version > http://www.clearchain.com/~benjsc/download/20070107-wpi-freebsd.tar.gz Your box seems to have a reasonable uptime. Is that right, or should I=20 continue to mirror your tarballs? > To help debug: > > kldload wpi_ucode > kldload if_wpi > wlandebug -i wpi0 0xffffff (I've included a copy of the -current > tool to save having to checkout the tree) > sysctl debug.wpi=3D10 (Debug levels are explained in if_wpi.c) > ifconfig wpi0 up > ... wait 30 seconds then... > ifconfig wpi0 down > > Then put /var/log/messages somewhere on the web & let me know > > This will dump lots of debug info to syslog but should help me work out > whats happening. If the driver works for you, stick to debug level 5 > max, else you'll be bombarded with logs. I'll try to install FBSD 32 > -current & -stable (32/64) on the laptop in the next week to see what > might be different. ANY feedback is helpful. > > Finally, for those who see "rx tail flags error xxx" this is caused by > a 802.11 frame with an invalid CRC. Hence seeing the occasional one > (with debug level 4 or higher) is quiet normal. If you see floods of > them then chances are the rx ring is really out of alignment and things > will just be busted. =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --nextPart12044061.EdYQbaGecM Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQBFoRc4XyyEoT62BG0RAv9WAJ91z7RP+C+Gw0wnG0clMYjgwcXkBwCfRjYd VSfCAbUxoC/az+NIzIzDfKM= =rmVB -----END PGP SIGNATURE----- --nextPart12044061.EdYQbaGecM-- From owner-freebsd-drivers@FreeBSD.ORG Sun Jan 7 17:08:47 2007 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 769E216A407; Sun, 7 Jan 2007 17:08:47 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from av7-2-sn3.vrr.skanova.net (av7-2-sn3.vrr.skanova.net [81.228.9.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2DD1713C44C; Sun, 7 Jan 2007 17:08:46 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: by av7-2-sn3.vrr.skanova.net (Postfix, from userid 502) id 53D2137EC0; Sun, 7 Jan 2007 17:39:38 +0100 (CET) Received: from smtp3-1-sn3.vrr.skanova.net (smtp3-1-sn3.vrr.skanova.net [81.228.9.101]) by av7-2-sn3.vrr.skanova.net (Postfix) with ESMTP id 16C1B37E60; Sun, 7 Jan 2007 17:39:38 +0100 (CET) Received: from [192.168.1.199] (81-234-214-163-no68.tbcn.telia.com [81.234.214.163]) by smtp3-1-sn3.vrr.skanova.net (Postfix) with ESMTP id D55E237E49; Sun, 7 Jan 2007 17:40:00 +0100 (CET) From: Joel Dahl To: Benjamin Close In-Reply-To: <45A0F739.3030202@clearchain.com> References: <459E6477.2010508@clearchain.com> <200701051634.00293.max@love2party.net> <459E75A5.7000309@FreeBSD.org> <200701051732.27176.max@love2party.net> <45A0F739.3030202@clearchain.com> Content-Type: text/plain; charset=iso8859-1 Date: Sun, 07 Jan 2007 17:39:59 +0100 Message-Id: <1168187999.1124.4.camel@jesus.automatvapen.se> Mime-Version: 1.0 X-Mailer: Evolution 2.8.2.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Sun, 07 Jan 2007 21:31:24 +0000 Cc: Massimo Lusetti , gavin.atkinson@ury.york.ac.uk, Florent Thoumie , freebsd-hackers@freebsd.org, freebsd-drivers@freebsd.org, Attilio Rao , damien.bergamini@free.fr, sam@freebsd.org, gabor@freebsd.org, Max Laier Subject: Re: Updated Driver for 3945ABG Intel 3945ABG Wireless LAN controller X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jan 2007 17:08:47 -0000 Mån 2007-01-08 klockan 00:05 +1030 skrev Benjamin Close: > Hi Folks, > I did the port as my searching led me to believe that progress on a > driver had stagnated. > Port 1: was done by Damien himself > (http://lists.freebsd.org/pipermail/freebsd-mobile/2006-July/008768.html) > Port 2: was an updated version by Daminen: > http://osdir.com/ml/freebsd-hackers@freebsd.org/msg58154.html > which seems to be duplicated here: > http://people.freebsd.org/~flz/local/wpi/ > (http://www.mail-archive.com/freebsd-net@freebsd.org/msg20710.html) > With version 2 being minor bug fixes to version 1 to try and get it > working. Since then the driver has come a long way in netbsd with the > FreeBSD version just getting older. > > To others working on a wpi driver, please post something indicating what > you've done and even a sample of what your up to so we can one build one > driver that just works. I also did the driver port as everything I found > failed to work on a 64bit kernel, most the time wouldn't even compile. Gavin Atkinson (CC'ed) is AFAIK also working on wpi(4) for FreeBSD, according to his announcement on net@: http://lists.freebsd.org/pipermail/freebsd-net/2006-December/012808.html -- Joel From owner-freebsd-drivers@FreeBSD.ORG Thu Jan 11 21:21:52 2007 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9ABFE16A407 for ; Thu, 11 Jan 2007 21:21:52 +0000 (UTC) (envelope-from daniel@roe.ch) Received: from calvin.roe.ch (calvin.roe.ch [213.144.141.26]) by mx1.freebsd.org (Postfix) with ESMTP id 583C713C428 for ; Thu, 11 Jan 2007 21:21:50 +0000 (UTC) (envelope-from daniel@roe.ch) Received: from d212-53-102-185.cust.tele2.ch ([212.53.102.185] helo=dragon.roe.ch) by calvin.roe.ch (envelope-from ) with ESMTPS (TLSv1:AES256-SHA:256) id 1H51Vb-000H7E-12 for freebsd-drivers@freebsd.org; Thu, 11 Jan 2007 16:06:27 +0100 Received: from roe by dragon.roe.ch (envelope-from ) with LOCAL id 1H51WG-0000YI-00 for freebsd-drivers@freebsd.org; Thu, 11 Jan 2007 16:07:08 +0100 Date: Thu, 11 Jan 2007 16:07:08 +0100 From: Daniel Roethlisberger To: freebsd-drivers@freebsd.org Message-ID: <20070111150707.GA1487@dragon.roe.ch> Mail-Followup-To: freebsd-drivers@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i DomainKey-Status: (calvin.roe.ch) DomainKey-Result: (calvin.roe.ch) Subject: Arch Handbook on pccarddevs.h X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jan 2007 21:21:52 -0000 I am currently having a go at writing a device driver for the pccard based smartcard reader Omnikey CM4040. The arch handbook states in the chapter on pccards [1] that there is a manual step involved in generating pccarddevs.h from pccarddevs, using Makefile.pccarddevs. However, it very much looks like said header file is generated automagically, and I cannot find the respective Makefile at all in my RELENG_6 sources. Also, there are special instructions for committers which probably aren't applicable anymore either. Can someone confirm that the relevant sections from [1] are out of date, and not applicable to 6.x/7.x anymore? -Dan [1] http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/pccard.html -- Daniel Roethlisberger