Commit Graph

2228 Commits

Author SHA1 Message Date
Bruce Evans
34e9dea435 Added a flags arg to dsopen() and updated drivers. The DSO_ONESLICE
and DSO_NOLABELS flags prevent searching for slices and labels
respectively.  Current drivers don't set these flags.  When
DSO_NOLABELS is set, the in-core label for the whole disk is cloned
to create an in-core label for each slice.  This gives the correct
result (a good in-core label for the compatibility slice) if
DSO_ONESLICE is set or only one slice is found, but usually gives
broken labels otherwise, so DSO_ONESLICE should be set if DSO_NOLABELS
is set.
1998-07-30 15:16:06 +00:00
Bruce Evans
7010319f16 Fixed sign extension bugs awoken by changing speed_t to an unsigned
type.  19200, 1200 and other relatively uninteresting speeds were
broken.

Submitted by:	Rob Mallory <rmallory@qualcomm.com>
1998-07-29 18:48:20 +00:00
Bruce Evans
5c1a1eae83 Fixed error handling:
- Call isa_dmadone() whenever necessary to stop DMA and/or free bounce
  buffers.  Undead DMA corrupted the malloc freelist fairly consistently
  in the following configuration: SLICE kernel, 2 floppy drives, no disk
  in fd0, disk in fd1.
- Don't call fdc_reset() from fd_timeout().  Doing so gave an "extra"
  interrupt which was usually misinterpreted as being for completion
  of the next FDC command; the interrupt for completion of the next
  FDC command was then usually misinterpreted...  There were further
  complications for interrupts latched by the soft-spl mechanism so
  that they were delivered after all the h/w interrupts went away.
  This caused at least wrong head settle delays and may be why the
  FreeBSD floppy driver seems to munch floppies more than most floppy
  drivers.  The reset was unnecessary anyway in cases that didn't have
  the bug described next, since is was repeated a little later for
  the IOTIMEDOUT state.  The state machine has complications to handle
  resets correctly, so just use it.
- Don't call retrier() from fd_timeout().  The IOTIMEDOUT state needs
  to be processed next, and it isn't valid to set to that state if
  retrier() has aborted the current transfer.  Doing so caused null
  pointer panics after the previous bug was fixed.

Improved error handling:
- If an i/o is aborted, arrange to reset in the state machine before
  doing the next i/o.  New fdc flag for this.  This fixes spurious
  warnings and lengthy busy-waiting for the next i/o.
- Split STARTRECAL into RESETCOMPLETE and STARTRECAL and only check
  for the results from reset if we actually reset.  This fixes spurious
  warnings for other paths to STARTRECAL.  [Oops, it may break reset
  handling for motor-off resets.]

Cleanups in fd_timeout():
- Renamed to fd_iotimeout() to make it clearer that it is only used
  for i/o.
- Don't handle the bp == 0 case.  This case can't happen for i/o.
- Don't check for controller-busy.  We know it must be.
- Don't print anything.  retrier() already prints too much for normal
  errors.
- Fudge the state differently so that the state machine advances
  fdc->retry and the status is invalid (perhaps this should fudge a
  valid state like the one for WP).
- Style fixes.
1998-07-29 13:00:42 +00:00
Jonathan Lemon
a69546de82 Extend cpl workaround so that it applies when we are returning to
user-mode as well as vm86 mode.
1998-07-27 16:51:33 +00:00
Bruce Evans
f69c53b019 Don't pass the label to diskerr(), since the label is being constructed
and may be invalid.  In particular, d_secpercyl may be 0, and diskerr()
divides by it.
1998-07-25 16:35:06 +00:00
Mike Smith
b16d163da1 Add the 'cs' driver for Crystal Semiconductor CS89x0 devices. This
supports PnP and if_media.  I've been running a slightly older version
here for several weeks now.
Submitted by:	Maxim Bolotin <max@rsu.ru>
1998-07-20 20:00:43 +00:00
Mike Smith
2512c3e67b Add support for PCNet PCI chips that only work when we talk to them as ISA
devices. Specifically fix the case for the Hitachi version as used in
their VisionBook models.

