blob: b50cf1415e04eec9eceee2cbee95462f9ca14d12 [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;
Holger Schurigff829ae2008-03-19 17:08:32 +010037 u32 rssi;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020038 u32 channel;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020039 u16 beaconperiod;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020040 u32 atimwindow;
41
Holger Schuriga2235ed2007-08-02 13:12:45 -040042 /* IW_MODE_AUTO, IW_MODE_ADHOC, IW_MODE_INFRA */
Dan Williams0dc5a292007-05-10 22:58:02 -040043 u8 mode;
Holger Schuriga2235ed2007-08-02 13:12:45 -040044
Dan Williams8c512762007-08-02 11:40:45 -040045 /* zero-terminated array of supported data rates */
46 u8 rates[MAX_RATES + 1];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020047
Dan Williamsfcdb53d2007-05-25 16:15:56 -040048 unsigned long last_scanned;
49
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020050 union ieeetypes_phyparamset phyparamset;
51 union IEEEtypes_ssparamset ssparamset;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020052
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020053 struct ieeetypes_countryinfofullset countryinfo;
54
Dan Williams51b0c9d2007-05-10 22:51:28 -040055 u8 wpa_ie[MAX_WPA_IE_LEN];
56 size_t wpa_ie_len;
57 u8 rsn_ie[MAX_WPA_IE_LEN];
58 size_t rsn_ie_len;
Dan Williamsfcdb53d2007-05-25 16:15:56 -040059
Luis Carlos Cobo1e838bf2007-08-02 10:51:27 -040060 u8 mesh;
61
Dan Williamsfcdb53d2007-05-25 16:15:56 -040062 struct list_head list;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020063};
64
Holger Schurig10078322007-11-15 18:05:47 -050065int lbs_ssid_cmp(u8 *ssid1, u8 ssid1_len, u8 *ssid2, u8 ssid2_len);
Dan Williamsfcdb53d2007-05-25 16:15:56 -040066
David Woodhouseaa21c002007-12-08 20:04:36 +000067struct bss_descriptor *lbs_find_ssid_in_list(struct lbs_private *priv,
Holger Schurig10078322007-11-15 18:05:47 -050068 u8 *ssid, u8 ssid_len, u8 *bssid, u8 mode,
69 int channel);
Dan Williamsfcdb53d2007-05-25 16:15:56 -040070
David Woodhouseaa21c002007-12-08 20:04:36 +000071struct bss_descriptor *lbs_find_bssid_in_list(struct lbs_private *priv,
Holger Schurig10078322007-11-15 18:05:47 -050072 u8 *bssid, u8 mode);
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020073
Holger Schurig69f90322007-11-23 15:43:44 +010074int lbs_find_best_network_ssid(struct lbs_private *priv, u8 *out_ssid,
Dan Williamsd8efea22007-05-28 23:54:55 -040075 u8 *out_ssid_len, u8 preferred_mode, u8 *out_mode);
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020076
Holger Schurig69f90322007-11-23 15:43:44 +010077int lbs_send_specific_ssid_scan(struct lbs_private *priv, u8 *ssid,
Holger Schurig52933d82008-03-05 07:05:32 +010078 u8 ssid_len);
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020079
Holger Schurig10078322007-11-15 18:05:47 -050080int lbs_get_scan(struct net_device *dev, struct iw_request_info *info,
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020081 struct iw_point *dwrq, char *extra);
Holger Schurig10078322007-11-15 18:05:47 -050082int lbs_set_scan(struct net_device *dev, struct iw_request_info *info,
Holger Schurig52933d82008-03-05 07:05:32 +010083 union iwreq_data *wrqu, char *extra);
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020084
Holger Schurig10078322007-11-15 18:05:47 -050085void lbs_scan_worker(struct work_struct *work);
Dan Williams2afc0c52007-08-02 13:19:04 -040086
Holger Schurig10078322007-11-15 18:05:47 -050087#endif