change all of these to be timeout_funt_t and remove the casts and
typedef?
Remove secound argument (uban) from ifp->if_reset routines since it is now
obsolete.
Reviewed by: David Greenman
1) check va before clearing the page clean flag. Not doing so was
causing the vnode pager error 5 messages when paging from
NFS. (pmap.c)
2) put back interrupt protection in idle_loop. Bruce didn't think
it was necessary, John insists that it is (and I agree). (swtch.s)
3) various improvements to the clustering code (vm_machdep.c). It's
now enabled/used by default.
4) bad disk blocks are now handled properly when doing clustered IOs.
(wd.c, vm_machdep.c)
5) bogus bad block handling fixed in wd.c.
6) algorithm improvements to the pageout/pagescan daemons. It's amazing
how well 4MB machines work now.
finally have the f**king documentation!):
1) Changed all the numeric register offsets to symbolic ones (it should
have been this way originally).
2) If 16 bit, disable the shared memory when not using it. Apparantly
switching between 8/16bit mode makes the Ultra unhappy unless
this is done (i.e. it trashes the bus).
- ansi prototypes in lpt.c
- a bit of tidying in lpt.c
- ioctl in lpt.c for switching between polling and using interrupts
- added lpt.h - needed for ioctl to allow switching between polling
and interrupt-driven modes.
---
This list of changes is in approximately chronological order (oldest first).
o Many cosmetic changes - renamed comintr1 -> siointr1, moved
things around and fixed whitespace.
o Reduced SLIP latency (FRAME_END hack) from 20-30 ms to 16 ms
at 115200 bps (you won't notice the average 10 ms improvement
on slow lines). ppp seems to use only counted transfers so
there's no similar hack available. It's too hard for the
driver to know the count.
o Temporary #ifdefs for new and old interrupt handling
(OLD_INTERRUPT_HANDLING decided by setsofttty() not being
externally defined.
o Don't test for the IIR_NOPEND bit being set - test for the
non-fifo part of the iir equalling it like the docs say to.
States with other IIR_NOPEND set in combination with the
other iir bits are undefined. The docs may be stupid - the
old test would not have broken when the fifo bits were
introduced.
o Noted more problems with DTR wait.
o Rewrote console stuff. Still some initialization and state
preservation problems. Same for kgdb stuff. The driver
doesn't do anything about the console close bug. It needs
to be fixed entirely in i386/cons.c. I like chmr's version
where the the console driver revectors the device open and
close routines.
o Temporary (?) #ifdefs for references to tty buffers.
o Noted further things to do in (2 comments about 3 places) for
phk's change to not touch RTS unless it is being used for flow
control.
o Temporary #ifdefs for timestamp handling. It needs fixing.
The microtime() call breaks the first rule of writing fast
interrupt handlers: NO calls to functions that might do slow
and bad things. microtime() enables interrupts. This turns
out to be only moderately harmful. Also, I want the timestamp
copy outside of the normal interrupt handler.
o Don't init com->tp early for the !DONT_MALLOC_TTYS case -
both sides are NULL.
o Worry about com->tp == NULL in siopoll. I don't see how you
survived the (incc <= 0 || !(tp->state & TS_ISOPEN)) test.
Perhaps early sttys or comcontrols set up the tp's for _all_
the ports before this code is reached.
list of changes, I've made the following additional changes:
1) i386/include/ipl.h renamed to spl.h as the name conflicts with the
file of the same name in i386/isa/ipl.h.
2) changed all use of *mask (i.e. netmask, biomask, ttymask, etc) to
*_imask (net_imask, etc).
3) changed vestige of splnet use in if_is to splimp.
4) got rid of "impmask" completely (Bruce had gotten rid of netmask),
and are now using net_imask instead.
5) dozens of minor cruft to glue in Bruce's changes.
These require changes I made to config(8) as well, and thus it must
be rebuilt.
-DG
from Bruce Evans:
sio:
o No diff is supplied. Remove the define of setsofttty(). I hope
that is enough.
*.s:
o i386/isa/debug.h no longer exists. The event counters became too
much trouble to maintain. All function call entry and exception
entry counters can be recovered by using profiling kernel (the new
profiling supports all entry points; however, it is too slow to
leave enabled all the time; it also). Only BDBTRAP() from debug.h
is now used. That is moved to exception.s. It might be worth
preserving SHOW_BITS() and calling it from _mcount() (if enabled).
o T_ASTFLT is now only set just before calling trap().
o All exception handlers set SWI_AST_MASK in cpl as soon as possible
after entry and arrange for _doreti to restore it atomically with
exiting. It is not possible to set it atomically with entering
the kernel, so it must be checked against the user mode bits in
the trap frame before committing to using it. There is no place
to store the old value of cpl for syscalls or traps, so there are
some complications restoring it.
Profiling stuff (mostly in *.s):
o Changes to kern/subr_mcount.c, gcc and gprof are not supplied yet.
o All interesting labels `foo' are renamed `_foo' and all
uninteresting labels `_bar' are renamed `bar'. A small change
to gprof allows ignoring labels not starting with underscores.
o MCOUNT_LABEL() is to provide names for counters for times spent
in exception handlers.
o FAKE_MCOUNT() is a version of MCOUNT() suitable for exception
handlers. Its arg is the pc where the exception occurred. The
new mcount() pretends that this was a call from that pc to a
suitable MCOUNT_LABEL().
o MEXITCOUNT is to turn off any timer started by MCOUNT().
/usr/src/sys/i386/i386/exception.s:
o The non-BDB BPTTRAP() macros were doing a sti even when interrupts
were disabled when the trap occurred. The sti (fixed) sti is
actually a no-op unless you have my changes to machdep.c that make
the debugger trap gates interrupt gates, but fixing that would
make the ifdefs messier. ddb seems to be unharmed by both
interrupts always disabled and always enabled (I had the branch in
the fix back to front for some time :-().
o There is no known pushal bug.
o tf_err can be left as garbage for syscalls.
/usr/src/sys/i386/i386/locore.s:
o Fix and update BDE_DEBUGGER support.
o ENTRY(btext) before initialization was dangerous.
o Warm boot shot was longer than intended.
/usr/src/sys/i386/i386/machdep.c:
o DON'T APPLY ALL OF THIS DIFF. It's what I'm using, but may require
other changes.
Use the following:
o Remove aston() and setsoftclock().
Maybe use the following:
o No netisr.h.
o Spelling fix.
o Delay to read the Rebooting message.
o Fix for vm system unmapping a reduced area of memory
after bounds_check_with_label() reduces the size of
a physical i/o for a partition boundary. A similar
fix is required in kern_physio.c.
o Correct use of __CONCAT. It never worked here for non-
ANSI cpp's. Is it time to drop support for non-ANSI?
o gdt_segs init. 0xffffffffUL is bogus because ssd_limit
is not 32 bits. The replacement may have the same
value :-), but is more natural.
o physmem was one page too low. Confusing variable names.
Don't use the following:
o Better numbers of buffers. Each 8K page requires up to
16 buffer headers. On my system, this results in 5576
buffers containing [up to] 2854912 bytes of memory.
The usual allocation of about 384 buffers only holds
192K of disk if you use it on an fs with a block size
of 512.
o gdt changes for bdb.
o *TGT -> *IDT changes for bdb.
o #ifdefed changes for bdb.
/usr/src/sys/i386/i386/microtime.s:
o Use the correct asm macros. I think asm.h was copied from Mach
just for microtime and isn't used now. It certainly doesn't
belong in <sys>. Various macros are also duplicated in
sys/i386/boot.h and libc/i386/*.h.
o Don't switch to and from the IRR; it is guaranteed to be selected
(default after ICU init and explicitly selected in isa.c too, and
never changed until the old microtime clobbered it).
/usr/src/sys/i386/i386/support.s:
o Non-essential changes (none related to spls or profiling).
o Removed slow loads of %gs again. The LDT support may require
not relying on %gs, but loading it is not the way to fix it!
Some places (copyin ...) forgot to load it. Loading it clobbers
the user %gs. trap() still loads it after certain types of
faults so that fuword() etc can rely on it without loading it
explicitly. Exception handlers don't restore it. If we want
to preserve the user %gs, then the fastest method is to not
touch it except for context switches. Comparing with
VM_MAXUSER_ADDRESS and branching takes only 2 or 4 cycles on
a 486, while loading %gs takes 9 cycles and using it takes
another.
o Fixed a signed branch to unsigned.
/usr/src/sys/i386/i386/swtch.s:
o Move spl0() outside of idle loop.
o Remove cli/sti from idle loop. sw1 does a cli, and in the
unlikely event of an interrupt occurring and whichqs becoming
zero, sw1 will just jump back to _idle.
o There's no spl0() function in asm any more, so use splz().
o swtch() doesn't need to be superaligned, at least with the
new mcounting.
o Fixed a signed branch to unsigned.
o Removed astoff().
/usr/src/sys/i386/i386/trap.c:
o The decentralized extern decls were inconsistent, of course.
o Fixed typo MATH_EMULTATE in comments. */
o Removed unused variables.
o Old netmask is now impmask; print it instead. Perhaps we
should print some of the new masks.
o BTW, trap() should not print anything for normal debugger
traps.
/usr/src/sys/i386/include/asmacros.h:
o DON'T APPLY ALL OF THIS DIFF. Just use some of the null macros
as necessary.
/usr/src/sys/i386/include/cpu.h:
o CLKF_BASEPRI() changes since cpl == SWI_AST_MASK is now normal
while the kernel is running.
o Don't use var++ to set boolean variables. It fails after a mere
4G times :-) and is slower than storing a constant on [3-4]86s.
/usr/src/sys/i386/include/cpufunc.h:
o DON'T APPLY ALL OF THIS DIFF. You need mainly the include of
<machine/ipl.h>. Unfortunately, <machine/ipl.h> is needed by
almost everything for the inlines.
/usr/src/sys/i386/include/ipl.h:
o New file. Defines spl inlines and SWI macros and declares most
variables related to hard and soft interrupt masks.
/usr/src/sys/i386/isa/icu.h:
o Moved definitions to <machine/ipl.h>
/usr/src/sys/i386/isa/icu.s:
o Software interrupts (SWIs) and delayed hardware interrupts (HWIs)
are now handled uniformally, and dispatching them from splx() is
more like dispatching them from _doreti. The dispatcher is
essentially *(handler[ffs(ipending & ~cpl)]().
o More care (not quite enough) is taken to avoid unbounded nesting
of interrupts.
o The interface to softclock() is changed so that a trap frame is
not required.
o Fast interrupt handlers are now handled more uniformally.
Configuration is still too early (new handlers would require
bits in <machine/ipl.h> and functions to vector.s).
o splnnn() and splx() are no longer here; they are inline functions
(could be macros for other compilers). splz() is the nontrivial
part of the old splx().
/usr/src/sys/i386/isa/ipl.h
o New file. Supposed to have only bus-dependent stuff. Perhaps
the h/w masks should be declared here.
/usr/src/sys/i386/isa/isa.c:
o DON'T APPLY ALL OF THIS DIFF. You need only things involving
*mask and *MASK and comments about them. netmask is now a pure
software mask. It works like the softclock mask.
/usr/src/sys/i386/isa/vector.s:
o Reorganize AUTO_EOI* macros.
o Option FAST_INTR_HANDLER_USERS_ES for people who don't trust
fastintr handlers.
o fastintr handlers need to metamorphose into ordinary interrupt
handlers if their SWI bit has become set. Previously, sio had
unintended latency for handling output completions and input
of SLIP framing characters because this was not done.
/usr/src/sys/net/netisr.h:
o The machine-dependent stuff is now imported from <machine/ipl.h>.
/usr/src/sys/sys/systm.h
o DON'T APPLY ALL OF THIS DIFF. You need mainly the different
splx() prototype. The spl*() prototypes are duplicated as
inlines in <machine/ipl.h> but they need to be duplicated here
in case there are no inlines. I sent systm.h and cpufunc.h
to Garrett. We agree that spl0 should be replaced by splnone
and not the other way around like I've done.
/usr/src/sys/kern/kern_clock.c
o splsoftclock() now lowers cpl so the direct call to softclock()
works as intended.
o softclock() interface changed to avoid passing the whole frame
(some machines may need another change for profile_tick()).
o profiling renamed _profiling to avoid ANSI namespace pollution.
(I had to improve the mcount() interface and may as well fix it.)
The GUPROF variant doesn't actually reference profiling here,
but the 'U' in GUPROF should mean to select the microtimer
mcount() and not change the interface.
/dev/mcd0a instead of /dev/mcd0d. This is more conforming to the /dev/cd0a
for the SCSI cdrom drives. It breaks the convention d the whole drive.
But the question is, do we really need partitions on cdrom drives ?
1) tty.c: gather all the info about the processes before calling ttyprintf
(which may block).
2) syscons.c: handle asynchronous output properly (data structures may
be corrupted otherwise).
Example:
Application use port cua01
Getty open ttyd1 (allocates rawq,outq,etc) and waits while application
done
Application quits, sioclose issued, ttyfree issued (getty calls revoke)
Getty awakes and goes to panic into initrb (NULL rawq)
now HUPCL set only in bidir case for callin lines
(this prevents set HUPCL on mouse)
comhardclose:
in addition to HUPCL case now DTR dropped for bidir case
if line was active in and no carrier present now.
(this prevents DTR sleep on mouse)
Subject: Re: Bugs with floppy drives
Date: Tue, 8 Mar 94 9:11:54 CST
The transfer speed was only set in the retry after error, not when
switching drives.
it still looks a little suspicious that so many of the status codes are missing
so I'm not going to adopt all of the existing ones yet. Try to be more
descriptive in the use of hex constants.
hack in the moment for testing purposes and to get the drive going
again.
0x20 means empty drive.
0x30 means closed drive with CDROM inserted.
0x80 means drive pulled out, but door closed.
0xa0 means drive pulled out and door open.
Luckily none of these values are the same as that reported for Ethernet
cards ( 0 for WD8003E, 0x40 for WD8013EPC, 0x60 for NE2000).
The bad part is, the probe code gets the WD8003E so hosed, that it is
no longer usable after it. No problem with the WD8013EPC.
This inetrface should be used from now on.
pseudo device pty xx still keeps its meaning: a maximum of
xx ptys is allowed.
A ringbuffer is now 2040 bytes long, per Garrett Wollman's request.
The changes are inspired by the way NetBSD did it (thanks for that!),
though I made it slihghtly different, including the interface so
at least 75% of the allocated space is deallocated when the tty is
closed.
Note further that it is easy to modify the ringbuffer length runtime.
This will have to wait untill some later date...
-Guido
When the keyboard is probed, the LED's blink quickly and
"Keyboard reset failed" is printed on the console. The
init routine keeps trying endlessly with the same behavior
as above.
I got the latest -current sup sources (06-Feb-94 12:00 GMT) to work using the
old syscons.c. The following patch makes the new syscons work:
2) Make SNAKE_SAVER like default, if no saver specified in "options"
3) Remove #ifdef STAR_SAVER before line /* make screensaver happy */
this code needed in any case.
Subject: syscons-1.3
Date: Sat, 29 Jan 94 23:33:50 MET
But here is the (hopefully) final syscons-1.3....
....
I've changed sgetc so it works as the pccons parallel
(it now uses a scgetc internally).
[
There were a couple changes that Bruce Evans sent me that were applied
to this version along with some changes that S'ren didn't incorporate
into the final version. There will be only minor changes if anything
from this version to his final release.
]
netmask or impmask.
2) Fixes from Bruce:
o Changed name of schedsoftcom() to setsofttty() to match
setsoftclock()
o Bool_t isn't used.
o tx_fifo_size is 1 for chips without fifos, 16 for 16550's, to
help to output more efficiently for 16550's (LSR_TXRDY means
that the fifo is empty, not that it has space for one char).
o Changed name of softsio1() to siopoll() and merged compoll()
into siopoll().
o The probe forgot to clear com_mcr after it failed. This is
harmful for 4 single serial ports on 2 interrupts. It makes
partial misconfigurations worse.
o Don't bother initializing static variables that are 0 (bidir
stuff).
o Only initialize t_oflag to TTYDEF_OFLAG if unit == COMCONSOLE,
not if COMCONSOLE is defined.
o Don't call siointr() from comparam() if there is no output in
progress. For the call from sioopen(), there's no output in
progress, and siointr() often saw silo overflows for stale
input because it was called before sioopen() discarded the
input.
o Let ttselect() do the work for select(), so that the fixes for
ttselect() don't have to be duplicated in zillions of drivers.
Yes, I know that IFADDR ioctl is supposed to be deprecated... Note
that the patch was modified by me to fit better into the driver. -DG
...
While porting CAP to 386bsd/pk0.2.4 and now to FreeBSD Release 1.0
I found a couple of bugs associated with the packet filter. Here
are the fixes. I'm posting them here because they apply to
FreeBSD and 386bsd/pk0.2.4 and possibly to other *BSD.
The first occurs when using the packet filter to write raw
ethernet packets. The header consisting of the sender and
destination addresses and the protocol is removed and later
added back on, but with the byte order of the protocol reversed.
The fix ensures that the byte order in the protocol field is
swapped when it is removed.
The second fix ensures that SIOCGIFADDR works for BPF as claimed
in the man pages, by adding it to the ed driver. Similar fixes
will be needed for other ethernet drivers.
Dave Matthews.
file override to disable fifo on 16550s:
I bought a board with two 16550's, but one of those ports has a mouse
on it. The sio driver always enables the fifo, which is a bad thing
for mice and X. The mouse is jerky and hard to use. The simple thing
is be to treat one of the ports as a non-fifo'ed UART, and I use the
flags option in my config file.
So, my config file has:
device sio0 at isa? port "IO_COM1" tty irq 4 flags 0x2 vector siointr
device sio1 at isa? port "IO_COM2" tty irq 3 vector siointr
(patch deleted)
0) FreeBSD additional include files additions
1) Rod's arpacom changes
2) Function type and return code cleanup, and all functions have correct
casting to the correct data types
3) Bugfix where driver would not function due to missing structure not
given a value.
4) General cleanup. (Theo did a lot already, I just did some more)
Choose older MULTIPORT version, because lastest bde version
not worked.
Don't force HUPCL for bidirectional case.
From bde:
Use bit (1 << (16 + 4)) in schedsoftcom() to avoid clash with
non-serial h/w on IRQ4.
Allow FIFO_TRIGGER in config.
Clear com->mcr_image when clearing mcr for init of 4port. The
usual value MCR_IENABLE should have broken 4ports unless
something happened to clear it later.
Turn off interrupts as well as DTR after an error waiting for
carrier (bidir dialin case).
Drain fifo more carefully.
Don't hang up if debugging.
Rearrange siointr() -> siointr1() for multiport case for speed,
lower latency and clarity.
Use suser() to check perms.
Provide missing splx() after failed perms checks.
c_ispeed == 0 means c_ispeed = c_ospeed (POSIX).
Set parameters (except speed) for c_ospeed == 0 as well as
hanging up.
Better initialization for console (fifo stuff...).
Misc. cleanups.
Fix dead hang if modem power is off.
problems in the moment are stray intr's in the ifconfig up/down.
No way to select all three interfaces on a combo card with
AUI/BNC/UTP interfaces and the performance doesn't look good.
Only tested with a ISA AUI/BNC card yet.
a binary link-kit. Make all non-optional options (pagers, procfs) standard,
and update LINT to reflect new symtab requirements.
NB: -Wtraditional will henceforth be forgotten. This editing pass was
primarily intended to detect any constructions where the old code might
have been relying on traditional C semantics or syntax. These were all
fixed, and the result of fixing some of them means that -Wall is now a
realistic possibility within a few weeks.
Entries for 800 and 820 fixed.
From vak@kiae.su:
incorporate Joerg Wunsch formatting code
correct handle timeouted operations
fixed entry for 720 media
GAP values changed suitable for possible format code addition.
Read/write GAP always 2 now.
Interleave parameter added for possible format code addition.
Many logical formats added.
720K physical drive added.
Problems: still can't read 720..820 media in 1.44 drive.
800K in HD 5.25in (maximum for DD diskettes)
1.44M in HD 5.25in (for easy distributions)
1.46M in HD 5.25in (maximum for 5.25)
Some cosmetique changes.
Now minor looks like UU DDDDDD, UU - unit, DDDDDD - density.
If density == 0, CMOS-detect format assumed.
Fix attach code for correct work with unknown CMOS
floppy types.
Trick diskerr to handle new minor.
1.722M floppy in 1.44M drive popular format added.
possible end-user errors.
Now:
1) on physical 1.2 can open logical 1.2, 720, 360H
2) on physical 1.44 can open logical 1.44, 720
3) on physical 360 can open logical 360
All other variants refused.
C-style improved in this check, multiply if's changed to switch.
More work to add 720K floppy support.
Restore good old dependance of device and floppy type.
Now:
fd?a == 1.44
fd?b == 1.2
fd?c == 720
fd?d == 360 in HD
fd?e == 360
Add more strict size check in Fdopen, not it refuse:
1) Attempt to open any type expect fd?e, if you have only 360K drive.
2) Attempt to open fd?a if you have only 1.2 drive.
added to probe.
2) Force CLOCAL=on for outgoing ports and CLOCAL=off for
incoming ports into open in bidirectional case.
3) Add DELAY after writing to com_ier for fifo drain into probe.
From: <dec@lazarus.nrtc.northrop.com>
Changes between EPSILON and RELEASE of FreeBSD have again caused
the kernel to not see my floppy disk drives. I don't know what happened,
'cause I don't see any changes to fd.c, but here is an old fix that
I have applied to the probe routine which will solve the problem (at
least for me). Since this is a rather brute-force solution - I understand
if you want to ignore it...
[Upgrading to pre-Beta FreeBSD caused this on my system. -AM]
* merged in Garrett Wollman's strict prototype changes
*
* Revision 2.15 1993/11/29 16:32:58 davidg
* From Thomas Sandford <t.d.g.sandford@comp.brad.ac.uk>
* Add support for the 8013W board type
* change all splnet's to splimp's
*
* Revision 2.13 1993/11/22 10:53:52 davidg
* patch to add support for SMC8216 (Elite-Ultra) boards
* from Glen H. Lowe
*
* Revision 2.12 1993/11/07 18:04:13 davidg
* fix from Garrett Wollman:
* add a return(0) at the end of ed_probe so that if the various device
* specific probes fail that we just don't fall of the end of the function.
* Novell probe changed to be invasive because of too many complaints
* about some clone boards not being reset properly and thus not
* found on a warmboot. Yuck.
*
* Revision 2.10 1993/10/23 04:07:12 davidg
* increment output errors if the device times out (done via watchdog)
*
* Revision 2.9 1993/10/23 04:01:45 davidg
* increment input error counter if a packet with a bad length is
* detected.
(rick@snowhite.cis.uoguelph.ca). I am currently using it with a Microsoft
InPort busmouse, under FreeBSD Epsilon. I hadn't planned on supporting it,
but I have patched it a few times, and I guess this is now the de facto
reference version, so send me any problems or improvements.
- Gene Stark
stark@cs.sunysb.edu
October 9, 1993
* 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.