Submitted by:	Ted Faber <faber@isi.edu>
1998-07-20 17:33:01 +00:00
Bruce Evans
92d1f65ed2 Moved allocation of the slices struct to the right place. Initialize
everything in it (the devsw pointers were not initialized early or at
all for the !DEVFS case, but this was harmless on i386's).
1998-07-20 13:39:45 +00:00
Bruce Evans
f2bd332e7c Stop physical DMA for the non-auto case in isa_dmadone(). This fixes a
small part of a bug suite beginning in the SLICE probes but mostly in the
floppy driver.  This is a quick fix: the auto case shouldn't be special;
DMA should also be stopped in isa_dma_release(); isa_dmastop() probably
shouldn't exist; common DMA registers should not be accessed without
locking.
1998-07-19 04:22:55 +00:00
Bruce Evans
e5d7d24361 Fixed error handling after a seek error that can't happen. When the
controller reports a successful seek, it is very unlikely to report
seeking to a cylinder other than the one requested, but we check for
this, and botched the error handling for the requested_cylinder != 0
case.  This error happened when the bug fixed in rev.1.52 of <sys/buf.h>
caused the head of buffer queue to change to one starting on a different
cylnder - the requested cylinder was found, but it wasn't what we
thought we requested.  The fix is simply to arrange to reset the state
machine.

Corruption of the buffer queue seems to only have been a problem in the
floppy driver.  Other drivers dequeue the head of the queue before doing
physical i/o on it, so the corruption at worse broke the elevator sort
order.  Dequeueing breaks it anyway.
1998-07-18 03:15:33 +00:00
Bruce Evans
18da528d41 Changed %n to %r in devfs name format strings. %n has almost gone away. 1998-07-15 12:18:34 +00:00
Bruce Evans
1be1e72fd8 Don't cast pointers to longs in asm statements.
These asm statments are not quite as pessimal as when I complained
about them in rev.1.9 of audio.c.  They seem to be only 40% slower
than the C version on P5's and the same speed on K6's.
1998-07-15 11:47:58 +00:00
Bruce Evans
51d5e97efa The ioctl request arg is unsigned log, so don't attempt to pass it
around as signed int.

Fixed printf format error for ioctl request arg hidden in ifdefed code.
1998-07-15 10:11:21 +00:00
Bruce Evans
29d6b96d69 The ioctl request arg is unsigned long, so don't attempt to pass it
around as signed int.
1998-07-15 09:59:31 +00:00
Bruce Evans
ea878c61f1 Don't pretend to support ix86's with 16-bit ints by using longs
just to ensure 32-bit variables.
1998-07-15 09:38:10 +00:00
Bruce Evans
3cc954df66 Don't pretend to support ix86's with 16-bit ints by using longs
just to ensure 32-bit variables.  Doing so broke i386's with 64-bit
longs.
1998-07-14 11:42:05 +00:00
Bruce Evans
8f5aca410f Don't pretend to support ix86's with 16-bit ints and 32-bit registers
by using longs just to ensure 32-bit variables.  Long variables don't
fit in 32-bit registers on ix86's with 64-bit longs.
1998-07-14 06:17:28 +00:00
Bruce Evans
9bffbcd4f5 Fixed printf format errors (only 1 left in GENERIC now). 1998-07-13 09:53:11 +00:00
Julian Elischer
ad27f8d9a5 SLICE probing becomes asynchronous. It can now be triggered by
interupt level events. This needs a lot of cleanup, but has been working
here for a month or two.. originally needed for CAM integration
but that hasn't happenned yet. The probing  state machines for each
handler should be replaced by a more generic state-service. It's
still quite messy in there..
1998-07-13 08:23:05 +00:00
Poul-Henning Kamp
3bc7e56592 Improve a couple of comment.
PR:		7242
Reviewed by:	phk
Submitted by:	Peter Jeremy <peter.jeremyp@alcatel.com.au>
1998-07-11 08:01:18 +00:00
Bruce Evans
ac1e407b32 Fixed printf format errors. 1998-07-11 07:46:16 +00:00
Bruce Evans
a838d83d8f Don't pretend to support ix86's with 7-bit ints by using longs just to
ensure 8-bit variables.  Doing so mainly bogotified some printf formats.
1998-07-11 06:35:39 +00:00
Eivind Eklund
c8cedb4e27 "vender" -> "vendor"
Requested by:	Aage Røbekk <aagero@aage.priv.no>
1998-07-06 16:10:06 +00:00
Warner Losh
f71f5262b1 Add the ability to suspend as well as hibernate to the system. This
is the kernel part of my commits, the userlevel stuff will be done in
a separate commit.  Add the ability to suspend as well as hibernate to
syscons.  Create a new virtual key like hibernate for suspend.  Update
apm_bios.h to define more apm bios goodies.
1998-07-06 06:29:07 +00:00
Julian Elischer
f7ea2f55d1 There is no such thing any more as "struct bdevsw".
There is only cdevsw (which should be renamed in a later edit to deventry
or something). cdevsw contains the union of what were in both bdevsw an
cdevsw entries.  The bdevsw[] table stiff exists and is a second pointer
to the cdevsw entry of the device. it's major is in d_bmaj rather than
d_maj. some cleanup still to happen (e.g. dsopen now gets two pointers
to the same cdevsw struct instead of one to a bdevsw and one to a cdevsw).

rawread()/rawwrite() went away as part of this though it's not strictly
the same  patch, just that it involves all the same lines in the drivers.

cdroms no longer have write() entries (they did have rawwrite (?)).
tapes no longer have support for bdev operations.

Reviewed by: Eivind Eklund and Mike Smith
	Changes suggested by eivind.
1998-07-04 22:30:26 +00:00
Jordan K. Hubbard
24fa2d131e Check for missing keyboard.
PR:		7108
Submitted by:	Hellmuth Michaelis <hm@hcs.de>
1998-07-03 14:34:28 +00:00
John-Mark Gurney
a9e837f479 document options to hardwire GUS irq/dmas... 1998-06-30 08:24:02 +00:00
Poul-Henning Kamp
761b9eeed9 Add D_DISK flag. 1998-06-26 18:13:57 +00:00
Poul-Henning Kamp
b62591052c Remove bdevsw_add(), change the only two users to use bdevsw_add_generic().
Extend cdevsw to be superset of bdevsw.
Remove non-functional bdev lkm support.
Teach wcd what the open() args mean.
1998-06-25 11:28:07 +00:00
Kazutaka YOKOTA
bf41934ccb Don't refer to mouse_info.u.datea.[xyz] while processing MOUSE_BUTTON_EVENT
ioctl.  These fields don't have valid values for this ioctl.
PR: kern/6928
Submitted by: Bill Fenner <fenner@parc.xerox.com>
1998-06-24 10:21:30 +00:00
Poul-Henning Kamp
e29bc9add4 Avoid some panics in sio_unload which gets called with various dirt
if the attach of a modem card failed.
1998-06-24 09:23:32 +00:00
Bruce Evans
be160d60ab Removed unused includes. 1998-06-21 18:02:50 +00:00
Bruce Evans
86ef30b746 Removed unused includes.
Ifdefed conditionally used includes.
1998-06-21 17:08:08 +00:00
Bruce Evans
2d7fa8d877 Removed unused includes.
Ifdefed conditionally used includes.
Finished rev.1.39.  (I only submitted the request.)
1998-06-21 16:51:06 +00:00
Bruce Evans
4d2540b074 Removed unused includes.
Don't depend on "implicit int".
1998-06-21 15:54:11 +00:00
Bruce Evans
2773aa0ef6 Removed unused includes.
Don't depend on "implicit int".
Don't bloat the data section with explicit initialization to 0.
1998-06-21 15:49:39 +00:00
Bruce Evans
e5b19842ef Removed unused includes. 1998-06-21 14:53:44 +00:00
Bruce Evans
316bbd5c6f Converted add_interrupt_randomness() to take a `void *' arg. Rewrote
mmioctl() to fix hundreds of style bugs and a few error handling bugs
(don't check for superuser privilege for inappropriate ioctls, don't
check the input arg for the output-only MEM_RETURNIRQ ioctl, and don't
return EPERM for null changes).
1998-06-21 11:33:32 +00:00
Bruce Evans
5a2ae61fec Converted isa_strayintr() to take a `void *' arg. 1998-06-18 16:08:46 +00:00
Bruce Evans
9a2daf9190 Changed the type of an isa/general interrupt handler to take a
`void *' arg.  Fixed or hid most of the resulting type mismatches.
Handlers can now be updated locally (except for reworking their
global declarations in isa_device.h).
1998-06-18 15:32:09 +00:00
Bruce Evans
a5211c115d Renambed sbintr to sb_intr to avoid a conflict with the (now
unconditionally declared although it can't be configured together
with snd) extern function sbintr.
1998-06-17 16:59:30 +00:00
Bruce Evans
e9b998f0be Don't depend on <sys/conf.h> declaring isa device structs or isa
interrupt handlers.  pcm is not in LINT, so it is hard to test.
1998-06-17 16:54:22 +00:00
KATO Takenori
a880d1a224 Declare bsintr when PC98 is defined. 1998-06-17 16:32:23 +00:00
Bruce Evans
084d9853ca Don't declare isa device structs or isa interrupt handlers in <sys/conf>,
and don't depend on them being declared there.  This will cause lots of
warnings for a few minutes until config is updated.  Interrupt handlers
should never have been configured by config, and the machine generated
declarations get in the way of changing the arg type from int to void *.
1998-06-17 14:58:04 +00:00
Bruce Evans
f878d7eebd Include <i386/isa/pnp.h> after including its prerequisite
<i386/isa/isa_device.h> - don't depend on pollution in <sys/conf.h>
including the prerequisite earlier.
1998-06-17 14:01:00 +00:00
Bruce Evans
b6f37c1954 Added used include of <i386/isa/isa_device.h> - don't depend on
pollution in <sys/conf.h>
1998-06-17 13:54:59 +00:00
Bruce Evans
eca52014bd Don't log "unexpected" events on never-opened devices. Events left
over from the probe are now expected for incompatible UARTs that
deliver IRQs as a strobe (low) instead of a level (high).

Discard events on going-away devices too.  Endless loops may have
been possible when an active pccard was removed.
1998-06-16 11:05:59 +00:00
Bruce Evans
26d7294956 Avoid 64-bit divisions and modulos. Fixed related overflows for weird
args.

This driver should not be used, since it calls uiomove() with interrupts
disabled.
1998-06-14 10:52:52 +00:00
Steve Price
396ffb2e6b Add a macro tweak.
PR:		6932
Submitted by:	Nick Sayer <nsayer@quack.kfu.com>
1998-06-13 19:36:22 +00:00
Steve Price
56cef66e8c Add a symlink from /dev/vga to /dev/ttyv0 when using DEVFS
for programs like doscmd.

PR:		6920
Submitted by:	Luoqi Chen <luoqi@chen.ml.org>
1998-06-13 18:53:22 +00:00