Commit Graph

52 Commits

Author SHA1 Message Date
mav
7f1b7b0799 Bring SATA revision reporting into conformance with SATA-IO guidelines. 2009-02-23 22:29:38 +00:00
mav
6a9085269a 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
rdivacky
190e541ba0 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
58dd6e51d2 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
phk
c9d3114663 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
phk
916647a52a 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
phk
2c03b45538 Un-cut&paste argument processing, fix things lint found. 2008-03-16 17:54:55 +00:00
phk
1cc7475e87 Recognize CFA devices using either identification method. 2007-12-16 21:19:07 +00:00
phk
3406c02d4a Report CFA extension, CFA -> (Compact) Flash Association 2007-12-16 15:11:40 +00:00
jhb
47d488244c 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
sos
66352fecee Add new modes. 2006-03-15 19:32:43 +00:00
sos
8681571f4b Remove accidental debug leftovers. 2006-01-30 10:19:38 +00:00
sos
769267adae Update copyright header to match rest of ATA. 2006-01-23 08:49:50 +00:00
sos
b35a42e718 Properly print the SATA protocal version. 2006-01-18 10:01:43 +00:00
maxim
265803afe8 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
sos
ed266019ee Fix status to report status from the given array. 2005-08-05 13:08:02 +00:00
sos
877683a848 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
sos
ac2cc57f35 Print the rigth argv string on error (too much c&p).. 2005-05-20 06:23:40 +00:00
sos
05399c3127 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
sos
f820cdfe29 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
sos
68af55d74a Distinguish between TCQ and NCQ type of tagged queing. 2004-09-15 11:22:05 +00:00
des
9d30610b24 Whitespace cleanup. 2004-05-20 15:01:26 +00:00
sos
127008a266 Add printing of relevant SATA info where approbiate. 2004-03-15 13:21:41 +00:00
sos
7b3d7d7361 Cosmetics 2004-01-21 21:31:19 +00:00
johan
6422f144d7 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
0bae88cecd 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
sos
7ddb450cd6 Adjust to the new sys/ata.h layout 2003-08-24 09:23:54 +00:00
sos
5e7892f0e3 DOnt allow getting caps from other than master and slave device :) 2003-05-05 10:28:37 +00:00
sos
33aa8ec186 Added more descriptive error outputs.
PR:	46096
2003-05-04 09:51:06 +00:00
sos
0383b05a47 On getting status print the stripesize on RAID0's. 2003-05-04 09:28:43 +00:00
sos
282348e1fa Add "addspare" functionality. 2003-05-02 12:42:31 +00:00
johan
3cd76cb1f7 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
mux
41824db1c6 - 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
bd0063350a Don't depend on <sys/types.h> pollution in <fcntl.h>. Sort includes. 2002-09-16 08:34:08 +00:00
sos
ff0e7d967c Use the proper fields for security.
PR: 41870
2002-09-12 14:08:28 +00:00
sos
ab8cfd574b Also print the serial # on atacontrol cap .... 2002-07-31 18:30:38 +00:00
sos
251be3e5cd Sync with the new endianness in ata.h 2002-04-05 21:51:03 +00:00
sos
3fd899708c Be able to print ATA133 mode. 2002-04-05 11:49:24 +00:00
sos
9b962a4e9b Add get-status to the ATA RAID subsystem. 2002-04-02 13:48:17 +00:00
sos
65dd7ee2d6 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
sos
143359e917 Add support for creating/deleting ATA RAID's
Sponsored by: Advanis
2002-03-27 10:59:53 +00:00
sos
7acee01805 Check the <channel> arg a bit more.
Submitted by: David Malone <dwmalone@maths.tcd.ie>
2002-03-10 13:59:00 +00:00
sos
a7336f1ad6 Update headers 2002-03-04 21:11:30 +00:00
sos
a40226defb Add the RAID rebuild command. 2002-03-03 15:41:57 +00:00
sos
fbd1043c42 Match the requirements of the new kernel structures. 2002-02-04 19:24:43 +00:00
sos
d1756c2eb0 Update to reflect the change in ata.h
Forgotten by: sos
2001-10-07 07:48:12 +00:00
sos
50fdd52eff Fix bogon introduce by last commit. 2001-05-18 11:38:58 +00:00
sos
e70764b25c Update to use the new ioctl interface.
Add the list command.
2001-05-17 10:30:07 +00:00
sos
bb8c9777fd Some minor cleanups to the code, no new functionality. 2001-03-19 07:58:47 +00:00
imp
c0ee5dbaf8 Back out ru's changes. Soren has requested this and I see no reason
to not just do it.  It is his new code that is being actively
developed so he has say over it.  ru's direct changes were premature
as they occurred less than 4 hours after it was committed to the tree.
2001-03-16 08:07:00 +00:00