From: Matthew Dharm <mdharm-kernel@one-eyed-alien.net>
To: matthieu castet <castet.matthieu@free.fr>
Cc: linux-usb@vger.kernel.org,
Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mass storage : emulation of sat scsi_pass_thru with ATACB
Date: Sun, 9 Mar 2008 18:20:14 -0700 [thread overview]
Message-ID: <20080310012014.GG2820@one-eyed-alien.net> (raw)
In-Reply-To: <47D459DA.20207@free.fr>
[-- Attachment #1: Type: text/plain, Size: 2417 bytes --]
On Sun, Mar 09, 2008 at 10:42:50PM +0100, matthieu castet wrote:
> Hi
>
> here an update version of the patch
We're getting very close here.
> + /* this value can change, but most(all ?) manufacturers keep the
> cypress
> + * default : 0x24
> + */
Line wrap problem. This happens a few times in your patch, but this was
the first one I noticed.
> + srb->cmnd[0] = 0x24;
> + srb->cmnd[1] = 0x24;
> + srb->cmnd[2] = 0;
> +
> + srb->cmnd[3] = 0xff - 1;
> + srb->cmnd[4] = 1;
What are these magic constants? Symbolic names or comments would be
apropriate here.
> + if (srb->cmnd[12] == ATA_CMD_ID_ATA || srb->cmnd[12] ==
> ATA_CMD_ID_ATAPI)
> + srb->cmnd[2] |= (1<<7);
What does this block do? In general, you could use some more comments
about the code flow...
> + /* if the device doesn't support ATACB
> + * abort and register usb_stor_transparent_scsi_command
> + * callback
> + */
> + if (srb->result == SAM_STAT_CHECK_CONDITION &&
> + memcmp(srb->sense_buffer, usb_stor_sense_invalidCDB,
> + sizeof(usb_stor_sense_invalidCDB)) == 0) {
> + us->subclass = US_SC_SCSI;
> + us->proto_handler = usb_stor_transparent_scsi_command;
> + goto end;
> + }
This is an interesting section of code. Do you have reason to believe that
some of the units you've claimed via unusual_devs.h do not support this
protocol, or are you just being forward-looking?
Either way, some debug printout would be good here...
> --- linux-2.6.24.2.orig/include/linux/usb_usual.h 2008-03-09
> 21:15:01.000000000 +0100
> +++ linux-2.6.24.2/include/linux/usb_usual.h 2008-03-09
> 21:24:12.000000000 +0100
> @@ -81,8 +81,9 @@
> #define US_SC_8070 0x05 /* Removable media */
> #define US_SC_SCSI 0x06 /* Transparent */
> #define US_SC_ISD200 0x07 /* ISD200 ATA */
> +#define US_SC_CYP_ATACB 0x08 /* Cypress ATACB */
> #define US_SC_MIN US_SC_RBC
> -#define US_SC_MAX US_SC_ISD200
> +#define US_SC_MAX US_SC_CYP_ATACB
>
> #define US_SC_DEVICE 0xff /* Use device's value */
I thought we changed this so that the non-spec protocols started from 0xfe
and worked their way down?
Matt
--
Matthew Dharm Home: mdharm-usb@one-eyed-alien.net
Maintainer, Linux USB Mass Storage Driver
C: They kicked your ass, didn't they?
S: They were cheating!
-- The Chief and Stef
User Friendly, 11/19/1997
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2008-03-10 1:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-08 17:32 matthieu castet
2008-03-08 18:31 ` Matthew Dharm
2008-03-08 20:08 ` matthieu castet
2008-03-08 21:21 ` Matthew Dharm
2008-03-09 8:21 ` matthieu castet
2008-03-09 18:45 ` Matthew Dharm
2008-03-09 21:42 ` matthieu castet
2008-03-10 1:20 ` Matthew Dharm [this message]
2008-03-13 21:22 ` matthieu castet
2008-03-14 0:51 ` Matthew Dharm
[not found] ` <20080318221207.GY2820@one-eyed-alien.net>
2008-03-19 18:40 ` matthieu castet
2008-03-19 20:02 ` Matthew Dharm
2008-03-20 21:39 ` patch usb-mass-storage-emulation-of-sat-scsi_pass_thru-with-atacb.patch added to gregkh-2.6 tree gregkh
2008-03-09 10:13 ` [PATCH] mass storage : emulation of sat scsi_pass_thru with ATACB Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080310012014.GG2820@one-eyed-alien.net \
--to=mdharm-kernel@one-eyed-alien.net \
--cc=castet.matthieu@free.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome