Commit Graph

168 Commits

Author SHA1 Message Date
Søren Schmidt
0d611a6c29 Cleanup sweep. 2000-03-13 12:27:11 +00:00
Søren Schmidt
cfb21bbb7d Enable disksort the right way both on ATA disks and ATAPI devices. 2000-03-13 12:04:58 +00:00
Søren Schmidt
8048917432 Backout the previous fix, it is _not_ that easy too fix.
Leave it as is for 4.0 the real solution comes later.
2000-03-13 09:10:25 +00:00
Søren Schmidt
4c435787ab Dont call ad_start unless the controller is idle.
This effectively nullified the usefullness of disksort().
2000-03-12 13:56:05 +00:00
Søren Schmidt
924f6734a5 Cosmetics.. 2000-03-10 22:10:34 +00:00
Søren Schmidt
643b70ec9d Dont call make_dev until we are sure the device is there, this prevents
panic'ing when the device is tried accessed later.
2000-03-10 08:09:53 +00:00
Søren Schmidt
aaa29cf209 Fix the CD driver so that the last blocks can be read even if
a blocksize != 2k is used.
Update the timeout code to try fallback to PIO if problems
arise in DMA mode.
2000-03-05 16:52:26 +00:00
Søren Schmidt
b744c0fdc6 Spell construct right. 2000-03-01 14:39:51 +00:00
Søren Schmidt
7caf73fb3c Add DVD-RAM support.
The driver constructs a fake disklabel that makes the 'a' partition
cover the entire DVD-RAM disk. This cannot be changed from the user
side. This solution was chosen because most DVD-RAM will have a
UDF (or until we have that CD9660) filesystem on it covering the
entire disk, its not really thought as a real random access device.

This might change over time, but for now this is what we have, and
it is compatible with CDROM's etc, that makes using the minidisk
subsystem less than ideal, because of !modulo BDEV_SIZE blocks.
2000-02-29 22:00:53 +00:00
Søren Schmidt
41ef40c93d Only read user data when blocksize != 2048, this "read the works"
sneaked in sometime which is not what the average user wants.
2000-02-29 16:11:18 +00:00
Søren Schmidt
cb66e8d4e3 Fix the problem that caused the boot to fail when modules were loaded.
Real braino, confuses two different softc types, I wonder how this
could ever work :(
2000-02-27 12:41:07 +00:00
Søren Schmidt
1a488af60f Add (partial) support for the Cypress ATA controller.
Call intr_teardown on detach.

Always add non masterdevice from unit 2 upwards.

Update to the pccard code, at least some cards are now working,
more testing to follow.
2000-02-25 09:48:23 +00:00
Søren Schmidt
9bd1c89ad3 Add UDMA66 support to the Intel ICH chip.
Submitted by: sakichan@lares.dti.ne.jp
2000-02-22 20:37:01 +00:00
Søren Schmidt
456b5ad253 Fix the changer code, dont wait for device ready on unload, it
wont become ready as there is no media - doh.

Update the command name reporting.
2000-02-21 18:41:05 +00:00
Søren Schmidt
47351d2774 Update the ata driver to take more advantage of newbus, this
was needed to make attach/detach of devices work, which is
needed for the PCCARD support.
(PCCARD support is still not working though, more to come on that)

Support the CMD646 chip which is used on many alphas, sadly only
in WDMA2 mode, as the silicon is broken beyond belief for UDMA modes.

Lots of cosmetic fixes here and there.

Sorry for the size of this megapatchfromhell but it was not
possible otherwise...

newbus patches based on work from: dfr (Doug Rabson)
2000-02-18 20:57:33 +00:00
Søren Schmidt
32c3d17908 That "NO DRIVER" panic fix wasn't good enough... 2000-02-11 07:37:00 +00:00
Søren Schmidt
1af69d6936 Probe cosmetics. 2000-02-08 18:38:39 +00:00
Søren Schmidt
cc8baa1136 The bde script has a bug, I used a patch from it verbatim, bad idea....
Fixed...
2000-02-08 16:39:11 +00:00
Søren Schmidt
e8359a57de Do refcounting of open devices (more) correctly.
count_dev funtion by phk.
2000-02-07 23:05:40 +00:00
Søren Schmidt
a9ec39136b Dont panic if no sub-driver is found. 2000-02-07 22:57:11 +00:00
Søren Schmidt
77145a3388 Unbreak addump, now dumping works again. 2000-02-07 22:56:32 +00:00
Søren Schmidt
96ebd6d1fc fix support for shared IRQ's.
fix support for multiple HPT & Promise controllers.

support mixed 33/66 devices on the Promise 66 controllers.

fix the refcount stuff in the atapi drivers.

misc cleanups.
2000-02-04 10:20:22 +00:00
Søren Schmidt
4de1cbfab9 cosmetic changes only. 2000-01-29 22:38:36 +00:00
Søren Schmidt
eff43d0e8a cosmetic changes only. 2000-01-29 14:10:59 +00:00
Søren Schmidt
a4fec20898 Get the MEDIA_CHANGED status right here too. 2000-01-28 22:17:29 +00:00
Søren Schmidt
211a760057 Use atapi_test_ready not atapi_wait_ready, I need more sleep :( 2000-01-28 21:30:31 +00:00
Søren Schmidt
78e0324341 Get the MEDIA_CHANGED status right. 2000-01-28 21:03:25 +00:00
Søren Schmidt
0b905b407e Fix the atapi-fd.c (afd device) so that fx MSDOS formatted ZIP
disks can be mounted. Use b_pblkno instead of b_blkno

Found by: phk

Protect (proberly) against setting modes on nonexisting devices.
2000-01-28 20:18:19 +00:00
Søren Schmidt
96478887ff Fix compilation on ISA only setups... 2000-01-28 15:57:13 +00:00
Søren Schmidt
02ce0452e1 Cleanup the ata_dmainit function a bit.
Also allow BIOS setup DMA on unknown controllers.
2000-01-28 13:35:43 +00:00
Søren Schmidt
6a7f51845b Oops, fix compile error due to the new way of storing the transfer mode. 2000-01-28 08:03:21 +00:00
Søren Schmidt
0fd4327bb6 Add sysctl oid hw.atamodes to set the transfermodes online. 2000-01-27 19:00:51 +00:00
Søren Schmidt
0817db9f98 Retry a bit more agressively on the atapi identify.
Try to support older systems reporting irq0 for the first channels.

Support sharing of the std interrupts (says peter :) )

Dont use READ_CD on normal data reads (2048 bytes), too many old drives
doesn't support this command even if the std says "shall" :(, but still
use READ_CD on all other blocksizes.

Add the geometry to the ad probe, its still usefull.
2000-01-25 20:14:51 +00:00
Søren Schmidt
fe08efdcfb General cleanup.
Dont be so verbose in the probe, only ONE line printed now, to get more
info boot verbose. Centralise most printf's in ata-all & ata-dma to use
the ata_printf function, it saves alot of codelines.

Repeat the identify command if drive fails the first.

Protect the timeout functions with splbio.

Dont update the transfer details before we are sure the transfer
succeded, this way they are proberly retried on errors.

Move the handling of next_writeable to userland.

Use the READ_CD command to read CD's. That enables us to read _anything_
via the normal read/write interface. This kindof obsoletes the READAUDIO
ioctl, but we keep that for now.
2000-01-24 20:45:24 +00:00
Søren Schmidt
6e5d660a63 Quantify the calls to ad_attach and atapi_attach so that diskless
or atapiless kernels can be built.
2000-01-19 07:25:46 +00:00
Søren Schmidt
974f34013a Rearrange the probecode, so that 80pin cables can be identified
correctly on both master and slave.
Smash together the ata_params & atapi_params structures as they
are more or less equal anyways.
Get rid of the last SYSINIT's in here.
2000-01-18 21:02:59 +00:00
Søren Schmidt
46a37dbac0 Add support for the Intel 810 chipset (ICH type of chips)
Prober support for the VIA 82C686, I finally got the right datasheet.

Get rid of atapi_wait, merge it into ata_wait.

Avoid a couple of races by using asleep instead of tsleep.

Always use 16bit transfers on ISA systems.

Clear up the atapi_read/write functions.
2000-01-17 02:04:19 +00:00
Søren Schmidt
9687efec89 Grrrr, this time it should be right, I need sleep - badly... 2000-01-07 15:51:45 +00:00
Søren Schmidt
39412a7ece This is not my lucky day :( 2000-01-07 13:15:42 +00:00
Søren Schmidt
af86437301 Guard against transfers of zero length given to *strategy. 2000-01-07 12:01:01 +00:00
Søren Schmidt
e960abaf96 Set PIO mode in all cases. 2000-01-07 08:28:41 +00:00
Søren Schmidt
14c2c6c8b1 New ATAPI burner utility API, replaces the wormio API. 2000-01-06 22:50:02 +00:00
Søren Schmidt
14fc459ef4 Fix link problem on ISA only systems.. 2000-01-03 20:01:18 +00:00
Søren Schmidt
aa966b9a64 Add support for VIA 82C596 controller
Better shared irq handeling for Promise & HPT366 controllers

Setup prober PIO mode timings on Promise & HPT366 controllers

Update Copyright headers to be Y2K compliant :)
2000-01-03 10:26:59 +00:00
Søren Schmidt
3ace5ae2c8 Yet another cleanup of the VIA code, this time it should work
on all combinations (I hope)...

Add DMA support for the AMD 756 chip (K7 chipset) this is actually the
same as the VIA 82C686 chip (the ATA part that is).

Treat the intel MX chipset PIIX as a PIIX4

Allow UDMA on all disks that say they can handle it.

Cleanup probe printf's a bit

Remove alot of the old #ifdef DEBUG crap.
1999-12-21 20:18:56 +00:00
Søren Schmidt
6be090b840 Relax the requirements for doing WDMA2, this should enable DMA
on non ATA[234] compliant disks.

Move all PCI dependent stuff under #ifdef NPCI > 0
1999-12-18 20:06:30 +00:00
Søren Schmidt
7d9451f143 Cleanup the probe messages a bit, show what the device really is, not
just "CDROM". Also cope with devices that doesn't report speed in
the old way, this should be changed into the new GET_PERFORMANCE
cmd instead..
1999-12-16 08:22:16 +00:00
Søren Schmidt
dbdfe960cb Have another go at the VIA support, this time use the PCI ID form the
main component in the southbridge chip to determine which VIA chip
we are dealing with.

Try to enable DMA on generic controllers that say they has the
capability, instead of relying on the BIOS to have set it up.
1999-12-14 10:25:28 +00:00
Søren Schmidt
54ecff8b84 Add DMA support for the SiS 5591 and old PIIX chipsets.
Add a missing DELAY(1) in ata_wait.

Change the info from ad_version, so the ATA version from the disk can
be used to quantify the DAM modes valid for this drive, ie be more
selective with turning DMA on on older disks that should not support it..

Fix the probe for BIOS enabled DMA in the generic case, master/slave
was reversed in the test.

Check the return for ata_command in all cases, and print warnings if
it fails.

Call ata_dmainit with all dmamodes off when falling back to PIO mode,
that should take care of both the Promise & HPT366 controllers not
being able to handle the fallback...

Cleanup the printf's in the drivers, use the prober device name (if
possible) instead of ataN-master/slave.
1999-12-13 10:19:39 +00:00
Søren Schmidt
fed48464cc Change the devstat priorities to the std values now in devicestats.h 1999-12-08 12:08:47 +00:00
Søren Schmidt
cb2a8dffa0 Commit the kernel part of our DVD support. Nothing much to say really,
its just a number of new ioctl's, the rest is done in userland.
1999-12-07 22:25:28 +00:00
Søren Schmidt
bd533091af Try a little harder at the VIA DMA support.
Only use UDMA66 on 82C686 and with prober cable.
1999-12-07 22:07:18 +00:00
Søren Schmidt
7420fbaac2 Fix support for disk with > 64K cyls. 1999-12-07 14:49:00 +00:00
Søren Schmidt
60c94e7628 Better error handeling:
On UDMA CRC errors retry operation as it might be a fluke, if not fall
back to PIO mode on the failing drive. If you get alot of these your
cabeling is most likely not good enough.

On HARD error using DMA, retry once using PIO, if it succeds using PIO
fall back to PIO mode on the failing drive.
1999-11-29 12:24:51 +00:00
Søren Schmidt
ad6eb979ba call ata_reinit in addump trying to make sure the dump will succed,
also check for errors underways, and make it possible to abort the
dump by hitting a key.
1999-11-27 17:06:10 +00:00
Søren Schmidt
7dfec6b427 Oops, committed the wrong file.. 1999-11-26 20:05:11 +00:00
Søren Schmidt
30f5b2a68e Fix atapi_wait_ready, it returned prematurely.
Less verbosity on non-fatal errors.
1999-11-26 19:26:04 +00:00
Søren Schmidt
a150cc4284 Tidy up the VIA support a bit, make it more generic. 1999-11-26 19:24:26 +00:00
Søren Schmidt
3082a6dc59 Add DMA support for the VIA 82C586 & 82C686 chips, also rearrange
to fall back to slower speeds if the faster ones fails to probe.

Log and retry request on UDMA CRC errors.

Fix a couple of warnings.
1999-11-24 21:40:05 +00:00
Søren Schmidt
bb8f8c633e Loose ad_sleep, its of no use anymore. 1999-11-19 08:21:15 +00:00
Søren Schmidt
5c7e184349 Dont listen to disks that say they can only do 0 sector transfers. 1999-11-10 19:37:00 +00:00
Søren Schmidt
6e82e8be6d Make the atapi device return sensible errno's back to userland.
Dont panic if a nonexistant device is opened.
1999-11-10 07:13:51 +00:00
Søren Schmidt
838b8e23b9 Unbreak ATAPI on the Aladdin chipset, only DMA access worked.
Try to use a 32bit mask on the IO addresses, this fixes the alpha
and hopefully doesn't break on any i386 machines.

