From owner-freebsd-current Thu May 1 21:12:31 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id VAA10292 for current-outgoing; Thu, 1 May 1997 21:12:31 -0700 (PDT) Received: from pluto.plutotech.com (root@pluto100.plutotech.com [206.168.67.137]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id VAA10276 for ; Thu, 1 May 1997 21:12:28 -0700 (PDT) Received: from narnia.plutotech.com (narnia.plutotech.com [206.168.67.130]) by pluto.plutotech.com (8.8.5/8.8.3) with ESMTP id WAA29396; Thu, 1 May 1997 22:12:25 -0600 (MDT) Message-Id: <199705020412.WAA29396@pluto.plutotech.com> To: Richard Straka cc: "Justin T. Gibbs" , current@freebsd.org Subject: Re: ie driver fixes for EtherExpress 16 In-reply-to: Your message of "Thu, 01 May 1997 20:12:24 PDT." Date: Thu, 01 May 1997 23:11:02 -0600 From: "Justin T. Gibbs" Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > >The following is a patch for if_ie.c which can be applied >to the 2.2-970422-RELENG kernel to make it work with the >EtherExpress 16 ethernet adapter. The patch does the >following. > >1. Change the number of frame desciptors NFRAMES from 16 >to 8. This is consistent with the number of ether frame >buffers NRXBUF (48) allocated. This solves the "descriptors >out of sync" error while receiving. The driver should really be changed so that this can be configured dynamically at probe time. This would allow you to take full advantage of the memory on the card. This becomes important if you have multiple interfaces or the box is busy. >2. Commented out the at_shutdown call. This seems to be >unnecessary. I have repeatedly rebooted between FreeBSD and >DOS/Packet Driver and have not noticed any problems with >the card settings. This solves the hang/panic at shutdown. You can't boot Win95 after using FreeBSD without the shutdown hook. The original contributor of that code hasn't been able to reproduce this panic, so it would be nice if you could put DDB in your kernel and determine what the cause is so that the shutdown hook can remain but doesn't panic the system. >3. Moved the interrupt acknowledge call to the top of the >"event loop" in ieintr. This allows events to be recognized >while current events are being processed. This solves the >transmit problems. This seems to be correct according to the ix driver. I wish I had documentation on this though. >4. Changed the initialization of the transmit buffers. Was >hard coded for 2 buffers. Changed to initialize NTXBUF buffers. >This would only be a problem if one wanted to increase NTXBUF >from its current value of 2. Watch your white space. You should be using tabs where appropriate instead of spaces. Take a look at the style.9 man page for details. (Not that much of if_ie.c conforms to style.9, but it is a good habit to get into). >5. Moved the block of code which take the adapter out of "loop >back" mode to the very end of ieinit. This seems cleaner and >may eliminate inadvertant packets sent during initialization. >+ >+ /* take the ee16 out of loopback */ >+ { >+ u_char bart_config; >+ >+ if(ie->hard_type == IE_EE16) { >+ bart_config = inb(PORT + IEE16_CONFIG); >+ bart_config &= ~IEE16_BART_LOOPBACK; This would look better as: /* take the ee16 out of loopback */ if (ie->hard_type == IE_EE16) { u_char bart_config; bart_config = inb(PORT + IEE16_CONFIG); bart_config &= ~IEE16_BART_LOOPBACK; ... } It seems strange to me to first start the receiver then take the card out of loopback mode instead of the other way around. -- Justin T. Gibbs =========================================== FreeBSD: Turning PCs into workstations ===========================================