2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
35 #define IS_TYPE_DATA(pMACHeader) \
36 ((((struct ieee80211_hdr *) pMACHeader)->frame_control & TYPE_802_11_MASK) == TYPE_802_11_DATA)
38 #define IS_TYPE_MGMT(pMACHeader) \
39 ((((struct ieee80211_hdr *) pMACHeader)->frame_control & TYPE_802_11_MASK) == TYPE_802_11_MGMT)
41 #define IS_TYPE_CONTROL(pMACHeader) \
42 ((((struct ieee80211_hdr *) pMACHeader)->frame_control & TYPE_802_11_MASK) == TYPE_802_11_CTL)
44 #define IS_FC_MOREDATA(pMACHeader) \
45 ((((struct ieee80211_hdr *) pMACHeader)->frame_control & FC_MOREDATA) == FC_MOREDATA)
47 #define IS_FC_POWERMGT(pMACHeader) \
48 ((((struct ieee80211_hdr *) pMACHeader)->frame_control & FC_POWERMGT) == FC_POWERMGT)
50 #define IS_FC_RETRY(pMACHeader) \
51 ((((struct ieee80211_hdr *) pMACHeader)->frame_control & FC_RETRY) == FC_RETRY)
53 #define IS_FC_WEP(pMACHeader) \
54 ((((struct ieee80211_hdr *) pMACHeader)->frame_control & FC_WEP) == FC_WEP)
58 #define IS_FRAGMENT_PKT(pMACHeader) \
59 (((((struct ieee80211_hdr *) pMACHeader)->frame_control & FC_MOREFRAG) != 0) | \
60 ((((struct ieee80211_hdr *) pMACHeader)->seq_ctrl & 0x0F00) != 0))
62 #define IS_FIRST_FRAGMENT_PKT(pMACHeader) \
63 ((((struct ieee80211_hdr *) pMACHeader)->seq_ctrl & 0x0F00) == 0)
67 #define IS_FRAGMENT_PKT(pMACHeader) \
68 (((((struct ieee80211_hdr *) pMACHeader)->frame_control & FC_MOREFRAG) != 0) | \
69 ((((struct ieee80211_hdr *) pMACHeader)->seq_ctrl & 0x000F) != 0))
71 #define IS_FIRST_FRAGMENT_PKT(pMACHeader) \
72 ((((struct ieee80211_hdr *) pMACHeader)->seq_ctrl & 0x000F) == 0)
74 #endif//#ifdef __BIG_ENDIAN
76 #define IS_LAST_FRAGMENT_PKT(pMACHeader) \
77 ((((struct ieee80211_hdr *) pMACHeader)->frame_control & FC_MOREFRAG) == 0)
79 #define IS_CTL_PSPOLL(pMACHeader) \
80 ((((struct ieee80211_hdr *) pMACHeader)->frame_control & TYPE_SUBTYPE_MASK) == TYPE_CTL_PSPOLL)
82 #define ADD_ONE_WITH_WRAP_AROUND(uVar, uModulo) { \
83 if ((uVar) >= ((uModulo) - 1)) \
89 bool WCTLbIsDuplicate(PSCache pCache
, struct ieee80211_hdr
*pMACHeader
);
90 bool WCTLbHandleFragment(struct vnt_private
*, struct ieee80211_hdr
*pMACHeader
, unsigned int cbFrameLength
, bool bWEP
, bool bExtIV
);
91 unsigned int WCTLuSearchDFCB(struct vnt_private
*, struct ieee80211_hdr
*pMACHeader
);
92 unsigned int WCTLuInsertDFCB(struct vnt_private
*, struct ieee80211_hdr
*pMACHeader
);
94 #endif /* __WCTL_H__ */