From owner-freebsd-drivers@FreeBSD.ORG Fri Apr 18 03:18:42 2008 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC2BD106564A for ; Fri, 18 Apr 2008 03:18:42 +0000 (UTC) (envelope-from sogabe@iij.ad.jp) Received: from otm-mgo00.iij.ad.jp (otm-mgo00.iij.ad.jp [210.138.20.174]) by mx1.freebsd.org (Postfix) with ESMTP id 4AD1C8FC1B for ; Fri, 18 Apr 2008 03:18:42 +0000 (UTC) (envelope-from sogabe@iij.ad.jp) DKIM-Signature: v=1;a=rsa-sha256;c=relaxed/simple;d=iij.ad.jp;h=Message-ID: Date:From:MIME-Version:To:Subject:References:In-Reply-To:Content-Type: Content-Transfer-Encoding;i=sogabe@iij.ad.jp;s=omgo0;t=1208488721;x= 1209698321; bh=mVUF0L19zFR5cOgA/dmccw8HTizvtwd0TVvlHHF8Z1o=; b=Jk1wu0D6DOcTV6GV SgkGyU/1+/n50o/tkXRkkXm8jQVv8ihH70CjiyATKfzd8ir4ECj9ZMV6gcHdX2zFo+JGqGNsK1XYd opNRIipsre6YSOv6XJ84NUUqH9uUsoHLMyfrPMQY9iBGqiveiNhH8u+oZeSPTCzftZB7gTogJBjnM c=; Received: OTM-MO(otm-mgo00) id m3I3IfX5078054; Fri, 18 Apr 2008 12:18:41 +0900 (JST) Received: OTM-MIX(otm-mix01) id m3I3IeQD075295; Fri, 18 Apr 2008 12:18:40 +0900 (JST) Received: from [192.168.184.115] ([192.168.184.115]) by rsmtp.iij.ad.jp (OTM-MR/rsmtp01) id m3I3Ie9J073138 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 18 Apr 2008 12:18:40 +0900 (JST) Message-ID: <4808138D.2040408@iij.ad.jp> Date: Fri, 18 Apr 2008 12:20:45 +0900 From: Sogabe Takashi User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: freebsd-drivers@freebsd.org References: <4805BBA7.60806@iij.ad.jp> <20080416163938.GM95731@elvis.mu.org> <20080416.132024.1649777798.imp@bsdimp.com> In-Reply-To: <20080416.132024.1649777798.imp@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: question: workaround for AX88190 (dev/ed/if_ed.c) 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: Fri, 18 Apr 2008 03:18:42 -0000 I see buggy cards must be around here.. I think any other AX series(ax88796, etc.) may have similler bugs, but I don't know how to confirm them. Thanks, -- sogabe@iij.ad.jp > In message: <20080416163938.GM95731@elvis.mu.org> > Alfred Perlstein writes: > : I think the driver developer found the card buggy and wanted > : to give it a longer try to clear the status bits, but if it > : just flat out refuses to clear status, then it just aborts. > > Some versions of silicon seem to be better than others at this as > well. Some cards need it, but most don't. > > Warner > > > : * Sogabe Takashi [080416 02:00] wrote: > : > Hi all, > : > > : > Does anyone know what kind of problems about following > : > workaround-code? > : > > : > I read asix datasheets, but corresponding problem is not > : > described. > : > > : > (in sys/dev/ed/if_ed.c) > : > /* > : > * Ethernet interface interrupt processor > : > */ > : > void > : > edintr(void *arg) > : > { > : > ... > : > /* > : > * XXX workaround for AX88190 > : > * We limit this to 5000 iterations. At 1us per inb/outb, > : > * this translates to about 15ms, which should be plenty > : > * of time, and also gives protection in the card eject > : > * case. > : > */ > : > if (sc->chip_type == ED_CHIP_TYPE_AX88190) { > : > count = 5000; /* 15ms */ > : > while (count-- && (ed_nic_inb(sc, ED_P0_ISR) & isr)) { > : > ed_nic_outb(sc, ED_P0_ISR,0); > : > ed_nic_outb(sc, ED_P0_ISR,isr); > : > } > : > if (count == 0) > : > break; > : > } > : > ... > : > } > : > > : > -- > : > sogabe@iij.ad.jp