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.
6 * This software may be distributed under the terms of the BSD license.
7 * See README for more details.
13 #include "common/ieee802_11_defs.h"
14 #include "drivers/driver.h"
16 struct wpa_supplicant
;
18 #define WMM_AC_ACCESS_POLICY_EDCA 1
19 #define WMM_AC_FIXED_MSDU_SIZE BIT(15)
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
27 * struct wmm_ac_assoc_data - WMM Admission Control Association Data
29 * This struct will store any relevant WMM association data needed by WMM AC.
30 * In case there is a valid WMM association, an instance of this struct will be
31 * created. In case there is no instance of this struct, the station is not
32 * associated to a valid WMM BSS and hence, WMM AC will not be used.
34 struct wmm_ac_assoc_data
{
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.
44 * uapsd_queues - Unscheduled Automatic Power Save Delivery
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
52 } ac_params
[WMM_AC_NUM
];
56 * wmm_ac_dir - WMM Admission Control Direction
59 WMM_AC_DIR_UPLINK
= 0,
60 WMM_AC_DIR_DOWNLINK
= 1,
61 WMM_AC_DIR_BIDIRECTIONAL
= 3
65 * ts_dir_idx - indices of internally saved tspecs
67 * we can have multiple tspecs (downlink + uplink) per ac.
68 * save them in array, and use the enum to directly access
69 * the respective tspec slot (according to the direction).
78 #define TS_DIR_IDX_ALL (BIT(TS_DIR_IDX_COUNT) - 1)
81 * struct wmm_ac_addts_request - ADDTS Request Information
83 * The last sent ADDTS request(s) will be saved as element(s) of this struct in
84 * order to be compared with the received ADDTS response in ADDTS response
85 * action frame handling and should be stored until that point.
86 * In case a new traffic stream will be created/replaced/updated, only its
87 * relevant traffic stream information will be stored as a wmm_ac_ts struct.
89 struct wmm_ac_addts_request
{
91 * dialog token - Used to link the recived ADDTS response with this
92 * saved ADDTS request when ADDTS response is being handled
97 * address - The alleged traffic stream's receiver/transmitter address
98 * Address and TID are used to identify the TS (TID is contained in
101 u8 address
[ETH_ALEN
];
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
108 struct wmm_tspec_element tspec
;
113 * struct wmm_ac_ts_setup_params - TS setup parameters
115 * This struct holds parameters which should be provided
116 * to wmm_ac_ts_setup in order to setup a traffic stream
118 struct wmm_ac_ts_setup_params
{
121 * TID and address are used to identify the TS
126 * direction - Traffic Stream's direction
128 enum wmm_ac_dir direction
;
131 * user_priority - Traffic Stream's user priority
136 * nominal_msdu_size - Nominal MAC service data unit size
138 int nominal_msdu_size
;
141 * fixed_nominal_msdu - Whether the size is fixed
142 * 0 = Nominal MSDU size is not fixed
143 * 1 = Nominal MSDU size is fixed
145 int fixed_nominal_msdu
;
148 * surplus_bandwidth_allowance - Specifies excess time allocation
153 * minimum_phy_rate - Specifies the minimum supported PHY rate in bps
155 int minimum_phy_rate
;
158 * surplus_bandwidth_allowance - Specifies excess time allocation
160 int surplus_bandwidth_allowance
;
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
);
173 #endif /* WMM_AC_H */