Author Topic: USB mass storage device  (Read 3759 times)

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
USB mass storage device
« on: December 08, 2003, 06:29:42 am »
Sorry to bring this up again, but I only got a quick look at the previous (oddly titled) thread.

Anyway, from what I understand it may or may not be possible for a Zaurus (other than the c860) to implement this ability.

Anyone have any constructive thoughts on this (it would be rather nice to not have to install drivers on someone else\'s computer)?


Simon
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
USB mass storage device
« Reply #1 on: December 08, 2003, 11:00:44 am »
Does the Z use the gadget API? (http://www.linux-usb.org/gadget/) After reading the page I note that it is available from 2.4.23 onwards, but I assume it could have been backported.

I presume that the Z uses something along the lines of the CDC Ethernet \'gadget driver\', and assuming it does do this, it would appear that it\'s at least vaguely possible to produce a USB mass storage client driver.

That said, there may still be hardware issues (I know not-a-lot about this subject in general).

If this is in fact possible, where does one find the low level code which actually talks to the USB hardware chip? Does anyone know what the chip is?

Another, slightly unrelated question, I know people have been over this point but I\'d just like to clarify it in my own mind. The Z is a client/slave not a master usb device. How much difference is there in the hardware between the two devices? Is this a completely insurmountable (using low level software of some or other description) problem, and thinking of the sl6000, can a usb master also act as a slave?


Simon
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

Anonymous

  • Guest
USB mass storage device
« Reply #2 on: December 08, 2003, 11:11:26 am »
To summarize the missing thread;

1) Proto believes that it would probably have some hardware component to the usb drive, but concedes that it is possible to do it software only.

2) Mickeyl confirms that there is a software component, but has not confirmed that it is a complete implementation (no special hardware needed).  With the work being done on OZ he may or may not have the time.

3) Treke has the 860 ROM on the 760, but has yet to make the usb drive work on the 760.  This may or may not be hardware related.

4)  tkcROM/proto bashing is not cool

treke

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
    • http://
USB mass storage device
« Reply #3 on: December 08, 2003, 11:36:38 am »
The problem with it not working  for me is mostly because the extent of my testing was trying to load the module and then reading the /etc/hotplug/storage.agent script. Not really much effort. If you want this functionality, you can have it. I don\'t have a url off hand, but I know there is an open source software implementation that was written for the iPaq, and could be ported to the zaurus.

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
USB mass storage device
« Reply #4 on: December 08, 2003, 11:56:01 am »
Ah good, if you do remember the URL do please post it as this would be a useful feature imo.


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

treke

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
    • http://
USB mass storage device
« Reply #5 on: December 08, 2003, 12:54:40 pm »

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
USB mass storage device
« Reply #6 on: December 08, 2003, 02:46:57 pm »
First off, would this work?

Would someone (who has a working setup) mind compiling the module for the latest OZ kernel on the 5500 (uname -r reports \"2.4.18-rmk7-pxa3-embedix\", but I have my doubts).

A direct link to the C file is: http://ahmedahamid.tripod.com/usbmass/usb_mass.c

I notice that there are two usb related modules loaded by default on my OZ3.3.5 5500:

usbdmonitor
usbdcore

there\'s also one called net_fd which relies on usbdcore. What of these would I need to remove to allow the mass storage device module to work? (Removing usbdmonitor kills the touch screen for some reason)

How does the c860 know whether it\'s supposed to be a mass storage device or an ethernet device?

Questions, questions.....


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
USB mass storage device
« Reply #7 on: December 09, 2003, 05:59:03 pm »
Pretty please ;-)?

Actually I suppose I should really try myself. Could someone give me the link to the bitkeeper repository which holds said kernel source code (links to any of the ones which I might have tried have vanished with the devnet)?

Thanks,


Simon
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

wbs

  • Newbie
  • *
  • Posts: 15
    • View Profile
USB mass storage device
« Reply #8 on: December 12, 2003, 02:13:21 pm »
Quote
3) Treke has the 860 ROM on the 760, but has yet to make the usb drive work on the 760.  This may or may not be hardware related.
I put the 860 rom on my 760 and USB mass storage works perfectly!

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
USB mass storage device
« Reply #9 on: December 12, 2003, 08:10:59 pm »
Well this is what I get:

# rmmod net_fd
# insmod storage_fd
Using /lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/drivers/usb/device/storage_fd/storage_fd.o
embedix/kernel/drivers/usb/device/storage_fd/storage_fd.o: init_modules: Invalid argument
Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters

Then I tried:
# insmod storage_fd dev_major=3 dev_minor=0

These are the parameters from the iPAQ one (linked above), I just get:

invalid parameter: parm_dev_major


Oh and I can\'t suspend any more :-). Anyone have any ideas as to what I should pass as parameters to the module? What are the chances that I can read the command line if I take a hex editor to the PC Link applet (in the settings page) in the ROM image I have?


Simon
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

treke

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
    • http://
USB mass storage device
« Reply #10 on: December 12, 2003, 09:42:47 pm »
# modinfo  /lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/drivers/usb/device/storage_fd/storage_fd.o

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
USB mass storage device
« Reply #11 on: December 13, 2003, 05:38:56 am »
Ah, thank you.

This is what I get:

# modinfo storage_fd
filename:    /lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/drivers/usb/device/storage_fd/storage_fd.o
description: \"USB Device Mass Storage Function\"
author:      \"kabata@kyoto-cti.co.jp\"
parm:        vendor_id int, description \"vendor id\"
parm:        product_id int, description \"product id\"
parm:        out_pkt_sz int
parm:        in_pkt_sz int
parm:        storage_device string

Does this mean I have to provide all of these parm entires? I presume that product_id & vendor_id are those funny numbers which I had to mess around with in my /lib/modules/`uname -r`/modules.usbmap file? Should they be set to something specific so that Windows/etc. will recognise the device as a storage device?

out_pkt_sz - out packet size..? Anyone have any better ideas?


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

Mickeyl

  • Hero Member
  • *****
  • Posts: 1495
    • View Profile
    • http://www.Vanille.de
USB mass storage device
« Reply #12 on: December 13, 2003, 07:58:32 pm »
Quick success notice: I got usb-storage running on OpenZaurus 3.3.6-pre1 (not yet available, don\'t ask) with my C750 and Windows XP. As expected it mounts my CF card as a drive. Stay tuned.
Cheers,

Michael 'Mickey' Lauer | Embedded Linux Freelancer | www.Vanille-Media.de
Consider donating, if you like the software I contribute to.

Richjn

  • Full Member
  • ***
  • Posts: 121
    • View Profile
    • http://
USB mass storage device
« Reply #13 on: December 14, 2003, 04:44:07 am »
mickeyl

Oh go on please let us have 3.3.6---please--- pretty please--- I know were not worthy but it is nearly Christmas.


Richard

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
USB mass storage device
« Reply #14 on: December 14, 2003, 06:17:36 am »
Quote
Quick success notice: I got usb-storage running on OpenZaurus 3.3.6-pre1 (not yet available, don\'t ask) with my C750 and Windows XP. As expected it mounts my CF card as a drive. Stay tuned.

I\'m glad it\'s possible. Did you use the Sharp driver, or modify the iPAQ one? I presume that there shouldn\'t be any problems running the Sharp binary driver on my libc2.2 ROM as it\'s not linked directly (I assume your ROM is a libc2.3 one).

Any hints on what you passed as params? ;-)


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva