[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Huawei e122 - how to make symlink to usb modem?



Camaleón <noelamac@gmail.com> writes:

> On Sun, 12 Jun 2011 16:14:53 +0200, Kamil Jońca wrote:
>
>> Camaleón <noelamac@gmail.com> writes:
>> 
>>> What's the output for udevinfo on that device?
>
> (...)
>
>> Udevadm info starts with the device specified by the devpath and then
>> walks up the chain of parent devices. It prints for every device found,
>> all possible attributes in the udev rules key format. A rule to match,
>> can be composed by the attributes of the device and the attributes from
>> one single parent device.
>
> (...)
>
> Okay... then according to this doc:
>
> http://reactivated.net/writing_udev_rules.html#udevinfo
>
> You can't mix attributes from different parent devices, so
>
> SUBSYSTEM=="tty"
Erm. 
--8<---------------cut here---------------start------------->8---
legal to combine the attributes from the device in question and a single parent device
--8<---------------cut here---------------end--------------->8---
SUBSYSTEM=="tty" is from "device in question" Am I wrong?

>
> cannot go with
>
> ATTRS{idVendor} == "12d1"
>
> You may try with:
>
> SUBSYSTEMS=="usb", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1003", SYMLINK+="e122"

Unfortunately /dev/sdc match these rule, and somehow "takes precedence"
and I ends with symlink to sdc.

--8<---------------cut here---------------start------------->8---
%sudo udevadm info --query=all --attribute-walk --name=sdc    
custom logging function 0x7f52d1ee2010 registered
selinux=0
runtime dir '/dev/.udev'
calling: info
device 0x7f52d1ee44c0 has devpath '/devices/pci0000:00/0000:00:02.1/usb1/1-10/1-10:1.3/host76/target76:0:0/76:0:0:0/block/sdc'
device 0x7f52d1ee3160 has devpath '/devices/pci0000:00/0000:00:02.1/usb1/1-10/1-10:1.3/host76/target76:0:0/76:0:0:0'
device 0x7f52d1ee4e20 has devpath '/devices/pci0000:00/0000:00:02.1/usb1/1-10/1-10:1.3/host76/target76:0:0'
device 0x7f52d1ee51b0 has devpath '/devices/pci0000:00/0000:00:02.1/usb1/1-10/1-10:1.3/host76'
device 0x7f52d1ee55f0 has devpath '/devices/pci0000:00/0000:00:02.1/usb1/1-10/1-10:1.3'
device 0x7f52d1ee61f0 has devpath '/devices/pci0000:00/0000:00:02.1/usb1/1-10'
device 0x7f52d1ee7db0 has devpath '/devices/pci0000:00/0000:00:02.1/usb1'

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:02.1/usb1/1-10/1-10:1.3/host76/target76:0:0/76:0:0:0/block/sdc':
    KERNEL=="sdc"
    SUBSYSTEM=="block"
    DRIVER==""
    ATTR{range}=="16"
    ATTR{ext_range}=="256"
    ATTR{removable}=="1"
    ATTR{ro}=="0"
    ATTR{size}=="0"
    ATTR{alignment_offset}=="0"
    ATTR{discard_alignment}=="0"
    ATTR{capability}=="51"
    ATTR{stat}=="       0        0        0        0        0        0        0        0        0        0        0"
    ATTR{inflight}=="       0        0"
    ATTR{events}=="media_change"
    ATTR{events_async}==""
    ATTR{events_poll_msecs}=="-1"

  looking at parent device '/devices/pci0000:00/0000:00:02.1/usb1/1-10/1-10:1.3/host76/target76:0:0/76:0:0:0':
    KERNELS=="76:0:0:0"
    SUBSYSTEMS=="scsi"
    DRIVERS=="sd"
    ATTRS{device_blocked}=="0"
    ATTRS{type}=="0"
    ATTRS{scsi_level}=="3"
    ATTRS{vendor}=="HUAWEI  "
    ATTRS{model}=="SD Storage      "
    ATTRS{rev}=="2.31"
    ATTRS{state}=="running"
    ATTRS{timeout}=="30"
    ATTRS{iocounterbits}=="32"
    ATTRS{iorequest_cnt}=="0x7"
    ATTRS{iodone_cnt}=="0x7"
    ATTRS{ioerr_cnt}=="0x6"
    ATTRS{evt_media_change}=="0"
    ATTRS{queue_depth}=="1"
    ATTRS{queue_type}=="none"
    ATTRS{max_sectors}=="240"

  looking at parent device '/devices/pci0000:00/0000:00:02.1/usb1/1-10/1-10:1.3/host76/target76:0:0':
    KERNELS=="target76:0:0"
    SUBSYSTEMS=="scsi"
    DRIVERS==""

  looking at parent device '/devices/pci0000:00/0000:00:02.1/usb1/1-10/1-10:1.3/host76':
    KERNELS=="host76"
    SUBSYSTEMS=="scsi"
    DRIVERS==""

  looking at parent device '/devices/pci0000:00/0000:00:02.1/usb1/1-10/1-10:1.3':
    KERNELS=="1-10:1.3"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb-storage"
    ATTRS{bInterfaceNumber}=="03"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bNumEndpoints}=="02"
    ATTRS{bInterfaceClass}=="08"
    ATTRS{bInterfaceSubClass}=="06"
    ATTRS{bInterfaceProtocol}=="50"
    ATTRS{supports_autosuspend}=="1"
    ATTRS{interface}=="USB MASS STORAGE"

  looking at parent device '/devices/pci0000:00/0000:00:02.1/usb1/1-10':
    KERNELS=="1-10"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 4"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="80"
    ATTRS{bMaxPower}=="500mA"
    ATTRS{urbnum}=="239"
    ATTRS{idVendor}=="12d1"
    ATTRS{idProduct}=="1003"
    ATTRS{bcdDevice}=="0000"
    ATTRS{bDeviceClass}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="480"
    ATTRS{busnum}=="1"
    ATTRS{devnum}=="43"
    ATTRS{devpath}=="10"
    ATTRS{version}==" 2.00"
    ATTRS{maxchild}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="HUA WEI"
    ATTRS{product}=="Huawei Mobile"

  looking at parent device '/devices/pci0000:00/0000:00:02.1/usb1':
    KERNELS=="usb1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bMaxPower}=="  0mA"
    ATTRS{urbnum}=="1033"
    ATTRS{idVendor}=="1d6b"
    ATTRS{idProduct}=="0002"
    ATTRS{bcdDevice}=="0206"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="480"
    ATTRS{busnum}=="1"
    ATTRS{devnum}=="1"
    ATTRS{devpath}=="0"
    ATTRS{version}==" 2.00"
    ATTRS{maxchild}=="10"
    ATTRS{quirks}=="0x0"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Linux 2.6.38+3-64 ehci_hcd"
    ATTRS{product}=="EHCI Host Condevice 0x7f52d1ee9b30 has devpath '/devices/pci0000:00/0000:00:02.1'
device 0x7f52d1eeb060 has devpath '/devices/pci0000:00'
troller"
    ATTRS{serial}=="0000:00:02.1"
    ATTRS{authorized_default}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:02.1':
    KERNELS=="0000:00:02.1"
    SUBSYSTEMS=="pci"
    DRIVERS=="ehci_hcd"
    ATTRS{vendor}=="0x10de"
    ATTRS{device}=="0x005b"
    ATTRS{subsystem_vendor}=="0x1043"
    ATTRS{subsystem_device}=="0x815a"
    ATTRS{class}=="0x0c0320"
    ATTRS{irq}=="21"
    ATTRS{local_cpus}=="1"
    ATTRS{local_cpulist}=="0"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{consistent_dma_mask_bits}=="31"
    ATTRS{enable}=="1"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}==""
    ATTRS{companion}==""

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""
--8<---------------cut here---------------end--------------->8---


-- 
http://modnebzdury.wordpress.com/2009/10/01/niewiarygodny-list-prof-majewskiej-wprowadzenie/
"Nie można wlecieć w trzecie tysiaclecie
  na drzwiach od stodoły" - biskup polowy WP Sławoj Leszek Głódź.


Reply to: