aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/storage/usb.c
diff options
context:
space:
mode:
authormatthieu castet <castet.matthieu@free.fr>2008-03-19 14:40:52 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-04-25 00:16:42 -0400
commitd277064e7e16d02e0078a6bc1820764ae00dea87 (patch)
tree18f78d06f8bc3d5a57a04ac46d4f75ca5757faad /drivers/usb/storage/usb.c
parentdda43a0e03a33dd716fb34f812b1af614f74daff (diff)
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>
Diffstat (limited to 'drivers/usb/storage/usb.c')
-rw-r--r--drivers/usb/storage/usb.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index ac6114eea0c3..f59593de3b8f 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -101,6 +101,9 @@
101#ifdef CONFIG_USB_STORAGE_KARMA 101#ifdef CONFIG_USB_STORAGE_KARMA
102#include "karma.h" 102#include "karma.h"
103#endif 103#endif
104#ifdef CONFIG_USB_STORAGE_CYPRESS_ATACB
105#include "cypress_atacb.h"
106#endif
104 107
105/* Some informational data */ 108/* Some informational data */
106MODULE_AUTHOR("Matthew Dharm <mdharm-usb@one-eyed-alien.net>"); 109MODULE_AUTHOR("Matthew Dharm <mdharm-usb@one-eyed-alien.net>");
@@ -708,6 +711,13 @@ static int get_protocol(struct us_data *us)
708 break; 711 break;
709#endif 712#endif
710 713
714#ifdef CONFIG_USB_STORAGE_CYPRESS_ATACB
715 case US_SC_CYP_ATACB:
716 us->protocol_name = "Transparent SCSI with Cypress ATACB";
717 us->proto_handler = cypress_atacb_passthrough;
718 break;
719#endif
720
711 default: 721 default:
712 return -EIO; 722 return -EIO;
713 } 723 }