2 * hostapd / Initialization and configuration
3 * Host AP kernel driver
4 * Copyright (c) 2002-2008, Jouni Malinen <j@w1.fi>
5 * Copyright (c) 2007-2008, Intel Corporation
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * Alternatively, this software may be distributed under the terms of BSD
14 * See README and COPYING for more details.
30 #define ETH_P_ALL 0x0003
33 #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
34 #endif /* ETH_P_PAE */
36 #define ETH_P_EAPOL ETH_P_PAE
37 #endif /* ETH_P_EAPOL */
40 #define ETH_P_RRB 0x890D
41 #endif /* ETH_P_RRB */
49 #define MAX_VLAN_ID 4094
58 struct ieee80211_hdr {
65 /* followed by 'u8 addr4[6];' if ToDS and FromDS is set in data frame
73 #define IEEE80211_DA_FROMDS addr1
74 #define IEEE80211_BSSID_FROMDS addr2
75 #define IEEE80211_SA_FROMDS addr3
77 #define IEEE80211_HDRLEN (sizeof(struct ieee80211_hdr))
79 #define IEEE80211_FC(type, stype) host_to_le16((type << 2) | (stype << 4))
81 /* MTU to be set for the wlan#ap device; this is mainly needed for IEEE 802.1X
82 * frames that might be longer than normal default MTU and they are not
84 #define HOSTAPD_MTU 2290
86 extern unsigned char rfc1042_header[6];
88 struct hostap_sta_driver_data {
89 unsigned long rx_packets, tx_packets, rx_bytes, tx_bytes;
90 unsigned long current_tx_rate;
91 unsigned long inactive_msec;
93 unsigned long num_ps_buf_frames;
94 unsigned long tx_retry_failed;
95 unsigned long tx_retry_count;
100 struct wpa_driver_ops;
102 struct radius_server_data;
104 #ifdef CONFIG_FULL_DYNAMIC_VLAN
105 struct full_dynamic_vlan;
106 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
109 * struct hostapd_data - hostapd per-BSS data structure
111 struct hostapd_data {
112 struct hostapd_iface *iface;
113 struct hostapd_config *iconf;
114 struct hostapd_bss_config *conf;
115 int interface_added; /* virtual interface added for this BSS */
117 u8 own_addr[ETH_ALEN];
119 int num_sta; /* number of entries in sta_list */
120 struct sta_info *sta_list; /* STA info list head */
121 struct sta_info *sta_hash[STA_HASH_SIZE];
123 /* pointers to STA info; based on allocated AID or NULL if AID free
124 * AID is in the range 1-2007, so sta_aid[0] corresponders to AID 1
127 struct sta_info *sta_aid[MAX_AID_TABLE_SIZE];
129 const struct wpa_driver_ops *driver;
133 u8 default_wep_key_idx;
135 struct radius_client_data *radius;
136 int radius_client_reconfigured;
137 u32 acct_session_id_hi, acct_session_id_lo;
139 struct iapp_data *iapp;
141 struct hostapd_cached_radius_acl *acl_cache;
142 struct hostapd_acl_query_data *acl_queries;
144 struct wpa_authenticator *wpa_auth;
145 struct eapol_authenticator *eapol_auth;
147 struct rsn_preauth_interface *preauth_iface;
148 time_t michael_mic_failure;
149 int michael_mic_failures;
150 int tkip_countermeasures;
153 struct wpa_ctrl_dst *ctrl_dst;
156 void *eap_sim_db_priv;
157 struct radius_server_data *radius_srv;
159 int parameter_set_count;
161 #ifdef CONFIG_FULL_DYNAMIC_VLAN
162 struct full_dynamic_vlan *full_dynamic_vlan;
163 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
165 struct l2_packet_data *l2;
166 struct wps_context *wps;
170 size_t wps_beacon_ie_len;
171 u8 *wps_probe_resp_ie;
172 size_t wps_probe_resp_ie_len;
173 #endif /* CONFIG_WPS */
178 * struct hostapd_iface - hostapd per-interface data structure
180 struct hostapd_iface {
182 struct hostapd_config *conf;
185 struct hostapd_data **bss;
187 int num_ap; /* number of entries in ap_list */
188 struct ap_info *ap_list; /* AP info list head */
189 struct ap_info *ap_hash[STA_HASH_SIZE];
190 struct ap_info *ap_iter_list;
192 struct hostapd_hw_modes *hw_features;
194 struct hostapd_hw_modes *current_mode;
195 /* Rates that are currently used (i.e., filtered copy of
196 * current_mode->channels */
198 struct hostapd_rate_data *current_rates;
202 /* Number of associated Non-ERP stations (i.e., stations using 802.11b
206 /* Number of associated stations that do not support Short Slot Time */
207 int num_sta_no_short_slot_time;
209 /* Number of associated stations that do not support Short Preamble */
210 int num_sta_no_short_preamble;
212 int olbc; /* Overlapping Legacy BSS Condition */
214 /* Number of HT associated stations that do not support greenfield */
215 int num_sta_ht_no_gf;
217 /* Number of associated non-HT stations */
220 /* Number of HT associated stations 20 MHz */
221 int num_sta_ht_20mhz;
223 /* Overlapping BSS information */
226 #ifdef CONFIG_IEEE80211N
228 #endif /* CONFIG_IEEE80211N */
231 void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
233 int hostapd_reload_config(struct hostapd_iface *iface);
235 #endif /* HOSTAPD_H */