aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ata/atapi-all.c
Commit message (Collapse)AuthorAgeFilesLines
* This is a major rework of the ATA driver (ATAng)Søren Schmidt2003-08-241-699/+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. Notes: svn path=/head/; revision=119404
* Second round of updates to the ATA driver.Søren Schmidt2003-03-291-27/+23
| | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=112791
* Dont call dma->free unless dma is there.Søren Schmidt2003-03-131-1/+2
| | | | | | | Spotted by: Ian Dowse <iedowse@maths.tcd.ie> Notes: svn path=/head/; revision=112186
* Always set the setmode funcptr.Søren Schmidt2003-03-031-1/+3
| | | | Notes: svn path=/head/; revision=111809
* More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9).Dag-Erling Smørgrav2003-03-021-4/+4
| | | | Notes: svn path=/head/; revision=111748
* First round off updates/fixes to the ATA driver.Søren Schmidt2003-02-201-33/+13
| | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=111188
* Fix an indentation problem.Poul-Henning Kamp2002-09-281-1/+1
| | | | Notes: svn path=/head/; revision=104096
* Dont hang in atprq on poll_dsc command.Søren Schmidt2002-09-121-2/+4
| | | | | | | | | This is a temporary fix until I get proper locking done. Submitted by: iedowse@maths.tcd.ie Notes: svn path=/head/; revision=103248
* Fix buffer length.Søren Schmidt2002-08-191-1/+1
| | | | | | | PR: 41063 Notes: svn path=/head/; revision=102126
* Add the ability to use ATAPI devices via CAM.Søren Schmidt2002-08-091-21/+4
| | | | | | | | | | | | | 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> Notes: svn path=/head/; revision=101606
* OK, dont rely on the upper layers handling iosize_max correctly,Søren Schmidt2002-07-281-2/+5
| | | | | | | | | instead rely on ATAPI devices ability to do the work instead. MFC material. Notes: svn path=/head/; revision=100837
* Sync with the spl changes in -stable.Søren Schmidt2002-07-221-2/+5
| | | | | | | Add start of support for DVD+RW. Notes: svn path=/head/; revision=100525
* Fix the breakage of tagged queueing that the busdma integrationSøren Schmidt2002-04-181-1/+2
| | | | | | | | introduced. Since its now only possible to have one DMA control block at a time, we move the setup to dmastart instead. Notes: svn path=/head/; revision=95010
* Make the ATA driver compile & work on the sparc64 platform.Søren Schmidt2002-04-051-32/+24
| | | | | | | | | | 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). Notes: svn path=/head/; revision=93882
* Misc little cleanups.Søren Schmidt2002-03-261-12/+10
| | | | Notes: svn path=/head/; revision=93198
* Add new support for locking an ATA channel and use that throughoutSøren Schmidt2002-03-111-10/+11
| | | | | | | | | the ATA/ATAPI driver. This solves the concurrency problem with the new GEOM code, and also cuts a good deal of the patch size in the upcoming MFC. Notes: svn path=/head/; revision=92107
* Minor cosmetic changes to minimise diffs for MFC.Søren Schmidt2002-03-071-1/+0
| | | | Notes: svn path=/head/; revision=91817
* Added undocumented options AAC_DEBUG, ACD_DEBUG, ACPI_MAX_THREADS,Bruce Evans2002-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | ACPI_NO_SEMAPHORES, ASR_MEASURE_PERFORMANCE, AST_DEBUG, ATAPI_DEBUG, ATA_DEBUG, BKTR_ALLOC_PAGES, BROOKTREE_ALLOC_PAGES, CAPABILITIES, COMPAT_SUNOS, CV_DEBUG, MAXFILES, METEOR_TEST_VIDEO, NDEVFSINO, NDEVFSOVERFLOW, NETGRAPH_BRIDGE, NETSMB, NETSMBCRYPTO, PFIL_HOOKS, SIMOS, SMBFS, VESA_DEBUG, VGA_DEBUG. Start using #! to comment out negative options and ## to comment out broken options. atapi-all.c: Fixed rotted bits that were hiding under ATAPI_DEBUG. atapi-cd.c: #include "opt_ata.h" so that ACD_DEBUG is actually visible. ata/atapi-tape.c #include "opt_ata.h" so that AST_DEBUG is actually visible. Notes: svn path=/head/; revision=90681
* Major update of the ATA RAID code, part 2:Søren Schmidt2002-02-121-1/+3
| | | | | | | | | | | More cleanups of the RAID1 failure mode code. Add functionality that writes the changed RAID config setup back to the disks (in controller BIOS specific format), so that a reboot will make the BIOS pick up the changed config. Notes: svn path=/head/; revision=90566
* Major update of the ATA RAID code, part 1:Søren Schmidt2002-02-041-170/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=90215
* Fix bug introduced by the last commit, the caused some ATAPISøren Schmidt2001-10-161-1/+1
| | | | | | | devices to fail to proberly initialize at boot.. Notes: svn path=/head/; revision=85025
* Update with latest ATA/ATAPI ver 6 rev 2 items.Søren Schmidt2001-10-061-13/+13
| | | | Notes: svn path=/head/; revision=84584
* Overhaul to minimize stack usage, in some places >2K was usedSøren Schmidt2001-09-201-1/+1
| | | | | | | on the stack *blush*... Notes: svn path=/head/; revision=83728
* Finally commit some of the minor things I've collected over the last month(s):Søren Schmidt2001-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. Notes: svn path=/head/; revision=82053
* - Remove asleep(), await(), and M_ASLEEP.John Baldwin2001-08-101-5/+1
| | | | | | | | | | | | - Callers of asleep() and await() have been converted to calling tsleep(). The only caller outside of M_ASLEEP was the ata driver, which called both asleep() and await() with spl-raised, so there was no need for the asleep() and await() pair. M_ASLEEP was unused. Reviewed by: jasone, peter Notes: svn path=/head/; revision=81397
* "Fix" the previous initial attempt at fixing TUNABLE_INT(). This timePeter Wemm2001-06-081-1/+1
| | | | | | | | | | around, use a common function for looking up and extracting the tunables from the kernel environment. This saves duplicating the same function over and over again. This way typically has an overhead of 8 bytes + the path string, versus about 26 bytes + the path string. Notes: svn path=/head/; revision=77900
* Back out part of my previous commit. This was a last minute changePeter Wemm2001-06-071-1/+1
| | | | | | | | and I botched testing. This is a perfect example of how NOT to do this sort of thing. :-( Notes: svn path=/head/; revision=77853
* Make the TUNABLE_*() macros look and behave more consistantly like thePeter Wemm2001-06-061-2/+2
| | | | | | | | SYSCTL_*() macros. TUNABLE_INT_DECL() was an odd name because it didn't actually declare the int, which is what the name suggests it would do. Notes: svn path=/head/; revision=77843
* Fix bug in debug codeSøren Schmidt2001-05-291-2/+2
| | | | Notes: svn path=/head/; revision=77403
* Actually biofinish(struct bio *, struct devstat *, int error) is more generalPoul-Henning Kamp2001-05-061-3/+1
| | | | | | | | | than the bioerror(). Most of this patch is generated by scripts. Notes: svn path=/head/; revision=76322
* More error handling cleanups.Søren Schmidt2001-04-051-14/+11
| | | | Notes: svn path=/head/; revision=75237
* Add new flag ATPR_F_QUIET to atapi_request.Søren Schmidt2001-04-051-36/+35
| | | | | | | Cleanup error handling. Notes: svn path=/head/; revision=75232
* Use PLAY_MSF instead of PLAY_BIG when doing audio play.Søren Schmidt2001-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. Notes: svn path=/head/; revision=74847
* Fix the problem with some drives not reporting back when theSøren Schmidt2001-03-231-0/+2
| | | | | | | | | are busy blanking and erasing CD-RW media. This fixes burncd's premature returns from blanking/erasing that caused trouble. Notes: svn path=/head/; revision=74704
* Add sysctls for reading the tunables as suggested by des.Søren Schmidt2001-03-191-0/+6
| | | | | | | | Minor cleanups plus checks of the ->active state. Cosmetics. Notes: svn path=/head/; revision=74450
* Provide the interface to atacontrol and associated logic.Søren Schmidt2001-03-151-57/+68
| | | | | | | | | | | | 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). Notes: svn path=/head/; revision=74302
* Minor cleanup to the previous commit:Søren Schmidt2001-03-141-1/+1
| | | | | | | | | Print what devices went away and which arrived. Avoid timeout loop on missing status. Notes: svn path=/head/; revision=74253
* Refine the detach/attach code.Søren Schmidt2001-03-141-1/+22
| | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=74250
* Print out sensekey specifik values if set on errorSøren Schmidt2001-02-121-3/+8
| | | | Notes: svn path=/head/; revision=72403
* Introduce busspace instead of the good old in/out instructions.Søren Schmidt2001-02-061-28/+29
| | | | | | | Not pretty but it works (I hope)... Notes: svn path=/head/; revision=72106
* Convert ata and atapi #if NATA* > 0 to options instead. Stop configPeter Wemm2001-01-291-12/+9
| | | | | | | trying to count the number of ata* devs since they were not used anyway. Notes: svn path=/head/; revision=71788
* Add session argument to *close_disk, allowing to set session type on fixate.Søren Schmidt2001-01-101-1/+1
| | | | | | | | | Add support for different blank/erase types. Update headers. Notes: svn path=/head/; revision=70901
* Use M_ZERO flag on malloc when approbiate.Søren Schmidt2000-12-261-4/+3
| | | | Notes: svn path=/head/; revision=70363
* Update the burncd interface a bit, dont block the ATA channel onSøren Schmidt2000-12-261-10/+7
| | | | | | | | blank & fixate commands and provide a progress interface for the blank command (for now) Notes: svn path=/head/; revision=70361
* Staticize some malloc M_ instances.Poul-Henning Kamp2000-12-081-1/+1
| | | | Notes: svn path=/head/; revision=69774
* Better handling of immediate commands, mainly to solve timeoutsSøren Schmidt2000-11-121-5/+32
| | | | | | | in the atapi-tape code... Notes: svn path=/head/; revision=68644
* Remove unneeded #include <machine/clock.h>Poul-Henning Kamp2000-10-151-1/+0
| | | | Notes: svn path=/head/; revision=67164
* Remove unneeded includesSøren Schmidt2000-09-201-2/+2
| | | | | | | Pointed out by: phk Notes: svn path=/head/; revision=66106
* Add support for tagged queuing on ATA drives. There is only support forSøren Schmidt2000-09-191-41/+50
| | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=66070
* * Completely rewrite the alpha busspace to hide the implementation fromDoug Rabson2000-08-281-0/+1
| | | | | | | | | | | | | | | the drivers. * Remove legacy inx/outx support from chipset and replace with macros which call busspace. * Rework pci config accesses to route through the pcib device instead of calling a MD function directly. With these changes it is possible to cleanly support machines which have more than one independantly numbered PCI busses. As a bonus, the new busspace implementation should be measurably faster than the old one. Notes: svn path=/head/; revision=65176