blob: 610d14c14cd4d532370b8b9310e377dcffa1e3f5 [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;
39 /** channel */
40 u8 channel;
41 /** zero-terminated array of supported data rates */
42 u8 rates[MAX_RATES + 1];
43};
44
45/**
46 * @brief Structure used to store information for each beacon/probe response
47 */
48struct bss_descriptor {
49 u8 bssid[ETH_ALEN];
50
51 u8 ssid[IEEE80211_MAX_SSID_LEN + 1];
52 u8 ssid_len;
53
54 u16 capability;
55 u32 rssi;
56 u32 channel;
57 u16 beaconperiod;
58 __le16 atimwindow;
59
60 /* IW_MODE_AUTO, IW_MODE_ADHOC, IW_MODE_INFRA */
61 u8 mode;
62
63 /* zero-terminated array of supported data rates */
64 u8 rates[MAX_RATES + 1];
65
66 unsigned long last_scanned;
67
68 union ieee_phy_param_set phy;
69 union ieee_ss_param_set ss;
70
71 u8 wpa_ie[MAX_WPA_IE_LEN];
72 size_t wpa_ie_len;
73 u8 rsn_ie[MAX_WPA_IE_LEN];
74 size_t rsn_ie_len;
75
76 u8 mesh;
77
78 struct list_head list;
79};
80
81/** Association request
82 *
83 * Encapsulates all the options that describe a specific assocation request
84 * or configuration of the wireless card's radio, mode, and security settings.
85 */
86struct assoc_request {
87#define ASSOC_FLAG_SSID 1
88#define ASSOC_FLAG_CHANNEL 2
89#define ASSOC_FLAG_BAND 3
90#define ASSOC_FLAG_MODE 4
91#define ASSOC_FLAG_BSSID 5
92#define ASSOC_FLAG_WEP_KEYS 6
93#define ASSOC_FLAG_WEP_TX_KEYIDX 7
94#define ASSOC_FLAG_WPA_MCAST_KEY 8
95#define ASSOC_FLAG_WPA_UCAST_KEY 9
96#define ASSOC_FLAG_SECINFO 10
97#define ASSOC_FLAG_WPA_IE 11
98 unsigned long flags;
99
100 u8 ssid[IEEE80211_MAX_SSID_LEN + 1];
101 u8 ssid_len;
102 u8 channel;
103 u8 band;
104 u8 mode;
105 u8 bssid[ETH_ALEN] __attribute__ ((aligned (2)));
106
107 /** WEP keys */
108 struct enc_key wep_keys[4];
109 u16 wep_tx_keyidx;
110
111 /** WPA keys */
112 struct enc_key wpa_mcast_key;
113 struct enc_key wpa_unicast_key;
114
115 struct lbs_802_11_security secinfo;
116
117 /** WPA Information Elements*/
118 u8 wpa_ie[MAX_WPA_IE_LEN];
119 u8 wpa_ie_len;
120
121 /* BSS to associate with for infrastructure of Ad-Hoc join */
122 struct bss_descriptor bss;
123};
124
125
126extern u8 lbs_bg_rates[MAX_RATES];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200127
Holger Schurig10078322007-11-15 18:05:47 -0500128void lbs_association_worker(struct work_struct *work);
David Woodhouseaa21c002007-12-08 20:04:36 +0000129struct assoc_request *lbs_get_association_request(struct lbs_private *priv);
Luis Carlos Cobo Rusb8bedef2007-05-30 12:14:34 -0400130
Dan Williamsf5fe1fd2008-08-21 21:46:59 -0400131int lbs_adhoc_stop(struct lbs_private *priv);
132
Holger Schurig697900a2008-04-02 16:27:10 +0200133int lbs_cmd_80211_deauthenticate(struct lbs_private *priv,
Dan Williams191bb402008-08-21 17:46:18 -0400134 u8 bssid[ETH_ALEN], u16 reason);
Holger Schurig697900a2008-04-02 16:27:10 +0200135
Holger Schurig10078322007-11-15 18:05:47 -0500136#endif /* _LBS_ASSOC_H */