From owner-freebsd-bugs@FreeBSD.ORG Tue Jan 2 11:40:22 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0F6B316A403 for ; Tue, 2 Jan 2007 11:40:22 +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 F218E13C45A for ; Tue, 2 Jan 2007 11:40:21 +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 l02BeL7L098768 for ; Tue, 2 Jan 2007 11:40:21 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l02BeLvK098765; Tue, 2 Jan 2007 11:40:21 GMT (envelope-from gnats) Date: Tue, 2 Jan 2007 11:40:21 GMT Message-Id: <200701021140.l02BeLvK098765@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Jason Young Cc: Subject: Re: kern/85886: [an] an0: timeouts with Cisco 350 minipci X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jason Young List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jan 2007 11:40:22 -0000 The following reply was made to PR kern/85886; it has been noted by GNATS. From: Jason Young 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 */