From nobody@FreeBSD.org  Thu Sep  8 21:43:53 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 08C3F16A41F
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  8 Sep 2005 21:43:53 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id AB28A43D45
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  8 Sep 2005 21:43:52 +0000 (GMT)
	(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 j88LhqLP075008
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 8 Sep 2005 21:43:52 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j88LhqSf074991;
	Thu, 8 Sep 2005 21:43:52 GMT
	(envelope-from nobody)
Message-Id: <200509082143.j88LhqSf074991@www.freebsd.org>
Date: Thu, 8 Sep 2005 21:43:52 GMT
From: David Brown <djb@gofree.co.uk>
To: freebsd-gnats-submit@FreeBSD.org
Subject: an0: timeouts with Cisco 350 minipci
X-Send-Pr-Version: www-2.3

>Number:         85886
>Category:       kern
>Synopsis:       [an] [patch] an0: timeouts with Cisco 350 minipci
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jhb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 08 21:50:13 GMT 2005
>Closed-Date:    Mon Mar 04 17:36:49 UTC 2013
>Last-Modified:  Mon Mar  4 17:40:00 UTC 2013
>Originator:     David Brown
>Release:        6 beta4
>Organization:
N/A
>Environment:
IBM T40 laptop with built in Cisco 350 minipci wireless nic.

FreeBSD bsdlaptop 6.0-BETA4 FreeBSD 6.0-BETA4 #1: Wed Sep  7 22:14:48 BST 2005     djbrown@bsdlaptop:/usr/obj/usr/src/sys/MYKERN  
>Description:
The Cisco 350 minipci wireless is almost useless as it drops out very frequently.

output of ifconfig:
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=b<RXCSUM,TXCSUM,VLAN_MTU>
        inet 192.168.0.4 netmask 0xffffff00 broadcast 192.168.0.255
        ether 00:0d:60:5e:9f:57
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
an0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 192.168.0.4 netmask 0xffffff00 broadcast 192.168.0.255
        ether 00:02:8a:dd:ae:d2
        media: IEEE 802.11 Wireless Ethernet autoselect (DS/11Mbps)
        status: associated
        ssid  1:Wireless channel 3
        stationname FreeBSD
an0: record length mismatch -- expected 194, got 196 for Rid ff10
        authmode OPEN privacy OFF deftxkey 1 txpowmax 0 rtsthreshold 0
        fragthreshold 0 roaming DEVICE
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
        inet 127.0.0.1 netmask 0xff000000


output of ping:
PING 192.168.0.1 (192.168.0.1): 56 data bytes
an0: device timeout
64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=4914.181 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=3915.282 ms
64 bytes from 192.168.0.1: icmp_seq=3 ttl=64 time=2916.216 ms
64 bytes from 192.168.0.1: icmp_seq=4 ttl=64 time=1917.271 ms
64 bytes from 192.168.0.1: icmp_seq=5 ttl=64 time=1004.354 ms
an0: device timeout
64 bytes from 192.168.0.1: icmp_seq=7 ttl=64 time=5423.167 ms
64 bytes from 192.168.0.1: icmp_seq=8 ttl=64 time=4424.101 ms
64 bytes from 192.168.0.1: icmp_seq=9 ttl=64 time=3425.091 ms
64 bytes from 192.168.0.1: icmp_seq=10 ttl=64 time=2426.324 ms
64 bytes from 192.168.0.1: icmp_seq=11 ttl=64 time=1004.042 ms
an0: device timeout
64 bytes from 192.168.0.1: icmp_seq=13 ttl=64 time=5443.470 ms
64 bytes from 192.168.0.1: icmp_seq=14 ttl=64 time=4449.495 ms
64 bytes from 192.168.0.1: icmp_seq=15 ttl=64 time=3449.405 ms
64 bytes from 192.168.0.1: icmp_seq=16 ttl=64 time=2449.269 ms
64 bytes from 192.168.0.1: icmp_seq=17 ttl=64 time=1004.529 ms


output of dmesg:
Copyright (c) 1992-2005 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD 6.0-BETA4 #1: Wed Sep  7 22:14:48 BST 2005
    djbrown@bsdlaptop:/usr/obj/usr/src/sys/MYKERN
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel(R) Pentium(R) M processor 1500MHz (1495.16-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x695  Stepping = 5
  Features=0xa7e9f9bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,TM,PBE>
  Features2=0x180<EST,TM2>
real memory  = 804651008 (767 MB)
avail memory = 782348288 (746 MB)
npx0: [FAST]
npx0: <math processor> on motherboard
npx0: INT 16 interface
acpi0: <IBM TP-1R> on motherboard
acpi_ec0: <Embedded Controller: GPE 0x1c, ECDT> port 0x62,0x66 on acpi0
acpi0: Power Button (fixed)
pci_link0: <ACPI PCI Link LNKA> irq 11 on acpi0
pci_link1: <ACPI PCI Link LNKB> irq 11 on acpi0
pci_link2: <ACPI PCI Link LNKC> irq 11 on acpi0
pci_link3: <ACPI PCI Link LNKD> irq 11 on acpi0
pci_link4: <ACPI PCI Link LNKE> on acpi0
pci_link5: <ACPI PCI Link LNKF> on acpi0
pci_link6: <ACPI PCI Link LNKG> on acpi0
pci_link7: <ACPI PCI Link LNKH> irq 11 on acpi0
Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1008-0x100b on acpi0
cpu0: <ACPI CPU> on acpi0
acpi_perf0: <ACPI CPU Frequency Control> on cpu0
acpi_throttle0: <ACPI CPU Throttling> on cpu0
acpi_lid0: <Control Method Lid Switch> on acpi0
acpi_button0: <Sleep Button> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
agp0: <Intel 82855 host to AGP bridge> mem 0xd0000000-0xdfffffff at device 0.0 on pci0
pcib1: <ACPI PCI-PCI bridge> at device 1.0 on pci0
pci1: <ACPI PCI bus> on pcib1
pci1: <display, VGA> at device 0.0 (no driver attached)
uhci0: <Intel 82801DB (ICH4) USB controller USB-A> port 0x1800-0x181f irq 11 at device 29.0 on pci0
uhci0: [GIANT-LOCKED]
usb0: <Intel 82801DB (ICH4) USB controller USB-A> on uhci0
usb0: USB revision 1.0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1: <Intel 82801DB (ICH4) USB controller USB-B> port 0x1820-0x183f irq 11 at device 29.1 on pci0
uhci1: [GIANT-LOCKED]
usb1: <Intel 82801DB (ICH4) USB controller USB-B> on uhci1
usb1: USB revision 1.0
uhub1: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
uhci2: <Intel 82801DB (ICH4) USB controller USB-C> port 0x1840-0x185f irq 11 at device 29.2 on pci0
uhci2: [GIANT-LOCKED]
usb2: <Intel 82801DB (ICH4) USB controller USB-C> on uhci2
usb2: USB revision 1.0
uhub2: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
ehci0: <Intel 82801DB/DBL/DBM (ICH4) USB 2.0 controller> mem 0xc0000000-0xc00003ff irq 11 at device 29.7 on pci0
ehci0: [GIANT-LOCKED]
usb3: EHCI version 1.0
usb3: companion controllers, 2 ports each: usb0 usb1 usb2
usb3: <Intel 82801DB/DBL/DBM (ICH4) USB 2.0 controller> on ehci0
usb3: USB revision 2.0
uhub3: Intel EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub3: 6 ports with 6 removable, self powered
pcib2: <ACPI PCI-PCI bridge> at device 30.0 on pci0
pci2: <ACPI PCI bus> on pcib2
cbb0: <TI1520 PCI-CardBus Bridge> mem 0xb0000000-0xb0000fff irq 11 at device 0.0 on pci2
cardbus0: <CardBus bus> on cbb0
pccard0: <16-bit PCCard bus> on cbb0
cbb1: <TI1520 PCI-CardBus Bridge> mem 0xb1000000-0xb1000fff irq 11 at device 0.1 on pci2
cardbus1: <CardBus bus> on cbb1
pccard1: <16-bit PCCard bus> on cbb1
em0: <Intel(R) PRO/1000 Network Connection, Version - 2.1.7> port 0x8400-0x843f mem 0xc0220000-0xc023ffff,0xc0200000-0xc020ffff irq 11 at device 1.0 on pci2
em0: Ethernet address: 00:0d:60:5e:9f:57
em0:  Speed:N/A  Duplex:N/A
an0: <Cisco Aironet MPI350> port 0x8000-0x80ff mem 0xc0210000-0xc0213fff,0xc0400000-0xc07fffff irq 11 at device 2.0 on pci2
an0: record length mismatch -- expected 194, got 196 for Rid ff10
an0: record length mismatch -- expected 192, got 260 for Rid ff00
an0: got RSSI <-> dBM map
an0: supported rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
an0: Ethernet address: 00:02:8a:dd:ae:d2
an0: [GIANT-LOCKED]
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel ICH4 UDMA100 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x1860-0x186f at device 31.1 on pci0
ata0: <ATA channel 0> on atapci0
ata1: <ATA channel 1> on atapci0
pci0: <serial bus, SMBus> at device 31.3 (no driver attached)
pcm0: <Intel ICH4 (82801DB)> port 0x1c00-0x1cff,0x18c0-0x18ff mem 0xc0000c00-0xc0000dff,0xc0000800-0xc00008ff irq 11 at device 31.5 on pci0
pcm0: [GIANT-LOCKED]
pcm0: <Analog Devices AD1981B AC97 Codec>
pci0: <simple comms, generic modem> at device 31.6 (no driver attached)
acpi_tz0: <Thermal Zone> on acpi0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: model Generic PS/2 mouse, device ID 0
battery0: <ACPI Control Method Battery> on acpi0
acpi_acad0: <AC Adapter> on acpi0
pmtimer0 on isa0
orm0: <ISA Option ROMs> at iomem 0xd0000-0xd0fff,0xd1000-0xd1fff,0xdc000-0xdffff on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
Timecounter "TSC" frequency 1495157661 Hz quality 800
Timecounters tick every 1.000 msec
ad0: 35133MB <HTS548040M9AT00 MG2OA55A> at ata0-master UDMA100
acd0: CDRW <UJDA745 DVD/CDRW/1.03> at ata1-master UDMA33
Trying to mount root from ufs:/dev/ad0s1a
an0: record length mismatch -- expected 194, got 196 for Rid ff10
pid 42364 (pkg_add), uid 0: exited on signal 6 (core dumped)
pid 42790 (pkg_add), uid 0: exited on signal 6 (core dumped)
an0: record length mismatch -- expected 194, got 196 for Rid ff10
arp: 192.168.0.1 is on em0 but got reply from 00:09:5b:2c:01:6e on an0
an0: record length mismatch -- expected 194, got 196 for Rid ff10
an0: device timeout
an0: device timeout
pid 71972 (typesconfig), uid 0: exited on signal 11 (core dumped)
pid 71973 (typesconfig), uid 0: exited on signal 11 (core dumped)
an0: record length mismatch -- expected 194, got 196 for Rid ff10
arp: 192.168.0.1 is on em0 but got reply from 00:09:5b:2c:01:6e on an0
an0: record length mismatch -- expected 194, got 196 for Rid ff10
an0: device timeout
an0: record length mismatch -- expected 194, got 196 for Rid ff10
an0: record length mismatch -- expected 194, got 196 for Rid ff10
an0: device timeout
an0: device timeout
an0: device timeout
an0: device timeout
an0: device timeout
an0: record length mismatch -- expected 194, got 196 for Rid ff10
an0: device timeout
an0: record length mismatch -- expected 194, got 196 for Rid ff10
an0: record length mismatch -- expected 194, got 196 for Rid ff10
an0: record length mismatch -- expected 194, got 196 for Rid ff10
an0: record length mismatch -- expected 194, got 196 for Rid ff10
an0: record length mismatch -- expected 194, got 196 for Rid ff10
an0: device timeout
an0: device timeout
an0: device timeout
an0: device timeout
an0: device timeout
an0: device timeout
an0: device timeout
an0: device timeout
an0: device timeout
an0: device timeout
an0: device timeout


Thanks!!
>How-To-Repeat:
Simply try and send traffic over the an0 interface, e.g. ping.
>Fix:
      
>Release-Note:
>Audit-Trail:

From: "Jason Young" <jyoung@evelocity.net>
To: <bug-followup@FreeBSD.org>,
	<djb@gofree.co.uk>
Cc:  
Subject: Re: kern/85886: [an] an0: timeouts with Cisco 350 minipci
Date: Wed, 27 Dec 2006 01:24:19 -0500

 I've had the same symptoms when using the MPI350 (Aironet 350 series
 Mini PCI). Every N packets (seems to be 5 for me), the transmit
 interrupt would fail to fire and the result would be "an0: device
 timeout". The card would reset, then I could get another N packets,
 lather rinse repeat. The card will work when running 5.00.03 or below,
 but 5.02 and above experienced this problem.
 
 I spent a lot of time comparing what we do with the Cisco-updated Linux
 driver that's supposed to work with the new firmware. My results: it
 looks like the MPI350 does NOT want certain transmit control bits set.
 In if_anreg.h, we define the control bits for an 802.3 frame as follows:
 
 #define AN_TXCTL_8023   \
         (AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_HEADERTYPE_8023|
 \
         AN_PAYLOADTYPE_ETHER|AN_TXCTL_NORELEASE)
 
 There's another definition used when sending 802.11 frames, but the
 driver is not written to use that definition at all. If you drop the
 bits asking for TX complete and TX error interrupts, like so:
 
 #define AN_TXCTL_8023   \
         (AN_HEADERTYPE_8023|AN_PAYLOADTYPE_ETHER|AN_TXCTL_NORELEASE)
 
 The card runs happily at full speed, no timeouts, running any of the
 following firmware revisions: 5.00.01, 5.30.17 and 5.60.21. The MPI350
 has its own special kind of transmit interrupt, TX_CPY (transmit buffer
 copy or DMA done? unsure), so maybe the other two just don't apply to
 MPI350.
 
 The driver will still complain of RID length mismatches, but this should
 be cosmetic only for the driver's current feature set. In order to take
 full advantage of the card's features, the driver will have to learn
 about the new fields.
 
 I do not recommend the above change be committed as-is, because it will
 affect more than the MPI350. I think the right thing to do is to add an
 mpi350 switch (like many other places in the driver), but next week I
 should have access to some pccard Aironet 340 and 350s to do regression
 testing with. I would be interested in any feedback, though, to see if
 this change helps anyone else drive new-firmware MPI350s under FreeBSD.
 
 -jyoung

From: Jason Young <jyoung@spaceball1.doogles.com>
To: bug-followup@FreeBSD.org, djb@gofree.co.uk
Cc:  
Subject: Re: kern/85886: [an] an0: timeouts with Cisco 350 minipci
Date: Wed, 27 Dec 2006 01:20:53 -0500 (EST)

 I've had the same symptoms when using the MPI350 (Aironet 350 series Mini 
 PCI). Every N packets (seems to be 5 for me), the transmit interrupt would 
 fail to fire and the result would be "an0: device timeout". The card would 
 reset, then I could get another N packets, lather rinse repeat. The card 
 will work when running 5.00.03 or below, but 5.02 and above experienced 
 this problem.
 
 I spent a lot of time comparing what we do with the Cisco-updated Linux 
 driver that's supposed to work with the new firmware. My results: it looks 
 like the MPI350 does NOT want certain transmit control bits set. In 
 if_anreg.h, we define the control bits for an 802.3 frame as follows:
 
 #define AN_TXCTL_8023	\
  	(AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_HEADERTYPE_8023|	\
  	AN_PAYLOADTYPE_ETHER|AN_TXCTL_NORELEASE)
 
 There's another definition used when sending 802.11 frames, but the driver 
 is not written to use that definition at all. If you drop the bits asking 
 for TX complete and TX error interrupts, like so:
 
 #define AN_TXCTL_8023	\
  	(AN_HEADERTYPE_8023|AN_PAYLOADTYPE_ETHER|AN_TXCTL_NORELEASE)
 
 The card runs happily at full speed, no timeouts, running any of the 
 following firmware revisions: 5.00.01, 5.30.17 and 5.60.21. The MPI350 has 
 its own special kind of transmit interrupt, TX_CPY (transmit buffer copy 
 or DMA done? unsure), so maybe the other two just don't apply to MPI350.
 
 The driver will still complain of RID length mismatches, but this should 
 be cosmetic only for the driver's current feature set. In order to take 
 full advantage of the card's features, the driver will have to learn about 
 the new fields.
 
 I do not recommend the above change be committed as-is, because it will 
 affect more than the MPI350. I think the right thing to do is to add an 
 mpi350 switch (like many other places in the driver), but next week I 
 should have access to some pccard Aironet 340 and 350s to do regression 
 testing with. I would be interested in any feedback, though, to see if 
 this change helps anyone else drive new-firmware MPI350s under FreeBSD.
 
 -jyoung

