USB: mass storage: emulation of sat scsi_pass_thru with ATACB
authormatthieu castet <castet.matthieu@free.fr>
Wed, 19 Mar 2008 18:40:52 +0000 (19:40 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 25 Apr 2008 04:16:42 +0000 (21:16 -0700)
commitd277064e7e16d02e0078a6bc1820764ae00dea87
tree18f78d06f8bc3d5a57a04ac46d4f75ca5757faad
parentdda43a0e03a33dd716fb34f812b1af614f74daff
USB: mass storage: emulation of sat scsi_pass_thru with ATACB

I have got a cypress usb-ide bridge and I would like to tune or monitor
my disk with tools like hdparm, hddtemp or smartctl.

My controller support a way to send raw ATA command to the disk with
something call atacb (see
http://download.cypress.com.edgesuite.net/design_resources/datasheets/contents/cy7c68300c_8.pdf).

Atacb support can be added for each application, but there is some disadvantages :
- all application need to be patched
- A race is possible if there other accesses, because the emulation can
be split in 2 atacb scsi transactions. One for sending the command, one
for reading the register (if ck_cond is set).

I have implemented the emulation in usb-storage with a special proto_handler,
and an unsual entry.

Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/storage/Kconfig
drivers/usb/storage/Makefile
drivers/usb/storage/cypress_atacb.c [new file with mode: 0644]
drivers/usb/storage/cypress_atacb.h [new file with mode: 0644]
drivers/usb/storage/scsiglue.c
drivers/usb/storage/transport.c
drivers/usb/storage/unusual_devs.h
drivers/usb/storage/usb.c
include/linux/usb_usual.h