Changeset 2272

Show
Ignore:
Timestamp:
04/12/07 01:29:54 (1 year ago)
Author:
mentor
Message:

Clean up IW POWER handler; however, it seems to be entirely useless.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/net80211/ieee80211_wireless.c

    r2268 r2272  
    12521252        struct ieee80211vap *vap = dev->priv; 
    12531253        struct ieee80211com *ic = vap->iv_ic; 
    1254  
    1255         if (wrq->disabled) { 
    1256                 if (ic->ic_flags & IEEE80211_F_PMGTON) { 
    1257                         ic->ic_flags &= ~IEEE80211_F_PMGTON; 
    1258                         goto done; 
    1259                 } 
    1260                 return 0; 
    1261         } 
     1254         
     1255        /* XXX: These values, flags, and caps do not seem to be used elsewhere  
     1256         * at all? */ 
    12621257 
    12631258        if ((ic->ic_caps & IEEE80211_C_PMGT) == 0) 
    12641259                return -EOPNOTSUPP; 
    1265         switch (wrq->flags & IW_POWER_MODE) { 
    1266         case IW_POWER_UNICAST_R: 
    1267         case IW_POWER_ALL_R: 
    1268         case IW_POWER_ON: 
    1269                 ic->ic_flags |= IEEE80211_F_PMGTON; 
    1270                 break; 
    1271         default: 
    1272                 return -EINVAL; 
    1273         } 
    1274         if (wrq->flags & IW_POWER_TIMEOUT) { 
    1275                 ic->ic_holdover = IEEE80211_MS_TO_TU(wrq->value); 
    1276                 ic->ic_flags |= IEEE80211_F_PMGTON; 
    1277         } 
    1278         if (wrq->flags & IW_POWER_PERIOD) { 
    1279                 ic->ic_lintval = IEEE80211_MS_TO_TU(wrq->value); 
    1280                 ic->ic_flags |= IEEE80211_F_PMGTON; 
    1281         } 
    1282 done: 
     1260         
     1261        if (wrq->disabled) { 
     1262                if (ic->ic_flags & IEEE80211_F_PMGTON) 
     1263                        ic->ic_flags &= ~IEEE80211_F_PMGTON; 
     1264        } else { 
     1265                switch (wrq->flags & IW_POWER_MODE) { 
     1266                case IW_POWER_UNICAST_R: 
     1267                case IW_POWER_ALL_R: 
     1268                case IW_POWER_ON: 
     1269                        ic->ic_flags |= IEEE80211_F_PMGTON; 
     1270                         
     1271                        if (wrq->flags & IW_POWER_TIMEOUT) 
     1272                                ic->ic_holdover = IEEE80211_MS_TO_TU(wrq->value); 
     1273                        if (wrq->flags & IW_POWER_PERIOD) 
     1274                                ic->ic_lintval = IEEE80211_MS_TO_TU(wrq->value); 
     1275                        break; 
     1276                default: 
     1277                        return -EINVAL; 
     1278                } 
     1279        } 
     1280         
    12831281        return IS_UP(ic->ic_dev) ? ic->ic_reset(ic->ic_dev) : 0; 
    12841282}