linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Stable identification of identical USB hardware
@ 2007-06-18 15:35 Joerg Pommnitz
  2007-06-18 17:00 ` Michael Mauch
  2007-06-18 20:33 ` [Linux-usb-users] " Greg KH
  0 siblings, 2 replies; 5+ messages in thread
From: Joerg Pommnitz @ 2007-06-18 15:35 UTC (permalink / raw)
  To: linux-kernel, linux-usb-users

Hello all,
I want to be able to distinguish between two (or more) mostly identical USB serial devices. The devices in question are UMTS modems. AFAIK they are identical except for the SIM card and the point of attachment. Externally the cards are CardBus devices with an integrated USB host adapter. The actual UMTS device is (internally) connected to the USB host adapter.

If I have to cardbus sockets, how do I get from what I know ("the card is in socket 0") to "I have to talk to ttyUSB2 to talk to the card"? I suspect I have to follow the thread from /sys/bus/pci to /sys/bus/usb/devices, but how exactly?

Thanks in advance and kind regards
  Joerg

__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. 
http://mail.yahoo.com 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Stable identification of identical USB hardware
  2007-06-18 15:35 Stable identification of identical USB hardware Joerg Pommnitz
@ 2007-06-18 17:00 ` Michael Mauch
  2007-06-18 17:13   ` Lee Revell
  2007-06-18 20:33 ` [Linux-usb-users] " Greg KH
  1 sibling, 1 reply; 5+ messages in thread
From: Michael Mauch @ 2007-06-18 17:00 UTC (permalink / raw)
  To: linux-kernel

Joerg Pommnitz wrote:

> I want to be able to distinguish between two (or more) mostly
> identical USB serial devices. The devices in question are UMTS modems.
> AFAIK they are identical except for the SIM card and the point of
> attachment. Externally the cards are CardBus devices with an integrated
> USB host adapter. The actual UMTS device is (internally) connected to
> the USB host adapter.

> If I have to cardbus sockets, how do I get from what I know ("the card
> is in socket 0") to "I have to talk to ttyUSB2 to talk to the card"? I
> suspect I have to follow the thread from /sys/bus/pci to
> /sys/bus/usb/devices, but how exactly?

You should be able to distinguish the devices with udev. Have a look at
http://www.reactivated.net/writing_udev_rules.html 

If that doesn't help, I would like to propose that you ask again in
the de.comp.os.unix.linux.hardware or comp.os.linux.hardware newsgroups.

Regards...
		Michael


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Stable identification of identical USB hardware
  2007-06-18 17:00 ` Michael Mauch
@ 2007-06-18 17:13   ` Lee Revell
  0 siblings, 0 replies; 5+ messages in thread
From: Lee Revell @ 2007-06-18 17:13 UTC (permalink / raw)
  To: linux-kernel

On 6/18/07, Michael Mauch <michael.mauch@gmx.de> wrote:
> > If I have to cardbus sockets, how do I get from what I know ("the card
> > is in socket 0") to "I have to talk to ttyUSB2 to talk to the card"? I
> > suspect I have to follow the thread from /sys/bus/pci to
> > /sys/bus/usb/devices, but how exactly?
>
> You should be able to distinguish the devices with udev. Have a look at
> http://www.reactivated.net/writing_udev_rules.html
>

Isn't this something that the distro should do for you?  It's insane
to expect users to write udev rules for such basic functionality...

Lee

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Linux-usb-users] Stable identification of identical USB hardware
  2007-06-18 15:35 Stable identification of identical USB hardware Joerg Pommnitz
  2007-06-18 17:00 ` Michael Mauch
@ 2007-06-18 20:33 ` Greg KH
  2007-06-19  9:09   ` Kay Sievers
  1 sibling, 1 reply; 5+ messages in thread
From: Greg KH @ 2007-06-18 20:33 UTC (permalink / raw)
  To: Joerg Pommnitz; +Cc: linux-kernel, linux-usb-users

On Mon, Jun 18, 2007 at 08:35:35AM -0700, Joerg Pommnitz wrote:
> Hello all,
> I want to be able to distinguish between two (or more) mostly
> identical USB serial devices. The devices in question are UMTS modems.
> AFAIK they are identical except for the SIM card and the point of
> attachment. Externally the cards are CardBus devices with an
> integrated USB host adapter. The actual UMTS device is (internally)
> connected to the USB host adapter.
> 
> If I have to cardbus sockets, how do I get from what I know ("the card
> is in socket 0") to "I have to talk to ttyUSB2 to talk to the card"? I
> suspect I have to follow the thread from /sys/bus/pci to
> /sys/bus/usb/devices, but how exactly?

Walk up the "chain" of devices in sysfs and in udev.  The udev man pages
and documentation should show you how to do this.  If you have specific
questions about this, please ask them on the linux-hotplug-devel mailing
list.

hope this helps,
greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Linux-usb-users] Stable identification of identical USB hardware
  2007-06-18 20:33 ` [Linux-usb-users] " Greg KH
@ 2007-06-19  9:09   ` Kay Sievers
  0 siblings, 0 replies; 5+ messages in thread
From: Kay Sievers @ 2007-06-19  9:09 UTC (permalink / raw)
  To: Greg KH; +Cc: Joerg Pommnitz, linux-kernel, linux-usb-users

On 6/18/07, Greg KH <greg@kroah.com> wrote:
> On Mon, Jun 18, 2007 at 08:35:35AM -0700, Joerg Pommnitz wrote:
> > I want to be able to distinguish between two (or more) mostly
> > identical USB serial devices. The devices in question are UMTS modems.
> > AFAIK they are identical except for the SIM card and the point of
> > attachment. Externally the cards are CardBus devices with an
> > integrated USB host adapter. The actual UMTS device is (internally)
> > connected to the USB host adapter.
> >
> > If I have to cardbus sockets, how do I get from what I know ("the card
> > is in socket 0") to "I have to talk to ttyUSB2 to talk to the card"? I
> > suspect I have to follow the thread from /sys/bus/pci to
> > /sys/bus/usb/devices, but how exactly?
>
> Walk up the "chain" of devices in sysfs and in udev.  The udev man pages
> and documentation should show you how to do this.  If you have specific
> questions about this, please ask them on the linux-hotplug-devel mailing
> list.

This should create a symlink for the serial device in the first slot:
  KERNEL="ttyUSB*", SUBSYSTEMS=="pcmcia", KERNELS=="0.0",
SYMLINK+="serial-slot0"

You find the keys used with udevinfo. Here is an example for a PCMCIA
CF Memory card:
  udevinfo --attribute-walk --name hda4
  ...

  looking at device '/block/hda/hda4':
    KERNEL=="hda4"
    SUBSYSTEM=="block"
  ...

  looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:04:00.0/0.0':
    KERNELS=="0.0"
    SUBSYSTEMS=="pcmcia"
    DRIVERS=="ide-cs"
  ...

  looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:04:00.0':
    KERNELS=="0000:04:00.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="yenta_cardbus"
  ...

Kay

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-06-19  9:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-18 15:35 Stable identification of identical USB hardware Joerg Pommnitz
2007-06-18 17:00 ` Michael Mauch
2007-06-18 17:13   ` Lee Revell
2007-06-18 20:33 ` [Linux-usb-users] " Greg KH
2007-06-19  9:09   ` Kay Sievers

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).