]> www.infradead.org Git - users/jedix/linux-maple.git/commit
usb-storage: Accept 8020i-protocol commands longer than 12 bytes
authorAlan Stern <stern@rowland.harvard.edu>
Tue, 25 Oct 2011 14:50:58 +0000 (10:50 -0400)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Thu, 8 Dec 2011 19:19:19 +0000 (11:19 -0800)
commita7711112b4fa73ff889741d35fda358108e0e6b8
tree4d953f67be077716f73559e81c059ad4a3ab7cc6
parentdcb8c1c8ef907e3f7c8a05e2c9d3a4b534580f09
usb-storage: Accept 8020i-protocol commands longer than 12 bytes

commit 2f640bf4c94324aeaa1b6385c10aab8c5ad1e1cf upstream.

The 8020i protocol (also 8070i and QIC-157) uses 12-byte commands;
shorter commands must be padded.  Simon Detheridge reports that his
3-TB USB disk drive claims to use the 8020i protocol (which is
normally meant for ATAPI devices like CD drives), and because of its
large size, the disk drive requires the use of 16-byte commands.
However the usb_stor_pad12_command() routine in usb-storage always
sets the command length to 12, making the drive impossible to use.

Since the SFF-8020i specification allows for 16-byte commands in
future extensions, we may as well accept them.  This patch (as1490)
changes usb_stor_pad12_command() to leave commands larger than 12
bytes alone rather than truncating them.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Simon Detheridge <simon@widgit.com>
CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/storage/protocol.c