ieee80211_hostap.c (282742) | ieee80211_hostap.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_hostap.c 282742 2015-05-10 22:07:53Z adrian $"); | 28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_hostap.c 282820 2015-05-12 16:55:50Z adrian $"); |
29#endif 30 31/* 32 * IEEE 802.11 HOSTAP mode support. 33 */ 34#include "opt_inet.h" 35#include "opt_wlan.h" 36 --- 436 unchanged lines hidden (view full) --- 473 * during AP scanning to select a AP to associate with; it can have 474 * any units so long as values have consistent units and higher values 475 * mean ``better signal''. The receive timestamp is currently not used 476 * by the 802.11 layer. 477 */ 478static int 479hostap_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf) 480{ | 29#endif 30 31/* 32 * IEEE 802.11 HOSTAP mode support. 33 */ 34#include "opt_inet.h" 35#include "opt_wlan.h" 36 --- 436 unchanged lines hidden (view full) --- 473 * during AP scanning to select a AP to associate with; it can have 474 * any units so long as values have consistent units and higher values 475 * mean ``better signal''. The receive timestamp is currently not used 476 * by the 802.11 layer. 477 */ 478static int 479hostap_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf) 480{ |
481#define HAS_SEQ(type) ((type & 0x4) == 0) | |
482 struct ieee80211vap *vap = ni->ni_vap; 483 struct ieee80211com *ic = ni->ni_ic; 484 struct ifnet *ifp = vap->iv_ifp; 485 struct ieee80211_frame *wh; 486 struct ieee80211_key *key; 487 struct ether_header *eh; 488 int hdrspace, need_tap = 1; /* mbuf need to be tapped. */ 489 uint8_t dir, type, subtype, qos; --- 76 unchanged lines hidden (view full) --- 566 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, 567 bssid, NULL, "%s", "not to bss"); 568 vap->iv_stats.is_rx_wrongbss++; 569 goto out; 570 } 571 572 IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); 573 ni->ni_noise = nf; | 481 struct ieee80211vap *vap = ni->ni_vap; 482 struct ieee80211com *ic = ni->ni_ic; 483 struct ifnet *ifp = vap->iv_ifp; 484 struct ieee80211_frame *wh; 485 struct ieee80211_key *key; 486 struct ether_header *eh; 487 int hdrspace, need_tap = 1; /* mbuf need to be tapped. */ 488 uint8_t dir, type, subtype, qos; --- 76 unchanged lines hidden (view full) --- 565 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, 566 bssid, NULL, "%s", "not to bss"); 567 vap->iv_stats.is_rx_wrongbss++; 568 goto out; 569 } 570 571 IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); 572 ni->ni_noise = nf; |
574 if (HAS_SEQ(type)) { | 573 if (IEEE80211_HAS_SEQ(type, subtype)) { |
575 uint8_t tid = ieee80211_gettid(wh); 576 if (IEEE80211_QOS_HAS_SEQ(wh) && 577 TID_TO_WME_AC(tid) >= WME_AC_VI) 578 ic->ic_wme.wme_hipri_traffic++; 579 rxseq = le16toh(*(uint16_t *)wh->i_seq); 580 if (! ieee80211_check_rxseq(ni, wh)) { 581 /* duplicate, discard */ 582 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, --- 1759 unchanged lines hidden --- | 574 uint8_t tid = ieee80211_gettid(wh); 575 if (IEEE80211_QOS_HAS_SEQ(wh) && 576 TID_TO_WME_AC(tid) >= WME_AC_VI) 577 ic->ic_wme.wme_hipri_traffic++; 578 rxseq = le16toh(*(uint16_t *)wh->i_seq); 579 if (! ieee80211_check_rxseq(ni, wh)) { 580 /* duplicate, discard */ 581 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, --- 1759 unchanged lines hidden --- |