More changes from madwifi-dfs that are either definitions or missed changes that should not have been on the feature branch.

git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3162 0192ed92-7a03-0410-a25b-9323aeb14dbd
This commit is contained in:
mtaylor 2008-01-16 20:01:39 +00:00
parent 909dc70af4
commit 92c62d977e
7 changed files with 102 additions and 11 deletions

View File

@ -63,6 +63,27 @@ enum ieee80211_opmode {
IEEE80211_M_WDS = 2 /* WDS link */
};
/*
* True if this mode will send beacon on a regular interval, like AP
* or IBSS
*/
#define IEEE80211_IS_MODE_BEACON(_opmode) \
((_opmode == IEEE80211_M_IBSS) || \
(_opmode == IEEE80211_M_HOSTAP))
/*
* True if this mode must behave like a DFS master, ie do Channel
* Check Availability and In Service Monitoring. We need to make sure
* that all modes cannot send data without being authorized. Such
* enforcement is not done in monitor mode however.
*/
#define IEEE80211_IS_MODE_DFS_MASTER(_opmode) \
((_opmode == IEEE80211_M_IBSS) || \
(_opmode == IEEE80211_M_AHDEMO) || \
(_opmode == IEEE80211_M_HOSTAP) || \
(_opmode == IEEE80211_M_WDS))
/*
* 802.11g protection mode.
*/
@ -121,6 +142,11 @@ struct ieee80211_channel {
int8_t ic_maxregpower; /* maximum regulatory tx power in dBm */
int8_t ic_maxpower; /* maximum tx power in dBm */
int8_t ic_minpower; /* minimum tx power in dBm */
/* end of the Non-Occupancy Period, when we can use this channel again?
* If <= NOW then clear IEEE80211_CHAN_RADAR in ic_flags. Initialized
* to {0,0} */
struct timeval ic_non_occupancy_period;
};
#define IEEE80211_CHAN_MAX 255
@ -128,8 +154,9 @@ struct ieee80211_channel {
#define IEEE80211_CHAN_ANY 0xffff /* token for ``any channel'' */
#define IEEE80211_CHAN_ANYC ((struct ieee80211_channel *) IEEE80211_CHAN_ANY)
#define IEEE80211_RADAR_11HCOUNT 1
#define IEEE80211_RADAR_CHANCHANGE_TBTT_COUNT 0
#define IEEE80211_DEFAULT_CHANCHANGE_TBTT_COUNT 3
#define IEEE80211_RADAR_TEST_MUTE_CHAN 36 /* Move to channel 36 for mute test */
/* bits 0-3 are for private use by drivers */
@ -218,6 +245,8 @@ struct ieee80211_channel {
(((_c)->ic_flags & IEEE80211_CHAN_RADAR) != 0)
#define IEEE80211_IS_CHAN_PASSIVE(_c) \
(((_c)->ic_flags & IEEE80211_CHAN_PASSIVE) != 0)
#define IEEE80211_ARE_CHANS_SAME_MODE(_a, _b) \
(((_a)->ic_flags & IEEE80211_CHAN_ALLTURBO) == ((_b)->ic_flags & IEEE80211_CHAN_ALLTURBO))
/* ni_chan encoding for FH phy */
#define IEEE80211_FH_CHANMOD 80
@ -225,6 +254,49 @@ struct ieee80211_channel {
#define IEEE80211_FH_CHANSET(chan) ((chan) / IEEE80211_FH_CHANMOD + 1)
#define IEEE80211_FH_CHANPAT(chan) ((chan) % IEEE80211_FH_CHANMOD)
/*
* Spectrum Management (IEEE 802.11h-2003)
*/
/* algorithm for (re)association based on supported channels
* (the one mentioned in 11.6.1 as out of scope of .11h) */
enum ieee80211_sc_algorithm {
IEEE80211_SC_NONE,
/*
* Do not disallow anyone from associating. When needed, channel will
* be switched to the most suitable channel, no matter client stations
* support it or not.
*/
IEEE80211_SC_LOOSE,
/*
* Do not disallow anyone from associating. When needed, channel will
* be switched to a suitable channel, which will be chosen taking
* ni->ni_suppchans and ic->ic_sc_sldg under consideration.
*/
IEEE80211_SC_TIGHT,
/*
* Allow to associate if there are at least ic->ic_mincom channels
* common to the associating station and all of the already associated
* stations. If the number of new common channels is less than
* required, consider disassociating some other STAs. Such a
* disassociation will be performed if (and only if) the association we
* are currently considering would be then possible and the count of
* the resultant set of common channels (ic_chan_nodes[i] ==
* ic_cn_total) would increase by some amount. Whether the number of
* the new channels that could be gained is enough to sacrifice a
* number of STAs is determined by the ic->ic_slcg parameter.
*/
IEEE80211_SC_STRICT
/*
* Basically the same behavior as IEEE80211_SC_TIGHT, except that if a
* station does not specify Supported Channels, then it is denied to
* associate.
*/
};
/*
* 802.11 rate set.
*/

View File

@ -840,7 +840,7 @@ ieee80211_mark_dfs(struct ieee80211com *ic, struct ieee80211_channel *ichan)
} else {
/* Change to a radar free 11a channel for dfstesttime seconds */
ic->ic_chanchange_chan = IEEE80211_RADAR_TEST_MUTE_CHAN;
ic->ic_chanchange_tbtt = IEEE80211_RADAR_11HCOUNT;
ic->ic_chanchange_tbtt = IEEE80211_RADAR_CHANCHANGE_TBTT_COUNT;
ic->ic_flags |= IEEE80211_F_CHANSWITCH;
/* A timer is setup in the radar task if markdfs is not set and
* we are in hostap mode.
@ -861,7 +861,7 @@ ieee80211_dfs_test_return(struct ieee80211com *ic, u_int8_t ieeeChan)
if_printf(dev, "Returning to channel %d\n", ieeeChan);
printk("Returning to chan %d\n", ieeeChan);
ic->ic_chanchange_chan = ieeeChan;
ic->ic_chanchange_tbtt = IEEE80211_RADAR_11HCOUNT;
ic->ic_chanchange_tbtt = IEEE80211_RADAR_CHANCHANGE_TBTT_COUNT;
ic->ic_flags |= IEEE80211_F_CHANSWITCH;
}
EXPORT_SYMBOL(ieee80211_dfs_test_return);

View File

@ -58,7 +58,7 @@
*/
static const struct ieee80211_cipher *ciphers[IEEE80211_CIPHER_MAX];
static int _ieee80211_crypto_delkey(struct ieee80211vap *,
static int ieee80211_crypto_delkey_locked(struct ieee80211vap *,
struct ieee80211_key *, struct ieee80211_node *);
/*
@ -439,7 +439,7 @@ EXPORT_SYMBOL(ieee80211_crypto_newkey);
* Remove the key (no locking, for internal use).
*/
static int
_ieee80211_crypto_delkey(struct ieee80211vap *vap, struct ieee80211_key *key,
ieee80211_crypto_delkey_locked(struct ieee80211vap *vap, struct ieee80211_key *key,
struct ieee80211_node *ni)
{
ieee80211_keyix_t keyix;
@ -484,7 +484,7 @@ ieee80211_crypto_delkey(struct ieee80211vap *vap, struct ieee80211_key *key,
dev_comp_set(vap, ni, 0);
#endif
ieee80211_key_update_begin(vap);
status = _ieee80211_crypto_delkey(vap, key, ni);
status = ieee80211_crypto_delkey_locked(vap, key, ni);
ieee80211_key_update_end(vap);
return status;
@ -501,7 +501,7 @@ ieee80211_crypto_delglobalkeys(struct ieee80211vap *vap)
ieee80211_key_update_begin(vap);
for (i = 0; i < IEEE80211_WEP_NKID; i++)
(void) _ieee80211_crypto_delkey(vap, &vap->iv_nw_keys[i], NULL);
(void) ieee80211_crypto_delkey_locked(vap, &vap->iv_nw_keys[i], NULL);
ieee80211_key_update_end(vap);
}
EXPORT_SYMBOL(ieee80211_crypto_delglobalkeys);

View File

@ -131,6 +131,7 @@ struct ieee80211_stats {
u_int32_t is_rx_assoc_capmismatch;/* rx assoc w/ cap mismatch */
u_int32_t is_rx_assoc_norate; /* rx assoc w/ no rate match */
u_int32_t is_rx_assoc_badwpaie; /* rx assoc w/ bad WPA IE */
u_int32_t is_rx_assoc_badscie; /* rx assoc w/ bad SC IE */
u_int32_t is_rx_deauth; /* rx deauthentication */
u_int32_t is_rx_disassoc; /* rx disassociation */
u_int32_t is_rx_badsubtype; /* rx frame w/ unknown subtype*/
@ -163,6 +164,7 @@ struct ieee80211_stats {
u_int32_t is_scan_active; /* active scans started */
u_int32_t is_scan_passive; /* passive scans started */
u_int32_t is_node_timeout; /* nodes timed out inactivity */
u_int32_t is_node_fdisassoc; /* forced node disassociation */
u_int32_t is_crypto_nomem; /* no memory for crypto ctx */
u_int32_t is_crypto_tkip; /* tkip crypto done in s/w */
u_int32_t is_crypto_tkipenmic; /* tkip en-MIC done in s/w */

View File

@ -290,7 +290,7 @@ u_int8_t *ieee80211_add_xr_param(u_int8_t *, struct ieee80211vap *);
u_int8_t *ieee80211_add_xr_param(u_int8_t *, struct ieee80211vap *);
u_int8_t *ieee80211_add_wme_param(u_int8_t *, struct ieee80211_wme_state *, int);
u_int8_t *ieee80211_add_country(u_int8_t *, struct ieee80211com *);
u_int8_t *ieee80211_add_country(u_int8_t *, struct ieee80211com *);
u_int8_t *ieee80211_add_pwrcnstr(u_int8_t *frm, struct ieee80211com *ic);
u_int8_t *ieee80211_add_athAdvCap(u_int8_t *, u_int8_t, u_int16_t);
/*

View File

@ -978,7 +978,7 @@ ieee80211_scan_dfs_action(struct ieee80211vap *vap,
se->se_chan->ic_freq);
if (vap->iv_state == IEEE80211_S_RUN) {
ic->ic_chanchange_chan = se->se_chan->ic_ieee;
ic->ic_chanchange_tbtt = IEEE80211_RADAR_11HCOUNT;
ic->ic_chanchange_tbtt = IEEE80211_RADAR_CHANCHANGE_TBTT_COUNT;
ic->ic_flags |= IEEE80211_F_CHANSWITCH;
} else {
/*
@ -1015,7 +1015,7 @@ ieee80211_scan_dfs_action(struct ieee80211vap *vap,
ic->ic_channels[chanStart].ic_ieee,
ic->ic_channels[chanStart].ic_freq);
ic->ic_chanchange_chan = ic->ic_channels[chanStart].ic_ieee;
ic->ic_chanchange_tbtt = IEEE80211_RADAR_11HCOUNT;
ic->ic_chanchange_tbtt = IEEE80211_RADAR_CHANCHANGE_TBTT_COUNT;
ic->ic_flags |= IEEE80211_F_CHANSWITCH;
}
}

View File

@ -542,7 +542,24 @@ sta_start(struct ieee80211_scan_state *ss, struct ieee80211vap *vap)
ss->ss_next = 0;
/* XXX tunables */
ss->ss_mindwell = msecs_to_jiffies(20); /* 20ms */
/*
* MT: The scanner will stay on station for ss_maxdwell ms (using a
* timer), collecting responses. ss_maxdwell can adjusted downward
* so the station gets back on channel before DTIM occurs. If the
* station receives probe responses before ss_mindwell has elapsed, the
* timer continues. If it receives probe responses after ss_mindwell
* then the timer is cancelled and the next channel is chosen.
* Basically, you are going to get the mindwell if you are scanning an
* occupied channel in the real world and the maxdwell if it's empty.
*
* This seems somehow wrong to me, as you tend to want to fish where the
* fish is bitin'.
*
* I'm bumping mindwell up to 60ms (was 20ms). This gives us a reasonable
* chance to find all the APs with active scans, and should pick up
* everything within a few passes for passive.
*/
ss->ss_mindwell = msecs_to_jiffies(60); /* 60ms */
ss->ss_maxdwell = msecs_to_jiffies(200); /* 200ms */
#ifdef IEEE80211_DEBUG