diff options
author | sam <sam@FreeBSD.org> | 2009-02-19 05:21:54 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2009-02-19 05:21:54 +0000 |
commit | ac3671600d3f9dfcb9dec1c308b4273cfb9422e8 (patch) | |
tree | 8c26850231f8a1c174df4857a224272370e028d2 /sys | |
parent | c56d117735c50a60c1061bf389db81f0cbd8ed8b (diff) | |
download | FreeBSD-src-ac3671600d3f9dfcb9dec1c308b4273cfb9422e8.zip FreeBSD-src-ac3671600d3f9dfcb9dec1c308b4273cfb9422e8.tar.gz |
Add modes for 1/2 and 1/4-width channels so we have separate roaming
and xmit parameters. This makes it possible to use tdma on fractional
channels.
o add IEEE80211_MODE_HALF and IEEE80211_MODE_QUARTER; note these are
band-agnostic (may need revisiting)
o setup all default rates in ic_sup_rates instead of doing it only
for active modes; we need these to calculate the default tx parameters
which are not recalculated after a regulatory update (can't just
recalculate after installing a new channel list because we might
clobber user settings)
o remove special case code in ieee80211_get_suprates; this is now
a candidate for an inline or removal
o add various entries for new modes (roaming+tx params, wme, rate
mapping, scan set setup, country ie construction, tdma, basic rates)
Note these modes are intentionally not visible through if_media.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net80211/_ieee80211.h | 4 | ||||
-rw-r--r-- | sys/net80211/ieee80211.c | 25 | ||||
-rw-r--r-- | sys/net80211/ieee80211_ioctl.c | 2 | ||||
-rw-r--r-- | sys/net80211/ieee80211_node.c | 4 | ||||
-rw-r--r-- | sys/net80211/ieee80211_proto.c | 20 | ||||
-rw-r--r-- | sys/net80211/ieee80211_regdomain.c | 6 | ||||
-rw-r--r-- | sys/net80211/ieee80211_scan.c | 6 | ||||
-rw-r--r-- | sys/net80211/ieee80211_scan_sta.c | 2 | ||||
-rw-r--r-- | sys/net80211/ieee80211_tdma.c | 8 |
9 files changed, 69 insertions, 8 deletions
diff --git a/sys/net80211/_ieee80211.h b/sys/net80211/_ieee80211.h index 5e68e58..a910685 100644 --- a/sys/net80211/_ieee80211.h +++ b/sys/net80211/_ieee80211.h @@ -66,8 +66,10 @@ enum ieee80211_phymode { IEEE80211_MODE_STURBO_A = 7, /* 5GHz, OFDM, 2x clock, static */ IEEE80211_MODE_11NA = 8, /* 5GHz, w/ HT */ IEEE80211_MODE_11NG = 9, /* 2GHz, w/ HT */ + IEEE80211_MODE_HALF = 10, /* OFDM, 1/2x clock */ + IEEE80211_MODE_QUARTER = 11, /* OFDM, 1/4x clock */ }; -#define IEEE80211_MODE_MAX (IEEE80211_MODE_11NG+1) +#define IEEE80211_MODE_MAX (IEEE80211_MODE_QUARTER+1) /* * Operating mode. Devices do not necessarily support diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index 9892107..217f04d 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -58,6 +58,8 @@ const char *ieee80211_phymode_name[IEEE80211_MODE_MAX] = { [IEEE80211_MODE_TURBO_A] = "turboA", [IEEE80211_MODE_TURBO_G] = "turboG", [IEEE80211_MODE_STURBO_A] = "sturboA", + [IEEE80211_MODE_HALF] = "half", + [IEEE80211_MODE_QUARTER] = "quarter", [IEEE80211_MODE_11NA] = "11na", [IEEE80211_MODE_11NG] = "11ng", }; @@ -112,7 +114,7 @@ static void ieee80211_chan_init(struct ieee80211com *ic) { #define DEFAULTRATES(m, def) do { \ - if (isset(ic->ic_modecaps, m) && ic->ic_sup_rates[m].rs_nrates == 0) \ + if (ic->ic_sup_rates[m].rs_nrates == 0) \ ic->ic_sup_rates[m] = def; \ } while (0) struct ieee80211_channel *c; @@ -159,6 +161,10 @@ ieee80211_chan_init(struct ieee80211com *ic) setbit(ic->ic_modecaps, IEEE80211_MODE_TURBO_G); if (IEEE80211_IS_CHAN_ST(c)) setbit(ic->ic_modecaps, IEEE80211_MODE_STURBO_A); + if (IEEE80211_IS_CHAN_HALF(c)) + setbit(ic->ic_modecaps, IEEE80211_MODE_HALF); + if (IEEE80211_IS_CHAN_QUARTER(c)) + setbit(ic->ic_modecaps, IEEE80211_MODE_QUARTER); if (IEEE80211_IS_CHAN_HTA(c)) setbit(ic->ic_modecaps, IEEE80211_MODE_11NA); if (IEEE80211_IS_CHAN_HTG(c)) @@ -185,6 +191,8 @@ ieee80211_chan_init(struct ieee80211com *ic) DEFAULTRATES(IEEE80211_MODE_TURBO_A, ieee80211_rateset_11a); DEFAULTRATES(IEEE80211_MODE_TURBO_G, ieee80211_rateset_11g); DEFAULTRATES(IEEE80211_MODE_STURBO_A, ieee80211_rateset_11a); + DEFAULTRATES(IEEE80211_MODE_HALF, ieee80211_rateset_half); + DEFAULTRATES(IEEE80211_MODE_QUARTER, ieee80211_rateset_quarter); DEFAULTRATES(IEEE80211_MODE_11NA, ieee80211_rateset_11a); DEFAULTRATES(IEEE80211_MODE_11NG, ieee80211_rateset_11g); @@ -867,6 +875,8 @@ addmedia(struct ifmedia *media, int caps, int addsta, int mode, int mword) [IEEE80211_MODE_TURBO_A] = IFM_IEEE80211_11A|IFM_IEEE80211_TURBO, [IEEE80211_MODE_TURBO_G] = IFM_IEEE80211_11G|IFM_IEEE80211_TURBO, [IEEE80211_MODE_STURBO_A] = IFM_IEEE80211_11A|IFM_IEEE80211_TURBO, + [IEEE80211_MODE_HALF] = IFM_IEEE80211_11A, /* XXX */ + [IEEE80211_MODE_QUARTER] = IFM_IEEE80211_11A, /* XXX */ [IEEE80211_MODE_11NA] = IFM_IEEE80211_11NA, [IEEE80211_MODE_11NG] = IFM_IEEE80211_11NG, }; @@ -955,7 +965,7 @@ ieee80211_media_setup(struct ieee80211com *ic, * use a "placeholder" media subtype and any fixed MCS * must be specified with a different mechanism. */ - for (; mode < IEEE80211_MODE_MAX; mode++) { + for (; mode <= IEEE80211_MODE_11NG; mode++) { if (isclr(ic->ic_modecaps, mode)) continue; addmedia(media, caps, addsta, mode, IFM_AUTO); @@ -1006,13 +1016,10 @@ ieee80211_media_init(struct ieee80211com *ic) /* XXX need to propagate new media settings to vap's */ } +/* XXX inline or eliminate? */ const struct ieee80211_rateset * ieee80211_get_suprates(struct ieee80211com *ic, const struct ieee80211_channel *c) { - if (IEEE80211_IS_CHAN_HALF(c)) - return &ieee80211_rateset_half; - if (IEEE80211_IS_CHAN_QUARTER(c)) - return &ieee80211_rateset_quarter; /* XXX does this work for 11ng basic rates? */ return &ic->ic_sup_rates[ieee80211_chan2mode(c)]; } @@ -1317,6 +1324,10 @@ ieee80211_chan2mode(const struct ieee80211_channel *chan) return IEEE80211_MODE_STURBO_A; else if (IEEE80211_IS_CHAN_TURBO(chan)) return IEEE80211_MODE_TURBO_A; + else if (IEEE80211_IS_CHAN_HALF(chan)) + return IEEE80211_MODE_HALF; + else if (IEEE80211_IS_CHAN_QUARTER(chan)) + return IEEE80211_MODE_QUARTER; else if (IEEE80211_IS_CHAN_A(chan)) return IEEE80211_MODE_11A; else if (IEEE80211_IS_CHAN_ANYG(chan)) @@ -1432,6 +1443,8 @@ ieee80211_rate2media(struct ieee80211com *ic, int rate, enum ieee80211_phymode m rate &= IEEE80211_RATE_VAL; switch (mode) { case IEEE80211_MODE_11A: + case IEEE80211_MODE_HALF: /* XXX good 'nuf */ + case IEEE80211_MODE_QUARTER: case IEEE80211_MODE_11NA: case IEEE80211_MODE_TURBO_A: case IEEE80211_MODE_STURBO_A: diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index 8c8b925..21d5637 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -1769,6 +1769,8 @@ findchannel(struct ieee80211com *ic, int ieee, int mode) [IEEE80211_MODE_TURBO_A] = IEEE80211_CHAN_108A, [IEEE80211_MODE_TURBO_G] = IEEE80211_CHAN_108G, [IEEE80211_MODE_STURBO_A] = IEEE80211_CHAN_STURBO, + [IEEE80211_MODE_HALF] = IEEE80211_CHAN_HALF, + [IEEE80211_MODE_QUARTER] = IEEE80211_CHAN_QUARTER, /* NB: handled specially below */ [IEEE80211_MODE_11NA] = IEEE80211_CHAN_A, [IEEE80211_MODE_11NG] = IEEE80211_CHAN_G, diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index aa92d8e..3dc2827 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -237,6 +237,10 @@ node_setuptxparms(struct ieee80211_node *ni) /* NB: 108A/108G should be handled as 11a/11g respectively */ if (IEEE80211_IS_CHAN_ST(ni->ni_chan)) mode = IEEE80211_MODE_STURBO_A; + else if (IEEE80211_IS_CHAN_HALF(ni->ni_chan)) + mode = IEEE80211_MODE_HALF; + else if (IEEE80211_IS_CHAN_QUARTER(ni->ni_chan)) + mode = IEEE80211_MODE_QUARTER; else if (IEEE80211_IS_CHAN_A(ni->ni_chan)) mode = IEEE80211_MODE_11A; else if (ni->ni_flags & IEEE80211_NODE_ERP) diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index 5d9b747..a9d5324 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -662,6 +662,8 @@ setbasicrates(struct ieee80211_rateset *rs, [IEEE80211_MODE_TURBO_A] = { 3, { 12, 24, 48 } }, [IEEE80211_MODE_TURBO_G] = { 4, { 2, 4, 11, 22 } }, [IEEE80211_MODE_STURBO_A] = { 3, { 12, 24, 48 } }, + [IEEE80211_MODE_HALF] = { 3, { 6, 12, 24 } }, + [IEEE80211_MODE_QUARTER] = { 3, { 3, 6, 12 } }, [IEEE80211_MODE_11NA] = { 3, { 12, 24, 48 } }, /* NB: mixed b/g */ [IEEE80211_MODE_11NG] = { 4, { 2, 4, 11, 22 } }, @@ -725,6 +727,8 @@ static const struct phyParamType phyParamForAC_BE[IEEE80211_MODE_MAX] = { [IEEE80211_MODE_TURBO_A]= { 2, 3, 5, 0, 0 }, [IEEE80211_MODE_TURBO_G]= { 2, 3, 5, 0, 0 }, [IEEE80211_MODE_STURBO_A]={ 2, 3, 5, 0, 0 }, + [IEEE80211_MODE_HALF] = { 3, 4, 6, 0, 0 }, + [IEEE80211_MODE_QUARTER]= { 3, 4, 6, 0, 0 }, [IEEE80211_MODE_11NA] = { 3, 4, 6, 0, 0 }, [IEEE80211_MODE_11NG] = { 3, 4, 6, 0, 0 }, }; @@ -737,6 +741,8 @@ static const struct phyParamType phyParamForAC_BK[IEEE80211_MODE_MAX] = { [IEEE80211_MODE_TURBO_A]= { 7, 3, 10, 0, 0 }, [IEEE80211_MODE_TURBO_G]= { 7, 3, 10, 0, 0 }, [IEEE80211_MODE_STURBO_A]={ 7, 3, 10, 0, 0 }, + [IEEE80211_MODE_HALF] = { 7, 4, 10, 0, 0 }, + [IEEE80211_MODE_QUARTER]= { 7, 4, 10, 0, 0 }, [IEEE80211_MODE_11NA] = { 7, 4, 10, 0, 0 }, [IEEE80211_MODE_11NG] = { 7, 4, 10, 0, 0 }, }; @@ -749,6 +755,8 @@ static const struct phyParamType phyParamForAC_VI[IEEE80211_MODE_MAX] = { [IEEE80211_MODE_TURBO_A]= { 1, 2, 3, 94, 0 }, [IEEE80211_MODE_TURBO_G]= { 1, 2, 3, 94, 0 }, [IEEE80211_MODE_STURBO_A]={ 1, 2, 3, 94, 0 }, + [IEEE80211_MODE_HALF] = { 1, 3, 4, 94, 0 }, + [IEEE80211_MODE_QUARTER]= { 1, 3, 4, 94, 0 }, [IEEE80211_MODE_11NA] = { 1, 3, 4, 94, 0 }, [IEEE80211_MODE_11NG] = { 1, 3, 4, 94, 0 }, }; @@ -761,6 +769,8 @@ static const struct phyParamType phyParamForAC_VO[IEEE80211_MODE_MAX] = { [IEEE80211_MODE_TURBO_A]= { 1, 2, 2, 47, 0 }, [IEEE80211_MODE_TURBO_G]= { 1, 2, 2, 47, 0 }, [IEEE80211_MODE_STURBO_A]={ 1, 2, 2, 47, 0 }, + [IEEE80211_MODE_HALF] = { 1, 2, 3, 47, 0 }, + [IEEE80211_MODE_QUARTER]= { 1, 2, 3, 47, 0 }, [IEEE80211_MODE_11NA] = { 1, 2, 3, 47, 0 }, [IEEE80211_MODE_11NG] = { 1, 2, 3, 47, 0 }, }; @@ -774,6 +784,8 @@ static const struct phyParamType bssPhyParamForAC_BE[IEEE80211_MODE_MAX] = { [IEEE80211_MODE_TURBO_A]= { 2, 3, 10, 0, 0 }, [IEEE80211_MODE_TURBO_G]= { 2, 3, 10, 0, 0 }, [IEEE80211_MODE_STURBO_A]={ 2, 3, 10, 0, 0 }, + [IEEE80211_MODE_HALF] = { 3, 4, 10, 0, 0 }, + [IEEE80211_MODE_QUARTER]= { 3, 4, 10, 0, 0 }, [IEEE80211_MODE_11NA] = { 3, 4, 10, 0, 0 }, [IEEE80211_MODE_11NG] = { 3, 4, 10, 0, 0 }, }; @@ -786,6 +798,8 @@ static const struct phyParamType bssPhyParamForAC_VI[IEEE80211_MODE_MAX] = { [IEEE80211_MODE_TURBO_A]= { 2, 2, 3, 94, 0 }, [IEEE80211_MODE_TURBO_G]= { 2, 2, 3, 94, 0 }, [IEEE80211_MODE_STURBO_A]={ 2, 2, 3, 94, 0 }, + [IEEE80211_MODE_HALF] = { 2, 3, 4, 94, 0 }, + [IEEE80211_MODE_QUARTER]= { 2, 3, 4, 94, 0 }, [IEEE80211_MODE_11NA] = { 2, 3, 4, 94, 0 }, [IEEE80211_MODE_11NG] = { 2, 3, 4, 94, 0 }, }; @@ -798,6 +812,8 @@ static const struct phyParamType bssPhyParamForAC_VO[IEEE80211_MODE_MAX] = { [IEEE80211_MODE_TURBO_A]= { 1, 2, 2, 47, 0 }, [IEEE80211_MODE_TURBO_G]= { 1, 2, 2, 47, 0 }, [IEEE80211_MODE_STURBO_A]={ 1, 2, 2, 47, 0 }, + [IEEE80211_MODE_HALF] = { 2, 2, 3, 47, 0 }, + [IEEE80211_MODE_QUARTER]= { 2, 2, 3, 47, 0 }, [IEEE80211_MODE_11NA] = { 2, 2, 3, 47, 0 }, [IEEE80211_MODE_11NG] = { 2, 2, 3, 47, 0 }, }; @@ -930,6 +946,8 @@ ieee80211_wme_updateparams_locked(struct ieee80211vap *vap) [IEEE80211_MODE_TURBO_A] = { 1, 3, 10, 64, 0 }, [IEEE80211_MODE_TURBO_G] = { 1, 3, 10, 64, 0 }, [IEEE80211_MODE_STURBO_A] = { 1, 3, 10, 64, 0 }, + [IEEE80211_MODE_HALF] = { 2, 4, 10, 64, 0 }, + [IEEE80211_MODE_QUARTER] = { 2, 4, 10, 64, 0 }, [IEEE80211_MODE_11NA] = { 2, 4, 10, 64, 0 }, /* XXXcheck*/ [IEEE80211_MODE_11NG] = { 2, 4, 10, 64, 0 }, /* XXXcheck*/ }; @@ -1016,6 +1034,8 @@ ieee80211_wme_updateparams_locked(struct ieee80211vap *vap) [IEEE80211_MODE_TURBO_A] = 3, [IEEE80211_MODE_TURBO_G] = 3, [IEEE80211_MODE_STURBO_A] = 3, + [IEEE80211_MODE_HALF] = 3, + [IEEE80211_MODE_QUARTER] = 3, [IEEE80211_MODE_11NA] = 3, [IEEE80211_MODE_11NG] = 3, }; diff --git a/sys/net80211/ieee80211_regdomain.c b/sys/net80211/ieee80211_regdomain.c index 724f32a..c1d6173 100644 --- a/sys/net80211/ieee80211_regdomain.c +++ b/sys/net80211/ieee80211_regdomain.c @@ -214,7 +214,7 @@ ieee80211_alloc_countryie(struct ieee80211com *ic) (IEEE80211_CHAN_TURBO | IEEE80211_CHAN_STURBO | \ IEEE80211_CHAN_HALF | IEEE80211_CHAN_QUARTER) /* XXX what about auto? */ - /* flag set of channels to be excluded */ + /* flag set of channels to be excluded (band added below) */ static const int skipflags[IEEE80211_MODE_MAX] = { [IEEE80211_MODE_AUTO] = CHAN_UNINTERESTING, [IEEE80211_MODE_11A] = CHAN_UNINTERESTING, @@ -227,6 +227,10 @@ ieee80211_alloc_countryie(struct ieee80211com *ic) [IEEE80211_MODE_TURBO_A] = CHAN_UNINTERESTING, [IEEE80211_MODE_TURBO_G] = CHAN_UNINTERESTING, [IEEE80211_MODE_STURBO_A] = CHAN_UNINTERESTING, + [IEEE80211_MODE_HALF] = IEEE80211_CHAN_TURBO + | IEEE80211_CHAN_STURBO, + [IEEE80211_MODE_QUARTER] = IEEE80211_CHAN_TURBO + | IEEE80211_CHAN_STURBO, [IEEE80211_MODE_11NA] = CHAN_UNINTERESTING, [IEEE80211_MODE_11NG] = CHAN_UNINTERESTING, }; diff --git a/sys/net80211/ieee80211_scan.c b/sys/net80211/ieee80211_scan.c index 0beea91..e5ba5e1 100644 --- a/sys/net80211/ieee80211_scan.c +++ b/sys/net80211/ieee80211_scan.c @@ -84,6 +84,8 @@ struct scan_state { #define ROAM_RATE_11A_DEFAULT 2*12 /* 11a bss */ #define ROAM_RATE_11B_DEFAULT 2*5 /* 11b bss */ #define ROAM_RATE_11BONLY_DEFAULT 2*1 /* 11b-only bss */ +#define ROAM_RATE_HALF_DEFAULT 2*6 /* half-width 11a/g bss */ +#define ROAM_RATE_QUARTER_DEFAULT 2*3 /* quarter-width 11a/g bss */ #define ROAM_MCS_11N_DEFAULT (1 | IEEE80211_RATE_MCS) /* 11n bss */ static void scan_restart_pwrsav(void *); @@ -141,6 +143,10 @@ static const struct ieee80211_roamparam defroam[IEEE80211_MODE_MAX] = { .rate = ROAM_RATE_11A_DEFAULT }, [IEEE80211_MODE_STURBO_A]={ .rssi = ROAM_RSSI_11A_DEFAULT, .rate = ROAM_RATE_11A_DEFAULT }, + [IEEE80211_MODE_HALF] = { .rssi = ROAM_RSSI_11A_DEFAULT, + .rate = ROAM_RATE_HALF_DEFAULT }, + [IEEE80211_MODE_QUARTER]= { .rssi = ROAM_RSSI_11A_DEFAULT, + .rate = ROAM_RATE_QUARTER_DEFAULT }, [IEEE80211_MODE_11NA] = { .rssi = ROAM_RSSI_11A_DEFAULT, .rate = ROAM_MCS_11N_DEFAULT }, [IEEE80211_MODE_11NG] = { .rssi = ROAM_RSSI_11B_DEFAULT, diff --git a/sys/net80211/ieee80211_scan_sta.c b/sys/net80211/ieee80211_scan_sta.c index f9210a0..9dde2ce 100644 --- a/sys/net80211/ieee80211_scan_sta.c +++ b/sys/net80211/ieee80211_scan_sta.c @@ -416,6 +416,8 @@ static const u_int chanflags[IEEE80211_MODE_MAX] = { [IEEE80211_MODE_TURBO_A] = IEEE80211_CHAN_A, [IEEE80211_MODE_TURBO_G] = IEEE80211_CHAN_G, [IEEE80211_MODE_STURBO_A] = IEEE80211_CHAN_ST, + [IEEE80211_MODE_HALF] = IEEE80211_CHAN_HALF, + [IEEE80211_MODE_QUARTER] = IEEE80211_CHAN_QUARTER, /* check legacy */ [IEEE80211_MODE_11NA] = IEEE80211_CHAN_A, [IEEE80211_MODE_11NG] = IEEE80211_CHAN_G, diff --git a/sys/net80211/ieee80211_tdma.c b/sys/net80211/ieee80211_tdma.c index e3796e2..be9de26 100644 --- a/sys/net80211/ieee80211_tdma.c +++ b/sys/net80211/ieee80211_tdma.c @@ -82,6 +82,12 @@ __FBSDID("$FreeBSD$"); #ifndef TDMA_TXRATE_STURBO_A_DEFAULT #define TDMA_TXRATE_STURBO_A_DEFAULT 2*24 #endif +#ifndef TDMA_TXRATE_HALF_DEFAULT +#define TDMA_TXRATE_HALF_DEFAULT 2*12 +#endif +#ifndef TDMA_TXRATE_QUARTER_DEFAULT +#define TDMA_TXRATE_QUARTER_DEFAULT 2*6 +#endif #ifndef TDMA_TXRATE_11NA_DEFAULT #define TDMA_TXRATE_11NA_DEFAULT (4 | IEEE80211_RATE_MCS) #endif @@ -148,6 +154,8 @@ ieee80211_tdma_vattach(struct ieee80211vap *vap) settxparms(vap, IEEE80211_MODE_STURBO_A, TDMA_TXRATE_STURBO_A_DEFAULT); settxparms(vap, IEEE80211_MODE_11NA, TDMA_TXRATE_11NA_DEFAULT); settxparms(vap, IEEE80211_MODE_11NG, TDMA_TXRATE_11NG_DEFAULT); + settxparms(vap, IEEE80211_MODE_HALF, TDMA_TXRATE_HALF_DEFAULT); + settxparms(vap, IEEE80211_MODE_QUARTER, TDMA_TXRATE_QUARTER_DEFAULT); setackpolicy(vap->iv_ic, 1); /* disable ACK's */ |