summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-card.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r256304grehan2013-10-111-1/+1
| | | | | | | Allow the legacy CDROM device to be accessed in a FreeBSD guest, while still using enlightened drivers for other block devices. Approved by: re@ (gjb)
* Remove duplicate const specifiers in many drivers (I hope I got all ofdim2012-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | them, please let me know if not). Most of these are of the form: static const struct bzzt_type { [...list of members...] } const bzzt_devs[] = { [...list of initializers...] }; The second const is unnecessary, as arrays cannot be modified anyway, and if the elements are const, the whole thing is const automatically (e.g. it is placed in .rodata). I have verified this does not change the binary output of a full kernel build (except for build timestamps embedded in the object files). Reviewed by: yongari, marius MFC after: 1 week
* - First pass at const'ifying ata(4) as appropriate.marius2012-03-211-3/+3
| | | | | | | - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers MFC after: 1 week
* Convert files to UTF-8uqs2012-01-151-1/+1
|
* Minor formatting nits.imp2010-07-041-2/+2
|
* Check the Disk FUNCE recorded in the CIS to see if we should probe forimp2009-03-121-1/+6
| | | | | | both disks, or if we should suppress the slave drive. Default to suppressing the slave, in the case that this REQIURED tuple turns out to not actually be present...
* Use channel driver's attach/detach routines instead of ata_attach()/mav2009-02-191-0/+8
| | | | | | ata_detach() to implement IOCATAATTACH/IOCATADETACH ioctls. This will permit channel drivers to properly shutdown port hardware on channel detach and init it on attach.
* Add experimental support for SATA Port Multiplierssos2008-04-101-1/+1
| | | | | | | Support is working on the Silicon Image SiI3124/3132. Support is working on some AHCI chips but far from all. Remember this is WIP, so test reports and (constructive) suggestions are welcome!
* Update copyright headers.sos2007-02-211-1/+1
|
* Get rid of the advertising clause in the copyright.sos2006-01-051-3/+1
|
* Forgot to commit ata-card fixes last night. Fix gleb's attempt to doimp2005-09-221-4/+7
| | | | | the right thing by merging in the changes I neglected to commit last night.
* Fix build.glebius2005-09-221-9/+4
|
* Eliminate unused argument in PCMCIA_CARD macro.imp2005-06-241-7/+7
| | | | | | | | Provide a backwards compatible way to have the extra macro by defining PCCARD_API_LEVEL 5 before including pccarddevs for driver writers that want/need to have the same driver on 5 and 6 with pccard attachments. Approved by: re (dwhite)
* Take newbusification one step further, ie use the device_t more consequentlysos2005-04-301-2/+2
| | | | | | | all way through the code down the layers, instead of the mix'n'match that resulted from the conversion done earlier. Sponsored by: pair.com
* Provide a default setmode method.sos2005-04-281-11/+0
| | | | This shaves off multiple copies of the same setmode stub.
* Cosmeticssos2005-04-251-12/+9
|
* Add a ata_setmode method so we dont panic on setmode.sos2005-04-131-3/+16
| | | | | Note that the mode is only set on the device, we (mostly) have no knowledge on how to set mode on the controller if at all possible.
* Add support for controllers that doesn't have the usual taskfilesos2005-04-061-14/+16
| | | | layout. No functional changes.
* This is the much rumoured ATA mkIII update that I've been working on.sos2005-03-301-27/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o ATA is now fully newbus'd and split into modules. This means that on a modern system you just load "atapci and ata" to get the base support, and then one or more of the device subdrivers "atadisk atapicd atapifd atapist ataraid". All can be loaded/unloaded anytime, but for obvious reasons you dont want to unload atadisk when you have mounted filesystems. o The device identify part of the probe has been rewritten to fix the problems with odd devices the old had, and to try to remove so of the long delays some HW could provoke. Also probing is done without the need for interrupts, making earlier probing possible. o SATA devices can be hot inserted/removed and devices will be created/ removed in /dev accordingly. NOTE: only supported on controllers that has this feature: Promise and Silicon Image for now. On other controllers the usual atacontrol detach/attach dance is still needed. o Support for "atomic" composite ATA requests used for RAID. o ATA RAID support has been rewritten and and now supports these metadata formats: "Adaptec HostRAID" "Highpoint V2 RocketRAID" "Highpoint V3 RocketRAID" "Intel MatrixRAID" "Integrated Technology Express" "LSILogic V2 MegaRAID" "LSILogic V3 MegaRAID" "Promise FastTrak" "Silicon Image Medley" "FreeBSD PseudoRAID" o Update the ioctl API to match new RAID levels etc. o Update atacontrol to know about the new RAID levels etc NOTE: you need to recompile atacontrol with the new sys/ata.h, make world will take care of that. NOTE2: that rebuild is done differently from the old system as the rebuild is now done piggybacked on read requests to the array, so atacontrol simply starts a background "dd" to rebuild the array. o The reinit code has been worked over to be much more robust. o The timeout code has been overhauled for races. o Support of new chipsets. o Lots of fixes for bugs found while doing the modulerization and reviewing the old code. Missing or changed features from current ATA: o atapi-cd no longer has support for ATAPI changers. Todays its much cheaper and alot faster to copy those CD images to disk and serve them from there. Besides they dont seem to be made anymore, maybe for that exact reason. o ATA RAID can only read metadata from all the above metadata formats, not write all of them (Promise and Highpoint V2 so far). This means that arrays can be picked up from the BIOS, but they cannot be created from FreeBSD. There is more to it than just the missing write metadata support, those formats are not unique to a given controller like Promise and Highpoint formats, instead they exist for several types, and even worse, some controllers can have different formats and its impossible to tell which one. The outcome is that we cannot reliably create the metadata of those formats and be sure the controller BIOS will understand it. However write support is needed to update/fail/rebuild the arrays properly so it sits fairly high on the TODO list. o So far atapicam is not supported with these changes. When/if this will change is up to the maintainer of atapi-cam so go there for questions. HW donated by: Webveveriet AS HW donated by: Frode Nordahl HW donated by: Yahoo! HW donated by: Sentex Patience by: Vife and my boys (and even the cats)
* Catchup to the iodata renamingimp2005-01-261-1/+1
|
* Tweaks to the resource allocation to allow a few of my obscureimp2004-11-101-7/+7
| | | | cdrom/ata controller PC Card devices work better.
* Return the unit number of a channel instead of a hardcoded '1' fromle2004-10-191-1/+1
| | | | | | | | | the ATA pccard locking function. This makes pccard devices like Compact Flash cards work again. PR: kern/72805 Submitted by: James E. Flemer <jflemer@alum.rpi.edu> MFC in: 2 days
* Fix the PC98 lockups on boot.sos2004-10-061-1/+2
| | | | | The interchannel locking for PC98 needed to be updated to match the rest of the locking in ATA.
* Fix disordering of pccarddevs.h noticed by bde. Also remove a fewimp2004-05-271-1/+2
| | | | | | redundant includes and fix some of the include disordering. Submitted by: bde
* Move to generating pccarddevs.h on the fly, both for the kernel andimp2004-05-261-1/+1
| | | | | | | the modules. Also generate usbdevs.h automatically now, but a non-kernel file is stopping that at the moment.
* Add support for the Promise command sequencer present on all modern Promisesos2004-04-131-0/+1
| | | | | | | | | | | | | | | | | controllers (PDC203** PDC206**). This also adds preliminary support for the Promise SX4/SX4000 but *only* as a "normal" Promise ATA controller (ATA RAID's are supported though but only RAID0, RAID1 and RAID0+1). This cuts off yet another 5-8% of the command overhead on promise controllers, making them the fastest we have ever had support for. Work is now continuing to add support for this in ATA RAID, to accellerate ATA RAID quite a bit on these controllers, and especially the SX4/SX4000 series as they have quite a few tricks in there.. This commit also adds a few fixes to the SATA code needed for proper support.
* Use UMA instead of plain malloc for getting ATA request storage.sos2004-01-141-0/+1
| | | | | | | This gives +10% performance on simple tests, so definitly worth it. A few percent more could be had by not using M_ZERO'd alloc's, but we then need to clear fields all over the place to be safe, and that was deemed not worth the trouble (and it makes life dangerous).
* Overhaul of the timeout/reinit framework. This should clear up mostsos2004-01-111-1/+2
| | | | | | | | | | | | 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..
* Fix ata-card.sos2003-11-301-37/+27
| | | | | | | | | 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@
* Include pccard/pccard_cis.h here tooimp2003-10-071-1/+2
|
* Unify prototypes.sos2003-08-251-1/+1
| | | | Cosmetics.
* Use __FBSDID().obrien2003-08-241-2/+3
| | | | Also some minor style cleanups.
* This is a major rework of the ATA driver (ATAng)sos2003-08-241-3/+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.
* Remove check to see if the get resource for the second resourceimp2003-06-271-4/+0
| | | | | | | | | | | | | | 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
* Add FREECOM PCCARD-IDE to the mix. It doesn't have a manufacturer orimp2003-06-171-0/+1
| | | | | | product ID, so we have to use the CIS strings to ID it. dmesg by: Christian Laursen
* Add support for generic PMCICA ATA CARDimp2003-06-031-0/+1
|
* Fix an off-by-1 error.phk2003-05-121-1/+1
| | | | | | Found by: FlexeLint Reviewed by: sos Approved by: re/rwatson
* MF-p4:imp2003-04-261-1/+19
| | | | | | | "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.
* Second round of updates to the ATA driver.sos2003-03-291-7/+42
| | | | | | | | | | | | 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
* Always set the setmode funcptr.sos2003-03-031-0/+9
|
* First round off updates/fixes to the ATA driver.sos2003-02-201-9/+2
| | | | | | | | | | | | 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
* Fix linking problem when atadisk is not use in ata-all.csos2002-12-061-1/+13
| | | | | | Add dummy intr_func and lock_func to ata-card.c Dont call ad_print if the driver decided there is no disk.
* Remove unused #includes: <sys/disk.h> <sys/devicestat.h> and <sys/sysctl.h>phk2002-09-201-3/+0
| | | | | Sponsored by: DARPA & NAI Labs. Approved by: sos
* remove #includes of <sys/bio.h> where not needed.phk2002-09-141-1/+0
|
* Major update of the ATA RAID code, part 1:sos2002-02-041-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add support for pccard.sos2002-01-281-3/+30
| | | | submitted by: imp
* Overhaul to minimize stack usage, in some places >2K was usedsos2001-09-201-1/+1
| | | | on the stack *blush*...
* Split out the ata probes in seperate files for each bus type.sos2001-03-061-0/+108
OpenPOWER on IntegriCloud