mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <Andries.Brouwer@cwi.nl>
To: greg@kroah.com, mdharm-usb@one-eyed-alien.net
Cc: linux-kernel@vger.kernel.org, linux-usb-devel@lists.sourceforge.net
Subject: [patch] datafab fix and unusual devices
Date: Tue, 30 Mar 2004 00:44:09 +0200 (MEST)	[thread overview]
Message-ID: <UTC200403292244.i2TMi9f11131.aeb@smtp.cwi.nl> (raw)

datafab.c has an often-seen bug: the SCSI READ_CAPACITY command
does not need the number of sectors but the last sector.

I just tried the CF and SM parts of a 5-in-1 card reader.
The CF part works with US_PR_DATAFAB when the bug mentioned is fixed.
The SM part works with US_PR_SDDR55.
(Revision Number is 17.08 - that in case the 0000-ffff
should prove to be too optimistic.)

We still must discuss what setup to use for readers like this -
I have several of them - that require different drivers for
different LUNs. As it is now one has to compile usb-storage
twice, once with CONFIG_USB_STORAGE_DATAFAB defined and once
without, and remove one usb-storage.ko and insert the other
to go from CF to SM. (And that hangs with 2.6.4 so a reboot
is required..)

Andries

[Two years ago I had a very general setup, and when mdharm
didnt like it, a 2-lun setup, the minimal needed for the
devices I had at that time. They must still live in the
archives somewhere. I forgot all details so have no opinion today.]


diff -uprN -X /linux/dontdiff a/drivers/usb/storage/datafab.c b/drivers/usb/storage/datafab.c
--- a/drivers/usb/storage/datafab.c	2004-02-05 19:55:20.000000000 +0100
+++ b/drivers/usb/storage/datafab.c	2004-03-30 00:00:36.000000000 +0200
@@ -539,8 +539,8 @@ int datafab_transport(Scsi_Cmnd * srb, s
 			  info->sectors, info->ssize);
 
 		// build the reply
-		//
-		((u32 *) ptr)[0] = cpu_to_be32(info->sectors);
+		// we need the last sector, not the number of sectors
+		((u32 *) ptr)[0] = cpu_to_be32(info->sectors - 1);
 		((u32 *) ptr)[1] = cpu_to_be32(info->ssize);
 		usb_stor_set_xfer_buf(ptr, 8, srb);
 
diff -uprN -X /linux/dontdiff a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
--- a/drivers/usb/storage/unusual_devs.h	2004-03-28 17:11:50.000000000 +0200
+++ b/drivers/usb/storage/unusual_devs.h	2004-03-29 23:59:47.000000000 +0200
@@ -710,6 +710,21 @@ UNUSUAL_DEV(  0x0bf6, 0xa001, 0x0100, 0x
 		0 ),
 #endif
 
+#ifdef CONFIG_USB_STORAGE_DATAFAB
+UNUSUAL_DEV( 0x0c0b, 0xa109, 0x0000, 0xffff,
+	       "Acomdata",
+	       "CF",
+	       US_SC_SCSI, US_PR_DATAFAB, NULL,
+	       US_FL_SINGLE_LUN ),
+#endif
+#ifdef CONFIG_USB_STORAGE_SDDR55
+UNUSUAL_DEV( 0x0c0b, 0xa109, 0x0000, 0xffff,
+	       "Acomdata",
+	       "SM",
+	       US_SC_SCSI, US_PR_SDDR55, NULL,
+	       US_FL_SINGLE_LUN ),
+#endif
+
 /* Submitted by Joris Struyve <joris@struyve.be> */
 UNUSUAL_DEV( 0x0d96, 0x410a, 0x0001, 0xffff,
 		"Medion",

             reply	other threads:[~2004-03-29 22:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-29 22:44 Andries.Brouwer [this message]
2004-03-29 23:15 ` Matthew Dharm
2004-03-29 23:38   ` Andries Brouwer
2004-03-30 21:56 ` Greg KH

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=UTC200403292244.i2TMi9f11131.aeb@smtp.cwi.nl \
    --to=andries.brouwer@cwi.nl \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=mdharm-usb@one-eyed-alien.net \
    /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

all inboxes | Powered by JetHome®