hostapd
wmm_ac.h
1 /*
2  * Wi-Fi Multimedia Admission Control (WMM-AC)
3  * Copyright(c) 2014, Intel Mobile Communication GmbH.
4  * Copyright(c) 2014, Intel Corporation. All rights reserved.
5  *
6  * This software may be distributed under the terms of the BSD license.
7  * See README for more details.
8  */
9 
10 #ifndef WMM_AC_H
11 #define WMM_AC_H
12 
13 #include "common/ieee802_11_defs.h"
14 #include "drivers/driver.h"
15 
16 struct wpa_supplicant;
17 
18 #define WMM_AC_ACCESS_POLICY_EDCA 1
19 #define WMM_AC_FIXED_MSDU_SIZE BIT(15)
20 
21 #define WMM_AC_MAX_TID 7
22 #define WMM_AC_MAX_USER_PRIORITY 7
23 #define WMM_AC_MIN_SBA_UNITY 0x2000
24 #define WMM_AC_MAX_NOMINAL_MSDU 32767
25 
35  struct {
36  /*
37  * acm - Admission Control Mandatory
38  * In case an access category is ACM, the traffic will have
39  * to be admitted by WMM-AC's admission mechanism before use.
40  */
41  unsigned int acm:1;
42 
43  /*
44  * uapsd_queues - Unscheduled Automatic Power Save Delivery
45  * queues.
46  * Indicates whether ACs are configured for U-APSD (or legacy
47  * PS). Storing this value is necessary in order to set the
48  * Power Save Bit (PSB) in ADDTS request Action frames (if not
49  * given).
50  */
51  unsigned int uapsd:1;
52  } ac_params[WMM_AC_NUM];
53 };
54 
58 enum wmm_ac_dir {
59  WMM_AC_DIR_UPLINK = 0,
60  WMM_AC_DIR_DOWNLINK = 1,
61  WMM_AC_DIR_BIDIRECTIONAL = 3
62 };
63 
71 enum ts_dir_idx {
72  TS_DIR_IDX_UPLINK,
73  TS_DIR_IDX_DOWNLINK,
74  TS_DIR_IDX_BIDI,
75 
76  TS_DIR_IDX_COUNT
77 };
78 #define TS_DIR_IDX_ALL (BIT(TS_DIR_IDX_COUNT) - 1)
79 
90  /*
91  * dialog token - Used to link the received ADDTS response with this
92  * saved ADDTS request when ADDTS response is being handled
93  */
94  u8 dialog_token;
95 
96  /*
97  * address - The alleged traffic stream's receiver/transmitter address
98  * Address and TID are used to identify the TS (TID is contained in
99  * TSPEC)
100  */
101  u8 address[ETH_ALEN];
102 
103  /*
104  * tspec - Traffic Stream Specification, will be used to compare the
105  * sent TSPEC in ADDTS request to the received TSPEC in ADDTS response
106  * and act accordingly in ADDTS response handling
107  */
108  struct wmm_tspec_element tspec;
109 };
110 
111 
119  /*
120  * tsid - Traffic ID
121  * TID and address are used to identify the TS
122  */
123  int tsid;
124 
125  /*
126  * direction - Traffic Stream's direction
127  */
128  enum wmm_ac_dir direction;
129 
130  /*
131  * user_priority - Traffic Stream's user priority
132  */
133  int user_priority;
134 
135  /*
136  * nominal_msdu_size - Nominal MAC service data unit size
137  */
138  int nominal_msdu_size;
139 
140  /*
141  * fixed_nominal_msdu - Whether the size is fixed
142  * 0 = Nominal MSDU size is not fixed
143  * 1 = Nominal MSDU size is fixed
144  */
145  int fixed_nominal_msdu;
146 
147  /*
148  * surplus_bandwidth_allowance - Specifies excess time allocation
149  */
150  int mean_data_rate;
151 
152  /*
153  * minimum_phy_rate - Specifies the minimum supported PHY rate in bps
154  */
155  int minimum_phy_rate;
156 
157  /*
158  * surplus_bandwidth_allowance - Specifies excess time allocation
159  */
160  int surplus_bandwidth_allowance;
161 };
162 
163 void wmm_ac_notify_assoc(struct wpa_supplicant *wpa_s, const u8 *ies,
164  size_t ies_len, const struct wmm_params *wmm_params);
165 void wmm_ac_notify_disassoc(struct wpa_supplicant *wpa_s);
166 int wpas_wmm_ac_addts(struct wpa_supplicant *wpa_s,
167  struct wmm_ac_ts_setup_params *params);
168 int wpas_wmm_ac_delts(struct wpa_supplicant *wpa_s, u8 tsid);
169 void wmm_ac_rx_action(struct wpa_supplicant *wpa_s, const u8 *da,
170  const u8 *sa, const u8 *data, size_t len);
171 int wpas_wmm_ac_status(struct wpa_supplicant *wpa_s, char *buf, size_t buflen);
172 void wmm_ac_save_tspecs(struct wpa_supplicant *wpa_s);
173 void wmm_ac_clear_saved_tspecs(struct wpa_supplicant *wpa_s);
174 int wmm_ac_restore_tspecs(struct wpa_supplicant *wpa_s);
175 
176 #endif /* WMM_AC_H */
struct wmm_ac_ts_setup_params - TS setup parameters
Definition: wmm_ac.h:118
struct wmm_ac_addts_request - ADDTS Request Information
Definition: wmm_ac.h:89
struct wmm_ac_assoc_data - WMM Admission Control Association Data
Definition: wmm_ac.h:34
struct wpa_supplicant - Internal data for wpa_supplicant interface
Definition: wpa_supplicant_i.h:472
Definition: ieee802_11_defs.h:1274
struct wmm_params - WMM parameterss configured for this association : Bitmap of valid wmm_params info...
Definition: driver.h:1790