Commit Graph

58 Commits

Author SHA1 Message Date
Craig Rodrigues
8d1a3b6998 Add a "kern.features.ata_cam" sysctl in the kernel when the ATA_CAM kernel
option is defined.  This sysctl can be queried by feature_present(3).

Query for this feature in /sbin/atacontrol and /usr/sbin/burncd.
If these utilities detect that ATA_CAM is enabled, then these utilities
will error out.  These utilities are compatible with the old ATA
driver, but are incomptible with the new ATA_CAM driver.  By erroring out,
we give end-users an idea as to what remedies to use, and reduce the need for them
to file PR's.  For atacontrol, camcontrol must be used instead,
and for burncd, alternative utilties from the ports collection must be used
such as sysutils/cdrtools.

In future, maybe someone can re-write burncd to work with ATA_CAM,
but at least for now, we give a somewhat useful error message to end users.

PR:		160979
Reviewed by:	jh, Arnaud Lacombe <lacombar at gmail dot com>
Reported by:	Joe Barbish <fbsd8 at a1poweruser dot com>
MFC after:	3 days
2011-10-09 21:42:02 +00:00
Ulrich Spörlein
6e18fca127 Re-encode files from ISO-8859-1 to UTF-8 2011-05-22 14:03:30 +00:00
Alexander Motin
6a5d28b93a Improve output for controllers that doesn't report SATA speed. 2010-02-22 10:45:40 +00:00
Alexander Motin
066f913a94 MFp4:
Introduce ATA_CAM kernel option, turning ata(4) controller drivers into
cam(4) interface modules. When enabled, this options deprecates all ata(4)
peripheral drivers (ad, acd, ...) and interfaces and allows cam(4) drivers
(ada, cd, ...) and interfaces to be natively used instead.

As side effect of this, ata(4) mode setting code was completely rewritten
to make controller API more strict and permit above change. While doing
this, SATA revision was separated from PATA mode. It allows DMA-incapable
SATA devices to operate and makes hw.ata.atapi_dma tunable work again.

Also allow ata(4) controller drivers (except some specific or broken ones)
to handle larger data transfers. Previous constraint of 64K was artificial
and is not really required by PCI ATA BM specification or hardware.

Submitted by:	nwitehorn (powerpc part)
2009-12-06 00:10:13 +00:00
Alexander Motin
bcbe578a6a Drop USB mass storage devices support from ata(4). It is out of the build as
long as I remember, and completely superseded by better maintained umass(4).
It's main idea was to optionally avoid CAM dependency for such devices, but
with move ATA to CAM, it is not actual any more.

No objections:	hselasky@, thompsa@, arch@
2009-11-26 12:41:43 +00:00
Alexander Motin
72e2ce370d Add some missing WDMA/UDMA modes. 2009-11-22 10:53:26 +00:00
Alexander Motin
18d7e39ee7 Bring SATA revision reporting into conformance with SATA-IO guidelines. 2009-02-23 22:29:38 +00:00
Alexander Motin
91b791a38f Add SATA and USB modes for completeness. USB modes principally can't be set,
SATA mode setting is not implementes at this time.

Submitted by:	Christoph Mallon
2009-02-22 18:22:21 +00:00
Roman Divacky
1cf0b25f91 Display an error message when the requested mode is not known. So the user can
distinguish between a typo in the mode name and that the device does not
support a certain mode (till now both causes show the same result, i.e. the old
mode is displayed).

Submitted by:	Christoph Mallon <christoph.mallon gmx.de>
Approved by:	kib (mentor)
2009-02-19 20:45:37 +00:00
Antoine Brodin
5718b3f2c0 Make atacontrol(8) rebuild work when /usr is not mounted or from /rescue
PR:		bin/125680
MFC after:	1 month
Tested by:	Stef Walter
2008-08-06 18:08:02 +00:00
Poul-Henning Kamp
8680fabaa8 Fix for a bug I introduced when I cleaned up atacontrol: Don't terminate
if we are listing devices, a controller might legitimately not be there.

Submitted by:	"Andrey V. Elsukov" <bu7cher@yandex.ru>
2008-05-15 01:25:29 +00:00
Poul-Henning Kamp
72d945abcc Add a "spindown" facility to ata-disks: If no requests have been received
for a configurable number of seconds, spin the disk down.  Spin it back
up on the next request.

Notice that the timeout is only armed by a request, so to spin down a
disk you may have to do:

	atacontrol spindown ad10 5
	dd if=/dev/ad10 of=/dev/null count=1

To disable spindown, set timeout to zero:

	atacontrol spindown ad10 0

In order to debug any trouble caused, this code is somewhat noisy on the
console.

Enabling spindown on a disk containing / or /var/log/messages is not
going to do anything sensible.

Spinning a disk up and down all the time will wear it out, use sensibly.

Approved by:	sos
2008-03-17 10:33:23 +00:00
Poul-Henning Kamp
f64275189c Un-cut&paste argument processing, fix things lint found. 2008-03-16 17:54:55 +00:00
Poul-Henning Kamp
e34f6b7311 Recognize CFA devices using either identification method. 2007-12-16 21:19:07 +00:00
Poul-Henning Kamp
9d599522c3 Report CFA extension, CFA -> (Compact) Flash Association 2007-12-16 15:11:40 +00:00
John Baldwin
14657ee81f Expand the data structure returned by the ATA RAID status ioctl to include
detailed status on each of the backing subdisks.  This allows userland
to see which subdisks are online, failed, missing, or a hot spare.

