[ar71xx] remove another empty directory
[openwrt.git] / package / broadcom-wl / src / driver / proto / 802.11e.h
1 /*
2 * 802.11e protocol header file
3 *
4 * Copyright 2007, Broadcom Corporation
5 * All Rights Reserved.
6 *
7 * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8 * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9 * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
10 * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
11 *
12 * $Id$
13 */
14
15 #ifndef _802_11e_H_
16 #define _802_11e_H_
17
18 /* enable structure packing */
19 #if defined(__GNUC__)
20 #define PACKED __attribute__((packed))
21 #else
22 #pragma pack(1)
23 #define PACKED
24 #endif
25
26 #ifdef BCMDBG
27 extern const char *aci_names[];
28 #endif /* BCMDBG */
29
30 /* WME Traffic Specification (TSPEC) element */
31 #define WME_TSPEC_HDR_LEN 2 /* WME TSPEC header length */
32 #define WME_TSPEC_BODY_OFF 2 /* WME TSPEC body offset */
33
34 #define WME_CATEGORY_CODE_OFFSET 0 /* WME Category code offset */
35 #define WME_ACTION_CODE_OFFSET 1 /* WME Action code offset */
36 #define WME_TOKEN_CODE_OFFSET 2 /* WME Token code offset */
37 #define WME_STATUS_CODE_OFFSET 3 /* WME Status code offset */
38
39 struct tsinfo {
40 uint8 octets[3];
41 } PACKED;
42
43 typedef struct tsinfo tsinfo_t;
44
45 /* 802.11e TSPEC IE */
46 typedef struct tspec {
47 uint8 oui[DOT11_OUI_LEN]; /* WME_OUI */
48 uint8 type; /* WME_TYPE */
49 uint8 subtype; /* WME_SUBTYPE_TSPEC */
50 uint8 version; /* WME_VERSION */
51 tsinfo_t tsinfo; /* TS Info bit field */
52 uint16 nom_msdu_size; /* (Nominal or fixed) MSDU Size (bytes) */
53 uint16 max_msdu_size; /* Maximum MSDU Size (bytes) */
54 uint32 min_srv_interval; /* Minimum Service Interval (us) */
55 uint32 max_srv_interval; /* Maximum Service Interval (us) */
56 uint32 inactivity_interval; /* Inactivity Interval (us) */
57 uint32 suspension_interval; /* Suspension Interval (us) */
58 uint32 srv_start_time; /* Service Start Time (us) */
59 uint32 min_data_rate; /* Minimum Data Rate (bps) */
60 uint32 mean_data_rate; /* Mean Data Rate (bps) */
61 uint32 peak_data_rate; /* Peak Data Rate (bps) */
62 uint32 max_burst_size; /* Maximum Burst Size (bytes) */
63 uint32 delay_bound; /* Delay Bound (us) */
64 uint32 min_phy_rate; /* Minimum PHY Rate (bps) */
65 uint16 surplus_bw; /* Surplus Bandwidth Allowance Factor */
66 uint16 medium_time; /* Medium Time (32 us/s periods) */
67 } PACKED tspec_t;
68
69 #define WME_TSPEC_LEN (sizeof(tspec_t)) /* not including 2-bytes of header */
70
71 /* ts_info */
72 /* 802.1D priority is duplicated - bits 13-11 AND bits 3-1 */
73 #define TS_INFO_TID_SHIFT 1 /* TS info. TID shift */
74 #define TS_INFO_TID_MASK (0xf << TS_INFO_TID_SHIFT) /* TS info. TID mask */
75 #define TS_INFO_CONTENTION_SHIFT 7 /* TS info. contention shift */
76 #define TS_INFO_CONTENTION_MASK (0x1 << TS_INFO_CONTENTION_SHIFT) /* TS info. contention mask */
77 #define TS_INFO_DIRECTION_SHIFT 5 /* TS info. direction shift */
78 #define TS_INFO_DIRECTION_MASK (0x3 << TS_INFO_DIRECTION_SHIFT) /* TS info. direction mask */
79 #define TS_INFO_PSB_SHIFT 2 /* TS info. PSB bit Shift */
80 #define TS_INFO_PSB_MASK (1 << TS_INFO_PSB_SHIFT) /* TS info. PSB mask */
81 #define TS_INFO_UPLINK (0 << TS_INFO_DIRECTION_SHIFT) /* TS info. uplink */
82 #define TS_INFO_DOWNLINK (1 << TS_INFO_DIRECTION_SHIFT) /* TS info. downlink */
83 #define TS_INFO_BIDIRECTIONAL (3 << TS_INFO_DIRECTION_SHIFT) /* TS info. bidirectional */
84 #define TS_INFO_USER_PRIO_SHIFT 3 /* TS info. user priority shift */
85 /* TS info. user priority mask */
86 #define TS_INFO_USER_PRIO_MASK (0x7 << TS_INFO_USER_PRIO_SHIFT)
87
88 /* Macro to get/set bit(s) field in TSINFO */
89 #define WLC_CAC_GET_TID(pt) ((((pt).octets[0]) & TS_INFO_TID_MASK) >> TS_INFO_TID_SHIFT)
90 #define WLC_CAC_GET_DIR(pt) ((((pt).octets[0]) & \
91 TS_INFO_DIRECTION_MASK) >> TS_INFO_DIRECTION_SHIFT)
92 #define WLC_CAC_GET_PSB(pt) ((((pt).octets[1]) & WLC_CAC_PSB_MASK) >> WLC_CAC_PSB_SHIFT)
93 #define WLC_CAC_GET_USER_PRIO(pt) ((((pt).octets[1]) & \
94 TS_INFO_USER_PRIO_MASK) >> TS_INFO_USER_PRIO_SHIFT)
95
96 #define WLC_CAC_SET_TID(pt, id) ((((pt).octets[0]) & (~TS_INFO_TID_MASK)) | \
97 ((id) << TS_INFO_TID_SHIFT))
98 #define WLC_CAC_SET_USER_PRIO(pt, prio) ((((pt).octets[0]) & (~TS_INFO_USER_PRIO_MASK)) | \
99 ((prio) << TS_INFO_USER_PRIO_SHIFT))
100
101 /* 802.11e QBSS Load IE */
102 #define QBSS_LOAD_IE_LEN 5 /* QBSS Load IE length */
103 #define QBSS_LOAD_AAC_OFF 3 /* AAC offset in IE */
104
105 #define CAC_ADDTS_RESP_TIMEOUT 300 /* default ADDTS response timeout in ms */
106
107 /* 802.11e ADDTS status code */
108 #define DOT11E_STATUS_ADMISSION_ACCEPTED 0 /* TSPEC Admission accepted status */
109 #define DOT11E_STATUS_ADDTS_INVALID_PARAM 1 /* TSPEC invalid parameter status */
110 #define DOT11E_STATUS_ADDTS_REFUSED_NSBW 3 /* ADDTS refused (non-sufficient BW) */
111
112 /* 802.11e DELTS status code */
113 #define DOT11E_STATUS_QSTA_LEAVE_QBSS 36 /* STA leave QBSS */
114 #define DOT11E_STATUS_END_TS 37 /* END TS */
115 #define DOT11E_STATUS_UNKNOWN_TS 38 /* UNKNOWN TS */
116 #define DOT11E_STATUS_QSTA_REQ_TIMEOUT 39 /* STA ADDTS request timeout */
117
118 #undef PACKED
119 #if !defined(__GNUC__)
120 #pragma pack()
121 #endif
122
123 #endif /* _802_11e_CAC_H_ */
This page took 0.082642 seconds and 5 git commands to generate.