* increase maximum time to wait for transmit DMA to complete to 120us.
* call ed_reset() if the time limit is reached instead of trying
* to abort the remote DMA.
*
* Revision 2.7 1993/10/15 10:49:10 davidg
* minor change to way the mbuf pointer temp variable is assigned in
* ed_start (slightly improves code readability)
*
* Revision 2.6 93/10/02 01:12:20 davidg
* use ETHER_ADDR_LEN in NE probe rather than '6'.
> code. As this memcpy generation is done by the compiler it doesn't
> work to have memcpy a macro. Instead I made it a static function that
> calls bcopy.
Okay, I tracked down the d*mn thing that is causing the memcpy to be
emmitted by gcc2. In the following patch is a fix to eliminate the
one place that was causing gcc to do the memcpy in function ie_readframe
for the ie_recv_frame_desc rfd = *(ie->rframes[num]) structure copy.
I also fixed the code so that the NS (XNS) support would compile with
out error and removed the cruft #define ns_* stuff from the softc
structures (I did this a while back for all the other either drivers)
Removed the $Log$ and all of the old log stuff, that is all kept in
the cvs tree, no need to duplicate it in the file... I'll copy it
into my commit message so that it is all retained, except the
revision numbers are going to get screwed up.
It now compiles cleanly under my LINT kernel...
> I have not yet tested this on the AT&T fiver cards yet. But, Wollman
> has used it on various other AT&T cards. I'm pretty sure Terry also
> uses this driver.
$Log$ stuff from Garretts original file
* $Log$
* Revision 1.32 1993/06/20 15:56:15 wollman
* Fixed warning message.
*
* Revision 1.31 93/06/20 15:52:28 wollman
* More compilation lint.
*
* Revision 1.30 93/06/20 15:48:16 wollman
* Commented all the rest of the cast-qual warnings. Might be
* fixed someday by changing the prototypes of bcopy(), bzero(), etc.
*
* Revision 1.29 93/06/20 15:40:13 wollman
* Started fixing some of the cast-qual warnings (most just commented).
*
* Revision 1.28 93/06/12 20:39:14 wollman
* Changed definition of MK_24 to silence -Wcast-qual.
*
* Revision 1.27 93/06/08 17:05:57 wollman
* Attach routine now returns void.
*
* Revision 1.26 93/06/08 16:31:21 wollman
* Deleted attempt to set watchdog timer, since we don't use it.
*
* Revision 1.25 93/04/16 22:15:31 wollman
* Fixed infinite loop in iestart() which would cause the transmitter
* to constantly step on the Ethernet, sending the same two packets over
* and over again. This crashes the router (really!) and makes other
* network users very angry.
*
* Revision 1.24 93/04/14 23:57:47 wollman
* Increased transmit buffer size from 1504 to 1512, just in case I don't
* understand how the MTU is used.
*
* Revision 1.23 93/04/14 23:16:19 wollman
* Fix iestart() so that it only tries to execute a command if one was
* queued up (oops...).
*
* Revision 1.22 93/04/14 23:02:16 wollman
* Unknown changes.
*
* Revision 1.21 93/04/12 18:29:33 wollman
* Added multiple transmit commands. Note that they are always queued in
* pairs (there are only two to begin with), and the I flag is only set
* on the second one. This should decrease interrupt activity somewhat.
*
* Revision 1.20 93/04/12 15:36:05 wollman
* Changed setup of config block to take into account difference between
* StarLAN (10BASE-T) and Ethernet: StarLAN is Manchester, Ethernet is NRZ.
*
* Revision 1.19 93/03/23 18:58:44 wollman
* Raised count of receive buffers from 32 to 48 and included analysis of
* memory usage in a comment near that definition.
*
* Revision 1.18 93/03/18 03:59:53 wollman
* Last try to get large TCP windows to work...
*
* Revision 1.17 93/03/18 03:54:10 wollman
* Added RNR processing as a part of receive interrupts. Hopefully this
* will make everything Just Work now.
*
* Revision 1.16 93/03/18 03:23:24 wollman
* Still having problems with RNR conditions. Basic problem: say we
* set TCP window to 16k, which is a semsible value. Then smart
* partners will blast 16k to us, of which we can fit 8k minus a bit
* into our buffers. (Need to look at that memory map..) So, we get
* an RNR interrupt. The problem is, what do we need to do in this case?
* The original code doesn't work, but it doesn't hang the system either.
*
* Revision 1.15 93/03/18 02:37:00 wollman
* Disabled watchdog timer. This gets called from a timeout somewhere,
* which is running up at softclock. This is at a higher priority than
* we are, so we can get interrupted in the process of receiving something
* by the timer expiration, which is not a nice thing to have happen.
* Question: how can we keep this functionality, but do it in sync with
* our interrupts? (Ugh!)
*
* Revision 1.14 93/03/18 02:35:46 wollman
* Fixed some more problems with receive code---it works!
*
* Revision 1.13 93/03/17 20:15:59 wollman
* Think we fixed the serious (showstopper) bugs in 1.12.
*
* Revision 1.12 93/03/15 17:45:39 wollman
* Changed filtering logic dramatically to avoid the unnecessary copyin
* for BPF or multicast routing when the packet is not for us. (We
* have to run in promiscuous mode in this case.) We still need to
* deal with the problem of allocating one mbuf per receive buffer;
* we should be able to get away with a single mbuf for all reasonable
* incoming packets, and using an mbuf cluster will help avoid unnecessary
* copying of data.
*
* Revision 1.11 93/01/30 20:23:15 wollman
* Fiddled with reset code to hopefully make it work better when the
* watchdog timer expires. Question: why does it make a difference that
* we do the same thing through ieioctl() as we were doing before. The
* old code, when iereset() was called, the receive unit would completely
* die. But, a cycle of ifconfig ie0 down ; ifconfig ie0 up' would bring
* things back to normal. So, we try to mimic that now. Grrr...
*
* Revision 1.10 93/01/29 17:26:50 wollman
* Finally fixed multicast routing/BPF mb_map full problem!!!!
* It turned out that, when we received a packet not for us, we
* would just return from ie_readframe(), *WITHOUT* freeing the
* mbuf that the packet was in. So, when running in promiscuous
* mode (i.e., multicast routing or BPF without -p), we would have
* (on our extremely busy subnet 4) a memory leak of epic proportions.
*
* We now hold on to a single mbuf chain allocated in this way,
* and the next time a packet is read, we free it. Also, the
* next time a packet is transmitted, we free it. This way,
* we never lose more than 6 mbufs total (and on average more like
* 3).
*
* Revision 1.9 93/01/23 14:22:21 wollman
* Added some StarLAN Fiber modifications from L. Jonas Olsson.
*
* Revision 1.8 93/01/23 14:02:34 wollman
* Added support for IP multicasting.
*
* Revision 1.7 92/11/21 17:51:59 wollman
* Added StarLAN Fiber version point to my driver.
*
* Revision 1.6 92/11/20 18:21:45 wollman
* Fixed documentation, made out-of-mbuf condition an error.
*
* Revision 1.5 92/11/20 18:14:02 wollman
* Move change of ethertype to host byte order so that it's after
* bpf_mtap. Hopefully, this will allow us to listen to incoming
* IP packets.
*
* Revision 1.4 92/11/20 18:11:00 wollman
* Added code to drop packets when we run out of mbufs rather than
* panicking. This should alleviate the problems observed when using tcpdump.
*
* Revision 1.3 92/11/14 14:12:40 wollman
* Added BPF support code.
*
* Revision 1.2 92/11/14 13:30:26 wollman
* Added RCS keywords
*
* patch from vak@zebub.msk.su (Serge V.Vakulenko) to work around
* a hardware bug in cheap WD clone boards where the PROM checksum
* byte is always zero
* Added software NIC reset in NE probe to work around a problem
* with some NE boards where the 8390 doesn't reset properly on
* power-up. Remove initialization of IMR/ISR in the NE probe
* because this is inherent in the reset.
* added no multi-buffer override for 3c503
*
* Revision 2.1 93/09/29 12:32:12 davidg
* changed multi-buffer count for 16bit 3c503's from 5 to 2 after
* noticing that the transmitter becomes idle because of so many
* packets to load.
*
* Revision 2.0 93/09/29 00:00:19 davidg
* many changes, rewrites, additions, etc. Now supports the
* NE1000, NE2000, WD8003, WD8013, 3C503, 16bit 3C503, and
* a variety of similar clones. 16bit 3c503 now does multi
* transmit buffers. Nearly every part of the driver has
* changed in some way since rev 1.30.
Date: Thu, 16 Sep 93 01:35:10 +1000
Julian writes:
>In fact DEVIDLE and FINDWORK ended up being basically equivalent.
>the bit I wonder about, is the returning of 0.. What (other than
>another request from somewhere else in the kernel) is going to start
>work on the next item on the queue?
I think removing FINDWORK would make things clearer.
Nothing much is going to start work on the next item. However, it is
pointless to continue processing the queue for the same unready drive.
Aborting all reads and trying harder to perform all writes would be
better.
Julian writes.
> no, actually it should be:
> fdt = fd_data[FDUNIT(minor(dev))].ft;
Fixed.
From: bde@kralizec.zeta.org.au (Bruce Evans)
Date: Thu, 16 Sep 93 22:56:01 +1000
The fd driver reported the wrong cylinder/head/sector numbers after an
error (ST3 is only valid after a sense-drive command), and didn't report
fs block numbers (diskerr was not used).
There was an old problem with writes to block fd devices. Try this:
1. write protect floppy in fd0.
2. tar cf /dev/fd0a /dev/null. Repeat a few times. Later writes tend to
terminate earlier.
3. un-write protect floppy.
4. repeat step 2. The writes tend to return 0, 2048, 4096, ... and then
succeed.
This was caused by a bug in vfs__bios.c. (The bug is fixed in NetBSD's
vfs_bio.c.) fd.c sets bp->b_resid to nonzero after an error. vfs__bios.c
was not initializing bp->b_resid. This causes some writes to terminate
early (e.g., writes to block devices; see spec_write()).
Related funnies:
1. Nothing tries to write the residual bytes.
2. The wd driver sets bp->b_resid to 0 after an error, so there's no
way anything else could write the residual bytes.
3. I use the block fd device for tar because the raw device seemed to
have more bugs long ago, and because it ought to be able to handle
buffering more transparently (I don't want to have to know the
device size). But spec_write() always uses the size BLKDEV_IOSIZE
== 2048 which is too small. For disks it should use the size of
one track (rounded down to meet the next track boundary or the i/o
size). Here it would help if the DIOCGPART ioctl worked. But
DIOCGPART is not implemented for floppies, and the disk size is
ignored except for partitions of type FS_BSDFFS.
Bruce
message for Bruces changes:
>From: bde@kralizec.zeta.org.au (Bruce Evans)
>Subject: fixes for fd driver
I think I've fixed some bugs in the 0.2.4 fd driver.
1. The main cause of hangs was that there was no timeout for seeks. So
attempting i/o with no floppy in the drive hung iff a seek was required.
2. Opens of unattached drives were allowed. The kernel usually paniced
soon after due to a bad pointer.
3. Some timeout functions ran at splclock() instead of splbio(). This
may not have mattered.
4. The state machine was left in a funny state after a timeout.
5. Some function headers were new-style.
6. I picked up some code posted the other day to implement label ioctls.
Now `disklabel fd0' works. See a comment for how to modify conf.c.
>Subject: Bad bug in kbdtables.h [FreeBSD]
I found a bug in /sys/i386/isa/kbdtables.h which contain the
different keyboard layouts for syscons. This regards all tables exept
the Danish and US. When compiling the kernel with any other keymapping
than Danish or none at all (US), you get an error that 'key_map' is undefined.
This is because there is a typo in the name of the struct containing
the tables, keymap intead of key_map.
That is because TIOCMGET was broken. Yes...this is known for some time
and no, we (Bruce and me) never posted it. Why? Simply because we choose
to post fixes when we fixed most of the bugs.
Anyway..now that the slip problems are coming, here is a fix for
correct TIOCMGET behaviour.
-Guido
Note: this should be tested first (Rich?). Tested by rgrimes
1) fixed 3c503 lock-up if the thinwire cable was disconnected at boot time
2) 8013EBT boards now work (quite well!) in 16bit/16k mode
3) ED_NO_DOUBLE_BUFFERING flag now works
4) slightly higer performance (about 3%) with 16bit WD/SMC boards
5) support for WD8013WC (10BaseT) boards
Additionally, the probe code has been reorganized to be much cleaner. This
revision of the driver is 1.25. The release notes have been updated as well.
Subject: Re: Some small errors in GAMMA
4. Move printf("\n"); at line 491 in "/sys/i386/isa/sio.c" to after
COM_MULTIPORT block at line 512.
From rgrimes:
The above would cause the word (multiport) with out a new line to
appear after the uart type message if you had COM_MULTIPORT enabled.
reinitialized between while loops. Added comments about what was going
on in the out_fdc routine.
out_fdc now returns if the direction bit is not set in time instead of
trying to wait for MRQ to get cleared.
profiling, and various protection checks that cause security holes
and system crashes.
* Changed min/max/bcmp/ffs/strlen to be static inline functions
- included from cpufunc.h in via systm.h. This change
improves performance in many parts of the kernel - up to 5% in the
networking layer alone. Note that this requires systm.h to be included
in any file that uses these functions otherwise it won't be able to
find them during the load.
* Fixed incorrect call to splx() in if_is.c
* Fixed bogus variable assignment to splx() in if_ed.c
* them in cpufunc.h. Modified wait loop in reset to look a little better.
* Added read for talley counters to prevent an infinite loop on old
* 8003E's if they (the counters) overflow.
asic register even if the board isn't a 3c503. This caused old 8003E's not
to work because they ignore IO address bits >10bits and the 3c503 asic is
located at +0x400....the offset was ignored by the 8003E and so the
value was written to one of the NIC registers. The bug was discovered by
Wolfgang Solfrank.
8bit or 16bit operation, and a flag to disable transmitter double buffering.
See the updated "ed.relnotes" file for information about how to set
the flags.
This should be considered the first "production" release. It still
needs a manual page, though.
way of doing things. There still remain several drivers that need to
be updated. Also added a compile-time option to pccons to switch the
control and caps-lock keys (REVERSE_CAPS_CTRL) - added for my personal
sanity.