Commit Graph

3214 Commits

Author SHA1 Message Date
Bruce Evans
33dc7e1b84 Reduce timeout frequency from `hz' to 0 if no ports are open or to 1 if
no ports are active, provided there are no polled ports and no
`LOSESOUTINTS' ports.  Do a little more in the interrupt handler instead.
This is a little less efficient if there are are many active ports but
a little more efficient otherwise.  Polled ports are ones with no irq
specified (as before).  `LOSESOUTINTS' ports are ones with 0x08 set in
their config flags.  Unless this flag is set, it will now take up to one
second to recover from lost output interrupts, if any.  Some 8250s and
16450s lose output interrupts.

Improve output buffering: copy the clist buffer to 2 linear buffers if
necessary and possible instead of to 1.  Handle an arbitrary queue of
buffers in the interrupt handler.  Check for waking up sleepers after
copying characters out of the clist buffer instead of before.

Delay translation of TIOCM_DTR to MCR_DTR etc. so that the top level
routines are more machine independent.

Fix bogus device register in unused code.
1995-06-25 04:51:01 +00:00
Andrey A. Chernov
a526d6bb67 ttywait: convert EWOULDBLOCK to EIO, when t_timeout expired 1995-06-24 16:28:20 +00:00
Andrey A. Chernov
13cf82d487 Replace EWOULDBLOCK to EIO in ttwrite, when t_timeout expired 1995-06-23 21:20:10 +00:00
Andrey A. Chernov
525cb41eb5 1) Enable boot from root partition which end > cyl 1023, it isn't criminal
2) Produce hard error when Bread attempts to read cyl >1023
Reviewed by: bde
1995-06-23 01:42:42 +00:00
Doug Rabson
975c53c7b0 Add an option to the psm driver to skip the parts of the probe which break
some laptops with PS/2 mice.

Submitted by:	nsayer@quack.kfu.com
1995-06-22 10:56:56 +00:00
David Greenman
108b7c8091 Use ifr_mtu for the mtu value rather than ifr_metric. 1995-06-22 07:03:20 +00:00
Garrett Wollman
43bed81d64 Fix an error in the comparison direction of the ap->updating case of
in_rtqkill().

Submitted by: W. Richard Stevens
1995-06-21 19:48:53 +00:00
David Greenman
381e6190c0 Change interface type...IFT_SLIP -> IFT_PARA. 1995-06-21 10:23:23 +00:00
David Greenman
0a779360e5 Killed a couple lines of redundant code. 1995-06-21 10:13:23 +00:00
David Greenman
92678d4679 Protect the call to if_up() with an splnet(). 1995-06-21 09:11:22 +00:00
David Greenman
2cd67fdafd 1) Set interface up/down correctly as a function of open and close of the
SLIP device.
2) Don't directly frob the IFF_UP flag - use if_up/if_down as it was
   intended.
3) Return ENETDOWN if IFF_UP isn't set when outputing, drop the packet if
   if IFF_UP isn't set when inputing.
1995-06-21 08:48:19 +00:00
Garrett Wollman
4650161123 Fix a resource allocation bug where multicast forwarding would leak mbufs
in certain cases when allocation of another mbuf has already failed.

Submitted by: Bill Fenner <fenner@parc.xerox.com>
1995-06-19 17:22:01 +00:00
Garrett Wollman
9167720192 Now that we've gone to all sorts of effort to allow TCP to cache some of
its connection parameters, we want to keep statistics on how often this
actually happens to see whether there is any work that needs to be done in
TCP itself.

Suggested by: John Wroclawski <jtw@lcs.mit.edu>
1995-06-19 16:45:33 +00:00
Atsushi Murai
4112bc7874 1. Supporting fast sync value displayin latest firmware.
2. Use restrict round-robin scheme rather than a  agresive one if
   firmware has a this capability.
1995-06-19 13:02:09 +00:00
Bill Paul
0932a90b65 Close out PR #507 (loading LM_MISC pseudo-lkms twice crashes system).
For the LKM_E_LOAD case of the DISPATCH() macro, use lkmexists() to
make sure we don't have another instance the module we're trying to
load already loaded _before_ calling the module's load() function.
If lkmexists() returns true, return EEXIST without trying to load
the module.

For most types of modules, the individual dispatch functions in the
kernel check for duplicated modules, but for LM_MISC we can't trust
the module to do the checks itself. Currently, the kernel does
do an lkmexists() check on LM_MISC modules, but not until after
the module's load() function has been called, which is too late
for it to do any good. If the load() function does irreversible
things to the kernel, the belated lkmexists() check forces an
unload() and a crash.
1995-06-17 05:02:30 +00:00
Andrey A. Chernov
00999cd623 Optimized and simplified version of setreuid/gid
Fixed: lack of crcopy in certain conditions, lack
of setting sv[ug]id in certain conditions. Fixes non-critical.
1995-06-15 22:32:03 +00:00
Paul Traina
00a838879b Give the BPF the ability to generate signals when a packet is available.
Reviewed by:	pst & wollman
Submitted by:	grossman@cygnus.com
1995-06-15 18:11:00 +00:00
David Greenman
3740e2ad04 Took out P2P_LOCALADDR_SHARE option and made it standard. 1995-06-15 00:19:56 +00:00
Andrey A. Chernov
ae39e7ee16 Next version, many bugs fixed 1995-06-14 19:37:02 +00:00
Atsushi Murai
634ccfcbf6 Bestmatch check for cd-drive always faild due to additional space
on manufacture and  other items. So it's never probe as MORE_LUNS
after frist SONY entry....
1995-06-14 12:28:32 +00:00
Bruce Evans
f53dbe9765 Convert %p to 0x%x instead of to 0x%8x. The latter gives blank padding
in the wrong place.  Blank padding in the right place or zero padding
would be inconsistent with user mode.

Put case 'p' in alphabetical order.

Implement %p in sprintf() too.  I'd like only a single, more complete
printf() core, perhaps one based on vsnprintf().
1995-06-14 07:55:07 +00:00
Bruce Evans
6f5014b462 Convert to ANSI C: change #endif THING to #endif /* THING */.
Fix one such THING in code to match comment.
Sort IO_GSC* into numeric order and update comments about the gaps.
Sort common SCSI addresses into alphabetical order.
Remove bogus comments about com ports having i/o size 4.
Uniformize whitespace.
Uniformize case in hex digits.

This file is very incomplete.  In particular, it doesn't mention any
network cards.  This doesn't matter much for the base addresses, but
it means that the comments about which addresses are free are mostly
bogus.  The i/o sizes are unreliable because of split address ranges
for many devices (VGA, wd).  The i/o sizes are incomplete.  In
particular, there are no sizes for SCSI controllers.  The bt driver
still returns a truth value instead of a size.
1995-06-14 07:38:31 +00:00
Joerg Wunsch
ec05e1f5d7 The duplicate information returned in fa_type and fa_mode
is an ambiguity in the NFS version 2 protocol.

VREG should be taken literally as a regular file.  If a
server intents to return some type information differently
in the upper bits of the mode field (e.g. for sockets, or
FIFOs), NFSv2 mandates fa_type to be VNON.  Anyway, we
leave the examination of the mode bits even in the VREG
case to avoid breakage for bogus servers, but we make sure
that there are actually type bits set in the upper part of
fa_mode (and failing that, trust the va_type field).

NFSv3 cleared the issue, and requires fa_mode to not
contain any type information (while also introduing sockets
and FIFOs for fa_type).

The fix has been tested against a variety of NFS servers.
It fixes problems with the ``Tropic'' NFS server for Windows,
while apparently not breaking anything.

Pointed-out by: scott@zorch.sf-bay.org (Scott Hazen Mueller)
1995-06-14 06:23:38 +00:00
Bruce Evans
5dce8a63fc Don't convert \n to \r\n in pccnputc(). This is the responsibility of
cnputc().
1995-06-14 05:16:12 +00:00
Bruce Evans
567cfde170 Replace \n\r by \n in error messages. 1995-06-14 05:06:51 +00:00
Bruce Evans
39a7e2a41a Output \n as \r\n, not as \n\r. 1995-06-14 04:52:39 +00:00
Garrett Wollman
ca78a2a8bb I was wrong. I thought that the ip_mroute lkm would still compile, but it
seems to have stopped working on me.  Disable it until I get a chance to
fix it.
1995-06-13 20:51:13 +00:00
Garrett Wollman
1c5de19afb Kernel side of 3.5 multicast routing code, based on work by Bill Fenner
and other work done here.  The LKM support is probably broken, but it
still compiles and will be fixed later.
1995-06-13 17:51:16 +00:00
Rodney W. Grimes
d3628763db Merge RELENG_2_0_5 into HEAD 1995-06-11 19:33:05 +00:00
Rodney W. Grimes
9b2e535452 Remove trailing whitespace. 1995-05-30 08:16:23 +00:00
Rodney W. Grimes
5ebc7e6281 Remove trailing whitespace. 1995-05-30 06:12:45 +00:00
Rodney W. Grimes
6c06b4e2aa Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
Rodney W. Grimes
4399be3cbd Remove trailing whitespace. 1995-05-30 05:05:38 +00:00
David Greenman
ac8d676972 Fix setdumpdev():
- the major number wasn't checked, so accesses beyond the end of bdevsw[]
  were possible.  Bogus major numbers are easy to get because `sysctl -w'
  doesn't handle dev_t's reasonably - it doesn't convert names to dev_t's
  and it converts the number 1025 to the dev_t 0x35323031.
