Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Srinivas Girigowda | ea32d6a | 2017-03-25 00:03:12 -0700 | [diff] [blame] | 2 | * Copyright (c) 2011-2012,2016-2017 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
| 28 | #ifndef _WLAN_HDD_WMM_H |
| 29 | #define _WLAN_HDD_WMM_H |
| 30 | |
| 31 | /** |
| 32 | * DOC: HDD WMM |
| 33 | * |
| 34 | * This module (wlan_hdd_wmm.h interface + wlan_hdd_wmm.c implementation) |
| 35 | * houses all the logic for WMM in HDD. |
| 36 | * |
| 37 | * On the control path, it has the logic to setup QoS, modify QoS and delete |
| 38 | * QoS (QoS here refers to a TSPEC). The setup QoS comes in two flavors: an |
| 39 | * explicit application invoked and an internal HDD invoked. The implicit QoS |
| 40 | * is for applications that do NOT call the custom QCT WLAN OIDs for QoS but |
| 41 | * which DO mark their traffic for priortization. It also has logic to start, |
| 42 | * update and stop the U-APSD trigger frame generation. It also has logic to |
| 43 | * read WMM related config parameters from the registry. |
| 44 | * |
| 45 | * On the data path, it has the logic to figure out the WMM AC of an egress |
| 46 | * packet and when to signal TL to serve a particular AC queue. It also has the |
| 47 | * logic to retrieve a packet based on WMM priority in response to a fetch from |
| 48 | * TL. |
| 49 | * |
| 50 | * The remaining functions are utility functions for information hiding. |
| 51 | */ |
| 52 | |
| 53 | /* Include files */ |
| 54 | #include <linux/workqueue.h> |
| 55 | #include <linux/list.h> |
| 56 | #include <wlan_hdd_main.h> |
| 57 | #include <wlan_hdd_wext.h> |
| 58 | #include <sme_qos_api.h> |
| 59 | |
| 60 | /*Maximum number of ACs */ |
| 61 | #define WLAN_MAX_AC 4 |
| 62 | |
| 63 | |
| 64 | /* Preprocessor Definitions and Constants */ |
| 65 | |
| 66 | /* #define HDD_WMM_DEBUG 1 */ |
| 67 | |
| 68 | #define HDD_WMM_CTX_MAGIC 0x574d4d58 /* "WMMX" */ |
| 69 | |
| 70 | #define HDD_WMM_HANDLE_IMPLICIT 0xFFFFFFFF |
| 71 | |
| 72 | #define HDD_WLAN_INVALID_STA_ID 0xFF |
| 73 | |
| 74 | /* Type Declarations */ |
| 75 | |
| 76 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 77 | * enum hdd_wmm_user_mode - WMM modes of operation |
| 78 | * |
| 79 | * @HDD_WMM_USER_MODE_AUTO: STA can associate with any AP, & HDD looks at |
| 80 | * the SME notification after association to find out if associated |
| 81 | * with QAP and acts accordingly |
| 82 | * @HDD_WMM_USER_MODE_QBSS_ONLY - SME will add the extra logic to make sure |
| 83 | * STA associates with a QAP only |
Padma, Santhosh Kumar | a9e08e9 | 2016-10-12 16:44:23 +0530 | [diff] [blame] | 84 | * @HDD_WMM_USER_MODE_NO_QOS - Join any AP, but uapsd is disabled |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 85 | */ |
Srinivas Girigowda | ea32d6a | 2017-03-25 00:03:12 -0700 | [diff] [blame] | 86 | enum hdd_wmm_user_mode { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 87 | HDD_WMM_USER_MODE_AUTO = 0, |
| 88 | HDD_WMM_USER_MODE_QBSS_ONLY = 1, |
| 89 | HDD_WMM_USER_MODE_NO_QOS = 2, |
Srinivas Girigowda | ea32d6a | 2017-03-25 00:03:12 -0700 | [diff] [blame] | 90 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 91 | |
| 92 | /* UAPSD Mask bits */ |
| 93 | /* (Bit0:VO; Bit1:VI; Bit2:BK; Bit3:BE all other bits are ignored) */ |
| 94 | #define HDD_AC_VO 0x1 |
| 95 | #define HDD_AC_VI 0x2 |
| 96 | #define HDD_AC_BK 0x4 |
| 97 | #define HDD_AC_BE 0x8 |
| 98 | |
| 99 | /** |
Rakesh Pillai | 3e534db | 2017-09-26 18:59:43 +0530 | [diff] [blame] | 100 | * enum hdd_wmm_linuxac: AC/Queue Index values for Linux Qdisc to |
| 101 | * operate on different traffic. |
| 102 | */ |
| 103 | enum hdd_wmm_linuxac { |
| 104 | HDD_LINUX_AC_VO = 0, |
| 105 | HDD_LINUX_AC_VI = 1, |
| 106 | HDD_LINUX_AC_BE = 2, |
| 107 | HDD_LINUX_AC_BK = 3, |
| 108 | HDD_LINUX_AC_HI_PRIO = 4, |
| 109 | }; |
| 110 | |
| 111 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 112 | * struct hdd_wmm_qos_context - HDD WMM QoS Context |
| 113 | * |
| 114 | * This structure holds the context for a single flow which has either |
| 115 | * been confgured explicitly from userspace or implicitly via the |
| 116 | * Implicit QoS feature. |
| 117 | * |
| 118 | * @node: list node which can be used to put the context into a list |
| 119 | * of contexts |
| 120 | * @handle: identifer which uniquely identifies this context to userspace |
| 121 | * @qosFlowID: identifier which uniquely identifies this flow to SME |
Jeff Johnson | b66d850 | 2017-10-02 11:18:08 -0700 | [diff] [blame] | 122 | * @adapter: adapter upon which this flow was configured |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 123 | * @acType: access category for this flow |
| 124 | * @lastStatus: the status of the last operation performed on this flow by SME |
| 125 | * @wmmAcSetupImplicitQos: work structure used for deferring implicit QoS work |
| 126 | * from softirq context to thread context |
| 127 | * @magic: magic number used to verify that this is a valid context when |
| 128 | * referenced anonymously |
| 129 | */ |
Srinivas Girigowda | ea32d6a | 2017-03-25 00:03:12 -0700 | [diff] [blame] | 130 | struct hdd_wmm_qos_context { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 131 | struct list_head node; |
| 132 | uint32_t handle; |
| 133 | uint32_t qosFlowId; |
Jeff Johnson | b66d850 | 2017-10-02 11:18:08 -0700 | [diff] [blame] | 134 | struct hdd_adapter *adapter; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 135 | sme_ac_enum_type acType; |
| 136 | hdd_wlan_wmm_status_e lastStatus; |
| 137 | struct work_struct wmmAcSetupImplicitQos; |
| 138 | uint32_t magic; |
| 139 | bool is_inactivity_timer_running; |
Srinivas Girigowda | ea32d6a | 2017-03-25 00:03:12 -0700 | [diff] [blame] | 140 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 141 | |
| 142 | /** |
| 143 | * struct hdd_wmm_ac_status - WMM related per-AC state & status info |
| 144 | * @wmmAcAccessRequired - does the AP require access to this AC? |
| 145 | * @wmmAcAccessNeeded - does the worker thread need to acquire access to |
| 146 | * this AC? |
| 147 | * @wmmAcAccessPending - is implicit QoS negotiation currently taking place? |
| 148 | * @wmmAcAccessFailed - has implicit QoS negotiation already failed? |
| 149 | * @wmmAcAccessGranted - has implicit QoS negotiation already succeeded? |
| 150 | * @wmmAcAccessAllowed - is access to this AC allowed, either because we |
| 151 | * are not doing WMM, we are not doing implicit QoS, implict QoS has |
| 152 | * completed, or explicit QoS has completed? |
| 153 | * @wmmAcTspecValid - is the wmmAcTspecInfo valid? |
| 154 | * @wmmAcUapsdInfoValid - are the wmmAcUapsd* fields valid? |
| 155 | * @wmmAcTspecInfo - current (possibly aggregate) Tspec for this AC |
| 156 | * @wmmAcIsUapsdEnabled - is UAPSD enabled on this AC? |
| 157 | * @wmmAcUapsdServiceInterval - service interval for this AC |
| 158 | * @wmmAcUapsdSuspensionInterval - suspension interval for this AC |
| 159 | * @wmmAcUapsdDirection - direction for this AC |
| 160 | * @wmmInactivityTime - inactivity time for this AC |
| 161 | * @wmmPrevTrafficCnt - TX counter used for inactivity detection |
| 162 | * @wmmInactivityTimer - timer used for inactivity detection |
| 163 | */ |
Srinivas Girigowda | ea32d6a | 2017-03-25 00:03:12 -0700 | [diff] [blame] | 164 | struct hdd_wmm_ac_status { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 165 | bool wmmAcAccessRequired; |
| 166 | bool wmmAcAccessNeeded; |
| 167 | bool wmmAcAccessPending; |
| 168 | bool wmmAcAccessFailed; |
| 169 | bool wmmAcAccessGranted; |
| 170 | bool wmmAcAccessAllowed; |
| 171 | bool wmmAcTspecValid; |
| 172 | bool wmmAcUapsdInfoValid; |
Abhishek Singh | 12be60f | 2017-08-11 13:52:42 +0530 | [diff] [blame] | 173 | struct sme_qos_wmmtspecinfo wmmAcTspecInfo; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 174 | bool wmmAcIsUapsdEnabled; |
| 175 | uint32_t wmmAcUapsdServiceInterval; |
| 176 | uint32_t wmmAcUapsdSuspensionInterval; |
Abhishek Singh | 12be60f | 2017-08-11 13:52:42 +0530 | [diff] [blame] | 177 | enum sme_qos_wmm_dir_type wmmAcUapsdDirection; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 178 | |
| 179 | #ifdef FEATURE_WLAN_ESE |
| 180 | uint32_t wmmInactivityTime; |
| 181 | uint32_t wmmPrevTrafficCnt; |
Anurag Chouhan | 210db07 | 2016-02-22 18:42:15 +0530 | [diff] [blame] | 182 | qdf_mc_timer_t wmmInactivityTimer; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 183 | #endif |
Srinivas Girigowda | ea32d6a | 2017-03-25 00:03:12 -0700 | [diff] [blame] | 184 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 185 | |
| 186 | /** |
| 187 | * struct hdd_wmm_status - WMM status maintained per-adapter |
| 188 | * @wmmContextList - list of WMM contexts active on the adapter |
| 189 | * @wmmLock - mutex used for exclusive access to this adapter's WMM status |
| 190 | * @wmmACStatus - per-AC WMM status |
| 191 | * @wmmQap - is this connected to a QoS-enabled AP? |
| 192 | * @wmmQosConnection - is this a QoS connection? |
| 193 | */ |
Srinivas Girigowda | ea32d6a | 2017-03-25 00:03:12 -0700 | [diff] [blame] | 194 | struct hdd_wmm_status { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 195 | struct list_head wmmContextList; |
| 196 | struct mutex wmmLock; |
Srinivas Girigowda | ea32d6a | 2017-03-25 00:03:12 -0700 | [diff] [blame] | 197 | struct hdd_wmm_ac_status wmmAcStatus[WLAN_MAX_AC]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 198 | bool wmmQap; |
| 199 | bool wmmQosConnection; |
Srinivas Girigowda | ea32d6a | 2017-03-25 00:03:12 -0700 | [diff] [blame] | 200 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 201 | |
| 202 | extern const uint8_t hdd_qdisc_ac_to_tl_ac[]; |
| 203 | extern const uint8_t hdd_wmm_up_to_ac_map[]; |
| 204 | extern const uint8_t hdd_linux_up_to_ac_map[]; |
| 205 | |
| 206 | #define WLAN_HDD_MAX_DSCP 0x3f |
| 207 | |
| 208 | /** |
| 209 | * hdd_wmmps_helper() - Function to set uapsd psb dynamically |
| 210 | * |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 211 | * @adapter: [in] pointer to adapter structure |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 212 | * @ptr: [in] pointer to command buffer |
| 213 | * |
| 214 | * Return: Zero on success, appropriate error on failure. |
| 215 | */ |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 216 | int hdd_wmmps_helper(struct hdd_adapter *adapter, uint8_t *ptr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 217 | |
| 218 | /** |
| 219 | * hdd_wmm_init() - initialize the WMM DSCP configuation |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 220 | * @adapter : [in] pointer to Adapter context |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 221 | * |
| 222 | * This function will initialize the WMM DSCP configuation of an |
| 223 | * adapter to an initial state. The configuration can later be |
| 224 | * overwritten via application APIs or via QoS Map sent OTA. |
| 225 | * |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 226 | * Return: QDF_STATUS enumeration |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 227 | */ |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 228 | QDF_STATUS hdd_wmm_init(struct hdd_adapter *adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 229 | |
| 230 | /** |
| 231 | * hdd_wmm_adapter_init() - initialize the WMM configuration of an adapter |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 232 | * @adapter: [in] pointer to Adapter context |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 233 | * |
| 234 | * This function will initialize the WMM configuation and status of an |
| 235 | * adapter to an initial state. The configuration can later be |
| 236 | * overwritten via application APIs |
| 237 | * |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 238 | * Return: QDF_STATUS enumeration |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 239 | */ |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 240 | QDF_STATUS hdd_wmm_adapter_init(struct hdd_adapter *adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 241 | |
| 242 | /** |
| 243 | * hdd_wmm_close() - WMM close function |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 244 | * @adapter: [in] pointer to adapter context |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 245 | * |
| 246 | * Function which will perform any necessary work to to clean up the |
| 247 | * WMM functionality prior to the kernel module unload. |
| 248 | * |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 249 | * Return: QDF_STATUS enumeration |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 250 | */ |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 251 | QDF_STATUS hdd_wmm_adapter_close(struct hdd_adapter *adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 252 | |
| 253 | /** |
| 254 | * hdd_wmm_select_queue() - Function which will classify the packet |
| 255 | * according to linux qdisc expectation. |
| 256 | * |
| 257 | * @dev: [in] pointer to net_device structure |
| 258 | * @skb: [in] pointer to os packet |
| 259 | * |
| 260 | * Return: Qdisc queue index |
| 261 | */ |
| 262 | uint16_t hdd_wmm_select_queue(struct net_device *dev, struct sk_buff *skb); |
| 263 | |
| 264 | /** |
| 265 | * hdd_hostapd_select_queue() - Function which will classify the packet |
| 266 | * according to linux qdisc expectation. |
| 267 | * |
| 268 | * @dev: [in] pointer to net_device structure |
| 269 | * @skb: [in] pointer to os packet |
| 270 | * |
| 271 | * Return: Qdisc queue index |
| 272 | */ |
| 273 | uint16_t hdd_hostapd_select_queue(struct net_device *dev, struct sk_buff *skb |
| 274 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0)) |
| 275 | , void *accel_priv |
| 276 | #endif |
| 277 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) |
| 278 | , select_queue_fallback_t fallback |
| 279 | #endif |
| 280 | ); |
| 281 | |
| 282 | /** |
| 283 | * hdd_wmm_acquire_access_required() - Function which will determine |
| 284 | * acquire admittance for a WMM AC is required or not based on psb configuration |
| 285 | * done in framework |
| 286 | * |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 287 | * @adapter: [in] pointer to adapter structure |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 288 | * @acType: [in] WMM AC type of OS packet |
| 289 | * |
| 290 | * Return: void |
| 291 | */ |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 292 | void hdd_wmm_acquire_access_required(struct hdd_adapter *adapter, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 293 | sme_ac_enum_type acType); |
| 294 | |
| 295 | /** |
| 296 | * hdd_wmm_acquire_access() - Function which will attempt to acquire |
| 297 | * admittance for a WMM AC |
| 298 | * |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 299 | * @adapter: [in] pointer to adapter context |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 300 | * @acType: [in] WMM AC type of OS packet |
| 301 | * @pGranted: [out] pointer to bool flag when indicates if access |
| 302 | * has been granted or not |
| 303 | * |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 304 | * Return: QDF_STATUS enumeration |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 305 | */ |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 306 | QDF_STATUS hdd_wmm_acquire_access(struct hdd_adapter *adapter, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 307 | sme_ac_enum_type acType, bool *pGranted); |
| 308 | |
| 309 | /** |
| 310 | * hdd_wmm_assoc() - Function which will handle the housekeeping |
| 311 | * required by WMM when association takes place |
| 312 | * |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 313 | * @adapter: [in] pointer to adapter context |
Jeff Johnson | fd06085 | 2017-10-04 10:50:51 -0700 | [diff] [blame] | 314 | * @roam_info: [in] pointer to roam information |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 315 | * @eBssType: [in] type of BSS |
| 316 | * |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 317 | * Return: QDF_STATUS enumeration |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 318 | */ |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 319 | QDF_STATUS hdd_wmm_assoc(struct hdd_adapter *adapter, |
Jeff Johnson | 172237b | 2017-11-07 15:32:59 -0800 | [diff] [blame] | 320 | struct csr_roam_info *roam_info, |
| 321 | eCsrRoamBssType eBssType); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 322 | |
| 323 | /** |
| 324 | * hdd_wmm_connect() - Function which will handle the housekeeping |
| 325 | * required by WMM when a connection is established |
| 326 | * |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 327 | * @adapter : [in] pointer to adapter context |
Jeff Johnson | fd06085 | 2017-10-04 10:50:51 -0700 | [diff] [blame] | 328 | * @roam_info: [in] pointer to roam information |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 329 | * @eBssType : [in] type of BSS |
| 330 | * |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 331 | * Return: QDF_STATUS enumeration |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 332 | */ |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 333 | QDF_STATUS hdd_wmm_connect(struct hdd_adapter *adapter, |
Jeff Johnson | 172237b | 2017-11-07 15:32:59 -0800 | [diff] [blame] | 334 | struct csr_roam_info *roam_info, |
| 335 | eCsrRoamBssType eBssType); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 336 | |
| 337 | /** |
| 338 | * hdd_wmm_get_uapsd_mask() - Function which will calculate the |
| 339 | * initial value of the UAPSD mask based upon the device configuration |
| 340 | * |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 341 | * @adapter : [in] pointer to adapter context |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 342 | * @pUapsdMask: [out] pointer to where the UAPSD Mask is to be stored |
| 343 | * |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 344 | * Return: QDF_STATUS enumeration |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 345 | */ |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 346 | QDF_STATUS hdd_wmm_get_uapsd_mask(struct hdd_adapter *adapter, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 347 | uint8_t *pUapsdMask); |
| 348 | |
| 349 | /** |
| 350 | * hdd_wmm_is_active() - Function which will determine if WMM is |
| 351 | * active on the current connection |
| 352 | * |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 353 | * @adapter: [in] pointer to adapter context |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 354 | * |
| 355 | * Return: true if WMM is enabled, false if WMM is not enabled |
| 356 | */ |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 357 | bool hdd_wmm_is_active(struct hdd_adapter *adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 358 | |
| 359 | /** |
Kabilan Kannan | f56f9d5 | 2017-04-05 03:31:34 -0700 | [diff] [blame] | 360 | * hdd_wmm_is_acm_allowed() - Function which will determine if WMM is |
| 361 | * active on the current connection |
| 362 | * |
| 363 | * @vdev: vdev object |
| 364 | * |
| 365 | * Return: true if WMM is enabled, false if WMM is not enabled |
| 366 | */ |
| 367 | bool hdd_wmm_is_acm_allowed(struct wlan_objmgr_vdev **vdev); |
| 368 | |
| 369 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 370 | * hdd_wmm_addts() - Function which will add a traffic spec at the |
| 371 | * request of an application |
| 372 | * |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 373 | * @adapter : [in] pointer to adapter context |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 374 | * @handle : [in] handle to uniquely identify a TS |
| 375 | * @pTspec : [in] pointer to the traffic spec |
| 376 | * |
| 377 | * Return: HDD_WLAN_WMM_STATUS_* |
| 378 | */ |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 379 | hdd_wlan_wmm_status_e hdd_wmm_addts(struct hdd_adapter *adapter, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 380 | uint32_t handle, |
Abhishek Singh | 12be60f | 2017-08-11 13:52:42 +0530 | [diff] [blame] | 381 | struct sme_qos_wmmtspecinfo *pTspec); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 382 | |
| 383 | /** |
| 384 | * hdd_wmm_delts() - Function which will delete a traffic spec at the |
| 385 | * request of an application |
| 386 | * |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 387 | * @adapter: [in] pointer to adapter context |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 388 | * @handle: [in] handle to uniquely identify a TS |
| 389 | * |
| 390 | * Return: HDD_WLAN_WMM_STATUS_* |
| 391 | */ |
Jeff Johnson | de353b8 | 2017-10-03 11:44:52 -0700 | [diff] [blame] | 392 | hdd_wlan_wmm_status_e hdd_wmm_delts(struct hdd_adapter *adapter, |
| 393 | uint32_t handle); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 394 | |
| 395 | /** |
| 396 | * hdd_wmm_checkts() - Function which will return the status of a traffic |
| 397 | * spec at the request of an application |
| 398 | * |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 399 | * @adapter: [in] pointer to adapter context |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 400 | * @handle: [in] handle to uniquely identify a TS |
| 401 | * |
| 402 | * Return: HDD_WLAN_WMM_STATUS_* |
| 403 | */ |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 404 | hdd_wlan_wmm_status_e hdd_wmm_checkts(struct hdd_adapter *adapter, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 405 | uint32_t handle); |
| 406 | /** |
| 407 | * hdd_wmm_adapter_clear() - Function which will clear the WMM status |
| 408 | * for all the ACs |
| 409 | * |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 410 | * @adapter: [in] pointer to Adapter context |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 411 | * |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 412 | * Return: QDF_STATUS enumeration |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 413 | */ |
Jeff Johnson | a7e2e00 | 2017-10-02 13:19:58 -0700 | [diff] [blame] | 414 | QDF_STATUS hdd_wmm_adapter_clear(struct hdd_adapter *adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 415 | |
Jeff Johnson | 5b8b67d | 2017-08-29 14:16:53 -0700 | [diff] [blame] | 416 | void wlan_hdd_process_peer_unauthorised_pause(struct hdd_adapter *adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 417 | #endif /* #ifndef _WLAN_HDD_WMM_H */ |