Try to enable both read & write cache on disks, they should be as
default, but better be sure..
1999-11-08 21:36:00 +00:00
Søren Schmidt
3de25e2f32 Fix IRQ allocation bug on controllers using a shared interrupt.
Fix a bug which could cause panics in ad/atapi-interrupt.

Add support for UDMA66 on Promise Ultra/Fasttrak controllers.

Get rid of ATA_IGNORE_INTR, and introduce ATA_WAIT_INTR instead.

Add a delay in the dump routine in ata-disk.c, some controllers
seem to need this. Also dont use the timeout watchdog when dumping.

Disable DMA on ATAPI devices as default, add option ATA_ENABLE_ATAPI_DMA
for those that has HW that works.

Add support for some not-up-to-spec ATAPI devices that returns data
together with completition status on data moving cmd's.
1999-11-06 16:50:21 +00:00
Poul-Henning Kamp
923502ff91 useracc() the prequel:
Merge the contents (less some trivial bordering the silly comments)
of <vm/vm_prot.h> and <vm/vm_inherit.h> into <vm/vm.h>.  This puts
the #defines for the vm_inherit_t and vm_prot_t types next to their
typedefs.

This paves the road for the commit to follow shortly: change
useracc() to use VM_PROT_{READ|WRITE} rather than B_{READ|WRITE}
as argument.
1999-10-29 18:09:36 +00:00
Andrew Gallatin
ca4e37e1cf Increase the timeout to be 3*hz. This recalibrates the timeout so that
it has the same value on all platforms.  Previously it was just under
3 seconds on x86 (typically hz<=128) and just under 1/3 of a second on
alpha (typically hz>=1024).  This covers up a race between ad_interrupt()
and ad_timeout() which is being looked into.

reviewd by: sos
1999-10-18 17:55:38 +00:00
Doug Rabson
d8517c5437 Relax the check for class=storage, subclass=ide to just class=storage.
This allows ata to probe correctly for the HPT366 on Abit's BP6.
1999-10-16 09:00:49 +00:00
Doug Rabson
81f4abc9c1 Don't match non-IDE devices in probe.
Reviewed by: sos
1999-10-13 18:56:49 +00:00
Søren Schmidt
205a52de79 Fix a bug in the isa attach code which would panic isa systems. 1999-10-11 11:04:43 +00:00
Søren Schmidt
31694ea9b0 Remove unused include files.
Submitted by: phk
1999-10-10 18:08:40 +00:00
Søren Schmidt
2b0a1c086d Add support for the HPT366 chip, this is used on the Abit boards and
their HotRod controller and on SIIG PCI ultra DMA controller. These
changes also made lots of the Promise code go away, its all much more
generic this way.

Get rid of atapi_immed_cmd, instead use the queue to move atapi commands
from interrupt context if nessesary, the entire atapi layer has
gotten an overhaul.

Lots of fixes to utililize the new features in subr_disk.c etc, and
get rid of the last biots of softc arrays in the drivers, the
only one left is atadevices which cannot easily go away (yet).

Use our own malloc names, its a lot easier to track memory usage this way.

General cleanup overall.
1999-10-09 19:57:13 +00:00
Mike Smith
5c0b893d05 Be much more selective in claiming devices that might be IDE controllers.
The old algorithm was:

 if class == storage and subclass != SCSI device must be IDE

This results in claiming 'raid' and 'other' storage devices as IDE,
which is typically not the case.

Reviewed by:	sos
1999-10-07 02:17:21 +00:00
Nick Hibma
3e2c6ca3b9 Removal of sys/device.h
- Move intrhook stuff into kernel.h
- Remove all occurrences of #device <device.h>
- Add kernel.h were necessary (nowhere)
- delete device.h

This file contained the structures for cfdata (old style config) and is no
longer used. It was included by most drivers.

It confuses the remote debugger as the definition of 'struct device' in
device.h is found before the one in bus_private.h.
1999-10-05 21:19:41 +00:00
Bruce Evans
503e666658 Fixed "misspelling" of bcmp as memcmp. memcmp doesn't exist in the
kernel, but gcc provides a pessimal builtin for it.

Makefile.i386:
Added a variable (CONF_CFLAGS) for configuration-specific compiler flags.

LINT:
Use CONF_CFLAGS to inhibit use of gcc builtins.
1999-10-03 07:09:31 +00:00
Peter Wemm
fe49e6c57c Use the sys/wormio.h definitions of the CDRIOCNEXTWRITEABLEADDR and
CDRIOCBLANK ioctls rather than duplicating them.
1999-10-01 14:14:20 +00:00
Poul-Henning Kamp
d6a0e38a1b Remove five now unused fields from struct cdevsw. They should never
have been there in the first place.  A GENERIC kernel shrinks almost 1k.

Add a slightly different safetybelt under nostop for tty drivers.

Add some missing FreeBSD tags
1999-09-25 18:24:47 +00:00
Søren Schmidt
27fceb7416 Fix timeout handeling and add retry counts.
Add HPT366 probe message (but no real support yet),
Add CDR support for several diffenrent blocktypes, also close
disk as a multisession CD.
1999-09-24 12:36:10 +00:00
Søren Schmidt
fbf6ea790a Support quad & max speeds in wormcontrol.
A bit more general cleanup.
1999-09-22 12:04:51 +00:00
Søren Schmidt
0720c0ebbe I knew it, I introduced new bugs :)
The lun is not incremented in the ata-disk driver when ATA_STATIC_ID
is not defined, thanks to Kenneth Wayne Culver <culverk@wam.umd.edu>
for finding that one.

PHK pointed at the & problem in atapi-cd in devstat_end_transaction_buf.

Too little sleep I guess...
1999-09-22 07:15:46 +00:00
Søren Schmidt
3427651043 Ten'th update to the new ATA/ATAPI driver:
It been awhile since the last major update, as a benefit there
are some cool things in this one (and new bugs probably :) )...

The ATA driver has grown "real" timeout support for all devices.
This means that it should be possible to get in contact with
(especially) lost ATAPI devices. It also means that the ATA
driver is now usable on notebooks as it will DTRT on resume.

An experimental hack at utilizing the Promise66's at UDMA66 is
in there, but I cant test it. If someone feels like sending
me one, give me a ping.

The ATAPI DMA enableling scheme has been changed, also better DMA
support for the Aladdin chipset has been implemented for ATAPI
devices. Note that the Aladdin apparently only can do DMA reads
on ATAPI devices, and the Promise cant do ATAPI DMA at all.
I have seen problems on some ATAPI devices that should be able
to run in DMA mode, so if you encounter problems with hanging
atapi devices during the probe, or during access, disable DMA
in atapi-all.c, and let me know. It might be nessesary to do this
via a "white list" for known good devices...

The ATAPI CDROM driver can now use eject/close without hanging and
the bug that caused reading beyond the end of a CD has been fixed.
Media change is also handled proberly. DVD drives are identified
and are usable as CDROM devices at least, I dont have the HW to
test this further, see above :).

