Commit Graph

193 Commits

Author SHA1 Message Date
Søren Schmidt
82681884cf Restore transfermode on devices after reinit. 2003-10-10 11:03:27 +00:00
Søren Schmidt
6235c1f6ae Dont store ata_params for devices that return a bogus ident string. 2003-10-10 11:00:06 +00:00
Søren Schmidt
e203a01fad In case we loose a device during reset in reinit() finish off
the request with error instead of loosing it.
2003-10-07 13:44:15 +00:00
Poul-Henning Kamp
70cd771337 The present defaults for the open and close for device drivers which
provide no methods does not make any sense, and is not used by any
driver.

It is a pretty hard to come up with even a theoretical concept of
a device driver which would always fail open and close with ENODEV.

Change the defaults to be nullopen() and nullclose() which simply
does nothing.

Remove explicit initializations to these from the drivers which
already used them.
2003-09-27 12:01:01 +00:00
Søren Schmidt
9855ae3844 Update the PIO mode gathering code.
Reported by: bde
2003-09-08 08:30:43 +00:00
Søren Schmidt
7c78880561 Rearrange the probe code yet again. 2003-09-01 11:13:21 +00:00
Søren Schmidt
61f07fc6ca Return the translated result code from ATA/ATAPI commands. 2003-08-27 15:27:56 +00:00
Søren Schmidt
9f06a4277f Unify prototypes.
Cosmetics.
2003-08-25 09:01:49 +00:00
Søren Schmidt
ea01d56917 Only call FLUSH_CACHE on devices that say they can.
This will get rid of the warnings issued at shutdown (that seems to
worry alot of users), but will also no flush cache on lots of
devices that can, but doesn't set the right support bits...
2003-08-25 07:59:50 +00:00
David E. O'Brien
aad970f1fe Use __FBSDID().
Also some minor style cleanups.
2003-08-24 17:55:58 +00:00
Søren Schmidt
5fdbb0d222 This is a major rework of the ATA driver (ATAng)
Restructure the way ATA/ATAPI commands are processed, use a common
ata_request structure for both. This centralises the way requests
are handled so locking is much easier to handle.

The driver is now layered much more cleanly to seperate the lowlevel
HW access so it can be tailored to specific controllers without touching
the upper layers. This is needed to support some of the newer
semi-intelligent ATA controllers showing up.

The top level drivers (disk, ATAPI devices) are more or less still
the same with just corrections to use the new interface.

Pull ATA out from under Gaint now that locking can be done in a sane way.

Add support for a the National Geode SC1100. Thanks to Soekris engineering
for sponsoring a Soekris 4801 to make this support.

Fixed alot of small bugs in the chipset code for various chips now
we are around in that corner anyways.
2003-08-24 09:22:26 +00:00
Søren Schmidt
27409aa046 Add string for SATA150
Approved by: re
2003-05-18 16:43:08 +00:00
Søren Schmidt
9c51ecf436 Grap the ATA lock on all channels before suspend, this makes certain
that we have no outstanding ops in transit, which would cause problems
on resume.
2003-05-04 09:34:14 +00:00
Søren Schmidt
7af89aab59 Fix locking on reinit. 2003-05-03 18:28:43 +00:00
Søren Schmidt
93f307bbea Add flushing of devices on shutdown.
Note: this might print failure messages on some systems, unfortunatly
the info from the device, stating if flushing is supported, cannot be trusted
so the operation is always issued on all devices, just in case...
2003-05-02 13:47:44 +00:00
Søren Schmidt
31de970e72 Add ioctl to add a spare disk to a RAID array.
Fix the discovery of RAID's to not grap unused disks.
Change the probe printing of a RAID a bit.
2003-05-02 12:41:44 +00:00
Søren Schmidt
1b39bd2412 Third round of updates to the ATA driver.
More DMA cleanups, including fix for breakage on older Promise controllers.

Add more ways of getting to the ATA registers.
2003-04-07 14:12:12 +00:00
Poul-Henning Kamp
891619a66d Use bioq_flush() to drain a bio queue with a specific error code.
Retain the mistake of not updating the devstat API for now.

Spell bioq_disksort() consistently with the remaining bioq_*().

