Changeset 1856

Show
Ignore:
Timestamp:
12/14/06 02:38:00 (2 years ago)
Author:
scottr
Message:

This patch implementing user control of the short/long preamble via iwpriv ioctl.
By default as before is the short preamble option on.

Usage:
iwpriv wlan0 shpreamble 1 (enable short preamble) (default)
iwpriv wlan0 shpreamble 0 (disable short preamble)
iwpriv wlan0 get_shpreamble (return curret value)

Note:
Preamble can be controlled for for 802.11b/g. 802.11a do not implement it.
Short preamble is a capability option, so when its turned off at accesspoint,
any stations capable to use short preamble will use long preamble. When
is accesspoint capable to use short preamble and station not, ap and station
will use long preamble. Outdoor with poor signal condition is better to use
long preamble.

Signed-off-by: Jiri Fojtasek <jiri.fojtasek@hlohovec.net>

Files:

Legend:

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

    r1849 r1856  
    34723472                 */ 
    34733473                if (IEEE80211_IS_CHAN_A(ic->ic_curchan) || 
    3474                     (ni->ni_capinfo & IEEE80211_CAPINFO_SHORT_PREAMBLE)) { 
     3474                    ((ni->ni_capinfo & IEEE80211_CAPINFO_SHORT_PREAMBLE) && 
     3475                    (ic->ic_caps & IEEE80211_C_SHPREAMBLE))) { 
    34753476                        ic->ic_flags |= IEEE80211_F_SHPREAMBLE; 
    34763477                        ic->ic_flags &= ~IEEE80211_F_USEBARKER; 
     
    34973498                        "%sassoc success: %s preamble, %s slot time%s%s%s%s%s%s%s", 
    34983499                        ISREASSOC(subtype) ? "re" : "", 
    3499                         ic->ic_flags&IEEE80211_F_SHPREAMBLE ? "short" : "long", 
     3500                        (ic->ic_flags&IEEE80211_F_SHPREAMBLE) && 
     3501                        (ni->ni_capinfo & IEEE80211_CAPINFO_SHORT_PREAMBLE) ? "short" : "long", 
    35003502                        ic->ic_flags&IEEE80211_F_SHSLOT ? "short" : "long", 
    35013503                        ic->ic_flags&IEEE80211_F_USEPROT ? ", protection" : "", 
  • trunk/net80211/ieee80211_ioctl.h

    r1756 r1856  
    599599        IEEE80211_PARAM_REGCLASS        = 59,   /* enable regclass ids in country IE */ 
    600600        IEEE80211_PARAM_DROPUNENC_EAPOL = 60,   /* drop unencrypted eapol frames */ 
     601        IEEE80211_PARAM_SHPREAMBLE      = 61,   /* Short Preamble */ 
    601602}; 
    602603 
  • trunk/net80211/ieee80211_node.c

    r1821 r1856  
    18461846                newassoc ? "" : "re", 
    18471847                IEEE80211_NODE_AID(ni), 
    1848                 ic->ic_flags & IEEE80211_F_SHPREAMBLE ? "short" : "long", 
     1848                (ic->ic_flags & IEEE80211_F_SHPREAMBLE) && 
     1849                (ni->ni_capinfo & IEEE80211_CAPINFO_SHORT_PREAMBLE) ? "short" : "long", 
    18491850                ic->ic_flags & IEEE80211_F_SHSLOT ? "short" : "long", 
    18501851                ic->ic_flags & IEEE80211_F_USEPROT ? ", protection" : "", 
  • trunk/net80211/ieee80211_wireless.c

    r1849 r1856  
    23772377                retv = ENETRESET;       /* XXX: need something this drastic? */ 
    23782378                break; 
     2379        case IEEE80211_PARAM_SHPREAMBLE: 
     2380                if (value) { 
     2381                        ic->ic_caps |= IEEE80211_C_SHPREAMBLE; 
     2382                        ic->ic_flags |= IEEE80211_F_SHPREAMBLE; 
     2383                        ic->ic_flags &= ~IEEE80211_F_USEBARKER; 
     2384                } else { 
     2385                        ic->ic_caps &= ~IEEE80211_C_SHPREAMBLE; 
     2386                        ic->ic_flags &= ~IEEE80211_F_SHPREAMBLE; 
     2387                        ic->ic_flags |= IEEE80211_F_USEBARKER; 
     2388                }        
     2389                retv = ENETRESET;       /* requires restart */ 
     2390                break; 
    23792391        case IEEE80211_PARAM_PWRTARGET: 
    23802392                ic->ic_curchanmaxpwr = value; 
     
    27722784        case IEEE80211_PARAM_DOTH: 
    27732785                param[0] = (ic->ic_flags & IEEE80211_F_DOTH) != 0; 
     2786                break; 
     2787        case IEEE80211_PARAM_SHPREAMBLE: 
     2788                param[0] = (ic->ic_caps & IEEE80211_C_SHPREAMBLE) != 0; 
    27742789                break; 
    27752790        case IEEE80211_PARAM_PWRTARGET: 
     
    50875102        { IEEE80211_PARAM_DROPUNENC_EAPOL, 
    50885103          0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_dropunencea" }, 
     5104        { IEEE80211_PARAM_SHPREAMBLE, 
     5105          IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "shpreamble" }, 
     5106        { IEEE80211_PARAM_SHPREAMBLE, 
     5107          0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_shpreamble" }, 
    50895108        /* 
    50905109         * NB: these should be roamrssi* etc, but iwpriv usurps all