1. 在hisi sdk中编译neardi-fd7352s驱动源码并加载
->编译出两个ko文件
.1 skw_sdio_v20.ko
.2 skw6316.ko
确认是否识别到fd7352s 模块
cat /proc/mci/mci_info
MCI2: pluged_connected
Type: SDIO card Mode: HS
Speed Class: Class 0
Uhs Speed Grade: Less than 10MB/sec(0h)
Host work clock: 50MHz
Card support clock: 50MHz
Card work clock: 50MHz
Card error count: 0
.3 wifi固件:
EA6316_SEEKWAVE_R00006.bin
RAM_RW_KERNEL_DRAM.bin
ROM_EXEC_KERNEL_IRAM.bin
SEEKWAVE_NV_SWT6652.bin
EA6316_SEEKWAVE_R00006.bin
将如上固件放进/lib/firmware
.4 将ko按顺序.1/.2进行insmod加载信息
ifconfig -a
wlan0 Link encap:Ethernet HWaddr 24:EF:B4:51:C4:A8
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
2. 交叉编译wpa_supplicant测试工具
.1 openssl:
wget https://www.openssl.org/source/openssl-1.1.1k.tar.gz
tar -xzvf openssl-1.1.1k.tar.gz
cd openssl-1.1.1k
mkdir _install
./config no-asm no-shared no-async --prefix=$PWD/_install --cross-compile-prefix=aarch64-mix210-linux-
打开Makefile,搜索并删除“-m64”字段,保存并退出。而后执行:
make CC=aarch64-mix210-linux-gcc -j8
make install
.2 libnl:
wget https://github.com/thom311/libnl/releases/download/libnl3_5_0/libnl-3.5.0.tar.gz
tar -xzvf libnl-3.5.0.tar.gz
cd libnl-3.5.0
mkdir _install
./configure --host=aarch64-mix210-linux --prefix=$PWD/_install --enable-static
make
make install
.3 expat-2.2.10:
wget https://sourceforge.net/projects/expat/files/expat/2.2.10/expat-2.2.10-RENAMED-VULNERABLE-PLEASE-USE-2.4.7-INSTEAD.tar.gz
tar -xzvf expat-2.2.10-RENAMED-VULNERABLE-PLEASE-USE-2.4.7-INSTEAD.tar.gz
cd expat-2.2.10
mkdir _install
./configure --prefix=$PWD/_install --host=aarch64-mix210-linux CC=aarch64-mix210-linux-gcc CXX=aarch64-mix210-linux-g++ --enable-shared --enable-static
make
make install
.4 dbus-1.13.18:
sudo apt-get install autoconf autoconf-archive libtool pkg-config libglib2.0-dev
wget https://dbus.freedesktop.org/releases/dbus/dbus-1.13.18.tar.xz
tar -xvf dbus-1.13.18.tar.xz
cd dbus-1.13.18
export PKG_CONFIG_PATH=$PWD/../expat-2.2.10/_install/lib/pkgconfig/
mkdir _install
./configure --prefix=$PWD/_install --host=aarch64-mix210-linux CC=aarch64-mix210-linux-gcc CXX=aarch64-mix210-linux-g++ --enable-shared --enable-static CFLAGS=-I/neardi/SS928V100_SDK_V2.0.2.2/smp/a55_linux/interdrv/wpa/expat-2.2.10/_install/include LDFLAGS=-L/neardi/SS928V100_SDK_V2.0.2.2/smp/a55_linux/interdrv/wpa/expat-2.2.10/_install/lib --disable-tests --disable-selinux
make
make install
.5 wpa_suplicant编译:
wget http://w1.fi/releases/wpa_supplicant-2.10.tar.gz
cd wpa_supplicant/
mkdir _install
cp defconfig .config
vi .config
+ CFLAGS += -I../../openssl-1.1.1k/_install/include
+ += -L../../openssl-1.1.1k/_install/lib
+ CFLAGS += -I../../libnl-3.5.0/_install/include/libnl3
+ LIBS += -L../../libnl-3.5.0/_install/lib
+ CFLAGS += -I../../dbus-1.13.18/_install/include
+ LIBS += -L../../dbus-1.13.18/_install/lib
+ CC=aarch64-mix210-linux-gcc
make
make install DESTDIR=$PWD/_install/
.6 wpa_supplicant运行依赖:
将如上交叉编译 中_install/lib下的xx.so(.xx)放到开发板/lib64目录下
3.交叉编译dhcp测试工具
.1 zlib
wget https://www.zlib.net/fossils/zlib-1.2.11.tar.gz
tar -xzvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
mkdir _install
export CC=aarch64-mix210-linux-gcc
./configure --prefix=$PWD/_install --static
make
make install
.2 dhcp
wget https://ftp.iij.ad.jp/pub/network/isc/dhcp/4.4.2/dhcp-4.4.2.tar.gz
tar -xzvf dhcp-4.4.2.tar.gz
cd dhcp-4.4.2
mkdir _install
./configure --host=aarch64-mix210-linux --prefix=$PWD/_install --with-randomdev=no
export PKG_CONFIG_PATH=/neardi/SS928V100_SDK_V2.0.2.2/smp/a55_linux/interdrv/wpa/zlib-1.2.11/_install/lib/pkgconfig/
export CFLAGS="-I/neardi/SS928V100_SDK_V2.0.2.2/smp/a55_linux/interdrv/wpa/zlib-1.2.11/_install/include"
export LDFLAGS="-L/neardi/SS928V100_SDK_V2.0.2.2/smp/a55_linux/interdrv/wpa/zlib-1.2.11/_install/lib"
//configure: error: found zlib include but not library.
export BUILD_CC=gcc
//configure: error: BUILD_CC not set
make
make install
.3 将DHCP下_install中编译出来的文件复制到hisi3403 开发板环境下对应的目录下
_install/bin目录下的所有内容拷贝到开发板的/usr/bin目录下;
_install/sbin目录下的所有内容拷贝到开发板的/usr/sbin目录下;
_install/etc/dhclient.conf.example 拷贝到开发板并重命名/etc/dhclient.conf;
_install/etc/dhcpd.conf.example 拷贝到开发板并重命名/etc/dhcpd.conf;
client/scripts/linux拷贝到开发板并重命名为/etc/dhclient-script ,执行一下命令给dhclient-script加上可执行权限:chmod +x /etc/dhclient-script,并修改#!/bin/bash为#!/bin/sh
4.wifi测试
wpa_supplicant -D nl80211 -i wlan0 -c /etc/wpa_supplicant.conf -B 1
dhclient wlan0
ping -I wlan0 qq.com
配置参考:
etc/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
ap_scan=1
update_config=1
network={
ssid="neardi"
psk="neardi_trump"
key_mgmt=WPA-PSK
}