• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Scan interfaces for XRadio drivers
3  *
4  * Copyright (c) 2013
5  * Xradio Technology Co., Ltd. <www.xradiotech.com>
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 
13 #ifndef SCAN_H_INCLUDED
14 #define SCAN_H_INCLUDED
15 
16 #include <linux/semaphore.h>
17 #include "wsm.h"
18 
19 /* external */ struct sk_buff;
20 /* external */ struct cfg80211_scan_request;
21 /* external */ struct ieee80211_channel;
22 /* external */ struct ieee80211_hw;
23 /* external */ struct work_struct;
24 
25 #define SCAN_DEFAULT_TIMEOUT (5000)   /* default scan timeout(ms)*/
26 #define SCAN_MAX_DELAY      (3*HZ)   /*3s delay for connect*/
27 #define XRADIO_SCAN_ALLOW   0
28 #define XRADIO_SCAN_DELAY   1
29 
30 struct xradio_scan {
31 	struct semaphore lock;
32 	struct work_struct work;
33 #ifdef ROAM_OFFLOAD
34 	struct work_struct swork; /* scheduled scan work */
35 	struct cfg80211_sched_scan_request *sched_req;
36 #endif /*ROAM_OFFLOAD*/
37 	struct delayed_work timeout;
38 	struct cfg80211_scan_request *req;
39 	struct ieee80211_channel **begin;
40 	struct ieee80211_channel **curr;
41 	struct ieee80211_channel **end;
42 	struct wsm_ssid ssids[WSM_SCAN_MAX_NUM_OF_SSIDS];
43 	int output_power;
44 	int n_ssids;
45 	struct semaphore status_lock; /*sync scan request and result*/
46 	int status;
47 	atomic_t in_progress;
48 	/* Direct probe requests workaround */
49 	struct delayed_work probe_work;
50 	int direct_probe;
51 	u8 if_id;
52 #ifdef SCAN_FAILED_WORKAROUND_OF_FW_EXCEPTION
53 	unsigned long scan_failed_timestamp;
54 	u8 scan_failed_cnt;
55 #endif
56 };
57 
58 int xradio_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
59 		   struct ieee80211_scan_request *req);
60 #ifdef ROAM_OFFLOAD
61 int xradio_hw_sched_scan_start(struct ieee80211_hw *hw,
62 			       struct ieee80211_vif *vif,
63 			       struct cfg80211_sched_scan_request *req,
64 			       struct ieee80211_sched_scan_ies *ies);
65 void xradio_hw_sched_scan_stop(struct xradio_common *priv);
66 void xradio_sched_scan_work(struct work_struct *work);
67 #endif /*ROAM_OFFLOAD*/
68 void xradio_scan_work(struct work_struct *work);
69 void xradio_scan_timeout(struct work_struct *work);
70 void xradio_scan_complete_cb(struct xradio_common *priv,
71 			     struct wsm_scan_complete *arg);
72 
73 /* ******************************************************************** */
74 /* Raw probe requests TX workaround					*/
75 void xradio_probe_work(struct work_struct *work);
76 #ifdef CONFIG_XRADIO_TESTMODE
77 /* Advance Scan Timer							*/
78 void xradio_advance_scan_timeout(struct work_struct *work);
79 #endif
80 
81 #endif
82