2007-02-10 22:25:27 +08:00
|
|
|
/**
|
|
|
|
* Interface for the wlan network scan routines
|
|
|
|
*
|
|
|
|
* Driver interface functions and type declarations for the scan module
|
2007-11-16 07:05:47 +08:00
|
|
|
* implemented in scan.c.
|
2007-02-10 22:25:27 +08:00
|
|
|
*/
|
2007-11-16 07:05:47 +08:00
|
|
|
#ifndef _LBS_SCAN_H
|
|
|
|
#define _LBS_SCAN_H
|
2007-02-10 22:25:27 +08:00
|
|
|
|
2007-05-11 10:51:28 +08:00
|
|
|
#include <net/ieee80211.h>
|
2007-02-10 22:25:27 +08:00
|
|
|
#include "hostcmd.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Maximum number of channels that can be sent in a setuserscan ioctl
|
|
|
|
*
|
2007-11-16 07:05:47 +08:00
|
|
|
* @sa lbs_ioctl_user_scan_cfg
|
2007-02-10 22:25:27 +08:00
|
|
|
*/
|
2007-11-16 07:05:47 +08:00
|
|
|
#define LBS_IOCTL_USER_SCAN_CHAN_MAX 50
|
2007-02-10 22:25:27 +08:00
|
|
|
|
2008-03-03 19:18:03 +08:00
|
|
|
//! Infrastructure BSS scan type in cmd_ds_802_11_scan
|
2007-11-16 07:05:47 +08:00
|
|
|
#define LBS_SCAN_BSS_TYPE_BSS 1
|
2007-02-10 22:25:27 +08:00
|
|
|
|
2008-03-03 19:18:03 +08:00
|
|
|
//! Adhoc BSS scan type in cmd_ds_802_11_scan
|
2007-11-16 07:05:47 +08:00
|
|
|
#define LBS_SCAN_BSS_TYPE_IBSS 2
|
2007-02-10 22:25:27 +08:00
|
|
|
|
2008-03-03 19:18:03 +08:00
|
|
|
//! Adhoc or Infrastructure BSS scan type in cmd_ds_802_11_scan, no filter
|
2007-11-16 07:05:47 +08:00
|
|
|
#define LBS_SCAN_BSS_TYPE_ANY 3
|
2007-02-10 22:25:27 +08:00
|
|
|
|
|
|
|
/**
|
2007-11-16 07:05:47 +08:00
|
|
|
* @brief IOCTL channel sub-structure sent in lbs_ioctl_user_scan_cfg
|
2007-02-10 22:25:27 +08:00
|
|
|
*
|
|
|
|
* Multiple instances of this structure are included in the IOCTL command
|
|
|
|
* to configure a instance of a scan on the specific channel.
|
|
|
|
*/
|
2007-11-16 07:05:47 +08:00
|
|
|
struct lbs_ioctl_user_scan_chan {
|
2007-02-10 22:25:27 +08:00
|
|
|
u8 channumber; //!< channel Number to scan
|
|
|
|
u8 radiotype; //!< Radio type: 'B/G' band = 0, 'A' band = 1
|
|
|
|
u8 scantype; //!< Scan type: Active = 0, Passive = 1
|
|
|
|
u16 scantime; //!< Scan duration in milliseconds; if 0 default used
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief IOCTL input structure to configure an immediate scan cmd to firmware
|
|
|
|
*
|
2007-11-16 07:05:47 +08:00
|
|
|
* Used in the setuserscan (LBS_SET_USER_SCAN) private ioctl. Specifies
|
2007-02-10 22:25:27 +08:00
|
|
|
* a number of parameters to be used in general for the scan as well
|
2007-11-16 07:05:47 +08:00
|
|
|
* as a channel list (lbs_ioctl_user_scan_chan) for each scan period
|
2007-02-10 22:25:27 +08:00
|
|
|
* desired.
|
|
|
|
*
|
2007-11-16 07:05:47 +08:00
|
|
|
* @sa lbs_set_user_scan_ioctl
|
2007-02-10 22:25:27 +08:00
|
|
|
*/
|
2007-11-16 07:05:47 +08:00
|
|
|
struct lbs_ioctl_user_scan_cfg {
|
2007-02-10 22:25:27 +08:00
|
|
|
/**
|
|
|
|
* @brief BSS type to be sent in the firmware command
|
|
|
|
*
|
|
|
|
* Field can be used to restrict the types of networks returned in the
|
|
|
|
* scan. valid settings are:
|
|
|
|
*
|
2007-11-16 07:05:47 +08:00
|
|
|
* - LBS_SCAN_BSS_TYPE_BSS (infrastructure)
|
|
|
|
* - LBS_SCAN_BSS_TYPE_IBSS (adhoc)
|
|
|
|
* - LBS_SCAN_BSS_TYPE_ANY (unrestricted, adhoc and infrastructure)
|
2007-02-10 22:25:27 +08:00
|
|
|
*/
|
|
|
|
u8 bsstype;
|
|
|
|
|
2007-05-26 04:25:21 +08:00
|
|
|
/**
|
|
|
|
* @brief BSSID filter sent in the firmware command to limit the results
|
|
|
|
*/
|
|
|
|
u8 bssid[ETH_ALEN];
|
2007-02-10 22:25:27 +08:00
|
|
|
|
2007-05-26 04:25:21 +08:00
|
|
|
/* Clear existing scan results matching this BSSID */
|
|
|
|
u8 clear_bssid;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief SSID filter sent in the firmware command to limit the results
|
|
|
|
*/
|
|
|
|
char ssid[IW_ESSID_MAX_SIZE];
|
|
|
|
u8 ssid_len;
|
|
|
|
|
|
|
|
/* Clear existing scan results matching this SSID */
|
|
|
|
u8 clear_ssid;
|
2007-02-10 22:25:27 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Structure used to store information for each beacon/probe response
|
|
|
|
*/
|
|
|
|
struct bss_descriptor {
|
2007-05-26 01:16:38 +08:00
|
|
|
u8 bssid[ETH_ALEN];
|
2007-02-10 22:25:27 +08:00
|
|
|
|
2007-05-29 11:54:55 +08:00
|
|
|
u8 ssid[IW_ESSID_MAX_SIZE + 1];
|
|
|
|
u8 ssid_len;
|
2007-02-10 22:25:27 +08:00
|
|
|
|
2007-08-02 22:43:44 +08:00
|
|
|
u16 capability;
|
2007-02-10 22:25:27 +08:00
|
|
|
|
|
|
|
/* receive signal strength in dBm */
|
|
|
|
long rssi;
|
|
|
|
|
|
|
|
u32 channel;
|
|
|
|
|
|
|
|
u16 beaconperiod;
|
|
|
|
|
|
|
|
u32 atimwindow;
|
|
|
|
|
2007-08-03 01:12:45 +08:00
|
|
|
/* IW_MODE_AUTO, IW_MODE_ADHOC, IW_MODE_INFRA */
|
2007-05-11 10:58:02 +08:00
|
|
|
u8 mode;
|
2007-08-03 01:12:45 +08:00
|
|
|
|
2007-08-02 23:40:45 +08:00
|
|
|
/* zero-terminated array of supported data rates */
|
|
|
|
u8 rates[MAX_RATES + 1];
|
2007-02-10 22:25:27 +08:00
|
|
|
|
2007-05-26 04:15:56 +08:00
|
|
|
unsigned long last_scanned;
|
|
|
|
|
2007-02-10 22:25:27 +08:00
|
|
|
union ieeetypes_phyparamset phyparamset;
|
|
|
|
union IEEEtypes_ssparamset ssparamset;
|
|
|
|
|
|
|
|
struct ieeetypes_countryinfofullset countryinfo;
|
|
|
|
|
2007-05-11 10:51:28 +08:00
|
|
|
u8 wpa_ie[MAX_WPA_IE_LEN];
|
|
|
|
size_t wpa_ie_len;
|
|
|
|
u8 rsn_ie[MAX_WPA_IE_LEN];
|
|
|
|
size_t rsn_ie_len;
|
2007-05-26 04:15:56 +08:00
|
|
|
|
2007-08-02 22:51:27 +08:00
|
|
|
u8 mesh;
|
|
|
|
|
2007-05-26 04:15:56 +08:00
|
|
|
struct list_head list;
|
2007-02-10 22:25:27 +08:00
|
|
|
};
|
|
|
|
|
2007-11-16 07:05:47 +08:00
|
|
|
int lbs_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len);
|
2007-05-26 04:15:56 +08:00
|
|
|
|
2007-12-09 04:04:36 +08:00
|
|
|
struct bss_descriptor *lbs_find_ssid_in_list(struct lbs_private *priv,
|
2007-11-16 07:05:47 +08:00
|
|
|
u8 *ssid, u8 ssid_len, u8 *bssid, u8 mode,
|
|
|
|
int channel);
|
2007-05-26 04:15:56 +08:00
|
|
|
|
2007-12-09 04:04:36 +08:00
|
|
|
struct bss_descriptor *lbs_find_bssid_in_list(struct lbs_private *priv,
|
2007-11-16 07:05:47 +08:00
|
|
|
u8 *bssid, u8 mode);
|
2007-02-10 22:25:27 +08:00
|
|
|
|
2007-11-23 22:43:44 +08:00
|
|
|
int lbs_find_best_network_ssid(struct lbs_private *priv, u8 *out_ssid,
|
2007-05-29 11:54:55 +08:00
|
|
|
u8 *out_ssid_len, u8 preferred_mode, u8 *out_mode);
|
2007-02-10 22:25:27 +08:00
|
|
|
|
2007-11-23 22:43:44 +08:00
|
|
|
int lbs_send_specific_ssid_scan(struct lbs_private *priv, u8 *ssid,
|
2007-05-29 11:54:55 +08:00
|
|
|
u8 ssid_len, u8 clear_ssid);
|
2007-02-10 22:25:27 +08:00
|
|
|
|
2007-11-23 22:43:44 +08:00
|
|
|
int lbs_scan_networks(struct lbs_private *priv,
|
2007-11-16 07:05:47 +08:00
|
|
|
const struct lbs_ioctl_user_scan_cfg *puserscanin,
|
2007-05-25 12:33:28 +08:00
|
|
|
int full_scan);
|
2007-02-10 22:25:27 +08:00
|
|
|
|
|
|
|
struct ifreq;
|
|
|
|
|
|
|
|
struct iw_point;
|
|
|
|
struct iw_param;
|
|
|
|
struct iw_request_info;
|
2007-11-16 07:05:47 +08:00
|
|
|
int lbs_get_scan(struct net_device *dev, struct iw_request_info *info,
|
2007-02-10 22:25:27 +08:00
|
|
|
struct iw_point *dwrq, char *extra);
|
2007-11-16 07:05:47 +08:00
|
|
|
int lbs_set_scan(struct net_device *dev, struct iw_request_info *info,
|
2007-02-10 22:25:27 +08:00
|
|
|
struct iw_param *vwrq, char *extra);
|
|
|
|
|
2007-11-16 07:05:47 +08:00
|
|
|
void lbs_scan_worker(struct work_struct *work);
|
2007-08-03 01:19:04 +08:00
|
|
|
|
2007-11-16 07:05:47 +08:00
|
|
|
#endif
|