linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Problems accessing USB Mass Storage
@ 2002-09-17 11:25 Mark C
  2002-09-17 15:18 ` Greg KH
  0 siblings, 1 reply; 22+ messages in thread
From: Mark C @ 2002-09-17 11:25 UTC (permalink / raw)
  To: linux-kernel

-- 
---
To steal ideas from one person is plagiarism;
to steal from many is research.

I'm trying to access a USB digital camera under RedHat null Beta2 

The Camera information is as follows:

USB Epsilon 1.3  (Digital Dreams)
Resolution 1600 x 1280 pixels
Image sensor CMOS
LCD Screen 1.5" colour TFT
Internal memory 8MB NAND Gate Flash
External Memory Build in Smart Media card slot
Viewfinder Optical
Digital zoom X 4
Image capacity (with build in memory)   1600x1200 - 20
                                        1280x1024 - 29
                                        640x480 - 121
White balance Auto/Day/Shade/Bulb/Fl
Exposure Auto/Manual
Image format JPG, AVI (through software)
Computer interface USB
Power control Auto off (10 seconds)


I'm running a standard kernel 2.4.19-ac2 with USB Mass Storage degugging
Information.and also RedHat's 2.4.18-12.5 
(the below messages was taken for the 2.4.19-ac2)

When I plug it in its detected as: 

[root@stimpy mark]# usb.c: USB device 2 (vend/prod 0x733/0x1310) is not
claimed by any active driver.
  Vendor:           Model: 1.3M DigitalCAM   Rev: 1.00
  Type:   Direct-Access                      ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0
SCSI device sda: 16384 512-byte hdwr sectors (8 MB)
sda: test WP failed, assume Write Enabled
 sda1


Which means that the kernel has seen it and its being treated as a mass
Storage device, thus treated as a SCSI device.

So I also ran cdrecord -scanbus and that listed the device as well. 

scsibus1: 
        1,0,0   100) '        ' '1.3M DigitalCAM ' '1.00' Removable Disk

After reading several pages on USB and Mass storage, I have found out
how I should be able to access it

The following Kernel modules that are relevant to this device are loaded
as below:

vfat                   11356   0  (autoclean)
fat                    36888   0  (autoclean) [vfat]
sr_mod                 16248   0  (autoclean)
usb-storage           102352   0
usb-ohci               19528   0  (unused)
usbcore                69888   1  [usb-storage hid usb-ohci]
aic7xxx               123444   0
sd_mod                 13104   0
scsi_mod               99716   4  [sr_mod usb-storage aic7xxx sd_mod]

The file system on the camera is FAT (this can be accessed by VMware
running on this Box, as a removable device (which is running a Virtual
WinXp O/S) through the USB port using the drivers for windows supplied
by the manufacturer)

mount /dev/sda /mnt/camera

and

/sbin/modprobe fat && mount -t fat /dev/sda /mnt/camera

I've also tried vat, auto, autofs and /dev/sda[0-10] as well.

Also running the following, it cannot access the device either:

[root@stimpy dev]# dd if=/dev/sda of=/dev/null bs=1k count=1
dd: reading `/dev/sda': Input/output error
0+0 records in
0+0 records out

It seems it cannot find a partition table on the device, in WinXp I can
happily right click and create folders on the camera, It can also
Identify the amount of space on the device 8MB, when first plugged it.

And I have also tried the following as well:

[root@stimpy mark]# cat /dev/sda | file  -
cat: /dev/sda: Input/output error
standard input:              empty


Please see below the output of dmesg -n 9, with USB Mass storage
debugging turned on (sorry for the large amount)

---------------------- cut -----------------------------

