2 * Interface for the wlan network scan routines
4 * Driver interface functions and type declarations for the scan module
5 * implemented in scan.c.
10 #include <net/ieee80211.h>
14 * @brief Maximum number of channels that can be sent in a setuserscan ioctl
16 * @sa lbs_ioctl_user_scan_cfg
18 #define LBS_IOCTL_USER_SCAN_CHAN_MAX 50
20 //! Infrastructure BSS scan type in cmd_ds_802_11_scan
21 #define LBS_SCAN_BSS_TYPE_BSS 1
23 //! Adhoc BSS scan type in cmd_ds_802_11_scan
24 #define LBS_SCAN_BSS_TYPE_IBSS 2
26 //! Adhoc or Infrastructure BSS scan type in cmd_ds_802_11_scan, no filter
27 #define LBS_SCAN_BSS_TYPE_ANY 3
30 * @brief IOCTL channel sub-structure sent in lbs_ioctl_user_scan_cfg
32 * Multiple instances of this structure are included in the IOCTL command
33 * to configure a instance of a scan on the specific channel.
35 struct lbs_ioctl_user_scan_chan {
36 u8 channumber; //!< channel Number to scan
37 u8 radiotype; //!< Radio type: 'B/G' band = 0, 'A' band = 1
38 u8 scantype; //!< Scan type: Active = 0, Passive = 1
39 u16 scantime; //!< Scan duration in milliseconds; if 0 default used
43 * @brief IOCTL input structure to configure an immediate scan cmd to firmware
45 * Used in the setuserscan (LBS_SET_USER_SCAN) private ioctl. Specifies
46 * a number of parameters to be used in general for the scan as well
47 * as a channel list (lbs_ioctl_user_scan_chan) for each scan period
50 * @sa lbs_set_user_scan_ioctl
52 struct lbs_ioctl_user_scan_cfg {
54 * @brief BSS type to be sent in the firmware command
56 * Field can be used to restrict the types of networks returned in the
57 * scan. valid settings are:
59 * - LBS_SCAN_BSS_TYPE_BSS (infrastructure)
60 * - LBS_SCAN_BSS_TYPE_IBSS (adhoc)
61 * - LBS_SCAN_BSS_TYPE_ANY (unrestricted, adhoc and infrastructure)
66 * @brief BSSID filter sent in the firmware command to limit the results
70 /* Clear existing scan results matching this BSSID */
74 * @brief SSID filter sent in the firmware command to limit the results
76 char ssid[IW_ESSID_MAX_SIZE];
79 /* Clear existing scan results matching this SSID */
84 * @brief Structure used to store information for each beacon/probe response
86 struct bss_descriptor {
89 u8 ssid[IW_ESSID_MAX_SIZE + 1];
94 /* receive signal strength in dBm */
103 /* IW_MODE_AUTO, IW_MODE_ADHOC, IW_MODE_INFRA */
106 /* zero-terminated array of supported data rates */
107 u8 rates[MAX_RATES + 1];
109 unsigned long last_scanned;
111 union ieeetypes_phyparamset phyparamset;
112 union IEEEtypes_ssparamset ssparamset;
114 struct ieeetypes_countryinfofullset countryinfo;
116 u8 wpa_ie[MAX_WPA_IE_LEN];
118 u8 rsn_ie[MAX_WPA_IE_LEN];
123 struct list_head list;
126 int lbs_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len);
128 struct bss_descriptor *lbs_find_ssid_in_list(struct lbs_private *priv,
129 u8 *ssid, u8 ssid_len, u8 *bssid, u8 mode,
132 struct bss_descriptor *lbs_find_bssid_in_list(struct lbs_private *priv,
135 int lbs_find_best_network_ssid(struct lbs_private *priv, u8 *out_ssid,
136 u8 *out_ssid_len, u8 preferred_mode, u8 *out_mode);
138 int lbs_send_specific_ssid_scan(struct lbs_private *priv, u8 *ssid,
139 u8 ssid_len, u8 clear_ssid);
141 int lbs_scan_networks(struct lbs_private *priv,
142 const struct lbs_ioctl_user_scan_cfg *puserscanin,
149 struct iw_request_info;
150 int lbs_get_scan(struct net_device *dev, struct iw_request_info *info,
151 struct iw_point *dwrq, char *extra);
152 int lbs_set_scan(struct net_device *dev, struct iw_request_info *info,
153 struct iw_param *vwrq, char *extra);
155 void lbs_scan_worker(struct work_struct *work);