无线命令:iw 移植到mipsel上

由于之前iwconfig wlan0 mode ad-hoc的时候,发现错误:Error for wireless request "Set Mode" (8B06) : SET failed on device wlan0 ; Operation not supported.

尝试使用更新的iw测试。

准备工具:
iw.tar.bz2:  
http://linuxwireless.org/download/iw/iw-3.7.tar.bz2
libnl:          
http://www.infradead.org/~tgr/libnl/

先交叉编译libnl
./configure --prefix=../build/libnl CC=mipsel-linux-gcc --host=mipsel
make 
make install

OK之后,在进入iw目录
export PKG_CONFIG_PATH=../build/libnl/lib/pkgconfig:$PKG_CONFIG_PATH
make CC=mipsel-linux-gcc
OK后就会生成iw命令,复制到设备上使用即可。

如果人品值和我一样,可能会出现以下报错信息,解决方法也如下:
iw目录下的:
出现 undefined reference to `htole16'
在info.c代码前面加上:
//add by jieen used little endian
#if 0
#define htole16(X) (X)
#else
#define htole16(X)  (((((uint16_t)(X)) << 8) | ((uint16_t)(X) >> 8)) & 0xffff)
#endif
重新编译就解决。
如果出现
/home/jwt/lry/myworks/third/wifi/build/libnl/lib/libnl-3.a(utils.o): In function `nl_prob2int':
/home/jwt/lry/myworks/third/wifi/libnl-3.2.14/lib/utils.c:392: undefined reference to `rint'
collect2: ld returned 1 exit status
就需要编辑libnl的lib目录下的utils.c,注意是libnl源代码目录下的lib目录下,非libnl源代码下的src/lib目录下。
修改如下:
//add by jieen
double myabs(double x)
{
if(x >= 0)
return x;
else
return (-x);
}
double mypositiverint(double x)
{
if((x - (int)x) > 0.5)
{
return (int)(x+1);
}
else if(x-(int)x < 0.5)
{
return (int)x;
}
else
{
if(((int)x % 2))
{
return ((int)(x)+1);
}
else
{
return (int)(x);
}
}
}
double myrint(double x)
{
double tmp,result;
if(x >= 0)
{
result = mypositiverint(x);
return result;
}
else
{
tmp = myabs(x);
result = mypositiverint(tmp);
return -result;
}
}
#define rint myrint
然后先重新make;make install;之后再进入iw目录下执行:
make CC=mipsel-linux-gcc

OK,人品值已经提高。问题解决。



  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值