Re: Q: how to send ATA cmds to USB drive?



int scsi_dispatch_cmd(struct scsi_cmnd *cmd)
...
/*
* If SCSI-2 or lower, store the LUN value in cmnd.
*/
if (cmd->device->scsi_level <= SCSI_2) {
cmd->cmnd[1] = (cmd->cmnd[1] & 0x1f) |
(cmd->device->lun << 5 & 0xe0);
}

hm. now what .... ? If scsi-2 requires this, and the device is scsi-2.

actually, the scsi-level reported by the device is *not* 2.

it is set to 2 by "slave_configure" from drivers/usb/storage/scsiglue.c:

static int slave_configure(struct scsi_device *sdev)
{
...
/* Set the SCSI level to at least 2. We'll leave it at 3 if that's
* what is originally reported. We need this to avoid confusing
* the SCSI layer with devices that report 0 or 1, but need 10-byte
* commands (ala ATAPI devices behind certain bridges, or devices
^^^^^^^^^^^^^^^

the CY7C68310 is exactly that.

* which simply have broken INQUIRY data).
...

if (sdev->scsi_level < SCSI_2)
sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2;


kind regards,
h.rosmanith
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: RSG
    ... restore mailbox data is through a RSG? ... The filesystem snapshot I have restored from tape to a seperate san ... lun and then presented the lun to the server. ... pointers and resides on the same LUN as the running store. ...
    (microsoft.public.exchange.admin)
  • Re: Moving large stores between LUNs
    ... no consistency checks or rebuilding of Store. ... MVP - Exchange ... NEW blog location: ... manually, move files to new LUN, and either map the LUN to the same drive ...
    (microsoft.public.exchange.admin)
  • Re: Moving large stores between LUNs
    ... MVP - Exchange ... manually, move files to new LUN, and either map the LUN to the same drive ... and then manually mount the Store again. ...
    (microsoft.public.exchange.admin)
  • Re: Moving large stores between LUNs
    ... I've done some large stores from ESM. ... moving a store using ESM is just that, ... manually, move files to new LUN, and either map the LUN to the same drive ...
    (microsoft.public.exchange.admin)
  • [PATCH] tpm: use wait_event return code and msecs_to_jiffies
    ... just store the return value of wait_event_interruptible_timeout? ... Update the usage of wait_event calls to utilize the return code and ... static int request_locality(struct tpm_chip *chip, ...
    (Linux-Kernel)