在实现USB WiFi 芯片 rtl8188eu驱动后,接下来开始实现加密WiFi: WEP,目前rtems的GitHub上的master 已经merge了本人贡献的WEP代码,可以自行前去下载。
1.Add the WEP module suppport in nexus-devices.h
我们需要加密算法模块的支持,因此在nexus-devices.h中添加wlan_wep模块的支持。
+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支持就算完成了,那么如何在shell command中配置WEP连接
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.