1 /*
2  * Scan interface for ST-Ericsson CW1200 mac80211 drivers
3  *
4  * Copyright (c) 2010, ST-Ericsson
5  * Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  */
11 
12 #ifndef SCAN_H_INCLUDED
13 #define SCAN_H_INCLUDED
14 
15 #include <linux/semaphore.h>
16 #include "wsm.h"
17 
18 /* external */ struct sk_buff;
19 /* external */ struct cfg80211_scan_request;
20 /* external */ struct ieee80211_channel;
21 /* external */ struct ieee80211_hw;
22 /* external */ struct work_struct;
23 
24 struct cw1200_scan {
25 	struct semaphore lock;
26 	struct work_struct work;
27 	struct delayed_work timeout;
28 	struct cfg80211_scan_request *req;
29 	struct ieee80211_channel **begin;
30 	struct ieee80211_channel **curr;
31 	struct ieee80211_channel **end;
32 	struct wsm_ssid ssids[WSM_SCAN_MAX_NUM_OF_SSIDS];
33 	int output_power;
34 	int n_ssids;
35 	int status;
36 	atomic_t in_progress;
37 	/* Direct probe requests workaround */
38 	struct delayed_work probe_work;
39 	int direct_probe;
40 };
41 
42 int cw1200_hw_scan(struct ieee80211_hw *hw,
43 		   struct ieee80211_vif *vif,
44 		   struct ieee80211_scan_request *hw_req);
45 void cw1200_scan_work(struct work_struct *work);
46 void cw1200_scan_timeout(struct work_struct *work);
47 void cw1200_clear_recent_scan_work(struct work_struct *work);
48 void cw1200_scan_complete_cb(struct cw1200_common *priv,
49 			     struct wsm_scan_complete *arg);
50 void cw1200_scan_failed_cb(struct cw1200_common *priv);
51 
52 /* ******************************************************************** */
53 /* Raw probe requests TX workaround					*/
54 void cw1200_probe_work(struct work_struct *work);
55 
56 #endif
57