blob: e807d604bf618fb13ad989bd590dba732564e198 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Jeff Johnsone1422fb2017-01-12 08:45:01 -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 * DOC : wlan_hdd_scan.h
24 *
25 * WLAN Host Device Driver scan related implementation
26 *
27 */
28
29#if !defined(WLAN_HDD_SCAN_H)
30#define WLAN_HDD_SCAN_H
31
32#include "wlan_hdd_main.h"
Nachiket Kukadec34d4a32017-07-12 16:20:27 +053033#include "csr_inside_api.h"
Sandeep Puligillad0004212017-02-26 18:34:56 -080034#include <wlan_cfg80211_scan.h>
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080035
36#define MAX_PENDING_LOG 5
37
Kapil Gupta0ed58dc2016-04-22 15:35:26 +053038/* (30 Mins) */
39#define MIN_TIME_REQUIRED_FOR_NEXT_BUG_REPORT (30 * 60 * 1000)
40
Nachiket Kukadec34d4a32017-07-12 16:20:27 +053041/* HDD Scan inactivity timeout set to 10 seconds
42 * more than the CSR CMD Timeout */
43#define HDD_SCAN_INACTIVITY_TIMEOUT \
44 (CSR_ACTIVE_SCAN_LIST_CMD_TIMEOUT + (10*1000))
45
Jeff Johnson24d267e2017-08-28 11:43:07 -070046int hdd_scan_context_init(struct hdd_context *hdd_ctx);
47void hdd_scan_context_destroy(struct hdd_context *hdd_ctx);
Prashanth Bhatta527fd752016-04-28 12:35:23 -070048
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080049int wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080050 struct cfg80211_scan_request *request);
51
52#ifdef FEATURE_WLAN_SCAN_PNO
53int wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
54 struct net_device *dev,
55 struct cfg80211_sched_scan_request
56 *request);
57
Dustin Browndfc5ef62017-08-16 15:20:11 -070058#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
Dustin Brownf27bce82016-11-03 12:52:27 -070059/**
60 * wlan_hdd_cfg80211_sched_scan_stop() - stop cfg80211 scheduled (PNO) scan
61 * @wiphy: Pointer to wiphy
62 * @dev: Pointer network device
63 *
64 * Note, this returns success if the driver is recovering or unloading to
65 * prevent race conditions between PLD initiating an unload and kernel
66 * initiating a scheduled scan stop via cfg80211. Unload is expected to stop
67 * any pending scheduled scans in this case.
68 *
69 * Return: 0 for success, non zero for failure
70 */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080071int wlan_hdd_cfg80211_sched_scan_stop(struct wiphy *wiphy,
72 struct net_device *dev);
Dustin Browndfc5ef62017-08-16 15:20:11 -070073#else
74int wlan_hdd_cfg80211_sched_scan_stop(struct wiphy *wiphy,
75 struct net_device *dev,
76 uint64_t reqid);
77
78#endif /* KERNEL_VERSION(4, 12, 0) */
Dustin Brownf27bce82016-11-03 12:52:27 -070079
80/**
81 * wlan_hdd_sched_scan_stop() - stop scheduled (PNO) scans
82 * @dev: Pointer network device
83 *
84 * Return: 0 for success, non zero for failure
85 */
86int wlan_hdd_sched_scan_stop(struct net_device *dev);
Abhishek Singhb20db962017-03-03 21:28:46 +053087#else
88static inline int wlan_hdd_sched_scan_stop(struct net_device *dev)
89{
90 return 0;
91}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080092#endif /* End of FEATURE_WLAN_SCAN_PNO */
93
94int wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy,
95 struct wireless_dev *wdev, const void *data,
96 int data_len);
97
yeshwanth sriram guntuka310b3ac2016-11-15 23:25:26 +053098/**
99 * wlan_hdd_vendor_abort_scan() - API to process vendor command for
100 * abort scan
101 * @wiphy: Pointer to wiphy
102 * @wdev: Pointer to net device
103 * @data : Pointer to the data
104 * @data_len : length of the data
105 *
106 * This is called from supplicant to abort scan
107 *
108 * Return: zero for success and non zero for failure.
109 */
110int wlan_hdd_vendor_abort_scan(
111 struct wiphy *wiphy, struct wireless_dev *wdev,
112 const void *data, int data_len);
113
Vidyullatha, Kanchanapally528789e2016-05-11 20:38:37 +0530114#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)) || \
Srinivas Girigowda682a16b2017-03-24 23:19:34 -0700115 defined(CFG80211_ABORT_SCAN)
Vidyullatha, Kanchanapally528789e2016-05-11 20:38:37 +0530116void wlan_hdd_cfg80211_abort_scan(struct wiphy *wiphy,
117 struct wireless_dev *wdev);
118#endif
hqueaa33ee2017-05-04 17:56:35 +0800119
120/**
121 * wlan_hdd_cfg80211_scan_block_cb() - scan block work handler
122 * @work: Pointer to work
123 *
124 * This function is used to do scan block work handler
125 *
126 * Return: none
127 */
128void wlan_hdd_cfg80211_scan_block_cb(struct work_struct *work);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800129#endif /* end #if !defined(WLAN_HDD_SCAN_H) */
130