MFC after:	1 week
Approved by:	re (bmah)
Reviewed by:	sos
2007-08-13 18:46:31 +00:00
Søren Schmidt
997021111e Add new modes. 2006-03-15 19:32:43 +00:00
Søren Schmidt
9e6b35bff3 Remove accidental debug leftovers. 2006-01-30 10:19:38 +00:00
Søren Schmidt
247c37e782 Update copyright header to match rest of ATA. 2006-01-23 08:49:50 +00:00
Søren Schmidt
d0b8e03914 Properly print the SATA protocal version. 2006-01-18 10:01:43 +00:00
Maxim Konovalov
54ccb3ac94 o Correct usage(): delete command takes as argument array not channel.
PR:		bin/90353
Submitted by:	Gavin Atkinson
MFC after:	1 week
2005-12-14 06:33:18 +00:00
Søren Schmidt
3ea7aedd41 Fix status to report status from the given array. 2005-08-05 13:08:02 +00:00
Søren Schmidt
265fa8db1d Open devices RDONLY for ioctls. That makes it work on open devices to which
GEOM doesn't allow WR access.
2005-06-06 20:46:51 +00:00
Søren Schmidt
06b97dbc13 Print the rigth argv string on error (too much c&p).. 2005-05-20 06:23:40 +00:00
Søren Schmidt
6667b30d15 Change the way ioctls are issue to ATA.
The most prominent part is that its now possible to issue ata_requests
directly to say acd0, instead of going through the cumbersome /dev/ata
device.
2005-05-16 13:07:27 +00:00
Søren Schmidt
8ca4df3299 This is the much rumoured ATA mkIII update that I've been working on.
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)
2005-03-30 12:03:40 +00:00
Søren Schmidt
536beae5a8 Distinguish between TCQ and NCQ type of tagged queing. 2004-09-15 11:22:05 +00:00
Dag-Erling Smørgrav
5a0581860f Whitespace cleanup. 2004-05-20 15:01:26 +00:00
Søren Schmidt
d7659cb1ac Add printing of relevant SATA info where approbiate. 2004-03-15 13:21:41 +00:00
Søren Schmidt
ad836d50cb Cosmetics 2004-01-21 21:31:19 +00:00
Johan Karlsson
8fbf7d0847 Make sure argv[x] exists before using it.
PR:		56696
Reported by:	Igor Truszkowski <igort@intergate.pl>
Submitted by:	maxim@
Approved by:	sos@
MFC after:	2 weeks
2003-11-05 21:56:21 +00:00
Johan Karlsson
8fb7e78565 Make this WARNS=6 clean by:
- declaring 'mode2str' as returning a 'const char *'
 - prototyping all function
 - rename the argument 'version' to 'ver', not to shadow
        the now prototyped function 'version'.

Also mark it as WARNS?= 6 clean to try to keep it clean.

Tested by:	make universe (including amd64)
2003-11-05 19:20:41 +00:00
Søren Schmidt
e0b4a710b6 Adjust to the new sys/ata.h layout 2003-08-24 09:23:54 +00:00
Søren Schmidt
e5f8aed520 DOnt allow getting caps from other than master and slave device :) 2003-05-05 10:28:37 +00:00
Søren Schmidt
0a2b02fe0a Added more descriptive error outputs.
PR:	46096
2003-05-04 09:51:06 +00:00
Søren Schmidt
7ed6898c2f On getting status print the stripesize on RAID0's. 2003-05-04 09:28:43 +00:00
Søren Schmidt
0a124c3704 Add "addspare" functionality. 2003-05-02 12:42:31 +00:00
Johan Karlsson
c0bb08c5ed Make this WARNS=2 clean by using %j and (uintmax_t).
Reviewed by:	tjr@ on audit@
Approved by:	silence from sos@
2003-04-22 19:57:46 +00:00
Maxime Henrion
0a50de79cb - Add a new ioctl to get the maximum number of ATA channels.
- Use it in atacontrol(8) when listing ATA devices instead of
  stopping at the first ENXIO received.

This makes atacontrol list work on my sparc64 where the two ATA
channels I have are numbered 2 and 3.

Reviewed by:	sos
2003-03-22 12:18:20 +00:00
Mike Barcroft
2c16ed2973 Don't depend on <sys/types.h> pollution in <fcntl.h>. Sort includes. 2002-09-16 08:34:08 +00:00
Søren Schmidt
ed8a242cef Use the proper fields for security.
PR: 41870
2002-09-12 14:08:28 +00:00
Søren Schmidt
cc6666dc21 Also print the serial # on atacontrol cap .... 2002-07-31 18:30:38 +00:00
Søren Schmidt
2f1eaa933e Sync with the new endianness in ata.h 2002-04-05 21:51:03 +00:00
Søren Schmidt
99bb242b53 Be able to print ATA133 mode. 2002-04-05 11:49:24 +00:00
Søren Schmidt
3348c0092c Add get-status to the ATA RAID subsystem. 2002-04-02 13:48:17 +00:00
Søren Schmidt
4486f609fc Add support for getting status (fan, temp, 5V and 12V levels) from
Promise Superswap enclosures.

Sponsored by: Advanis
2002-03-30 16:36:41 +00:00
Søren Schmidt
f642c834f4 Add support for creating/deleting ATA RAID's
Sponsored by: Advanis
2002-03-27 10:59:53 +00:00
Søren Schmidt
c75ece6633 Check the <channel> arg a bit more.
Submitted by: David Malone <dwmalone@maths.tcd.ie>
2002-03-10 13:59:00 +00:00
Søren Schmidt
de7997511b Update headers 2002-03-04 21:11:30 +00:00
Søren Schmidt
0df4b5542c Add the RAID rebuild command. 2002-03-03 15:41:57 +00:00