hub.c: USB new device connect on bus1/1, assigned device number 2
usb.c: USB device 2 (vend/prod 0x733/0x1310) is not claimed by any
active driver.
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
usb-storage: act_altsettting is 0
usb-storage: id_index calculated to be: 85
usb-storage: Array length appears to be: 87
usb-storage: USB Mass Storage device detected
usb-storage: Endpoints: In: 0xdb6b0b20 Out: 0xdb6b0b34 Int: 0xdb6b0b48
(Period 1)
usb-storage: New GUID 07331310000ffffffffff700
usb-storage: GetMaxLUN command result is 1, data is 0
usb-storage: Transport: Bulk
usb-storage: Protocol: Transparent SCSI
usb-storage: *** thread sleeping.
scsi1 : SCSI emulation for USB Mass Storage devices
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command INQUIRY (6 bytes)
usb-storage: 12 00 00 00 ff 00 4f da d4 33 4f da
usb-storage: Bulk command S 0x43425355 T 0x8 Trg 0 LUN 0 L 255 F 128 CL
6
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_transfer_partial(): xfer 255 bytes
usb-storage: usb_stor_bulk_msg() returned 0 xferred 36/255
usb-storage: Bulk data transfer result 0x1
usb-storage: Attempting to get CSW...
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x8 R 219 Stat 0x0
usb-storage: Fixing INQUIRY data to show SCSI rev 2
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
  Vendor:           Model: 1.3M DigitalCAM   Rev: 1.00
  Type:   Direct-Access                      ANSI SCSI revision: 02
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (1/0)
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (2/0)
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (3/0)
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (4/0)
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (5/0)
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (6/0)
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Bad target number (7/0)
usb-storage: *** thread sleeping.
Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command TEST_UNIT_READY (6 bytes)
usb-storage: 00 00 00 00 00 00 00 00 00 00 30 da
usb-storage: Bulk command S 0x43425355 T 0x10 Trg 0 LUN 0 L 0 F 0 CL 6
usb-storage: Bulk command transfer result=0
usb-storage: Attempting to get CSW...
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x10 R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command READ_CAPACITY (10 bytes)
usb-storage: 25 00 00 00 00 00 00 00 00 00 30 da
usb-storage: Bulk command S 0x43425355 T 0x11 Trg 0 LUN 0 L 8 F 128 CL
10
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_transfer_partial(): xfer 8 bytes
usb-storage: usb_stor_bulk_msg() returned 0 xferred 8/8
usb-storage: usb_stor_transfer_partial(): transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x11 R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
SCSI device sda: 16384 512-byte hdwr sectors (8 MB)
usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command MODE_SENSE (6 bytes)
usb-storage: 1a 00 3f 00 ff 00 00 00 00 00 30 da
usb-storage: Bulk command S 0x43425355 T 0x12 Trg 0 LUN 0 L 255 F 128 CL
6
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_transfer_partial(): xfer 255 bytes
usb-storage: usb_stor_bulk_msg() returned -32 xferred 0/255
usb-storage: clearing endpoint halt for pipe 0xc0038280
usb-storage: usb_stor_clear_halt: result=0
usb-storage: usb_stor_transfer_partial(): unknown error
usb-storage: Bulk data transfer result 0x2
usb-storage: Attempting to get CSW...
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x12 R 255 Stat 0x1
usb-storage: -- transport indicates command failure
usb-storage: Issuing auto-REQUEST_SENSE
usb-storage: Bulk command S 0x43425355 T 0x12 Trg 0 LUN 0 L 18 F 128 CL
6
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_transfer_partial(): xfer 18 bytes
usb-storage: usb_stor_bulk_msg() returned 0 xferred 18/18
usb-storage: usb_stor_transfer_partial(): transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x12 R 0 Stat 0x0
usb-storage: -- Result from auto-sense is 0
usb-storage: -- code: 0x70, key: 0x5, ASC: 0x24, ASCQ: 0x0
usb-storage: Illegal Request: invalid field in CDB
usb-storage: scsi cmd done, result=0x2
usb-storage: *** thread sleeping.
sda: test WP failed, assume Write Enabled
 sda:<7>usb-storage: queuecommand() called
usb-storage: *** thread awakened.
usb-storage: Command READ_10 (10 bytes)
usb-storage: 28 00 00 00 00 00 00 00 08 00 30 da
usb-storage: Bulk command S 0x43425355 T 0x13 Trg 0 LUN 0 L 4096 F 128
CL 10
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_transfer_partial(): xfer 4096 bytes
usb-storage: usb_stor_bulk_msg() returned 0 xferred 4096/4096
usb-storage: usb_stor_transfer_partial(): transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x13 R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
 sda1
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 2
USB Mass Storage support registered.
Attached scsi CD-ROM sr0 at scsi0, channel 0, id 2, lun 0
sr0: scsi3-mmc drive: 24x/24x writer cd/rw xa/form2 cdda tray
cdrom: This disc doesn't have any tracks I recognize!

---------------------- cut -----------------------------

