Add WEP encrypted WiFi support for RTEMS-libbsd on BBB BSP

After add the rtl8188eu WiFi chip support on RTEMS, We need add the encrypted WiFi support for RTEMS-libbsd. WEP is a kind of encrypted WiFi which is easier to implement then WPA. So let us first implement the WEP.

How to add WEP support for RTEMS-libbsd


1. Add the WEP module suppport in nexus-devices.h


We need the encryption algorithm support for WEP, so add the wlan_wep module in nexus-devices.h

+SYSINIT_MODULE_REFERENCE(wlan_wep);

2. Add the encrypted module support in rtems-kernel-init.c


The crypto module not support in kernel-init.c. So we need add this support:

diff --git a/rtemsbsd/rtems/rtems-kernel-init.c b/rtemsbsd/rtems/rtems-kernel-init.c
index 594e1ba..4138bc1 100644
--- a/rtemsbsd/rtems/rtems-kernel-init.c
+++ b/rtemsbsd/rtems/rtems-kernel-init.c
@@ -72,6 +72,8 @@ typedef void (*ratectl_modevent)(int);
RTEMS_BSD_DEFINE_SET(ratectl_set, ratectl_modevent);
typedef void (*scanner_modevent)(int);
RTEMS_BSD_DEFINE_SET(scanner_set, scanner_modevent);
+typedef void (*crypto_modevent)(int);
+RTEMS_BSD_DEFINE_SET(crypto_set, crypto_modevent);
RTEMS_BSD_DEFINE_SET(sysctl_set, struct sysctl_oid *);
RTEMS_BSD_DEFINE_RWSET(sysinit_set, struct sysinit *);



 WEP support is done. So how to configure the WEP to connect WiFi?


1. Firstly, we need create a wlan device via ifconfig:


ifconfig wlan0 create wlandev rtwn0

The wlan name is wlan0, the real WiFi device name is rtwn0.

2. connect WEP WiFi via ifconfig


ifconfig wlan0 inet 192.168.1.100 netmask 255.255.255.0 \
   ssid my_net wepmode on weptxkey 1 wepkey 1:0x3456789012

The ip address is inet, the ssid of my_net is the name of router name, the weptxkey is a index of key, the default is 1, wepkey is the WiFi password.

With these two command, you can connect WiFi via WEP encrypted WiFi.

And by the way, we need set the mode of WEP in wireless router in "open system", instead of the "shared" mode. Because it uses the WEP key in a very restricted way, the attacker can easily break the key


评论

此博客中的热门博文

How to generate image file and dd to SD card

Developed the I2C driver for Beaglebone Black BSP

Compiling RTEMS for Beaglebone Black BSP