LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Modem name changed from ttyS2 to ttyS1 after reboot (http://www.linuxquestions.org/questions/slackware-14/modem-name-changed-from-ttys2-to-ttys1-after-reboot-4175440234/)

kite 12-06-2012 02:27 AM

Modem name changed from ttyS2 to ttyS1 after reboot
 
I just set up a hylafax server in my slackware 14.0 wifi router. But the modem name is not consistent as following:

It was like (dmesg):
Code:

[ 4496.706205] 0.0: ttyS2 at I/O 0x3e8 (irq = 5) is a 16550A
But after system reboot, it changed to:
Code:

[  13.029704] 0.0: ttyS1 at I/O 0x33f8 (irq = 4) is a 16550A
If I unplugged the modem and plugged it again, it returned back to ttyS2.

As I need to start the auto answer by adding the exact modem name into inittab, it now became a headache.

Any suggestion?

kite 12-06-2012 03:22 AM

After some googling, I solved my own question:

I added a rule file at /etc/udev/rules.d/80-persistent-modem.rules
Code:

ATTRS{card_id}=="0x0034", ATTRS{manf_id}=="0x0101", SYMLINK+="3commodem"
Testing the result:
udevadm control --reload-rules
udevadm test -a -p $(udevadm info -q path -n /dev/ttyS1)


The variable is based on the following command result:
udevadm info --name=/dev/ttyS1 --attribute-walk

Code:

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:1e.0/0000:02:00.0/0.0/tty/ttyS1':
    KERNEL=="ttyS1"
    SUBSYSTEM=="tty"
    DRIVER==""

  looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:02:00.0/0.0':
    KERNELS=="0.0"
    SUBSYSTEMS=="pcmcia"
    DRIVERS=="serial_cs"
    ATTRS{function}=="0x00"
    ATTRS{pm_state}=="on"
    ATTRS{func_id}=="0x02"
    ATTRS{manf_id}=="0x0101"
    ATTRS{card_id}=="0x0034"
    ATTRS{prod_id1}=="3Com"
    ATTRS{prod_id2}=="3CXM/3CCM556"
    ATTRS{prod_id3}=="Megahertz 56K Cell/Telephony Modem"

  looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:02:00.0':
    KERNELS=="0000:02:00.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="yenta_cardbus"
    ATTRS{vendor}=="0x1180"
    ATTRS{device}=="0x0476"
    ATTRS{subsystem_vendor}=="0x1014"
    ATTRS{subsystem_device}=="0x0532"
    ATTRS{class}=="0x060700"
    ATTRS{irq}=="11"
    ATTRS{local_cpus}=="1"
    ATTRS{local_cpulist}=="0"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{consistent_dma_mask_bits}=="32"
    ATTRS{enable}=="2"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:1e.0':
    KERNELS=="0000:00:1e.0"
    SUBSYSTEMS=="pci"
    DRIVERS==""
    ATTRS{vendor}=="0x8086"
    ATTRS{device}=="0x2448"
    ATTRS{subsystem_vendor}=="0x0000"
    ATTRS{subsystem_device}=="0x0000"
    ATTRS{class}=="0x060400"
    ATTRS{irq}=="0"
    ATTRS{local_cpus}=="1"
    ATTRS{local_cpulist}=="0"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{consistent_dma_mask_bits}=="32"
    ATTRS{enable}=="1"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}=="1"

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

reference: http://wiki.debian.org/udev


All times are GMT -5. The time now is 01:01 AM.