blob: 59045f598a590556f63006e908d4cd720621aad5 [file] [log] [blame]
/*
* Linux Wireless Extensions event scan
*
* Copyright (C) 1999-2016, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2 (the "GPL"),
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
* following added to such license:
*
* As a special exception, the copyright holders of this software give you
* permission to link this software with independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that
* you also meet, for each linked independent module, the terms and conditions of
* the license of that module. An independent module is a module which is not
* derived from this software. The special exception does not apply to any
* modifications of the software.
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
*
* <<Broadcom-WL-IPTag/Open:>>
*
* $Id: wl_escan.h 591286 2015-10-07 11:59:26Z $
*/
#ifndef _wl_escan_
#define _wl_escan_
#include <linux/wireless.h>
#include <wl_iw.h>
#include <dngl_stats.h>
#include <dhd.h>
#include <linux/time.h>
#ifdef DHD_MAX_IFS
#define WL_MAX_IFS DHD_MAX_IFS
#else
#define WL_MAX_IFS 16
#endif
#define ESCAN_BUF_SIZE (64 * 1024)
#define WL_ESCAN_TIMER_INTERVAL_MS 10000 /* Scan timeout */
/* event queue for cfg80211 main event */
struct escan_event_q {
struct list_head eq_list;
u32 etype;
wl_event_msg_t emsg;
s8 edata[1];
};
/* donlge escan state */
enum escan_state {
ESCAN_STATE_IDLE,
ESCAN_STATE_SCANING
};
struct wl_escan_info;
typedef s32(*ESCAN_EVENT_HANDLER) (struct wl_escan_info *escan,
const wl_event_msg_t *e, void *data);
typedef struct wl_escan_info {
struct net_device *dev;
dhd_pub_t *pub;
struct timer_list scan_timeout; /* Timer for catch scan event timeout */
int escan_state;
int ioctl_ver;
char ioctlbuf[WLC_IOCTL_SMLEN];
u8 escan_buf[ESCAN_BUF_SIZE];
struct wl_scan_results *bss_list;
struct wl_scan_results *scan_results;
struct ether_addr disconnected_bssid;
u8 *escan_ioctl_buf;
spinlock_t eq_lock; /* for event queue synchronization */
struct list_head eq_list; /* used for event queue */
tsk_ctl_t event_tsk; /* task of main event handler thread */
ESCAN_EVENT_HANDLER evt_handler[WLC_E_LAST];
struct mutex usr_sync; /* maily for up/down synchronization */
} wl_escan_info_t;
void wl_escan_event(struct net_device *ndev, const wl_event_msg_t * e, void *data);
int wl_escan_set_scan(
struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu,
char *extra
);
int wl_escan_get_scan(struct net_device *dev, struct iw_request_info *info,
struct iw_point *dwrq, char *extra);
int wl_escan_attach(struct net_device *dev, void * dhdp);
void wl_escan_detach(void);
#endif /* _wl_escan_ */