* Added xauth authentication module needed for WPA.

* Forwarded a few more ioctls to the driver.
* Enabled debugging mode for now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39387 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2010-11-10 21:28:07 +00:00
parent 506a7b97c1
commit 9dd26e81ab
3 changed files with 55 additions and 15 deletions

View File

@ -11,9 +11,9 @@ UsePrivateKernelHeaders ;
Includes [ FGristFiles kernel_c++_structs.h ]
: <src!system!kernel>kernel_c++_struct_sizes.h ;
SubDirCcFlags [ FDefines _KERNEL=1 FBSD_DRIVER=1 ]
SubDirCcFlags [ FDefines _KERNEL=1 FBSD_DRIVER=1 IEEE80211_DEBUG=1 ]
-Wno-format -Wno-unused -Wno-uninitialized ;
SubDirC++Flags [ FDefines _KERNEL=1 FBSD_DRIVER=1 ]
SubDirC++Flags [ FDefines _KERNEL=1 FBSD_DRIVER=1 IEEE80211_DEBUG=1 ]
-Wno-format -Wno-unused -Wno-uninitialized ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) .. crypto rijndael ] ;
@ -59,5 +59,5 @@ KernelStaticLibrary libfreebsd_wlan.a :
# NOT SUPPORTED YET ieee80211_rssadapt.c
# NOT SUPPORTED YET ieee80211_superg.c
# NOT SUPPORTED YET ieee80211_tdma.c
# NOT SUPPORTED YET ieee80211_xauth.c
ieee80211_xauth.c
;

View File

@ -38,17 +38,17 @@
#include "ieee80211_haiku.h"
extern "C" {
#include <sys/kernel.h>
#include <sys/mbuf.h>
#include <sys/bus.h>
#include <sys/sockio.h>
# include <sys/kernel.h>
# include <sys/mbuf.h>
# include <sys/bus.h>
# include <sys/sockio.h>
#include <net/if.h>
#include <net/if_media.h>
#include <net/if_types.h>
#include <net/if_var.h>
# include <net/if.h>
# include <net/if_media.h>
# include <net/if_types.h>
# include <net/if_var.h>
#include "ieee80211_var.h"
# include "ieee80211_var.h"
};
#include <SupportDefs.h>
@ -62,6 +62,14 @@ extern "C" {
#include <shared.h>
#define TRACE_WLAN
#ifdef TRACE_WLAN
# define TRACE(x, ...) dprintf(x, __VA_ARGS__);
#else
# define TRACE(x, ...) ;
#endif
#define MC_ALIGN(m, len) \
do { \
(m)->m_data += (MCLBYTES - (len)) &~ (sizeof(long) - 1);\
@ -336,6 +344,7 @@ wlan_control(void* cookie, uint32 op, void* arg, size_t length)
if (user_memcpy(&request, arg, sizeof(struct ieee80211req)) != B_OK)
return B_BAD_ADDRESS;
TRACE("wlan_control: %ld, %d\n", op, request.i_type);
status_t status = ifp->if_ioctl(ifp, op, (caddr_t)&request);
if (status != B_OK)
return status;
@ -345,6 +354,13 @@ wlan_control(void* cookie, uint32 op, void* arg, size_t length)
return B_BAD_ADDRESS;
return B_OK;
}
case SIOCSIFFLAGS:
case SIOCSIFMEDIA:
case SIOCGIFMEDIA:
case SIOCSIFMTU:
// Requests that make it here always come from the kernel
return ifp->if_ioctl(ifp, op, (caddr_t)arg);
}
return B_BAD_VALUE;
@ -530,8 +546,7 @@ ieee80211_sysctl_vattach(struct ieee80211vap* vap)
| IEEE80211_MSG_DOTH
| IEEE80211_MSG_INACT
| IEEE80211_MSG_ROAM
| IEEE80211_MSG_RATECTL
;
| IEEE80211_MSG_RATECTL;
}
@ -555,7 +570,7 @@ ieee80211_vap_destroy(struct ieee80211vap* vap)
void
ieee80211_load_module(const char* modname)
{
dprintf("%s not implemented, yet.\n", __func__);
dprintf("%s not implemented, yet: modname %s\n", __func__, modname);
}
@ -568,6 +583,8 @@ ieee80211_notify_node_join(struct ieee80211_node* ni, int newassoc)
if (ni == vap->iv_bss)
if_link_state_change(ifp, LINK_STATE_UP);
TRACE("%s\n", __FUNCTION__);
if (sNotificationModule != NULL) {
char messageBuffer[512];
KMessage message;
@ -590,6 +607,8 @@ ieee80211_notify_node_leave(struct ieee80211_node* ni)
if (ni == vap->iv_bss)
if_link_state_change(ifp, LINK_STATE_DOWN);
TRACE("%s\n", __FUNCTION__);
if (sNotificationModule != NULL) {
char messageBuffer[512];
KMessage message;
@ -609,6 +628,8 @@ ieee80211_notify_scan_done(struct ieee80211vap* vap)
release_sem_etc(vap->iv_ifp->scan_done_sem, 1,
B_DO_NOT_RESCHEDULE | B_RELEASE_ALL);
TRACE("%s\n", __FUNCTION__);
if (sNotificationModule != NULL) {
char messageBuffer[512];
KMessage message;
@ -701,10 +722,12 @@ ieee80211_notify_radio(struct ieee80211com* ic, int state)
void
ieee80211_sysctl_attach(struct ieee80211com* ic)
{
dprintf("%s not implemented, yet.\n", __func__);
}
void
ieee80211_sysctl_detach(struct ieee80211com* ic)
{
dprintf("%s not implemented, yet.\n", __func__);
}

View File

@ -283,6 +283,23 @@ void ieee80211_load_module(const char *);
typedef void (*policy##_setup)(int); \
SET_DECLARE(policy##_set, policy##_setup);
/*
* Authenticator modules handle 802.1x/WPA authentication.
*/
#define IEEE80211_AUTH_MODULE(name, version) \
_IEEE80211_POLICY_MODULE(auth, name, version)
#define IEEE80211_AUTH_ALG(name, alg, v) \
static void \
name##_modevent(int type) \
{ \
if (type == MOD_LOAD) \
ieee80211_authenticator_register(alg, &v); \
else \
ieee80211_authenticator_unregister(alg); \
} \
TEXT_SET(auth_set, name##_modevent)
/*
* Scanner modules provide scanning policy.
*/