summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/atapi-all.h
Commit message (Collapse)AuthorAgeFilesLines
* This is a major rework of the ATA driver (ATAng)sos2003-08-241-196/+0
| | | | | | | | | | | | | | | | | | | | | | 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.
* 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
* Fill in missing parts of the ATAPI/CAM XPT: implement XPT_RESET_BUSthomas2002-10-221-0/+1
| | | | | | | | | | | | | | 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
* use __packed.alfred2002-09-231-2/+2
|
* Add the ability to use ATAPI devices via CAM.sos2002-08-091-0/+2
| | | | | | | | | | 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>
* Sync with the spl changes in -stable.sos2002-07-221-0/+1
| | | | Add start of support for DVD+RW.
* 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).
* Fix buglets in the ATAPI resume code.sos2002-02-121-1/+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-31/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Overhaul to minimize stack usage, in some places >2K was usedsos2001-09-201-1/+1
| | | | on the stack *blush*...
* Finally commit some of the minor things I've collected over the last month(s):sos2001-08-211-1/+1
| | | | | | | | | | | | | | | | | | | | Add tagged queueing support for new IBM drives. Add support for Yet Another Promise ATA 100 chip. Flush disk cache on close. Dont flush the disk cache on BIO_ORDERED anymore. Cleanup the tests for DMA on ATAPI devices. Allow to share ALL irq's even the std irg 14 & 15. Fix calculation bug in end of media code on CD's. Add REZERO on opening a CDR/CDRW. Cleanup ataioctl a bit.
* Add new flag ATPR_F_QUIET to atapi_request.sos2001-04-051-1/+2
| | | | Cleanup error handling.
* Use PLAY_MSF instead of PLAY_BIG when doing audio play.sos2001-03-271-1/+2
| | | | | | | | | | | The fixes the problem of PLAY_BIG not being implemented on some modern drives. The problem now is that some old drives use BSD encoding in the MSF case, which they dont tell, and which is also not according to spec *sigh*. Hopefully there are not too many of those still alive, or I hereby grant license to kill the firmware writers that wrote the mess.
* Fix the problem with some drives not reporting back when thesos2001-03-231-1/+2
| | | | | | are busy blanking and erasing CD-RW media. This fixes burncd's premature returns from blanking/erasing that caused trouble.
* Provide the interface to atacontrol and associated logic.sos2001-03-151-1/+0
| | | | | | | | | see atacontrol(8) for more. Also the ATA_ENABLE_ATAPI_DMA, ATA_ENABLE_WC and ATA_ENABLE_TAGS options are gone, use the tuneables listed in ata.4 instead from the loader (this makes it possible to switch off DMA before the driver has to touch the devices on broken hardware).
* Refine the detach/attach code.sos2001-03-141-1/+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.
* Introduce busspace instead of the good old in/out instructions.sos2001-02-061-1/+1
| | | | Not pretty but it works (I hope)...
* 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.
* Update the burncd interface a bit, dont block the ATA channel onsos2000-12-261-2/+3
| | | | | blank & fixate commands and provide a progress interface for the blank command (for now)
* Better handling of immediate commands, mainly to solve timeoutssos2000-11-121-0/+1
| | | | in the atapi-tape code...
* Add support for tagged queuing on ATA drives. There is only support forsos2000-09-191-21/+22
| | | | | | | | | | | | | | | | | | 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
* Make ATAPI CD changer devices work, hopefully better than before.sos2000-03-211-2/+3
|
* Remove the old DSC code, it doesn't work anymore.sos2000-03-181-2/+1
|
* Cleanup sweep.sos2000-03-131-1/+1
|
* Enable disksort the right way both on ATA disks and ATAPI devices.sos2000-03-131-2/+11
|
* Fix the CD driver so that the last blocks can be read even ifsos2000-03-051-4/+5
| | | | | | a blocksize != 2k is used. Update the timeout code to try fallback to PIO if problems arise in DMA mode.
* Fix the changer code, dont wait for device ready on unload, itsos2000-02-211-3/+11
| | | | | | wont become ready as there is no media - doh. Update the command name reporting.
* Update the ata driver to take more advantage of newbus, thissos2000-02-181-2/+3
| | | | | | | | | | | | | | | | 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-4/+3
|
* Rearrange the probecode, so that 80pin cables can be identifiedsos2000-01-181-99/+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 :)
* Add DMA support for the SiS 5591 and old PIIX chipsets.sos1999-12-131-0/+1
| | | | | | | | | | | | | | | | | | | | | 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.
* Commit the kernel part of our DVD support. Nothing much to say really,sos1999-12-071-0/+3
| | | | its just a number of new ioctl's, the rest is done in userland.
* Make the atapi device return sensible errno's back to userland.sos1999-11-101-0/+1
| | | | Dont panic if a nonexistant device is opened.
* Fix IRQ allocation bug on controllers using a shared interrupt.sos1999-11-061-1/+2
| | | | | | | | | | | | | | | | | 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.
* Add support for the HPT366 chip, this is used on the Abit boards andsos1999-10-091-26/+24
| | | | | | | | | | | | | | | | | | 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.
* Support quad & max speeds in wormcontrol.sos1999-09-221-0/+1
| | | | A bit more general cleanup.
* Ten'th update to the new ATA/ATAPI driver:sos1999-09-211-132/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Nine'th update to the new ATA/ATAPI driver:sos1999-06-251-11/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | 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!
* Seventh update to the new ATA/ATAPI driver:sos1999-05-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fourth update to the new ATA/ATAPI driver:sos1999-03-281-24/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-3/+26
| | | | | | | | | | | | 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.
* Added driver to support ATAPI floppies ie LS-120 & ZIP drives.sos1999-03-031-8/+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/+180
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