blob: d8c266895dd3d8f78c980588cae1e07ddf1f7afc [file] [log] [blame]
Marcelo Tosatti876c9d32007-02-10 12:25:27 -02001/* Copyright (C) 2006, Red Hat, Inc. */
2
Holger Schurig10078322007-11-15 18:05:47 -05003#ifndef _LBS_ASSOC_H_
4#define _LBS_ASSOC_H_
Marcelo Tosatti876c9d32007-02-10 12:25:27 -02005
Holger Schurig2d465022009-10-22 15:30:48 +02006
7#include "defs.h"
8#include "host.h"
9
10
11struct lbs_private;
12
13/*
14 * In theory, the IE is limited to the IE length, 255,
15 * but in practice 64 bytes are enough.
16 */
17#define MAX_WPA_IE_LEN 64
18
19
20
21struct lbs_802_11_security {
22 u8 WPAenabled;
23 u8 WPA2enabled;
24 u8 wep_enabled;
25 u8 auth_mode;
26 u32 key_mgmt;
27};
28
29/** Current Basic Service Set State Structure */
30struct current_bss_params {
31 /** bssid */
32 u8 bssid[ETH_ALEN];
33 /** ssid */
34 u8 ssid[IEEE80211_MAX_SSID_LEN + 1];
35 u8 ssid_len;
36
37 /** band */
38 u8 band;
Holger Schurigc14951f2009-10-22 15:30:50 +020039 /** channel is directly in priv->channel */
Holger Schurig2d465022009-10-22 15:30:48 +020040 /** zero-terminated array of supported data rates */
41 u8 rates[MAX_RATES + 1];
42};
43
44/**
45 * @brief Structure used to store information for each beacon/probe response
46 */
47struct bss_descriptor {
48 u8 bssid[ETH_ALEN];
49
50 u8 ssid[IEEE80211_MAX_SSID_LEN + 1];
51 u8 ssid_len;
52
53 u16 capability;
54 u32 rssi;
55 u32 channel;
56 u16 beaconperiod;
57 __le16 atimwindow;
58
59 /* IW_MODE_AUTO, IW_MODE_ADHOC, IW_MODE_INFRA */
60 u8 mode;
61
62 /* zero-terminated array of supported data rates */
63 u8 rates[MAX_RATES + 1];
64
65 unsigned long last_scanned;
66
67 union ieee_phy_param_set phy;
68 union ieee_ss_param_set ss;
69
70 u8 wpa_ie[MAX_WPA_IE_LEN];
71 size_t wpa_ie_len;
72 u8 rsn_ie[MAX_WPA_IE_LEN];
73 size_t rsn_ie_len;
74
75 u8 mesh;
76
77 struct list_head list;
78};
79
80/** Association request
81 *
82 * Encapsulates all the options that describe a specific assocation request
83 * or configuration of the wireless card's radio, mode, and security settings.
84 */
85struct assoc_request {
86#define ASSOC_FLAG_SSID 1
87#define ASSOC_FLAG_CHANNEL 2
88#define ASSOC_FLAG_BAND 3
89#define ASSOC_FLAG_MODE 4
90#define ASSOC_FLAG_BSSID 5
91#define ASSOC_FLAG_WEP_KEYS 6
92#define ASSOC_FLAG_WEP_TX_KEYIDX 7
93#define ASSOC_FLAG_WPA_MCAST_KEY 8
94#define ASSOC_FLAG_WPA_UCAST_KEY 9
95#define ASSOC_FLAG_SECINFO 10
96#define ASSOC_FLAG_WPA_IE 11
97 unsigned long flags;
98
99 u8 ssid[IEEE80211_MAX_SSID_LEN + 1];
100 u8 ssid_len;
101 u8 channel;
102 u8 band;
103 u8 mode;
104 u8 bssid[ETH_ALEN] __attribute__ ((aligned (2)));
105
106 /** WEP keys */
107 struct enc_key wep_keys[4];
108 u16 wep_tx_keyidx;
109
110 /** WPA keys */
111 struct enc_key wpa_mcast_key;
112 struct enc_key wpa_unicast_key;
113
114 struct lbs_802_11_security secinfo;
115
116 /** WPA Information Elements*/
117 u8 wpa_ie[MAX_WPA_IE_LEN];
118 u8 wpa_ie_len;
119
120 /* BSS to associate with for infrastructure of Ad-Hoc join */
121 struct bss_descriptor bss;
122};
123
124
125extern u8 lbs_bg_rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200126
Holger Schurig10078322007-11-15 18:05:47 -0500127void lbs_association_worker(struct work_struct *work);
David Woodhouseaa21c002007-12-08 20:04:36 +0000128struct assoc_request *lbs_get_association_request(struct lbs_private *priv);
Luis Carlos Cobo Rusb8bedef2007-05-30 12:14:34 -0400129
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400130int lbs_adhoc_stop(struct lbs_private *priv);
131
Holger Schurig697900a2008-04-02 16:27:10 +0200132int lbs_cmd_80211_deauthenticate(struct lbs_private *priv,
Dan Williams191bb402008-08-21 17:46:18 -0400133 u8 bssid[ETH_ALEN], u16 reason);
Holger Schurig697900a2008-04-02 16:27:10 +0200134
Holger Schurig10078322007-11-15 18:05:47 -0500135#endif /* _LBS_ASSOC_H */