- Driver d_psize() functions return -1 to indicate error ENXIO or ENODEV
  (the interface is too braindamaged to say which).  -1 was interpreted
  as a size and resulted in the bogus error ENOSPC.
- it was possible to set the dumpdev for devices without a d_psize()
  function.  This is equivalent to setting the dumpdev to NODEV except
  it confuses sysctl.
- change a 512 to DEV_BSIZE.  There is an official macro dtoc() for
  converting "pages" to disk blocks but it is never used in /usr/src/sys.
  There is much confusion between PAGE_SIZE sized pages and NBPG sized
  pages.  Maxmem consists of both.

Not fixed:
- there is nothing to invalidate the dumpdev if the media goes away.
  This reduces the benefits of the early calculation of dumplo.  Bounds
  checking in the dump routines is relied on to reduce the risk of
  damage and little would be lost by relying on the dump routines to
  calculate dumplo.
- no attempt is made to stay away from the start of the device to
  avoid clobbering labels.

Fix wrong && anachronistic comment about the type of bootdev.

Reviewed by:	davidg
Submitted by:	Bruce Evans
1995-05-29 04:08:13 +00:00
David Greenman
77f53bcf27 Fixed some serious bugs that resulted in object reference counts not being
handled correctly. This would manifest itself as "object deallocated too
many times" panics and perhaps other strange inconsistencies on NFS servers.

Reviewed by:	me, of course
Submitted by:	John Dyson
1995-05-29 04:01:09 +00:00
Poul-Henning Kamp
fe3ee28802 Mount MFS as root RW. Remounting doesn't make sense.
Reviewed by:	davidg
1995-05-29 03:27:37 +00:00
Poul-Henning Kamp
13eb702447 Reduce the amount of bss the kzip stuff uses by moving big buffers into
the first Mb of memory.  Makes 4Mb machines more happy.
1995-05-29 01:38:07 +00:00
Rodney W. Grimes
265368d4f1 Submitted by: dufault
LINT talks about about 2.1.  I changed that to 2.0.5,
and clarified why certain devices need "at scbus?".

There is still a crazy "PCVT=210" which shouldn't be there,
but corrected comment as it is needed for 2.0.5.
1995-05-28 13:24:16 +00:00
David Greenman
347a022fa7 Kill bogus vnode_pager_setsize(). It was being called at the wrong time
and resulted in the object size being too small. This caused bad things
to happen later when the file was mapped.

Reviewed by:	John Dyson
1995-05-28 04:32:23 +00:00
David Greenman
dd1da8a5af Increased delay after reset to 10ms. Suggested by several people, the last
of which was Scott Mace. This fixes a bug where the card would be missed
sometimes during the device probe.
1995-05-27 04:40:57 +00:00
David Greenman
b2af64fd03 Added a fix for a bug which caused the wrong interface to be selected
for broadcasts if point-to-point links shared the same IP address as
the ethernet. The fix must be enabled with P2P_LOCALADDR_SHARE option
in the kernel config file. This will someday likely be standard, but
there isn't sufficient time before release to determine if there are
any interoperability problems with routed and/or gated.

Reviewed by:	Garrett Wollman, and me
Submitted by:	Peter Wemm
1995-05-27 04:37:24 +00:00
David Greenman
b8e91dab53 Update swap and dump stuff to match reality:
- option DODUMP no longer exists (remove all references to it).
- directive `swap on' is now a no-op (don't bother documenting it; remove
  comment to match code).
- directive `dumps on' still works (restore code to match comment; deprecate
  it in comment).

Reviewed by:	Poul-Henning Kamp, and me
Submitted by:	Bruce Evans
1995-05-27 04:32:12 +00:00
David Greenman
0063696232 Fixed bugs in multicast address handling (flag was set in wrong register,
etc.). The tulip_start routine was rewritten to use less stack space (I've
been having problems with wcarchive overflowing the stack and this should
help a little). This version also has preliminary NetBSD support.

Rod Grimes helped in testing this version of the driver. Thanks Rod. It's
additionally been extensively tested here and on wcarchive.

Submitted by:	Matt Thomas
1995-05-26 02:02:44 +00:00
David Greenman
b64b660cd3 Made "NMBCLUSTERS" calculation dynamic and fixed bogus use of "NMBCLUSTERS"
in machdep.c (it should use the global nmbclusters). Moved the calculation
of nmbclusters into conf/param.c (same place where nmbclusters has always
been assigned), and made the calculation include an extra amount based
on "maxusers". NMBCLUSTERS can still be overrided in the kernel config
file as always, but this change will make that generally unnecessary. This
fixes the "bug" reports from people who have misconfigured kernels seeing
the network hang when the mbuf cluster pool runs out.

Reviewed by:	John Dyson
1995-05-25 07:41:28 +00:00
David Greenman
cddc961a83 Made "NMBCLUSTERS" calculation dynamic and fixed bogus use of "NMBCLUSTERS"
in machdep.c (it should use the global nmbclusters). Moved the calculation
of nmbclusters into conf/param.c (same place where nmbclusters has always
been assigned), and made the calculation include an extra amount based
on "maxusers". NMBCLUSTERS can still be overrided in the kernel config
file as always, but this change will make that generally unnecessary. This
fixes the "bug" reports from people who have misconfigured kernels seeing
the network "hang" when the mbuf cluster pool runs out.

Reviewed by:	John Dyson
1995-05-25 07:36:24 +00:00
David Greenman
956e9ca5a0 Removed check for sw_dev == NODEV; this is a normal condition for swap
over NFS and was gratuitously panicing when it happens.

Reviewed by:	John Dyson
Submitted by:	Pierre Beyssac via Poul-Henning Kamp
1995-05-25 03:38:11 +00:00
David Greenman
243e5a88d5 Fixed panic that resulted from mmaping files in kernfs and procfs. A
regular user could panic the machine with a simple "tail /proc/curproc/mem"
command. The problem was twofold: both kernfs and procfs didn't fill in
the mnt_stat statfs struct (which would later lead to an integer divide
fault in the vnode pager), and kernfs bogusly paniced if a bmap was
attempted.

Reviewed by:	John Dyson
1995-05-25 01:35:24 +00:00
David Greenman
d53eacdf28 This should fix PR 438. Apparently I never tested disklabel on the block
device.

v_numoutput wasn't incremented to match the b_iodone nesting.  It's still
fishy that vwakeup() clears B_WRITEINPROG before biodone() has finished;
however, B_WRITEINPROG seems to be never used.

Submitted by:	Bruce Evans
1995-05-24 23:33:42 +00:00
David Greenman
3e47ca0577 Enclosed is a patch for if_ze.c which will allow it to operate with
the National Semiconductor InfoMover PCMCIA cards also. In tests on a
NE4100 on Jordan's laptop here, the ze driver works fine with that
card.

Reviewed by:	Jordan Hubbard, Rod Grimes, and me
Submitted by:	Gary Palmer
1995-05-24 20:33:42 +00:00
David Greenman
87c15d9649 There are two serious bugs in if_de.c. The first should not matter
to most users (the wrong length is passed to ether_input).  The
second is more serious.  The multicast hash algorithm uses the wrong
(low) bits instead of the right (high) bits.  This is only an issue
if you use >12 multicast addresses but if you are using IP multicast
then it might affect you...

Submitted by:	Matt Thomas
1995-05-22 13:32:24 +00:00