[hsflinux] TIOCM_RNG woes...

Michael Landon - IBN mlandon at ibnads.com
Fri May 24 18:43:03 EDT 2002


I've been trying all week to find a reliable way of detecting an incoming ring
from an AOpen FM56-SV (pci id 14F1:2F01) HSF modem or IBM 19K4162 (pci id
14F1:1033) HCF modem...both of which are giving me very strange results.  All
other functions of the modems appear to work just fine (we can dial out &
connect w/out any problems), but the ring detection is a bit flaky.

With the AOpen modem under RH 7.2, immediately after I install the driver
(currently hsflinmodem-5.03.03.L2mbsibeta02052300), I can use the following code
to wait for an incoming ring:

    mstat = TIOCM_RNG;
    err = ioctl(fd, TIOCMIWAIT, &mstat);
    ...

However, once I reboot, this functionality goes away (the above code just hangs
indefinitely, no matter if a call comes in or not).  In some cases, exiting
(<CTRL> C) from the above program and just waiting a few minutes (sometimes as
few as 5) you can relaunch the above program & it will work.  (I cannot
determine what happens during that timespan that could have caused the system to
work.)

Reverting to an older ring detection program we had been using (one that's
called repeatedly from a script and just uses TIOCMGET to check the status of
the line), I was able to detect a ring, but after the ring was detected, the
ring bit is never cleared and all subsequent queries w/ TIOCMGET falsely
indicate an incoming ring (until the system is rebooted).  The code used for
this program is as follows:

    unsigned int mstat = 0;
    err = ioctl(fd, TIOCMGET, &mstat);
    if(err == -1)
    {
        printf("error!");
        exit(255);
    }
    if (mstat & TIOCM_RI)
    ...

With the IBM modem, I'm having a different problem.  Using the most recent
driver (hcflinmodem-0.93mbsibeta02052300) under RH 7.3, ioctl w/ TIOCMIWAIT
appears to work ok (it always waits until a ring is detected and returns),
however the method returns -1 (indicating an error w/ errno being set to 5).
Under RH 7.2 the method works as expected and does not return -1.  I looked in
the serial.c source and didn't see any behavior changes between 7.2 and 7.3 that
might be the culprit.

I'm pulling my hair out trying to work around these issues.  Any ideas/help
would be appreciated.

Michael






More information about the hsflinux mailing list