Not being a programmer or kernel developer, I'm not sure where the error
lies, Its going to be either a USB device driver bug or the actual
camera itself (thus relying on the Windows drivers doing the actual
work, rather than properly implementing USB Mass Storage)

After several conversations with the RedHat mailing list,
I have not got any closer with regards to finding out where the error
actually lies

Can anyone possibly help on this one. 

Thanks in advance

Mark


^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: Problems accessing USB Mass Storage
@ 2002-09-17 18:22 Randy.Dunlap
  2002-09-17 19:50 ` Thomas Dodd
  0 siblings, 1 reply; 22+ messages in thread
From: Randy.Dunlap @ 2002-09-17 18:22 UTC (permalink / raw)
  To: Jonathan Corbet; +Cc: gen-lists, linux-kernel

On Tue, 17 Sep 2002, Jonathan Corbet wrote:

| Don't know if this is helpful or not, but, based on my messing around with
| SmartMedia USB stuff...
|
| SmartMedia cards are weird in that they have a (seemingly) random amount of
| waste space at the beginning of the card.  Your 8MB card, in particular,
| has nothing of interest in the first 25 sectors.  Some cards have a
| reasonable partition table in the first sector, and some don't.  Modern
| Windows systems (and cameras, of course) seem to be able to access the
| filesystem on the card without needing to see a partition table.
|
| A little while I posted a Lexar SmartMedia driver patch which hacked around
| this by substituting a fake partition table when the first sector was read.
| I'm not sure it's the right solution, though.  A better way, perhaps, is a
| little user-space program which writes the appropriate partition table
| depending on the card capacity.  Note that fdisk doesn't (easily) work for
| this purpose, since it wants partitions to start on cylinder boundaries.
|
| You might try just using dd to copy your card to disk with an offset of 25
| sectors, and see of you can mount the resulting image.
|
| Then again, the interface to some SmartMedia readers is vastly more
| complicated, as the sddr09 driver shows.

This is a bit like what we (JE, David Brownell, and I) saw at
the USB plugfest in 1999.  We had a camera device that we
couldn't mount as a filesystem, but we could dd it.
When we did that and studied the dd-ed file, we could see a
FAT filesystem beginning after the first <N> blocks (but more than
25 sectors IIRC -- more like after 50-100 KB, or maybe even more).

-- 
~Randy
"Linux is not a research project. Never was, never will be."
  -- Linus, 2002-09-02


^ permalink raw reply	[flat|nested] 22+ messages in thread
[parent not found: <Pine.LNX.4.33L2.0209171627330.14033-100000@dragon.pdx.osdl.net>]

end of thread, other threads:[~2002-09-18  5:56 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-17 11:25 Problems accessing USB Mass Storage Mark C
2002-09-17 15:18 ` Greg KH
2002-09-17 17:37   ` Thomas Dodd
2002-09-17 17:46     ` Greg KH
2002-09-17 18:06       ` Richard B. Johnson
2002-09-17 20:09       ` Thomas Dodd
2002-09-17 21:01         ` Mark C
2002-09-17 21:43       ` Rogier Wolff
2002-09-17 22:04         ` Thomas Dodd
2002-09-17 22:12           ` [Linux-usb-users] " Randy.Dunlap
2002-09-17 22:21           ` Patrick Mansfield
2002-09-17 22:51             ` Mark C
2002-09-17 23:09               ` [Linux-usb-users] " Randy.Dunlap
     [not found]             ` <mailman.1032306001.9987.linux-kernel2news@redhat.com>
2002-09-18  1:37               ` Pete Zaitcev
2002-09-18  6:01           ` Rogier Wolff
2002-09-17 18:22 Randy.Dunlap
2002-09-17 19:50 ` Thomas Dodd
2002-09-17 19:58   ` Matthew Dharm
2002-09-17 20:13     ` Thomas Dodd
2002-09-17 21:13       ` [Linux-usb-users] " Mark C
2002-09-17 21:40         ` Thomas Dodd
2002-09-17 21:51           ` Mark C
2002-09-17 21:58         ` Rogier Wolff
2002-09-17 22:17           ` Thomas Dodd
2002-09-17 22:23             ` Randy.Dunlap
     [not found] <Pine.LNX.4.33L2.0209171627330.14033-100000@dragon.pdx.osdl.net>
2002-09-17 23:46 ` Mark C

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).