CRIS: Move common Kconfig variable ETRAX_RTC to arch independet Kconfig.
[wrt350n-kernel.git] / drivers / net / wireless / libertas / scan.h
blob319f70dde350dcd48c034ba1ee100b75ad2b2d35
1 /**
2 * Interface for the wlan network scan routines
4 * Driver interface functions and type declarations for the scan module
5 * implemented in scan.c.
6 */
7 #ifndef _LBS_SCAN_H
8 #define _LBS_SCAN_H
10 #include <net/ieee80211.h>
11 #include "hostcmd.h"
13 /**
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 lbs_scan_cmd_config
21 #define LBS_SCAN_BSS_TYPE_BSS 1
23 //! Adhoc BSS scan type in lbs_scan_cmd_config
24 #define LBS_SCAN_BSS_TYPE_IBSS 2
26 //! Adhoc or Infrastructure BSS scan type in lbs_scan_cmd_config, no filter
27 #define LBS_SCAN_BSS_TYPE_ANY 3
29 /**
30 * @brief Structure used internally in the wlan driver to configure a scan.
32 * Sent to the command processing module to configure the firmware
33 * scan command prepared by lbs_cmd_80211_scan.
35 * @sa lbs_scan_networks
38 struct lbs_scan_cmd_config {
39 /**
40 * @brief BSS type to be sent in the firmware command
42 * Field can be used to restrict the types of networks returned in the
43 * scan. valid settings are:
45 * - LBS_SCAN_BSS_TYPE_BSS (infrastructure)
46 * - LBS_SCAN_BSS_TYPE_IBSS (adhoc)
47 * - LBS_SCAN_BSS_TYPE_ANY (unrestricted, adhoc and infrastructure)
49 u8 bsstype;
51 /**
52 * @brief Specific BSSID used to filter scan results in the firmware
54 u8 bssid[ETH_ALEN];
56 /**
57 * @brief length of TLVs sent in command starting at tlvBuffer
59 int tlvbufferlen;
61 /**
62 * @brief SSID TLV(s) and ChanList TLVs to be sent in the firmware command
64 * @sa TLV_TYPE_CHANLIST, mrvlietypes_chanlistparamset_t
65 * @sa TLV_TYPE_SSID, mrvlietypes_ssidparamset_t
67 u8 tlvbuffer[1]; //!< SSID TLV(s) and ChanList TLVs are stored here
70 /**
71 * @brief IOCTL channel sub-structure sent in lbs_ioctl_user_scan_cfg
73 * Multiple instances of this structure are included in the IOCTL command
74 * to configure a instance of a scan on the specific channel.
76 struct lbs_ioctl_user_scan_chan {
77 u8 channumber; //!< channel Number to scan
78 u8 radiotype; //!< Radio type: 'B/G' band = 0, 'A' band = 1
79 u8 scantype; //!< Scan type: Active = 0, Passive = 1
80 u16 scantime; //!< Scan duration in milliseconds; if 0 default used
83 /**
84 * @brief IOCTL input structure to configure an immediate scan cmd to firmware
86 * Used in the setuserscan (LBS_SET_USER_SCAN) private ioctl. Specifies
87 * a number of parameters to be used in general for the scan as well
88 * as a channel list (lbs_ioctl_user_scan_chan) for each scan period
89 * desired.
91 * @sa lbs_set_user_scan_ioctl
93 struct lbs_ioctl_user_scan_cfg {
94 /**
95 * @brief BSS type to be sent in the firmware command
97 * Field can be used to restrict the types of networks returned in the
98 * scan. valid settings are:
100 * - LBS_SCAN_BSS_TYPE_BSS (infrastructure)
101 * - LBS_SCAN_BSS_TYPE_IBSS (adhoc)
102 * - LBS_SCAN_BSS_TYPE_ANY (unrestricted, adhoc and infrastructure)
104 u8 bsstype;
107 * @brief BSSID filter sent in the firmware command to limit the results
109 u8 bssid[ETH_ALEN];
111 /* Clear existing scan results matching this BSSID */
112 u8 clear_bssid;
115 * @brief SSID filter sent in the firmware command to limit the results
117 char ssid[IW_ESSID_MAX_SIZE];
118 u8 ssid_len;
120 /* Clear existing scan results matching this SSID */
121 u8 clear_ssid;
125 * @brief Structure used to store information for each beacon/probe response
127 struct bss_descriptor {
128 u8 bssid[ETH_ALEN];
130 u8 ssid[IW_ESSID_MAX_SIZE + 1];
131 u8 ssid_len;
133 u16 capability;
135 /* receive signal strength in dBm */
136 long rssi;
138 u32 channel;
140 u16 beaconperiod;
142 u32 atimwindow;
144 /* IW_MODE_AUTO, IW_MODE_ADHOC, IW_MODE_INFRA */
145 u8 mode;
147 /* zero-terminated array of supported data rates */
148 u8 rates[MAX_RATES + 1];
150 unsigned long last_scanned;
152 union ieeetypes_phyparamset phyparamset;
153 union IEEEtypes_ssparamset ssparamset;
155 struct ieeetypes_countryinfofullset countryinfo;
157 u8 wpa_ie[MAX_WPA_IE_LEN];
158 size_t wpa_ie_len;
159 u8 rsn_ie[MAX_WPA_IE_LEN];
160 size_t rsn_ie_len;
162 u8 mesh;
164 struct list_head list;
167 int lbs_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len);
169 struct bss_descriptor *lbs_find_ssid_in_list(struct lbs_private *priv,
170 u8 *ssid, u8 ssid_len, u8 *bssid, u8 mode,
171 int channel);
173 struct bss_descriptor *lbs_find_bssid_in_list(struct lbs_private *priv,
174 u8 *bssid, u8 mode);
176 int lbs_find_best_network_ssid(struct lbs_private *priv, u8 *out_ssid,
177 u8 *out_ssid_len, u8 preferred_mode, u8 *out_mode);
179 int lbs_send_specific_ssid_scan(struct lbs_private *priv, u8 *ssid,
180 u8 ssid_len, u8 clear_ssid);
182 int lbs_cmd_80211_scan(struct lbs_private *priv,
183 struct cmd_ds_command *cmd,
184 void *pdata_buf);
186 int lbs_ret_80211_scan(struct lbs_private *priv,
187 struct cmd_ds_command *resp);
189 int lbs_scan_networks(struct lbs_private *priv,
190 const struct lbs_ioctl_user_scan_cfg *puserscanin,
191 int full_scan);
193 struct ifreq;
195 struct iw_point;
196 struct iw_param;
197 struct iw_request_info;
198 int lbs_get_scan(struct net_device *dev, struct iw_request_info *info,
199 struct iw_point *dwrq, char *extra);
200 int lbs_set_scan(struct net_device *dev, struct iw_request_info *info,
201 struct iw_param *vwrq, char *extra);
203 void lbs_scan_worker(struct work_struct *work);
205 #endif