ieee80211_wds.c (271861) | ieee80211_wds.c (282820) |
---|---|
1/*- 2 * Copyright (c) 2007-2008 Sam Leffler, Errno Consulting 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26#include <sys/cdefs.h> 27#ifdef __FreeBSD__ | 1/*- 2 * Copyright (c) 2007-2008 Sam Leffler, Errno Consulting 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26#include <sys/cdefs.h> 27#ifdef __FreeBSD__ |
28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_wds.c 271861 2014-09-19 09:20:55Z glebius $"); | 28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_wds.c 282820 2015-05-12 16:55:50Z adrian $"); |
29#endif 30 31/* 32 * IEEE 802.11 WDS mode support. 33 */ 34#include "opt_inet.h" 35#include "opt_wlan.h" 36 --- 364 unchanged lines hidden (view full) --- 401 * during AP scanning to select a AP to associate with; it can have 402 * any units so long as values have consistent units and higher values 403 * mean ``better signal''. The receive timestamp is currently not used 404 * by the 802.11 layer. 405 */ 406static int 407wds_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf) 408{ | 29#endif 30 31/* 32 * IEEE 802.11 WDS mode support. 33 */ 34#include "opt_inet.h" 35#include "opt_wlan.h" 36 --- 364 unchanged lines hidden (view full) --- 401 * during AP scanning to select a AP to associate with; it can have 402 * any units so long as values have consistent units and higher values 403 * mean ``better signal''. The receive timestamp is currently not used 404 * by the 802.11 layer. 405 */ 406static int 407wds_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf) 408{ |
409#define HAS_SEQ(type) ((type & 0x4) == 0) | |
410 struct ieee80211vap *vap = ni->ni_vap; 411 struct ieee80211com *ic = ni->ni_ic; 412 struct ifnet *ifp = vap->iv_ifp; 413 struct ieee80211_frame *wh; 414 struct ieee80211_key *key; 415 struct ether_header *eh; 416 int hdrspace, need_tap = 1; /* mbuf need to be tapped. */ 417 uint8_t dir, type, subtype, qos; --- 65 unchanged lines hidden (view full) --- 483 /* not interested in */ 484 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, 485 wh->i_addr1, NULL, "%s", "not to bss"); 486 vap->iv_stats.is_rx_wrongbss++; 487 goto out; 488 } 489 IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); 490 ni->ni_noise = nf; | 409 struct ieee80211vap *vap = ni->ni_vap; 410 struct ieee80211com *ic = ni->ni_ic; 411 struct ifnet *ifp = vap->iv_ifp; 412 struct ieee80211_frame *wh; 413 struct ieee80211_key *key; 414 struct ether_header *eh; 415 int hdrspace, need_tap = 1; /* mbuf need to be tapped. */ 416 uint8_t dir, type, subtype, qos; --- 65 unchanged lines hidden (view full) --- 482 /* not interested in */ 483 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, 484 wh->i_addr1, NULL, "%s", "not to bss"); 485 vap->iv_stats.is_rx_wrongbss++; 486 goto out; 487 } 488 IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); 489 ni->ni_noise = nf; |
491 if (HAS_SEQ(type)) { | 490 if (IEEE80211_HAS_SEQ(type, subtype)) { |
492 uint8_t tid = ieee80211_gettid(wh); 493 if (IEEE80211_QOS_HAS_SEQ(wh) && 494 TID_TO_WME_AC(tid) >= WME_AC_VI) 495 ic->ic_wme.wme_hipri_traffic++; 496 rxseq = le16toh(*(uint16_t *)wh->i_seq); 497 if (! ieee80211_check_rxseq(ni, wh)) { 498 /* duplicate, discard */ 499 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, --- 301 unchanged lines hidden --- | 491 uint8_t tid = ieee80211_gettid(wh); 492 if (IEEE80211_QOS_HAS_SEQ(wh) && 493 TID_TO_WME_AC(tid) >= WME_AC_VI) 494 ic->ic_wme.wme_hipri_traffic++; 495 rxseq = le16toh(*(uint16_t *)wh->i_seq); 496 if (! ieee80211_check_rxseq(ni, wh)) { 497 /* duplicate, discard */ 498 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, --- 301 unchanged lines hidden --- |