Re: FC5, Madwifi, NM -- network recovery after suspend-to-ram?



I finally solved my problem.

I /was/ doing something like what you suggest, but that didn't work.  The
problem was that something was polling the device such that the modules
were immediately re-loaded PRIOR to the actual suspend.  So basically I
was getting:

<stop NM>
<modules unloaded>
<modules re-loaded automatically>
<suspend>
...
<resume>
<ifconfig ath0 up>
<wakeup NM>

Obviously this doesn't work.  So I changed my script and now it works.
It does:

<stop NM>
<suspend>
...
<resume>
<ifdown ath0>
<ifconfig ath0 down>
<unload modules>
<ifconfig ath0 up> -> forces a reload of the modules
<wakeup NM>

This process works great.  So I guess the underlying question is:
what's polling the device and causing the reload of the modules prior
to suspend?  I've already suspended network manager, so what else
could be doing it?  Not that it REALLY matters -- it's working now --
but I'm still curious.

Thanks, all.

-derek

Tim Niemueller <tim niemueller de> writes:

> Derek Atkins schrieb:
>> Hey,
>> 
>> My only issue right now is that the wireless network doesn't seem to
>> "come back" automatically after a suspend-to-ram.  Maybe I'm not doing
>
> Add a file /etc/pm/hooks/80madwifi and will it with:
>
> #!/bin/bash
>
> . /etc/pm/functions
>
> MADWIFI_MODULES="wlan_wep wlan_ccmp wlan_tkip ath_pci ath_rate_sample
> ath_hal wlan_scan_sta wlan"
>
> unload_modules()
> {
>         [ -z "$MADWIFI_MODULES" ] && return 0
>         for x in $MADWIFI_MODULES ; do
>                 /sbin/rmmod $x >/dev/null 2>&1 0<&1
>         done
>         return 0
> }
>
> load_modules()
> {
>         [ -z "$MADWIFI_MODULES" ] && return 0
>         for x in $MADWIFI_MODULES ; do
>                 /sbin/modprobe $x >/dev/null 2>&1 0<&1
>         done
>         return 0
> }
>
> case "$1" in
>         suspend)
>                 ;;
>         resume)
>                 unload_modules
>                 load_modules
>                 ;;
>         *)
>                 ;;
> esac
>
> exit $?
>
>
> This does the trick for me. The MADWIFI_MODULES have to be in one line.
> This could be extended to check if there are actually any madwifi
> drivers loaded before going rampart so that we can bundle this in the NM
> package for instance as a "unfortnately needed up to now"-script...
>
> 	Tim

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord MIT EDU                        PGP key available



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