xref: /aosp_15_r20/external/wmediumd/wmediumd/ieee80211.h (revision 621120a22a0cd8ba80b131fe8bcb37c86ff453e3)
1 /*
2  *	wmediumd, wireless medium simulator for mac80211_hwsim kernel module
3  *	Copyright (c) 2011 cozybit Inc.
4  *
5  *	Author:	Javier Lopez	<[email protected]>
6  *		Javier Cardona	<[email protected]>
7  *
8  *	This program is free software; you can redistribute it and/or
9  *	modify it under the terms of the GNU General Public License
10  *	as published by the Free Software Foundation; either version 2
11  *	of the License, or (at your option) any later version.
12  *
13  *	This program is distributed in the hope that it will be useful,
14  *	but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *	GNU General Public License for more details.
17  *
18  *	You should have received a copy of the GNU General Public License
19  *	along with this program; if not, write to the Free Software
20  *	Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  *	02110-1301, USA.
22  */
23 
24 #ifndef IEEE80211_H_
25 #define IEEE80211_H_
26 
27 #define IEEE80211_AVAILABLE_RATES 12
28 #define IEEE80211_TX_MAX_RATES 4
29 #define IEEE80211_NUM_ACS 4
30 
31 #ifndef ETH_ALEN
32 #define ETH_ALEN 6
33 #endif
34 
35 #define FCTL_FTYPE		0x0c
36 #define FCTL_TODS		0x01
37 #define FCTL_FROMDS		0x02
38 
39 #define FTYPE_MGMT		0x00
40 #define FTYPE_DATA		0x08
41 
42 #define STYPE_QOS_DATA		0x80
43 #define STYPE_PROBE_REQ		0x40
44 
45 #define QOS_CTL_TAG1D_MASK	0x07
46 
47 enum ieee80211_ac_number {
48 	IEEE80211_AC_VO		= 0,
49 	IEEE80211_AC_VI		= 1,
50 	IEEE80211_AC_BE		= 2,
51 	IEEE80211_AC_BK		= 3,
52 };
53 
54 enum ieee80211_eid {
55 	WLAN_EID_VENDOR_SPECIFIC = 221,
56 };
57 
58 static const enum ieee80211_ac_number ieee802_1d_to_ac[8] = {
59 	IEEE80211_AC_BE,
60 	IEEE80211_AC_BK,
61 	IEEE80211_AC_BK,
62 	IEEE80211_AC_BE,
63 	IEEE80211_AC_VI,
64 	IEEE80211_AC_VI,
65 	IEEE80211_AC_VO,
66 	IEEE80211_AC_VO
67 };
68 
69 struct ieee80211_hdr {
70 	unsigned char frame_control[2];
71 	unsigned char duration_id[2];
72 	unsigned char addr1[ETH_ALEN];
73 	unsigned char addr2[ETH_ALEN];
74 	unsigned char addr3[ETH_ALEN];
75 	unsigned char seq_ctrl[2];
76 	unsigned char addr4[ETH_ALEN];
77 };
78 
79 struct ieee80211_element {
80 	unsigned char id;
81 	unsigned char datalen;
82 	unsigned char data[];
83 } __attribute__((packed));
84 
85 #endif /* IEEE80211_H_ */
86