Changeset View
Changeset View
Standalone View
Standalone View
head/sys/net80211/ieee80211_input.h
Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Lines | |||||
* The routine only eliminates packets whose sequence/fragment | * The routine only eliminates packets whose sequence/fragment | ||||
* match or are less than the last seen sequence/fragment number | * match or are less than the last seen sequence/fragment number | ||||
* AND are retransmits It doesn't try to eliminate out of order packets. | * AND are retransmits It doesn't try to eliminate out of order packets. | ||||
* | * | ||||
* Since all frames after sequence number 4095 will be less than 4095 | * Since all frames after sequence number 4095 will be less than 4095 | ||||
* (as the seqnum wraps), handle that special case so packets aren't | * (as the seqnum wraps), handle that special case so packets aren't | ||||
* incorrectly dropped - ie, if the next packet is sequence number 0 | * incorrectly dropped - ie, if the next packet is sequence number 0 | ||||
* but a retransmit since the initial packet didn't make it. | * but a retransmit since the initial packet didn't make it. | ||||
* | |||||
* XXX TODO: handle sequence number space wrapping with dropped frames; | |||||
* especially in high interference conditions under high traffic load | |||||
* The RX AMPDU reorder code also needs it. | |||||
* | |||||
* XXX TODO: update for 802.11-2012 9.3.2.10 Duplicate Detection and Recovery. | |||||
*/ | */ | ||||
static __inline int | static __inline int | ||||
ieee80211_check_rxseq(struct ieee80211_node *ni, struct ieee80211_frame *wh, | ieee80211_check_rxseq(struct ieee80211_node *ni, struct ieee80211_frame *wh, | ||||
uint8_t *bssid) | uint8_t *bssid) | ||||
{ | { | ||||
#define SEQ_LEQ(a,b) ((int)((a)-(b)) <= 0) | #define SEQ_LEQ(a,b) ((int)((a)-(b)) <= 0) | ||||
#define SEQ_EQ(a,b) ((int)((a)-(b)) == 0) | #define SEQ_EQ(a,b) ((int)((a)-(b)) == 0) | ||||
#define SEQNO(a) ((a) >> IEEE80211_SEQ_SEQ_SHIFT) | #define SEQNO(a) ((a) >> IEEE80211_SEQ_SEQ_SHIFT) | ||||
#define FRAGNO(a) ((a) & IEEE80211_SEQ_FRAG_MASK) | #define FRAGNO(a) ((a) & IEEE80211_SEQ_FRAG_MASK) | ||||
struct ieee80211vap *vap = ni->ni_vap; | struct ieee80211vap *vap = ni->ni_vap; | ||||
uint16_t rxseq; | uint16_t rxseq; | ||||
uint8_t type, subtype; | uint8_t type, subtype; | ||||
uint8_t tid; | uint8_t tid; | ||||
struct ieee80211_rx_ampdu *rap; | struct ieee80211_rx_ampdu *rap; | ||||
rxseq = le16toh(*(uint16_t *)wh->i_seq); | rxseq = le16toh(*(uint16_t *)wh->i_seq); | ||||
type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; | type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; | ||||
subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; | subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; | ||||
/* | /* | ||||
* Types with no sequence number (or QoS (+)Null frames) | * Types with no sequence number (or QoS (+)Null frames) | ||||
* are always treated valid. | * are always treated valid. | ||||
*/ | */ | ||||
if (! IEEE80211_HAS_SEQ(type, subtype)) | if (! IEEE80211_HAS_SEQ(type, subtype)) | ||||
return 1; | |||||
/* | |||||
* Always allow multicast frames for now - QoS (any TID) | |||||
* or not. | |||||
*/ | |||||
if (IEEE80211_IS_MULTICAST(wh->i_addr1)) | |||||
return 1; | return 1; | ||||
tid = ieee80211_gettid(wh); | tid = ieee80211_gettid(wh); | ||||
/* | /* | ||||
* Only do the HT AMPDU check for WME stations; non-WME HT stations | * Only do the HT AMPDU check for WME stations; non-WME HT stations | ||||
* shouldn't exist outside of debugging. We should at least | * shouldn't exist outside of debugging. We should at least | ||||
* handle that. | * handle that. | ||||
▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines |