[PATCH] libata: return sense data in HDIO_DRIVE_CMD ioctl
authorEran Tromer <eran@tromer.org>
Tue, 10 Oct 2006 21:29:25 +0000 (14:29 -0700)
committerJeff Garzik <jeff@garzik.org>
Wed, 11 Oct 2006 08:18:07 +0000 (04:18 -0400)
commitbbe1fe7ea3438f8c4447dbcd46a126581ed2ed41
tree5b1eec4a822887a2f1380f6a0aa649322c986a91
parent4ad99f15c6a3cadf36928c399459ea4fdb3d49f9
[PATCH] libata: return sense data in HDIO_DRIVE_CMD ioctl

Make the HDIO_DRIVE_CMD ioctl in libata (ATA command pass through) return a
few ATA registers to userspace, following the same convention as the
drivers/ide implementation of the same ioctl.  This is needed to support ATA
commands like CHECK POWER MODE, which return information in nsectors.

This fixes "hdparm -C" on SATA drives.

Forcing the sense data read via the cc flag causes spurious check conditions,
so we filter these out (following the ATA command pass-through specification
T10/04-262r7).

Signed-off-by: Eran Tromer <eran@tromer.org>
Acked-by: Tejun Heo <htejun@gmail.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/ata/libata-scsi.c