#include <geom/geom_disk.h> where this is more appropriate.
2003-04-01 15:06:26 +00:00
Søren Schmidt
0c4b980607 Fix ATA_DEBUG case breakage. 2003-03-30 09:27:59 +00:00
Søren Schmidt
566cf07a7c Second round of updates to the ATA driver.
Clean up the DMA interface too much unneeded stuff crept in with
the busdma code back when.

Modify the ATA_IN* / ATA_OUT* macros so that resource and offset
are gotten from a table. That allows for new chipsets that doesn't
nessesarily have things ordered the good old way. This also removes
the need for the wierd PC98 resource functions.

Tested on: i386, PC98, Alpha, Sparc64
2003-03-29 13:37:09 +00:00
Maxime Henrion
0a50de79cb - Add a new ioctl to get the maximum number of ATA channels.
- Use it in atacontrol(8) when listing ATA devices instead of
  stopping at the first ENXIO received.

This makes atacontrol list work on my sparc64 where the two ATA
channels I have are numbered 2 and 3.

Reviewed by:	sos
2003-03-22 12:18:20 +00:00
Poul-Henning Kamp
b4b138c27f Including <sys/stdint.h> is (almost?) universally only to be able to use
%j in printfs, so put a newsted include in <sys/systm.h> where the printf
prototype lives and save everybody else the trouble.
2003-03-18 08:45:25 +00:00
Søren Schmidt
9eb8572ea2 Dont hang the channel on enclosures without sensors. 2003-03-12 10:59:35 +00:00
Poul-Henning Kamp
60794e0478 Centralize the devstat handling for all GEOM disk device drivers
in geom_disk.c.

As a side effect this makes a lot of #include <sys/devicestat.h>
lines not needed and some biofinish() calls can be reduced to
biodone() again.
2003-03-08 08:01:31 +00:00
Poul-Henning Kamp
7ac40f5f59 Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by:    re(scottl)
2003-03-03 12:15:54 +00:00
Dag-Erling Smørgrav
521f364b80 More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9). 2003-03-02 16:54:40 +00:00
Søren Schmidt
b301920c88 Revert the probe code change.
It helped those fake devices probe delays to go away, but as a side
effect it also made some not so conforming CD/DVD drives go away...
2003-02-25 08:22:01 +00:00
Søren Schmidt
bb5bdd386e First round off updates/fixes to the ATA driver.
This moves all chipset specific code to a new file 'ata-chipset.c'.
Extensive use of tables and pointers to avoid having the same switch
on chipset type in several places, and to allow substituting various
functions for different HW arch needs.
Added PIO mode setup and all DMA modes.
Support for all known SiS chipsets. Thanks to Christoph Kukulies for
sponsoring a nice ASUS P4S8X SiS648 based board for this work!

Tested on:	i386, PC98, alpha and sparc64
2003-02-20 20:02:32 +00:00
Alfred Perlstein
c11110eabe Fix crash dumps on ata and scsi.
To fix scsi, don't wait for ithreads if we're dumping, it makes the
debugger sad.

To fix ata, use what appears to be a polling method if we're dumping,
I stole this from tmm but added code to ensure that this change is
only in effect while dumping.

Tested by: des
2003-02-14 13:10:40 +00:00
Søren Schmidt
33ede9b3e7 Update the code that deals with disk enclosures:
Properly handle the newer Promise SuperSwap 1000 enclosures.
Print out what kind of enclosure was found in the probe.
Misc cleanups in the enclosure handling code.

Sponsored by: Advanis Inc.
2003-01-27 09:04:29 +00:00
Søren Schmidt
7fc7425df3 Small change to the previous commit, zero out the 48BIT flag in ata_command
instead of in dmadone.
2003-01-19 20:18:07 +00:00
Søren Schmidt
15fa4bd593 Fix the 48bit access support for the older Promise 66/100 controllers, the
first attempt was wrong and could cause r/w timeouts.

Add yet another Promise PCI id.
2003-01-19 11:47:32 +00:00
Søren Schmidt
9dec0f3de0 Fix linking problem when atadisk is not use in ata-all.c
Add dummy intr_func and lock_func to ata-card.c

