blob: c664eb4c05c7f606ffa0bd89720bddac55d3b25f [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Jeff Johnson4fca3b52017-01-12 08:44:18 -08002 * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
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
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -080028/* denote that this file does not allow legacy hddLog */
29#define HDD_DISALLOW_LEGACY_HDDLOG 1
30
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080031/* Include files */
32#include <linux/semaphore.h>
33#include <wlan_hdd_tx_rx.h>
34#include <wlan_hdd_softap_tx_rx.h>
35#include <linux/netdevice.h>
36#include <linux/skbuff.h>
37#include <linux/etherdevice.h>
Anurag Chouhan6d760662016-02-20 16:05:43 +053038#include <qdf_types.h>
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080039#include <ani_global.h>
Anurag Chouhan6d760662016-02-20 16:05:43 +053040#include <qdf_types.h>
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080041#include <net/ieee80211_radiotap.h>
42#include <cds_sched.h>
43#include <wlan_hdd_napi.h>
Leo Changfdb45c32016-10-28 11:09:23 -070044#include <cdp_txrx_cmn.h>
Dhanashri Atreb08959a2016-03-01 17:28:03 -080045#include <cdp_txrx_peer_ops.h>
Manjunathappa Prakash779e4862016-09-12 17:00:11 -070046#include <cds_utils.h>
Leo Changfdb45c32016-10-28 11:09:23 -070047#include <cdp_txrx_flow_ctrl_v2.h>
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -080048#include <cdp_txrx_handle.h>
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080049
50#ifdef IPA_OFFLOAD
51#include <wlan_hdd_ipa.h>
52#endif
53
54/* Preprocessor definitions and constants */
55#undef QCA_HDD_SAP_DUMP_SK_BUFF
56
57/* Type declarations */
58
59/* Function definitions and documenation */
60#ifdef QCA_HDD_SAP_DUMP_SK_BUFF
61/**
62 * hdd_softap_dump_sk_buff() - Dump an skb
63 * @skb: skb to dump
64 *
65 * Return: None
66 */
67static void hdd_softap_dump_sk_buff(struct sk_buff *skb)
68{
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +053069 QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA, QDF_TRACE_LEVEL_ERROR,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080070 "%s: head = %p ", __func__, skb->head);
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +053071 /* QDF_TRACE( QDF_MODULE_ID_HDD_SAP_DATA, QDF_TRACE_LEVEL_ERROR,"%s: data = %p ", __func__, skb->data); */
72 QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA, QDF_TRACE_LEVEL_ERROR,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080073 "%s: tail = %p ", __func__, skb->tail);
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +053074 QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA, QDF_TRACE_LEVEL_ERROR,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080075 "%s: end = %p ", __func__, skb->end);
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +053076 QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA, QDF_TRACE_LEVEL_ERROR,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080077 "%s: len = %d ", __func__, skb->len);
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +053078 QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA, QDF_TRACE_LEVEL_ERROR,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080079 "%s: data_len = %d ", __func__, skb->data_len);
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +053080 QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA, QDF_TRACE_LEVEL_ERROR,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080081 "%s: mac_len = %d", __func__, skb->mac_len);
82
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +053083 QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA, QDF_TRACE_LEVEL_ERROR,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080084 "0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x ", skb->data[0],
85 skb->data[1], skb->data[2], skb->data[3], skb->data[4],
86 skb->data[5], skb->data[6], skb->data[7]);
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +053087 QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA, QDF_TRACE_LEVEL_ERROR,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080088 "0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x", skb->data[8],
89 skb->data[9], skb->data[10], skb->data[11], skb->data[12],
90 skb->data[13], skb->data[14], skb->data[15]);
91}
92#else
93static void hdd_softap_dump_sk_buff(struct sk_buff *skb)
94{
95}
96#endif
97
98#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
99/**
100 * hdd_softap_tx_resume_timer_expired_handler() - TX Q resume timer handler
101 * @adapter_context: pointer to vdev adapter
102 *
103 * TX Q resume timer handler for SAP and P2P GO interface. If Blocked
104 * OS Q is not resumed during timeout period, to prevent permanent
105 * stall, resume OS Q forcefully for SAP and P2P GO interface.
106 *
107 * Return: None
108 */
109void hdd_softap_tx_resume_timer_expired_handler(void *adapter_context)
110{
111 hdd_adapter_t *pAdapter = (hdd_adapter_t *) adapter_context;
112
113 if (!pAdapter) {
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -0800114 hdd_err("NULL adapter");
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800115 return;
116 }
117
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -0800118 hdd_notice("Enabling queues");
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800119 wlan_hdd_netif_queue_control(pAdapter, WLAN_WAKE_ALL_NETIF_QUEUE,
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -0800120 WLAN_CONTROL_PATH);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800121 return;
122}
123
Poddar, Siddarthb61cf642016-04-28 16:02:39 +0530124#if defined(CONFIG_PER_VDEV_TX_DESC_POOL)
125
126/**
127 * hdd_softap_tx_resume_false() - Resume OS TX Q false leads to queue disabling
128 * @pAdapter: pointer to hdd adapter
129 * @tx_resume: TX Q resume trigger
130 *
131 *
132 * Return: None
133 */
134static void
135hdd_softap_tx_resume_false(hdd_adapter_t *pAdapter, bool tx_resume)
136{
137 if (true == tx_resume)
138 return;
139
140 hdd_notice("Disabling queues");
141 wlan_hdd_netif_queue_control(pAdapter, WLAN_STOP_ALL_NETIF_QUEUE,
142 WLAN_DATA_FLOW_CONTROL);
143
144 if (QDF_TIMER_STATE_STOPPED ==
145 qdf_mc_timer_get_current_state(&pAdapter->
146 tx_flow_control_timer)) {
147 QDF_STATUS status;
148 status = qdf_mc_timer_start(&pAdapter->tx_flow_control_timer,
149 WLAN_SAP_HDD_TX_FLOW_CONTROL_OS_Q_BLOCK_TIME);
150
151 if (!QDF_IS_STATUS_SUCCESS(status))
152 hdd_err("Failed to start tx_flow_control_timer");
153 else
154 pAdapter->hdd_stats.hddTxRxStats.txflow_timer_cnt++;
155 }
156 return;
157}
158#else
159
160static inline void
161hdd_softap_tx_resume_false(hdd_adapter_t *pAdapter, bool tx_resume)
162{
163 return;
164}
165#endif
166
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800167/**
168 * hdd_softap_tx_resume_cb() - Resume OS TX Q.
169 * @adapter_context: pointer to vdev apdapter
170 * @tx_resume: TX Q resume trigger
171 *
172 * Q was stopped due to WLAN TX path low resource condition
173 *
174 * Return: None
175 */
176void hdd_softap_tx_resume_cb(void *adapter_context, bool tx_resume)
177{
178 hdd_adapter_t *pAdapter = (hdd_adapter_t *) adapter_context;
179
180 if (!pAdapter) {
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -0800181 hdd_err("NULL adapter");
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800182 return;
183 }
184
185 /* Resume TX */
186 if (true == tx_resume) {
Anurag Chouhan210db072016-02-22 18:42:15 +0530187 if (QDF_TIMER_STATE_STOPPED !=
188 qdf_mc_timer_get_current_state(&pAdapter->
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800189 tx_flow_control_timer)) {
Anurag Chouhan210db072016-02-22 18:42:15 +0530190 qdf_mc_timer_stop(&pAdapter->tx_flow_control_timer);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800191 }
192
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -0800193 hdd_notice("Enabling queues");
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800194 wlan_hdd_netif_queue_control(pAdapter,
195 WLAN_WAKE_ALL_NETIF_QUEUE,
196 WLAN_DATA_FLOW_CONTROL);
197 }
Poddar, Siddarthb61cf642016-04-28 16:02:39 +0530198 hdd_softap_tx_resume_false(pAdapter, tx_resume);
199
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800200 return;
201}
gbianec670c592016-11-24 11:21:30 +0800202
203static inline struct sk_buff *hdd_skb_orphan(hdd_adapter_t *pAdapter,
204 struct sk_buff *skb)
205{
206 if (pAdapter->tx_flow_low_watermark > 0)
207 skb_orphan(skb);
208 else {
209 skb = skb_unshare(skb, GFP_ATOMIC);
210 }
211
212 return skb;
213}
214
215#else
216
217static inline struct sk_buff *hdd_skb_orphan(hdd_adapter_t *pAdapter,
218 struct sk_buff *skb)
219{
220 return skb_unshare(skb, GFP_ATOMIC);
221}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800222#endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */
223
224/**
Mukul Sharmac4de4ef2016-09-12 15:39:00 +0530225 * __hdd_softap_hard_start_xmit() - Transmit a frame
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800226 * @skb: pointer to OS packet (sk_buff)
227 * @dev: pointer to network device
228 *
229 * Function registered with the Linux OS for transmitting
230 * packets. This version of the function directly passes
231 * the packet to Transport Layer.
232 *
233 * Return: Always returns NETDEV_TX_OK
234 */
Jeff Johnson6376abe2016-10-05 16:24:56 -0700235static int __hdd_softap_hard_start_xmit(struct sk_buff *skb,
236 struct net_device *dev)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800237{
238 sme_ac_enum_type ac = SME_AC_BE;
239 hdd_adapter_t *pAdapter = (hdd_adapter_t *) netdev_priv(dev);
240 hdd_ap_ctx_t *pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(pAdapter);
Anurag Chouhan6d760662016-02-20 16:05:43 +0530241 struct qdf_mac_addr *pDestMacAddress;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800242 uint8_t STAId;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800243
244 ++pAdapter->hdd_stats.hddTxRxStats.txXmitCalled;
245 /* Prevent this function from being called during SSR since TL
246 * context may not be reinitialized at this time which may
247 * lead to a crash.
248 */
Prashanth Bhatta9e143052015-12-04 11:56:47 -0800249 if (cds_is_driver_recovering()) {
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530250 QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA, QDF_TRACE_LEVEL_INFO_HIGH,
Prashanth Bhatta9e143052015-12-04 11:56:47 -0800251 "%s: Recovery in Progress. Ignore!!!", __func__);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800252 goto drop_pkt;
253 }
254
255 /*
256 * If the device is operating on a DFS Channel
257 * then check if SAP is in CAC WAIT state and
258 * drop the packets. In CAC WAIT state device
259 * is expected not to transmit any frames.
260 * SAP starts Tx only after the BSS START is
261 * done.
262 */
263 if (pHddApCtx->dfs_cac_block_tx) {
264 goto drop_pkt;
265 }
266
Dhanashri Atre168d2b42016-02-22 14:43:06 -0800267 /*
Jeff Johnson4fca3b52017-01-12 08:44:18 -0800268 * If a transmit function is not registered, drop packet
269 */
Dhanashri Atre168d2b42016-02-22 14:43:06 -0800270 if (!pAdapter->tx_fn) {
271 QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA, QDF_TRACE_LEVEL_INFO_HIGH,
272 "%s: TX function not registered by the data path",
273 __func__);
274 goto drop_pkt;
275 }
276
Nirav Shah5e74bb82016-07-20 16:01:27 +0530277 wlan_hdd_classify_pkt(skb);
278
Anurag Chouhan6d760662016-02-20 16:05:43 +0530279 pDestMacAddress = (struct qdf_mac_addr *) skb->data;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800280
Nirav Shah5e74bb82016-07-20 16:01:27 +0530281 if (QDF_NBUF_CB_GET_IS_BCAST(skb) ||
282 QDF_NBUF_CB_GET_IS_MCAST(skb)) {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800283 /* The BC/MC station ID is assigned during BSS
284 * starting phase. SAP will return the station ID
285 * used for BC/MC traffic.
286 */
287 STAId = pHddApCtx->uBCStaId;
288 } else {
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530289 if (QDF_STATUS_SUCCESS !=
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800290 hdd_softap_get_sta_id(pAdapter,
291 pDestMacAddress, &STAId)) {
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530292 QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA,
293 QDF_TRACE_LEVEL_WARN,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800294 "%s: Failed to find right station", __func__);
295 goto drop_pkt;
296 }
297
Prakash Dhavali3107b752016-11-28 14:35:06 +0530298 if (STAId >= WLAN_MAX_STA_COUNT) {
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530299 QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA,
300 QDF_TRACE_LEVEL_WARN,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800301 "%s: Failed to find right station", __func__);
302 goto drop_pkt;
303 } else if (false == pAdapter->aStaInfo[STAId].isUsed) {
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530304 QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA,
305 QDF_TRACE_LEVEL_WARN,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800306 "%s: STA %d is unregistered", __func__,
307 STAId);
308 goto drop_pkt;
Poddar, Siddartha5075462017-03-16 19:20:09 +0530309 } else if (true == pAdapter->aStaInfo[STAId].
310 isDeauthInProgress) {
311 QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA,
312 QDF_TRACE_LEVEL_WARN,
313 "%s: STA %d deauth in progress", __func__,
314 STAId);
315 goto drop_pkt;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800316 }
317
Dhanashri Atreb08959a2016-03-01 17:28:03 -0800318 if ((OL_TXRX_PEER_STATE_CONN !=
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800319 pAdapter->aStaInfo[STAId].tlSTAState)
Dhanashri Atreb08959a2016-03-01 17:28:03 -0800320 && (OL_TXRX_PEER_STATE_AUTH !=
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800321 pAdapter->aStaInfo[STAId].tlSTAState)) {
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530322 QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA,
323 QDF_TRACE_LEVEL_WARN,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800324 "%s: Station not connected yet", __func__);
325 goto drop_pkt;
Dhanashri Atreb08959a2016-03-01 17:28:03 -0800326 } else if (OL_TXRX_PEER_STATE_CONN ==
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800327 pAdapter->aStaInfo[STAId].tlSTAState) {
328 if (ntohs(skb->protocol) != HDD_ETHERTYPE_802_1_X) {
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530329 QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA,
330 QDF_TRACE_LEVEL_WARN,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800331 "%s: NON-EAPOL packet in non-Authenticated state",
332 __func__);
333 goto drop_pkt;
334 }
335 }
336 }
337
338 hdd_get_tx_resource(pAdapter, STAId,
339 WLAN_SAP_HDD_TX_FLOW_CONTROL_OS_Q_BLOCK_TIME);
340
341 /* Get TL AC corresponding to Qdisc queue index/AC. */
342 ac = hdd_qdisc_ac_to_tl_ac[skb->queue_mapping];
343 ++pAdapter->hdd_stats.hddTxRxStats.txXmitClassifiedAC[ac];
344
345#if defined (IPA_OFFLOAD)
Nirav Shahcbc6d722016-03-01 16:24:53 +0530346 if (!qdf_nbuf_ipa_owned_get(skb)) {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800347#endif
gbianec670c592016-11-24 11:21:30 +0800348
349#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 19, 0))
350 /*
Jeff Johnson4fca3b52017-01-12 08:44:18 -0800351 * The TCP TX throttling logic is changed a little after
352 * 3.19-rc1 kernel, the TCP sending limit will be smaller,
353 * which will throttle the TCP packets to the host driver.
354 * The TCP UP LINK throughput will drop heavily. In order to
355 * fix this issue, need to orphan the socket buffer asap, which
356 * will call skb's destructor to notify the TCP stack that the
357 * SKB buffer is unowned. And then the TCP stack will pump more
358 * packets to host driver.
359 *
360 * The TX packets might be dropped for UDP case in the iperf
361 * testing. So need to be protected by follow control.
362 */
gbianec670c592016-11-24 11:21:30 +0800363 skb = hdd_skb_orphan(pAdapter, skb);
364#else
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800365 /* Check if the buffer has enough header room */
366 skb = skb_unshare(skb, GFP_ATOMIC);
gbianec670c592016-11-24 11:21:30 +0800367#endif
368
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800369 if (!skb)
Jeff Johnsonedeff232015-11-11 17:19:42 -0800370 goto drop_pkt_accounting;
gbianec670c592016-11-24 11:21:30 +0800371
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800372#if defined (IPA_OFFLOAD)
373 }
374#endif
375
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800376 pAdapter->stats.tx_bytes += skb->len;
377 ++pAdapter->stats.tx_packets;
378
Nirav Shah5e74bb82016-07-20 16:01:27 +0530379 hdd_event_eapol_log(skb, QDF_TX);
Nirav Shah0d58a7e2016-04-26 22:54:12 +0530380 qdf_dp_trace_log_pkt(pAdapter->sessionId, skb, QDF_TX);
Nirav Shahcbc6d722016-03-01 16:24:53 +0530381 QDF_NBUF_CB_TX_PACKET_TRACK(skb) = QDF_NBUF_TX_PKT_DATA_TRACK;
382 QDF_NBUF_UPDATE_TX_PKT_COUNT(skb, QDF_NBUF_TX_PKT_HDD);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800383
Nirav Shah0d58a7e2016-04-26 22:54:12 +0530384 qdf_dp_trace_set_track(skb, QDF_TX);
385 DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_TX_PACKET_PTR_RECORD,
Himanshu Agarwalee3411a2017-01-31 12:56:47 +0530386 qdf_nbuf_data_addr(skb), sizeof(qdf_nbuf_data(skb)),
387 QDF_TX));
Nirav Shah0d58a7e2016-04-26 22:54:12 +0530388 DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_TX_PACKET_RECORD,
389 (uint8_t *)skb->data, qdf_nbuf_len(skb), QDF_TX));
Nirav Shahcbc6d722016-03-01 16:24:53 +0530390 if (qdf_nbuf_len(skb) > QDF_DP_TRACE_RECORD_SIZE)
Nirav Shah0d58a7e2016-04-26 22:54:12 +0530391 DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_TX_PACKET_RECORD,
392 (uint8_t *)&skb->data[QDF_DP_TRACE_RECORD_SIZE],
393 (qdf_nbuf_len(skb)-QDF_DP_TRACE_RECORD_SIZE), QDF_TX));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800394
Leo Changfdb45c32016-10-28 11:09:23 -0700395 if (pAdapter->tx_fn(pAdapter->txrx_vdev,
Dhanashri Atre168d2b42016-02-22 14:43:06 -0800396 (qdf_nbuf_t) skb) != NULL) {
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530397 QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA, QDF_TRACE_LEVEL_WARN,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800398 "%s: Failed to send packet to txrx for staid:%d",
399 __func__, STAId);
400 ++pAdapter->hdd_stats.hddTxRxStats.txXmitDroppedAC[ac];
401 goto drop_pkt;
402 }
Dustin Browne0024fa2016-10-14 16:29:21 -0700403 netif_trans_update(dev);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800404
405 return NETDEV_TX_OK;
406
407drop_pkt:
408
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530409 DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_DROP_PACKET_RECORD,
Nirav Shah0d58a7e2016-04-26 22:54:12 +0530410 (uint8_t *)skb->data, qdf_nbuf_len(skb), QDF_TX));
Nirav Shahcbc6d722016-03-01 16:24:53 +0530411 if (qdf_nbuf_len(skb) > QDF_DP_TRACE_RECORD_SIZE)
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530412 DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_DROP_PACKET_RECORD,
Nirav Shah0d58a7e2016-04-26 22:54:12 +0530413 (uint8_t *)&skb->data[QDF_DP_TRACE_RECORD_SIZE],
414 (qdf_nbuf_len(skb)-QDF_DP_TRACE_RECORD_SIZE), QDF_TX));
Jeff Johnsonedeff232015-11-11 17:19:42 -0800415 kfree_skb(skb);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800416
Jeff Johnsonedeff232015-11-11 17:19:42 -0800417drop_pkt_accounting:
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800418 ++pAdapter->stats.tx_dropped;
419 ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800420
421 return NETDEV_TX_OK;
422}
423
424/**
Mukul Sharmac4de4ef2016-09-12 15:39:00 +0530425 * hdd_softap_hard_start_xmit() - Wrapper function to protect
426 * __hdd_softap_hard_start_xmit from SSR
427 * @skb: pointer to OS packet
428 * @dev: pointer to net_device structure
429 *
430 * Function called by OS if any packet needs to transmit.
431 *
432 * Return: Always returns NETDEV_TX_OK
433 */
434int hdd_softap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
435{
436 int ret;
437
438 cds_ssr_protect(__func__);
439 ret = __hdd_softap_hard_start_xmit(skb, dev);
440 cds_ssr_unprotect(__func__);
441
442 return ret;
443}
444
Sen, Devendra154b3c42017-02-13 20:44:15 +0530445#ifdef FEATURE_WLAN_DIAG_SUPPORT
446/**
447 * hdd_wlan_datastall_sap_event()- Send SAP datastall information
448 *
449 * This Function send send SAP datastall diag event
450 *
451 * Return: void.
452 */
453static void hdd_wlan_datastall_sap_event(void)
454{
455 WLAN_HOST_DIAG_EVENT_DEF(sap_data_stall,
456 struct host_event_wlan_datastall);
457 qdf_mem_zero(&sap_data_stall, sizeof(sap_data_stall));
458 sap_data_stall.reason = SOFTAP_TX_TIMEOUT;
459 WLAN_HOST_DIAG_EVENT_REPORT(&sap_data_stall,
460 EVENT_WLAN_SOFTAP_DATASTALL);
461}
462#else
463static inline void hdd_wlan_datastall_sap_event(void)
464{
465
466}
467#endif
468
Mukul Sharmac4de4ef2016-09-12 15:39:00 +0530469/**
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800470 * __hdd_softap_tx_timeout() - TX timeout handler
471 * @dev: pointer to network device
472 *
473 * This function is registered as a netdev ndo_tx_timeout method, and
474 * is invoked by the kernel if the driver takes too long to transmit a
475 * frame.
476 *
477 * Return: None
478 */
479static void __hdd_softap_tx_timeout(struct net_device *dev)
480{
481 hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
482 hdd_context_t *hdd_ctx;
Nirav Shah89223f72016-03-01 18:10:38 +0530483 struct netdev_queue *txq;
484 int i;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800485
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530486 DPTRACE(qdf_dp_trace(NULL, QDF_DP_TRACE_HDD_SOFTAP_TX_TIMEOUT,
Nirav Shah0d58a7e2016-04-26 22:54:12 +0530487 NULL, 0, QDF_TX));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800488 /* Getting here implies we disabled the TX queues for too
489 * long. Queues are disabled either because of disassociation
490 * or low resource scenarios. In case of disassociation it is
491 * ok to ignore this. But if associated, we have do possible
492 * recovery here
493 */
494 hdd_ctx = WLAN_HDD_GET_CTX(adapter);
Prashanth Bhatta9e143052015-12-04 11:56:47 -0800495 if (cds_is_driver_recovering()) {
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530496 QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA, QDF_TRACE_LEVEL_ERROR,
Prashanth Bhatta9e143052015-12-04 11:56:47 -0800497 "%s: Recovery in Progress. Ignore!!!", __func__);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800498 return;
499 }
Nirav Shah89223f72016-03-01 18:10:38 +0530500
Dustin Browne0024fa2016-10-14 16:29:21 -0700501 TX_TIMEOUT_TRACE(dev, QDF_MODULE_ID_HDD_SAP_DATA);
Nirav Shah89223f72016-03-01 18:10:38 +0530502
503 for (i = 0; i < NUM_TX_QUEUES; i++) {
504 txq = netdev_get_tx_queue(dev, i);
505 QDF_TRACE(QDF_MODULE_ID_HDD_DATA,
506 QDF_TRACE_LEVEL_ERROR,
507 "Queue%d status: %d txq->trans_start %lu",
508 i, netif_tx_queue_stopped(txq), txq->trans_start);
509 }
510
511 wlan_hdd_display_netif_queue_history(hdd_ctx);
Leo Changfdb45c32016-10-28 11:09:23 -0700512 cdp_dump_flow_pool_info(cds_get_context(QDF_MODULE_ID_SOC));
Nirav Shah89223f72016-03-01 18:10:38 +0530513 QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_ERROR,
514 "carrier state: %d", netif_carrier_ok(dev));
Sen, Devendra154b3c42017-02-13 20:44:15 +0530515 hdd_wlan_datastall_sap_event();
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800516}
517
518/**
519 * hdd_softap_tx_timeout() - SSR wrapper for __hdd_softap_tx_timeout
520 * @dev: pointer to net_device
521 *
522 * Return: none
523 */
524void hdd_softap_tx_timeout(struct net_device *dev)
525{
526 cds_ssr_protect(__func__);
527 __hdd_softap_tx_timeout(dev);
528 cds_ssr_unprotect(__func__);
529}
530
531/**
532 * @hdd_softap_init_tx_rx() - Initialize Tx/RX module
533 * @pAdapter: pointer to adapter context
534 *
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530535 * Return: QDF_STATUS_E_FAILURE if any errors encountered,
536 * QDF_STATUS_SUCCESS otherwise
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800537 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530538QDF_STATUS hdd_softap_init_tx_rx(hdd_adapter_t *pAdapter)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800539{
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530540 QDF_STATUS status = QDF_STATUS_SUCCESS;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800541
542 uint8_t STAId = 0;
543
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530544 qdf_mem_zero(&pAdapter->stats, sizeof(struct net_device_stats));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800545
546 spin_lock_init(&pAdapter->staInfo_lock);
547
548 for (STAId = 0; STAId < WLAN_MAX_STA_COUNT; STAId++) {
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530549 qdf_mem_zero(&pAdapter->aStaInfo[STAId],
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800550 sizeof(hdd_station_info_t));
551 }
552
553 return status;
554}
555
556/**
557 * @hdd_softap_deinit_tx_rx() - Deinitialize Tx/RX module
558 * @pAdapter: pointer to adapter context
559 *
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530560 * Return: QDF_STATUS_E_FAILURE if any errors encountered,
561 * QDF_STATUS_SUCCESS otherwise
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800562 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530563QDF_STATUS hdd_softap_deinit_tx_rx(hdd_adapter_t *pAdapter)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800564{
Dhanashri Atreed3bf512017-02-21 12:25:53 -0800565 if (pAdapter == NULL) {
566 hdd_err("Called with pAdapter = NULL.");
567 return QDF_STATUS_E_FAILURE;
568 }
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800569
Dhanashri Atreed3bf512017-02-21 12:25:53 -0800570 pAdapter->txrx_vdev = NULL;
571 pAdapter->tx_fn = NULL;
572 hdd_info("Deregistering TX function hook !");
573 return QDF_STATUS_SUCCESS;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800574}
575
576/**
577 * hdd_softap_init_tx_rx_sta() - Initialize tx/rx for a softap station
578 * @pAdapter: pointer to adapter context
579 * @STAId: Station ID to initialize
580 * @pmacAddrSTA: pointer to the MAC address of the station
581 *
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530582 * Return: QDF_STATUS_E_FAILURE if any errors encountered,
583 * QDF_STATUS_SUCCESS otherwise
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800584 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530585QDF_STATUS hdd_softap_init_tx_rx_sta(hdd_adapter_t *pAdapter, uint8_t STAId,
Anurag Chouhan6d760662016-02-20 16:05:43 +0530586 struct qdf_mac_addr *pmacAddrSTA)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800587{
588 spin_lock_bh(&pAdapter->staInfo_lock);
589 if (pAdapter->aStaInfo[STAId].isUsed) {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800590 spin_unlock_bh(&pAdapter->staInfo_lock);
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -0800591 hdd_err("Reinit of in use station %d", STAId);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530592 return QDF_STATUS_E_FAILURE;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800593 }
594
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530595 qdf_mem_zero(&pAdapter->aStaInfo[STAId], sizeof(hdd_station_info_t));
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800596
597 pAdapter->aStaInfo[STAId].isUsed = true;
598 pAdapter->aStaInfo[STAId].isDeauthInProgress = false;
Anurag Chouhanc5548422016-02-24 18:33:27 +0530599 qdf_copy_macaddr(&pAdapter->aStaInfo[STAId].macAddrSTA, pmacAddrSTA);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800600
601 spin_unlock_bh(&pAdapter->staInfo_lock);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530602 return QDF_STATUS_SUCCESS;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800603}
604
605/**
606 * hdd_softap_deinit_tx_rx_sta() - Deinitialize tx/rx for a softap station
607 * @pAdapter: pointer to adapter context
608 * @STAId: Station ID to deinitialize
609 *
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530610 * Return: QDF_STATUS_E_FAILURE if any errors encountered,
611 * QDF_STATUS_SUCCESS otherwise
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800612 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530613QDF_STATUS hdd_softap_deinit_tx_rx_sta(hdd_adapter_t *pAdapter, uint8_t STAId)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800614{
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530615 QDF_STATUS status = QDF_STATUS_SUCCESS;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800616 hdd_hostapd_state_t *pHostapdState;
617
618 pHostapdState = WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter);
619
620 spin_lock_bh(&pAdapter->staInfo_lock);
621
622 if (false == pAdapter->aStaInfo[STAId].isUsed) {
623 spin_unlock_bh(&pAdapter->staInfo_lock);
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -0800624 hdd_err("Deinit station not inited %d", STAId);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530625 return QDF_STATUS_E_FAILURE;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800626 }
627
628 pAdapter->aStaInfo[STAId].isUsed = false;
629 pAdapter->aStaInfo[STAId].isDeauthInProgress = false;
630
631 spin_unlock_bh(&pAdapter->staInfo_lock);
632 return status;
633}
634
635/**
636 * hdd_softap_rx_packet_cbk() - Receive packet handler
Dhanashri Atre182b0272016-02-17 15:35:07 -0800637 * @context: pointer to HDD context
Nirav Shahcbc6d722016-03-01 16:24:53 +0530638 * @rxBuf: pointer to rx qdf_nbuf
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800639 *
640 * Receive callback registered with TL. TL will call this to notify
641 * the HDD when one or more packets were received for a registered
642 * STA.
643 *
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530644 * Return: QDF_STATUS_E_FAILURE if any errors encountered,
645 * QDF_STATUS_SUCCESS otherwise
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800646 */
Dhanashri Atre182b0272016-02-17 15:35:07 -0800647QDF_STATUS hdd_softap_rx_packet_cbk(void *context, qdf_nbuf_t rxBuf)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800648{
649 hdd_adapter_t *pAdapter = NULL;
650 int rxstat;
651 unsigned int cpu_index;
652 struct sk_buff *skb = NULL;
Dhanashri Atrecefa8802017-02-02 16:17:14 -0800653 struct sk_buff *next = NULL;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800654 hdd_context_t *pHddCtx = NULL;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800655
656 /* Sanity check on inputs */
Dhanashri Atre182b0272016-02-17 15:35:07 -0800657 if (unlikely((NULL == context) || (NULL == rxBuf))) {
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +0530658 QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA, QDF_TRACE_LEVEL_ERROR,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800659 "%s: Null params being passed", __func__);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530660 return QDF_STATUS_E_FAILURE;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800661 }
662
Dhanashri Atre182b0272016-02-17 15:35:07 -0800663 pAdapter = (hdd_adapter_t *)context;
664 if (unlikely(WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) {
665 QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_FATAL,
666 "Magic cookie(%x) for adapter sanity verification is invalid",
667 pAdapter->magic);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530668 return QDF_STATUS_E_FAILURE;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800669 }
670
Dhanashri Atre182b0272016-02-17 15:35:07 -0800671 pHddCtx = pAdapter->pHddCtx;
672 if (unlikely(NULL == pHddCtx)) {
673 QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA, QDF_TRACE_LEVEL_ERROR,
674 "%s: HDD context is Null", __func__);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530675 return QDF_STATUS_E_FAILURE;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800676 }
677
678 /* walk the chain until all are processed */
Dhanashri Atrecefa8802017-02-02 16:17:14 -0800679 next = (struct sk_buff *)rxBuf;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800680
Dhanashri Atrecefa8802017-02-02 16:17:14 -0800681 while (next) {
682 skb = next;
683 next = skb->next;
Dhanashri Atre63d98022017-01-24 18:22:09 -0800684 skb->next = NULL;
Dhanashri Atrecefa8802017-02-02 16:17:14 -0800685
686#ifdef QCA_WIFI_NAPIER_EMULATION /* Debug code, remove later */
687 QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_ERROR,
688 "%s: skb %p skb->len %d\n", __func__, skb, skb->len);
689#endif
690
Dhanashri Atre63d98022017-01-24 18:22:09 -0800691 hdd_softap_dump_sk_buff(skb);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800692
Dhanashri Atre63d98022017-01-24 18:22:09 -0800693 skb->dev = pAdapter->dev;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800694
Dhanashri Atre63d98022017-01-24 18:22:09 -0800695 if (unlikely(skb->dev == NULL)) {
696
697 QDF_TRACE(QDF_MODULE_ID_HDD_SAP_DATA, QDF_TRACE_LEVEL_ERROR,
698 "%s: ERROR!!Invalid netdevice", __func__);
Dhanashri Atrecefa8802017-02-02 16:17:14 -0800699 continue;
Dhanashri Atre63d98022017-01-24 18:22:09 -0800700 }
701 cpu_index = wlan_hdd_get_cpu();
702 ++pAdapter->hdd_stats.hddTxRxStats.rxPackets[cpu_index];
703 ++pAdapter->stats.rx_packets;
704 pAdapter->stats.rx_bytes += skb->len;
705
706 hdd_event_eapol_log(skb, QDF_RX);
Himanshu Agarwalee3411a2017-01-31 12:56:47 +0530707 DPTRACE(qdf_dp_trace(skb,
Dhanashri Atre63d98022017-01-24 18:22:09 -0800708 QDF_DP_TRACE_RX_HDD_PACKET_PTR_RECORD,
Himanshu Agarwalee3411a2017-01-31 12:56:47 +0530709 qdf_nbuf_data_addr(skb),
710 sizeof(qdf_nbuf_data(skb)), QDF_RX));
711 DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_RX_PACKET_RECORD,
712 (uint8_t *)skb->data, qdf_nbuf_len(skb), QDF_RX));
713 if (qdf_nbuf_len(skb) > QDF_DP_TRACE_RECORD_SIZE)
714 DPTRACE(qdf_dp_trace(skb,
715 QDF_DP_TRACE_HDD_RX_PACKET_RECORD,
716 (uint8_t *)&skb->data[QDF_DP_TRACE_RECORD_SIZE],
717 (qdf_nbuf_len(skb)-QDF_DP_TRACE_RECORD_SIZE),
718 QDF_RX));
Dhanashri Atre63d98022017-01-24 18:22:09 -0800719
720 skb->protocol = eth_type_trans(skb, skb->dev);
721
722 /* hold configurable wakelock for unicast traffic */
723 if (pHddCtx->config->rx_wakelock_timeout &&
724 skb->pkt_type != PACKET_BROADCAST &&
725 skb->pkt_type != PACKET_MULTICAST) {
726 cds_host_diag_log_work(&pHddCtx->rx_wake_lock,
727 pHddCtx->config->rx_wakelock_timeout,
728 WIFI_POWER_EVENT_WAKELOCK_HOLD_RX);
729 qdf_wake_lock_timeout_acquire(&pHddCtx->rx_wake_lock,
730 pHddCtx->config->
731 rx_wakelock_timeout);
732 }
733
734 /* Remove SKB from internal tracking table before submitting
735 * it to stack
736 */
737 qdf_net_buf_debug_release_skb(rxBuf);
738 if (hdd_napi_enabled(HDD_NAPI_ANY) &&
739 !pHddCtx->enableRxThread)
740 rxstat = netif_receive_skb(skb);
741 else
742 rxstat = netif_rx_ni(skb);
743 if (NET_RX_SUCCESS == rxstat) {
744 ++pAdapter->hdd_stats.hddTxRxStats.rxDelivered[cpu_index];
745 } else {
746 ++pAdapter->hdd_stats.hddTxRxStats.rxRefused[cpu_index];
747 }
748
749 pAdapter->dev->last_rx = jiffies;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800750 }
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800751
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530752 return QDF_STATUS_SUCCESS;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800753}
754
755/**
756 * hdd_softap_deregister_sta(hdd_adapter_t *pAdapter, uint8_t staId)
757 * @pAdapter: pointer to adapter context
758 * @staId: Station ID to deregister
759 *
Anurag Chouhanf04e84f2016-03-03 10:12:12 +0530760 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800761 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530762QDF_STATUS hdd_softap_deregister_sta(hdd_adapter_t *pAdapter, uint8_t staId)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800763{
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530764 QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800765 hdd_context_t *pHddCtx;
766
767 if (NULL == pAdapter) {
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -0800768 hdd_err("NULL adapter");
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530769 return QDF_STATUS_E_INVAL;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800770 }
771
772 if (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic) {
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -0800773 hdd_err("Invalid adapter magic");
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530774 return QDF_STATUS_E_INVAL;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800775 }
776
777 pHddCtx = (hdd_context_t *) (pAdapter->pHddCtx);
778 /* Clear station in TL and then update HDD data
779 * structures. This helps to block RX frames from other
780 * station to this station.
781 */
Krishna Kumaar Natarajane58b4092017-01-25 15:47:35 -0800782 qdf_status = cdp_clear_peer(cds_get_context(QDF_MODULE_ID_SOC),
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800783 (struct cdp_pdev *)cds_get_context(QDF_MODULE_ID_TXRX),
784 staId);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530785 if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
Krishna Kumaar Natarajane58b4092017-01-25 15:47:35 -0800786 hdd_err("cdp_clear_peer failed for staID %d, Status=%d [0x%08X]",
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -0800787 staId, qdf_status, qdf_status);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800788 }
789
790 if (pAdapter->aStaInfo[staId].isUsed) {
791 spin_lock_bh(&pAdapter->staInfo_lock);
Anurag Chouhan600c3a02016-03-01 10:33:54 +0530792 qdf_mem_zero(&pAdapter->aStaInfo[staId],
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800793 sizeof(hdd_station_info_t));
794 spin_unlock_bh(&pAdapter->staInfo_lock);
795 }
796 pHddCtx->sta_to_adapter[staId] = NULL;
797
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530798 return qdf_status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800799}
800
801/**
802 * hdd_softap_register_sta() - Register a SoftAP STA
803 * @pAdapter: pointer to adapter context
804 * @fAuthRequired: is additional authentication required?
805 * @fPrivacyBit: should 802.11 privacy bit be set?
806 * @staId: station ID assigned to this station
807 * @ucastSig: unicast security signature
808 * @bcastSig: broadcast security signature
809 * @pPeerMacAddress: station MAC address
810 * @fWmmEnabled: is WMM enabled for this STA?
811 *
Anurag Chouhanf04e84f2016-03-03 10:12:12 +0530812 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800813 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530814QDF_STATUS hdd_softap_register_sta(hdd_adapter_t *pAdapter,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800815 bool fAuthRequired,
816 bool fPrivacyBit,
817 uint8_t staId,
818 uint8_t ucastSig,
819 uint8_t bcastSig,
Anurag Chouhan6d760662016-02-20 16:05:43 +0530820 struct qdf_mac_addr *pPeerMacAddress,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800821 bool fWmmEnabled)
822{
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530823 QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800824 struct ol_txrx_desc_type staDesc = { 0 };
825 hdd_context_t *pHddCtx = pAdapter->pHddCtx;
Dhanashri Atre182b0272016-02-17 15:35:07 -0800826 struct ol_txrx_ops txrx_ops;
Leo Changfdb45c32016-10-28 11:09:23 -0700827 void *soc = cds_get_context(QDF_MODULE_ID_SOC);
828 void *pdev = cds_get_context(QDF_MODULE_ID_TXRX);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800829
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -0800830 hdd_info("STA:%u, Auth:%u, Priv:%u, WMM:%u",
831 staId, fAuthRequired, fPrivacyBit, fWmmEnabled);
832
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800833 /*
834 * Clean up old entry if it is not cleaned up properly
835 */
836 if (pAdapter->aStaInfo[staId].isUsed) {
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -0800837 hdd_info("clean up old entry for STA %d", staId);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800838 hdd_softap_deregister_sta(pAdapter, staId);
839 }
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800840
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -0800841 /* Get the Station ID from the one saved during the assocation. */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800842 staDesc.sta_id = staId;
843
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -0800844 /* Save the pAdapter Pointer for this staId */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800845 pHddCtx->sta_to_adapter[staId] = pAdapter;
846
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530847 qdf_status =
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800848 hdd_softap_init_tx_rx_sta(pAdapter, staId,
849 pPeerMacAddress);
850
851 staDesc.is_qos_enabled = fWmmEnabled;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800852
Dhanashri Atre182b0272016-02-17 15:35:07 -0800853 /* Register the vdev transmit and receive functions */
854 qdf_mem_zero(&txrx_ops, sizeof(txrx_ops));
855 txrx_ops.rx.rx = hdd_softap_rx_packet_cbk;
Leo Changfdb45c32016-10-28 11:09:23 -0700856 cdp_vdev_register(soc,
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800857 (struct cdp_vdev *)cdp_get_vdev_from_vdev_id(soc,
858 (struct cdp_pdev *)pdev, pAdapter->sessionId),
859 pAdapter, &txrx_ops);
860 pAdapter->txrx_vdev = (void *)cdp_get_vdev_from_vdev_id(soc,
861 (struct cdp_pdev *)pdev,
Leo Changfdb45c32016-10-28 11:09:23 -0700862 pAdapter->sessionId);
Dhanashri Atre168d2b42016-02-22 14:43:06 -0800863 pAdapter->tx_fn = txrx_ops.tx.tx;
Dhanashri Atre182b0272016-02-17 15:35:07 -0800864
Venkata Sharath Chandra Manchala0d44d452016-11-23 17:48:15 -0800865 qdf_status = cdp_peer_register(soc,
866 (struct cdp_pdev *)pdev, &staDesc);
Dhanashri Atre50141c52016-04-07 13:15:29 -0700867 if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -0800868 hdd_err("cdp_peer_register() failed to register. Status = %d [0x%08X]",
869 qdf_status, qdf_status);
Dhanashri Atre50141c52016-04-07 13:15:29 -0700870 return qdf_status;
871 }
872
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800873 /* if ( WPA ), tell TL to go to 'connected' and after keys come to the
874 * driver then go to 'authenticated'. For all other authentication
875 * types (those that do not require upper layer authentication) we can
876 * put TL directly into 'authenticated' state
877 */
878
879 pAdapter->aStaInfo[staId].ucSTAId = staId;
880 pAdapter->aStaInfo[staId].isQosEnabled = fWmmEnabled;
881
882 if (!fAuthRequired) {
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -0800883 hdd_info("open/shared auth StaId= %d. Changing TL state to AUTHENTICATED at Join time",
884 pAdapter->aStaInfo[staId].ucSTAId);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800885
886 /* Connections that do not need Upper layer auth,
887 * transition TL directly to 'Authenticated' state.
888 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530889 qdf_status = hdd_change_peer_state(pAdapter, staDesc.sta_id,
Dhanashri Atreb08959a2016-03-01 17:28:03 -0800890 OL_TXRX_PEER_STATE_AUTH, false);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800891
Dhanashri Atreb08959a2016-03-01 17:28:03 -0800892 pAdapter->aStaInfo[staId].tlSTAState = OL_TXRX_PEER_STATE_AUTH;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800893 pAdapter->sessionCtx.ap.uIsAuthenticated = true;
894 } else {
895
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -0800896 hdd_info("ULA auth StaId= %d. Changing TL state to CONNECTED at Join time",
897 pAdapter->aStaInfo[staId].ucSTAId);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800898
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530899 qdf_status = hdd_change_peer_state(pAdapter, staDesc.sta_id,
Dhanashri Atreb08959a2016-03-01 17:28:03 -0800900 OL_TXRX_PEER_STATE_CONN, false);
901 pAdapter->aStaInfo[staId].tlSTAState = OL_TXRX_PEER_STATE_CONN;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800902
903 pAdapter->sessionCtx.ap.uIsAuthenticated = false;
904
905 }
906
907 /* Enable Tx queue */
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -0800908 hdd_notice("Enabling queues");
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800909 wlan_hdd_netif_queue_control(pAdapter,
910 WLAN_START_ALL_NETIF_QUEUE_N_CARRIER,
911 WLAN_CONTROL_PATH);
912
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530913 return qdf_status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800914}
915
916/**
917 * hdd_softap_register_bc_sta() - Register the SoftAP broadcast STA
918 * @pAdapter: pointer to adapter context
919 * @fPrivacyBit: should 802.11 privacy bit be set?
920 *
Anurag Chouhanf04e84f2016-03-03 10:12:12 +0530921 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800922 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530923QDF_STATUS hdd_softap_register_bc_sta(hdd_adapter_t *pAdapter,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800924 bool fPrivacyBit)
925{
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530926 QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800927 hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
Anurag Chouhan6d760662016-02-20 16:05:43 +0530928 struct qdf_mac_addr broadcastMacAddr =
929 QDF_MAC_ADDR_BROADCAST_INITIALIZER;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800930 hdd_ap_ctx_t *pHddApCtx;
931
932 pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(pAdapter);
933
934 pHddCtx->sta_to_adapter[WLAN_RX_BCMC_STA_ID] = pAdapter;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800935 pHddCtx->sta_to_adapter[pHddApCtx->uBCStaId] = pAdapter;
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530936 qdf_status =
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800937 hdd_softap_register_sta(pAdapter, false, fPrivacyBit,
938 (WLAN_HDD_GET_AP_CTX_PTR(pAdapter))->
939 uBCStaId, 0, 1, &broadcastMacAddr, 0);
940
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530941 return qdf_status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800942}
943
944/**
945 * hdd_softap_deregister_bc_sta() - Deregister the SoftAP broadcast STA
946 * @pAdapter: pointer to adapter context
947 *
Anurag Chouhanf04e84f2016-03-03 10:12:12 +0530948 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800949 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530950QDF_STATUS hdd_softap_deregister_bc_sta(hdd_adapter_t *pAdapter)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800951{
952 return hdd_softap_deregister_sta(pAdapter,
953 (WLAN_HDD_GET_AP_CTX_PTR(pAdapter))->
954 uBCStaId);
955}
956
957/**
958 * hdd_softap_stop_bss() - Stop the BSS
959 * @pAdapter: pointer to adapter context
960 *
Anurag Chouhanf04e84f2016-03-03 10:12:12 +0530961 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800962 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530963QDF_STATUS hdd_softap_stop_bss(hdd_adapter_t *pAdapter)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800964{
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530965 QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800966 uint8_t staId = 0;
967 hdd_context_t *pHddCtx;
968 pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
969
970 /* bss deregister is not allowed during wlan driver loading or
971 * unloading
972 */
Rajeev Kumarfec3dbe2016-01-19 15:23:52 -0800973 if (cds_is_load_or_unload_in_progress()) {
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -0800974 hdd_err("Loading_unloading in Progress, state: 0x%x. Ignore!!!",
975 cds_get_driver_state());
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530976 return QDF_STATUS_E_PERM;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800977 }
978
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530979 qdf_status = hdd_softap_deregister_bc_sta(pAdapter);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800980
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530981 if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -0800982 hdd_err("Failed to deregister BC sta Id %d",
983 (WLAN_HDD_GET_AP_CTX_PTR(pAdapter))->uBCStaId);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800984 }
985
986 for (staId = 0; staId < WLAN_MAX_STA_COUNT; staId++) {
987 /* This excludes BC sta as it is already deregistered */
988 if (pAdapter->aStaInfo[staId].isUsed) {
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530989 qdf_status = hdd_softap_deregister_sta(pAdapter, staId);
990 if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -0800991 hdd_err("Failed to deregister sta Id %d",
992 staId);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800993 }
994 }
995 }
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530996 return qdf_status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800997}
998
999/**
1000 * hdd_softap_change_sta_state() - Change the state of a SoftAP station
1001 * @pAdapter: pointer to adapter context
1002 * @pDestMacAddress: MAC address of the station
1003 * @state: new state of the station
1004 *
Anurag Chouhanf04e84f2016-03-03 10:12:12 +05301005 * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001006 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301007QDF_STATUS hdd_softap_change_sta_state(hdd_adapter_t *pAdapter,
Anurag Chouhan6d760662016-02-20 16:05:43 +05301008 struct qdf_mac_addr *pDestMacAddress,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001009 enum ol_txrx_peer_state state)
1010{
1011 uint8_t ucSTAId = WLAN_MAX_STA_COUNT;
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -08001012 QDF_STATUS qdf_status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001013
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -08001014 ENTER_DEV(pAdapter->dev);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001015
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -08001016 qdf_status = hdd_softap_get_sta_id(pAdapter, pDestMacAddress, &ucSTAId);
1017 if (QDF_STATUS_SUCCESS != qdf_status) {
1018 hdd_err("Failed to find right station");
1019 return qdf_status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001020 }
1021
1022 if (false ==
Anurag Chouhanc5548422016-02-24 18:33:27 +05301023 qdf_is_macaddr_equal(&pAdapter->aStaInfo[ucSTAId].macAddrSTA,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001024 pDestMacAddress)) {
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -08001025 hdd_err("Station %u MAC address not matching", ucSTAId);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301026 return QDF_STATUS_E_FAILURE;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001027 }
1028
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301029 qdf_status =
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001030 hdd_change_peer_state(pAdapter, ucSTAId, state, false);
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -08001031 hdd_info("Station %u changed to state %d", ucSTAId, state);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001032
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301033 if (QDF_STATUS_SUCCESS == qdf_status) {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001034 pAdapter->aStaInfo[ucSTAId].tlSTAState =
Dhanashri Atreb08959a2016-03-01 17:28:03 -08001035 OL_TXRX_PEER_STATE_AUTH;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001036 }
1037
Jeff Johnsond5bd6fd2016-12-05 12:29:21 -08001038 EXIT();
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301039 return qdf_status;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001040}
1041
1042/*
1043 * hdd_softap_get_sta_id() - Find station ID from MAC address
1044 * @pAdapter: pointer to adapter context
1045 * @pDestMacAddress: MAC address of the destination
1046 * @staId: Station ID associated with the MAC address
1047 *
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301048 * Return: QDF_STATUS_SUCCESS if a match was found, in which case
1049 * staId is populated, QDF_STATUS_E_FAILURE if a match is
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001050 * not found
1051 */
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301052QDF_STATUS hdd_softap_get_sta_id(hdd_adapter_t *pAdapter,
Anurag Chouhan6d760662016-02-20 16:05:43 +05301053 struct qdf_mac_addr *pMacAddress,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001054 uint8_t *staId)
1055{
1056 uint8_t i;
1057
1058 for (i = 0; i < WLAN_MAX_STA_COUNT; i++) {
Anurag Chouhan600c3a02016-03-01 10:33:54 +05301059 if (!qdf_mem_cmp
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001060 (&pAdapter->aStaInfo[i].macAddrSTA, pMacAddress,
Anurag Chouhan6d760662016-02-20 16:05:43 +05301061 QDF_MAC_ADDR_SIZE) && pAdapter->aStaInfo[i].isUsed) {
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001062 *staId = i;
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301063 return QDF_STATUS_SUCCESS;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001064 }
1065 }
1066
Anurag Chouhanfb54ab02016-02-18 18:00:46 +05301067 return QDF_STATUS_E_FAILURE;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001068}