libertas: implement SSID scanning for SIOCSIWSCAN
[linux-2.6/openmoko-kernel/knife-kernel.git] / drivers / net / wireless / libertas / scan.h
blobc50c8b74714b7c223eb3992fd55ac00aee246c63
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 #define LBS_IOCTL_USER_SCAN_CHAN_MAX 50
18 //! Infrastructure BSS scan type in cmd_ds_802_11_scan
19 #define LBS_SCAN_BSS_TYPE_BSS 1
21 //! Adhoc BSS scan type in cmd_ds_802_11_scan
22 #define LBS_SCAN_BSS_TYPE_IBSS 2
24 //! Adhoc or Infrastructure BSS scan type in cmd_ds_802_11_scan, no filter
25 #define LBS_SCAN_BSS_TYPE_ANY 3
27 /**
28 * @brief Structure used to store information for each beacon/probe response
30 struct bss_descriptor {
31 u8 bssid[ETH_ALEN];
33 u8 ssid[IW_ESSID_MAX_SIZE + 1];
34 u8 ssid_len;
36 u16 capability;
38 /* receive signal strength in dBm */
39 long rssi;
41 u32 channel;
43 u16 beaconperiod;
45 u32 atimwindow;
47 /* IW_MODE_AUTO, IW_MODE_ADHOC, IW_MODE_INFRA */
48 u8 mode;
50 /* zero-terminated array of supported data rates */
51 u8 rates[MAX_RATES + 1];
53 unsigned long last_scanned;
55 union ieeetypes_phyparamset phyparamset;
56 union IEEEtypes_ssparamset ssparamset;
58 struct ieeetypes_countryinfofullset countryinfo;
60 u8 wpa_ie[MAX_WPA_IE_LEN];
61 size_t wpa_ie_len;
62 u8 rsn_ie[MAX_WPA_IE_LEN];
63 size_t rsn_ie_len;
65 u8 mesh;
67 struct list_head list;
70 int lbs_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len);
72 struct bss_descriptor *lbs_find_ssid_in_list(struct lbs_private *priv,
73 u8 *ssid, u8 ssid_len, u8 *bssid, u8 mode,
74 int channel);
76 struct bss_descriptor *lbs_find_bssid_in_list(struct lbs_private *priv,
77 u8 *bssid, u8 mode);
79 int lbs_find_best_network_ssid(struct lbs_private *priv, u8 *out_ssid,
80 u8 *out_ssid_len, u8 preferred_mode, u8 *out_mode);
82 int lbs_send_specific_ssid_scan(struct lbs_private *priv, u8 *ssid,
83 u8 ssid_len);
85 int lbs_get_scan(struct net_device *dev, struct iw_request_info *info,
86 struct iw_point *dwrq, char *extra);
87 int lbs_set_scan(struct net_device *dev, struct iw_request_info *info,
88 union iwreq_data *wrqu, char *extra);
90 void lbs_scan_worker(struct work_struct *work);
92 #endif