Dont call ad_print if the driver decided there is no disk.
2002-12-06 19:29:53 +00:00
Søren Schmidt
8ba4488cea Add support for the PC98 platform to the ATA driver.
This mostly consists of functionality to serialize accesses to
the two ATA channels (which can also be used to "fix" certain
PCI based controllers).
Add support for Acard controllers.
Enable the ATA driver in PC98 GENERIC, and add device hints.
Update man page with latest support.

The PC98 core team has kindly provided me with a PC98
machine that made this all possible, thanks to all that
contributed to that effort, without that this would
probably newer have been possible..

Approved by: re@
2002-12-03 20:20:44 +00:00
Thomas Quinot
9e3a06e150 In ata_reinit, when ata_getparam fails for a new device (indicating that
the device is not actually present), clear the corresponding bit in
the ch->devices bitmap. This resolves a panic that occurred with ATAPI/CAM
after an APM suspend/resume, when the ATA hardware would erroneously
report an extra ATAPI device.

Approved by:	re, sos
Reviewed by:	roberto
MFC after:	7 days
2002-12-01 14:20:08 +00:00
John Baldwin
482a5259ac Use [u]intmax_t and %j instead of long long and %ll to better fix warnings
I fixed earlier.

Requested by:	mux, jake
2002-11-07 22:23:46 +00:00
John Baldwin
929791c8cc Use some long long casts to quiet warnings in debug printf's on alpha. 2002-11-06 19:52:13 +00:00
Thomas Quinot
e937fdbdcd Fill in missing parts of the ATAPI/CAM XPT: implement XPT_RESET_BUS
and XPT_RESET_DEV.

In order to properly handle reset requests whether they originate in the
ATA layer (atacontrol reinit) or from the CAM layer (camcontrol reset)
ata_reinit does not cause the SIM to be deallocated anymore. The SIM
is now unconditionnally created for each ATAPI bus.

This change may cause existing bus ids to change on some setups.

Reviewed by:	roberto
Approved by:	sos
2002-10-22 20:18:51 +00:00
Søren Schmidt
94ec75ef27 Misc cleanups.
Pointed out by: phk/flexelint
2002-10-01 15:21:57 +00:00
Søren Schmidt
35ca7a483a Rearrange where to get the ATAPI magic sequence.
Submitted by: Benjamin Close <cisbjc@cs.unisa.edu.au>
2002-09-12 14:32:33 +00:00
Søren Schmidt
fd4b4ecc73 Add the ability to use ATAPI devices via CAM.
The CAM<>ATAPI layer was submitted by "Thomas Quinot <thomas@cuivre.fr.eu.org>"
changes form the version on the net by me (formatting, ability to be used
alone without the ATAPI native device driver, proper speed reporting...)

See /sys/conf/NOTES for usage.

Submitted by: Thomas Quinot <thomas@cuivre.fr.eu.org>
2002-08-09 20:54:06 +00:00
Søren Schmidt
c4d86885af Byteswap the serial # 2002-07-31 18:29:34 +00:00
Søren Schmidt
2dadf47412 Update the tags handling a bit, which makes support for the
older IBM DTTA series of drives possible.
Update error handling a bit now we are here.
2002-07-22 18:35:01 +00:00
Søren Schmidt
0b2577457c Fix a '<<' that should have been a '>>' in the 48bit case.
Fortunately we only have had 32bit block counts until recently,
and no 2TB disks :)
2002-06-08 21:33:42 +00:00
Søren Schmidt
56397b300c Fix the FreeBSD native ATA RAID code a bit. 2002-04-10 11:18:07 +00:00
Søren Schmidt
32dbed0488 Unlock the channel again if an ata_reinit() fails. 2002-04-05 18:37:04 +00:00
Søren Schmidt
111ab6f7ed Dont allow to detach twice. 2002-04-05 18:02:33 +00:00
Søren Schmidt
22c60e8d8c Add forgotten ATA_UNLOCK_CH when getting status from non-existing
enclosure.
2002-04-05 15:58:45 +00:00
Søren Schmidt
7800211b08 Make the ATA driver compile & work on the sparc64 platform.
Initial work & code by tmm.

Lots of changes and rearrangements by yours truely to make busdma
be a little less a PITA (but I still dont like it).
2002-04-05 13:13:56 +00:00
Søren Schmidt
3348c0092c Add get-status to the ATA RAID subsystem. 2002-04-02 13:48:17 +00:00