Commit Graph

46 Commits

Author SHA1 Message Date
David Greenman
c1bb2f57d0 Brought over two fixes from 1.1.5; this now makes this driver "up to date"
with 1.1.5:

  revision 1.40
  date: 1994/06/17 16:57:03;  author: pst;  state: Exp;  lines: +4 -2
  From: Gill Kloepfer Jr. <gil@limbic.ssdl.com>
  Verified by: pst

  > The DIOCSBAD ioctl sets a bad block table (is almost suredly called by
  > the bad144 utility) and changes the memory-resident bad block table.  The
  > problem is that bad144intern() is not called after the "disk" structure has
  > been changed, so that the internal bad144 table will become out-of-sync with
  > the one in the disk structure.
  ----------------------------
  revision 1.39
  date: 1994/06/07 01:36:39;  author: phk;  state: Exp;  lines: +3 -2
  another place option !defined(DISKLABEL_UNPROTECTED) was needed.
1994-09-10 03:19:49 +00:00
Andrey A. Chernov
b7a8860d88 Change WDRAW back to 3, too early step right now, disklabels needs more
work
Change hardcoded 'd' in printfs to 'a' + WDPART
1994-08-30 14:26:13 +00:00
Andrey A. Chernov
8a1d40881d Now WDRAW=2 1994-08-29 21:35:16 +00:00
Paul Richards
d091793974 Ran ft.c through ident.
Added a missing #ifdef INET wrapper in lpt.c

Main change:
	Removed the timeout_func_t casts from timeout calls and
	correctly defined the timeout routines to conform to
	the new format.
lpt.c doesn't have this change.

Reviewed by:
Submitted by:
1994-08-23 07:52:29 +00:00
Garrett Wollman
f540b1065a Change all #includes to follow the current Berkeley style. Some of these
``changes'' are actually not changes at all, but CVS sometimes has trouble
telling the difference.

This also includes support for second-directory compiles.  This is not
quite complete yet, as `config' doesn't yet do the right thing.  You can
still make it work trivially, however, by doing the following:

rm /sys/compile
mkdir /usr/obj/sys/compile
ln -s M-. /sys/compile
cd /sys/i386/conf
config MYKERNEL
cd ../../compile/MYKERNEL
ln -s /sys @
rm machine
ln -s @/i386/include machine
make depend
make
1994-08-13 03:50:34 +00:00
David Greenman
e80859e4d6 Last commit for this file should have read:
Reduced maximum transfer size by one to allow for catching a too large
condition correctly. Do single block I/O if the size is too large.

Submitted by:	Bruce Evans
1994-08-08 13:56:46 +00:00
David Greenman
7d7bb69d41 Detect the "EOF" condition. Specifically, end of partition.
Submitted by:	Bruce Evans
1994-08-08 13:53:55 +00:00
Rodney W. Grimes
26f9a76710 The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.
Reviewed by:	Rodney W. Grimes
Submitted by:	John Dyson and David Greenman
1994-05-25 09:21:21 +00:00
David Greenman
0e195446b7 Bug fixes and performance improvements from John Dyson and myself:
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.
1994-04-20 07:06:57 +00:00
Geoff Rehmet
5bc9752a71 Modify wdprobe() to correctly recognise some 2 drive systems,
on which it was failing.  Modifications follow ATA, but also
allow some weird setups which seem to contradict ATA (aaarrrrgghhh!!)
1994-04-10 11:17:13 +00:00
Jordan K. Hubbard
068a409099 Beginning of change set for making more friendly laptop configurations.
Changes _only_ take effect if `options LAPTOP' is set.

Note:  This one is distinctly dodgy. When my IDE drive spins back up from sleep
mode, it generates this `extra interrupt' condition by spinning back up and
generating an intr, though without any particular action required.  This
message coming out every time is rather annoying, and thus disabled.
However, what I'm not at all sure of is whether or not all IDE drives will
behave in the same way, or if perhaps it needs to be done in a more complicated
fashion by detecting this more involved "I've spun up and am just saying hi"
condition.  This is a simple change and easy to back out/ammend if anybody has
any better ideas.
1994-03-06 03:10:58 +00:00
Andrey A. Chernov
3b2acd20e0 1) My previous fix does nothing, now Rod's fix rewrited to implement
my previous fix too (using wdp_heads controller value) and check
0 heads case too.

Other fixes from Bruce:
2) Fix dk_timeout from 2 to about 4 seconds.
3) wdcontrol not retried on internal error.
4) wdwait return check changed ( "!=0" to "<0" into wdsetctlr,
"<0" to "!=0" into wdgetctlr).
1994-03-04 16:43:07 +00:00
Andrey A. Chernov
3932675839 Better fix for >16 heads problem, right value from
controller restored.
1994-02-25 23:17:40 +00:00
Rodney W. Grimes
5086a82862 Fix off by one error 1994-02-23 11:14:26 +00:00
Rodney W. Grimes
97687d1b3d More clean up of the drive Id string, trancate trailing spaces. 1994-02-22 22:13:37 +00:00
Rodney W. Grimes
1004b0634c The model string can be 40 bytes long with no terminating null, so
convert all nulls to spaces and then print it with a %40s.
1994-02-22 18:51:27 +00:00
Rodney W. Grimes
84a161c5f1 Clean up dmesg output so that it matches the scsi stuff.
Small hack, if heads > 16, output a warning and then set the head
count to 16.  This stops the infinite loop on this error and allows
people to later fix the DOS parameter table later with fdisk.
1994-02-21 12:32:33 +00:00
Nate Williams
b21df1d16c Added third parameter to wdwait which contains the amount of time to
'wait' based on suggestion by Rod in -hackers.

No functional change as all the TIMEOUTS are identical currently, but
this will probably change.
1994-02-11 12:02:35 +00:00
Andrey A. Chernov
2803eb968a Add "wdx: not found" diagnostic missed in previous commits 1994-02-07 15:40:38 +00:00
David Greenman
5ef457fa81 Nuke bogus error message 1994-02-07 04:20:57 +00:00
Andreas Schulz
8a683b0d28 Fixed up the compiler warnings. 1994-02-06 17:03:17 +00:00
Rodney W. Grimes
069968bf50 Increase the TIMEOUT value that keeps getting nuked to 300 mSEC, I set it
to 1.1 secounds this time (ie, TIMEOUT=10000).
1994-02-06 02:56:11 +00:00
Nate Williams
fa998562eb Removed hack for older version of syscons (new version going in soon) 1994-02-01 05:58:02 +00:00
Nate Williams
768e8947c6 From: bde@kralizec.zeta.org.au (Bruce Evans)
o merged and fixed timeout code from sos.
	o merged DOS partition support from sos.
	o fixed "extra" interrupts.
	o check if malloc retuns NULL :-(.
	o print drive size as in NetBSD
	o after an error, return the residual count, not 0.
	o give up early for > 16 heads.
	o cleaned up the old-drive detection in wdgetctlr().
	o rewrote wddump().  I'd been putting this off because
	  I'd had the dump disabled since 0.0 and had no idea
	  if even the standard version worked.  It didn't:
	  (0) syscons' sgetc() interface broke some keyboard
	  stuff.
	  (1) CADDR1 is mapped using pmap() and pmap got a NULL
	  pointer trap (at least when I got to wddump() using
	  call diediedie from ddb) because the pte for CADDR1
	  is only supposed to be hacked on directly (e.g. in
	  physcopyseg()).
	  (2) bad144 handling was not done.
	  (3) it was slooow (3600 sectors/minute) because my
	  controller doesn't cache writes.
	o miscellaneous other cleanups, e.g., removed scattered
	  patchkit/terry dates.
	o lots of reformatting.

To be done:
	o Merge/fix TIH/NetBSD bad144 code (doesn't belong in any
	  particular driver.  Why aren't we using i386/dkbad.c?).
	o Merge/fix Dyson/NetBSD clustering code (large parts
	  should be shared).
	o Fix/extend the partition in use bits.  Support extended
	  partitions.  This should be shared by all disk drivers.  Swap
	  to a DOS partition so that the swap space can be shared with
	  linux.
	o Don't use polling except for initialization.  Need to
	  reorganise the state machine.  Then "extra" interrupts
	  shouldn't happen (except maybe one for initialization).
	o Fix disklabel, boot and driver inconsistencies with
	  bad144 in standard versions.
	o Look at latest linux clustering methods.  Our disksort()
	  gets in the way of clustering.
	o cleaned up the ATA changes (needs more work.  I think
	  the ATA specs say that the only thing really wrong with
	  the original version of wx is that there was no test
	  for drive-ready before some commands.  400 nsec delay
	  suffices for almost everything and 400 nsec delay is
	  usually "free").
1994-02-01 05:55:21 +00:00
Rodney W. Grimes
a8e9d1d5b7 Increased TIMEOUT in wdwait from 2000 to 20000 since it seems many people
have needed to do this in order for the wd driver to work for them.
1994-01-22 11:00:01 +00:00
Nate Williams
af60ea293c When a probe fails print a 'not found' line instead of nothing 1994-01-08 00:00:52 +00:00
Nate Williams
12da8ccb6e Whoops, I committed an older version that didn't have some warnings fixed.
This version fixes all warnings given the default compiler flags with some
casts.
1994-01-04 20:20:38 +00:00
Nate Williams
4aba964ef1 New wd driver, based on Bruce Evans 'wx/altwd' driver which has passed
enough tests to be considered more stable than current driver.

Lots of work by Bruce, David G., and Guido have gone into this version, and
more is to come in the future.

Support for multiple controllers is in, but doesn't work correctly with
different controllers (IDE AND MFM), but multiple alike controllers appears
to work.

Most of the stray interrupts problems should be fixed, although you will
get a couple 'extra interrupts' when disklabeling and on startup.
1994-01-04 20:05:26 +00:00
Garrett Wollman
aaf08d94ca Make everything compile with -Wtraditional. Make it easier to distribute
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.
1993-12-19 00:55:01 +00:00
Garrett Wollman
381fe1aaf4 Make the LINT kernel compile with -W -Wreturn-type -Wcomment -Werror, and
add same (sans -Werror) to Makefile for future compilations.
1993-11-25 01:38:01 +00:00
Nate Williams
997e3029c9 Subject: Panic - can't mount route (Soren's changes)
From: Geoff Rehmet  <g89r4222@braae.ru.ac.za>

Description:
	On bootup, probe of wd drives fails (CP30104), and kernel panics
	- cannot mount root
	It appears that the device probe just times out.
	Increasing the timeout back to its old value fixes the problem.
Repeat-By:
	SUP FreBSD-current,  Find a CP30104 .....  (ok ok ok)
	Basically - Soren's changes barf my disk.
1993-11-23 21:36:37 +00:00
Nate Williams
1b0b2339ce Stop gap measure until we can get Bruce's driver debugged.
---
From: sos@login.dkuug.dk (S|ren Schmidt)
Subject: IDE-disk hangs - solution/patches NetBSD/FreeBSD
Summary: fixes for lost interrupts with IDE disks
Keywords: hanging-disk, IDE-disk, lost-interrupt


Due to "popular" demand I'm posting these patches to NetBSD/FreeBSD
instead of mailing them around the world :-)

As many have found out there is a problem when using IDE disks on
FreeBSD. Following is a patch that fixes the problem with lost intterrupts.
Both fixes is based on a patch posted here some month ago by
Stefan Behrens?? (sorry I've lost the original article). But anyway it
works (for me :-).
Basically it does a timeout on lost interrupts, starting the operation
again and logging and error message on the console.

It additionally makes the allready present while loop timeouts
independent of CPU speed, and adds minor numbers for easy access to
dos partitions.
1993-11-22 23:25:46 +00:00
David Greenman
d333677271 added 5us delay before checking BUSY flag to conform to ATA spec -
as suggested by John Dyson (dyson@implode.rain.com)
1993-11-19 06:30:00 +00:00
Rodney W. Grimes
57bb0ee45f New version of scsi code from Julian 1993-11-18 05:03:27 +00:00
Garrett Wollman
35089dd415 Fixed comments that start within a comment, so code compiles cleanly with
-Wcomment.
1993-11-17 23:25:28 +00:00
Rodney W. Grimes
6f78ca6026 Removed all patch kit headers, sccsid and rcsid strings, put $Id$ in, some
minor cleanup.  Added $Id$ to files that did not have any version info, etc
1993-10-16 13:48:52 +00:00
Rodney W. Grimes
d2f07716e2 >From: "Andrew A. Chernov, Black Mage" <ache@astral.msk.su>
Date: Wed, 29 Sep 1993 01:54:53 +0300

To bring this error try to make two swap partitons on one disk:
one of the partitions will be not recognized.
Fix is simple: set uninitialized val variable.
1993-09-29 01:11:19 +00:00
Rodney W. Grimes
0ad99dbc30 Reverting wd driver back to version before Bruces new driver until the
many bugs can be worked out of it...
1993-09-07 02:08:51 +00:00
Rodney W. Grimes
5c954fb68d Removed patch kit header, added $Id$
Increased timeout in wdwait from 1000 to 2000, this makes the st157A's
at least pass the probe routines :-)
1993-09-06 17:41:46 +00:00
Rodney W. Grimes
cfd895c81e Date: Fri, 3 Sep 93 01:25:44 +1000
From: bde@kralizec.zeta.org.au (Bruce Evans)

This fixes several problems.

It has almost everything that is in the FreeBSD version of Aug 22.
It is missing the bug for 2 drives and still prints <> around the
drive type.  It handles BADEND144 less verbosely.  It does wdgetctlr()
somewhat differently from NetBSD/FreeBSD.

Date: Sun Sep  5 06:45:12 PDT 1993
From: rgrimes@cdrom.com

Fixed printf's to be correct, since Bruce used the old ones.  This driver
still prints phantom wd1's on some Maxtor and other IDE drives, I have
a patch I am sending to Bruce for checking.
1993-09-05 13:46:17 +00:00
Rodney W. Grimes
89bc97311a xxxprobe now returns the correct number of I/O registers used so that
the probe output during boot gives the I/O range instead of just the
starting address
1993-08-28 03:02:52 +00:00
Rodney W. Grimes
905ee1678d Fix so that unit number 1 is found again. 1993-08-24 19:41:58 +00:00
Rodney W. Grimes
0f5b6b9987 Fixed for DQFLQUIET flag from: Terry Lee <terry@uivlsisd.csl.uiuc.edu>
I submitted the part of patch00155 that fixes wd.c not reporting any
bad blocks.  Unfortunately, the patch created a new problem that makes new
installations using that kernel impossible.  I have included a patch below that
should fix both problems.  The fix comes from Tom Ivar Helbekkmo's wd driver
(the Norway wd driver).  I've also eliminated the use of the DKFL_QUIET flag
completely, since it is not used anymore.

Fixed wdgetctrl routines for so that it returns a meaniful string for
non IDE disk drives.  It also nolonger returns success when a drive is
not really there.
1993-08-08 07:03:21 +00:00
David Greenman
2a6c898016 Modified attach printf's so that the output is compatible with the "new"
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.
1993-07-15 17:53:14 +00:00
Paul Richards
7c434002a4 Upgrade to GCC 2.X 1993-06-18 02:47:24 +00:00
Rodney W. Grimes
5b81b6b301 Initial import, 0.1 + pk 0.2.4-B1 1993-06-12 14:58:17 +00:00