Fix for Thinkpad T400 WWAN on Ubuntu 9.10

posted 2010-02-25 20:51:08, link to this article

The builtin WWAN modem of Lenovo ThinkPad T400 laptops does not seem to wake properly when the laptop is suspended on Ubuntu.

I have written a small Power Manager script to fix this problem, it seems that Ubuntu 9.10 (Karmic Koala) does not support wakeup scripts in /etc/acpi/resume.d anymore.
Although it tires me a bit how much Ubuntu seems to break in new releases lately, it was worthwhile to search for the mechanism "du jour". It seems that scripts need to be placed in /etc/pm/sleep.d nowadays.
Add the script below to a new file, /etc/pm/sleep.d/10_thinkpad_wwan, and it should be called upon suspend and resume to revive your modem on resume.

#!/bin/sh

# Action script to reinitialize built-in WWAN of Lenovo ThinkPads
# on resume
#
# Hessel Schut, hessel@isquared.nl, 2010-02-25
#

PATH=/sbin:/usr/sbin:/bin:/usr/bin

case "${1}" in
        hibernate)
                # unload cdc_wdm module
                rmmod cdc_wdm
                ;;

        resume|thaw)
                # revive RF and reload cdc_wdm module
                echo 1 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill1/state
                modprobe cdc_wdm

                ;;
esac