summaryrefslogtreecommitdiffstats
path: root/meta/packages/wpa-supplicant
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/wpa-supplicant')
-rw-r--r--meta/packages/wpa-supplicant/files/defaults-sane8
-rw-r--r--meta/packages/wpa-supplicant/files/defconfig157
-rw-r--r--meta/packages/wpa-supplicant/files/defconfig-gnutls176
-rw-r--r--meta/packages/wpa-supplicant/files/driver-hermes.patch889
-rwxr-xr-xmeta/packages/wpa-supplicant/files/init.sh50
-rw-r--r--meta/packages/wpa-supplicant/files/madwifi-bsd-fix.diff12
-rw-r--r--meta/packages/wpa-supplicant/files/mtx-1/defconfig157
-rw-r--r--meta/packages/wpa-supplicant/files/openmn/defaults8
-rw-r--r--meta/packages/wpa-supplicant/files/slugos/defaults-sane8
-rw-r--r--meta/packages/wpa-supplicant/files/use-channel.patch32
-rw-r--r--meta/packages/wpa-supplicant/files/wpa_supplicant.conf502
-rw-r--r--meta/packages/wpa-supplicant/files/wpa_supplicant.conf-sane7
-rw-r--r--meta/packages/wpa-supplicant/files/wpa_supplicant_default.conf13
-rw-r--r--meta/packages/wpa-supplicant/wpa-supplicant-0.4.7/defconfig160
-rw-r--r--meta/packages/wpa-supplicant/wpa-supplicant-0.4.7/driver-hermes.patch884
-rw-r--r--meta/packages/wpa-supplicant/wpa-supplicant-0.4.7/driver-zd1211.patch535
-rw-r--r--meta/packages/wpa-supplicant/wpa-supplicant-0.4.7/madwifi-bsd-fix.diff12
-rw-r--r--meta/packages/wpa-supplicant/wpa-supplicant-0.4.7/wpa_supplicant.conf502
-rw-r--r--meta/packages/wpa-supplicant/wpa-supplicant-nossl/wpa-defconfig4
-rw-r--r--meta/packages/wpa-supplicant/wpa-supplicant-nossl_0.2.6.bb7
-rw-r--r--meta/packages/wpa-supplicant/wpa-supplicant-ssl/wpa-defconfig15
-rw-r--r--meta/packages/wpa-supplicant/wpa-supplicant-ssl_0.2.6.bb9
-rw-r--r--meta/packages/wpa-supplicant/wpa-supplicant_0.2.6.inc34
-rw-r--r--meta/packages/wpa-supplicant/wpa-supplicant_0.3.6.bb34
-rw-r--r--meta/packages/wpa-supplicant/wpa-supplicant_0.3.8.bb36
-rw-r--r--meta/packages/wpa-supplicant/wpa-supplicant_0.4.7.bb38
-rw-r--r--meta/packages/wpa-supplicant/wpa-supplicant_0.5.1.bb58
-rw-r--r--meta/packages/wpa-supplicant/wpa-supplicant_cvs.bb59
28 files changed, 4406 insertions, 0 deletions
diff --git a/meta/packages/wpa-supplicant/files/defaults-sane b/meta/packages/wpa-supplicant/files/defaults-sane
new file mode 100644
index 0000000000..67c4cbddf8
--- /dev/null
+++ b/meta/packages/wpa-supplicant/files/defaults-sane
@@ -0,0 +1,8 @@
1# Useful flags:
2# -i <ifname> Interface (required, unless specified in config)
3# -D <driver> Wireless Driver
4# -d Debugging (-dd for more)
5# -q Quiet (-qq for more)
6
7CONFIG="/etc/wpa_supplicant.conf"
8OPTIONS="-i eth1 -D wext"
diff --git a/meta/packages/wpa-supplicant/files/defconfig b/meta/packages/wpa-supplicant/files/defconfig
new file mode 100644
index 0000000000..c165343399
--- /dev/null
+++ b/meta/packages/wpa-supplicant/files/defconfig
@@ -0,0 +1,157 @@
1# This file lists the configuration options that are used when building the
2# hostapd binary. All lines starting with # are ignored. Configuration option
3# lines must be commented out complete, if they are not to be included, i.e.,
4# just setting VARIABLE=n is not disabling that variable.
5#
6# This file is included in Makefile, so variables like CFLAGS and LIBS can also
7# be modified from here. In most cass, these lines should use += in order not
8# to override previous values of the variables.
9
10CFLAGS = $(TARGET_CFLAGS) -I../hostapd -I../utils -I../driver/modules -Wall -MMD
11
12# for wpa_supplicant, wpa_cli
13LIBS = $(TARGET_LDFLAGS)
14
15# for wpa_passphrase:
16LIBS_p = $(TARGET_LDFLAGS)
17
18
19# Uncomment following two lines and fix the paths if you have installed openssl
20# in non-default location
21#CFLAGS += -I/usr/local/openssl/include
22#LIBS += -L/usr/local/openssl/lib
23
24# Example configuration for various cross-compilation platforms
25
26#### sveasoft (e.g., for Linksys WRT54G) ######################################
27#CC=mipsel-uclibc-gcc
28#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc
29#CFLAGS += -Os
30#CPPFLAGS += -I../src/include -I../../src/router/openssl/include
31#LIBS += -L/opt/brcm/hndtools-mipsel-uclibc-0.9.19/lib -lssl
32###############################################################################
33
34#### openwrt (e.g., for Linksys WRT54G) #######################################
35#CC=mipsel-uclibc-gcc
36#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc
37#CFLAGS += -Os
38#CPPFLAGS=-I../src/include -I../openssl-0.9.7d/include \
39# -I../WRT54GS/release/src/include
40#LIBS = -lssl
41###############################################################################
42
43
44# Driver interface for Host AP driver
45CONFIG_DRIVER_HOSTAP=y
46
47# Driver interface for Agere driver
48CONFIG_DRIVER_HERMES=y
49
50# Driver interface for madwifi driver
51#CONFIG_DRIVER_MADWIFI=y
52# Change include directories to match with the local setup
53#CFLAGS += -I../madwifi/wpa
54
55# Driver interface for Prism54 driver
56#CONFIG_DRIVER_PRISM54=y
57
58# Driver interface for ndiswrapper
59#CONFIG_DRIVER_NDISWRAPPER=y
60
61# Driver interface for Atmel driver
62#CONFIG_DRIVER_ATMEL=y
63
64# Driver interface for Broadcom driver
65#CONFIG_DRIVER_BROADCOM=y
66# Example path for wlioctl.h; change to match your configuration
67#CFLAGS += -I/opt/WRT54GS/release/src/include
68
69# Driver interface for Intel ipw2100 driver
70#CONFIG_DRIVER_IPW2100=y
71
72# Driver interface for generic Linux wireless extensions
73CONFIG_DRIVER_WEXT=y
74
75# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
76#CONFIG_DRIVER_BSD=y
77#CFLAGS += -I/usr/local/include
78#LIBS += -L/usr/local/lib
79
80# Driver interface for Windows NDIS
81#CONFIG_DRIVER_NDIS=y
82#CFLAGS += -I/usr/include/w32api/ddk
83#LIBS += -L/usr/local/lib
84# For native build using mingw
85#CONFIG_NATIVE_WINDOWS=y
86# Additional directories for cross-compilation on Linux host for mingw target
87#CFLAGS += -I/opt/mingw/mingw32/include/ddk
88#LIBS += -L/opt/mingw/mingw32/lib
89#CC=mingw32-gcc
90
91# Driver interface for development testing
92#CONFIG_DRIVER_TEST=y
93
94# Enable IEEE 802.1X Supplicant (automatically included if any EAP method is
95# included)
96CONFIG_IEEE8021X_EAPOL=y
97
98# EAP-MD5 (automatically included if EAP-TTLS is enabled)
99CONFIG_EAP_MD5=y
100
101# EAP-MSCHAPv2 (automatically included if EAP-PEAP is enabled)
102CONFIG_EAP_MSCHAPV2=y
103
104# EAP-TLS
105CONFIG_EAP_TLS=y
106
107# EAL-PEAP
108CONFIG_EAP_PEAP=y
109
110# EAP-TTLS
111CONFIG_EAP_TTLS=y
112
113# EAP-GTC
114CONFIG_EAP_GTC=y
115
116# EAP-OTP
117CONFIG_EAP_OTP=y
118
119# EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used)
120#CONFIG_EAP_SIM=y
121
122# EAP-PSK (experimental; this is _not_ needed for WPA-PSK)
123#CONFIG_EAP_PSK=y
124
125# LEAP
126CONFIG_EAP_LEAP=y
127
128# EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used)
129#CONFIG_EAP_AKA=y
130
131# PKCS#12 (PFX) support (used to read private key and certificate file from
132# a file that usually has extension .p12 or .pfx)
133CONFIG_PKCS12=y
134
135# PC/SC interface for smartcards (USIM, GSM SIM)
136# Enable this if EAP-SIM or EAP-AKA is included
137#CONFIG_PCSC=y
138
139# Development testing
140#CONFIG_EAPOL_TEST=y
141
142# Replace native Linux implementation of packet sockets with libdnet/libpcap.
143# This will be automatically set for non-Linux OS.
144#CONFIG_DNET_PCAP=y
145
146# Include control interface for external programs, e.g, wpa_cli
147CONFIG_CTRL_IFACE=y
148
149# Include interface for using external supplicant (Xsupplicant) for EAP
150# authentication
151#CONFIG_XSUPPLICANT_IFACE=y
152
153# Include support for GNU Readline and History Libraries in wpa_cli.
154# When building a wpa_cli binary for distribution, please note that these
155# libraries are licensed under GPL and as such, BSD license may not apply for
156# the resulting binary.
157#CONFIG_READLINE=y
diff --git a/meta/packages/wpa-supplicant/files/defconfig-gnutls b/meta/packages/wpa-supplicant/files/defconfig-gnutls
new file mode 100644
index 0000000000..2df5e51df8
--- /dev/null
+++ b/meta/packages/wpa-supplicant/files/defconfig-gnutls
@@ -0,0 +1,176 @@
1# This file lists the configuration options that are used when building the
2# hostapd binary. All lines starting with # are ignored. Configuration option
3# lines must be commented out complete, if they are not to be included, i.e.,
4# just setting VARIABLE=n is not disabling that variable.
5#
6# This file is included in Makefile, so variables like CFLAGS and LIBS can also
7# be modified from here. In most cass, these lines should use += in order not
8# to override previous values of the variables.
9
10CFLAGS = $(TARGET_CFLAGS) -I../hostapd -I../utils -I../driver/modules -Wall -MMD
11LIBS = $(TARGET_LDFLAGS)
12
13# Driver interface for Host AP driver
14CONFIG_DRIVER_HOSTAP=y
15
16# Driver interface for Agere driver
17#CONFIG_DRIVER_HERMES=n
18
19# Driver interface for madwifi driver
20#CONFIG_DRIVER_MADWIFI=y
21
22# Driver interface for Prism54 driver
23#CONFIG_DRIVER_PRISM54=y
24
25# Driver interface for ndiswrapper
26#CONFIG_DRIVER_NDISWRAPPER=y
27
28# Driver interface for Atmel driver
29#CONFIG_DRIVER_ATMEL=y
30
31# Driver interface for Broadcom driver
32#CONFIG_DRIVER_BROADCOM=y
33
34# Driver interface for Intel ipw2100 driver
35#CONFIG_DRIVER_IPW2100=y
36
37# Driver interface for generic Linux wireless extensions
38CONFIG_DRIVER_WEXT=y
39
40# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
41#CONFIG_DRIVER_BSD=y
42#CFLAGS += -I/usr/local/include
43#LIBS += -L/usr/local/lib
44
45# Driver interface for development testing
46#CONFIG_DRIVER_TEST=y
47
48# Driver interface for wired Ethernet drivers
49CONFIG_DRIVER_WIRED=y
50
51# Enable IEEE 802.1X Supplicant (automatically included if any EAP method is
52# included)
53CONFIG_IEEE8021X_EAPOL=y
54
55# EAP-MD5 (automatically included if EAP-TTLS is enabled)
56CONFIG_EAP_MD5=y
57
58# EAP-MSCHAPv2 (automatically included if EAP-PEAP is enabled)
59CONFIG_EAP_MSCHAPV2=y
60
61# EAP-TLS
62CONFIG_EAP_TLS=y
63
64# EAL-PEAP
65CONFIG_EAP_PEAP=y
66
67# EAP-TTLS
68CONFIG_EAP_TTLS=y
69
70# EAP-GTC
71CONFIG_EAP_GTC=y
72
73# EAP-OTP
74CONFIG_EAP_OTP=y
75
76# EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used)
77#CONFIG_EAP_SIM=y
78
79# EAP-PSK (experimental; this is _not_ needed for WPA-PSK)
80#CONFIG_EAP_PSK=y
81
82# EAP-PAX
83#CONFIG_EAP_PAX=y
84
85# LEAP
86CONFIG_EAP_LEAP=y
87
88# EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used)
89#CONFIG_EAP_AKA=y
90
91# PKCS#12 (PFX) support (used to read private key and certificate file from
92# a file that usually has extension .p12 or .pfx)
93CONFIG_PKCS12=y
94
95# Smartcard support (i.e., private key on a smartcard), e.g., with openssl
96# engine.
97CONFIG_SMARTCARD=y
98
99# PC/SC interface for smartcards (USIM, GSM SIM)
100# Enable this if EAP-SIM or EAP-AKA is included
101#CONFIG_PCSC=y
102
103# Development testing
104#CONFIG_EAPOL_TEST=y
105
106# Replace native Linux implementation of packet sockets with libdnet/libpcap.
107# This will be automatically set for non-Linux OS.
108#CONFIG_DNET_PCAP=y
109
110# Include control interface for external programs, e.g, wpa_cli
111CONFIG_CTRL_IFACE=y
112
113# Include support for GNU Readline and History Libraries in wpa_cli.
114# When building a wpa_cli binary for distribution, please note that these
115# libraries are licensed under GPL and as such, BSD license may not apply for
116# the resulting binary.
117#CONFIG_READLINE=y
118
119# Remove debugging code that is printing out debug message to stdout.
120# This can be used to reduce the size of the wpa_supplicant considerably
121# if debugging code is not needed. The size reduction can be around 35%
122# (e.g., 90 kB).
123#CONFIG_NO_STDOUT_DEBUG=y
124
125# Remove WPA support, e.g., for wired-only IEEE 802.1X supplicant, to save
126# 35-50 kB in code size.
127#CONFIG_NO_WPA=y
128
129# Select configuration backend:
130# file = text file (e.g., wpa_supplicant.conf)
131# winreg = Windows registry (see win_example.reg for an example)
132CONFIG_BACKEND=file
133
134# Select program entry point implementation:
135# main = UNIX/POSIX like main() function (default)
136# main_winsvc = Windows service (read parameters from registry)
137# main_none = Very basic example (development use only)
138#CONFIG_MAIN=main
139
140# Select wrapper for operatins system and C library specific functions
141# unix = UNIX/POSIX like systems (default)
142# win32 = Windows systems
143# none = Empty template
144#CONFIG_OS=unix
145
146# Select event loop implementation
147# eloop = select() loop (default)
148# eloop_win = Windows events and WaitForMultipleObject() loop
149# eloop_none = Empty template
150#CONFIG_ELOOP=eloop
151
152# Select layer 2 packet implementation
153# linux = Linux packet socket (default)
154# pcap = libpcap/libdnet/WinPcap
155# freebsd = FreeBSD libpcap
156# winpcap = WinPcap with receive thread
157# none = Empty template
158#CONFIG_L2_PACKET=linux
159
160# IEEE 802.11i/IEEE 802.11e STAKey negotiation for direct link connection
161#CONFIG_STAKEY=y
162
163# Select TLS implementation
164# openssl = OpenSSL (default)
165# gnutls = GnuTLS (needed for TLS/IA, see also CONFIG_GNUTLS_EXTRA)
166# none = Empty template
167CONFIG_TLS=gnutls
168
169# Whether to enable TLS/IA support, which is required for EAP-TTLSv1.
170# You need CONFIG_TLS=gnutls for this to have any effect. Please note that
171# even though the core GnuTLS library is released under LGPL, this extra
172# library uses GPL and as such, the terms of GPL apply to the combination
173# of wpa_supplicant and GnuTLS if this option is enabled. BSD license may not
174# apply for distribution of the resulting binary.
175CONFIG_GNUTLS_EXTRA=y
176
diff --git a/meta/packages/wpa-supplicant/files/driver-hermes.patch b/meta/packages/wpa-supplicant/files/driver-hermes.patch
new file mode 100644
index 0000000000..ad96db32c1
--- /dev/null
+++ b/meta/packages/wpa-supplicant/files/driver-hermes.patch
@@ -0,0 +1,889 @@
1
2#
3# Patch managed by http://www.holgerschurig.de/patcher.html
4#
5
6--- /dev/null
7+++ wpa_supplicant/driver_hermes.c
8@@ -0,0 +1,705 @@
9+/*
10+ * WPA Supplicant - testing driver interface
11+ * Copyright (c) 2004-2005, Jouni Malinen <jkmaline@cc.hut.fi>
12+ *
13+ * This program is free software; you can redistribute it and/or modify
14+ * it under the terms of the GNU General Public License version 2 as
15+ * published by the Free Software Foundation.
16+ *
17+ * Alternatively, this software may be distributed under the terms of BSD
18+ * license.
19+ *
20+ * See README and COPYING for more details.
21+ */
22+
23+#include <stdlib.h>
24+#include <stdio.h>
25+#include <unistd.h>
26+#include <string.h>
27+#include <sys/ioctl.h>
28+#include <errno.h>
29+#include <net/if_arp.h>
30+
31+#include "wireless_copy.h"
32+#include "common.h"
33+#include "driver.h"
34+
35+#include "eloop.h"
36+#include "wpa_supplicant.h"
37+#include "priv_netlink.h"
38+
39+#include "hostap_common.h"
40+#include "driver_wext.h"
41+#include "driver_hermes.h"
42+
43+
44+
45+/* Enumeration for supported Hermes Types */
46+enum
47+{
48+ WL_HERMES_UNKNOWN = 0,
49+ WL_HERMES_1 = 1,
50+ WL_HERMES_2 = 2,
51+ WL_HERMES_25 = 3
52+};
53+
54+
55+
56+
57+struct wpa_driver_hermes_data {
58+ void *wext; /* private data for driver_wext */
59+ void *ctx;
60+ char ifname[IFNAMSIZ + 1];
61+ int sock;
62+ int type;
63+};
64+
65+
66+
67+/****************************************************************************/
68+/* */
69+/* Routines for basic device access to Agere Hermes-I/Hermes-II via the UIL */
70+/* */
71+/****************************************************************************/
72+
73+IFBP _connect(void *priv)
74+{
75+ struct wpa_driver_hermes_data *drv = priv;
76+ int result = 0;
77+ IFBP ifbp = NULL;
78+ struct uilreq urq;
79+
80+ //wpa_printf(MSG_DEBUG, "%s: %s %d", __FUNCTION__, drv->ifname, drv->sock);
81+
82+ memset(&urq, 0, sizeof(urq));
83+
84+ strcpy(urq.ifr_name, drv->ifname);
85+ urq.command = UIL_FUN_CONNECT;
86+
87+ result = ioctl(drv->sock, WVLAN2_IOCTL_UIL, &urq);
88+ if (result == 0 && urq.result == UIL_SUCCESS) {
89+ ifbp = urq.hcfCtx;
90+ } else {
91+ wpa_printf(MSG_DEBUG, "%s: could not set IFBP, result %d", __FUNCTION__, result);
92+ }
93+
94+ return ifbp;
95+}
96+
97+
98+void _disconnect(void *priv, IFBP ifbp)
99+{
100+ struct wpa_driver_hermes_data *drv = priv;
101+ int result = 0;
102+ struct uilreq urq;
103+
104+ //wpa_printf(MSG_DEBUG, "%s: %s", __FUNCTION__, drv->ifname);
105+
106+ if (ifbp != NULL) {
107+ memset(&urq, 0, sizeof(struct uilreq));
108+
109+ strcpy(urq.ifr_name, drv->ifname);
110+ urq.command = UIL_FUN_DISCONNECT;
111+ urq.hcfCtx = ifbp;
112+
113+ result = ioctl(drv->sock, WVLAN2_IOCTL_UIL, &urq);
114+
115+ if (result != 0 || urq.result != UIL_SUCCESS) {
116+ wpa_printf( MSG_WARNING, "wl_disconnect(): ioctl() failed, errno: %d", errno );
117+ wpa_printf( MSG_WARNING, "wl_disconnect(): urq.result: %d", urq.result );
118+ }
119+ } else {
120+ wpa_printf(MSG_WARNING, "wl_disconnect(): called with NULL ifbp");
121+ }
122+
123+ return;
124+}
125+
126+int _get_info(void *priv, ltv_t *ltv)
127+{
128+ struct wpa_driver_hermes_data *drv = priv;
129+ int result = 0;
130+ IFBP ifbp = NULL;
131+ struct uilreq urq;
132+
133+ //wpa_printf(MSG_DEBUG, "%s: %s", __FUNCTION__, drv->ifname);
134+
135+ /* First, connect to the device */
136+ ifbp = _connect(priv);
137+ if (ifbp != NULL && ltv != NULL) {
138+ memset(&urq, 0, sizeof(struct uilreq));
139+
140+ strcpy(urq.ifr_name, drv->ifname);
141+ urq.hcfCtx = ifbp;
142+ urq.command = UIL_FUN_GET_INFO;
143+ urq.len = sizeof(ltv_t);
144+ urq.data = ltv;
145+
146+ result = ioctl(drv->sock, WVLAN2_IOCTL_UIL, &urq);
147+
148+ if (result != 0 || urq.result != UIL_SUCCESS) {
149+ wpa_printf(MSG_WARNING, "wl_disconnect(): ioctl() failed, errno: %d", errno);
150+ wpa_printf(MSG_WARNING, "wl_disconnect(): urq.result: %d", urq.result);
151+ }
152+ _disconnect(priv, ifbp);
153+ } else {
154+ wpa_printf( MSG_WARNING, "Could not connect to the device, or LTV NULL");
155+ result = -1;
156+ }
157+
158+ return result;
159+}
160+
161+int _put_info(void *priv, ltv_t *ltv)
162+{
163+ struct wpa_driver_hermes_data *drv = priv;
164+ int result = 0;
165+ IFBP ifbp = NULL;
166+ struct uilreq urq;
167+
168+ //wpa_printf(MSG_DEBUG, "%s: %s", __FUNCTION__, drv->ifname);
169+
170+ /* First, connect to the device */
171+ ifbp = _connect(priv);
172+ if (ifbp != NULL && ltv != NULL) {
173+ memset(&urq, 0, sizeof(struct uilreq));
174+
175+ strcpy(urq.ifr_name, drv->ifname);
176+ urq.hcfCtx = ifbp;
177+ urq.command = UIL_FUN_PUT_INFO;
178+ urq.len = sizeof( ltv_t );
179+ urq.data = ltv;
180+
181+ result = ioctl(drv->sock, WVLAN2_IOCTL_UIL, &urq);
182+
183+ if (result != 0 || urq.result != UIL_SUCCESS) {
184+ wpa_printf(MSG_WARNING, "_put_info(): ioctl() failed, errno: %d", errno);
185+ wpa_printf(MSG_WARNING, "_put_info(): urq.result: %d", urq.result);
186+ }
187+
188+ _disconnect(priv, ifbp);
189+ } else {
190+ wpa_printf(MSG_WARNING, "%s: could not connect to the device, or LTV NULL", __FUNCTION__ );
191+ result = -1;
192+ }
193+
194+ return result;
195+}
196+
197+
198+static void _detect_hermes_type(void *priv)
199+{
200+ struct wpa_driver_hermes_data *drv = priv;
201+ CFG_FW_IDENTITY_STRCT *fw_id;
202+ ltv_t ltv;
203+ int result;
204+
205+ //wpa_printf(MSG_DEBUG, "%s", __FUNCTION__);
206+
207+ drv->type = WL_HERMES_UNKNOWN;
208+
209+ if (drv->sock >= 0) {
210+ fw_id = (CFG_FW_IDENTITY_STRCT *)&ltv;
211+ fw_id->len = ( sizeof(CFG_FW_IDENTITY_STRCT) / sizeof( hcf_16 )) - 1;
212+ fw_id->typ = CFG_FW_IDENTITY;
213+
214+ result = _get_info(priv, (ltv_t *)fw_id);
215+ if (result == HCF_SUCCESS) {
216+ //wpa_printf(MSG_DEBUG, "PRI CompID : %d", fw_id->comp_id);
217+ //wpa_printf(MSG_DEBUG, "PRI Variant : %d", fw_id->variant);
218+ //wpa_printf(MSG_DEBUG, "PRI Version : %d.%02d", fw_id->version_major, fw_id->version_minor);
219+
220+ switch(fw_id->comp_id) {
221+ case COMP_ID_FW_STA:
222+ switch (fw_id->variant) {
223+ case 1:
224+ case 2:
225+ wpa_printf(MSG_DEBUG, "found Hermes 1 STA");
226+ drv->type = WL_HERMES_1;
227+ break;
228+
229+ case 3:
230+ wpa_printf(MSG_DEBUG, "found Hermes 2 STA");
231+ drv->type = WL_HERMES_2;
232+ break;
233+ case 4:
234+ wpa_printf(MSG_DEBUG, "found Hermes 2.5 STA");
235+ drv->type = WL_HERMES_25;
236+ break;
237+ }
238+ break;
239+
240+ case COMP_ID_FW_AP:
241+ switch (fw_id->variant) {
242+ case 1:
243+ wpa_printf(MSG_DEBUG, "found Hermes 1 AP");
244+ drv->type = WL_HERMES_1;
245+ break;
246+
247+ case 2:
248+ wpa_printf(MSG_DEBUG, "found Hermes 2 AP" );
249+ drv->type = WL_HERMES_2;
250+ break;
251+ }
252+ break;
253+
254+ default:
255+ wpa_printf(MSG_WARNING, "could not detect Hermes type!");
256+ break;
257+ }
258+ }
259+ }
260+}
261+
262+
263+
264+/****************************************************************************/
265+
266+
267+static int wpa_driver_hermes_set_wpa_ie(void *priv, const char *wpa_ie,
268+ size_t wpa_ie_len)
269+{
270+ struct wpa_driver_hermes_data *drv = priv;
271+ ltv_t ltv;
272+
273+ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__);
274+
275+ ltv.len = 2;
276+ ltv.typ = CFG_SET_WPA_AUTH_KEY_MGMT_SUITE;
277+
278+ switch(drv->type) {
279+ case WL_HERMES_1:
280+ ltv.u.u16[0] = 2;
281+ break;
282+
283+ case WL_HERMES_2:
284+ case WL_HERMES_25:
285+ ltv.u.u16[0] = 4;
286+ break;
287+
288+ default:
289+ ltv.u.u16[0] = 0;
290+ break;
291+ }
292+
293+ return _put_info(priv, &ltv);
294+}
295+
296+
297+static int wpa_driver_hermes_set_wpa(void *priv, int enabled)
298+{
299+ ltv_t ltv;
300+
301+ wpa_printf(MSG_DEBUG, "%s: enabled=%d", __func__, enabled);
302+
303+ ltv.len = 2;
304+ ltv.typ = CFG_CNF_ENCRYPTION;
305+ ltv.u.u16[0] = enabled ? 2 : 0; /* Setting CFG_CNF_ENCRYPTION to 2 sets WPA: TKIP or better */
306+
307+ return _put_info(priv, &ltv);
308+}
309+
310+
311+static int wpa_driver_hermes_set_key(void *priv, wpa_alg alg,
312+ const u8 *addr, int key_idx,
313+ int set_tx, const u8 *seq, size_t seq_len,
314+ const u8 *key, size_t key_len)
315+{
316+ struct wpa_driver_hermes_data *drv = priv;
317+ int ret = 0;
318+ char *alg_name;
319+ ltv_t ltv;
320+ int count = 0;
321+ int buf_idx = 0;
322+ hcf_8 tsc[] = { 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00 };
323+ hcf_8 rsc[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
324+
325+
326+ switch (alg) {
327+ case WPA_ALG_NONE:
328+ alg_name = "none";
329+ break;
330+ case WPA_ALG_WEP:
331+ alg_name = "WEP";
332+ break;
333+ case WPA_ALG_TKIP:
334+ alg_name = "TKIP";
335+ break;
336+ case WPA_ALG_CCMP:
337+ alg_name = "CCMP";
338+ break;
339+ default:
340+ return -1;
341+ }
342+
343+ wpa_printf(MSG_DEBUG, "%s: alg=%s key_idx=%d set_tx=%d seq_len=%d "
344+ "key_len=%d", __FUNCTION__, alg_name, key_idx, set_tx,
345+ seq_len, key_len);
346+
347+ if (seq_len > IW_ENCODE_SEQ_MAX_SIZE) {
348+ wpa_printf(MSG_DEBUG, "%s: Invalid seq_len %lu", __FUNCTION__, (unsigned long) seq_len);
349+ return -2;
350+ }
351+
352+ /* Check the key index here; if 0, load as Pairwise Key, otherwise, load as
353+ a group key. Note that for the Hermes, the RIDs for group/pairwise keys
354+ are different from each other and different than the default WEP keys as
355+ well. */
356+ switch (alg) {
357+ case WPA_ALG_TKIP:
358+ /* Make sure that there is no data queued up in the firmware before
359+ setting the TKIP keys. If this check is not performed, some data
360+ may be sent out with incorrect MIC and cause synchronizarion
361+ errors with the AP */
362+ /* Check every 1ms for 100ms */
363+ for (count = 0; count < 100; count++) {
364+ usleep(1000);
365+
366+ ltv.len = 2;
367+ ltv.typ = 0xFD91; // This RID not defined in HCF yet!!!
368+ ltv.u.u16[0] = 0;
369+
370+ _get_info( priv, &ltv);
371+
372+ if (ltv.u.u16[0] == 0)
373+ break;
374+ }
375+
376+ if (count == 100)
377+ wpa_printf(MSG_DEBUG, "%s: Timed out waiting for TxQ!", __FUNCTION__);
378+
379+
380+ switch (key_idx) {
381+ case 0:
382+ /* Only load key as pairwise key for Hermes-II and II.5. For Hermes-I,
383+ fall through to the next case and load the pairwise key as
384+ a Group Key at index 0. */
385+ if (drv->type == WL_HERMES_2 || drv->type == WL_HERMES_25) {
386+ ltv.len = 28;
387+ ltv.typ = CFG_ADD_TKIP_MAPPED_KEY;
388+
389+ /* Load the BSSID */
390+ memcpy(&ltv.u.u8[buf_idx], addr, ETH_ALEN);
391+ buf_idx += ETH_ALEN;
392+
393+ /* Load the TKIP key */
394+ memcpy(&ltv.u.u8[buf_idx], &key[0], 16);
395+ buf_idx += 16;
396+
397+ /* Load the TSC */
398+ memcpy(&ltv.u.u8[buf_idx], tsc, 8);
399+ buf_idx += 8;
400+
401+ /* Load the RSC */
402+ /* Copy the RSC from the supplicant to a local buffer, because
403+ the RSC doesn't always contain the padding needed */
404+ memcpy(rsc, seq, seq_len);
405+ memcpy(&ltv.u.u8[buf_idx], rsc, 8);
406+ buf_idx += 8;
407+
408+ /* Load the TxMIC key */
409+ memcpy(&ltv.u.u8[buf_idx], &key[16], 8);
410+ buf_idx += 8;
411+
412+ /* Load the RxMIC key */
413+ memcpy(&ltv.u.u8[buf_idx], &key[24], 8);
414+
415+ /* Send the request to the Hermes */
416+ _put_info(priv, &ltv);
417+ break;
418+ }
419+
420+ case 1:
421+ case 2:
422+ case 3:
423+ ltv.len = 26;
424+ ltv.typ = CFG_ADD_TKIP_DEFAULT_KEY;
425+
426+ /* Load the key Index */
427+ ltv.u.u16[buf_idx] = key_idx;
428+
429+ /* If this is a Tx Key, set bit 8000 */
430+ if (set_tx)
431+ ltv.u.u16[buf_idx] |= 0x8000;
432+
433+ buf_idx += 2;
434+
435+ /* Load the RSC */
436+ /* Copy the RSC from the supplicant to a local buffer, because
437+ the RSC doesn't always contain the padding needed */
438+ memcpy(rsc, seq, seq_len);
439+ memcpy(&ltv.u.u8[buf_idx], rsc, 8);
440+ buf_idx += 8;
441+
442+ /* Load the TKIP, TxMIC, and RxMIC keys in one shot, because in
443+ CFG_ADD_TKIP_DEFAULT_KEY they are back-to-back */
444+ memcpy(&ltv.u.u8[buf_idx], key, key_len);
445+ buf_idx += key_len;
446+
447+ /* Load the TSC */
448+ memcpy(&ltv.u.u8[buf_idx], tsc, 8);
449+
450+ /* Send the request to the Hermes */
451+ _put_info(priv, &ltv);
452+ break;
453+
454+ default:
455+ break;
456+ }
457+
458+ break;
459+
460+ case WPA_ALG_WEP:
461+ case WPA_ALG_CCMP:
462+ break;
463+
464+ case WPA_ALG_NONE:
465+ switch (key_idx) {
466+ case 0:
467+ if (drv->type == WL_HERMES_2 || drv->type == WL_HERMES_25) {
468+ /* Only clear a pairwise key for Hermes-II. For Hermes-I,
469+ fall through to the next case and clear the key as a
470+ Group Key at index 0. */
471+ if (addr) {
472+ ltv.len = 7;
473+ ltv.typ = CFG_REMOVE_TKIP_MAPPED_KEY;
474+
475+ memcpy(&ltv.u.u8[0], addr, ETH_ALEN);
476+
477+ _put_info(priv, &ltv);
478+ }
479+ break;
480+ }
481+
482+ case 1:
483+ case 2:
484+ case 3:
485+ /* Clear the Group TKIP keys by index */
486+ ltv.len = 2;
487+ ltv.typ = CFG_REMOVE_TKIP_DEFAULT_KEY;
488+
489+ ltv.u.u16[0] = key_idx;
490+
491+ _put_info(priv, &ltv);
492+ break;
493+
494+ default:
495+ break;
496+ }
497+ break;
498+
499+ default:
500+ break;
501+ }
502+
503+ return ret;
504+}
505+
506+
507+static int wpa_driver_hermes_set_countermeasures(void *priv, int enabled)
508+{
509+ ltv_t ltv;
510+
511+ /* The supplicant handles all the timers related to MIC failure and
512+ countermeasures. When countermeasures are enabled, shut down the card;
513+ when disable, re-enable the card. Make sure that the EAPOL message
514+ is getting out before card disable */
515+
516+ wpa_printf(MSG_DEBUG, "%s: enabled=%d", __FUNCTION__, enabled);
517+
518+ ltv.len = 2;
519+ ltv.typ = CFG_DRIVER_ENABLE;
520+ ltv.u.u16[0] = enabled ? 0 : 1;
521+
522+ return _put_info(priv, &ltv);
523+}
524+
525+
526+static int wpa_driver_hermes_set_drop_unencrypted(void *priv, int enabled)
527+{
528+ ltv_t ltv;
529+
530+ wpa_printf(MSG_DEBUG, "%s: enabled=%d", __FUNCTION__, enabled);
531+
532+ ltv.len = 2;
533+ ltv.typ = CFG_CNF_EXCL_UNENCRYPTED;
534+ ltv.u.u16[0] = enabled;
535+
536+ return _put_info(priv, &ltv);
537+}
538+
539+
540+static int wpa_driver_hermes_deauthenticate(void *priv, const u8 *addr,
541+ int reason_code)
542+{
543+ wpa_printf(MSG_DEBUG, "%s: *DUMMY* %d", __FUNCTION__, reason_code);
544+
545+ return 0;
546+}
547+
548+
549+static int wpa_driver_hermes_disassociate(void *priv, const u8 *addr, int reason_code)
550+{
551+ ltv_t ltv;
552+
553+ wpa_printf(MSG_DEBUG, "%s: reason=%d", __FUNCTION__, reason_code);
554+
555+ ltv.len = 2;
556+ ltv.typ = 0xFCC8; // This RID not defined in HCF yet!!!
557+ memcpy( &ltv.u.u8[0], addr, ETH_ALEN );
558+ ltv.u.u16[ETH_ALEN / 2] = reason_code;
559+
560+ return _put_info( priv, &ltv);
561+}
562+
563+
564+static int wpa_driver_hermes_associate(
565+ void *priv, struct wpa_driver_associate_params *params)
566+{
567+ struct wpa_driver_hermes_data *drv = priv;
568+
569+#if 0
570+ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__);
571+#else
572+ wpa_printf(MSG_DEBUG, "%s: priv=%p freq=%d pairwise_suite=%d "
573+ "group_suite=%d key_mgmt_suite=%d auth_alg=%d mode=%d",
574+ __func__, priv, params->freq, params->pairwise_suite,
575+ params->group_suite, params->key_mgmt_suite,
576+ params->auth_alg, params->mode);
577+ if (params->bssid) {
578+ wpa_printf(MSG_DEBUG, " bssid=" MACSTR,
579+ MAC2STR(params->bssid));
580+ }
581+ if (params->ssid) {
582+ wpa_hexdump_ascii(MSG_DEBUG, " ssid",
583+ params->ssid, params->ssid_len);
584+ }
585+ if (params->wpa_ie) {
586+ wpa_hexdump(MSG_DEBUG, " wpa_ie",
587+ params->wpa_ie, params->wpa_ie_len);
588+ }
589+#endif
590+
591+ if (wpa_driver_hermes_set_wpa_ie(priv, params->wpa_ie, params->wpa_ie_len) < 0)
592+ return -1;
593+ if (wpa_driver_wext_set_freq(drv->wext, params->freq) < 0)
594+ return -1;
595+ if (wpa_driver_wext_set_ssid(drv->wext, params->ssid, params->ssid_len) < 0)
596+ return -1;
597+#ifdef UNSUPPORTED_IN_HERMES_DRIVER
598+ if (wpa_driver_wext_hermes_bssid(drv->wext, params->bssid) < 0)
599+ return -1;
600+#endif
601+
602+ return 0;
603+}
604+
605+
606+static int wpa_driver_hermes_get_bssid(void *priv, u8 *bssid)
607+{
608+ struct wpa_driver_hermes_data *drv = priv;
609+ return wpa_driver_wext_get_bssid(drv->wext, bssid);
610+}
611+
612+
613+static int wpa_driver_hermes_get_ssid(void *priv, u8 *ssid)
614+{
615+ struct wpa_driver_hermes_data *drv = priv;
616+ return wpa_driver_wext_get_ssid(drv->wext, ssid);
617+}
618+
619+
620+static int wpa_driver_hermes_scan(void *priv, const u8 *ssid, size_t ssid_len)
621+{
622+ struct wpa_driver_hermes_data *drv = priv;
623+ return wpa_driver_wext_scan(drv->wext, ssid, ssid_len);
624+}
625+
626+
627+static int wpa_driver_hermes_get_scan_results(void *priv,
628+ struct wpa_scan_result *results,
629+ size_t max_size)
630+{
631+ struct wpa_driver_hermes_data *drv = priv;
632+ return wpa_driver_wext_get_scan_results(drv->wext, results, max_size);
633+}
634+
635+
636+static void * wpa_driver_hermes_init(void *ctx, const char *ifname)
637+{
638+ struct wpa_driver_hermes_data *drv;
639+
640+ wpa_printf(MSG_DEBUG, "%s: %s", __FUNCTION__, ifname);
641+
642+ drv = malloc(sizeof(*drv));
643+ if (drv == NULL)
644+ return NULL;
645+ memset(drv, 0, sizeof(*drv));
646+
647+ /* Initialize wireless context */
648+ drv->wext = wpa_driver_wext_init(ctx, ifname);
649+ if (drv->wext == NULL) {
650+ perror("no wext context");
651+ goto no_wext;
652+ }
653+
654+ drv->ctx = ctx;
655+ strncpy(drv->ifname, ifname, sizeof(drv->ifname));
656+
657+ drv->sock = socket(PF_INET, SOCK_DGRAM, 0);
658+ if (drv->sock < 0) {
659+ perror("socket(PF_INET,SOCK_DGRAM)");
660+ goto no_sock;
661+ }
662+
663+ _detect_hermes_type(drv);
664+
665+ return drv;
666+
667+no_sock:
668+ wpa_driver_wext_deinit(drv->wext);
669+no_wext:
670+ free(drv);
671+ return NULL;
672+}
673+
674+
675+static void wpa_driver_hermes_deinit(void *priv)
676+{
677+ struct wpa_driver_hermes_data *drv = priv;
678+ wpa_driver_wext_deinit(drv->wext);
679+ close(drv->sock);
680+ free(drv);
681+}
682+
683+
684+
685+
686+struct wpa_driver_ops wpa_driver_hermes_ops = {
687+ .name = "hermes",
688+ .desc = "wpa_supplicant hermes driver",
689+
690+ .init = wpa_driver_hermes_init,
691+ .deinit = wpa_driver_hermes_deinit,
692+
693+ // from old driver_hermes.c:
694+ .get_bssid = wpa_driver_hermes_get_bssid,
695+ .get_ssid = wpa_driver_hermes_get_ssid,
696+ .set_wpa = wpa_driver_hermes_set_wpa,
697+ .set_key = wpa_driver_hermes_set_key,
698+ //.events_init = wpa_driver_wext_events_init,
699+ //.events_deinit = wpa_driver_wext_events_deinit,
700+ .set_countermeasures = wpa_driver_hermes_set_countermeasures,
701+ .set_drop_unencrypted = wpa_driver_hermes_set_drop_unencrypted,
702+ .scan = wpa_driver_hermes_scan,
703+ .get_scan_results = wpa_driver_hermes_get_scan_results,
704+ .deauthenticate = wpa_driver_hermes_deauthenticate,
705+ .disassociate = wpa_driver_hermes_disassociate,
706+ .associate = wpa_driver_hermes_associate,
707+
708+
709+#if 0
710+ /* Not possible with current Hermes driver:
711+ .set_auth_alg = wpa_driver_hermes_set_auth_alg, */
712+#endif
713+};
714--- /dev/null
715+++ wpa_supplicant/driver_hermes.h
716@@ -0,0 +1,173 @@
717+#ifndef HERMES_DRIVER_H
718+#define HERMES_DRIVER_H
719+
720+typedef unsigned char hcf_8;
721+typedef unsigned short hcf_16;
722+typedef unsigned long hcf_32;
723+typedef hcf_16 hcf_io;
724+typedef hcf_8 *wci_bufp;
725+
726+typedef struct {
727+ hcf_16 len;
728+ hcf_16 typ;
729+ unsigned short * bufp;
730+} RID_LOG_STRCT;
731+typedef RID_LOG_STRCT *RID_LOGP;
732+
733+typedef struct {
734+ hcf_16 len;
735+ hcf_16 typ;
736+ hcf_16 comp_id;
737+ hcf_16 variant;
738+ hcf_16 version_major;
739+ hcf_16 version_minor;
740+} CFG_FW_IDENTITY_STRCT;
741+
742+typedef struct {
743+ hcf_32 TxUnicastFrames;
744+ hcf_32 TxMulticastFrames;
745+ hcf_32 TxFragments;
746+ hcf_32 TxUnicastOctets;
747+ hcf_32 TxMulticastOctets;
748+ hcf_32 TxDeferredTransmissions;
749+ hcf_32 TxSingleRetryFrames;
750+ hcf_32 TxMultipleRetryFrames;
751+ hcf_32 TxRetryLimitExceeded;
752+ hcf_32 TxDiscards;
753+ hcf_32 RxUnicastFrames;
754+ hcf_32 RxMulticastFrames;
755+ hcf_32 RxFragments;
756+ hcf_32 RxUnicastOctets;
757+ hcf_32 RxMulticastOctets;
758+ hcf_32 RxFCSErrors;
759+ hcf_32 RxDiscardsNoBuffer;
760+ hcf_32 TxDiscardsWrongSA;
761+ hcf_32 RxWEPUndecryptable;
762+ hcf_32 RxMsgInMsgFragments;
763+ hcf_32 RxMsgInBadMsgFragments;
764+ hcf_32 RxDiscardsWEPICVError;
765+ hcf_32 RxDiscardsWEPExcluded;
766+} CFG_HERMES_TALLIES_STRCT;
767+
768+typedef struct {
769+ hcf_32 not_used_NoBufInq;
770+ hcf_32 NoBufInfo;
771+ hcf_32 NoBufMB;
772+ hcf_32 MiscErr;
773+ hcf_32 EngCnt;
774+} CFG_HCF_TALLIES_STRCT;
775+
776+typedef struct {
777+ hcf_io IFB_IOBase;
778+ hcf_16 IFB_IORange;
779+
780+ hcf_32 IFB_TickIni;
781+
782+ hcf_16 IFB_Version;
783+ hcf_16 IFB_CardStat;
784+ hcf_16 IFB_TraceLvl;
785+ hcf_16 *IFB_MBp;
786+ hcf_16 IFB_MBSize;
787+ hcf_16 IFB_MBWp;
788+ hcf_16 IFB_MBRp;
789+ hcf_16 IFB_MBInfoLen;
790+
791+ hcf_16 IFB_DLMode;
792+ hcf_16 IFB_Magic;
793+ hcf_16 IFB_Cmd;
794+ hcf_16 IFB_RxFID;
795+ RID_LOGP IFB_RIDLogp;
796+ hcf_16 IFB_Monitor;
797+ hcf_16 IFB_TxFid;
798+ hcf_16 IFB_RxLen;
799+ hcf_16 IFB_DefunctStat;
800+
801+ hcf_16 IFB_ErrCmd;
802+ hcf_16 IFB_ErrQualifier;
803+ hcf_16 IFB_lal;
804+ wci_bufp IFB_lap;
805+ hcf_16 IFB_LinkStat;
806+
807+ void (*IFB_MICRxRtn)( hcf_32*, hcf_32 );
808+ void (*IFB_MICTxRtn)( hcf_32*, hcf_32 );
809+ hcf_16 IFB_rx_tlen;
810+ hcf_16 IFB_tx_tlen;
811+ hcf_8 IFB_rx_32[4];
812+ hcf_8 IFB_tx_32[4];
813+ hcf_16 IFB_RscInd;
814+ hcf_16 IFB_MB_FID;
815+ hcf_16 IFB_DLTarget[2];
816+
817+ hcf_16 IFB_DLPage;
818+ hcf_16 IFB_DLOffset;
819+ hcf_16 IFB_DLLen;
820+
821+ hcf_16 volatile IFB_IntOffCnt;
822+ hcf_16 IFB_IntEnMask;
823+
824+ CFG_FW_IDENTITY_STRCT IFB_FWIdentity;
825+ hcf_16 IFB_Tally;
826+ hcf_16 IFB_TallyTyp;
827+
828+ CFG_HERMES_TALLIES_STRCT IFB_NIC_Tallies;
829+ CFG_HCF_TALLIES_STRCT IFB_HCF_Tallies;
830+
831+ void *IFB_MSFSup;
832+} IFB_STRCT;
833+
834+typedef IFB_STRCT* IFBP;
835+
836+struct uilreq
837+{
838+ union
839+ {
840+ char ifrn_name[16];
841+ } ifr_ifrn;
842+
843+ IFBP hcfCtx;
844+ __u8 command;
845+ __u8 result;
846+ __u16 len;
847+ void *data;
848+};
849+
850+typedef struct
851+{
852+ hcf_16 len;
853+ hcf_16 typ;
854+ union
855+ {
856+ hcf_8 u8[(512 - (sizeof(hcf_16) * 2)) / sizeof(hcf_8)];
857+ hcf_16 u16[(512 - (sizeof(hcf_16) * 2)) / sizeof(hcf_16)];
858+ hcf_32 u32[(512 - (sizeof(hcf_16) * 2)) / sizeof(hcf_32)];
859+ } u;
860+} ltv_t;
861+
862+
863+#define UIL_FUN_CONNECT 0x00
864+#define UIL_FUN_DISCONNECT 0x01
865+#define UIL_FUN_GET_INFO 0x04
866+#define UIL_FUN_PUT_INFO 0x05
867+
868+#define GENERIC_INFO_ELEM 0xdd
869+#define RSN_INFO_ELEM 0x30
870+
871+#define CFG_DRIVER_ENABLE 0x0902
872+#define CFG_CNF_ENCRYPTION 0xFC20
873+#define CFG_ADD_TKIP_DEFAULT_KEY 0xFCB4
874+#define CFG_SET_WPA_AUTH_KEY_MGMT_SUITE 0xFCB5
875+#define CFG_REMOVE_TKIP_DEFAULT_KEY 0xFCB6
876+#define CFG_ADD_TKIP_MAPPED_KEY 0xFCB7
877+#define CFG_REMOVE_TKIP_MAPPED_KEY 0xFCB8
878+#define CFG_FW_IDENTITY 0xFD20
879+#define CFG_CNF_EXCL_UNENCRYPTED 0xFC22
880+
881+#define HCF_SUCCESS 0x00
882+#define UIL_SUCCESS 0x00
883+
884+#define COMP_ID_FW_STA 31
885+#define COMP_ID_FW_AP 32
886+
887+#define WVLAN2_IOCTL_UIL SIOCDEVPRIVATE
888+
889+#endif
diff --git a/meta/packages/wpa-supplicant/files/init.sh b/meta/packages/wpa-supplicant/files/init.sh
new file mode 100755
index 0000000000..bc7ee9184e
--- /dev/null
+++ b/meta/packages/wpa-supplicant/files/init.sh
@@ -0,0 +1,50 @@
1#!/bin/sh
2
3PATH=/sbin:/bin:/usr/sbin:/usr/bin
4
5DAEMON=/usr/sbin/wpa_supplicant
6CONFIG="/etc/wpa_supplicant.conf"
7PNAME="wpa_supplicant"
8
9# insane defaults
10OPTIONS=""
11
12test -f /etc/default/wpa && . /etc/default/wpa
13
14if [ ! -f $CONFIG ]; then
15 echo "No configuration file found, not starting."
16 exit 1
17fi
18
19test -f $DAEMON || exit 0
20
21case "$1" in
22 start)
23 echo -n "Starting wpa_supplicant: "
24 start-stop-daemon -S -b -x $DAEMON -- -Bw -c $CONFIG $OPTIONS >/dev/null
25 echo "done."
26 ;;
27 stop)
28 echo -n "Stopping wpa_supplicant: "
29 start-stop-daemon -K -n $PNAME >/dev/null
30 echo "done."
31 ;;
32 reload|force-reload)
33 echo -n "Reloading wpa_supplicant: "
34 killall -HUP $PNAME
35 echo "done."
36 ;;
37 restart)
38 echo -n "Restarting wpa_supplicant: "
39 start-stop-daemon -K -n $PNAME >/dev/null
40 sleep 1
41 start-stop-daemon -S -b -x $DAEMON -- -Bw -c $CONFIG $OPTIONS >/dev/null
42 echo "done."
43 ;;
44 *)
45 echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
46 exit 1
47 ;;
48esac
49
50exit 0
diff --git a/meta/packages/wpa-supplicant/files/madwifi-bsd-fix.diff b/meta/packages/wpa-supplicant/files/madwifi-bsd-fix.diff
new file mode 100644
index 0000000000..974eb39627
--- /dev/null
+++ b/meta/packages/wpa-supplicant/files/madwifi-bsd-fix.diff
@@ -0,0 +1,12 @@
1--- driver_madwifi.c.orig 2005-03-18 15:12:53.392793216 +0100
2+++ driver_madwifi.c 2005-03-18 15:13:09.246383104 +0100
3@@ -25,7 +25,8 @@
4 #include "eloop.h"
5 #include "wpa_supplicant.h"
6
7-#include <include/compat.h>
8+#include <net80211/compat.h>
9+#include <net80211/_ieee80211.h>
10 #include <net80211/ieee80211.h>
11 #include <net80211/ieee80211_crypto.h>
12 #include <net80211/ieee80211_ioctl.h>
diff --git a/meta/packages/wpa-supplicant/files/mtx-1/defconfig b/meta/packages/wpa-supplicant/files/mtx-1/defconfig
new file mode 100644
index 0000000000..a0d9b73d3f
--- /dev/null
+++ b/meta/packages/wpa-supplicant/files/mtx-1/defconfig
@@ -0,0 +1,157 @@
1# This file lists the configuration options that are used when building the
2# hostapd binary. All lines starting with # are ignored. Configuration option
3# lines must be commented out complete, if they are not to be included, i.e.,
4# just setting VARIABLE=n is not disabling that variable.
5#
6# This file is included in Makefile, so variables like CFLAGS and LIBS can also
7# be modified from here. In most cass, these lines should use += in order not
8# to override previous values of the variables.
9
10CFLAGS = $(TARGET_CFLAGS) -I../hostapd -I../utils -I../driver/modules -Wall -MMD
11
12# for wpa_supplicant, wpa_cli
13LIBS = $(TARGET_LDFLAGS)
14
15# for wpa_passphrase:
16LIBS_p = $(TARGET_LDFLAGS)
17
18
19# Uncomment following two lines and fix the paths if you have installed openssl
20# in non-default location
21#CFLAGS += -I/usr/local/openssl/include
22#LIBS += -L/usr/local/openssl/lib
23
24# Example configuration for various cross-compilation platforms
25
26#### sveasoft (e.g., for Linksys WRT54G) ######################################
27#CC=mipsel-uclibc-gcc
28#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc
29#CFLAGS += -Os
30#CPPFLAGS += -I../src/include -I../../src/router/openssl/include
31#LIBS += -L/opt/brcm/hndtools-mipsel-uclibc-0.9.19/lib -lssl
32###############################################################################
33
34#### openwrt (e.g., for Linksys WRT54G) #######################################
35#CC=mipsel-uclibc-gcc
36#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc
37#CFLAGS += -Os
38#CPPFLAGS=-I../src/include -I../openssl-0.9.7d/include \
39# -I../WRT54GS/release/src/include
40#LIBS = -lssl
41###############################################################################
42
43
44# Driver interface for Host AP driver
45CONFIG_DRIVER_HOSTAP=y
46
47# Driver interface for Agere driver
48#CONFIG_DRIVER_HERMES=y
49
50# Driver interface for madwifi driver
51CONFIG_DRIVER_MADWIFI=y
52# Change include directories to match with the local setup
53#CFLAGS += -I../madwifi/wpa
54
55# Driver interface for Prism54 driver
56CONFIG_DRIVER_PRISM54=y
57
58# Driver interface for ndiswrapper
59#CONFIG_DRIVER_NDISWRAPPER=y
60
61# Driver interface for Atmel driver
62#CONFIG_DRIVER_ATMEL=y
63
64# Driver interface for Broadcom driver
65#CONFIG_DRIVER_BROADCOM=y
66# Example path for wlioctl.h; change to match your configuration
67#CFLAGS += -I/opt/WRT54GS/release/src/include
68
69# Driver interface for Intel ipw2100 driver
70#CONFIG_DRIVER_IPW2100=y
71
72# Driver interface for generic Linux wireless extensions
73CONFIG_DRIVER_WEXT=y
74
75# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
76#CONFIG_DRIVER_BSD=y
77#CFLAGS += -I/usr/local/include
78#LIBS += -L/usr/local/lib
79
80# Driver interface for Windows NDIS
81#CONFIG_DRIVER_NDIS=y
82#CFLAGS += -I/usr/include/w32api/ddk
83#LIBS += -L/usr/local/lib
84# For native build using mingw
85#CONFIG_NATIVE_WINDOWS=y
86# Additional directories for cross-compilation on Linux host for mingw target
87#CFLAGS += -I/opt/mingw/mingw32/include/ddk
88#LIBS += -L/opt/mingw/mingw32/lib
89#CC=mingw32-gcc
90
91# Driver interface for development testing
92#CONFIG_DRIVER_TEST=y
93
94# Enable IEEE 802.1X Supplicant (automatically included if any EAP method is
95# included)
96CONFIG_IEEE8021X_EAPOL=y
97
98# EAP-MD5 (automatically included if EAP-TTLS is enabled)
99CONFIG_EAP_MD5=y
100
101# EAP-MSCHAPv2 (automatically included if EAP-PEAP is enabled)
102CONFIG_EAP_MSCHAPV2=y
103
104# EAP-TLS
105CONFIG_EAP_TLS=y
106
107# EAL-PEAP
108CONFIG_EAP_PEAP=y
109
110# EAP-TTLS
111CONFIG_EAP_TTLS=y
112
113# EAP-GTC
114CONFIG_EAP_GTC=y
115
116# EAP-OTP
117CONFIG_EAP_OTP=y
118
119# EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used)
120#CONFIG_EAP_SIM=y
121
122# EAP-PSK (experimental; this is _not_ needed for WPA-PSK)
123#CONFIG_EAP_PSK=y
124
125# LEAP
126CONFIG_EAP_LEAP=y
127
128# EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used)
129#CONFIG_EAP_AKA=y
130
131# PKCS#12 (PFX) support (used to read private key and certificate file from
132# a file that usually has extension .p12 or .pfx)
133CONFIG_PKCS12=y
134
135# PC/SC interface for smartcards (USIM, GSM SIM)
136# Enable this if EAP-SIM or EAP-AKA is included
137#CONFIG_PCSC=y
138
139# Development testing
140#CONFIG_EAPOL_TEST=y
141
142# Replace native Linux implementation of packet sockets with libdnet/libpcap.
143# This will be automatically set for non-Linux OS.
144#CONFIG_DNET_PCAP=y
145
146# Include control interface for external programs, e.g, wpa_cli
147CONFIG_CTRL_IFACE=y
148
149# Include interface for using external supplicant (Xsupplicant) for EAP
150# authentication
151#CONFIG_XSUPPLICANT_IFACE=y
152
153# Include support for GNU Readline and History Libraries in wpa_cli.
154# When building a wpa_cli binary for distribution, please note that these
155# libraries are licensed under GPL and as such, BSD license may not apply for
156# the resulting binary.
157#CONFIG_READLINE=y
diff --git a/meta/packages/wpa-supplicant/files/openmn/defaults b/meta/packages/wpa-supplicant/files/openmn/defaults
new file mode 100644
index 0000000000..1da73d30c0
--- /dev/null
+++ b/meta/packages/wpa-supplicant/files/openmn/defaults
@@ -0,0 +1,8 @@
1# Useful flags:
2# -i <ifname> Interface (required, unless specified in config)
3# -D <driver> Wireless Driver
4# -d Debugging (-dd for more)
5# -q Quiet (-qq for more)
6
7CONFIG="/etc/wpa_supplicant.conf"
8OPTIONS="-i eth1 -D hermes"
diff --git a/meta/packages/wpa-supplicant/files/slugos/defaults-sane b/meta/packages/wpa-supplicant/files/slugos/defaults-sane
new file mode 100644
index 0000000000..df4268b3a6
--- /dev/null
+++ b/meta/packages/wpa-supplicant/files/slugos/defaults-sane
@@ -0,0 +1,8 @@
1# Useful flags:
2# -i <ifname> Interface (required, unless specified in config)
3# -D <driver> Wireless Driver
4# -d Debugging (-dd for more)
5# -q Quiet (-qq for more)
6
7CONFIG="/etc/wpa_supplicant.conf"
8OPTIONS="-i ath0 -D madwifi"
diff --git a/meta/packages/wpa-supplicant/files/use-channel.patch b/meta/packages/wpa-supplicant/files/use-channel.patch
new file mode 100644
index 0000000000..337c0422cd
--- /dev/null
+++ b/meta/packages/wpa-supplicant/files/use-channel.patch
@@ -0,0 +1,32 @@
1
2#
3# Patch managed by http://www.holgerschurig.de/patcher.html
4#
5
6--- wpa_supplicant/driver_wext.c~use-channel
7+++ wpa_supplicant/driver_wext.c
8@@ -655,6 +655,12 @@
9 }
10
11
12+static const long frequency_list[] =
13+{
14+ 2412, 2417, 2422, 2427, 2432, 2437, 2442,
15+ 2447, 2452, 2457, 2462, 2467, 2472, 2484
16+};
17+
18 int wpa_driver_wext_get_scan_results(void *priv,
19 struct wpa_scan_result *results,
20 size_t max_size)
21@@ -739,6 +745,11 @@
22 case SIOCGIWFREQ:
23 if (ap_num < max_size) {
24 int div = 1000000, i;
25+ /* driver sent a channel, not a frequency */
26+ if (iwe->u.freq.e == 0 && iwe->u.freq.m >= 1 && iwe->u.freq.m <= sizeof(frequency_list)) {
27+ results[ap_num].freq = frequency_list[iwe->u.freq.m-1];
28+ break;
29+ } else
30 if (iwe->u.freq.e > 6) {
31 wpa_printf(
32 MSG_DEBUG, "Invalid freq "
diff --git a/meta/packages/wpa-supplicant/files/wpa_supplicant.conf b/meta/packages/wpa-supplicant/files/wpa_supplicant.conf
new file mode 100644
index 0000000000..da407b5ef3
--- /dev/null
+++ b/meta/packages/wpa-supplicant/files/wpa_supplicant.conf
@@ -0,0 +1,502 @@
1##### Example wpa_supplicant configuration file ###############################
2# Empty lines and lines starting with # are ignored
3
4# NOTE! This file may contain password information and should probably be made
5# readable only by root user on multiuser systems.
6
7# global configuration (shared by all network blocks)
8#
9# Interface for separate control program. If this is specified, wpa_supplicant
10# will create this directory and a UNIX domain socket for listening to requests
11# from external programs (CLI/GUI, etc.) for status information and
12# configuration. The socket file will be named based on the interface name, so
13# multiple wpa_supplicant processes can be run at the same time if more than
14# one interface is used.
15# /var/run/wpa_supplicant is the recommended directory for sockets and by
16# default, wpa_cli will use it when trying to connect with wpa_supplicant.
17ctrl_interface=/var/run/wpa_supplicant
18
19# Access control for the control interface can be configured by setting the
20# directory to allow only members of a group to use sockets. This way, it is
21# possible to run wpa_supplicant as root (since it needs to change network
22# configuration and open raw sockets) and still allow GUI/CLI components to be
23# run as non-root users. However, since the control interface can be used to
24# change the network configuration, this access needs to be protected in many
25# cases. By default, wpa_supplicant is configured to use gid 0 (root). If you
26# want to allow non-root users to use the control interface, add a new group
27# and change this value to match with that group. Add users that should have
28# control interface access to this group. If this variable is commented out or
29# not included in the configuration file, group will not be changed from the
30# value it got by default when the directory or socket was created.
31#
32# This variable can be a group name or gid.
33#ctrl_interface_group=wheel
34ctrl_interface_group=0
35
36# IEEE 802.1X/EAPOL version
37# wpa_supplicant was implemented based on IEEE 802-1X-REV-d8 which defines
38# EAPOL version 2. However, there are many APs that do not handle the new
39# version number correctly (they seem to drop the frames completely). In order
40# to make wpa_supplicant interoperate with these APs, the version number is set
41# to 1 by default. This configuration value can be used to set it to the new
42# version (2).
43eapol_version=1
44
45# AP scanning/selection
46# By default, wpa_supplicant requests driver to perform AP scanning and then
47# uses the scan results to select a suitable AP. Another alternative is to
48# allow the driver to take care of AP scanning and selection and use
49# wpa_supplicant just to process EAPOL frames based on IEEE 802.11 association
50# information from the driver.
51# 1: wpa_supplicant initiates scanning and AP selection
52# 0: driver takes care of scanning, AP selection, and IEEE 802.11 association
53# parameters (e.g., WPA IE generation); this mode can also be used with
54# non-WPA drivers when using IEEE 802.1X mode; do not try to associate with
55# APs (i.e., external program needs to control association)
56# 2: like 0, but associate with APs using security policy and SSID (but not
57# BSSID); this can be used, e.g., with ndiswrapper and NDIS driver to
58# enable operation with hidden SSIDs and optimized roaming; in this mode,
59# only the first network block in the configuration file is used and this
60# configuration should have explicit security policy (i.e., only one option
61# in the lists) for key_mgmt, pairwise, group, proto variables
62ap_scan=1
63
64# EAP fast re-authentication
65# By default, fast re-authentication is enabled for all EAP methods that
66# support it. This variable can be used to disable fast re-authentication.
67# Normally, there is no need to disable this.
68fast_reauth=1
69
70# network block
71#
72# Each network (usually AP's sharing the same SSID) is configured as a separate
73# block in this configuration file. The network blocks are in preference order
74# (the first match is used).
75#
76# network block fields:
77#
78# ssid: SSID (mandatory); either as an ASCII string with double quotation or
79# as hex string; network name
80#
81# scan_ssid:
82# 0 = do not scan this SSID with specific Probe Request frames (default)
83# 1 = scan with SSID-specific Probe Request frames (this can be used to
84# find APs that do not accept broadcast SSID or use multiple SSIDs;
85# this will add latency to scanning, so enable this only when needed)
86#
87# bssid: BSSID (optional); if set, this network block is used only when
88# associating with the AP using the configured BSSID
89#
90# priority: priority group (integer)
91# By default, all networks will get same priority group (0). If some of the
92# networks are more desirable, this field can be used to change the order in
93# which wpa_supplicant goes through the networks when selecting a BSS. The
94# priority groups will be iterated in decreasing priority (i.e., the larger the
95# priority value, the sooner the network is matched against the scan results).
96# Within each priority group, networks will be selected based on security
97# policy, signal strength, etc.
98# Please note that AP scanning with scan_ssid=1 is not using this priority to
99# select the order for scanning. Instead, it uses the order the networks are in
100# the configuration file.
101#
102# mode: IEEE 802.11 operation mode
103# 0 = infrastructure (Managed) mode, i.e., associate with an AP (default)
104# 1 = IBSS (ad-hoc, peer-to-peer)
105# Note: IBSS can only be used with key_mgmt NONE (plaintext and static WEP)
106# and key_mgmt=WPA-NONE (fixed group key TKIP/CCMP). In addition, ap_scan has
107# to be set to 2 for IBSS. WPA-None requires following network block options:
108# proto=WPA, key_mgmt=WPA-NONE, pairwise=NONE, group=TKIP (or CCMP, but not
109# both), and psk must also be set.
110#
111# proto: list of accepted protocols
112# WPA = WPA/IEEE 802.11i/D3.0
113# RSN = WPA2/IEEE 802.11i (also WPA2 can be used as an alias for RSN)
114# If not set, this defaults to: WPA RSN
115#
116# key_mgmt: list of accepted authenticated key management protocols
117# WPA-PSK = WPA pre-shared key (this requires 'psk' field)
118# WPA-EAP = WPA using EAP authentication (this can use an external
119# program, e.g., Xsupplicant, for IEEE 802.1X EAP Authentication
120# IEEE8021X = IEEE 802.1X using EAP authentication and (optionally) dynamically
121# generated WEP keys
122# NONE = WPA is not used; plaintext or static WEP could be used
123# If not set, this defaults to: WPA-PSK WPA-EAP
124#
125# auth_alg: list of allowed IEEE 802.11 authentication algorithms
126# OPEN = Open System authentication (required for WPA/WPA2)
127# SHARED = Shared Key authentication (requires static WEP keys)
128# LEAP = LEAP/Network EAP (only used with LEAP)
129# If not set, automatic selection is used (Open System with LEAP enabled if
130# LEAP is allowed as one of the EAP methods).
131#
132# pairwise: list of accepted pairwise (unicast) ciphers for WPA
133# CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0]
134# TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0]
135# NONE = Use only Group Keys (deprecated, should not be included if APs support
136# pairwise keys)
137# If not set, this defaults to: CCMP TKIP
138#
139# group: list of accepted group (broadcast/multicast) ciphers for WPA
140# CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0]
141# TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0]
142# WEP104 = WEP (Wired Equivalent Privacy) with 104-bit key
143# WEP40 = WEP (Wired Equivalent Privacy) with 40-bit key [IEEE 802.11]
144# If not set, this defaults to: CCMP TKIP WEP104 WEP40
145#
146# psk: WPA preshared key; 256-bit pre-shared key
147# The key used in WPA-PSK mode can be entered either as 64 hex-digits, i.e.,
148# 32 bytes or as an ASCII passphrase (in which case, the real PSK will be
149# generated using the passphrase and SSID). ASCII passphrase must be between
150# 8 and 63 characters (inclusive).
151# This field is not needed, if WPA-EAP is used.
152# Note: Separate tool, wpa_passphrase, can be used to generate 256-bit keys
153# from ASCII passphrase. This process uses lot of CPU and wpa_supplicant
154# startup and reconfiguration time can be optimized by generating the PSK only
155# only when the passphrase or SSID has actually changed.
156#
157# eapol_flags: IEEE 802.1X/EAPOL options (bit field)
158# Dynamic WEP key require for non-WPA mode
159# bit0 (1): require dynamically generated unicast WEP key
160# bit1 (2): require dynamically generated broadcast WEP key
161# (3 = require both keys; default)
162#
163# Following fields are only used with internal EAP implementation.
164# eap: space-separated list of accepted EAP methods
165# MD5 = EAP-MD5 (unsecure and does not generate keying material ->
166# cannot be used with WPA; to be used as a Phase 2 method
167# with EAP-PEAP or EAP-TTLS)
168# MSCHAPV2 = EAP-MSCHAPv2 (cannot be used separately with WPA; to be used
169# as a Phase 2 method with EAP-PEAP or EAP-TTLS)
170# OTP = EAP-OTP (cannot be used separately with WPA; to be used
171# as a Phase 2 method with EAP-PEAP or EAP-TTLS)
172# GTC = EAP-GTC (cannot be used separately with WPA; to be used
173# as a Phase 2 method with EAP-PEAP or EAP-TTLS)
174# TLS = EAP-TLS (client and server certificate)
175# PEAP = EAP-PEAP (with tunnelled EAP authentication)
176# TTLS = EAP-TTLS (with tunnelled EAP or PAP/CHAP/MSCHAP/MSCHAPV2
177# authentication)
178# If not set, all compiled in methods are allowed.
179#
180# identity: Identity string for EAP
181# anonymous_identity: Anonymous identity string for EAP (to be used as the
182# unencrypted identity with EAP types that support different tunnelled
183# identity, e.g., EAP-TTLS)
184# password: Password string for EAP
185# ca_cert: File path to CA certificate file. This file can have one or more
186# trusted CA certificates. If ca_cert is not included, server certificate
187# will not be verified. This is insecure and the CA file should always be
188# configured.
189# client_cert: File path to client certificate file (PEM/DER)
190# private_key: File path to client private key file (PEM/DER/PFX)
191# When PKCS#12/PFX file (.p12/.pfx) is used, client_cert should be
192# commented out. Both the private key and certificate will be read from
193# the PKCS#12 file in this case.
194# private_key_passwd: Password for private key file
195# dh_file: File path to DH/DSA parameters file (in PEM format)
196# This is an optional configuration file for setting parameters for an
197# ephemeral DH key exchange. In most cases, the default RSA
198# authentication does not use this configuration. However, it is possible
199# setup RSA to use ephemeral DH key exchange. In addition, ciphers with
200# DSA keys always use ephemeral DH keys. This can be used to achieve
201# forward secrecy. If the file is in DSA parameters format, it will be
202# automatically converted into DH params.
203# subject_match: Substring to be matched against the subject of the
204# authentication server certificate. If this string is set, the server
205# sertificate is only accepted if it contains this string in the subject.
206# The subject string is in following format:
207# /C=US/ST=CA/L=San Francisco/CN=Test AS/emailAddress=as@example.com
208# phase1: Phase1 (outer authentication, i.e., TLS tunnel) parameters
209# (string with field-value pairs, e.g., "peapver=0" or
210# "peapver=1 peaplabel=1")
211# 'peapver' can be used to force which PEAP version (0 or 1) is used.
212# 'peaplabel=1' can be used to force new label, "client PEAP encryption",
213# to be used during key derivation when PEAPv1 or newer. Most existing
214# PEAPv1 implementation seem to be using the old label, "client EAP
215# encryption", and wpa_supplicant is now using that as the default value.
216# Some servers, e.g., Radiator, may require peaplabel=1 configuration to
217# interoperate with PEAPv1; see eap_testing.txt for more details.
218# 'peap_outer_success=0' can be used to terminate PEAP authentication on
219# tunneled EAP-Success. This is required with some RADIUS servers that
220# implement draft-josefsson-pppext-eap-tls-eap-05.txt (e.g.,
221# Lucent NavisRadius v4.4.0 with PEAP in "IETF Draft 5" mode)
222# sim_min_num_chal=3 can be used to configure EAP-SIM to require three
223# challenges (by default, it accepts 2 or 3)
224# phase2: Phase2 (inner authentication with TLS tunnel) parameters
225# (string with field-value pairs, e.g., "auth=MSCHAPV2" for EAP-PEAP or
226# "autheap=MSCHAPV2 autheap=MD5" for EAP-TTLS)
227# Following certificate/private key fields are used in inner Phase2
228# authentication when using EAP-TTLS or EAP-PEAP.
229# ca_cert2: File path to CA certificate file. This file can have one or more
230# trusted CA certificates. If ca_cert2 is not included, server
231# certificate will not be verified. This is insecure and the CA file
232# should always be configured.
233# client_cert2: File path to client certificate file
234# private_key2: File path to client private key file
235# private_key2_passwd: Password for private key file
236# dh_file2: File path to DH/DSA parameters file (in PEM format)
237# subject_match2: Substring to be matched against the subject of the
238# authentication server certificate.
239#
240# EAP-PSK variables:
241# eappsk: 16-byte (128-bit, 32 hex digits) pre-shared key in hex format
242# nai: user NAI
243# server_nai: authentication server NAI
244#
245# EAP-FAST variables:
246# pac_file: File path for the PAC entries. wpa_supplicant will need to be able
247# to create this file and write updates to it when PAC is being
248# provisioned or refreshed.
249# phase1: fast_provisioning=1 option enables in-line provisioning of EAP-FAST
250# credentials (PAC)
251#
252# wpa_supplicant supports number of "EAP workarounds" to work around
253# interoperability issues with incorrectly behaving authentication servers.
254# These are enabled by default because some of the issues are present in large
255# number of authentication servers. Strict EAP conformance mode can be
256# configured by disabling workarounds with eap_workaround=0.
257
258# Example blocks:
259
260# Simple case: WPA-PSK, PSK as an ASCII passphrase, allow all valid ciphers
261network={
262 ssid="simple"
263 psk="very secret passphrase"
264 priority=5
265}
266
267# Same as previous, but request SSID-specific scanning (for APs that reject
268# broadcast SSID)
269network={
270 ssid="second ssid"
271 scan_ssid=1
272 psk="very secret passphrase"
273 priority=2
274}
275
276# Only WPA-PSK is used. Any valid cipher combination is accepted.
277network={
278 ssid="example"
279 proto=WPA
280 key_mgmt=WPA-PSK
281 pairwise=CCMP TKIP
282 group=CCMP TKIP WEP104 WEP40
283 psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb
284 priority=2
285}
286
287# Only WPA-EAP is used. Both CCMP and TKIP is accepted. An AP that used WEP104
288# or WEP40 as the group cipher will not be accepted.
289network={
290 ssid="example"
291 proto=RSN
292 key_mgmt=WPA-EAP
293 pairwise=CCMP TKIP
294 group=CCMP TKIP
295 eap=TLS
296 identity="user@example.com"
297 ca_cert="/etc/cert/ca.pem"
298 client_cert="/etc/cert/user.pem"
299 private_key="/etc/cert/user.prv"
300 private_key_passwd="password"
301 priority=1
302}
303
304# EAP-PEAP/MSCHAPv2 configuration for RADIUS servers that use the new peaplabel
305# (e.g., Radiator)
306network={
307 ssid="example"
308 key_mgmt=WPA-EAP
309 eap=PEAP
310 identity="user@example.com"
311 password="foobar"
312 ca_cert="/etc/cert/ca.pem"
313 phase1="peaplabel=1"
314 phase2="auth=MSCHAPV2"
315 priority=10
316}
317
318# EAP-TTLS/EAP-MD5-Challenge configuration with anonymous identity for the
319# unencrypted use. Real identity is sent only within an encrypted TLS tunnel.
320network={
321 ssid="example"
322 key_mgmt=WPA-EAP
323 eap=TTLS
324 identity="user@example.com"
325 anonymous_identity="anonymous@example.com"
326 password="foobar"
327 ca_cert="/etc/cert/ca.pem"
328 priority=2
329}
330
331# EAP-TTLS/MSCHAPv2 configuration with anonymous identity for the unencrypted
332# use. Real identity is sent only within an encrypted TLS tunnel.
333network={
334 ssid="example"
335 key_mgmt=WPA-EAP
336 eap=TTLS
337 identity="user@example.com"
338 anonymous_identity="anonymous@example.com"
339 password="foobar"
340 ca_cert="/etc/cert/ca.pem"
341 phase2="auth=MSCHAPV2"
342}
343
344# WPA-EAP, EAP-TTLS with different CA certificate used for outer and inner
345# authentication.
346network={
347 ssid="example"
348 key_mgmt=WPA-EAP
349 eap=TTLS
350 # Phase1 / outer authentication
351 anonymous_identity="anonymous@example.com"
352 ca_cert="/etc/cert/ca.pem"
353 # Phase 2 / inner authentication
354 phase2="autheap=TLS"
355 ca_cert2="/etc/cert/ca2.pem"
356 client_cert2="/etc/cer/user.pem"
357 private_key2="/etc/cer/user.prv"
358 private_key2_passwd="password"
359 priority=2
360}
361
362# Both WPA-PSK and WPA-EAP is accepted. Only CCMP is accepted as pairwise and
363# group cipher.
364network={
365 ssid="example"
366 bssid=00:11:22:33:44:55
367 proto=WPA RSN
368 key_mgmt=WPA-PSK WPA-EAP
369 pairwise=CCMP
370 group=CCMP
371 psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb
372}
373
374# Special characters in SSID, so use hex string. Default to WPA-PSK, WPA-EAP
375# and all valid ciphers.
376network={
377 ssid=00010203
378 psk=000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
379}
380
381
382# EAP-SIM with a GSM SIM or USIM
383network={
384 ssid="eap-sim-test"
385 key_mgmt=WPA-EAP
386 eap=SIM
387 pin="1234"
388 pcsc=""
389}
390
391
392# EAP-PSK
393network={
394 ssid="eap-psk-test"
395 key_mgmt=WPA-EAP
396 eap=PSK
397 identity="eap_psk_user"
398 eappsk=06b4be19da289f475aa46a33cb793029
399 nai="eap_psk_user@example.com"
400 server_nai="as@example.com"
401}
402
403
404# IEEE 802.1X/EAPOL with dynamically generated WEP keys (i.e., no WPA) using
405# EAP-TLS for authentication and key generation; require both unicast and
406# broadcast WEP keys.
407network={
408 ssid="1x-test"
409 key_mgmt=IEEE8021X
410 eap=TLS
411 identity="user@example.com"
412 ca_cert="/etc/cert/ca.pem"
413 client_cert="/etc/cert/user.pem"
414 private_key="/etc/cert/user.prv"
415 private_key_passwd="password"
416 eapol_flags=3
417}
418
419
420# LEAP with dynamic WEP keys
421network={
422 ssid="leap-example"
423 key_mgmt=IEEE8021X
424 eap=LEAP
425 identity="user"
426 password="foobar"
427}
428
429# EAP-FAST with WPA (WPA or WPA2)
430network={
431 ssid="eap-fast-test"
432 key_mgmt=WPA-EAP
433 eap=FAST
434 anonymous_identity="FAST-000102030405"
435 identity="username"
436 password="password"
437 phase1="fast_provisioning=1"
438 pac_file="/etc/wpa_supplicant.eap-fast-pac"
439}
440
441# Plaintext connection (no WPA, no IEEE 802.1X)
442network={
443 ssid="plaintext-test"
444 key_mgmt=NONE
445}
446
447
448# Shared WEP key connection (no WPA, no IEEE 802.1X)
449network={
450 ssid="static-wep-test"
451 key_mgmt=NONE
452 wep_key0="abcde"
453 wep_key1=0102030405
454 wep_key2="1234567890123"
455 wep_tx_keyidx=0
456 priority=5
457}
458
459
460# Shared WEP key connection (no WPA, no IEEE 802.1X) using Shared Key
461# IEEE 802.11 authentication
462network={
463 ssid="static-wep-test2"
464 key_mgmt=NONE
465 wep_key0="abcde"
466 wep_key1=0102030405
467 wep_key2="1234567890123"
468 wep_tx_keyidx=0
469 priority=5
470 auth_alg=SHARED
471}
472
473
474# IBSS/ad-hoc network with WPA-None/TKIP.
475network={
476 ssid="test adhoc"
477 mode=1
478 proto=WPA
479 key_mgmt=WPA-NONE
480 pairwise=NONE
481 group=TKIP
482 psk="secret passphrase"
483}
484
485
486# Catch all example that allows more or less all configuration modes
487network={
488 ssid="example"
489 scan_ssid=1
490 key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE
491 pairwise=CCMP TKIP
492 group=CCMP TKIP WEP104 WEP40
493 psk="very secret passphrase"
494 eap=TTLS PEAP TLS
495 identity="user@example.com"
496 password="foobar"
497 ca_cert="/etc/cert/ca.pem"
498 client_cert="/etc/cert/user.pem"
499 private_key="/etc/cert/user.prv"
500 private_key_passwd="password"
501 phase1="peaplabel=0"
502}
diff --git a/meta/packages/wpa-supplicant/files/wpa_supplicant.conf-sane b/meta/packages/wpa-supplicant/files/wpa_supplicant.conf-sane
new file mode 100644
index 0000000000..c91ffe0c84
--- /dev/null
+++ b/meta/packages/wpa-supplicant/files/wpa_supplicant.conf-sane
@@ -0,0 +1,7 @@
1ctrl_interface=/var/run/wpa_supplicant
2ctrl_interface_group=0
3update_config=1
4
5network={
6 key_mgmt=NONE
7}
diff --git a/meta/packages/wpa-supplicant/files/wpa_supplicant_default.conf b/meta/packages/wpa-supplicant/files/wpa_supplicant_default.conf
new file mode 100644
index 0000000000..8eebdeb5cb
--- /dev/null
+++ b/meta/packages/wpa-supplicant/files/wpa_supplicant_default.conf
@@ -0,0 +1,13 @@
1# This is a basic configuration for WPA with pre-shared keys (WPA-PSK)
2
3ctrl_interface=/var/run/wpa_supplicant
4ctrl_interface_group=0
5eapol_version=1
6ap_scan=1
7network={
8 ssid="YOUR_SSID"
9 psk="YOUR WPA PASSWORD IN HEX OR ASCII"
10 key_mgmt=WPA-PSK
11 pairwise=CCMP
12 priority=5
13}
diff --git a/meta/packages/wpa-supplicant/wpa-supplicant-0.4.7/defconfig b/meta/packages/wpa-supplicant/wpa-supplicant-0.4.7/defconfig
new file mode 100644
index 0000000000..0e45d01b88
--- /dev/null
+++ b/meta/packages/wpa-supplicant/wpa-supplicant-0.4.7/defconfig
@@ -0,0 +1,160 @@
1# This file lists the configuration options that are used when building the
2# hostapd binary. All lines starting with # are ignored. Configuration option
3# lines must be commented out complete, if they are not to be included, i.e.,
4# just setting VARIABLE=n is not disabling that variable.
5#
6# This file is included in Makefile, so variables like CFLAGS and LIBS can also
7# be modified from here. In most cass, these lines should use += in order not
8# to override previous values of the variables.
9
10CFLAGS = $(TARGET_CFLAGS) -I../hostapd -I../utils -I../driver/modules -Wall -MMD
11
12# for wpa_supplicant, wpa_cli
13LIBS = $(TARGET_LDFLAGS)
14
15# for wpa_passphrase:
16LIBS_p = $(TARGET_LDFLAGS)
17
18
19# Uncomment following two lines and fix the paths if you have installed openssl
20# in non-default location
21#CFLAGS += -I/usr/local/openssl/include
22#LIBS += -L/usr/local/openssl/lib
23
24# Example configuration for various cross-compilation platforms
25
26#### sveasoft (e.g., for Linksys WRT54G) ######################################
27#CC=mipsel-uclibc-gcc
28#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc
29#CFLAGS += -Os
30#CPPFLAGS += -I../src/include -I../../src/router/openssl/include
31#LIBS += -L/opt/brcm/hndtools-mipsel-uclibc-0.9.19/lib -lssl
32###############################################################################
33
34#### openwrt (e.g., for Linksys WRT54G) #######################################
35#CC=mipsel-uclibc-gcc
36#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc
37#CFLAGS += -Os
38#CPPFLAGS=-I../src/include -I../openssl-0.9.7d/include \
39# -I../WRT54GS/release/src/include
40#LIBS = -lssl
41###############################################################################
42
43
44# Driver interface for Host AP driver
45#CONFIG_DRIVER_HOSTAP=y
46
47# Driver interface for Agere driver
48#CONFIG_DRIVER_HERMES=y
49
50# Driver interface for madwifi driver
51#CONFIG_DRIVER_MADWIFI=y
52# Change include directories to match with the local setup
53#CFLAGS += -I../madwifi/wpa
54
55# Driver interface for Prism54 driver
56#CONFIG_DRIVER_PRISM54=y
57
58# Driver interface for ndiswrapper
59#CONFIG_DRIVER_NDISWRAPPER=y
60
61# Driver interface for Atmel driver
62#CONFIG_DRIVER_ATMEL=y
63
64# Driver interface for Broadcom driver
65#CONFIG_DRIVER_BROADCOM=y
66# Example path for wlioctl.h; change to match your configuration
67#CFLAGS += -I/opt/WRT54GS/release/src/include
68
69# Driver interface for Intel ipw2100 driver
70#CONFIG_DRIVER_IPW2100=y
71
72# Driver interface for the Zydas zd1211 driver
73CONFIG_DRIVER_ZD1211=y
74
75# Driver interface for generic Linux wireless extensions
76CONFIG_DRIVER_WEXT=y
77
78# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
79#CONFIG_DRIVER_BSD=y
80#CFLAGS += -I/usr/local/include
81#LIBS += -L/usr/local/lib
82
83# Driver interface for Windows NDIS
84#CONFIG_DRIVER_NDIS=y
85#CFLAGS += -I/usr/include/w32api/ddk
86#LIBS += -L/usr/local/lib
87# For native build using mingw
88#CONFIG_NATIVE_WINDOWS=y
89# Additional directories for cross-compilation on Linux host for mingw target
90#CFLAGS += -I/opt/mingw/mingw32/include/ddk
91#LIBS += -L/opt/mingw/mingw32/lib
92#CC=mingw32-gcc
93
94# Driver interface for development testing
95#CONFIG_DRIVER_TEST=y
96
97# Enable IEEE 802.1X Supplicant (automatically included if any EAP method is
98# included)
99CONFIG_IEEE8021X_EAPOL=y
100
101# EAP-MD5 (automatically included if EAP-TTLS is enabled)
102CONFIG_EAP_MD5=y
103
104# EAP-MSCHAPv2 (automatically included if EAP-PEAP is enabled)
105CONFIG_EAP_MSCHAPV2=y
106
107# EAP-TLS
108CONFIG_EAP_TLS=y
109
110# EAL-PEAP
111CONFIG_EAP_PEAP=y
112
113# EAP-TTLS
114CONFIG_EAP_TTLS=y
115
116# EAP-GTC
117CONFIG_EAP_GTC=y
118
119# EAP-OTP
120CONFIG_EAP_OTP=y
121
122# EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used)
123#CONFIG_EAP_SIM=y
124
125# EAP-PSK (experimental; this is _not_ needed for WPA-PSK)
126#CONFIG_EAP_PSK=y
127
128# LEAP
129CONFIG_EAP_LEAP=y
130
131# EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used)
132#CONFIG_EAP_AKA=y
133
134# PKCS#12 (PFX) support (used to read private key and certificate file from
135# a file that usually has extension .p12 or .pfx)
136CONFIG_PKCS12=y
137
138# PC/SC interface for smartcards (USIM, GSM SIM)
139# Enable this if EAP-SIM or EAP-AKA is included
140#CONFIG_PCSC=y
141
142# Development testing
143#CONFIG_EAPOL_TEST=y
144
145# Replace native Linux implementation of packet sockets with libdnet/libpcap.
146# This will be automatically set for non-Linux OS.
147#CONFIG_DNET_PCAP=y
148
149# Include control interface for external programs, e.g, wpa_cli
150CONFIG_CTRL_IFACE=y
151
152# Include interface for using external supplicant (Xsupplicant) for EAP
153# authentication
154#CONFIG_XSUPPLICANT_IFACE=y
155
156# Include support for GNU Readline and History Libraries in wpa_cli.
157# When building a wpa_cli binary for distribution, please note that these
158# libraries are licensed under GPL and as such, BSD license may not apply for
159# the resulting binary.
160#CONFIG_READLINE=y
diff --git a/meta/packages/wpa-supplicant/wpa-supplicant-0.4.7/driver-hermes.patch b/meta/packages/wpa-supplicant/wpa-supplicant-0.4.7/driver-hermes.patch
new file mode 100644
index 0000000000..4044835e1c
--- /dev/null
+++ b/meta/packages/wpa-supplicant/wpa-supplicant-0.4.7/driver-hermes.patch
@@ -0,0 +1,884 @@
1--- /dev/null
2+++ wpa_supplicant-0.4.7/driver_hermes.c
3@@ -0,0 +1,705 @@
4+/*
5+ * WPA Supplicant - testing driver interface
6+ * Copyright (c) 2004-2005, Jouni Malinen <jkmaline@cc.hut.fi>
7+ *
8+ * This program is free software; you can redistribute it and/or modify
9+ * it under the terms of the GNU General Public License version 2 as
10+ * published by the Free Software Foundation.
11+ *
12+ * Alternatively, this software may be distributed under the terms of BSD
13+ * license.
14+ *
15+ * See README and COPYING for more details.
16+ */
17+
18+#include <stdlib.h>
19+#include <stdio.h>
20+#include <unistd.h>
21+#include <string.h>
22+#include <sys/ioctl.h>
23+#include <errno.h>
24+#include <net/if_arp.h>
25+
26+#include "wireless_copy.h"
27+#include "common.h"
28+#include "driver.h"
29+
30+#include "eloop.h"
31+#include "wpa_supplicant.h"
32+#include "priv_netlink.h"
33+
34+#include "hostap_common.h"
35+#include "driver_wext.h"
36+#include "driver_hermes.h"
37+
38+
39+
40+/* Enumeration for supported Hermes Types */
41+enum
42+{
43+ WL_HERMES_UNKNOWN = 0,
44+ WL_HERMES_1 = 1,
45+ WL_HERMES_2 = 2,
46+ WL_HERMES_25 = 3
47+};
48+
49+
50+
51+
52+struct wpa_driver_hermes_data {
53+ void *wext; /* private data for driver_wext */
54+ void *ctx;
55+ char ifname[IFNAMSIZ + 1];
56+ int sock;
57+ int type;
58+};
59+
60+
61+
62+/****************************************************************************/
63+/* */
64+/* Routines for basic device access to Agere Hermes-I/Hermes-II via the UIL */
65+/* */
66+/****************************************************************************/
67+
68+IFBP _connect(void *priv)
69+{
70+ struct wpa_driver_hermes_data *drv = priv;
71+ int result = 0;
72+ IFBP ifbp = NULL;
73+ struct uilreq urq;
74+
75+ //wpa_printf(MSG_DEBUG, "%s: %s %d", __FUNCTION__, drv->ifname, drv->sock);
76+
77+ memset(&urq, 0, sizeof(urq));
78+
79+ strcpy(urq.ifr_name, drv->ifname);
80+ urq.command = UIL_FUN_CONNECT;
81+
82+ result = ioctl(drv->sock, WVLAN2_IOCTL_UIL, &urq);
83+ if (result == 0 && urq.result == UIL_SUCCESS) {
84+ ifbp = urq.hcfCtx;
85+ } else {
86+ wpa_printf(MSG_DEBUG, "%s: could not set IFBP, result %d", __FUNCTION__, result);
87+ }
88+
89+ return ifbp;
90+}
91+
92+
93+void _disconnect(void *priv, IFBP ifbp)
94+{
95+ struct wpa_driver_hermes_data *drv = priv;
96+ int result = 0;
97+ struct uilreq urq;
98+
99+ //wpa_printf(MSG_DEBUG, "%s: %s", __FUNCTION__, drv->ifname);
100+
101+ if (ifbp != NULL) {
102+ memset(&urq, 0, sizeof(struct uilreq));
103+
104+ strcpy(urq.ifr_name, drv->ifname);
105+ urq.command = UIL_FUN_DISCONNECT;
106+ urq.hcfCtx = ifbp;
107+
108+ result = ioctl(drv->sock, WVLAN2_IOCTL_UIL, &urq);
109+
110+ if (result != 0 || urq.result != UIL_SUCCESS) {
111+ wpa_printf( MSG_WARNING, "wl_disconnect(): ioctl() failed, errno: %d", errno );
112+ wpa_printf( MSG_WARNING, "wl_disconnect(): urq.result: %d", urq.result );
113+ }
114+ } else {
115+ wpa_printf(MSG_WARNING, "wl_disconnect(): called with NULL ifbp");
116+ }
117+
118+ return;
119+}
120+
121+int _get_info(void *priv, ltv_t *ltv)
122+{
123+ struct wpa_driver_hermes_data *drv = priv;
124+ int result = 0;
125+ IFBP ifbp = NULL;
126+ struct uilreq urq;
127+
128+ //wpa_printf(MSG_DEBUG, "%s: %s", __FUNCTION__, drv->ifname);
129+
130+ /* First, connect to the device */
131+ ifbp = _connect(priv);
132+ if (ifbp != NULL && ltv != NULL) {
133+ memset(&urq, 0, sizeof(struct uilreq));
134+
135+ strcpy(urq.ifr_name, drv->ifname);
136+ urq.hcfCtx = ifbp;
137+ urq.command = UIL_FUN_GET_INFO;
138+ urq.len = sizeof(ltv_t);
139+ urq.data = ltv;
140+
141+ result = ioctl(drv->sock, WVLAN2_IOCTL_UIL, &urq);
142+
143+ if (result != 0 || urq.result != UIL_SUCCESS) {
144+ wpa_printf(MSG_WARNING, "wl_disconnect(): ioctl() failed, errno: %d", errno);
145+ wpa_printf(MSG_WARNING, "wl_disconnect(): urq.result: %d", urq.result);
146+ }
147+ _disconnect(priv, ifbp);
148+ } else {
149+ wpa_printf( MSG_WARNING, "Could not connect to the device, or LTV NULL");
150+ result = -1;
151+ }
152+
153+ return result;
154+}
155+
156+int _put_info(void *priv, ltv_t *ltv)
157+{
158+ struct wpa_driver_hermes_data *drv = priv;
159+ int result = 0;
160+ IFBP ifbp = NULL;
161+ struct uilreq urq;
162+
163+ //wpa_printf(MSG_DEBUG, "%s: %s", __FUNCTION__, drv->ifname);
164+
165+ /* First, connect to the device */
166+ ifbp = _connect(priv);
167+ if (ifbp != NULL && ltv != NULL) {
168+ memset(&urq, 0, sizeof(struct uilreq));
169+
170+ strcpy(urq.ifr_name, drv->ifname);
171+ urq.hcfCtx = ifbp;
172+ urq.command = UIL_FUN_PUT_INFO;
173+ urq.len = sizeof( ltv_t );
174+ urq.data = ltv;
175+
176+ result = ioctl(drv->sock, WVLAN2_IOCTL_UIL, &urq);
177+
178+ if (result != 0 || urq.result != UIL_SUCCESS) {
179+ wpa_printf(MSG_WARNING, "_put_info(): ioctl() failed, errno: %d", errno);
180+ wpa_printf(MSG_WARNING, "_put_info(): urq.result: %d", urq.result);
181+ }
182+
183+ _disconnect(priv, ifbp);
184+ } else {
185+ wpa_printf(MSG_WARNING, "%s: could not connect to the device, or LTV NULL", __FUNCTION__ );
186+ result = -1;
187+ }
188+
189+ return result;
190+}
191+
192+
193+static void _detect_hermes_type(void *priv)
194+{
195+ struct wpa_driver_hermes_data *drv = priv;
196+ CFG_FW_IDENTITY_STRCT *fw_id;
197+ ltv_t ltv;
198+ int result;
199+
200+ //wpa_printf(MSG_DEBUG, "%s", __FUNCTION__);
201+
202+ drv->type = WL_HERMES_UNKNOWN;
203+
204+ if (drv->sock >= 0) {
205+ fw_id = (CFG_FW_IDENTITY_STRCT *)&ltv;
206+ fw_id->len = ( sizeof(CFG_FW_IDENTITY_STRCT) / sizeof( hcf_16 )) - 1;
207+ fw_id->typ = CFG_FW_IDENTITY;
208+
209+ result = _get_info(priv, (ltv_t *)fw_id);
210+ if (result == HCF_SUCCESS) {
211+ //wpa_printf(MSG_DEBUG, "PRI CompID : %d", fw_id->comp_id);
212+ //wpa_printf(MSG_DEBUG, "PRI Variant : %d", fw_id->variant);
213+ //wpa_printf(MSG_DEBUG, "PRI Version : %d.%02d", fw_id->version_major, fw_id->version_minor);
214+
215+ switch(fw_id->comp_id) {
216+ case COMP_ID_FW_STA:
217+ switch (fw_id->variant) {
218+ case 1:
219+ case 2:
220+ wpa_printf(MSG_DEBUG, "found Hermes 1 STA");
221+ drv->type = WL_HERMES_1;
222+ break;
223+
224+ case 3:
225+ wpa_printf(MSG_DEBUG, "found Hermes 2 STA");
226+ drv->type = WL_HERMES_2;
227+ break;
228+ case 4:
229+ wpa_printf(MSG_DEBUG, "found Hermes 2.5 STA");
230+ drv->type = WL_HERMES_25;
231+ break;
232+ }
233+ break;
234+
235+ case COMP_ID_FW_AP:
236+ switch (fw_id->variant) {
237+ case 1:
238+ wpa_printf(MSG_DEBUG, "found Hermes 1 AP");
239+ drv->type = WL_HERMES_1;
240+ break;
241+
242+ case 2:
243+ wpa_printf(MSG_DEBUG, "found Hermes 2 AP" );
244+ drv->type = WL_HERMES_2;
245+ break;
246+ }
247+ break;
248+
249+ default:
250+ wpa_printf(MSG_WARNING, "could not detect Hermes type!");
251+ break;
252+ }
253+ }
254+ }
255+}
256+
257+
258+
259+/****************************************************************************/
260+
261+
262+static int wpa_driver_hermes_set_wpa_ie(void *priv, const char *wpa_ie,
263+ size_t wpa_ie_len)
264+{
265+ struct wpa_driver_hermes_data *drv = priv;
266+ ltv_t ltv;
267+
268+ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__);
269+
270+ ltv.len = 2;
271+ ltv.typ = CFG_SET_WPA_AUTH_KEY_MGMT_SUITE;
272+
273+ switch(drv->type) {
274+ case WL_HERMES_1:
275+ ltv.u.u16[0] = 2;
276+ break;
277+
278+ case WL_HERMES_2:
279+ case WL_HERMES_25:
280+ ltv.u.u16[0] = 4;
281+ break;
282+
283+ default:
284+ ltv.u.u16[0] = 0;
285+ break;
286+ }
287+
288+ return _put_info(priv, &ltv);
289+}
290+
291+
292+static int wpa_driver_hermes_set_wpa(void *priv, int enabled)
293+{
294+ ltv_t ltv;
295+
296+ wpa_printf(MSG_DEBUG, "%s: enabled=%d", __func__, enabled);
297+
298+ ltv.len = 2;
299+ ltv.typ = CFG_CNF_ENCRYPTION;
300+ ltv.u.u16[0] = enabled ? 2 : 0; /* Setting CFG_CNF_ENCRYPTION to 2 sets WPA: TKIP or better */
301+
302+ return _put_info(priv, &ltv);
303+}
304+
305+
306+static int wpa_driver_hermes_set_key(void *priv, wpa_alg alg,
307+ const u8 *addr, int key_idx,
308+ int set_tx, const u8 *seq, size_t seq_len,
309+ const u8 *key, size_t key_len)
310+{
311+ struct wpa_driver_hermes_data *drv = priv;
312+ int ret = 0;
313+ char *alg_name;
314+ ltv_t ltv;
315+ int count = 0;
316+ int buf_idx = 0;
317+ hcf_8 tsc[] = { 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00 };
318+ hcf_8 rsc[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
319+
320+
321+ switch (alg) {
322+ case WPA_ALG_NONE:
323+ alg_name = "none";
324+ break;
325+ case WPA_ALG_WEP:
326+ alg_name = "WEP";
327+ break;
328+ case WPA_ALG_TKIP:
329+ alg_name = "TKIP";
330+ break;
331+ case WPA_ALG_CCMP:
332+ alg_name = "CCMP";
333+ break;
334+ default:
335+ return -1;
336+ }
337+
338+ wpa_printf(MSG_DEBUG, "%s: alg=%s key_idx=%d set_tx=%d seq_len=%d "
339+ "key_len=%d", __FUNCTION__, alg_name, key_idx, set_tx,
340+ seq_len, key_len);
341+
342+ if (seq_len > IW_ENCODE_SEQ_MAX_SIZE) {
343+ wpa_printf(MSG_DEBUG, "%s: Invalid seq_len %lu", __FUNCTION__, (unsigned long) seq_len);
344+ return -2;
345+ }
346+
347+ /* Check the key index here; if 0, load as Pairwise Key, otherwise, load as
348+ a group key. Note that for the Hermes, the RIDs for group/pairwise keys
349+ are different from each other and different than the default WEP keys as
350+ well. */
351+ switch (alg) {
352+ case WPA_ALG_TKIP:
353+ /* Make sure that there is no data queued up in the firmware before
354+ setting the TKIP keys. If this check is not performed, some data
355+ may be sent out with incorrect MIC and cause synchronizarion
356+ errors with the AP */
357+ /* Check every 1ms for 100ms */
358+ for (count = 0; count < 100; count++) {
359+ usleep(1000);
360+
361+ ltv.len = 2;
362+ ltv.typ = 0xFD91; // This RID not defined in HCF yet!!!
363+ ltv.u.u16[0] = 0;
364+
365+ _get_info( priv, &ltv);
366+
367+ if (ltv.u.u16[0] == 0)
368+ break;
369+ }
370+
371+ if (count == 100)
372+ wpa_printf(MSG_DEBUG, "%s: Timed out waiting for TxQ!", __FUNCTION__);
373+
374+
375+ switch (key_idx) {
376+ case 0:
377+ /* Only load key as pairwise key for Hermes-II and II.5. For Hermes-I,
378+ fall through to the next case and load the pairwise key as
379+ a Group Key at index 0. */
380+ if (drv->type == WL_HERMES_2 || drv->type == WL_HERMES_25) {
381+ ltv.len = 28;
382+ ltv.typ = CFG_ADD_TKIP_MAPPED_KEY;
383+
384+ /* Load the BSSID */
385+ memcpy(&ltv.u.u8[buf_idx], addr, ETH_ALEN);
386+ buf_idx += ETH_ALEN;
387+
388+ /* Load the TKIP key */
389+ memcpy(&ltv.u.u8[buf_idx], &key[0], 16);
390+ buf_idx += 16;
391+
392+ /* Load the TSC */
393+ memcpy(&ltv.u.u8[buf_idx], tsc, 8);
394+ buf_idx += 8;
395+
396+ /* Load the RSC */
397+ /* Copy the RSC from the supplicant to a local buffer, because
398+ the RSC doesn't always contain the padding needed */
399+ memcpy(rsc, seq, seq_len);
400+ memcpy(&ltv.u.u8[buf_idx], rsc, 8);
401+ buf_idx += 8;
402+
403+ /* Load the TxMIC key */
404+ memcpy(&ltv.u.u8[buf_idx], &key[16], 8);
405+ buf_idx += 8;
406+
407+ /* Load the RxMIC key */
408+ memcpy(&ltv.u.u8[buf_idx], &key[24], 8);
409+
410+ /* Send the request to the Hermes */
411+ _put_info(priv, &ltv);
412+ break;
413+ }
414+
415+ case 1:
416+ case 2:
417+ case 3:
418+ ltv.len = 26;
419+ ltv.typ = CFG_ADD_TKIP_DEFAULT_KEY;
420+
421+ /* Load the key Index */
422+ ltv.u.u16[buf_idx] = key_idx;
423+
424+ /* If this is a Tx Key, set bit 8000 */
425+ if (set_tx)
426+ ltv.u.u16[buf_idx] |= 0x8000;
427+
428+ buf_idx += 2;
429+
430+ /* Load the RSC */
431+ /* Copy the RSC from the supplicant to a local buffer, because
432+ the RSC doesn't always contain the padding needed */
433+ memcpy(rsc, seq, seq_len);
434+ memcpy(&ltv.u.u8[buf_idx], rsc, 8);
435+ buf_idx += 8;
436+
437+ /* Load the TKIP, TxMIC, and RxMIC keys in one shot, because in
438+ CFG_ADD_TKIP_DEFAULT_KEY they are back-to-back */
439+ memcpy(&ltv.u.u8[buf_idx], key, key_len);
440+ buf_idx += key_len;
441+
442+ /* Load the TSC */
443+ memcpy(&ltv.u.u8[buf_idx], tsc, 8);
444+
445+ /* Send the request to the Hermes */
446+ _put_info(priv, &ltv);
447+ break;
448+
449+ default:
450+ break;
451+ }
452+
453+ break;
454+
455+ case WPA_ALG_WEP:
456+ case WPA_ALG_CCMP:
457+ break;
458+
459+ case WPA_ALG_NONE:
460+ switch (key_idx) {
461+ case 0:
462+ if (drv->type == WL_HERMES_2 || drv->type == WL_HERMES_25) {
463+ /* Only clear a pairwise key for Hermes-II. For Hermes-I,
464+ fall through to the next case and clear the key as a
465+ Group Key at index 0. */
466+ if (addr) {
467+ ltv.len = 7;
468+ ltv.typ = CFG_REMOVE_TKIP_MAPPED_KEY;
469+
470+ memcpy(&ltv.u.u8[0], addr, ETH_ALEN);
471+
472+ _put_info(priv, &ltv);
473+ }
474+ break;
475+ }
476+
477+ case 1:
478+ case 2:
479+ case 3:
480+ /* Clear the Group TKIP keys by index */
481+ ltv.len = 2;
482+ ltv.typ = CFG_REMOVE_TKIP_DEFAULT_KEY;
483+
484+ ltv.u.u16[0] = key_idx;
485+
486+ _put_info(priv, &ltv);
487+ break;
488+
489+ default:
490+ break;
491+ }
492+ break;
493+
494+ default:
495+ break;
496+ }
497+
498+ return ret;
499+}
500+
501+
502+static int wpa_driver_hermes_set_countermeasures(void *priv, int enabled)
503+{
504+ ltv_t ltv;
505+
506+ /* The supplicant handles all the timers related to MIC failure and
507+ countermeasures. When countermeasures are enabled, shut down the card;
508+ when disable, re-enable the card. Make sure that the EAPOL message
509+ is getting out before card disable */
510+
511+ wpa_printf(MSG_DEBUG, "%s: enabled=%d", __FUNCTION__, enabled);
512+
513+ ltv.len = 2;
514+ ltv.typ = CFG_DRIVER_ENABLE;
515+ ltv.u.u16[0] = enabled ? 0 : 1;
516+
517+ return _put_info(priv, &ltv);
518+}
519+
520+
521+static int wpa_driver_hermes_set_drop_unencrypted(void *priv, int enabled)
522+{
523+ ltv_t ltv;
524+
525+ wpa_printf(MSG_DEBUG, "%s: enabled=%d", __FUNCTION__, enabled);
526+
527+ ltv.len = 2;
528+ ltv.typ = CFG_CNF_EXCL_UNENCRYPTED;
529+ ltv.u.u16[0] = enabled;
530+
531+ return _put_info(priv, &ltv);
532+}
533+
534+
535+static int wpa_driver_hermes_deauthenticate(void *priv, const u8 *addr,
536+ int reason_code)
537+{
538+ wpa_printf(MSG_DEBUG, "%s: *DUMMY* %d", __FUNCTION__, reason_code);
539+
540+ return 0;
541+}
542+
543+
544+static int wpa_driver_hermes_disassociate(void *priv, const u8 *addr, int reason_code)
545+{
546+ ltv_t ltv;
547+
548+ wpa_printf(MSG_DEBUG, "%s: reason=%d", __FUNCTION__, reason_code);
549+
550+ ltv.len = 2;
551+ ltv.typ = 0xFCC8; // This RID not defined in HCF yet!!!
552+ memcpy( &ltv.u.u8[0], addr, ETH_ALEN );
553+ ltv.u.u16[ETH_ALEN / 2] = reason_code;
554+
555+ return _put_info( priv, &ltv);
556+}
557+
558+
559+static int wpa_driver_hermes_associate(
560+ void *priv, struct wpa_driver_associate_params *params)
561+{
562+ struct wpa_driver_hermes_data *drv = priv;
563+
564+#if 0
565+ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__);
566+#else
567+ wpa_printf(MSG_DEBUG, "%s: priv=%p freq=%d pairwise_suite=%d "
568+ "group_suite=%d key_mgmt_suite=%d auth_alg=%d mode=%d",
569+ __func__, priv, params->freq, params->pairwise_suite,
570+ params->group_suite, params->key_mgmt_suite,
571+ params->auth_alg, params->mode);
572+ if (params->bssid) {
573+ wpa_printf(MSG_DEBUG, " bssid=" MACSTR,
574+ MAC2STR(params->bssid));
575+ }
576+ if (params->ssid) {
577+ wpa_hexdump_ascii(MSG_DEBUG, " ssid",
578+ params->ssid, params->ssid_len);
579+ }
580+ if (params->wpa_ie) {
581+ wpa_hexdump(MSG_DEBUG, " wpa_ie",
582+ params->wpa_ie, params->wpa_ie_len);
583+ }
584+#endif
585+
586+ if (wpa_driver_hermes_set_wpa_ie(priv, params->wpa_ie, params->wpa_ie_len) < 0)
587+ return -1;
588+ if (wpa_driver_wext_set_freq(drv->wext, params->freq) < 0)
589+ return -1;
590+ if (wpa_driver_wext_set_ssid(drv->wext, params->ssid, params->ssid_len) < 0)
591+ return -1;
592+#ifdef UNSUPPORTED_IN_HERMES_DRIVER
593+ if (wpa_driver_wext_hermes_bssid(drv->wext, params->bssid) < 0)
594+ return -1;
595+#endif
596+
597+ return 0;
598+}
599+
600+
601+static int wpa_driver_hermes_get_bssid(void *priv, u8 *bssid)
602+{
603+ struct wpa_driver_hermes_data *drv = priv;
604+ return wpa_driver_wext_get_bssid(drv->wext, bssid);
605+}
606+
607+
608+static int wpa_driver_hermes_get_ssid(void *priv, u8 *ssid)
609+{
610+ struct wpa_driver_hermes_data *drv = priv;
611+ return wpa_driver_wext_get_ssid(drv->wext, ssid);
612+}
613+
614+
615+static int wpa_driver_hermes_scan(void *priv, const u8 *ssid, size_t ssid_len)
616+{
617+ struct wpa_driver_hermes_data *drv = priv;
618+ return wpa_driver_wext_scan(drv->wext, ssid, ssid_len);
619+}
620+
621+
622+static int wpa_driver_hermes_get_scan_results(void *priv,
623+ struct wpa_scan_result *results,
624+ size_t max_size)
625+{
626+ struct wpa_driver_hermes_data *drv = priv;
627+ return wpa_driver_wext_get_scan_results(drv->wext, results, max_size);
628+}
629+
630+
631+static void * wpa_driver_hermes_init(void *ctx, const char *ifname)
632+{
633+ struct wpa_driver_hermes_data *drv;
634+
635+ wpa_printf(MSG_DEBUG, "%s: %s", __FUNCTION__, ifname);
636+
637+ drv = malloc(sizeof(*drv));
638+ if (drv == NULL)
639+ return NULL;
640+ memset(drv, 0, sizeof(*drv));
641+
642+ /* Initialize wireless context */
643+ drv->wext = wpa_driver_wext_init(ctx, ifname);
644+ if (drv->wext == NULL) {
645+ perror("no wext context");
646+ goto no_wext;
647+ }
648+
649+ drv->ctx = ctx;
650+ strncpy(drv->ifname, ifname, sizeof(drv->ifname));
651+
652+ drv->sock = socket(PF_INET, SOCK_DGRAM, 0);
653+ if (drv->sock < 0) {
654+ perror("socket(PF_INET,SOCK_DGRAM)");
655+ goto no_sock;
656+ }
657+
658+ _detect_hermes_type(drv);
659+
660+ return drv;
661+
662+no_sock:
663+ wpa_driver_wext_deinit(drv->wext);
664+no_wext:
665+ free(drv);
666+ return NULL;
667+}
668+
669+
670+static void wpa_driver_hermes_deinit(void *priv)
671+{
672+ struct wpa_driver_hermes_data *drv = priv;
673+ wpa_driver_wext_deinit(drv->wext);
674+ close(drv->sock);
675+ free(drv);
676+}
677+
678+
679+
680+
681+struct wpa_driver_ops wpa_driver_hermes_ops = {
682+ .name = "hermes",
683+ .desc = "wpa_supplicant hermes driver",
684+
685+ .init = wpa_driver_hermes_init,
686+ .deinit = wpa_driver_hermes_deinit,
687+
688+ // from old driver_hermes.c:
689+ .get_bssid = wpa_driver_hermes_get_bssid,
690+ .get_ssid = wpa_driver_hermes_get_ssid,
691+ .set_wpa = wpa_driver_hermes_set_wpa,
692+ .set_key = wpa_driver_hermes_set_key,
693+ //.events_init = wpa_driver_wext_events_init,
694+ //.events_deinit = wpa_driver_wext_events_deinit,
695+ .set_countermeasures = wpa_driver_hermes_set_countermeasures,
696+ .set_drop_unencrypted = wpa_driver_hermes_set_drop_unencrypted,
697+ .scan = wpa_driver_hermes_scan,
698+ .get_scan_results = wpa_driver_hermes_get_scan_results,
699+ .deauthenticate = wpa_driver_hermes_deauthenticate,
700+ .disassociate = wpa_driver_hermes_disassociate,
701+ .associate = wpa_driver_hermes_associate,
702+
703+
704+#if 0
705+ /* Not possible with current Hermes driver:
706+ .set_auth_alg = wpa_driver_hermes_set_auth_alg, */
707+#endif
708+};
709--- /dev/null
710+++ wpa_supplicant-0.4.7/driver_hermes.h
711@@ -0,0 +1,173 @@
712+#ifndef HERMES_DRIVER_H
713+#define HERMES_DRIVER_H
714+
715+typedef unsigned char hcf_8;
716+typedef unsigned short hcf_16;
717+typedef unsigned long hcf_32;
718+typedef hcf_16 hcf_io;
719+typedef hcf_8 *wci_bufp;
720+
721+typedef struct {
722+ hcf_16 len;
723+ hcf_16 typ;
724+ unsigned short * bufp;
725+} RID_LOG_STRCT;
726+typedef RID_LOG_STRCT *RID_LOGP;
727+
728+typedef struct {
729+ hcf_16 len;
730+ hcf_16 typ;
731+ hcf_16 comp_id;
732+ hcf_16 variant;
733+ hcf_16 version_major;
734+ hcf_16 version_minor;
735+} CFG_FW_IDENTITY_STRCT;
736+
737+typedef struct {
738+ hcf_32 TxUnicastFrames;
739+ hcf_32 TxMulticastFrames;
740+ hcf_32 TxFragments;
741+ hcf_32 TxUnicastOctets;
742+ hcf_32 TxMulticastOctets;
743+ hcf_32 TxDeferredTransmissions;
744+ hcf_32 TxSingleRetryFrames;
745+ hcf_32 TxMultipleRetryFrames;
746+ hcf_32 TxRetryLimitExceeded;
747+ hcf_32 TxDiscards;
748+ hcf_32 RxUnicastFrames;
749+ hcf_32 RxMulticastFrames;
750+ hcf_32 RxFragments;
751+ hcf_32 RxUnicastOctets;
752+ hcf_32 RxMulticastOctets;
753+ hcf_32 RxFCSErrors;
754+ hcf_32 RxDiscardsNoBuffer;
755+ hcf_32 TxDiscardsWrongSA;
756+ hcf_32 RxWEPUndecryptable;
757+ hcf_32 RxMsgInMsgFragments;
758+ hcf_32 RxMsgInBadMsgFragments;
759+ hcf_32 RxDiscardsWEPICVError;
760+ hcf_32 RxDiscardsWEPExcluded;
761+} CFG_HERMES_TALLIES_STRCT;
762+
763+typedef struct {
764+ hcf_32 not_used_NoBufInq;
765+ hcf_32 NoBufInfo;
766+ hcf_32 NoBufMB;
767+ hcf_32 MiscErr;
768+ hcf_32 EngCnt;
769+} CFG_HCF_TALLIES_STRCT;
770+
771+typedef struct {
772+ hcf_io IFB_IOBase;
773+ hcf_16 IFB_IORange;
774+
775+ hcf_32 IFB_TickIni;
776+
777+ hcf_16 IFB_Version;
778+ hcf_16 IFB_CardStat;
779+ hcf_16 IFB_TraceLvl;
780+ hcf_16 *IFB_MBp;
781+ hcf_16 IFB_MBSize;
782+ hcf_16 IFB_MBWp;
783+ hcf_16 IFB_MBRp;
784+ hcf_16 IFB_MBInfoLen;
785+
786+ hcf_16 IFB_DLMode;
787+ hcf_16 IFB_Magic;
788+ hcf_16 IFB_Cmd;
789+ hcf_16 IFB_RxFID;
790+ RID_LOGP IFB_RIDLogp;
791+ hcf_16 IFB_Monitor;
792+ hcf_16 IFB_TxFid;
793+ hcf_16 IFB_RxLen;
794+ hcf_16 IFB_DefunctStat;
795+
796+ hcf_16 IFB_ErrCmd;
797+ hcf_16 IFB_ErrQualifier;
798+ hcf_16 IFB_lal;
799+ wci_bufp IFB_lap;
800+ hcf_16 IFB_LinkStat;
801+
802+ void (*IFB_MICRxRtn)( hcf_32*, hcf_32 );
803+ void (*IFB_MICTxRtn)( hcf_32*, hcf_32 );
804+ hcf_16 IFB_rx_tlen;
805+ hcf_16 IFB_tx_tlen;
806+ hcf_8 IFB_rx_32[4];
807+ hcf_8 IFB_tx_32[4];
808+ hcf_16 IFB_RscInd;
809+ hcf_16 IFB_MB_FID;
810+ hcf_16 IFB_DLTarget[2];
811+
812+ hcf_16 IFB_DLPage;
813+ hcf_16 IFB_DLOffset;
814+ hcf_16 IFB_DLLen;
815+
816+ hcf_16 volatile IFB_IntOffCnt;
817+ hcf_16 IFB_IntEnMask;
818+
819+ CFG_FW_IDENTITY_STRCT IFB_FWIdentity;
820+ hcf_16 IFB_Tally;
821+ hcf_16 IFB_TallyTyp;
822+
823+ CFG_HERMES_TALLIES_STRCT IFB_NIC_Tallies;
824+ CFG_HCF_TALLIES_STRCT IFB_HCF_Tallies;
825+
826+ void *IFB_MSFSup;
827+} IFB_STRCT;
828+
829+typedef IFB_STRCT* IFBP;
830+
831+struct uilreq
832+{
833+ union
834+ {
835+ char ifrn_name[16];
836+ } ifr_ifrn;
837+
838+ IFBP hcfCtx;
839+ __u8 command;
840+ __u8 result;
841+ __u16 len;
842+ void *data;
843+};
844+
845+typedef struct
846+{
847+ hcf_16 len;
848+ hcf_16 typ;
849+ union
850+ {
851+ hcf_8 u8[(512 - (sizeof(hcf_16) * 2)) / sizeof(hcf_8)];
852+ hcf_16 u16[(512 - (sizeof(hcf_16) * 2)) / sizeof(hcf_16)];
853+ hcf_32 u32[(512 - (sizeof(hcf_16) * 2)) / sizeof(hcf_32)];
854+ } u;
855+} ltv_t;
856+
857+
858+#define UIL_FUN_CONNECT 0x00
859+#define UIL_FUN_DISCONNECT 0x01
860+#define UIL_FUN_GET_INFO 0x04
861+#define UIL_FUN_PUT_INFO 0x05
862+
863+#define GENERIC_INFO_ELEM 0xdd
864+#define RSN_INFO_ELEM 0x30
865+
866+#define CFG_DRIVER_ENABLE 0x0902
867+#define CFG_CNF_ENCRYPTION 0xFC20
868+#define CFG_ADD_TKIP_DEFAULT_KEY 0xFCB4
869+#define CFG_SET_WPA_AUTH_KEY_MGMT_SUITE 0xFCB5
870+#define CFG_REMOVE_TKIP_DEFAULT_KEY 0xFCB6
871+#define CFG_ADD_TKIP_MAPPED_KEY 0xFCB7
872+#define CFG_REMOVE_TKIP_MAPPED_KEY 0xFCB8
873+#define CFG_FW_IDENTITY 0xFD20
874+#define CFG_CNF_EXCL_UNENCRYPTED 0xFC22
875+
876+#define HCF_SUCCESS 0x00
877+#define UIL_SUCCESS 0x00
878+
879+#define COMP_ID_FW_STA 31
880+#define COMP_ID_FW_AP 32
881+
882+#define WVLAN2_IOCTL_UIL SIOCDEVPRIVATE
883+
884+#endif
diff --git a/meta/packages/wpa-supplicant/wpa-supplicant-0.4.7/driver-zd1211.patch b/meta/packages/wpa-supplicant/wpa-supplicant-0.4.7/driver-zd1211.patch
new file mode 100644
index 0000000000..3c731c1256
--- /dev/null
+++ b/meta/packages/wpa-supplicant/wpa-supplicant-0.4.7/driver-zd1211.patch
@@ -0,0 +1,535 @@
1diff -Nur wpa_supplicant-0.4.7/defconfig wpa_supplicant-0.4.7.new/defconfig
2--- wpa_supplicant-0.4.7/defconfig 2005-09-24 20:30:43.000000000 +0200
3+++ wpa_supplicant-0.4.7.new/defconfig 2005-12-26 19:18:14.000000000 +0100
4@@ -68,6 +68,9 @@
5 # Driver interface for Intel ipw2100/2200 driver
6 #CONFIG_DRIVER_IPW=y
7
8+# Driver interface for Zydas zd1211 driver
9+#CONFIG_DRIVER_ZD1211=y
10+
11 # Driver interface for generic Linux wireless extensions
12 CONFIG_DRIVER_WEXT=y
13
14diff -Nur wpa_supplicant-0.4.7/drivers.c wpa_supplicant-0.4.7.new/drivers.c
15--- wpa_supplicant-0.4.7/drivers.c 2005-02-20 01:15:54.000000000 +0100
16+++ wpa_supplicant-0.4.7.new/drivers.c 2005-12-26 19:19:16.000000000 +0100
17@@ -55,6 +55,9 @@
18 #ifdef CONFIG_DRIVER_TEST
19 extern struct wpa_driver_ops wpa_driver_test_ops; /* driver_test.c */
20 #endif /* CONFIG_DRIVER_TEST */
21+#ifdef CONFIG_DRIVER_ZD1211
22+extern struct wpa_driver_ops wpa_driver_zd1211_ops; /* driver_zd1211.c */
23+#endif /* CONFIG_DRIVER_ZD1211 */
24
25
26 struct wpa_driver_ops *wpa_supplicant_drivers[] =
27@@ -98,5 +101,8 @@
28 #ifdef CONFIG_DRIVER_TEST
29 &wpa_driver_test_ops,
30 #endif /* CONFIG_DRIVER_TEST */
31+#ifdef CONFIG_DRIVER_ZD1211
32+ &wpa_driver_zd1211_ops,
33+#endif /* CONFIG_DRIVER_ZD1211 */
34 NULL
35 };
36diff -Nur wpa_supplicant-0.4.7/driver_zd1211.c wpa_supplicant-0.4.7.new/driver_zd1211.c
37--- wpa_supplicant-0.4.7/driver_zd1211.c 1970-01-01 01:00:00.000000000 +0100
38+++ wpa_supplicant-0.4.7.new/driver_zd1211.c 2005-12-27 16:28:46.000000000 +0100
39@@ -0,0 +1,408 @@
40+#include <stdlib.h>
41+#include <stdio.h>
42+#include <unistd.h>
43+#include <string.h>
44+#include <sys/ioctl.h>
45+#include <errno.h>
46+
47+#include "common.h"
48+#include "driver.h"
49+#include "driver_wext.h"
50+#include "eloop.h"
51+#include "wireless_copy.h"
52+#include "wpa_supplicant.h"
53+
54+#include "zd1211_common.h"
55+
56+
57+struct wpa_driver_zd1211_data {
58+ void *ctx;
59+ void *wext; /* private data for driver_wext */
60+ char ifname[IFNAMSIZ + 1];
61+ int sock;
62+};
63+
64+
65+static int zd1211_ioctl(struct wpa_driver_zd1211_data *zd1211_drv, struct zd1211_wlan_param *param, int len, int show_err) {
66+ struct iwreq iwr;
67+
68+ memset(&iwr, 0, sizeof(iwr));
69+ strncpy(iwr.ifr_name, zd1211_drv->ifname, IFNAMSIZ);
70+ iwr.u.data.pointer = (caddr_t) param;
71+ iwr.u.data.length = len;
72+
73+ if (ioctl(zd1211_drv->sock, ZD_IOCTL_WPA, &iwr) < 0) {
74+ int ret;
75+
76+ ret = errno;
77+ if (show_err)
78+ perror("ioctl[ZD_IOCTL_WPA]");
79+ return ret;
80+ }
81+
82+ return 0;
83+}
84+
85+
86+static int zd1211_set_param(struct wpa_driver_zd1211_data *zd1211_drv, int op, int arg, int show_err) {
87+ struct iwreq iwr;
88+ int *i, ret = 0;
89+
90+ memset(&iwr, 0, sizeof(iwr));
91+ strncpy(iwr.ifr_name, zd1211_drv->ifname, IFNAMSIZ);
92+ i = (int *) iwr.u.name;
93+ *i++ = op;
94+ *i++ = arg;
95+
96+ if (ioctl(zd1211_drv->sock, ZD_IOCTL_PARAM, &iwr) < 0) {
97+ perror("ioctl[ZD_IOCTL_PARAM]");
98+ ret = -1;
99+ }
100+
101+ return ret;
102+}
103+
104+
105+static int wpa_driver_zd1211_get_scan_results(void *priv, struct wpa_scan_result *results, size_t max_size) {
106+ struct wpa_driver_zd1211_data *zd1211_drv;
107+
108+ zd1211_drv = priv;
109+ return wpa_driver_wext_get_scan_results(zd1211_drv->wext, results, max_size);
110+}
111+
112+
113+static int wpa_driver_zd1211_get_bssid(void *priv, u8 *bssid) {
114+ struct wpa_driver_zd1211_data *zd1211_drv;
115+
116+ zd1211_drv = priv;
117+ return wpa_driver_wext_get_bssid(zd1211_drv->wext, bssid);
118+}
119+
120+
121+static int wpa_driver_zd1211_get_ssid(void *priv, u8 *ssid) {
122+ struct wpa_driver_zd1211_data *zd1211_drv;
123+
124+ zd1211_drv = priv;
125+ return wpa_driver_wext_get_ssid(zd1211_drv->wext, ssid);
126+}
127+
128+
129+static int wpa_driver_zd1211_set_auth_alg(void *priv, int auth_alg) {
130+ struct wpa_driver_zd1211_data *zd1211_drv = priv;
131+ int algs = 0;
132+
133+ if (auth_alg & AUTH_ALG_OPEN_SYSTEM)
134+ algs = 0;
135+ if (auth_alg & AUTH_ALG_SHARED_KEY)
136+ algs = 1;
137+
138+ return zd1211_set_param(zd1211_drv, ZD_PARAM_AUTH_ALGS, algs, 1);
139+}
140+
141+
142+static int wpa_driver_zd1211_set_countermeasures(void *priv, int enabled) {
143+ struct wpa_driver_zd1211_data *zd1211_drv = priv;
144+
145+ /* Enable the countermeasure */
146+ wpa_printf(MSG_DEBUG, "%s: enabled=%d", __FUNCTION__, enabled);
147+ return zd1211_set_param(zd1211_drv, ZD_PARAM_COUNTERMEASURES, enabled, 1);
148+}
149+
150+
151+static int wpa_driver_zd1211_set_drop_unencrypted(void *priv, int enabled) {
152+ struct wpa_driver_zd1211_data *zd1211_drv = priv;
153+
154+ /* Enable the countermeasure */
155+ wpa_printf(MSG_DEBUG, "%s: enabled=%d", __FUNCTION__, enabled);
156+ return zd1211_set_param(zd1211_drv, ZD_PARAM_DROPUNENCRYPTED, enabled, 1);
157+}
158+
159+
160+static int wpa_driver_zd1211_set_key(void *priv, wpa_alg alg,
161+ const u8 *addr, int key_idx,
162+ int set_tx, const u8 *seq, size_t seq_len,
163+ const u8 *key, size_t key_len) {
164+ struct wpa_driver_zd1211_data *zd1211_drv = priv;
165+ struct zd1211_wlan_param *param;
166+ u8 *buf;
167+ size_t blen;
168+ int ret = 0;
169+ char *alg_name;
170+
171+ switch (alg) {
172+ case WPA_ALG_NONE:
173+ alg_name = "NONE";
174+ break;
175+ case WPA_ALG_WEP:
176+ alg_name = "WEP";
177+ break;
178+ case WPA_ALG_TKIP:
179+ alg_name = "TKIP";
180+ break;
181+ case WPA_ALG_CCMP:
182+ alg_name = "CCMP";
183+ break;
184+ default:
185+ return -1;
186+ }
187+
188+ wpa_printf(MSG_DEBUG, "%s: alg=%s key_idx=%d set_tx=%d seq_len=%d "
189+ "key_len=%d", __FUNCTION__, alg_name, key_idx, set_tx,
190+ seq_len, key_len);
191+
192+ if (seq_len > 8)
193+ return -2;
194+
195+ blen = sizeof(*param) + key_len;
196+ buf = malloc(blen);
197+ if (buf == NULL)
198+ return -1;
199+ memset(buf, 0, blen);
200+
201+ param = (struct zd1211_wlan_param *) buf;
202+ param->cmd = ZD_CMD_SET_ENCRYPT_KEY;
203+ /* TODO: In theory, STA in client mode can use five keys; four default
204+ * keys for receiving (with keyidx 0..3) and one individual key for
205+ * both transmitting and receiving (keyidx 0) _unicast_ packets. Now,
206+ * keyidx 0 is reserved for this unicast use and default keys can only
207+ * use keyidx 1..3 (i.e., default key with keyidx 0 is not supported).
208+ * This should be fine for more or less all cases, but for completeness
209+ * sake, the driver could be enhanced to support the missing key. */
210+#if 0
211+ if (addr == NULL)
212+ memset(param->sta_addr, 0xff, ETH_ALEN);
213+ else
214+ memcpy(param->sta_addr, addr, ETH_ALEN);
215+#else
216+ memset(param->sta_addr, 0xff, ETH_ALEN);
217+#endif
218+ strncpy(param->u.crypt.alg, alg_name, ZD_CRYPT_ALG_NAME_LEN);
219+ param->u.crypt.flags = set_tx ? ZD_FLAG_SET_TX_KEY : 0;
220+ param->u.crypt.idx = key_idx;
221+ memcpy(param->u.crypt.seq, seq, seq_len);
222+ param->u.crypt.key_len = key_len;
223+ memcpy((u8 *) param->u.crypt.key, key, key_len);
224+
225+ /* Dump key context */
226+ if(alg == WPA_ALG_TKIP) {
227+ int ii;
228+
229+ wpa_printf(MSG_DEBUG, "Key Context:");
230+ for(ii = 0; ii < key_len; ) {
231+ printf("0x%02x ", key[ii]);
232+
233+ if((++ii % 16) == 0)
234+ printf("\n");
235+ }
236+
237+ printf("\n");
238+ }
239+
240+ if (zd1211_ioctl(zd1211_drv, param, blen, 1)) {
241+ wpa_printf(MSG_WARNING, "Failed to set encryption.");
242+ //show_set_key_error(param);
243+ ret = -1;
244+ }
245+ free(buf);
246+
247+ return ret;
248+}
249+
250+
251+static int wpa_driver_zd1211_set_wpa_ie(struct wpa_driver_zd1211_data *zd1211_drv, const u8 *wpa_ie, size_t wpa_ie_len) {
252+ int res;
253+ struct zd1211_wlan_param *param;
254+ size_t blen = ZD_GENERIC_ELEMENT_HDR_LEN + wpa_ie_len;
255+
256+ if (blen < sizeof(*param))
257+ blen = sizeof(*param);
258+
259+ param = (struct zd1211_wlan_param *) malloc(blen);
260+ if (param == NULL)
261+ return -1;
262+
263+ memset(param, 0, blen);
264+ param->cmd = ZD_CMD_SET_GENERIC_ELEMENT;
265+ param->u.generic_elem.len = wpa_ie_len;
266+ memcpy(param->u.generic_elem.data, wpa_ie, wpa_ie_len);
267+ res = zd1211_ioctl(zd1211_drv, param, blen, 1);
268+
269+ free(param);
270+
271+ return res;
272+}
273+
274+
275+static int wpa_driver_zd1211_set_wpa(void *priv, int enabled) {
276+ struct wpa_driver_zd1211_data *zd1211_drv = priv;
277+ int ret = 0;
278+
279+ wpa_printf(MSG_DEBUG, "%s: enabled=%d", __FUNCTION__, enabled);
280+
281+ if (!enabled && wpa_driver_zd1211_set_wpa_ie(zd1211_drv, NULL, 0) < 0)
282+ ret = -1;
283+ if (zd1211_set_param(zd1211_drv, ZD_PARAM_ROAMING, enabled, 1) < 0)
284+ ret = -1;
285+ if (zd1211_set_param(zd1211_drv, ZD_PARAM_PRIVACY, enabled, 1) < 0)
286+ ret = -1;
287+ if (zd1211_set_param(zd1211_drv, ZD_PARAM_WPA, enabled, 1) < 0)
288+ ret = -1;
289+
290+ return ret;
291+}
292+
293+
294+static int wpa_driver_zd1211_associate(void *priv, struct wpa_driver_associate_params *params) {
295+ struct wpa_driver_zd1211_data *zd1211_drv = priv;
296+ int ret = 0;
297+
298+ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__);
299+
300+ /* Because there might be the case, two or more APs with the same
301+ * SSID, in order to identify them, we need to set the BSSID. */
302+ if (wpa_driver_zd1211_set_wpa_ie(zd1211_drv, params->wpa_ie, params->wpa_ie_len) < 0)
303+ ret = -1;
304+ if (wpa_driver_wext_set_ssid(zd1211_drv->wext, params->ssid, params->ssid_len) < 0)
305+ ret = -1;
306+
307+ // Mark for test
308+ //if (wpa_driver_wext_set_bssid(ifname, bssid) < 0)
309+ // ret = -1;
310+
311+#if 0
312+ /* Allow unencrypted EAPOL messages even if pairwise keys are set when
313+ * not using WPA. IEEE 802.1X specifies that these frames are not
314+ * encrypted, but WPA encrypts them when pairwise keys are in use. */
315+ if (key_mgmt_suite == KEY_MGMT_802_1X ||
316+ key_mgmt_suite == KEY_MGMT_PSK)
317+ allow_unencrypted_eapol = 0;
318+ else
319+ allow_unencrypted_eapol = 1;
320+
321+ if (prism2param(ifname, PRISM2_PARAM_IEEE_802_1X,
322+ allow_unencrypted_eapol) < 0) {
323+ wpa_printf(MSG_DEBUG, "hostap: Failed to configure "
324+ "ieee_802_1x param");
325+ /* Ignore this error.. driver_hostap.c can also be used with
326+ * other drivers that do not support this prism2_param. */
327+ }
328+#endif
329+
330+ return ret;
331+}
332+
333+
334+static int wpa_driver_zd1211_deauthenticate(void *priv, const u8 *addr, int reason_code) {
335+ struct zd1211_wlan_param *param;
336+ struct wpa_driver_zd1211_data *zd1211_drv = priv;
337+ int blen;
338+ int ret;
339+
340+ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__);
341+
342+ blen = sizeof(*param);
343+ param = (struct zd1211_wlan_param *) malloc(blen);
344+ if (param == NULL)
345+ return -1;
346+
347+ memset(param, 0, blen);
348+ param->cmd = ZD_CMD_SET_MLME;
349+ param->u.mlme.cmd = MLME_STA_DEAUTH;
350+ param->u.mlme.reason_code = reason_code;
351+ memcpy(param->sta_addr, addr, ETH_ALEN);
352+ ret = zd1211_ioctl(zd1211_drv, param, blen, 1);
353+ usleep(100000);
354+ free(param);
355+ return ret;
356+}
357+
358+
359+static int wpa_driver_zd1211_disassociate(void *priv, const u8 *addr, int reason_code) {
360+ struct zd1211_wlan_param *param;
361+ struct wpa_driver_zd1211_data *zd1211_drv = priv;
362+ int blen;
363+ int ret;
364+
365+ wpa_printf(MSG_DEBUG, "%s", __FUNCTION__);
366+
367+ blen = sizeof(*param);
368+ param = (struct zd1211_wlan_param *) malloc(blen);
369+ if (param == NULL)
370+ return -1;
371+
372+ memset(param, 0, blen);
373+ param->cmd = ZD_CMD_SET_MLME;
374+ param->u.mlme.cmd = MLME_STA_DISASSOC;
375+ param->u.mlme.reason_code = reason_code;
376+ memcpy(param->sta_addr, addr, ETH_ALEN);
377+ ret = zd1211_ioctl(zd1211_drv, param, blen, 1);
378+ free(param);
379+ return ret;
380+}
381+
382+
383+static int wpa_driver_zd1211_scan(void *priv, const u8 *ssid, size_t ssid_len) {
384+ struct wpa_driver_zd1211_data *zd1211_drv;
385+
386+ zd1211_drv = priv;
387+ return wpa_driver_wext_scan(zd1211_drv->wext, ssid, ssid_len);
388+}
389+
390+
391+static void * wpa_driver_zd1211_init(void *ctx, const char *ifname) {
392+ struct wpa_driver_zd1211_data *zd1211_drv;
393+
394+ zd1211_drv = malloc(sizeof(*zd1211_drv));
395+ if (zd1211_drv == NULL)
396+ return NULL;
397+ memset(zd1211_drv, 0, sizeof(*zd1211_drv));
398+
399+ zd1211_drv->wext = wpa_driver_wext_init(ctx, ifname);
400+ if (zd1211_drv->wext == NULL)
401+ goto exit_no_wext;
402+
403+ zd1211_drv->ctx = ctx;
404+ strncpy(zd1211_drv->ifname, ifname, sizeof(zd1211_drv->ifname));
405+
406+ zd1211_drv->sock = socket(PF_INET, SOCK_DGRAM, 0);
407+ if (zd1211_drv->sock < 0)
408+ goto exit_no_socket;
409+
410+ return zd1211_drv;
411+
412+exit_no_socket:
413+ wpa_driver_wext_deinit(zd1211_drv->wext);
414+exit_no_wext:
415+ free(zd1211_drv);
416+ return NULL;
417+}
418+
419+
420+static void wpa_driver_zd1211_deinit(void *ctx) {
421+ struct wpa_driver_zd1211_data *zd1211_drv = ctx;
422+
423+ wpa_driver_wext_deinit(zd1211_drv->wext);
424+ close(zd1211_drv->sock);
425+ free(zd1211_drv);
426+}
427+
428+
429+struct wpa_driver_ops wpa_driver_zd1211_ops = {
430+ .name = "zd1211",
431+ .desc = "Zydas zd1211 drivers",
432+ .init = wpa_driver_zd1211_init,
433+ .deinit = wpa_driver_zd1211_deinit,
434+ .associate = wpa_driver_zd1211_associate,
435+ .deauthenticate = wpa_driver_zd1211_deauthenticate,
436+ .disassociate = wpa_driver_zd1211_disassociate,
437+ .get_bssid = wpa_driver_zd1211_get_bssid,
438+ .get_scan_results = wpa_driver_zd1211_get_scan_results,
439+ .get_ssid = wpa_driver_zd1211_get_ssid,
440+// .get_capa = wpa_driver_zd1211_get_capa,
441+ .scan = wpa_driver_zd1211_scan,
442+ .set_auth_alg = wpa_driver_zd1211_set_auth_alg,
443+ .set_countermeasures = wpa_driver_zd1211_set_countermeasures,
444+ .set_drop_unencrypted = wpa_driver_zd1211_set_drop_unencrypted,
445+ .set_key = wpa_driver_zd1211_set_key,
446+ .set_wpa = wpa_driver_zd1211_set_wpa,
447+};
448diff -Nur wpa_supplicant-0.4.7/Makefile wpa_supplicant-0.4.7.new/Makefile
449--- wpa_supplicant-0.4.7/Makefile 2005-11-21 02:42:12.000000000 +0100
450+++ wpa_supplicant-0.4.7.new/Makefile 2005-12-26 19:17:14.000000000 +0100
451@@ -107,6 +107,12 @@
452 CONFIG_WIRELESS_EXTENSION=y
453 endif
454
455+ifdef CONFIG_DRIVER_ZD1211
456+CFLAGS += -DCONFIG_DRIVER_ZD1211
457+OBJS_d += driver_zd1211.o
458+CONFIG_WIRELESS_EXTENSION=y
459+endif
460+
461 ifdef CONFIG_DRIVER_BSD
462 CFLAGS += -DCONFIG_DRIVER_BSD
463 OBJS_d += driver_bsd.o
464diff -Nur wpa_supplicant-0.4.7/zd1211_common.h wpa_supplicant-0.4.7.new/zd1211_common.h
465--- wpa_supplicant-0.4.7/zd1211_common.h 1970-01-01 01:00:00.000000000 +0100
466+++ wpa_supplicant-0.4.7.new/zd1211_common.h 2005-12-27 16:00:36.000000000 +0100
467@@ -0,0 +1,68 @@
468+#ifndef ZD1211_COMMON_H
469+#define ZD1211_COMMON_H
470+
471+
472+#define ZD_IOCTL_WPA (SIOCDEVPRIVATE + 1)
473+#define ZD_IOCTL_PARAM (SIOCDEVPRIVATE + 2)
474+
475+#define ZD_PARAM_ROAMING 0x0001
476+#define ZD_PARAM_PRIVACY 0x0002
477+#define ZD_PARAM_WPA 0x0003
478+#define ZD_PARAM_COUNTERMEASURES 0x0004
479+#define ZD_PARAM_DROPUNENCRYPTED 0x0005
480+#define ZD_PARAM_AUTH_ALGS 0x0006
481+
482+#define ZD_CMD_SET_ENCRYPT_KEY 0x0001
483+#define ZD_CMD_SET_MLME 0x0002
484+//#define ZD_CMD_SCAN_REQ 0x0003
485+#define ZD_CMD_SET_GENERIC_ELEMENT 0x0004
486+
487+#define ZD_FLAG_SET_TX_KEY 0x0001
488+
489+#define ZD_GENERIC_ELEMENT_HDR_LEN \
490+((int) (&((struct zd1211_wlan_param *) 0)->u.generic_elem.data))
491+
492+#define ZD_CRYPT_ALG_NAME_LEN 16
493+#define ZD_MAX_KEY_SIZE 32
494+#define ZD_MAX_GENERIC_SIZE 64
495+
496+/* structure definition */
497+
498+struct zd1211_wlan_param {
499+ u32 cmd;
500+ u8 sta_addr[ETH_ALEN];
501+ union {
502+ struct {
503+ u8 alg[ZD_CRYPT_ALG_NAME_LEN];
504+ u32 flags;
505+ u32 err;
506+ u8 idx;
507+ u8 seq[8]; /* sequence counter (set: RX, get: TX) */
508+ u16 key_len;
509+ u8 key[ZD_MAX_KEY_SIZE];
510+ } crypt;
511+/*
512+ struct {
513+ u32 flags_and;
514+ u32 flags_or;
515+ } set_flags_sta;
516+*/
517+ struct {
518+ u8 len;
519+ u8 data[ZD_MAX_GENERIC_SIZE];
520+ } generic_elem;
521+ struct {
522+#define MLME_STA_DEAUTH 0
523+#define MLME_STA_DISASSOC 1
524+ u16 cmd;
525+ u16 reason_code;
526+ } mlme;
527+ struct {
528+ u8 ssid_len;
529+ u8 ssid[32];
530+ } scan_req;
531+ } u;
532+};
533+
534+
535+#endif
diff --git a/meta/packages/wpa-supplicant/wpa-supplicant-0.4.7/madwifi-bsd-fix.diff b/meta/packages/wpa-supplicant/wpa-supplicant-0.4.7/madwifi-bsd-fix.diff
new file mode 100644
index 0000000000..974eb39627
--- /dev/null
+++ b/meta/packages/wpa-supplicant/wpa-supplicant-0.4.7/madwifi-bsd-fix.diff
@@ -0,0 +1,12 @@
1--- driver_madwifi.c.orig 2005-03-18 15:12:53.392793216 +0100
2+++ driver_madwifi.c 2005-03-18 15:13:09.246383104 +0100
3@@ -25,7 +25,8 @@
4 #include "eloop.h"
5 #include "wpa_supplicant.h"
6
7-#include <include/compat.h>
8+#include <net80211/compat.h>
9+#include <net80211/_ieee80211.h>
10 #include <net80211/ieee80211.h>
11 #include <net80211/ieee80211_crypto.h>
12 #include <net80211/ieee80211_ioctl.h>
diff --git a/meta/packages/wpa-supplicant/wpa-supplicant-0.4.7/wpa_supplicant.conf b/meta/packages/wpa-supplicant/wpa-supplicant-0.4.7/wpa_supplicant.conf
new file mode 100644
index 0000000000..da407b5ef3
--- /dev/null
+++ b/meta/packages/wpa-supplicant/wpa-supplicant-0.4.7/wpa_supplicant.conf
@@ -0,0 +1,502 @@
1##### Example wpa_supplicant configuration file ###############################
2# Empty lines and lines starting with # are ignored
3
4# NOTE! This file may contain password information and should probably be made
5# readable only by root user on multiuser systems.
6
7# global configuration (shared by all network blocks)
8#
9# Interface for separate control program. If this is specified, wpa_supplicant
10# will create this directory and a UNIX domain socket for listening to requests
11# from external programs (CLI/GUI, etc.) for status information and
12# configuration. The socket file will be named based on the interface name, so
13# multiple wpa_supplicant processes can be run at the same time if more than
14# one interface is used.
15# /var/run/wpa_supplicant is the recommended directory for sockets and by
16# default, wpa_cli will use it when trying to connect with wpa_supplicant.
17ctrl_interface=/var/run/wpa_supplicant
18
19# Access control for the control interface can be configured by setting the
20# directory to allow only members of a group to use sockets. This way, it is
21# possible to run wpa_supplicant as root (since it needs to change network
22# configuration and open raw sockets) and still allow GUI/CLI components to be
23# run as non-root users. However, since the control interface can be used to
24# change the network configuration, this access needs to be protected in many
25# cases. By default, wpa_supplicant is configured to use gid 0 (root). If you
26# want to allow non-root users to use the control interface, add a new group
27# and change this value to match with that group. Add users that should have
28# control interface access to this group. If this variable is commented out or
29# not included in the configuration file, group will not be changed from the
30# value it got by default when the directory or socket was created.
31#
32# This variable can be a group name or gid.
33#ctrl_interface_group=wheel
34ctrl_interface_group=0
35
36# IEEE 802.1X/EAPOL version
37# wpa_supplicant was implemented based on IEEE 802-1X-REV-d8 which defines
38# EAPOL version 2. However, there are many APs that do not handle the new
39# version number correctly (they seem to drop the frames completely). In order
40# to make wpa_supplicant interoperate with these APs, the version number is set
41# to 1 by default. This configuration value can be used to set it to the new
42# version (2).
43eapol_version=1
44
45# AP scanning/selection
46# By default, wpa_supplicant requests driver to perform AP scanning and then
47# uses the scan results to select a suitable AP. Another alternative is to
48# allow the driver to take care of AP scanning and selection and use
49# wpa_supplicant just to process EAPOL frames based on IEEE 802.11 association
50# information from the driver.
51# 1: wpa_supplicant initiates scanning and AP selection
52# 0: driver takes care of scanning, AP selection, and IEEE 802.11 association
53# parameters (e.g., WPA IE generation); this mode can also be used with
54# non-WPA drivers when using IEEE 802.1X mode; do not try to associate with
55# APs (i.e., external program needs to control association)
56# 2: like 0, but associate with APs using security policy and SSID (but not
57# BSSID); this can be used, e.g., with ndiswrapper and NDIS driver to
58# enable operation with hidden SSIDs and optimized roaming; in this mode,
59# only the first network block in the configuration file is used and this
60# configuration should have explicit security policy (i.e., only one option
61# in the lists) for key_mgmt, pairwise, group, proto variables
62ap_scan=1
63
64# EAP fast re-authentication
65# By default, fast re-authentication is enabled for all EAP methods that
66# support it. This variable can be used to disable fast re-authentication.
67# Normally, there is no need to disable this.
68fast_reauth=1
69
70# network block
71#
72# Each network (usually AP's sharing the same SSID) is configured as a separate
73# block in this configuration file. The network blocks are in preference order
74# (the first match is used).
75#
76# network block fields:
77#
78# ssid: SSID (mandatory); either as an ASCII string with double quotation or
79# as hex string; network name
80#
81# scan_ssid:
82# 0 = do not scan this SSID with specific Probe Request frames (default)
83# 1 = scan with SSID-specific Probe Request frames (this can be used to
84# find APs that do not accept broadcast SSID or use multiple SSIDs;
85# this will add latency to scanning, so enable this only when needed)
86#
87# bssid: BSSID (optional); if set, this network block is used only when
88# associating with the AP using the configured BSSID
89#
90# priority: priority group (integer)
91# By default, all networks will get same priority group (0). If some of the
92# networks are more desirable, this field can be used to change the order in
93# which wpa_supplicant goes through the networks when selecting a BSS. The
94# priority groups will be iterated in decreasing priority (i.e., the larger the
95# priority value, the sooner the network is matched against the scan results).
96# Within each priority group, networks will be selected based on security
97# policy, signal strength, etc.
98# Please note that AP scanning with scan_ssid=1 is not using this priority to
99# select the order for scanning. Instead, it uses the order the networks are in
100# the configuration file.
101#
102# mode: IEEE 802.11 operation mode
103# 0 = infrastructure (Managed) mode, i.e., associate with an AP (default)
104# 1 = IBSS (ad-hoc, peer-to-peer)
105# Note: IBSS can only be used with key_mgmt NONE (plaintext and static WEP)
106# and key_mgmt=WPA-NONE (fixed group key TKIP/CCMP). In addition, ap_scan has
107# to be set to 2 for IBSS. WPA-None requires following network block options:
108# proto=WPA, key_mgmt=WPA-NONE, pairwise=NONE, group=TKIP (or CCMP, but not
109# both), and psk must also be set.
110#
111# proto: list of accepted protocols
112# WPA = WPA/IEEE 802.11i/D3.0
113# RSN = WPA2/IEEE 802.11i (also WPA2 can be used as an alias for RSN)
114# If not set, this defaults to: WPA RSN
115#
116# key_mgmt: list of accepted authenticated key management protocols
117# WPA-PSK = WPA pre-shared key (this requires 'psk' field)
118# WPA-EAP = WPA using EAP authentication (this can use an external
119# program, e.g., Xsupplicant, for IEEE 802.1X EAP Authentication
120# IEEE8021X = IEEE 802.1X using EAP authentication and (optionally) dynamically
121# generated WEP keys
122# NONE = WPA is not used; plaintext or static WEP could be used
123# If not set, this defaults to: WPA-PSK WPA-EAP
124#
125# auth_alg: list of allowed IEEE 802.11 authentication algorithms
126# OPEN = Open System authentication (required for WPA/WPA2)
127# SHARED = Shared Key authentication (requires static WEP keys)
128# LEAP = LEAP/Network EAP (only used with LEAP)
129# If not set, automatic selection is used (Open System with LEAP enabled if
130# LEAP is allowed as one of the EAP methods).
131#
132# pairwise: list of accepted pairwise (unicast) ciphers for WPA
133# CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0]
134# TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0]
135# NONE = Use only Group Keys (deprecated, should not be included if APs support
136# pairwise keys)
137# If not set, this defaults to: CCMP TKIP
138#
139# group: list of accepted group (broadcast/multicast) ciphers for WPA
140# CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0]
141# TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0]
142# WEP104 = WEP (Wired Equivalent Privacy) with 104-bit key
143# WEP40 = WEP (Wired Equivalent Privacy) with 40-bit key [IEEE 802.11]
144# If not set, this defaults to: CCMP TKIP WEP104 WEP40
145#
146# psk: WPA preshared key; 256-bit pre-shared key
147# The key used in WPA-PSK mode can be entered either as 64 hex-digits, i.e.,
148# 32 bytes or as an ASCII passphrase (in which case, the real PSK will be
149# generated using the passphrase and SSID). ASCII passphrase must be between
150# 8 and 63 characters (inclusive).
151# This field is not needed, if WPA-EAP is used.
152# Note: Separate tool, wpa_passphrase, can be used to generate 256-bit keys
153# from ASCII passphrase. This process uses lot of CPU and wpa_supplicant
154# startup and reconfiguration time can be optimized by generating the PSK only
155# only when the passphrase or SSID has actually changed.
156#
157# eapol_flags: IEEE 802.1X/EAPOL options (bit field)
158# Dynamic WEP key require for non-WPA mode
159# bit0 (1): require dynamically generated unicast WEP key
160# bit1 (2): require dynamically generated broadcast WEP key
161# (3 = require both keys; default)
162#
163# Following fields are only used with internal EAP implementation.
164# eap: space-separated list of accepted EAP methods
165# MD5 = EAP-MD5 (unsecure and does not generate keying material ->
166# cannot be used with WPA; to be used as a Phase 2 method
167# with EAP-PEAP or EAP-TTLS)
168# MSCHAPV2 = EAP-MSCHAPv2 (cannot be used separately with WPA; to be used
169# as a Phase 2 method with EAP-PEAP or EAP-TTLS)
170# OTP = EAP-OTP (cannot be used separately with WPA; to be used
171# as a Phase 2 method with EAP-PEAP or EAP-TTLS)
172# GTC = EAP-GTC (cannot be used separately with WPA; to be used
173# as a Phase 2 method with EAP-PEAP or EAP-TTLS)
174# TLS = EAP-TLS (client and server certificate)
175# PEAP = EAP-PEAP (with tunnelled EAP authentication)
176# TTLS = EAP-TTLS (with tunnelled EAP or PAP/CHAP/MSCHAP/MSCHAPV2
177# authentication)
178# If not set, all compiled in methods are allowed.
179#
180# identity: Identity string for EAP
181# anonymous_identity: Anonymous identity string for EAP (to be used as the
182# unencrypted identity with EAP types that support different tunnelled
183# identity, e.g., EAP-TTLS)
184# password: Password string for EAP
185# ca_cert: File path to CA certificate file. This file can have one or more
186# trusted CA certificates. If ca_cert is not included, server certificate
187# will not be verified. This is insecure and the CA file should always be
188# configured.
189# client_cert: File path to client certificate file (PEM/DER)
190# private_key: File path to client private key file (PEM/DER/PFX)
191# When PKCS#12/PFX file (.p12/.pfx) is used, client_cert should be
192# commented out. Both the private key and certificate will be read from
193# the PKCS#12 file in this case.
194# private_key_passwd: Password for private key file
195# dh_file: File path to DH/DSA parameters file (in PEM format)
196# This is an optional configuration file for setting parameters for an
197# ephemeral DH key exchange. In most cases, the default RSA
198# authentication does not use this configuration. However, it is possible
199# setup RSA to use ephemeral DH key exchange. In addition, ciphers with
200# DSA keys always use ephemeral DH keys. This can be used to achieve
201# forward secrecy. If the file is in DSA parameters format, it will be
202# automatically converted into DH params.
203# subject_match: Substring to be matched against the subject of the
204# authentication server certificate. If this string is set, the server
205# sertificate is only accepted if it contains this string in the subject.
206# The subject string is in following format:
207# /C=US/ST=CA/L=San Francisco/CN=Test AS/emailAddress=as@example.com
208# phase1: Phase1 (outer authentication, i.e., TLS tunnel) parameters
209# (string with field-value pairs, e.g., "peapver=0" or
210# "peapver=1 peaplabel=1")
211# 'peapver' can be used to force which PEAP version (0 or 1) is used.
212# 'peaplabel=1' can be used to force new label, "client PEAP encryption",
213# to be used during key derivation when PEAPv1 or newer. Most existing
214# PEAPv1 implementation seem to be using the old label, "client EAP
215# encryption", and wpa_supplicant is now using that as the default value.
216# Some servers, e.g., Radiator, may require peaplabel=1 configuration to
217# interoperate with PEAPv1; see eap_testing.txt for more details.
218# 'peap_outer_success=0' can be used to terminate PEAP authentication on
219# tunneled EAP-Success. This is required with some RADIUS servers that
220# implement draft-josefsson-pppext-eap-tls-eap-05.txt (e.g.,
221# Lucent NavisRadius v4.4.0 with PEAP in "IETF Draft 5" mode)
222# sim_min_num_chal=3 can be used to configure EAP-SIM to require three
223# challenges (by default, it accepts 2 or 3)
224# phase2: Phase2 (inner authentication with TLS tunnel) parameters
225# (string with field-value pairs, e.g., "auth=MSCHAPV2" for EAP-PEAP or
226# "autheap=MSCHAPV2 autheap=MD5" for EAP-TTLS)
227# Following certificate/private key fields are used in inner Phase2
228# authentication when using EAP-TTLS or EAP-PEAP.
229# ca_cert2: File path to CA certificate file. This file can have one or more
230# trusted CA certificates. If ca_cert2 is not included, server
231# certificate will not be verified. This is insecure and the CA file
232# should always be configured.
233# client_cert2: File path to client certificate file
234# private_key2: File path to client private key file
235# private_key2_passwd: Password for private key file
236# dh_file2: File path to DH/DSA parameters file (in PEM format)
237# subject_match2: Substring to be matched against the subject of the
238# authentication server certificate.
239#
240# EAP-PSK variables:
241# eappsk: 16-byte (128-bit, 32 hex digits) pre-shared key in hex format
242# nai: user NAI
243# server_nai: authentication server NAI
244#
245# EAP-FAST variables:
246# pac_file: File path for the PAC entries. wpa_supplicant will need to be able
247# to create this file and write updates to it when PAC is being
248# provisioned or refreshed.
249# phase1: fast_provisioning=1 option enables in-line provisioning of EAP-FAST
250# credentials (PAC)
251#
252# wpa_supplicant supports number of "EAP workarounds" to work around
253# interoperability issues with incorrectly behaving authentication servers.
254# These are enabled by default because some of the issues are present in large
255# number of authentication servers. Strict EAP conformance mode can be
256# configured by disabling workarounds with eap_workaround=0.
257
258# Example blocks:
259
260# Simple case: WPA-PSK, PSK as an ASCII passphrase, allow all valid ciphers
261network={
262 ssid="simple"
263 psk="very secret passphrase"
264 priority=5
265}
266
267# Same as previous, but request SSID-specific scanning (for APs that reject
268# broadcast SSID)
269network={
270 ssid="second ssid"
271 scan_ssid=1
272 psk="very secret passphrase"
273 priority=2
274}
275
276# Only WPA-PSK is used. Any valid cipher combination is accepted.
277network={
278 ssid="example"
279 proto=WPA
280 key_mgmt=WPA-PSK
281 pairwise=CCMP TKIP
282 group=CCMP TKIP WEP104 WEP40
283 psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb
284 priority=2
285}
286
287# Only WPA-EAP is used. Both CCMP and TKIP is accepted. An AP that used WEP104
288# or WEP40 as the group cipher will not be accepted.
289network={
290 ssid="example"
291 proto=RSN
292 key_mgmt=WPA-EAP
293 pairwise=CCMP TKIP
294 group=CCMP TKIP
295 eap=TLS
296 identity="user@example.com"
297 ca_cert="/etc/cert/ca.pem"
298 client_cert="/etc/cert/user.pem"
299 private_key="/etc/cert/user.prv"
300 private_key_passwd="password"
301 priority=1
302}
303
304# EAP-PEAP/MSCHAPv2 configuration for RADIUS servers that use the new peaplabel
305# (e.g., Radiator)
306network={
307 ssid="example"
308 key_mgmt=WPA-EAP
309 eap=PEAP
310 identity="user@example.com"
311 password="foobar"
312 ca_cert="/etc/cert/ca.pem"
313 phase1="peaplabel=1"
314 phase2="auth=MSCHAPV2"
315 priority=10
316}
317
318# EAP-TTLS/EAP-MD5-Challenge configuration with anonymous identity for the
319# unencrypted use. Real identity is sent only within an encrypted TLS tunnel.
320network={
321 ssid="example"
322 key_mgmt=WPA-EAP
323 eap=TTLS
324 identity="user@example.com"
325 anonymous_identity="anonymous@example.com"
326 password="foobar"
327 ca_cert="/etc/cert/ca.pem"
328 priority=2
329}
330
331# EAP-TTLS/MSCHAPv2 configuration with anonymous identity for the unencrypted
332# use. Real identity is sent only within an encrypted TLS tunnel.
333network={
334 ssid="example"
335 key_mgmt=WPA-EAP
336 eap=TTLS
337 identity="user@example.com"
338 anonymous_identity="anonymous@example.com"
339 password="foobar"
340 ca_cert="/etc/cert/ca.pem"
341 phase2="auth=MSCHAPV2"
342}
343
344# WPA-EAP, EAP-TTLS with different CA certificate used for outer and inner
345# authentication.
346network={
347 ssid="example"
348 key_mgmt=WPA-EAP
349 eap=TTLS
350 # Phase1 / outer authentication
351 anonymous_identity="anonymous@example.com"
352 ca_cert="/etc/cert/ca.pem"
353 # Phase 2 / inner authentication
354 phase2="autheap=TLS"
355 ca_cert2="/etc/cert/ca2.pem"
356 client_cert2="/etc/cer/user.pem"
357 private_key2="/etc/cer/user.prv"
358 private_key2_passwd="password"
359 priority=2
360}
361
362# Both WPA-PSK and WPA-EAP is accepted. Only CCMP is accepted as pairwise and
363# group cipher.
364network={
365 ssid="example"
366 bssid=00:11:22:33:44:55
367 proto=WPA RSN
368 key_mgmt=WPA-PSK WPA-EAP
369 pairwise=CCMP
370 group=CCMP
371 psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb
372}
373
374# Special characters in SSID, so use hex string. Default to WPA-PSK, WPA-EAP
375# and all valid ciphers.
376network={
377 ssid=00010203
378 psk=000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
379}
380
381
382# EAP-SIM with a GSM SIM or USIM
383network={
384 ssid="eap-sim-test"
385 key_mgmt=WPA-EAP
386 eap=SIM
387 pin="1234"
388 pcsc=""
389}
390
391
392# EAP-PSK
393network={
394 ssid="eap-psk-test"
395 key_mgmt=WPA-EAP
396 eap=PSK
397 identity="eap_psk_user"
398 eappsk=06b4be19da289f475aa46a33cb793029
399 nai="eap_psk_user@example.com"
400 server_nai="as@example.com"
401}
402
403
404# IEEE 802.1X/EAPOL with dynamically generated WEP keys (i.e., no WPA) using
405# EAP-TLS for authentication and key generation; require both unicast and
406# broadcast WEP keys.
407network={
408 ssid="1x-test"
409 key_mgmt=IEEE8021X
410 eap=TLS
411 identity="user@example.com"
412 ca_cert="/etc/cert/ca.pem"
413 client_cert="/etc/cert/user.pem"
414 private_key="/etc/cert/user.prv"
415 private_key_passwd="password"
416 eapol_flags=3
417}
418
419
420# LEAP with dynamic WEP keys
421network={
422 ssid="leap-example"
423 key_mgmt=IEEE8021X
424 eap=LEAP
425 identity="user"
426 password="foobar"
427}
428
429# EAP-FAST with WPA (WPA or WPA2)
430network={
431 ssid="eap-fast-test"
432 key_mgmt=WPA-EAP
433 eap=FAST
434 anonymous_identity="FAST-000102030405"
435 identity="username"
436 password="password"
437 phase1="fast_provisioning=1"
438 pac_file="/etc/wpa_supplicant.eap-fast-pac"
439}
440
441# Plaintext connection (no WPA, no IEEE 802.1X)
442network={
443 ssid="plaintext-test"
444 key_mgmt=NONE
445}
446
447
448# Shared WEP key connection (no WPA, no IEEE 802.1X)
449network={
450 ssid="static-wep-test"
451 key_mgmt=NONE
452 wep_key0="abcde"
453 wep_key1=0102030405
454 wep_key2="1234567890123"
455 wep_tx_keyidx=0
456 priority=5
457}
458
459
460# Shared WEP key connection (no WPA, no IEEE 802.1X) using Shared Key
461# IEEE 802.11 authentication
462network={
463 ssid="static-wep-test2"
464 key_mgmt=NONE
465 wep_key0="abcde"
466 wep_key1=0102030405
467 wep_key2="1234567890123"
468 wep_tx_keyidx=0
469 priority=5
470 auth_alg=SHARED
471}
472
473
474# IBSS/ad-hoc network with WPA-None/TKIP.
475network={
476 ssid="test adhoc"
477 mode=1
478 proto=WPA
479 key_mgmt=WPA-NONE
480 pairwise=NONE
481 group=TKIP
482 psk="secret passphrase"
483}
484
485
486# Catch all example that allows more or less all configuration modes
487network={
488 ssid="example"
489 scan_ssid=1
490 key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE
491 pairwise=CCMP TKIP
492 group=CCMP TKIP WEP104 WEP40
493 psk="very secret passphrase"
494 eap=TTLS PEAP TLS
495 identity="user@example.com"
496 password="foobar"
497 ca_cert="/etc/cert/ca.pem"
498 client_cert="/etc/cert/user.pem"
499 private_key="/etc/cert/user.prv"
500 private_key_passwd="password"
501 phase1="peaplabel=0"
502}
diff --git a/meta/packages/wpa-supplicant/wpa-supplicant-nossl/wpa-defconfig b/meta/packages/wpa-supplicant/wpa-supplicant-nossl/wpa-defconfig
new file mode 100644
index 0000000000..bf5d5e28e7
--- /dev/null
+++ b/meta/packages/wpa-supplicant/wpa-supplicant-nossl/wpa-defconfig
@@ -0,0 +1,4 @@
1CONFIG_DRIVER_WEXT=y
2CONFIG_WIRELESS_EXTENSION=y
3CONFIG_DRIVER_HOSTAP=y
4
diff --git a/meta/packages/wpa-supplicant/wpa-supplicant-nossl_0.2.6.bb b/meta/packages/wpa-supplicant/wpa-supplicant-nossl_0.2.6.bb
new file mode 100644
index 0000000000..2e9e1b879f
--- /dev/null
+++ b/meta/packages/wpa-supplicant/wpa-supplicant-nossl_0.2.6.bb
@@ -0,0 +1,7 @@
1DESCRIPTION = "User space helper for WPA and WPA2 client operations. \
2The Supplicant is used in WPA/WPA2 key handshakes to authenticate \
3with the AP and to generate dynamic encryption keys (TKIP or CCMP)."
4
5PR = "r3"
6
7include wpa-supplicant_${PV}.inc
diff --git a/meta/packages/wpa-supplicant/wpa-supplicant-ssl/wpa-defconfig b/meta/packages/wpa-supplicant/wpa-supplicant-ssl/wpa-defconfig
new file mode 100644
index 0000000000..2dac008aa5
--- /dev/null
+++ b/meta/packages/wpa-supplicant/wpa-supplicant-ssl/wpa-defconfig
@@ -0,0 +1,15 @@
1# CONFIG_DRIVER_HOSTAP is not set
2CONFIG_DRIVER_WEXT=y
3CONFIG_WIRELESS_EXTENSION=y
4CONFIG_DRIVER_HOSTAP=y
5CONFIG_IEEE8021X_EAPOL=y
6CONFIG_EAP_MD5=y
7CONFIG_MSCHAPV2=y
8CONFIG_EAP_TLS=y
9CONFIG_EAP_PEAP=y
10CONFIG_EAP_TTLS=y
11CONFIG_EAP_GTC=y
12CONFIG_EAP_OTP=y
13CONFIG_EAP_SIM=y
14CONFIG_EAP_LEAP=y
15#CONFIG_PCSC=y
diff --git a/meta/packages/wpa-supplicant/wpa-supplicant-ssl_0.2.6.bb b/meta/packages/wpa-supplicant/wpa-supplicant-ssl_0.2.6.bb
new file mode 100644
index 0000000000..85cdbb3379
--- /dev/null
+++ b/meta/packages/wpa-supplicant/wpa-supplicant-ssl_0.2.6.bb
@@ -0,0 +1,9 @@
1DESCRIPTION = "User space helper for WPA and WPA2 client operations with SSL. \
2The Supplicant is used in WPA/WPA2 key handshakes to authenticate \
3with the AP and to generate dynamic encryption keys (TKIP or CCMP)."
4DEPENDSS = "openssl"
5PR = "r3"
6
7EXTRA_OEMAKE="LIBS='-L${STAGING_LIBDIR} -lssl -lcrypto' LIBS_p='-L${STAGING_LIBDIR} -lssl -lcrypto'"
8
9include wpa-supplicant_${PV}.inc
diff --git a/meta/packages/wpa-supplicant/wpa-supplicant_0.2.6.inc b/meta/packages/wpa-supplicant/wpa-supplicant_0.2.6.inc
new file mode 100644
index 0000000000..c2b51021f9
--- /dev/null
+++ b/meta/packages/wpa-supplicant/wpa-supplicant_0.2.6.inc
@@ -0,0 +1,34 @@
1SECTION = "kernel/userland"
2HOMEPAGE = "http://hostap.epitest.fi/wpa_supplicant/"
3PRIORITY = "optional"
4MAINTAINER = "Michael 'Mickey' Lauer <mickey@Vanille.de>"
5LICENSE = "GPL"
6
7SRC_URI = "http://hostap.epitest.fi/releases/wpa_supplicant-${PV}.tar.gz \
8 file://wpa-defconfig \
9 file://wpa_supplicant_default.conf"
10
11RREPLACES_${PN} = "hostap-${PN}"
12RPROVIDES_${PN} = "hostap-${PN}"
13RCONFLICTS_${PN} = "hostap-${PN}"
14
15S = "${WORKDIR}/wpa_supplicant-${PV}"
16
17do_compile() {
18 unset CFLAGS
19 base_do_compile
20}
21
22do_configure() {
23 install -m 0644 ${WORKDIR}/wpa-defconfig .config
24}
25
26do_install() {
27 install -d ${D}${sysconfdir} ${D}${bindir}
28 install -m 0644 wpa_supplicant.conf ${D}${sysconfdir}/wpa_supplicant.conf.sample
29 install -m 0644 ../wpa_supplicant_default.conf ${D}${sysconfdir}/wpa_supplicant.conf
30 install -m 0755 wpa_passphrase ${D}${bindir}
31 install -m 0755 wpa_cli ${D}${bindir}
32 install -m 0755 wpa_supplicant ${D}${bindir}
33}
34
diff --git a/meta/packages/wpa-supplicant/wpa-supplicant_0.3.6.bb b/meta/packages/wpa-supplicant/wpa-supplicant_0.3.6.bb
new file mode 100644
index 0000000000..0a8fc1bc66
--- /dev/null
+++ b/meta/packages/wpa-supplicant/wpa-supplicant_0.3.6.bb
@@ -0,0 +1,34 @@
1DESCRIPTION = "A Client for Wi-Fi Protected Access (WPA)."
2SECTION = "network"
3LICENSE = "GPL"
4MAINTAINER = "Holger Schurig"
5HOMEPAGE = "http://hostap.epitest.fi/wpa_supplicant/"
6DEPENDS = "openssl"
7PR = "r3"
8
9SRC_URI = "http://hostap.epitest.fi/releases/wpa_supplicant-0.3.6.tar.gz \
10 file://defconfig \
11 file://driver-hermes.patch;patch=1 \
12 file://wpa_supplicant.conf"
13S = "${WORKDIR}/wpa_supplicant-${PV}"
14
15do_configure () {
16 install -m 0755 ${WORKDIR}/defconfig .config
17}
18
19do_compile () {
20 make
21}
22
23do_install () {
24 install -d ${D}${sbindir}
25 install -m755 wpa_supplicant ${D}${sbindir}
26 install -m755 wpa_passphrase ${D}${sbindir}
27 install -m755 wpa_cli ${D}${sbindir}
28
29 install -d ${D}${sysconfdir}
30 install -m644 ${WORKDIR}/wpa_supplicant.conf ${D}${sysconfdir}
31
32 install -d ${D}${docdir}/wpa_supplicant
33 install -m644 README ${D}${docdir}/wpa_supplicant
34}
diff --git a/meta/packages/wpa-supplicant/wpa-supplicant_0.3.8.bb b/meta/packages/wpa-supplicant/wpa-supplicant_0.3.8.bb
new file mode 100644
index 0000000000..684d7da8eb
--- /dev/null
+++ b/meta/packages/wpa-supplicant/wpa-supplicant_0.3.8.bb
@@ -0,0 +1,36 @@
1DESCRIPTION = "A Client for Wi-Fi Protected Access (WPA)."
2SECTION = "network"
3LICENSE = "GPL"
4MAINTAINER = "Holger Schurig"
5HOMEPAGE = "http://hostap.epitest.fi/wpa_supplicant/"
6DEPENDS = "openssl"
7DEPENDS_mtx-1_append = "madwifi-modules"
8PR = "r1"
9
10SRC_URI = "http://hostap.epitest.fi/releases/wpa_supplicant-${PV}.tar.gz \
11 file://madwifi-bsd-fix.diff;patch=1;pnum=0 \
12 file://defconfig \
13 file://driver-hermes.patch;patch=1 \
14 file://wpa_supplicant.conf"
15S = "${WORKDIR}/wpa_supplicant-${PV}"
16
17do_configure () {
18 install -m 0755 ${WORKDIR}/defconfig .config
19}
20
21do_compile () {
22 make
23}
24
25do_install () {
26 install -d ${D}${sbindir}
27 install -m755 wpa_supplicant ${D}${sbindir}
28 install -m755 wpa_passphrase ${D}${sbindir}
29 install -m755 wpa_cli ${D}${sbindir}
30
31 install -d ${D}${sysconfdir}
32 install -m644 ${WORKDIR}/wpa_supplicant.conf ${D}${sysconfdir}
33
34 install -d ${D}${docdir}/wpa_supplicant
35 install -m644 README ${D}${docdir}/wpa_supplicant
36}
diff --git a/meta/packages/wpa-supplicant/wpa-supplicant_0.4.7.bb b/meta/packages/wpa-supplicant/wpa-supplicant_0.4.7.bb
new file mode 100644
index 0000000000..268255c39e
--- /dev/null
+++ b/meta/packages/wpa-supplicant/wpa-supplicant_0.4.7.bb
@@ -0,0 +1,38 @@
1DESCRIPTION = "A Client for Wi-Fi Protected Access (WPA)."
2SECTION = "network"
3LICENSE = "GPL"
4MAINTAINER = "Holger Schurig"
5HOMEPAGE = "http://hostap.epitest.fi/wpa_supplicant/"
6DEPENDS = "openssl"
7DEPENDS_mtx-1_append = "madwifi-modules"
8PR = "r1"
9
10SRC_URI = "http://hostap.epitest.fi/releases/wpa_supplicant-${PV}.tar.gz \
11 file://madwifi-bsd-fix.diff;patch=1;pnum=0 \
12 file://defconfig \
13 file://driver-hermes.patch;patch=1 \
14 file://driver-zd1211.patch;patch=1 \
15 file://wpa_supplicant.conf"
16
17S = "${WORKDIR}/wpa_supplicant-${PV}"
18
19do_configure () {
20 install -m 0755 ${WORKDIR}/defconfig .config
21}
22
23do_compile () {
24 make
25}
26
27do_install () {
28 install -d ${D}${sbindir}
29 install -m755 wpa_supplicant ${D}${sbindir}
30 install -m755 wpa_passphrase ${D}${sbindir}
31 install -m755 wpa_cli ${D}${sbindir}
32
33 install -d ${D}${sysconfdir}
34 install -m644 ${WORKDIR}/wpa_supplicant.conf ${D}${sysconfdir}
35
36 install -d ${D}${docdir}/wpa_supplicant
37 install -m644 README ${D}${docdir}/wpa_supplicant
38}
diff --git a/meta/packages/wpa-supplicant/wpa-supplicant_0.5.1.bb b/meta/packages/wpa-supplicant/wpa-supplicant_0.5.1.bb
new file mode 100644
index 0000000000..236992f8f0
--- /dev/null
+++ b/meta/packages/wpa-supplicant/wpa-supplicant_0.5.1.bb
@@ -0,0 +1,58 @@
1DESCRIPTION = "A Client for Wi-Fi Protected Access (WPA)."
2SECTION = "network"
3LICENSE = "GPL"
4MAINTAINER = "Holger Schurig"
5MAINTAINER = "Eric Shattow <lucent@gmail.com>"
6HOMEPAGE = "http://hostap.epitest.fi/wpa_supplicant/"
7DEPENDS = "gnutls madwifi-ng"
8
9PR = "r4"
10DEFAULT_PREFERENCE = "-1"
11
12SRC_URI = "http://hostap.epitest.fi/releases/wpa_supplicant-${PV}.tar.gz \
13 file://defconfig-gnutls \
14 file://init.sh \
15 file://defaults-sane \
16 file://wpa_supplicant.conf \
17 file://wpa_supplicant.conf-sane"
18
19S = "${WORKDIR}/wpa_supplicant-${PV}"
20
21PACKAGES_prepend = "wpa-supplicant-passphrase wpa-supplicant-cli "
22FILES_wpa-supplicant-passphrase = "/usr/sbin/wpa_passphrase"
23FILES_wpa-supplicant-cli = "/usr/sbin/wpa_cli"
24
25RRECOMMENDS_${PN} = "wpa-supplicant-passphrase wpa-supplicant-cli"
26
27INITSCRIPT_NAME = "wpa"
28INITSCRIPT_PARAMS = "defaults 10"
29inherit update-rc.d
30
31do_configure () {
32 install -m 0755 ${WORKDIR}/defconfig-gnutls .config
33 echo "CONFIG_DRIVER_MADWIFI=y" >> .config
34 echo "CFLAGS += -I${STAGING_INCDIR}/madwifi-ng" >> .config
35}
36
37do_compile () {
38 make
39}
40
41do_install () {
42 install -d ${D}${sbindir}
43 install -m755 wpa_supplicant ${D}${sbindir}
44 install -m755 wpa_passphrase ${D}${sbindir}
45 install -m755 wpa_cli ${D}${sbindir}
46
47 install -d ${D}${localstatedir}/run/wpa_supplicant
48
49 install -d ${D}${docdir}/wpa_supplicant
50 install -m644 README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant
51
52 install -d ${D}${sysconfdir}/init.d
53 install -m700 ${WORKDIR}/init.sh ${D}${sysconfdir}/init.d/wpa
54
55 install -d ${D}${sysconfdir}/default
56 install -m600 ${WORKDIR}/defaults-sane ${D}${sysconfdir}/default/wpa
57 install -m600 ${WORKDIR}/wpa_supplicant.conf-sane ${D}${sysconfdir}/wpa_supplicant.conf
58}
diff --git a/meta/packages/wpa-supplicant/wpa-supplicant_cvs.bb b/meta/packages/wpa-supplicant/wpa-supplicant_cvs.bb
new file mode 100644
index 0000000000..fd93eb8e54
--- /dev/null
+++ b/meta/packages/wpa-supplicant/wpa-supplicant_cvs.bb
@@ -0,0 +1,59 @@
1DESCRIPTION = "Client for Wi-Fi Protected Access (WPA)."
2SECTION = "network"
3LICENSE = "GPL"
4MAINTAINER = "Holger Schurig"
5HOMEPAGE = "http://hostap.epitest.fi/wpa_supplicant/"
6DEPENDS = "openssl"
7PV = "0.0+cvs${SRCDATE}"
8PR = "r2"
9
10SRC_URI = "cvs://anonymous@hostap.epitest.fi/cvs;module=hostap \
11 file://use-channel.patch;patch=1 \
12 file://driver-hermes.patch;patch=1 \
13 file://defconfig \
14 file://defaults \
15 file://init.sh \
16 file://wpa_supplicant.conf"
17S = "${WORKDIR}/hostap/wpa_supplicant"
18
19
20PACKAGES_prepend = "wpa-supplicant-passphrase wpa-supplicant-cli "
21FILES_wpa-supplicant-passphrase = "/usr/sbin/wpa_passphrase"
22FILES_wpa-supplicant-cli = "/usr/sbin/wpa_cli"
23
24RRECOMMENDS_${PN} = "wpa-supplicant-passphrase wpa-supplicant-cli"
25
26
27INITSCRIPT_NAME = "wpa"
28INITSCRIPT_PARAMS = "defaults 10"
29inherit update-rc.d
30
31
32do_configure () {
33 install -m 0755 ${WORKDIR}/defconfig .config
34}
35
36
37do_compile () {
38 make
39}
40
41
42do_install () {
43 set -x
44 install -d ${D}${sbindir}
45 install -m755 wpa_supplicant ${D}${sbindir}
46 install -m755 wpa_passphrase ${D}${sbindir}
47 install -m755 wpa_cli ${D}${sbindir}
48
49 install -d ${D}${localstatedir}/run/wpa_supplicant
50
51 install -d ${D}${docdir}/wpa_supplicant
52 install -m644 README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant
53
54 install -d ${D}${sysconfdir}/init.d
55 install -m700 ${WORKDIR}/init.sh ${D}${sysconfdir}/init.d/wpa
56
57 install -d ${D}${sysconfdir}/default
58 install -m600 ${WORKDIR}/defaults ${D}${sysconfdir}/default/wpa
59}