1 /* -*- mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
2 /* vi: set expandtab shiftwidth=4 tabstop=4 textwidth=78: */
5 * Interface for the wlan network scan routines
7 * Driver interface functions and type declarations for the scan module
8 * implemented in wlan_scan.c.
16 * @brief Maximum number of channels that can be sent in a setuserscan ioctl
18 * @sa wlan_ioctl_user_scan_cfg
20 #define WLAN_IOCTL_USER_SCAN_CHAN_MAX 50
22 //! Infrastructure BSS scan type in wlan_scan_cmd_config
23 #define WLAN_SCAN_BSS_TYPE_BSS 1
25 //! Adhoc BSS scan type in wlan_scan_cmd_config
26 #define WLAN_SCAN_BSS_TYPE_IBSS 2
28 //! Adhoc or Infrastructure BSS scan type in wlan_scan_cmd_config, no filter
29 #define WLAN_SCAN_BSS_TYPE_ANY 3
32 * @brief Structure used internally in the wlan driver to configure a scan.
34 * Sent to the command processing module to configure the firmware
35 * scan command prepared by libertas_cmd_80211_scan.
37 * @sa wlan_scan_networks
40 struct wlan_scan_cmd_config {
42 * @brief BSS type to be sent in the firmware command
44 * Field can be used to restrict the types of networks returned in the
45 * scan. valid settings are:
47 * - WLAN_SCAN_BSS_TYPE_BSS (infrastructure)
48 * - WLAN_SCAN_BSS_TYPE_IBSS (adhoc)
49 * - WLAN_SCAN_BSS_TYPE_ANY (unrestricted, adhoc and infrastructure)
54 * @brief Specific BSSID used to filter scan results in the firmware
56 u8 specificBSSID[ETH_ALEN];
59 * @brief length of TLVs sent in command starting at tlvBuffer
64 * @brief SSID TLV(s) and ChanList TLVs to be sent in the firmware command
66 * @sa TLV_TYPE_CHANLIST, mrvlietypes_chanlistparamset_t
67 * @sa TLV_TYPE_SSID, mrvlietypes_ssidparamset_t
69 u8 tlvbuffer[1]; //!< SSID TLV(s) and ChanList TLVs are stored here
73 * @brief IOCTL channel sub-structure sent in wlan_ioctl_user_scan_cfg
75 * Multiple instances of this structure are included in the IOCTL command
76 * to configure a instance of a scan on the specific channel.
78 struct wlan_ioctl_user_scan_chan {
79 u8 channumber; //!< channel Number to scan
80 u8 radiotype; //!< Radio type: 'B/G' band = 0, 'A' band = 1
81 u8 scantype; //!< Scan type: Active = 0, Passive = 1
82 u16 scantime; //!< Scan duration in milliseconds; if 0 default used
86 * @brief IOCTL input structure to configure an immediate scan cmd to firmware
88 * Used in the setuserscan (WLAN_SET_USER_SCAN) private ioctl. Specifies
89 * a number of parameters to be used in general for the scan as well
90 * as a channel list (wlan_ioctl_user_scan_chan) for each scan period
93 * @sa libertas_set_user_scan_ioctl
95 struct wlan_ioctl_user_scan_cfg {
98 * @brief Flag set to keep the previous scan table intact
100 * If set, the scan results will accumulate, replacing any previous
101 * matched entries for a BSS with the new scan data
103 u8 keeppreviousscan; //!< Do not erase the existing scan results
106 * @brief BSS type to be sent in the firmware command
108 * Field can be used to restrict the types of networks returned in the
109 * scan. valid settings are:
111 * - WLAN_SCAN_BSS_TYPE_BSS (infrastructure)
112 * - WLAN_SCAN_BSS_TYPE_IBSS (adhoc)
113 * - WLAN_SCAN_BSS_TYPE_ANY (unrestricted, adhoc and infrastructure)
118 * @brief Configure the number of probe requests for active chan scans
123 * @brief BSSID filter sent in the firmware command to limit the results
125 u8 specificBSSID[ETH_ALEN];
128 * @brief SSID filter sent in the firmware command to limit the results
130 char specificSSID[IW_ESSID_MAX_SIZE + 1];
133 * @brief Variable number (fixed maximum) of channels to scan up
135 struct wlan_ioctl_user_scan_chan chanlist[WLAN_IOCTL_USER_SCAN_CHAN_MAX];
139 * @brief Structure used to store information for each beacon/probe response
141 struct bss_descriptor {
142 u8 macaddress[ETH_ALEN];
144 struct WLAN_802_11_SSID ssid;
146 /* WEP encryption requirement */
149 /* receive signal strength in dBm */
158 enum WLAN_802_11_NETWORK_INFRASTRUCTURE inframode;
159 u8 libertas_supported_rates[WLAN_SUPPORTED_RATES];
163 u8 timestamp[8]; //!< TSF value included in the beacon/probe response
164 union ieeetypes_phyparamset phyparamset;
165 union IEEEtypes_ssparamset ssparamset;
166 struct ieeetypes_capinfo cap;
167 u8 datarates[WLAN_SUPPORTED_RATES];
169 __le64 networktsf; //!< TSF timestamp from the current firmware TSF
171 struct ieeetypes_countryinfofullset countryinfo;
173 struct WPA_SUPPLICANT wpa_supplicant;
174 struct WPA_SUPPLICANT wpa2_supplicant;
178 extern int libertas_SSID_cmp(struct WLAN_802_11_SSID *ssid1,
179 struct WLAN_802_11_SSID *ssid2);
180 extern int libertas_find_SSID_in_list(wlan_adapter * adapter, struct WLAN_802_11_SSID *ssid,
181 u8 * bssid, int mode);
182 int libertas_find_best_SSID_in_list(wlan_adapter * adapter, enum WLAN_802_11_NETWORK_INFRASTRUCTURE mode);
183 extern int libertas_find_BSSID_in_list(wlan_adapter * adapter, u8 * bssid, int mode);
185 int libertas_find_best_network_SSID(wlan_private * priv,
186 struct WLAN_802_11_SSID *pSSID,
187 enum WLAN_802_11_NETWORK_INFRASTRUCTURE preferred_mode,
188 enum WLAN_802_11_NETWORK_INFRASTRUCTURE *out_mode);
190 extern int libertas_send_specific_SSID_scan(wlan_private * priv,
191 struct WLAN_802_11_SSID *prequestedssid,
192 u8 keeppreviousscan);
193 extern int libertas_send_specific_BSSID_scan(wlan_private * priv,
194 u8 * bssid, u8 keeppreviousscan);
196 extern int libertas_cmd_80211_scan(wlan_private * priv,
197 struct cmd_ds_command *cmd,
200 extern int libertas_ret_80211_scan(wlan_private * priv,
201 struct cmd_ds_command *resp);
203 int wlan_scan_networks(wlan_private * priv,
204 const struct wlan_ioctl_user_scan_cfg * puserscanin);
210 struct iw_request_info;
211 extern int libertas_get_scan(struct net_device *dev, struct iw_request_info *info,
212 struct iw_point *dwrq, char *extra);
213 extern int libertas_set_scan(struct net_device *dev, struct iw_request_info *info,
214 struct iw_param *vwrq, char *extra);
216 #endif /* _WLAN_SCAN_H */