Commit Graph

21 Commits

Author SHA1 Message Date
Søren Schmidt
a7a120f649 Overhaul of the timeout/reinit framework. This should clear up most
of the leftovers from the old version that really doesn't work anymore.

Add a reset function for host-end of the ATA channel. This is needed
for the SiI3112 in order to whack it back to reality if a device
locks up the SATA interface (thereby preventing that we can reset the
device). The result is that ATA now recovers from the timeouts that
happens with the SiI3112A and more or less all disks based on old
PATA electronics with a Marvell PATA->SATA converter. This includes
lots of the popular SATA dongles and the WDC Raptor disks..
2004-01-11 22:08:34 +00:00
Søren Schmidt
ccd50c4818 Fix ata-card.
The altio resource magic no longer worked probably due to other changes
in the kernel. Redo that part so it also fits better into ATAng.
Fix detach so it doesn't panic the system when a pccard device is
yanked.

Approved by: re@
2003-11-30 16:27:59 +00:00
Warner Losh
d25d7d01be Include pccard/pccard_cis.h here too 2003-10-07 04:26:14 +00:00
Søren Schmidt
9f06a4277f Unify prototypes.
Cosmetics.
2003-08-25 09:01:49 +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
Warner Losh
60c64b939b Remove check to see if the get resource for the second resource
succeeds.  There is a difference between how OLDCARD and NEWCARD deal
with their resources, and this code exposes that difference.  I'm not
sure which behavior is correct, and will need to look into that in
more detail.  However, it appears that we go ahead and allocate the
right thing in both cases that I have access to (CF cards, CDROM, and
external ata enclosures), so go ahead and ignore the failure to get
the resource for the other rid.  There's already another check to make
sure that the actual allocation works correctly, and that should be
sufficient to catch cases that don't work.

Submitted by: wpaul and iedowse
2003-06-27 03:25:43 +00:00
Warner Losh
04fd143fa8 Add FREECOM PCCARD-IDE to the mix. It doesn't have a manufacturer or
product ID, so we have to use the CIS strings to ID it.

dmesg by: Christian Laursen
2003-06-17 12:33:53 +00:00
Warner Losh
49d5015da8 Add support for generic PMCICA ATA CARD 2003-06-03 01:30:55 +00:00
Poul-Henning Kamp
df1970aa55 Fix an off-by-1 error.
Found by:	FlexeLint
Reviewed by:	sos
Approved by:	re/rwatson
2003-05-12 15:26:05 +00:00
Warner Losh
03988eea4d MF-p4:
"Ian gave me this patch"  I assume this is iadowse@.

Also, pull in a few devices NetBSD's table.  More are there, but I need
to properly move them to pccarddev before including them here.
2003-04-26 22:19:02 +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
Søren Schmidt
c55607ce1f Always set the setmode funcptr. 2003-03-03 11:15:32 +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
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
Poul-Henning Kamp
c6ff03e2df Remove unused #includes: <sys/disk.h> <sys/devicestat.h> and <sys/sysctl.h>
Sponsored by:	DARPA & NAI Labs.
Approved by:	sos
2002-09-20 18:08:57 +00:00
Poul-Henning Kamp
2f11d560cc remove #includes of <sys/bio.h> where not needed. 2002-09-14 18:59:32 +00:00
Søren Schmidt
6ddce9039b Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.

A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.

Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.

Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.

Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.

If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.

Misc fixes that I had lying around for various minor bugs.

Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
Søren Schmidt
d2e812582d Add support for pccard.
submitted by: imp
2002-01-28 13:12:16 +00:00
Søren Schmidt
f601b4eb7c Overhaul to minimize stack usage, in some places >2K was used
on the stack *blush*...
2001-09-20 15:25:36 +00:00
Søren Schmidt
331c488d69 Split out the ata probes in seperate files for each bus type. 2001-03-06 21:43:46 +00:00