From owner-freebsd-bugs@FreeBSD.ORG Fri Mar 27 19:16:37 2009 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41927106580F for ; Fri, 27 Mar 2009 19:16:37 +0000 (UTC) (envelope-from max_belov@yahoo.com) Received: from n64.bullet.mail.sp1.yahoo.com (n64.bullet.mail.sp1.yahoo.com [98.136.44.189]) by mx1.freebsd.org (Postfix) with SMTP id 1F0688FC13 for ; Fri, 27 Mar 2009 19:16:37 +0000 (UTC) (envelope-from max_belov@yahoo.com) Received: from [216.252.122.216] by n64.bullet.mail.sp1.yahoo.com with NNFMP; 27 Mar 2009 19:03:40 -0000 Received: from [69.147.65.167] by t1.bullet.sp1.yahoo.com with NNFMP; 27 Mar 2009 19:03:40 -0000 Received: from [127.0.0.1] by omp502.mail.sp1.yahoo.com with NNFMP; 27 Mar 2009 19:03:40 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 515722.39614.bm@omp502.mail.sp1.yahoo.com Received: (qmail 18497 invoked by uid 60001); 27 Mar 2009 19:03:40 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1238180620; bh=CW7tBgStU+IHAMqWixT3ffyGh+fH1VVGEBsPU9Xf6jE=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=OuYoGcO31UhohtXowWznSGRs6dBeX/oRYg3HQ4te/17Q6/wMLwJlrOF9XRWFBC2pZw8pxs23+NsCRC1FFZLA2vZzuaQS30xRDkpUUyWRuz/ybcqYbMDuoaE0SZ2EHo9GoaCwLQnPyK4Ly6rKb/F2Ze+aGyHeYmKncqz0jWdvbE4= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=FcP09m+euwCgcxHNnbCqFgzYTeBwwu6vRyXTLDsX7LhQEq0al5iVQ+t/c687t1q1OHdvW4yAmAtWiZAsJuxuLWGB14VFpwWVvLXJ6S4dtL39c4dVOWrpNT9roqykvnYeeOV/OCiCsn1o7Ct9p5ucPzC/85m32Ofaja3YqOsRQr0=; Message-ID: <229230.18285.qm@web45110.mail.sp1.yahoo.com> X-YMail-OSG: JSUA8T4VM1lRhr0sF2okUyD08ix9boq9nPV67q_T.U2qOjS0soeUzA8grifjH6yMvbRhI7epa.oTDzOK2t8LpZJ_4HVxtoW4lnqrsd7EHxO70Tf7zgFYommBlE8yeGwAJLkEj2oB68dzoQb4DorvvTUrk42eLh1KdKIVYRqtf5YVH00mM0HlV__C2gvJnFf8Qto- Received: from [91.104.174.57] by web45110.mail.sp1.yahoo.com via HTTP; Fri, 27 Mar 2009 12:03:39 PDT X-Mailer: YahooMailRC/1277.32 YahooMailWebService/0.7.289.1 Date: Fri, 27 Mar 2009 12:03:39 -0700 (PDT) From: Max Belov To: freebsd-bugs@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Question about kern/85886: [an] an0: timeouts with Cisco 350 minipci X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Mar 2009 19:16:38 -0000 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 Free BSD 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;