pcDuino 上RT3070 SoftAP:修改在Linux 3.18.0 内核上的编译错误

1. Rt_linux.c编译时报错
/workspace/git/2010_0203_RT3070_SoftAP_v2.4.0.1_DPA/UTIL/os/linux/../../os/linux/rt_linux.c: In function 'RtmpOSFSInfoChange':
/workspace/git/2010_0203_RT3070_SoftAP_v2.4.0.1_DPA/UTIL/os/linux/../../os/linux/rt_linux.c:991:20:error: incompatible types when assigning to type 'int' from type 'kuid_t'
   pOSFSInfo->fsuid = current_fsuid();
                    ^
/workspace/git/2010_0203_RT3070_SoftAP_v2.4.0.1_DPA/UTIL/os/linux/../../os/linux/rt_linux.c:992:20: error: incompatible types when assigning to type 'int' from type 'kgid_t'
   pOSFSInfo->fsgid = current_fsgid();  
                    ^
修改=============
Rt_linux.c
diff: line 991
-        pOSFSInfo->fsuid = current_fsuid();
+        pOSFSInfo->fsuid = current_fsuid().val;
diff: line 992
-        pOSFSInfo->fsgid = current_fsgid().val;
+        pOSFSInfo->fsgid = current_fsgid().val;        

2. 继续报错: GPL-incompatible module rt3070ap.ko uses GPL-only symbol '__rcu_read_unlock' 
修改=============
Rtmp_init.c 
diff: line 5242
-MODULE_LICENSE("RALINK");
+MODULE_LICENSE("GPL");

History:2011-10-25
Author:yr
雷凌系列网卡驱动移植后的调试工作记录:
为了支持多块wifi网卡同时在板子上启动,需要修改驱动源代码的参数。
假设板子上有3块网卡,都作为AP端使用,加载移植好的驱动后,分别驱动出ra0,ra1,ra2三个接口。
ifconfig ra0 up 成功,ifconfig ra1 up 时 提示:
<-- ERROR in Alloc TX TxContext[3] HTTX_BUFFER!! 
                                                         
<-- RTMPAllocTxRxRingMemory,Status=3                                                                                   
ERROR!!! RTMPAllocDMAMemory failed,Status[=0x00000003]                                               
!!! rt28xx Initialized fail!!!                                                                                               
ifconfig: SIOCSIFFLAGS: Operation notpermitted 

修改MODULE NETIFUTIL三个目录下的include/os/rt_linux.h中BULKAGGRE_SIZE参数,将100改为60,可以成功启动ra0和 ra1 但是ra2启动失败。继续减小这一参数值,到30后,三快都可以启动成功。
ifconfig rax up时若提示BIRIdx(0): RXDMALen not multiple of 4.[38539],BulkInBufLen = 172,说明DMA空间不够下一块网卡加载了,需要继续减小,但是应该会影响性能。

下面内容转载自一技术帖回复///
该网卡驱动需要使用DMA内存,而且还挺大(没记错的话有200k左右),出错的原因是驱动申请DMA内存失败。 
解决办法: 
1. 先确定系统可用于DMA的内存有多大,其他驱动是否用得差不多了。 
2. 如果不能修改系统DMA内存大小,那么 
3. 修改rt2870驱动rtmp_usb.h将BULKAGGRE_ZISE宏改小一些,比如(60)

在网上看到的。
http://www.61ic.com/code/redirect.php?fid=170&tid=18751&goto=nextoldset
http://blog.csdn.net/bbandxq521/archive/2010/11/09/5997419.aspx

如果再次出现一些error的话:
[99] RtmpOSFileOpen(): Error 2 opening/etc/Wireless/RT2870STA/RT2870STA.dat
[99] Open file "/etc/Wireless/RT2870STA/RT2870STA.dat"failed!
[99] 1. Phy Mode = 0
[99] ERROR!!! NICReadRegParameters failed,Status[=0x00000001]
[99] usb 1-1: RtmpTimerTask timed out on ep0in len=4/4
[99] usb 1-1: wpa_supplicant timed out on ep0in len=4/4
[99] ---> RTMPFreeTxRxRingMemory
[99] <--- RTMPFreeTxRxRingMemory
[99] !!! rt28xx Initialized fail !!!
[99] rt28xx_open return fail!
如果是PC机,请参考驱动包里的sta_ate_iwpriv_usage.txt文件。里面有这样的英文:
=======================================================================
CONFIGURATION:  
====================
RT2870 driver can be configured via followinginterfaces, 
i.e. (i)"iwconfig" command, (ii)"iwpriv" command, (iii)configuration file

i) iwconfig comes with kernel.  
ii) iwpriv usage, please refer to file "iwpriv_usage.txt" fordetails.
iii)modify configuration file "RT2870STA.dat" in/etc/Wireless/RT2870STA/RT2870STA.dat.
   
Configuration File : RT2870STA.dat
---------------------------------------
# Copy this file to /etc/Wireless/RT2870STA/RT2870STA.dat
# This file is a binary file and will be read on loading rt.omodule.
#
# Use "vi RT2870STA.dat" to modify settings according to yourneed.

# 1.) set NetworkType to "Adhoc" for using Adhoc-mode, otherwiseusing Infrastructure
# 2.) set Channel to "0" for auto-select on Infrastructuremode
# 3.) set SSID for connecting to your Accss-point.
# 4.) AuthMode can be "WEPAUTO", "OPEN", "SHARED", "WPAPSK","WPA2PSK", "WPANONE"
# 5.) EncrypType can be "NONE", "WEP", "TKIP", "AES"
# for more information refer to the Readme file.


因为我是做嵌入式的,为了省事,就将RT2870STA.dat直接固话到嵌入式设备里。然后修改路径就OK了。路径在/include/os/rt_linux.h里。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值