From: Jason Young <jyoung@spaceball1.doogles.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/85886: [an] an0: timeouts with Cisco 350 minipci
Date: Tue, 2 Jan 2007 06:37:06 -0500 (EST)

 I've been continuing to hack around on the an(4) driver, trying to get the 
 multiple rx/tx descriptor modes working, looking at the work done in the 
 NetBSD camp to fully use the net80211 infrastructure, see if WPA can be 
 made to work, etc etc. Slow going, and I'm not sure I'll get much further 
 at my skill level.
 
 So in the meantime, here is the minimum change necessary to get the MPI350 
 working with the card running recent firmware. This change has been tested 
 with most of the firmware versions currently downloadable from Cisco, and 
 it should be a no-op for Aironet hardware other than the MPI350. These 
 diffs are against -HEAD as of today.
 
 -jyoung
 
 
 
 *** /sys/dev/an/if_anreg.h	Fri Jun 10 12:49:03 2005
 --- ./if_anreg.h	Sat Jan  6 00:59:09 2007
 ***************
 *** 392,409 ****
    #define AN_HEADERTYPE_80211	0x0008
 
    #define AN_PAYLOADTYPE_ETHER	0x0000
    #define AN_PAYLOADTYPE_LLC	0x0010
 
 ! #define AN_TXCTL_80211	\
 ! 	(AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_HEADERTYPE_80211|	\
 ! 	AN_PAYLOADTYPE_LLC|AN_TXCTL_NORELEASE)
 
 ! #define AN_TXCTL_8023	\
 ! 	(AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_HEADERTYPE_8023|	\
 ! 	AN_PAYLOADTYPE_ETHER|AN_TXCTL_NORELEASE)
 
    #define AN_TXGAP_80211		0
    #define AN_TXGAP_8023		0
 
    struct an_802_3_hdr {
    	u_int16_t		an_8023_status;
 --- 392,419 ----
    #define AN_HEADERTYPE_80211	0x0008
 
    #define AN_PAYLOADTYPE_ETHER	0x0000
    #define AN_PAYLOADTYPE_LLC	0x0010
 
 ! #define AN_TXCTL_80211		(AN_HEADERTYPE_80211|AN_PAYLOADTYPE_LLC)
 
 ! #define AN_TXCTL_8023		(AN_HEADERTYPE_8023|AN_PAYLOADTYPE_ETHER)
 
 + /*
 +  * Hardware-specific additions to the transmit control bits.
 +  * 
 +  * The MPI350 behaves poorly when the transmit-interrupt control bits are
 +  * set. Firmware revision 5.02.XX and newer wouldn't reliably acknowledge
 +  * transmits. Revisions 5.00.03 and below seem to let us get away with it.
 +  * Revisions 5.00.03, 5.30.17 and 5.60.21 all test fine if we don't set
 +  * those bits. This is probably related to the DMA transmit and receive
 +  * methods specific to the MPI350.
 +  */
 + 
 + #define AN_TXCTL_HW(x)		( x ? (AN_TXCTL_NORELEASE) : \
 + 	(AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_TXCTL_NORELEASE))
 +
    #define AN_TXGAP_80211		0
    #define AN_TXGAP_8023		0
 
    struct an_802_3_hdr {
    	u_int16_t		an_8023_status;
 
 
 
 *** /sys/dev/an/if_an.c	Mon Nov  6 08:41:50 2006
 --- ./if_an.c	Sat Jan  6 00:49:19 2007
 ***************
 *** 2636,2646 ****
 
    			m_copydata(m0, sizeof(struct ether_header) - 2 ,
    				   tx_frame_802_3.an_tx_802_3_payload_len,
    				   (caddr_t)&sc->an_txbuf);
 
 ! 			txcontrol = AN_TXCTL_8023;
    			/* write the txcontrol only */
    			an_write_data(sc, id, 0x08, (caddr_t)&txcontrol,
    				      sizeof(txcontrol));
 
    			/* 802_3 header */
 --- 2636,2646 ----
 
    			m_copydata(m0, sizeof(struct ether_header) - 2 ,
    				   tx_frame_802_3.an_tx_802_3_payload_len,
    				   (caddr_t)&sc->an_txbuf);
 
 ! 			txcontrol = AN_TXCTL_8023 | AN_TXCTL_HW(sc->mpi350);
    			/* write the txcontrol only */
    			an_write_data(sc, id, 0x08, (caddr_t)&txcontrol,
    				      sizeof(txcontrol));
 
    			/* 802_3 header */
 ***************
 *** 2699,2709 ****
 
    			m_copydata(m0, sizeof(struct ether_header) - 2 ,
    				   tx_frame_802_3.an_tx_802_3_payload_len,
    				   (caddr_t)&sc->an_txbuf);
 
 ! 			txcontrol = AN_TXCTL_8023;
    			/* write the txcontrol only */
    			bcopy((caddr_t)&txcontrol, &buf[0x08],
    			      sizeof(txcontrol));
 
    			/* 802_3 header */
 --- 2699,2709 ----
 
    			m_copydata(m0, sizeof(struct ether_header) - 2 ,
    				   tx_frame_802_3.an_tx_802_3_payload_len,
    				   (caddr_t)&sc->an_txbuf);
 
 ! 			txcontrol = AN_TXCTL_8023 | AN_TXCTL_HW(sc->mpi350);
    			/* write the txcontrol only */
    			bcopy((caddr_t)&txcontrol, &buf[0x08],
    			      sizeof(txcontrol));
 
    			/* 802_3 header */

From: "Kevin Foo" <chflags@gmail.com>
To: bug-followup@FreeBSD.org, djb@gofree.co.uk
Cc:  
Subject: Re : kern/85886: [an] an0: timeouts with Cisco 350 minipci
Date: Mon, 16 Jun 2008 17:07:03 +0800

 ------=_Part_23645_10533728.1213607223317
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 Any updates on this issue?
 
 http://www.freebsd.org/cgi/query-pr.cgi?pr=85886
 
 I'm still seeing this issue with 7.0-stable on IBM T42 with Cisco 350
 minipci. Scanning will make ifconfig and wpa_supplicant stop responding or
 even kill the process i.e. ap_scan=1 will terminate wpa_supplicant.
 
 TIA
 
 -- 
 Regards
 Kevin Foo
 
 ------=_Part_23645_10533728.1213607223317--

From: "Kevin Foo" <chflags@gmail.com>
To: bug-followup@freebsd.org, jyoung@spaceball1.doogles.com, 
	jyoung@evelocity.net
Cc:  
Subject: Re: kern/85886: [an] an0: timeouts with Cisco 350 minipci
Date: Wed, 18 Jun 2008 14:08:43 +0800

 ------=_Part_33479_9076624.1213769324147
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 With FreeBSD 7.0-stable running on T42 + Cisco Aironet 350 minipci, I'm able
 to associate with the AP with 128bits encryption via ifconfig command,
 ifconfig an0 ssid 'myap' wepmode on weptxkey 1 wepkey 1:0x<mykey>. Still no
 luck of getting wpa_supplicant to manage it.
 
 It started giving out problem after 15-20mins or with heavy usage (using
 scp). The device refused to work and lockup the system for a while (few
 seconds to minutes). The system will alive again after an0 puked out these
 error messages.
 
 an0: device timeout
 an0: reset failed
 an0: failed to allocate RX descriptor
 an0: failed to write RID 1 ff11 a921 fdba 4365 c287, 60
 an0: failed to set ssid list
 an0: failed to read RID 1 ff50 a921 fdba 4365 c287, 3
 an0: failed to read RID 1 ff50 a921 fdba 4365 c287, 3
 an0: failed to read RID 1 ff50 a921 fdba 4365 c287, 3
 an0: failed to read RID 1 ff50 a921 fdba 4365 c287, 3
 
 The firmware in use was 5.00.01. The an0 driver is still not happy with it.
 Or I should forget about the card and buy a new PCMCIA card to go wireless?
 Any help or hint on this would be great.
 
 -- 
 Regards
 Kevin Foo
 
 ------=_Part_33479_9076624.1213769324147--

From: Mark Linimon <linimon@lonesome.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/85886: [an] an0: timeouts with Cisco 350 minipci
Date: Sun, 29 Mar 2009 20:03:16 -0500

 ----- Forwarded message from Max Belov <max_belov@yahoo.com> -----
 
 From: Max Belov <max_belov@yahoo.com>
 To: freebsd-bugs@freebsd.org
 Subject: Question about kern/85886: [an] an0: timeouts with Cisco 350 minipci
 
 Hi All,
 
 I've recently installed FreeBSD 7.1-RELEASE on the old ThinkPad T41 and
 I've found that the problem reported in the kern/85886 still exists. I
 was able to find a fix for this bug in the DragonFly BSD
 (http://www.mail-archive.com/bugs@crater.dragonflybsd.org/msg03677.html).
 I've merged the fix with the AiroNet driver which is distributed with
 FreeBSD and so far it is working like a charm. I don't know if anybody
 planning to fix it, or it just was forgotten. Here is the fix which I'm
 using merged with the code from 7.1-RELEASE. It would be nice to merge
 it with the trunk if it was forgotten: 
 
 --- an.orig/if_anreg.h    2008-11-25 02:59:29.000000000 +0000
 +++ an/if_anreg.h    2009-03-22 00:02:50.000000000 +0000
 @@ -394,14 +394,17 @@
  #define AN_PAYLOADTYPE_ETHER    0x0000
  #define AN_PAYLOADTYPE_LLC    0x0010
  
 -#define AN_TXCTL_80211    \
 -    (AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_HEADERTYPE_80211|    \
 -    AN_PAYLOADTYPE_LLC|AN_TXCTL_NORELEASE)
 -
 -#define AN_TXCTL_8023    \
 -    (AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_HEADERTYPE_8023|    \
 -    AN_PAYLOADTYPE_ETHER|AN_TXCTL_NORELEASE)
 +#define AN_TXCTL_80211         (AN_HEADERTYPE_80211|AN_PAYLOADTYPE_LLC)
  
 +#define AN_TXCTL_8023          (AN_HEADERTYPE_8023|AN_PAYLOADTYPE_ETHER)
 +
 +/* 
 + * Additions to transmit control bits for MPI350
 + */
 +
 +#define AN_TXCTL_HW(x)         ( x ? (AN_TXCTL_NORELEASE) : \
 +       (AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_TXCTL_NORELEASE))
 + 
  #define AN_TXGAP_80211        0
  #define AN_TXGAP_8023        0
  
  
 
 --- an.orig/if_an.c    2008-11-25 02:59:29.000000000 +0000
 +++ an/if_an.c    2009-03-22 00:02:50.000000000 +0000
 @@ -2631,7 +2631,7 @@
      struct mbuf        *m0 = NULL;
      struct an_txframe_802_3    tx_frame_802_3;
      struct ether_header    *eh;
 -    int            id, idx, i;
 +    int            id, idx, i, ready;
      unsigned char           txcontrol;
      struct an_card_tx_desc an_tx_desc;
      u_int8_t        *buf;
 @@ -2658,12 +2658,14 @@
          return;
      }
  
 +    ready = 0;
      idx = sc->an_rdata.an_tx_prod;
  
      if (!sc->mpi350) {
          bzero((char *)&tx_frame_802_3, sizeof(tx_frame_802_3));
  
          while (sc->an_rdata.an_tx_ring[idx] == 0) {
 +            ready = 1;
              IFQ_DRV_DEQUEUE(&ifp->if_snd, m0);
              if (m0 == NULL)
                  break;
 @@ -2686,7 +2688,7 @@
                     tx_frame_802_3.an_tx_802_3_payload_len,
                     (caddr_t)&sc->an_txbuf);
  
 -            txcontrol = AN_TXCTL_8023;
 +            txcontrol = AN_TXCTL_8023 | AN_TXCTL_HW(sc->mpi350);
              /* write the txcontrol only */
              an_write_data(sc, id, 0x08, (caddr_t)&txcontrol,
                        sizeof(txcontrol));
 @@ -2725,6 +2727,7 @@
  
          while (sc->an_rdata.an_tx_empty ||
              idx != sc->an_rdata.an_tx_cons) {
 +            ready = 1;
              IFQ_DRV_DEQUEUE(&ifp->if_snd, m0);
              if (m0 == NULL) {
                  break;
 @@ -2749,7 +2752,7 @@
                     tx_frame_802_3.an_tx_802_3_payload_len,
                     (caddr_t)&sc->an_txbuf);
  
 -            txcontrol = AN_TXCTL_8023;
 +            txcontrol = AN_TXCTL_8023 | AN_TXCTL_HW(sc->mpi350);
              /* write the txcontrol only */
              bcopy((caddr_t)&txcontrol, &buf[0x08],
                    sizeof(txcontrol));
 @@ -2771,7 +2774,7 @@
                  tx_frame_802_3.an_tx_802_3_payload_len;
              an_tx_desc.an_phys 
                  = sc->an_tx_buffer[idx].an_dma_paddr;
 -            for (i = 0; i < sizeof(an_tx_desc) / 4 ; i++) {
 +            for (i = sizeof(an_tx_desc) / 4 - 1; i >= 0 ; --i) {
                  CSR_MEM_AUX_WRITE_4(sc, AN_TX_DESC_OFFSET
                      /* zero for now */ 
                      + (0 * sizeof(an_tx_desc))
 @@ -2801,7 +2804,7 @@
          CSR_WRITE_2(sc, AN_INT_EN(sc->mpi350), AN_INTRS(sc->mpi350));
      }
  
 -    if (m0 != NULL)
 +    if (!ready)
          ifp->if_drv_flags |= IFF_DRV_OACTIVE;
  
      sc->an_rdata.an_tx_prod = idx;
 
 ----- End forwarded message -----

From: "Jeremy O'Brien" <obrien654j@gmail.com>
To: bug-followup@freebsd.org, djb@gofree.co.uk
Cc:  
Subject: Re: kern/85886: [an] [patch] an0: timeouts with Cisco 350 minipci
Date: Sun, 22 Nov 2009 20:29:42 -0500

 --0016e6d7f07a8db4800478ffc25a
 Content-Type: text/plain; charset=ISO-8859-1
 
 Hoping to see this fix in the kernel, as it works flawlessly for my
 aironet 350 as well, and has been in dragonflybsd's tree for over a
 year without incident. I've attached an updated version of the patch
 that applies to both 8.0-RC3 and 8.0-CURRENT. Can someone please
 commit this?
 
 --0016e6d7f07a8db4800478ffc25a
 Content-Type: application/octet-stream; name="mpi350_fix.diff"
 Content-Disposition: attachment; filename="mpi350_fix.diff"
 Content-Transfer-Encoding: base64
 X-Attachment-Id: f_g2ck6b320
 
 ZGlmZiAtLWdpdCBhL3N5cy9kZXYvYW4vaWZfYW4uYyBiL3N5cy9kZXYvYW4vaWZfYW4uYwppbmRl
 eCA1YjRmMTNiLi5mMDgxMzhkIDEwMDY0NAotLS0gYS9zeXMvZGV2L2FuL2lmX2FuLmMKKysrIGIv
 c3lzL2Rldi9hbi9pZl9hbi5jCkBAIC0yNzQ3LDcgKzI3NDcsNyBAQCBhbl9zdGFydChzdHJ1Y3Qg
 aWZuZXQgKmlmcCkKIAlzdHJ1Y3QgbWJ1ZgkJKm0wID0gTlVMTDsKIAlzdHJ1Y3QgYW5fdHhmcmFt
 ZV84MDJfMwl0eF9mcmFtZV84MDJfMzsKIAlzdHJ1Y3QgZXRo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gwMjExfAlcCi0JQU5fUEFZTE9BRFRZUEVfTExDfEFOX1RY
 Q1RMX05PUkVMRUFTRSkKKyNkZWZpbmUgQU5fVFhDVExfODAyMTEJCShBTl9IRUFERVJUWVBFXzgw
 MjExfEFOX1BBWUxPQURUWVBFX0xMQykKIAotI2RlZmluZSBBTl9UWENUTF84MDIzCVwKLQkoQU5f
 VFhDVExfVFhPS19JTlRSfEFOX1RYQ1RMX1RYRVJSX0lOVFJ8QU5fSEVBREVSVFlQRV84MDIzfAlc
 Ci0JQU5fUEFZTE9BRFRZUEVfRVRIRVJ8QU5fVFhDVExfTk9SRUxFQVNFKQorI2RlZmluZSBBTl9U
 WENUTF84MDIzCQkoQU5fSEVBREVSVFlQRV84MDIzfEFOX1BBWUxPQURUWVBFX0VUSEVSKQorCisv
 KiAKKyAqIEFkZGl0aW9ucyB0byB0cmFuc21pdCBjb250cm9sIGJpdHMgZm9yIE1QSTM1MAorICov
 CisKKyNkZWZpbmUgQU5fVFhDVExfSFcoeCkJCSggeCA/IChBTl9UWENUTF9OT1JFTEVBU0UpIDog
 XAorCShBTl9UWENUTF9UWE9LX0lOVFJ8QU5fVFhDVExfVFhFUlJfSU5UUnxBTl9UWENUTF9OT1JF
 TEVBU0UpKQogCiAjZGVmaW5lIEFOX1RYR0FQXzgwMjExCQkwCiAjZGVmaW5lIEFOX1RYR0FQXzgw
 MjMJCTAK
 --0016e6d7f07a8db4800478ffc25a--
State-Changed-From-To: open->patched 
State-Changed-By: eadler 
State-Changed-When: Tue Nov 15 17:26:11 UTC 2011 
State-Changed-Why:  
committed in r199757 


Responsible-Changed-From-To: freebsd-bugs->jhb 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Tue Nov 15 17:26:11 UTC 2011 
Responsible-Changed-Why:  
committed in r199757 

http://www.freebsd.org/cgi/query-pr.cgi?pr=85886 
State-Changed-From-To: patched->closed 
State-Changed-By: jhb 
State-Changed-When: Mon Mar 4 17:36:29 UTC 2013 
State-Changed-Why:  
Fix merged to 8. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=85886 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/85886: commit references a PR
Date: Mon,  4 Mar 2013 17:35:18 +0000 (UTC)

 Author: jhb
 Date: Mon Mar  4 17:35:10 2013
 New Revision: 247805
 URL: http://svnweb.freebsd.org/changeset/base/247805
 
 Log:
   MFC 199757:
   - For 350 chips, don't set various INTR bits in TX control word; turning INTR
     bits on seems to confuse hardware TX engine.
   - For 350 chips, set TX desc's buffer physical address before turning on the
     TX desc valid bit.
   
   PR:		kern/85886
 
 Modified:
   stable/8/sys/dev/an/if_an.c
   stable/8/sys/dev/an/if_anreg.h
 Directory Properties:
   stable/8/sys/   (props changed)
   stable/8/sys/dev/   (props changed)
   stable/8/sys/dev/an/   (props changed)
 
 Modified: stable/8/sys/dev/an/if_an.c
 ==============================================================================
 --- stable/8/sys/dev/an/if_an.c	Mon Mar  4 16:55:16 2013	(r247804)
 +++ stable/8/sys/dev/an/if_an.c	Mon Mar  4 17:35:10 2013	(r247805)
 @@ -2803,7 +2803,7 @@ an_start(struct ifnet *ifp)
  				   tx_frame_802_3.an_tx_802_3_payload_len,
  				   (caddr_t)&sc->an_txbuf);
  
 -			txcontrol = AN_TXCTL_8023;
 +			txcontrol = AN_TXCTL_8023 | AN_TXCTL_HW(sc->mpi350);
  			/* write the txcontrol only */
  			an_write_data(sc, id, 0x08, (caddr_t)&txcontrol,
  				      sizeof(txcontrol));
 @@ -2866,7 +2866,7 @@ an_start(struct ifnet *ifp)
  				   tx_frame_802_3.an_tx_802_3_payload_len,
  				   (caddr_t)&sc->an_txbuf);
  
 -			txcontrol = AN_TXCTL_8023;
 +			txcontrol = AN_TXCTL_8023 | AN_TXCTL_HW(sc->mpi350);
  			/* write the txcontrol only */
  			bcopy((caddr_t)&txcontrol, &buf[0x08],
  			      sizeof(txcontrol));
 @@ -2888,7 +2888,7 @@ an_start(struct ifnet *ifp)
  			    tx_frame_802_3.an_tx_802_3_payload_len;
  			an_tx_desc.an_phys
  			    = sc->an_tx_buffer[idx].an_dma_paddr;
 -			for (i = 0; i < sizeof(an_tx_desc) / 4 ; i++) {
 +			for (i = sizeof(an_tx_desc) / 4 - 1; i >= 0; i--) {
  				CSR_MEM_AUX_WRITE_4(sc, AN_TX_DESC_OFFSET
  				    /* zero for now */
  				    + (0 * sizeof(an_tx_desc))
 
 Modified: stable/8/sys/dev/an/if_anreg.h
 ==============================================================================
 --- stable/8/sys/dev/an/if_anreg.h	Mon Mar  4 16:55:16 2013	(r247804)
 +++ stable/8/sys/dev/an/if_anreg.h	Mon Mar  4 17:35:10 2013	(r247805)
 @@ -394,13 +394,18 @@ struct an_txframe_802_3 {
  #define AN_PAYLOADTYPE_ETHER	0x0000
  #define AN_PAYLOADTYPE_LLC	0x0010
  
 -#define AN_TXCTL_80211	\
 -	(AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_HEADERTYPE_80211|	\
 -	AN_PAYLOADTYPE_LLC|AN_TXCTL_NORELEASE)
 -
 -#define AN_TXCTL_8023	\
 -	(AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_HEADERTYPE_8023|	\
 -	AN_PAYLOADTYPE_ETHER|AN_TXCTL_NORELEASE)
 +#define AN_TXCTL_80211		(AN_HEADERTYPE_80211|AN_PAYLOADTYPE_LLC)
 +
 +#define AN_TXCTL_8023		(AN_HEADERTYPE_8023|AN_PAYLOADTYPE_ETHER)
 +
 +/*
 + * Additions to transmit control bits for MPI350
 + */
 +#define	AN_TXCTL_HW(x)	\
 +	( x ? (AN_TXCTL_NORELEASE) \
 +	  : \
 +	      (AN_TXCTL_TXOK_INTR|AN_TXCTL_TXERR_INTR|AN_TXCTL_NORELEASE) \
 +	      )
  
  #define AN_TXGAP_80211		0
  #define AN_TXGAP_8023		0
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
