This patch aggregates ioctls.
First is SIOCS80211. The SIOCS80211's arguments has 3 couples.
1-1. i_len, i_data
1-2. i_val
1-3. i_len, i_data, i_val (currently only IEEE80211_IOC_APPIE)
There were 3 routines for each cases. This patch aggregates these to
one.
Second is SIOCG80211. The SIOCG80211 returns 2 type of value.
2-1. i_len
2-2. i_val
There were 2 routines for each cases. This patch aggregates these to
one.
I have tested on both FreeBSD 8.0 and NetBSD 5.0.1 with these cases.
[hostapd]
RSN-PSK(CCMP)/WPA-PSK(TKIP)
[wpa_supplicant(STA)]
RSN-PSK(CCMP)/WPA-PSK(TKIP)
[wpa_supplicant(AP)]
RSN-PSK(CCMP)/WPA-PSK(TKIP)
This patch enables FreeBSD channel control.
I have tested on FreeBSD 7.2 with these cases.
[hostapd]
RSN-PSK(CCMP)/WPA-PSK(TKIP)
[wpa_supplicant(STA)]
RSN-PSK(CCMP)/WPA-PSK(TKIP)
[wpa_supplicant(AP)]
RSN-PSK(CCMP)/WPA-PSK(TKIP)
The attached patch unifies hostapd wpa_driver_bsd_ops and
wpa_supplicant wpa_driver_bsd_ops.
I have tested on NetBSD 5.0.1 with these cases.
[hostapd]
RSN-PSK(CCMP)/WPA-PSK(TKIP)
[wpa_supplicant(STA)]
RSN-PSK(CCMP)/WPA-PSK(TKIP)
[wpa_supplicant(AP)]
RSN-PSK(CCMP)/WPA-PSK(TKIP)
This patch modifies field name of struct bsd_driver_data to use
same name of struct wpa_driver_bsd_data. This is a preparation of
unifying struct bsd_driver_data and struct wpa_driver_bsd_data.
The bsd_send_eapol() adds Ethernet header by itself. This patch changes it
to use l2_packet functionality.
I have tested on NetBSD 5.0.1 with WPA-PSK(TKIP).
On NetBSD, we should configure some parameters manually out of hostapd
like below.
ifconfig ath0 mediaopt hostap
ifconfig ath0 mode 11g
ifconfig ath0 chan 6
This patch does these automatically. Maybe there will be some
objections, like "hardware configuration is not hostapd/wpa_supplican's
work". So I will write the reasons why I made this patch.
1. For usability.
2. The first command fails when previous state is adhoc. This patch is
free from previous state.
3. Some driver wrappers configure these automatically (like nl80211).
4. I have wasted time trying to find out these command were needed :(
On FreeBSD 8.0, driver_bsd.c build fails because of changes from
older versions of FreeBSD. The error messages are below:
In file included from ../src/drivers/driver_bsd.c:38:
/usr/include/net80211/ieee80211_crypto.h:94: error: 'IEEE80211_TID_SIZE'
undeclared here (not in a function)
../src/drivers/driver_bsd.c: In function 'wpa_driver_bsd_set_wpa_ie':
../src/drivers/driver_bsd.c:968: error: 'IEEE80211_IOC_OPTIE' undeclared (first
use in this function)
../src/drivers/driver_bsd.c:968: error: (Each undeclared identifier is reported
only once
../src/drivers/driver_bsd.c:968: error: for each function it appears in.)
gmake: *** [../src/drivers/driver_bsd.o] Error 1
This patch solves this issue.
This removes need for including hostapd/sta_flags.h into driver
wrappers and removes any remaining dependencies between driver flags
and internal hostapd flags.
On NetBSD 5.0.1, driver_bsd.c build fails with message below.
../src/drivers/driver_bsd.c: In function 'wpa_driver_bsd_associate':
../src/drivers/driver_bsd.c:1170: warning: implicit declaration of function 'wpa_driver_bsd_set_auth_alg'
../src/drivers/driver_bsd.c: At top level:
../src/drivers/driver_bsd.c:1204: error: static declaration of 'wpa_driver_bsd_set_auth_alg' follows non-static declaration
../src/drivers/driver_bsd.c:1170: error: previous implicit declaration of 'wpa_driver_bsd_set_auth_alg' was here
gmake: *** [../src/drivers/driver_bsd.o] Error 1
This patch solves this issue.
This makes it clearer which files are including header from src/common.
Some of these cases should probably be cleaned up in the future not to
do that.
In addition, src/common/nl80211_copy.h and wireless_copy.h were moved
into src/drivers since they are only used by driver wrappers and do not
need to live in src/common.
This gets rid of previously deprecated driver_ops handlers set_wpa,
set_drop_unencrypted, set_auth_alg, set_mode. The same functionality
can be achieved by using the init/deinit/associate handlers.
This code was copied from driver_hostap.c where it is used with the
special wlan#ap interface. It was not supposed to be used to change
the MTU for a normal data interface.
Both hostapd/wpa_supplicant compilation fails on DragonFly BSD.
This patch solves this issue.
I have tested only compilation. Not functionality.
Because I don't have any device which can work on DragonFly BSD.
Old way does not work with all drivers on NetBSD and FreeBSD are
also using this so should be a safe change. [Bug 312]
Signed-off-by: Roy Marples <roy@marples.name>
Add generic functions to get/set 80211 vars, set 80211 params and
get/sid ssid.
Change NetBSD defines to match the ioctl used for portability.
Check size we're copying into instead of assuming IFNAMSIZ.
Signed-off-by: Roy Marples <roy@marples.name>
The attached patch will replace get_scan_results with get_scan_results2.
This is a preparation for WPS on BSD.
And I erased "wpa_scan_result_compar". Because scan result
sorting will be done with "wpa_scan_result_compar" on
"scan_helpers.c".
I have done below tests on NetBSD with an atheros card.
- WPA2-PSK(CCMP)
- WPA-PSK(TKIP)
- PEAP(MSCHAPv2)
- EAP-TLS
- EAP-TTLS(MSCHAPv2)
This fixes deauth/disassoc frames in secondary BSSes when using
multi-BSSID. In addition, it reduces need to dereference
struct hostapd_data inside driver wrappers.
Use a parameter structure to pass in information that can be more easily
extended in the future. Include some of the parameters that were
previously read directly from hapd->conf in order to reduce need for
including hostapd/config.h into driver wrappers.
This commit merges the driver_ops structures and implementations from
hostapd/driver*.[ch] into src/drivers. This is only an initial step and
there is room for number of cleanups to share code between the hostapd
and wpa_supplicant parts of the wrappers to avoid unnecessary source
code duplication.