summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-disk.h
Commit message (Collapse)AuthorAgeFilesLines
* Change the disk(9) API in order to make device removal more robust.phk2004-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Previously the "struct disk" were owned by the device driver and this gave us problems when the device disappared and the users of that device were not immediately disappearing. Now the struct disk is allocate with a new call, disk_alloc() and owned by geom_disk and just abandonned by the device driver when disk_create() is called. Unfortunately, this results in a ton of "s/\./->/" changes to device drivers. Since I'm doing the sweep anyway, a couple of other API improvements have been carried out at the same time: The Giant awareness flag has been flipped from DISKFLAG_NOGIANT to DISKFLAG_NEEDSGIANT A version number have been added to disk_create() so that we can detect, report and ignore binary drivers with old ABI in the future. Manual page update to follow shortly.
* This is a major rework of the ATA driver (ATAng)sos2003-08-241-35/+2
| | | | | | | | | | | | | | | | | | | | | | 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.
* Add flushing of devices on shutdown.sos2003-05-021-1/+1
| | | | | | 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...
* Centralize the devstat handling for all GEOM disk device driversphk2003-03-081-1/+0
| | | | | | | | 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.
* Convert to new disk API.sos2003-02-251-1/+0
| | | | Prodded by: phk
* First round off updates/fixes to the ATA driver.sos2003-02-201-1/+1
| | | | | | | | | | | | 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
* Update the tags handling a bit, which makes support for thesos2002-07-221-0/+1
| | | | | older IBM DTTA series of drives possible. Update error handling a bit now we are here.
* Make the ATA driver compile & work on the sparc64 platform.sos2002-04-051-1/+0
| | | | | | | 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).
* Major update of the ATA RAID code, part 3:sos2002-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add code to properly detach/attach disks that are part of a RAID. Mark a disk that is attached on an ATA channel belonging to a RAID as a spare disk that can be used for rebuilding failed RAID1's. Add support for rebuilding failed RAID1's. Several fixes to the detach/attach code. For replacing a disk in a failed RAID1 do the following: Find the controller channel# of the failed disk. Exec 'atacontrol detach <channel#>' to free the disk from the system. Replace the failed disk with a new one of at least the same size. If your have your disks in drawers/enclosures this can be done with the system still running. Exec 'atacontrol attach <channel#>' to add the disk to the system and mark it as a valid spare for rebuild. Exec 'atacontrol rebuild <array#>' The system will rebuild the array on the fly, the array can still be used during this, although with slower performance. Please let me know of any problems with this! Sponsored by: Advanis Inc. MFC after: 2 weeks
* Finish phk's previous removal of BIO_ORDERED, all code thatsos2002-02-241-1/+0
| | | | depended on ATA_FLUSHCACHE_ON is now useless.
* Fix buglets in the ATAPI resume code.sos2002-02-121-2/+1
| | | | | This also fixes an old bug where some ATAPI devices went into funny mode on an 'atacontrol reinit' command.
* Major update of the ATA RAID code, part 1:sos2002-02-041-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Update with latest ATA/ATAPI ver 6 rev 2 items.sos2001-10-061-2/+2
|
* Overhaul to minimize stack usage, in some places >2K was usedsos2001-09-201-1/+1
| | | | on the stack *blush*...
* Add sysctls for reading the tunables as suggested by des.sos2001-03-191-4/+7
| | | | | Minor cleanups plus checks of the ->active state. Cosmetics.
* Minor cleanup to the previous commit:sos2001-03-141-1/+1
| | | | | | Print what devices went away and which arrived. Avoid timeout loop on missing status.
* Refine the detach/attach code.sos2001-03-141-0/+1
| | | | | | | | | | Proberly fail outstanding bio requests on devices that are detached. This makes it possible to change between disk/cdrom/dvd/whathaveyou in a notebook, just by suspending it, changing the device in the bay (or what you model calls it), unsuspend and the ATA driver will figure out what disappeared and properly fail those, and attach any new devices found.
* Add session argument to *close_disk, allowing to set session type on fixate.sos2001-01-101-1/+1
| | | | | | Add support for different blank/erase types. Update headers.
* Add support for ATA "pseudo" RAID controllers as the Promise Fasttraksos2000-10-131-1/+1
| | | | | | | and HighPoint HPT370 controllers. Use by defining the RAID in the BIOS and the "ar driver will pick it up automagically...
* Fix the breakage that snatched the ioports from the fdc device.sos2000-09-241-0/+1
| | | | Fix promise support.
* Add support for tagged queuing on ATA drives. There is only support forsos2000-09-191-27/+34
| | | | | | | | | | | | | | | | | | IBM's DPTA and DTLA series of drives (no other disk vendors are known to support this) on non-Promise controllers (promise controllers lockup when given the tagged queuing specific commands). It gives especially master/slave comboes about 5% better performance. Add support for the Promise ATA100 OEM chip (pdc20265) Add support for the Cyrix 5530 Change the way status is read from the drives, use the alternate status reg when possible. Better support for DEVFS, the acdXtY devices are now created when needed. Lots of little cleanups.
* Back out the previous change to the queue(3) interface.jake2000-05-261-1/+1
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-231-1/+1
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Complete the bio/buf divorce for all code below devfs::strategyphk2000-04-151-2/+2
| | | | | | | | | | Exceptions: Vinum untouched. This means that it cannot be compiled. Greg Lehey is on the case. CCD not converted yet, casts to struct buf (still safe) atapi-cd casts to struct buf to examine B_PHYS
* Enable disksort the right way both on ATA disks and ATAPI devices.sos2000-03-131-1/+2
|
* Fix the CD driver so that the last blocks can be read even ifsos2000-03-051-4/+4
| | | | | | a blocksize != 2k is used. Update the timeout code to try fallback to PIO if problems arise in DMA mode.
* Update the ata driver to take more advantage of newbus, thissos2000-02-181-0/+2
| | | | | | | | | | | | | | | | 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)
* Add sysctl oid hw.atamodes to set the transfermodes online.sos2000-01-271-2/+1
|
* Rearrange the probecode, so that 80pin cables can be identifiedsos2000-01-181-101/+1
| | | | | | | 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.
* Add support for VIA 82C596 controllersos2000-01-031-1/+1
| | | | | | | | Better shared irq handeling for Promise & HPT366 controllers Setup prober PIO mode timings on Promise & HPT366 controllers Update Copyright headers to be Y2K compliant :)
* Yet another cleanup of the VIA code, this time it should worksos1999-12-211-0/+1
| | | | | | | | | | | | | | | 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.
* Fix support for disk with > 64K cyls.sos1999-12-071-2/+1
|
* Better error handeling:sos1999-11-291-0/+1
| | | | | | | | | 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.
* Add DMA support for the VIA 82C586 & 82C686 chips, also rearrangesos1999-11-241-4/+4
| | | | | | | | 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.
* Add support for the HPT366 chip, this is used on the Abit boards andsos1999-10-091-4/+13
| | | | | | | | | | | | | | | | | | 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.
* Fix timeout handeling and add retry counts.sos1999-09-241-0/+1
| | | | | | Add HPT366 probe message (but no real support yet), Add CDR support for several diffenrent blocktypes, also close disk as a multisession CD.
* Ten'th update to the new ATA/ATAPI driver:sos1999-09-211-30/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Use micro "disk" layer in ata-diskphk1999-09-031-5/+1
| | | | Reviewed by: sos
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Convert DEVFS hooks in (most) drivers to make_dev().phk1999-08-231-5/+1
| | | | | | | | | | | | | | | | 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().
* Nine'th update to the new ATA/ATAPI driver:sos1999-06-251-10/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Eigth update to the new ATA/ATAPI driver:sos1999-05-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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!
* Fourth update to the new ATA/ATAPI driver:sos1999-03-281-16/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Well, better late than newer, but things has been hectic around here, sorry for the long delay. DMA support has been added to the ATA disk driver. This only works on Intel PIIX3/4, Acer Aladdin and Promise controllers. The promise support works without the BIOS on the board, and timing modes are set to support up to UDMA speed. This solves the problems with having more than one promise controller in the same system. There is support for "generic" DMA, that might work on other controllers, but now you have been warned :) More chipset specific code will come soon, I have to find testers with the approbiate HW, more on that when I have it ready. The system now uses its own major numbers, please run MAKEDEV with the devices you need (ad?, acd?, afd?, ast?). For now the disk driver will also attach to the old wd major so one can at least boot without this step, but be warned, this will eventually go away. The bootblocks will have to be changed before one can boot directly from an "ad" device though. Fixed problems: All known hang problems should be solved The probe code has been sligthly changed, this should solve the reports I have lying around (I hope). Hangs when accessing ata & atapi device on the same channel simultaniously. A real braino in ata_start caused this, fixed. 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, agaiin you have been warned :) But please tell me how it works for you! Enjoy! -Søren
* ZIP drives should now be working, I'm not sure about LS120 drives,sos1999-03-071-2/+2
| | | | | | | | | | | | reports on those most welcome! Fixed problems: Hang on probe on "fantom" devices. The probe now use a timeout to avoid hangs if no interrupt is recevied. There has also been more general code clenaups, and some reorgs.
* Now all actual probing of both ATA & ATAPI devices are done aftersos1999-03-051-1/+75
| | | | | | | | | | | | | | interrupts are enabled, this kills the last "unwanted interrupts" (and there is no ugly hacks like in the old driver to avoid them). COmmand interrupt devices are now supported, this applies mostly to older CDROM's and apparently also the ZIP. Fixed problems: Number of total sectors wrong on some older drives. Fixed by not using the LBA size unless we know its valid. There has also been more general code clenaups, some reorgs also.
* Added driver to support ATAPI floppies ie LS-120 & ZIP drives.sos1999-03-031-6/+8
| | | | | | | | | | | | | | | Added "options ATA_STATIC_ID" that wires ATA disks like the old wd driver. Fixed problems: Dont use more sectors/intr than the drive supports. Fix announce of > 8.4G disks. Dont call ad_interrupt/ad_transfer when no disks config'd. Use the right page# for CDR write mode params. Fix breakage when no PCI support in kernel. Implement DEVFS stuff. General code clenaup.
* Finally!!sos1999-03-011-0/+57
The much roumored replacement for our current IDE/ATA/ATAPI is materialising in the CVS repositories around the globe. So what does this bring us: A new reengineered ATA/ATAPI subsystem, that tries to overcome most of the deficiencies with the current drivers. It supports PCI as well as ISA devices without all the hackery in ide_pci.c to make PCI devices look like ISA counterparts. It doesn't have the excessive wait problem on probe, in fact you shouldn't notice any delay when your devices are getting probed. Probing and attaching of devices are postponed until interrupts are enabled (well almost, not finished yet for disks), making things alot cleaner. Improved performance, although DMA support is still WIP and not in this pre alpha release, worldstone is faster with the new driver compared to the old even with DMA. So what does it take away: There is NO support for old MFM/RLL/ESDI disks. There is NO support for bad144, if your disk is bad, ditch it, it has already outgrown its internal spare sectors, and is dying. For you to try this out, you will have to modify your kernel config file to use the "ata" controller instead of all wdc? entries. example: # for a PCI only system (most modern machines) controller ata0 device atadisk0 # ATA disks device atapicd0 # ATAPI CDROM's device atapist0 # ATAPI tapes #You should add the following on ISA systems: controller ata1 at isa? port "IO_WD1" bio irq 14 controller ata2 at isa? port "IO_WD2" bio irq 15 You can leave it all in there, the system knows how to manage. For now this driver reuses the device entries from the old system (that will probably change later), but remember that disks are now numbered in the sequence they are found (like the SCSI system) not as absolute positions as the old system. Although I have tested this on all the systems I can get my hands on, there might very well be gremlins in there, so use AT YOU OWN RISK!! This is still WIP, so there are lots of rough edges and unfinished things in there, and what I have in my lab might look very different from whats in CVS at any given time. So please have all eventual changes go through me, or chances are they just dissapears... I would very much like to hear from you, both good and bad news are very welcome. Enjoy!! -Søren
OpenPOWER on IntegriCloud