blob: c50c8b74714b7c223eb3992fd55ac00aee246c63 [file] [log] [blame]
Marcelo Tosatti876c9d32007-02-10 12:25:27 -02001/**
2 * Interface for the wlan network scan routines
3 *
4 * Driver interface functions and type declarations for the scan module
Holger Schurig10078322007-11-15 18:05:47 -05005 * implemented in scan.c.
Marcelo Tosatti876c9d32007-02-10 12:25:27 -02006 */
Holger Schurig10078322007-11-15 18:05:47 -05007#ifndef _LBS_SCAN_H
8#define _LBS_SCAN_H
Marcelo Tosatti876c9d32007-02-10 12:25:27 -02009
Dan Williams51b0c9d2007-05-10 22:51:28 -040010#include <net/ieee80211.h>
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020011#include "hostcmd.h"
12
13/**
14 * @brief Maximum number of channels that can be sent in a setuserscan ioctl
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020015 */
Holger Schurig10078322007-11-15 18:05:47 -050016#define LBS_IOCTL_USER_SCAN_CHAN_MAX 50
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020017
David Woodhousefa62f992008-03-03 12:18:03 +010018//! Infrastructure BSS scan type in cmd_ds_802_11_scan
Holger Schurig10078322007-11-15 18:05:47 -050019#define LBS_SCAN_BSS_TYPE_BSS 1
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020020
David Woodhousefa62f992008-03-03 12:18:03 +010021//! Adhoc BSS scan type in cmd_ds_802_11_scan
Holger Schurig10078322007-11-15 18:05:47 -050022#define LBS_SCAN_BSS_TYPE_IBSS 2
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020023
David Woodhousefa62f992008-03-03 12:18:03 +010024//! Adhoc or Infrastructure BSS scan type in cmd_ds_802_11_scan, no filter
Holger Schurig10078322007-11-15 18:05:47 -050025#define LBS_SCAN_BSS_TYPE_ANY 3
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020026
27/**
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020028 * @brief Structure used to store information for each beacon/probe response
29 */
30struct bss_descriptor {
Dan Williams4ace1132007-05-25 13:16:38 -040031 u8 bssid[ETH_ALEN];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020032
Dan Williamsd8efea22007-05-28 23:54:55 -040033 u8 ssid[IW_ESSID_MAX_SIZE + 1];
34 u8 ssid_len;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020035
Dan Williams0c9ca692007-08-02 10:43:44 -040036 u16 capability;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020037
38 /* receive signal strength in dBm */
39 long rssi;
40
41 u32 channel;
42
43 u16 beaconperiod;
44
45 u32 atimwindow;
46
Holger Schuriga2235ed2007-08-02 13:12:45 -040047 /* IW_MODE_AUTO, IW_MODE_ADHOC, IW_MODE_INFRA */
Dan Williams0dc5a292007-05-10 22:58:02 -040048 u8 mode;
Holger Schuriga2235ed2007-08-02 13:12:45 -040049
Dan Williams8c512762007-08-02 11:40:45 -040050 /* zero-terminated array of supported data rates */
51 u8 rates[MAX_RATES + 1];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020052
Dan Williamsfcdb53d2007-05-25 16:15:56 -040053 unsigned long last_scanned;
54
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020055 union ieeetypes_phyparamset phyparamset;
56 union IEEEtypes_ssparamset ssparamset;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020057
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020058 struct ieeetypes_countryinfofullset countryinfo;
59
Dan Williams51b0c9d2007-05-10 22:51:28 -040060 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;
Dan Williamsfcdb53d2007-05-25 16:15:56 -040064
Luis Carlos Cobo1e838bf2007-08-02 10:51:27 -040065 u8 mesh;
66
Dan Williamsfcdb53d2007-05-25 16:15:56 -040067 struct list_head list;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020068};
69
Holger Schurig10078322007-11-15 18:05:47 -050070int lbs_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len);
Dan Williamsfcdb53d2007-05-25 16:15:56 -040071
David Woodhouseaa21c002007-12-08 20:04:36 +000072struct bss_descriptor *lbs_find_ssid_in_list(struct lbs_private *priv,
Holger Schurig10078322007-11-15 18:05:47 -050073 u8 *ssid, u8 ssid_len, u8 *bssid, u8 mode,
74 int channel);
Dan Williamsfcdb53d2007-05-25 16:15:56 -040075
David Woodhouseaa21c002007-12-08 20:04:36 +000076struct bss_descriptor *lbs_find_bssid_in_list(struct lbs_private *priv,
Holger Schurig10078322007-11-15 18:05:47 -050077 u8 *bssid, u8 mode);
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020078
Holger Schurig69f90322007-11-23 15:43:44 +010079int lbs_find_best_network_ssid(struct lbs_private *priv, u8 *out_ssid,
Dan Williamsd8efea22007-05-28 23:54:55 -040080 u8 *out_ssid_len, u8 preferred_mode, u8 *out_mode);
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020081
Holger Schurig69f90322007-11-23 15:43:44 +010082int lbs_send_specific_ssid_scan(struct lbs_private *priv, u8 *ssid,
Holger Schurig52933d82008-03-05 07:05:32 +010083 u8 ssid_len);
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020084
Holger Schurig10078322007-11-15 18:05:47 -050085int lbs_get_scan(struct net_device *dev, struct iw_request_info *info,
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020086 struct iw_point *dwrq, char *extra);
Holger Schurig10078322007-11-15 18:05:47 -050087int lbs_set_scan(struct net_device *dev, struct iw_request_info *info,
Holger Schurig52933d82008-03-05 07:05:32 +010088 union iwreq_data *wrqu, char *extra);
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020089
Holger Schurig10078322007-11-15 18:05:47 -050090void lbs_scan_worker(struct work_struct *work);
Dan Williams2afc0c52007-08-02 13:19:04 -040091
Holger Schurig10078322007-11-15 18:05:47 -050092#endif