linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pedro Lopez-Cabanillas <plcl@telefonica.net>
To: linux-hotplug@vger.kernel.org
Subject: Re: Vosonic's X-Drive 2030
Date: Wed, 07 May 2003 21:54:44 +0000	[thread overview]
Message-ID: <marc-linux-hotplug-105234473702096@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-105222093406662@msgid-missing>

On Wednesday 07 May 2003 05:38, Randy.Dunlap wrote:
> >> On Tuesday 06 May 2003 19:39, Pedro Lopez-Cabanillas wrote:
> >>> On Tuesday 06 May 2003 13:32, Alexander Kühn wrote:
> >>> > scorpio:/etc/hotplug # cat usb.usermap
> >>> > # usb module         match_flags idVendor idProduct bcdDevice_lo
> >>>
> >>> bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol
> >>>
> >>> > bInterfaceClass bInterfaceSubClass bInterfaceProtocol driver_info
> >>>
> >>> usb-storage          0x0000     0x0d7d   0x0240    0x0000       0x0000
> >>>
> >>> >      0x00         0x00            0x00            0x00           
> >>> > 0x00 0x00            0x00000000
> >>>
> >>> Can you try this?
> >>> usb-storage          0x0003      0x7d0d  0x4002    0x0000       0x0000
> >>>
> >>> (match_flags)        ^^^^^^
> >>> (idVendor)                       ^^^^^^
> >>> (idProduct)                              ^^^^^^
> >>
> >> Sorry. Seems that lsusb is not very reliable on ppc architecture
> >> (bytesexual
> >>   problem :-). Try this instead:
> >>   usb-storage          0x0003      0x0d7d  0x0240    0x0000       0x0000
> >
> > Yes, that's right.  I made a patch for lsusb-endianness about 3 years
> > ago, but I expect that it's lost by now...unless it's in one of the
> > linux-usb email archives.
>
> Hm, apparently I didn't make a patch, just raised the issue and got no
> resolution on it.
>
> Here's the beginning of the mail thread:
> http://marc.theaimsgroup.com/?l=linux-usb-devel&m˜056359905969&w=2
>

I'm not sure about this (from usbutils-0.11)

lsusb.c:270
	vid = buf[8] | (buf[9] << 8);
	pid = buf[10] | (buf[11] << 8);

usbmodules.c:413
       idVendor = buf[8] | (buf[9] << 8);
       idProduct = buf[10] | (buf[11] << 8);

Both programs seem to be affected, if the above is wrong. It seems to say: get 
the first byte and store it on the lower half of the 16 bits word, then get 
the next byte and store it in the high bits, but what is doing is to store 
the second byte followed by the first byte on the word. This is correct in  
little-endian machines, but not in big-endian. If i'm right, then the 
following should work on both sexes:

       idVendor = buf[8] + (buf[9] * 256);
       idProduct = buf[10] + (buf[11] * 256);

What do you think?

But anyway, (sorry if my suspicions are wrong) the fact is that lsusb does not  
work in ppc, and usbmodules also can be wrong. This is more serious, because 
usbmodules is used in hotplug scripts to find what modules to load for USB 
devices if it is installed.

Regards,
Pedro

-- 
ALSA Library Bindings for Pascal
http://alsapas.alturl.com



-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com

_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

  parent reply	other threads:[~2003-05-07 21:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-06 11:32 Vosonic's X-Drive 2030 Alexander Kühn
2003-05-06 17:39 ` Pedro Lopez-Cabanillas
2003-05-06 18:30 ` Pedro Lopez-Cabanillas
2003-05-06 18:50 ` Alexander Kühn
2003-05-07  3:17 ` Randy.Dunlap
2003-05-07  3:38 ` Randy.Dunlap
2003-05-07 21:54 ` Pedro Lopez-Cabanillas [this message]
2003-05-07 22:17 ` Randy.Dunlap
2003-05-07 22:18 ` Pedro Lopez-Cabanillas
2003-05-07 22:24 ` David Brownell
2003-05-07 22:36 ` Pedro Lopez-Cabanillas
2003-05-08 18:48 ` Randy.Dunlap
2003-05-08 19:10 ` Pedro Lopez-Cabanillas

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=marc-linux-hotplug-105234473702096@msgid-missing \
    --to=plcl@telefonica.net \
    --cc=linux-hotplug@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).