Changeset 3302

Show
Ignore:
Timestamp:
01/29/08 10:17:23 (1 year ago)
Author:
scottr
Message:

Ensure non-AP STA VAPs correctly notify the AP when when their power save state
changes.

Previously, a confusion between the node's power save state and the VAP's
power save state was causing all nulldata frames to be sent with 0 in the
PwrMgt? bit. This was causing the AP to not notice when the STA went off
channel to scan and hence not buffer frames.

We now update the VAP's power save state so that nulldata frames are sent with
the correct bits set. We also clean up some logic surrounding the use of XOR.

Reference changesets:
* http://madwifi.org/changeset/2330
* http://madwifi.org/changeset/2345
* http://madwifi.org/changeset/3062
* http://madwifi.org/changeset/3065

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • madwifi/branches/madwifi-0.9.4/net80211/ieee80211_power.c

    r1721 r3302  
    339339        int qlen; 
    340340 
    341         if (!((enable != 0) ^ ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) != 0))) 
     341        if (!!enable == !!IEEE80211_VAP_IS_SLEEPING(vap)) /* Bool. normalise */ 
    342342                return; 
    343343 
     
    345345                "sta power save mode %s", enable ? "on" : "off"); 
    346346        if (!enable) { 
    347                 ni->ni_flags &= ~IEEE80211_NODE_PWR_MGT
     347                IEEE80211_VAP_WAKEUP(vap)
    348348                ieee80211_send_nulldata(ieee80211_ref_node(ni)); 
    349349                /* 
     
    369369                } 
    370370        } else { 
    371                 ni->ni_flags |= IEEE80211_NODE_PWR_MGT
     371                IEEE80211_VAP_GOTOSLEEP(vap)
    372372                ieee80211_send_nulldata(ieee80211_ref_node(ni)); 
    373373        } 
  • madwifi/branches/madwifi-0.9.4/net80211/ieee80211_scan.c

    r1849 r3302  
    324324        if (vap->iv_opmode == IEEE80211_M_STA && 
    325325            vap->iv_state == IEEE80211_S_RUN) { 
    326                 if ((vap->iv_bss->ni_flags & IEEE80211_NODE_PWR_MGT) == 0) { 
     326                if (!IEEE80211_VAP_IS_SLEEPING(vap)) { 
    327327                        /* 
    328328                         * Initiate power save before going off-channel.