[PATCH] neod: use apm instead of sysfs to suspend

Mike (mwester) mwester at dls.net
Tue May 27 17:51:37 CEST 2008


Holger Freyther wrote:
> On Tuesday 27 May 2008 07:00:47 Mike (mwester) wrote:
> 
>> by simple modifications to the apm configuration files.
> 
> Is that part already done?

Yes.  It has not been widely tested, but with the neod patch (to use apm), and 
the recently submitted Flow Control kernel patches, I have a set of apm configs 
that just Work For Me(tm).  :-)

Basically, we use libgsmd-tool to make gsmd spit out the AT commands to suppress 
the unsolicited messages that we're not interested in, and then echo "1" to the 
correct file in sysfs to flowcontrol the GSM modem itself.  We reverse the 
process on resume (with a delay before the libgsmd-tool command so that we don't 
distract gsmd from processing an incoming call or SMS or other important event).

I classify it as a "proof-of-concept" in terms of quality and reliability.  But 
it looks reasonably good; I'm at 36 hours since last restart of my GTA01 with 
several phone calls and SMS messages with no failures!  :-( The GTA02 doesn't 
seem to resume all the time for unrelated reasons, so it didn't make the full 36 
hours this test.

[Frankly, I think we can probably leave most of the unsolicited messages 
suppressed with the exception of the signal quality.  I don't see that we even 
use the time-zone or ciphering ones, and the registrations seem to be very noisy 
and not useful as far as I can tell.  More experimentation is needed, I think.]


======================================================
/etc/apm/suspend.d/gsm:
#!/bin/sh

exec >>/tmp/apm.log 2>&1

echo "----------------------------------------"
echo "$0: suspend processing begins..."
date
libgsmd-tool --mode atcmd <<EOF
AT%CSQ=0
AT+CREG=0
AT%CPRI=0
AT%CTZV=0
AT+CTZR=0
AT
EOF
echo "1" >/sys/devices/platform/neo1973-pm-gsm.0/flowcontrolled
echo "----------------------------------------"

======================================================
/etc/apm/resume.d/gsm:
#!/bin/sh

exec >>/tmp/apm.log 2>&1

echo "----------------------------------------"
echo "$0: resume processing begins..."
date
echo "0" >/sys/devices/platform/neo1973-pm-gsm.0/flowcontrolled
sleep 5
libgsmd-tool --mode atcmd <<EOF
AT%CSQ=1
AT+CREG=2
AT%CPRI=1
AT
EOF
echo "----------------------------------------"

======================================================


Here's a URL to a tarball with the apm configs and the patched neod that I've 
been making available to the community for testing:

[http://moko.mwester.net/mw09_apmstuff.tgz]

Documentation is nice too:

[http://moko.mwester.net/readme_kernel_mw09.txt]



Regards,
Mike (mwester)




More information about the openmoko-devel mailing list