The ATAPI tape driver has gotten some support for using the DSC
method for not blocking the IDE channel during read/write when
the device has full buffers. It knows about the OnStream DI-30
device, support is not completed yet, but it can function as a
primitive backup medium, without filemarks, and without bad media
handeling. This is because the OnStream device doesn't handle this
(like everybody else) in HW. It also now supports getting/setting
the record position on devices that supports it.

Some rather major cleanups and rearrangements as well (cvs -b diff
is your freind). I'm closing in on declaring this for beta code,
most of the infrastruture is in place by now.

As usual USE AT YOUR OWN RISK!!, this is still alpha level code.
This driver can hose your disk real bad if anything goes wrong, but
now you have been warned :)

But please tell me how it works for you!

Enjoy!

-Søren
1999-09-21 19:50:40 +00:00
Poul-Henning Kamp
2186cd9e8d Use devstat_end_transaction_buf() rather than Use devstat_end_transaction() 1999-09-18 21:30:27 +00:00
Poul-Henning Kamp
2016e4e906 Bite the bullet and allocate the devsw entry at compile time. 1999-09-12 20:40:29 +00:00
Poul-Henning Kamp
8072a14e83 Don't register a bmajor.
Approved by:	sos
1999-09-08 18:45:52 +00:00
Poul-Henning Kamp
9e33123898 nullclose, not noclose of course. 1999-09-05 15:41:09 +00:00
Poul-Henning Kamp
9c48bdd348 Use micro "disk" layer in ata-disk
Reviewed by:	sos
1999-09-03 10:57:17 +00:00
Poul-Henning Kamp
a2f21fdc51 Set si_bsize_phys to 2048 for cdrom.
Reviewed by:	sos
1999-09-03 10:56:27 +00:00
Doug Rabson
4249382df0 This represents essentially a complete rewrite of the ISA PnP code. The
new system is integrated with the ISA bus code more cleanly and allows
the future addition of more enumerators such as PnPBIOS and ACPI.

This commit also enables the new pcm driver since it is somewhat tied to
the new PnP code.
1999-09-01 20:53:43 +00:00
Poul-Henning Kamp
10af1a2b5f We don't need to pass the diskname argument all over the diskslice/label
code, we can find the name from any convenient dev_t
1999-08-28 14:33:44 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Poul-Henning Kamp
9dcbe2404a Convert DEVFS hooks in (most) drivers to make_dev().
Diskslice/label code not yet handled.

Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers)

Add the correct hook for devfs to kern_conf.c

The net result of this excercise is that a lot less files depends on DEVFS,
and devtoname() gets more sensible output in many cases.

A few drivers had minor additional cleanups performed relating to cdevsw
registration.

A few drivers don't register a cdevsw{} anymore, but only use make_dev().
1999-08-23 20:59:21 +00:00
Poul-Henning Kamp
49ff4debd3 Spring cleaning around strategy and disklabels/slices:
Introduce BUF_STRATEGY(struct buf *, int flag) macro, and use it throughout.
please see comment in sys/conf.h about the flag argument.

Remove strategy argument from all the diskslice/label/bad144
implementations, it should be found from the dev_t.

Remove bogus and unused strategy1 routines.

Remove open/close arguments from dssize().  Pick them up from dev_t.

Remove unused and unfinished setgeom support from diskslice/label/bad144 code.
1999-08-14 11:40:51 +00:00
Søren Schmidt
f63c7e582a Support DMA on ATAPI devices (finally).
This makes my system use only ~5% CPU on reading 4.5Mbyte/sec
from a CDROM, which before was limitted to 1.8Mbyte/sec due
to 100% CPU load..
1999-08-10 21:59:58 +00:00
Søren Schmidt
2203dc0030 Add limitted support for the Promise Ultra/66 controller. Its
only supported upto UDMA33 like the old Promise, but it works
now. More when I have specs ....
1999-08-06 17:39:38 +00:00
Poul-Henning Kamp
835646d6ef slight change in the way we hi-jack the wd drivers cdevsw. 1999-07-17 17:55:53 +00:00
Søren Schmidt
c4217f94eb Nine'th update to the new ATA/ATAPI driver:
The atapi subsystem has gotten better error handeling and timeouts,
it also tries a REQUEST SENSE command when devices returns errors,
to give a little more info as to what went wrong. It might be a
little verbose for now, but I'm interested in as much feedback on
errors as possible, especially timeouts, as I'm a bit in doubt if
I've chosen resonable default values everywhere.

The disk driver has been changed a bit to prepare for tagged queing,
which is next on my list.

The disk driver has grown a dump routine, I got one implementation
from Darrell Anderson <anderson@cs.duke.edu> which also did
partial dumps (usefull on big memory machines) I left out the
partial stuff for now, and changed the rest alot to fit into the new
ad_request framework.

Some minor cleanups and rearrangements as well.

As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, again you have been warned :)
Notebook owners should be carefull that their machines dont suspend
as this might cause trouble...

But please tell me how it works for you!

Enjoy!

-Søren
1999-06-25 09:03:07 +00:00
Poul-Henning Kamp
2447bec829 Simplify cdevsw registration.
The cdevsw_add() function now finds the major number(s) in the
struct cdevsw passed to it.  cdevsw_add_generic() is no longer
needed, cdevsw_add() does the same thing.

cdevsw_add() will print an message if the d_maj field looks bogus.

Remove nblkdev and nchrdev variables.  Most places they were used
bogusly.  Instead check a dev_t for validity by seeing if devsw()
or bdevsw() returns NULL.

Move bdevsw() and devsw() functions to kern/kern_conf.c

Bump __FreeBSD_version to 400006

This commit removes:
        72 bogus makedev() calls
        26 bogus SYSINIT functions

if_xe.c bogusly accessed cdevsw[], author/maintainer please fix.

I4b and vinum not changed.  Patches emailed to authors.  LINT
probably broken until they catch up.
1999-05-31 11:29:30 +00:00
Poul-Henning Kamp
4e2f199e0c This commit should be a extensive NO-OP:
Reformat and initialize correctly all "struct cdevsw".

        Initialize the d_maj and d_bmaj fields.

        The d_reset field was not removed, although it is never used.

I used a program to do most of this, so all the files now use the
same consistent format.  Please keep it that way.

Vinum and i4b not modified, patches emailed to respective authors.
1999-05-30 16:53:49 +00:00
Andrew Gallatin
50b8d1cce4 Allow chipset drivers to specify the direct-mapped DMA window's mask in
preparation for tsunami support.  Previous chipsets' direct-mapped DMA
mask was always 1024*1024*1024.  The Tsunami chipset needs it to be
2*1024*1024*1024

These changes should not affect the i386 port

Reviewed by:	Doug Rabson <dfr@nlsystems.com>
1999-05-26 23:01:57 +00:00
Søren Schmidt
dc82ab74e3 Eigth update to the new ATA/ATAPI driver:
Fixed problems:

    LS120/ZIP drives still currupted data.
	Reworked once again, buffered I/O is just ignoring any sizehints
	it is given :(
	Now the atapifd driver splits up requests for devices that has
	limitted transfer size.

    ISA only configs fails on boot with interrupt timeouts.
	The new-bus integration introduced a bug where the softc ptr
	was lost during the probe.

Some minor cleanups and rearrangements as well.

As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, again you have been warned :)
Notebook owners should be carefull that their machines dont suspend
as this might cause trouble...

But please tell me how it works for you!

Enjoy!
1999-05-20 09:12:06 +00:00
Søren Schmidt
b5bb732345 Seventh update to the new ATA/ATAPI driver:
Fixed problems:

    LS120 drives currupted data.
	The workaround for drives not supporting upto 64K transfers
	has been reworked. It works now both on LS120 & ZIP drives.

    ISA only configs wont compile.
	Fixed.

    The ATA driver wont share interrupts.
	Fixed.

    The "unwanted interrupt" warning gave wrong controller.
	Another lun<>unit messup from the newbus integration.

Some minor cleanups and rearrangements as well.

As usual USE AT YOUR OWN RISK!!, this is still pre alpha level code.
Especially the DMA support can hose your disk real bad if anything
goes wrong, again you have been warned :)
Notebook owners should be carefull that their machines dont suspend
as this might cause trouble...

But please tell me how it works for you!

Enjoy!

-Søren
1999-05-17 15:58:47 +00:00