From d277064e7e16d02e0078a6bc1820764ae00dea87 Mon Sep 17 00:00:00 2001 From: matthieu castet Date: Wed, 19 Mar 2008 19:40:52 +0100 Subject: 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 Signed-off-by: Matthew Dharm Signed-off-by: Greg Kroah-Hartman --- drivers/usb/storage/usb.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/usb/storage/usb.c') diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index ac6114eea0c..f59593de3b8 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c @@ -101,6 +101,9 @@ #ifdef CONFIG_USB_STORAGE_KARMA #include "karma.h" #endif +#ifdef CONFIG_USB_STORAGE_CYPRESS_ATACB +#include "cypress_atacb.h" +#endif /* Some informational data */ MODULE_AUTHOR("Matthew Dharm "); @@ -708,6 +711,13 @@ static int get_protocol(struct us_data *us) break; #endif +#ifdef CONFIG_USB_STORAGE_CYPRESS_ATACB + case US_SC_CYP_ATACB: + us->protocol_name = "Transparent SCSI with Cypress ATACB"; + us->proto_handler = cypress_atacb_passthrough; + break; +#endif + default: return -EIO; } -- cgit v1.2.3