十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
由于我这边kernel用的是比较老的,有些接口不支持,所以需要做一些处理
int rtw_is_dir_readable(const char *path)
//#define CL_IPV6_PASS 1
struct rtw_ieee80211_hdr {u16 frame_ctl;
u16 duration_id;
u8 addr1[ETH_ALEN];
u8 addr2[ETH_ALEN];
u8 addr3[ETH_ALEN];
u16 seq_ctrl;
u8 addr4[ETH_ALEN];
} __attribute__((packed));
struct ieee80211_hdr {u16 frame_ctl;
u16 duration_id;
u8 addr1[ETH_ALEN];
u8 addr2[ETH_ALEN];
u8 addr3[ETH_ALEN];
u16 seq_ctrl;
u8 addr4[ETH_ALEN];
} __attribute__((packed));
//#define CONFIG_P2P 1
void rtw_dump_cur_efuse(PADAPTER padapter)
{//原来是 int mapsize =0;
u16 mapsize =0;
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(padapter);
EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_EFUSE_MAP_LEN , (void *)&mapsize, _FALSE);
if (mapsize<= 0 || mapsize >EEPROM_MAX_SIZE) {RTW_ERR("wrong map size %d\n", mapsize);
return;
}
#ifdef CONFIG_RTW_DEBUG
if (hal_data->efuse_file_status == EFUSE_FILE_LOADED)
RTW_MAP_DUMP_SEL(RTW_DBGDUMP, "EFUSE FILE", hal_data->efuse_eeprom_data, mapsize);
else
RTW_MAP_DUMP_SEL(RTW_DBGDUMP, "HW EFUSE", hal_data->efuse_eeprom_data, mapsize);
#endif
}
#define IW_ENCODE_ALG_AES_CMAC 5
代码修改完毕后
安装前置工具sudo apt-get -y install flex
sudo apt-get -y install bison
编译openssl下载openssl-1.1.1a
./Configure linux-ppc shared no-asm --prefix=/home/lsy/work/tools/openssl CROSS_COMPILE=powerpc-e300c3-linux-
make
异常,出现错误:PTHREAD_MUTEX_RECURSIVE未声明
vim Makefile
CNF_CPPFLAGS=-DNDEBUG -D_GNU_SOURCE
编译libnlwget http://www.infradead.org/~tgr/libnl/files/libnl-3.2.0.tar.gz
tar xvf libnl-3.2.0.tar.gz
cd libnl-3.2.0
./configure --host=powerpc-e300c3-linux --prefix=/home/lisuyang/work/tools/libnl CFLAGS=-I/home/lisuyang/work/code/kz_linux-2.6.20/include
make
make install
解决报错cp ../kz_linux-2.6.20/include/linux/tc_ematch/tc_em_text.h include/linux/tc_ematch/
编译wpa_supplicantexport PKG_CONFIG_PATH=/home/lisuyang/work/tools/libnl/lib/pkgconfig
tar xvf wpa_supplicant-2.7.tar.gz
cd wpa_supplicant-2.7/wpa_supplicant
cp deconfig .config
vim .config
CC = powerpc-e300c3-linux-gcc
#openssl 库和头文件路径
CFLAGS += -I/home/lsy/work/tools/openssl/include
LIBS += -L/home/lsy/work/tools/openssl/lib -lssl -lcrypto
#libnl 库和头文件路径
CFLAGS += -I/home/lsy/work/tools/libnl/libnl3
LIBS += -L/home/lsy/work/tools/libnl/lib
make
make install
解决报错cp linux-2.6.20/include/linux/netfilter/nfnetlink.h /home/lsy/work/tools/libnl/include/libnl3/netlink/netfilter/
vim /home/lsy/work/tools/libnl/include/libnl3/netlink/netlink.h
//#include#include
#include
/home/lsy/work/tools/libnl/include/libnl3/netlink/netlink-kernel.h:18: error: redefinition of 'struct sockaddr_nl'
/home/lsy/work/tools/libnl/include/libnl3/netlink/netlink-kernel.h:42: error: redefinition of 'struct nlmsghdr'
/home/lsy/work/tools/libnl/include/libnl3/netlink/netlink-kernel.h:182: error: redefinition of 'struct nlmsgerr'
将netlink-kernel.h代码中的这三个结构体删除
拷贝kernel源码中的头文件信息到编译链头文件路径
抱歉,由于距离我做这个任务时间有些长,我不记得我将那些文件拷贝过去了,这里主要是编译过程中缺少某个结构体定义,那就去kernel源码/libnl输出路径中搜索哪个文件包含这个变量,将之复制到编译链的头文件中,该目录位于
/opt/freescale/usr/local/gcc-4.0.2-glibc-2.3.6-nptl-2/powerpc-e300c3-linux/powerpc-e300c3-linux/sys-include
编译hostapd我这边下载的是hostapd-0.6.9
export PKG_CONFIG_PATH=/home/lisuyang/work/tools/libnl/lib/pkgconfig
tar xvf hostapd-0.6.9.tar.gz
cd hostapd-0.6.9/hostapd
cp deconfig .config
vim .config
CONFIG_DRIVER_WEXT=y
CONFIG_DRIVER_NL80211=y
CFLAGS += -I/home/lsy/work/tools/libnl/include/libnl3
LIBS += -L/home/lsy/work/tools/libnl/lib
CONFIG_LIBNL20=y
CC = powerpc-e300c3-linux-gcc
CONFIG_TLS = internal
CONFIG_INTERNAL_LIBTOMMATH = y
CFLAGS += -I/home/lsy/work/tools/openssl/include
LIBS += -L/home/lsy/work/tools/openssl/lib -lssl -lcrypto
make
移植入嵌入式需要拷贝过去的文件如下
hostapd
wpa_supplicant
libnl/lib/.so
openssl/.so
你是否还在寻找稳定的海外服务器提供商?创新互联www.cdcxhl.cn海外机房具备T级流量清洗系统配攻击溯源,准确流量调度确保服务器高可用性,企业级服务器适合批量采购,新人活动首月15元起,快前往官网查看详情吧