diff options
Diffstat (limited to 'sys/net80211')
-rw-r--r-- | sys/net80211/ieee80211_adhoc.c | 5 | ||||
-rw-r--r-- | sys/net80211/ieee80211_ht.c | 29 | ||||
-rw-r--r-- | sys/net80211/ieee80211_node.c | 51 | ||||
-rw-r--r-- | sys/net80211/ieee80211_node.h | 1 | ||||
-rw-r--r-- | sys/net80211/ieee80211_sta.c | 8 |
5 files changed, 53 insertions, 41 deletions
diff --git a/sys/net80211/ieee80211_adhoc.c b/sys/net80211/ieee80211_adhoc.c index a9334d0..eca9877 100644 --- a/sys/net80211/ieee80211_adhoc.c +++ b/sys/net80211/ieee80211_adhoc.c @@ -371,10 +371,7 @@ adhoc_input(struct ieee80211_node *ni, struct mbuf *m, /* * Validate the bssid. */ - if (!(type == IEEE80211_FC0_TYPE_MGT && - (subtype == IEEE80211_FC0_SUBTYPE_BEACON || - subtype == IEEE80211_FC0_SUBTYPE_PROBE_RESP)) && - !IEEE80211_ADDR_EQ(bssid, vap->iv_bss->ni_bssid) && + if (!IEEE80211_ADDR_EQ(bssid, vap->iv_bss->ni_bssid) && !IEEE80211_ADDR_EQ(bssid, ifp->if_broadcastaddr)) { /* not interested in */ IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c index be380e9..cf78e88 100644 --- a/sys/net80211/ieee80211_ht.c +++ b/sys/net80211/ieee80211_ht.c @@ -136,12 +136,10 @@ const struct ieee80211_mcs_rates ieee80211_htrates[IEEE80211_HTRATE_MAXSIZE] = { { 429, 477, 891, 990 }, /* MCS 76 */ }; -#ifdef IEEE80211_AMPDU_AGE static int ieee80211_ampdu_age = -1; /* threshold for ampdu reorder q (ms) */ SYSCTL_PROC(_net_wlan, OID_AUTO, ampdu_age, CTLTYPE_INT | CTLFLAG_RW, &ieee80211_ampdu_age, 0, ieee80211_sysctl_msecs_ticks, "I", "AMPDU max reorder age (ms)"); -#endif static int ieee80211_recv_bar_ena = 1; SYSCTL_INT(_net_wlan, OID_AUTO, recv_bar, CTLFLAG_RW, &ieee80211_recv_bar_ena, @@ -178,9 +176,7 @@ ieee80211_ht_init(void) /* * Setup HT parameters that depends on the clock frequency. */ -#ifdef IEEE80211_AMPDU_AGE ieee80211_ampdu_age = msecs_to_ticks(500); -#endif ieee80211_addba_timeout = msecs_to_ticks(250); ieee80211_addba_backoff = msecs_to_ticks(10*1000); ieee80211_bar_timeout = msecs_to_ticks(250); @@ -671,7 +667,6 @@ ampdu_rx_dispatch(struct ieee80211_rx_ampdu *rap, struct ieee80211_node *ni) vap->iv_stats.is_ampdu_rx_oor += i; } -#ifdef IEEE80211_AMPDU_AGE /* * Dispatch all frames in the A-MPDU re-order queue. */ @@ -696,7 +691,6 @@ ampdu_rx_flush(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap) break; } } -#endif /* IEEE80211_AMPDU_AGE */ /* * Dispatch all frames in the A-MPDU re-order queue @@ -864,7 +858,7 @@ again: * Common case (hopefully): in the BA window. * Sec 9.10.7.6.2 a) (p.137) */ -#ifdef IEEE80211_AMPDU_AGE + /* * Check for frames sitting too long in the reorder queue. * This should only ever happen if frames are not delivered @@ -903,7 +897,7 @@ again: */ rap->rxa_age = ticks; } -#endif /* IEEE80211_AMPDU_AGE */ + /* save packet */ if (rap->rxa_m[off] == NULL) { rap->rxa_m[off] = m; @@ -1063,8 +1057,9 @@ ieee80211_ht_node_init(struct ieee80211_node *ni) IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, ni, - "%s: called", - __func__); + "%s: called (%p)", + __func__, + ni); if (ni->ni_flags & IEEE80211_NODE_HT) { /* @@ -1074,8 +1069,8 @@ ieee80211_ht_node_init(struct ieee80211_node *ni) */ IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, ni, - "%s: calling cleanup", - __func__); + "%s: calling cleanup (%p)", + __func__, ni); ieee80211_ht_node_cleanup(ni); } for (tid = 0; tid < WME_NUM_TID; tid++) { @@ -1100,8 +1095,8 @@ ieee80211_ht_node_cleanup(struct ieee80211_node *ni) IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, ni, - "%s: called", - __func__); + "%s: called (%p)", + __func__, ni); KASSERT(ni->ni_flags & IEEE80211_NODE_HT, ("not an HT node")); @@ -1124,14 +1119,11 @@ ieee80211_ht_node_cleanup(struct ieee80211_node *ni) void ieee80211_ht_node_age(struct ieee80211_node *ni) { -#ifdef IEEE80211_AMPDU_AGE struct ieee80211vap *vap = ni->ni_vap; uint8_t tid; -#endif KASSERT(ni->ni_flags & IEEE80211_NODE_HT, ("not an HT sta")); -#ifdef IEEE80211_AMPDU_AGE for (tid = 0; tid < WME_NUM_TID; tid++) { struct ieee80211_rx_ampdu *rap; @@ -1154,7 +1146,6 @@ ieee80211_ht_node_age(struct ieee80211_node *ni) ampdu_rx_flush(ni, rap); } } -#endif /* IEEE80211_AMPDU_AGE */ } static struct ieee80211_channel * @@ -2166,7 +2157,7 @@ ieee80211_ampdu_enable(struct ieee80211_node *ni, return 0; /* XXX check rssi? */ if (tap->txa_attempts >= ieee80211_addba_maxtries && - ticks < tap->txa_nextrequest) { + ieee80211_time_after(ticks, tap->txa_nextrequest)) { /* * Don't retry too often; txa_nextrequest is set * to the minimum interval we'll retry after diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 66afb74..0986145 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -330,9 +330,10 @@ ieee80211_create_ibss(struct ieee80211vap* vap, struct ieee80211_channel *chan) struct ieee80211_node *ni; IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, - "%s: creating %s on channel %u\n", __func__, + "%s: creating %s on channel %u%c\n", __func__, ieee80211_opmode_name[vap->iv_opmode], - ieee80211_chan2ieee(ic, chan)); + ieee80211_chan2ieee(ic, chan), + ieee80211_channel_type_char(chan)); ni = ieee80211_alloc_node(&ic->ic_sta, vap, vap->iv_myaddr); if (ni == NULL) { @@ -556,31 +557,18 @@ check_bss_debug(struct ieee80211vap *vap, struct ieee80211_node *ni) } #endif /* IEEE80211_DEBUG */ -/* - * Handle 802.11 ad hoc network merge. The - * convention, set by the Wireless Ethernet Compatibility Alliance - * (WECA), is that an 802.11 station will change its BSSID to match - * the "oldest" 802.11 ad hoc network, on the same channel, that - * has the station's desired SSID. The "oldest" 802.11 network - * sends beacons with the greatest TSF timestamp. - * - * The caller is assumed to validate TSF's before attempting a merge. - * - * Return !0 if the BSSID changed, 0 otherwise. - */ + int -ieee80211_ibss_merge(struct ieee80211_node *ni) +ieee80211_ibss_merge_check(struct ieee80211_node *ni) { struct ieee80211vap *vap = ni->ni_vap; -#ifdef IEEE80211_DEBUG - struct ieee80211com *ic = ni->ni_ic; -#endif if (ni == vap->iv_bss || IEEE80211_ADDR_EQ(ni->ni_bssid, vap->iv_bss->ni_bssid)) { /* unchanged, nothing to do */ return 0; } + if (!check_bss(vap, ni)) { /* capabilities mismatch */ IEEE80211_DPRINTF(vap, IEEE80211_MSG_ASSOC, @@ -592,6 +580,33 @@ ieee80211_ibss_merge(struct ieee80211_node *ni) vap->iv_stats.is_ibss_capmismatch++; return 0; } + + return 1; +} + +/* + * Handle 802.11 ad hoc network merge. The + * convention, set by the Wireless Ethernet Compatibility Alliance + * (WECA), is that an 802.11 station will change its BSSID to match + * the "oldest" 802.11 ad hoc network, on the same channel, that + * has the station's desired SSID. The "oldest" 802.11 network + * sends beacons with the greatest TSF timestamp. + * + * The caller is assumed to validate TSF's before attempting a merge. + * + * Return !0 if the BSSID changed, 0 otherwise. + */ +int +ieee80211_ibss_merge(struct ieee80211_node *ni) +{ +#ifdef IEEE80211_DEBUG + struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211com *ic = ni->ni_ic; +#endif + + if (! ieee80211_ibss_merge_check(ni)) + return 0; + IEEE80211_DPRINTF(vap, IEEE80211_MSG_ASSOC, "%s: new bssid %s: %s preamble, %s slot time%s\n", __func__, ether_sprintf(ni->ni_bssid), diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h index e9b7393..9492fc0 100644 --- a/sys/net80211/ieee80211_node.h +++ b/sys/net80211/ieee80211_node.h @@ -330,6 +330,7 @@ void ieee80211_setupcurchan(struct ieee80211com *, struct ieee80211_channel *); void ieee80211_setcurchan(struct ieee80211com *, struct ieee80211_channel *); void ieee80211_update_chw(struct ieee80211com *); +int ieee80211_ibss_merge_check(struct ieee80211_node *); int ieee80211_ibss_merge(struct ieee80211_node *); struct ieee80211_scan_entry; int ieee80211_sta_join(struct ieee80211vap *, struct ieee80211_channel *, diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c index 9c1707b..d80c767 100644 --- a/sys/net80211/ieee80211_sta.c +++ b/sys/net80211/ieee80211_sta.c @@ -1706,6 +1706,14 @@ sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, int subtype, } /* + * Always initialise FF/superg state; we can use this + * for doing A-MSDU encapsulation as well. + */ +#ifdef IEEE80211_SUPPORT_SUPERG + ieee80211_ff_node_init(ni); +#endif + + /* * Configure state now that we are associated. * * XXX may need different/additional driver callbacks? |