Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: [linux-usb-devel] Re: [PATCH] Adaptec USBXchange and USB2Xchange support

63 views
Skip to first unread message

René Rebe

unread,
Jan 30, 2006, 10:37:33 AM1/30/06
to Oliver Neukum, linux-u...@lists.sourceforge.net, Andrew Morton, linux-...@vger.kernel.org
Hi,

On Monday 30 January 2006 16:22, Oliver Neukum wrote:
> Am Montag, 30. Januar 2006 14:22 schrieb René Rebe:
> > +       /* Stop CPU */
> > +       err = usbxchange_set_reset(dev, cpureg, 1);
> > +       err = usbxchange_set_reset(dev, cpureg, 1);
> > +       if (err < 0) {
> > +               printk(KERN_ERR "%s -
error stopping dongle CPU: error = %d\n",
> > +                      __FUNCTI
ON__, err);
> > +               return err;
> > +       }
>
> [..]
>
> > +       /* De-assert reset (let the CPU run) */
> > +       err = usbxchange_set_reset(dev, cpureg, 1);
> > +       err = usbxchange_set_reset(dev, cpureg, 0);
> > +       if (err < 0) {
> > +               printk(KERN_ERR "%s -
error resetting dongle CPU: error = %d\n",
> > +                      __FUNCTI
ON__, err);
> > +               return err;
> > +       }
>
> Do you really want to ignore errors the first usbxchange_set_reset()s
return?

It is not really likely that the first one fails and the second succeed
s. But yes,
I could add an if (err == 0) before the 2nd send and skip it when t
he first already
failed.

I can resent with more suggestions accumulated.

Yours,

--
René Rebe - Rubensstr. 64 - 12157 Berlin (Europe / Germany)
http://www.exactcode.de | http://www.t2-project.org
+49 (0)30 255 897 45
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel"
in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

René Rebe

unread,
Jan 30, 2006, 1:05:12 PM1/30/06
to Oliver Neukum, linux-u...@lists.sourceforge.net, linux-...@vger.kernel.org, Louis C. Kouvaris, wilford smith
Hi,

finally - I got multi target (that is a SCSI device other than ID = 0
and more than than one) working
with the USB2Xchange. But it needs two ugly changes in transport.c:

The first one is only encoding the ID, no LUN:

--- ../linux-2.6.15/drivers/usb/storage/transport.c 2006-01-03 04:21:10
000000000 +0100
+++ drivers/usb/storage/transport.c 2006-01-30 18:49:25.172317000 +0100
@@ -983,7 +983,7 @@
bcb->Tag = ++us->tag;
bcb->Lun = srb->device->lun;
if (us->flags & US_FL_SCM_MULT_TARG)
- bcb->Lun |= srb->device->id << 4;
+ bcb->Lun = srb->device->id;
bcb->Length = srb->cmd_len;

/* copy the command payload */

Would it be ok when special case that one only for the Adaptec device,
for now?
Or define a whole new 2nd MULTI_TARG(2) quirk?

And furthermore the device does not respond to request other than the a
ttached targets,
this might be needed:

@@ -1069,6 +1069,19 @@
US_DEBUGP("Bulk Status S 0x%x T 0x%x R %u Stat 0x%x\n",
le32_to_cpu(bcs->Signature), bcs->Tag,
residue, bcs->Status);
+
+ if (bcs->Status > US_BULK_STAT_FAIL) {
+ /* Adaptec USB2XCHANGE */
+ if (us->pusb_dev->descriptor.idVendor == 0x03f3 &&
+ us->pusb_dev->descriptor.idProduct == 0x2003) {
+
+ /* This device will send bcs->Status == 0x8a for unused targets
and
+ == 0x02 for SRB's that require SENSE. */
+ bcs->Status = US_BULK_STAT_OK;
+ fake_sense = 1;
+ US_DEBUGP("Patched Bulk status to %d.\n", bcs->Status);
+ }
+ }
if (bcs->Tag != us->tag || bcs->Status > US_BULK_STAT_PHASE) {
US_DEBUGP("Bulk logical error\n");
return USB_STOR_TRANSPORT_ERROR;

Matthew Dharm

unread,
Jan 30, 2006, 4:39:43 PM1/30/06
to R...@one-eyed-alien.net, Oliver Neukum, linux-u...@lists.sourceforge.net, linux-...@vger.kernel.org, Louis C. Kouvaris, wilford smith
So how do you address a multi-LUN device with the USB2Xchange?

Matt

On Mon, Jan 30, 2006 at 07:04:15PM +0100, Ren? Rebe wrote:
> Hi,
>
> finally - I got multi target (that is a SCSI device other than ID = 0 and more than than one) working
> with the USB2Xchange. But it needs two ugly changes in transport.c:
>
> The first one is only encoding the ID, no LUN:
>

> --- ../linux-2.6.15/drivers/usb/storage/transport.c 2006-01-03 04:21:10.000000000 +0100


> +++ drivers/usb/storage/transport.c 2006-01-30 18:49:25.172317000 +0100
> @@ -983,7 +983,7 @@
> bcb->Tag = ++us->tag;
> bcb->Lun = srb->device->lun;
> if (us->flags & US_FL_SCM_MULT_TARG)
> - bcb->Lun |= srb->device->id << 4;
> + bcb->Lun = srb->device->id;
> bcb->Length = srb->cmd_len;
>
> /* copy the command payload */
>
> Would it be ok when special case that one only for the Adaptec device, for now?
> Or define a whole new 2nd MULTI_TARG(2) quirk?
>

> And furthermore the device does not respond to request other than the attached targets,

> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd_______________________________________________
> linux-u...@lists.sourceforge.net
> To unsubscribe, use the last form field at:
> https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

--
Matthew Dharm Home: mdhar...@one-eyed-alien.net
Maintainer, Linux USB Mass Storage Driver

NYET! The evil stops here!
-- Pitr
User Friendly, 6/22/1998

Matthew Dharm

unread,
Jan 30, 2006, 4:40:48 PM1/30/06
to Ren Rebe, Oliver Neukum, linux-u...@lists.sourceforge.net, linux-...@vger.kernel.org, Louis C. Kouvaris, wilford smith
So how do you address a multi-LUN target if you don't encode the LUN?

Matt

On Mon, Jan 30, 2006 at 07:04:15PM +0100, Ren? Rebe wrote:

> Hi,
>
> finally - I got multi target (that is a SCSI device other than ID = 0 and more than than one) working
> with the USB2Xchange. But it needs two ugly changes in transport.c:
>
> The first one is only encoding the ID, no LUN:
>

> --- ../linux-2.6.15/drivers/usb/storage/transport.c 2006-01-03 04:21:10.000000000 +0100


> +++ drivers/usb/storage/transport.c 2006-01-30 18:49:25.172317000 +0100
> @@ -983,7 +983,7 @@
> bcb->Tag = ++us->tag;
> bcb->Lun = srb->device->lun;
> if (us->flags & US_FL_SCM_MULT_TARG)
> - bcb->Lun |= srb->device->id << 4;
> + bcb->Lun = srb->device->id;
> bcb->Length = srb->cmd_len;
>
> /* copy the command payload */
>
> Would it be ok when special case that one only for the Adaptec device, for now?
> Or define a whole new 2nd MULTI_TARG(2) quirk?
>

> And furthermore the device does not respond to request other than the attached targets,

> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd_______________________________________________
> linux-u...@lists.sourceforge.net
> To unsubscribe, use the last form field at:
> https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

--
Matthew Dharm Home: mdhar...@one-eyed-alien.net
Maintainer, Linux USB Mass Storage Driver

A female who groks UNIX? My universe is collapsing.
-- Mike
User Friendly, 10/11/1998

0 new messages