由于我这边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元起,快前往官网查看详情吧
文章名称:PowerPC平台移植RTL8822BU-创新互联
转载来于:https://www.cdcxhl.com/article14/dsdige.html
成都网站建设公司_创新互联,为您提供面包屑导航、网站营销、企业网站制作、企业建站、网站导航、用户体验
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联