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>
16 * @brief Maximum number of channels that can be sent in a setuserscan ioctl
18 * @sa lbs_ioctl_user_scan_cfg
20 #define LBS_IOCTL_USER_SCAN_CHAN_MAX 50
22 //! Infrastructure BSS scan type in lbs_scan_cmd_config
23 #define LBS_SCAN_BSS_TYPE_BSS 1
25 //! Adhoc BSS scan type in lbs_scan_cmd_config
26 #define LBS_SCAN_BSS_TYPE_IBSS 2
28 //! Adhoc or Infrastructure BSS scan type in lbs_scan_cmd_config, no filter
29 #define LBS_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 lbs_cmd_80211_scan.
37 * @sa lbs_scan_networks
40 struct lbs_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 * - LBS_SCAN_BSS_TYPE_BSS (infrastructure)
48 * - LBS_SCAN_BSS_TYPE_IBSS (adhoc)
49 * - LBS_SCAN_BSS_TYPE_ANY (unrestricted, adhoc and infrastructure)
54 * @brief Specific BSSID used to filter scan results in the firmware
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 lbs_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 lbs_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 (LBS_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 (lbs_ioctl_user_scan_chan) for each scan period
93 * @sa lbs_set_user_scan_ioctl
95 struct lbs_ioctl_user_scan_cfg {
97 * @brief BSS type to be sent in the firmware command
99 * Field can be used to restrict the types of networks returned in the
100 * scan. valid settings are:
102 * - LBS_SCAN_BSS_TYPE_BSS (infrastructure)
103 * - LBS_SCAN_BSS_TYPE_IBSS (adhoc)
104 * - LBS_SCAN_BSS_TYPE_ANY (unrestricted, adhoc and infrastructure)
109 * @brief BSSID filter sent in the firmware command to limit the results
113 /* Clear existing scan results matching this BSSID */
117 * @brief SSID filter sent in the firmware command to limit the results
119 char ssid[IW_ESSID_MAX_SIZE];
122 /* Clear existing scan results matching this SSID */
127 * @brief Structure used to store information for each beacon/probe response
129 struct bss_descriptor {
132 u8 ssid[IW_ESSID_MAX_SIZE + 1];
137 /* receive signal strength in dBm */
146 /* IW_MODE_AUTO, IW_MODE_ADHOC, IW_MODE_INFRA */
149 /* zero-terminated array of supported data rates */
150 u8 rates[MAX_RATES + 1];
152 unsigned long last_scanned;
154 union ieeetypes_phyparamset phyparamset;
155 union IEEEtypes_ssparamset ssparamset;
157 struct ieeetypes_countryinfofullset countryinfo;
159 u8 wpa_ie[MAX_WPA_IE_LEN];
161 u8 rsn_ie[MAX_WPA_IE_LEN];
166 struct list_head list;
169 int lbs_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len);
171 struct bss_descriptor *lbs_find_ssid_in_list(struct lbs_adapter *adapter,
172 u8 *ssid, u8 ssid_len, u8 *bssid, u8 mode,
175 struct bss_descriptor *lbs_find_bssid_in_list(struct lbs_adapter *adapter,
178 int lbs_find_best_network_ssid(struct lbs_private *priv, u8 *out_ssid,
179 u8 *out_ssid_len, u8 preferred_mode, u8 *out_mode);
181 int lbs_send_specific_ssid_scan(struct lbs_private *priv, u8 *ssid,
182 u8 ssid_len, u8 clear_ssid);
184 int lbs_cmd_80211_scan(struct lbs_private *priv,
185 struct cmd_ds_command *cmd,
188 int lbs_ret_80211_scan(struct lbs_private *priv,
189 struct cmd_ds_command *resp);
191 int lbs_scan_networks(struct lbs_private *priv,
192 const struct lbs_ioctl_user_scan_cfg *puserscanin,
199 struct iw_request_info;
200 int lbs_get_scan(struct net_device *dev, struct iw_request_info *info,
201 struct iw_point *dwrq, char *extra);
202 int lbs_set_scan(struct net_device *dev, struct iw_request_info *info,
203 struct iw_param *vwrq, char *extra);
205 void lbs_scan_worker(struct work_struct *work);