RT3070驱动移植笔记 海思3515

时间:2020-12-04 20:38:43

今天将rt3070wifi模块安装到海思3515开发板上,需要移植驱动程序。下面就移植过程做一下笔记

首先下载源码,可以到我的资源中下载http://download.csdn.net/detail/alangdangjia/5430273

其次准备好你想要移植的开发板的系统的内核源码,并且是编译过的,因为编译过之后,里面会产生config文件,这个在下面驱动的编译时是需要的。

然后解压,选择其中一个就可以,现在是使用的rt3070这个目录下的驱动

到driver2.5_1010下面,修改Makefile文件,

我选择的是5VT平台,这个没有太大的关系,你选择哪个,就修改一下那个对应的交叉编译环境就可以了,

找到5VT下面的内核路径,和交叉编译器路径,修改如下:

  1. ifeq ($(PLATFORM),5VT) 
  2. LINUX_SRC = /var/Hi3515/Hi3515_SDK_V1.0.8.0/source/os/linux-2.6.24 
  3. CROSS_COMPILE = /opt/hisi-linux/x86-arm/gcc-3.4.3-uClibc-0.9.28/arm-hisi-linux/bin/ 


然后修改os/linux目录下的config.mk文件

也是找到5VT对应的那部分,将CFLAGS修改为EXTRA_CFLAGS,并且去掉-Wno-pointer-sign选项,因为海思提供的交叉编译环境不支持这个选项,修改后如下:

  1. ifeq ($(PLATFORM),5VT) 
  2. #CFLAGS := -D__KERNEL__ -I$(LINUX_SRC)/include -I$(RT28xx_DIR)/include -mlittle-endian -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -O3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-omit-frame-pointer -mapcs -mno-sched-prolog -mabi=apcs-gnu -mno-thumb-interwork -D__LINUX_ARM_ARCH__=5 -march=armv5te -mtune=arm926ej-s --param max-inline-insns-single=40000  -Uarm -Wdeclaration-after-statement -Wno-pointer-sign -DMODULE $(WFLAGS) 
  3. EXTRA_CFLAGS := -D__KERNEL__ -I$(LINUX_SRC)/include -I$(RT28xx_DIR)/include -mlittle-endian -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -O3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-omit-frame-pointer -mapcs -mno-sched-prolog -mabi=apcs-gnu -mno-thumb-interwork -D__LINUX_ARM_ARCH__=5 -march=armv5te -mtune=arm926ej-s --param max-inline-insns-single=40000  -Uarm -Wdeclaration-after-statement  -DMODULE $(WFLAGS)  
  4.  
  5. export EXTRA_CFLAGS 
  6. endif 

之所以要修改CFLAGS就是为了防止报如下的错误:


  1. scripts/Makefile.build:46: *** CFLAGS was changed in "/var/Hi3515/Hi3515_SDK_V1.0.8.0/source/os/linux/Makefile". Fix it to use EXTRA_CFLAGS.  Stop. 

当然我在网上看到有人通过另一种方式解决的,就是在make的时候添加KBUILD_NOPEDANTIC=1选项,如下

make ARCH=arm KBUILD_NOPEDANTIC=1

这样就不会提示上面的错误。但是我在通过使用这个选项的时候,虽然CFLAGS的错误不报了,但是编译的文件发生了很多处错误,所以还是修改成了EXTRA_CFLAGS。


然后就可以make了,一般来说,这样就已经可以了。

但是在我编译的过程中,出现了一个gcc报的错误:

  1. /var/Hi3515/2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO/os/linux/../../common/cmm_info.c: In function `RTMPCommSiteSurveyData': 
  2. /var/Hi3515/2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO/os/linux/../../common/cmm_info.c:2370: internal compiler error: in verify_local_live_at_start, at flow.c:546 
  3. Please submit a full bug report, 
  4. with preprocessed source if appropriate. 
  5. Send email to arm-gnu@codesourcery.com for instructions. 


查了很多资料,这个错误确实是gcc自身的错误,我当前使用的gcc是3.4.4版本,采用了新标准,所以以前旧的语法可能不支持了。可以通过更换gcc来解决这个问题,但是我的问题是:我使用的交叉编译环境是海思提供的,更换交叉编译所用的gcc的话,还需要将开发板中所有的东西都全部重新用新的gcc编译一便,更糟糕的是,海思没有提供其他的gcc,而我也不知道怎么替换。所以,根据网上有人说,一个比较投机的解决方法,就是将发生错误的那个函数进行屏蔽,就是将其中的所有的内容全部注释掉,只留个返回就行了,于是我就按照这样的方法,将

RTMPCommSiteSurveyData函数下面的内容全部屏蔽掉。这样做是有风险的:因为你不知道这个函数是干什么的,万一影响到了驱动,那么你虽然编译通过了,但是驱动根本不能工作,但是没办法,还是试了一下,万一正常呢,就算是解决了。

另外还有一种方法,就是将这个函数修改一下,而不是全部屏蔽,这个方法貌似更佳靠谱一些,我后来是采用的修改的方法,修改如下:

  1. #define LINE_LEN    (4+33+20+23+9+7+3)  // Channel+SSID+Bssid+Security+Signal+WiressMode+NetworkType 
  2. #ifdef CONFIG_STA_SUPPORT 
  3. #endif // CONFIG_STA_SUPPORT // 
  4.     VOID    RTMPCommSiteSurveyData( 
  5.         IN  PSTRING     msg, 
  6.         IN  PBSS_ENTRY  pBss) 
  7.     { 
  8.         INT         Rssi = 0; 
  9.         UINT        Rssi_Quality = 0; 
  10.         NDIS_802_11_NETWORK_TYPE    wireless_mode; 
  11.         CHAR        Ssid[MAX_LEN_OF_SSID +1]; 
  12.         STRING      SecurityStr[32] = {0}; 
  13.         NDIS_802_11_ENCRYPTION_STATUS   ap_cipher = Ndis802_11EncryptionDisabled; 
  14.         NDIS_802_11_AUTHENTICATION_MODE ap_auth_mode = Ndis802_11AuthModeOpen; 
  15.      
  16.         memset(Ssid, 0 ,(MAX_LEN_OF_SSID +1)); 
  17.      
  18.             //Channel 
  19.             sprintf(msg+strlen(msg),"%-4d", pBss->Channel); 
  20.             //SSID 
  21.             memcpy(Ssid, pBss->Ssid, pBss->SsidLen); 
  22.             Ssid[pBss->SsidLen] = '\0'
  23.             sprintf(msg+strlen(msg),"%-33s", Ssid);       
  24.             //BSSID 
  25.             sprintf(msg+strlen(msg),"%02x:%02x:%02x:%02x:%02x:%02x   ",  
  26.                 pBss->Bssid[0],  
  27.                 pBss->Bssid[1], 
  28.                 pBss->Bssid[2],  
  29.                 pBss->Bssid[3],  
  30.                 pBss->Bssid[4],  
  31.                 pBss->Bssid[5]); 
  32.      
  33.         //Security 
  34.         if ((Ndis802_11AuthModeWPA <= pBss->AuthMode) && 
  35.             (pBss->AuthMode <= Ndis802_11AuthModeWPA1PSKWPA2PSK)) 
  36.         { 
  37.             if (pBss->AuthModeAux == Ndis802_11AuthModeWPANone) 
  38.             { 
  39.                 ap_auth_mode = pBss->AuthMode; 
  40.                 if (pBss->WPA.PairCipherAux == Ndis802_11WEPDisabled) 
  41.                     ap_cipher = pBss->WPA.PairCipher; 
  42.                 else  
  43.                     ap_cipher = Ndis802_11Encryption4Enabled; 
  44.             } 
  45.             else if (pBss->AuthModeAux == Ndis802_11AuthModeOpen) 
  46.             { 
  47.                 ap_auth_mode = pBss->AuthMode; 
  48.                 if ((ap_auth_mode == Ndis802_11AuthModeWPA) ||  
  49.                     (ap_auth_mode == Ndis802_11AuthModeWPAPSK)) 
  50.                 { 
  51.                     if (pBss->WPA.PairCipherAux == Ndis802_11WEPDisabled) 
  52.                         ap_cipher = pBss->WPA.PairCipher; 
  53.                     else  
  54.                         ap_cipher = Ndis802_11Encryption4Enabled; 
  55.                 } 
  56.                 else if ((ap_auth_mode == Ndis802_11AuthModeWPA2) ||  
  57.                          (ap_auth_mode == Ndis802_11AuthModeWPA2PSK)) 
  58.                 { 
  59.                     if (pBss->WPA2.PairCipherAux == Ndis802_11WEPDisabled) 
  60.                         ap_cipher = pBss->WPA2.PairCipher; 
  61.                     else  
  62.                         ap_cipher = Ndis802_11Encryption4Enabled; 
  63.                 } 
  64.             } 
  65.             else if ((pBss->AuthMode == Ndis802_11AuthModeWPAPSK) ||  
  66.                      (pBss->AuthMode == Ndis802_11AuthModeWPA2PSK)) 
  67.             { 
  68.                 if ((pBss->AuthModeAux == Ndis802_11AuthModeWPAPSK) || 
  69.                     (pBss->AuthModeAux == Ndis802_11AuthModeWPA2PSK)) 
  70.                     ap_auth_mode = Ndis802_11AuthModeWPA1PSKWPA2PSK; 
  71.                 else 
  72.                     ap_auth_mode = pBss->AuthMode; 
  73.      
  74.                 if (pBss->WPA.PairCipher != pBss->WPA2.PairCipher) 
  75.                     ap_cipher = Ndis802_11Encryption4Enabled; 
  76.                 else if ((pBss->WPA.PairCipher == pBss->WPA2.PairCipher) && 
  77.                          (pBss->WPA.PairCipherAux != pBss->WPA2.PairCipherAux)) 
  78.                     ap_cipher = Ndis802_11Encryption4Enabled; 
  79.                 else if ((pBss->WPA.PairCipher == pBss->WPA2.PairCipher) && 
  80.                          (pBss->WPA.PairCipherAux == pBss->WPA2.PairCipherAux) && 
  81.                          (pBss->WPA.PairCipherAux != Ndis802_11WEPDisabled)) 
  82.                     ap_cipher = Ndis802_11Encryption4Enabled; 
  83.                 else if ((pBss->WPA.PairCipher == pBss->WPA2.PairCipher) && 
  84.                          (pBss->WPA.PairCipherAux == pBss->WPA2.PairCipherAux) && 
  85.                          (pBss->WPA.PairCipherAux == Ndis802_11WEPDisabled)) 
  86.                     ap_cipher = pBss->WPA.PairCipher; 
  87.             } 
  88.             else if ((pBss->AuthMode == Ndis802_11AuthModeWPA) ||  
  89.                      (pBss->AuthMode == Ndis802_11AuthModeWPA2)) 
  90.             { 
  91.                 if ((pBss->AuthModeAux == Ndis802_11AuthModeWPA) || 
  92.                     (pBss->AuthMode == Ndis802_11AuthModeWPA2)) 
  93.                     ap_auth_mode = Ndis802_11AuthModeWPA1WPA2; 
  94.                 else 
  95.                     ap_auth_mode = pBss->AuthMode; 
  96.      
  97.                 if (pBss->WPA.PairCipher != pBss->WPA2.PairCipher) 
  98.                     ap_cipher = Ndis802_11Encryption4Enabled; 
  99.                 else if ((pBss->WPA.PairCipher == pBss->WPA2.PairCipher) && 
  100.                          (pBss->WPA.PairCipherAux != pBss->WPA2.PairCipherAux)) 
  101.                     ap_cipher = Ndis802_11Encryption4Enabled; 
  102.                 else if ((pBss->WPA.PairCipher == pBss->WPA2.PairCipher) && 
  103.                          (pBss->WPA.PairCipherAux == pBss->WPA2.PairCipherAux) && 
  104.                          (pBss->WPA.PairCipherAux != Ndis802_11WEPDisabled)) 
  105.                     ap_cipher = Ndis802_11Encryption4Enabled; 
  106.                 else if ((pBss->WPA.PairCipher == pBss->WPA2.PairCipher) && 
  107.                          (pBss->WPA.PairCipherAux == pBss->WPA2.PairCipherAux) && 
  108.                          (pBss->WPA.PairCipherAux == Ndis802_11WEPDisabled)) 
  109.                     ap_cipher = pBss->WPA.PairCipher; 
  110.             } 
  111.      
  112.             sprintf(SecurityStr, "%s/%s", GetAuthMode((CHAR)ap_auth_mode), GetEncryptType((CHAR)ap_cipher));         
  113.         }            
  114.         else 
  115.         { 
  116.             ap_auth_mode = pBss->AuthMode; 
  117.             ap_cipher = pBss->WepStatus;      
  118.             if (ap_cipher == Ndis802_11WEPDisabled) 
  119.                 sprintf(SecurityStr, "NONE"); 
  120.             else if (ap_cipher == Ndis802_11WEPEnabled) 
  121.                 sprintf(SecurityStr, "WEP"); 
  122.             else 
  123.                 sprintf(SecurityStr, "%s/%s", GetAuthMode((CHAR)ap_auth_mode), GetEncryptType((CHAR)ap_cipher));         
  124.         } 
  125.      
  126.         sprintf(msg+strlen(msg), "%-23s", SecurityStr); 
  127.      
  128.             // Rssi 
  129.             Rssi = (INT)pBss->Rssi; 
  130.             if (Rssi >= -50) 
  131.                 Rssi_Quality = 100; 
  132.             else if (Rssi >= -80)    // between -50 ~ -80dbm 
  133.                 Rssi_Quality = (UINT)(24 + ((Rssi + 80) * 26)/10); 
  134.             else if (Rssi >= -90)   // between -80 ~ -90dbm 
  135.                 Rssi_Quality = (UINT)(((Rssi + 90) * 26)/10); 
  136.             else    // < -84 dbm 
  137.                 Rssi_Quality = 0; 
  138.             sprintf(msg+strlen(msg),"%-9d", Rssi_Quality); 
  139.             // Wireless Mode 
  140.             wireless_mode = NetworkTypeInUseSanity(pBss); 
  141.             if (wireless_mode == Ndis802_11FH || 
  142.                 wireless_mode == Ndis802_11DS) 
  143.                 sprintf(msg+strlen(msg),"%-7s","11b"); 
  144.             else if (wireless_mode == Ndis802_11OFDM5) 
  145.                 sprintf(msg+strlen(msg),"%-7s","11a"); 
  146.             else if (wireless_mode == Ndis802_11OFDM5_N) 
  147.                 sprintf(msg+strlen(msg),"%-7s","11a/n"); 
  148.             else if (wireless_mode == Ndis802_11OFDM24) 
  149.                 sprintf(msg+strlen(msg),"%-7s","11b/g"); 
  150.             else if (wireless_mode == Ndis802_11OFDM24_N) 
  151.                 sprintf(msg+strlen(msg),"%-7s","11b/g/n"); 
  152.             else 
  153.                 sprintf(msg+strlen(msg),"%-7s","unknow"); 
  154.             //Network Type       
  155.             if (pBss->BssType == BSS_ADHOC) 
  156.                 sprintf(msg+strlen(msg),"%-3s"," Ad"); 
  157.             else 
  158.                 sprintf(msg+strlen(msg),"%-3s"," In"); 
  159.      
  160.             sprintf(msg+strlen(msg),"\n"); 
  161.      
  162.         return
  163.     } 


将这个函数改写之后,是去掉了最后一个参数,所以在调用的地方,也需要修改,大概是在2387行,改成

RTMPCommSiteSurveyData(msg, pBss);

然后在编译即可了。

更改之后,编译通过,然后

通过在开发板中将配置文件和驱动文件拷贝过去

cp RT2870STA.dat  /etc/Wireless/RT2870STA/RT2870STA.dat

cp os/linux/rt3070sta.ko /usr/rt3070sta.ko

然后加载驱动

insmod /usr/rt3070sta.ko

会看到一些信息:

  1. rtusb init rt2870 ---> 
  2.  
  3.  
  4. === pAd = c4945000,size = 513120 === 
  5.  
  6. <-- RTMPAllocTxRxRingMemory,Status=0 
  7. <-- RTMPAllocAdapterBlock,Status=0 
  8. usbcore: registered new interface driver rt2870 


代表加载成功,然后可以通过ifconfig -a查看是否含有ra0网卡,如果有,代表已经加载成功了

下一步要启动网卡,

ifconfig ra0 up

会出现一些提示信息,代表你当前的设置什么的:

(Efuse for 3062/3562/3572) Size=0x2d [2d0-2fc]
RTMP_TimerListAdd: add timer obj c498d5a8!
RTMP_TimerListAdd: add timer obj c498d5d4!
RTMP_TimerListAdd: add timer obj c498d600!
RTMP_TimerListAdd: add timer obj c498d57c!
RTMP_TimerListAdd: add timer obj c498d4f8!
RTMP_TimerListAdd: add timer obj c498d524!
RTMP_TimerListAdd: add timer obj c4957b3c!
RTMP_TimerListAdd: add timer obj c4946f24!
RTMP_TimerListAdd: add timer obj c4946f58!
RTMP_TimerListAdd: add timer obj c4957bd4!
RTMP_TimerListAdd: add timer obj c4957ae4!
RTMP_TimerListAdd: add timer obj c4957ba4!
-->RTUSBVenderReset
<--RTUSBVenderReset
RTMPSetProfileParameters::(CountryRegion=60)
RTMPSetProfileParameters::(SSID=JeffWu)
RTMPSetProfileParameters::(Channel=1)
RTMPSetProfileParameters::(PhyMode=4)
RTMPSetProfileParameters::(TxPower=100)
RTMPSetProfileParameters::(AuthMode=0)
RTMPSetProfileParameters::(EncrypType=1)
Key1Str is Invalid key length(0) or Type(0)
Key2Str is Invalid key length(0) or Type(0)
Key3Str is Invalid key length(0) or Type(0)
Key4Str is Invalid key length(0) or Type(0)
RTMPSetProfileParameters :: (AutoRoaming=1)
RTMPSetProfileParameters :: (RoamThreshold=-72  dBm)
RTMPSetProfileParameters :: (BeaconLostTime=400 )
%%%%%%%%%%%%
1. Phy Mode = 4
2. Phy Mode = 4
NVM is Efuse and its size =2d[2d0-2fc]
(Efuse for 3062/3562/3572) Size=0x2d [2d0-2fc]
3. Phy Mode = 4
< ==== rt28xx_init, Status=0
0x1300 = 00073200

但是在我第一次加载时候,提示一个错误“

BIRIdx(6): RXDMALen not multiple of 4.[258], BulkInBufLen = 276)
BIRIdx(0): RXDMALen not multiple of 4.[257], BulkInBufLen = 272)
BIRIdx(3): RXDMALen not multiple of 4.[258], BulkInBufLen = 276)
GetPacketFromRxRing():pRxWIMPDUtotalByteCount(1281) large than RxDMALen(24)
BIRIdx(6): RXDMALen not multiple of 4.[257], BulkInBufLen = 280)
BIRIdx(0): RXDMALen not multiple of 4.[257], BulkInBufLen = 272)
BIRIdx(1): RXDMALen not multiple of 4.[258], BulkInBufLen = 276)

类似的信息不停的往出挑,这时因为DMA缓冲区设置的太大了,所以需要修改文件,从新编译驱动,修改驱动中的includ/iface/rtmp_usb.h文件

找到开头部分的#define RXBULKAGGRE_SIZE   12,将12修改为6,就可以解决了,这个数值越小,相对而言,网卡的性能越差一些,具体差多少我也不清楚。

更改完之后,重新编译,成功运行。

下面转载一下其他网友的文章

Linux Hi3515重新开始 (2)rt3070驱动移植

2013-02-22 15:20:48|  分类:HI3515学习|  标签:hi3515|字号订阅

http://rpf413.blog.163.com/blog/static/45563760201161132158913/

http://blog.chinaunix.net/uid-28572323-id-3482376.html

无线网卡为RT3070,驱动分为STA驱动和SoftAP驱动两种,STA驱动支持无线网卡工作在STA模式下,而SoftAP的驱动支持无线网卡工作在软AP的模式下,可以作为一个软的接入点。STA驱动为2010_0831_RT3070_Linux_STA_v2.3.0.0_DPO.bz2SoftAP的驱动是:2010_0203_RT3070_SoftAP_v2.4.0.1_DPA.bz2。需要移植STA驱动和SoftAP驱动,两款驱动的移植步骤差不多。下边首先对STA驱动进行移植。

1、编译驱动的预操作:编译arm版本的内核源码。(大致一样

tiny6410的光碟中获取内核源码,此内核源码已经经过友善之臂的移植,可以直接编译移植入tiny6410中。

cp linux-2.6.38-20110718.tar.gz/usr/src/kernels/

cd /usr/src/kernels

tar -zxvf linux-2.6.38-20110718.tar.gz

cd linux-2.6.38

cp config_mini6410_n43 .config

make menuconfig

进入内核配置界面,内核配置中需要做的修改如下:

[*] Networking support--->

     [*] Wireless--->

            <*> cfg80211 - wireless configuration API

            [*] Wireless extensions sysfs files

            <*> Generic IEEE 802.11 Networking Stack(mac80211)

Device Drivers--->

     [*]Network device support--->

            [*] Wireless LAN--->

                   <*> IEEE 802.11 for Host AP (Prism2/2.5/3 andWEP/TKIP/CCMP)

                   [*]   Support downloading firmware images withHost AP driver

                   [*]     Support for non-volatile firmwaredownload

                   <M> Ralink driver support--->

                          <M> Ralink rt27xx/rt28xx/rt30xx (USB) support

然后make,编译通过后会在arch/arm/boot/目录下生成可烧写入开发板的zImage内核镜像。

2:编译rt3070模块的驱动

解压tar -zxvf 2011_0107_RT3070_RT3370_Linux_STA_v2.5.0.1_DPO.tar.gz

修改原有的Makefile文件如下(只给出需要修改的部分,“-”表示删除的行,“+”表示添加的行):

+#Makefile for RT3070 on MBC-SAM9G45

+#2010_11_13 by liyi

RT28xx_MODE = STA

TARGET = LINUX

CHIPSET = 3070

-PLATFORM = PC

+PLATFORM = IXP

ifeq ($(PLATFORM),IXP)

-LINUX_SRC = /project

-CROSS_COMPILE = arm-linux-

+LINUX_SRC = /hisi/Hi3515_SDK_V1.0.8.0/source/os/linux-2.6.24

+CROSS_COMPILE =arm-hismall-linux-

endif

修改os/linux文件夹中的config.mk文件,需要修改的地方如下(只给出需要修改的部分):

# Support Wpa_Supplicant

- HAS_WPA_SUPPLICANT=n

+HAS_WPA_SUPPLICANT=y

# Support Native WpaSupplicant for Network Maganger

-HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n

+HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y

ifeq ($(PLATFORM),IXP)

- WFLAGS += -DRT_BIG_ENDIAN

+#WFLAGS += -DRT_BIG_ENDIAN

endif

ifeq ($(PLATFORM),IXP)

      EXTRA_CFLAGS := -v $(WFLAGS) -I$(RT28xx_DIR)/include

endif

ifeq ($(PLATFORM),IXP)

-       CFLAGS := -v -D__KERNEL__ -DMODULE -I$(LINUX_SRC)/include -I$(RT28xx_DIR)/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -Uarm -fno-common -pipe -mapcs-32 -D__LINUX_ARM_ARCH__=5 -mcpu=xscale -mtune=xscale -malignment-traps -msoft-float $(WFLAGS)

-      EXTRA_CFLAGS := -v $(WFLAGS) -I$(RT28xx_DIR)/include

-       export CFLAGS     

-

+

endif


ifeq ($(PLATFORM),IXP)
- WFLAGS += -DRT_BIG_ENDIAN
#
加这个选项,模块运行时显示出错,CPU不能工作
endif

在修改驱动config.mk文件的时候,红色修改部分没有给全,应该是把CFLAGS和EXTRA_FLAGS中的-mbig-endian选项去掉,因为在ARM中采用的小端模式!

修改完成以后,通过以下命令编译:

make ARCH=arm KBUILD_NOPEDANTIC=1

如果不加KBUILD_NOPEDANTIC=1将出现CFLAGS was changed in …. Fix it to use EXTRA_CFLAGS的错误,编译不能通过。编译完成后,会在os/linux文件夹中生成rt3070sta.ko的驱动模块。

会报如下错误:

/home/cabbage/Desktop/rt3070/os/linux/../../chips/rtmp_chip.c:In function 'RtmpChipOpsHook':

/home/cabbage/Desktop/rt3070/os/linux/../../chips/rtmp_chip.c:470:error: implicit declaration of function 'RT33xx_Init'

make[2]: ***[/home/cabbage/Desktop/rt3070/os/linux/../../chips/rtmp_chip.o] Error 1

make[1]: ***[_module_/home/cabbage/Desktop/rt3070/os/linux] Error 2

make[1]: Leaving directory`/usr/src/kernels/linux-2.6.38'

make: *** [LINUX] Error 2

在网上查到似乎是因为改变了CHIPSET所导致的错误。修改chips/目录下的rtmp_chip.c文件,定位到470行,修改后如下:

#ifdef RT30xx

      if (IS_RT30xx(pAd))

      {

              if (IS_RT3390(pAd))

                   ;//RT33xx_Init(pAd);

              else

                      RT30xx_Init(pAd);

      }

#endif /* RT30xx */




3、烧写内核和加载驱动

将之前编译好的zImage镜像通过dnw烧写入开发板中,将rt3070sta.ko和驱动源码目录下的RT2870STA.dat两个文件通过nfs或者sd卡下载到开发板中,RT2870STA.dat放入/etc/Wireless/RT2870STA/目录下,rt3070sta.ko放入任意合适的目录,我放在了/usr下。

mkdir –p /etc/Wireless/RT2870STA/

cp RT2870STA.dat / etc/Wireless/RT2870STA/

cp rt3070sta.ko /usr

加载驱动

insmod /usr/rt3070sta.ko

rtusb init rt2870 --->

=== pAd = d1502000, size = 513400 ===

<-- RTMPAllocTxRxRingMemory, Status=0

<-- RTMPAllocAdapterBlock, Status=0

usbcore: registered new interface driver rt2870

然后可以通过ifconfig –a可以看到系统已经正确识别网卡,名称为ra0

ifconfig –a

ra0     Link encap:EthernetHWaddr 00:00:00:00:00:00

        BROADCAST MULTICASTMTU:1500Metric: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)

然后启动网卡,有如下信息输出,而后可以观察到模块的指示灯不停闪烁,此时网卡已经可以正常工作了。

#ifconfig ra0 up

(Efuse for 3062/3562/3572) Size=0x2d [2d0-2fc]

RTMP_TimerListAdd: add timer obj d1549ba8!

RTMP_TimerListAdd: add timer obj d1549bd8!

RTMP_TimerListAdd: add timer obj d1549c08!

RTMP_TimerListAdd: add timer obj d1549b78!

RTMP_TimerListAdd: add timer obj d1549ae8!

RTMP_TimerListAdd: add timer obj d1549b18!

RTMP_TimerListAdd: add timer obj d151471c!

RTMP_TimerListAdd: add timer obj d1503edc!

RTMP_TimerListAdd: add timer obj d1503f14!

RTMP_TimerListAdd: add timer obj d15147c0!

RTMP_TimerListAdd: add timer obj d15146bc!

RTMP_TimerListAdd: add timer obj d151478c!

-->RTUSBVenderReset

<--RTUSBVenderReset

Key1Str is Invalid key length(0) or Type(0)

Key2Str is Invalid key length(0) or Type(0)

Key3Str is Invalid key length(0) or Type(0)

Key4Str is Invalid key length(0) or Type(0)

1. Phy Mode = 5

2. Phy Mode = 5

NVM is Efuse and its size =2d[2d0-2fc]

phy mode> Error! The chip does not support 5G band 5!

RTMPSetPhyMode: channel is out of range, use first channel=1

(Efuse for 3062/3562/3572) Size=0x2d [2d0-2fc]

3. Phy Mode = 9

AntCfgInit: primary/secondary ant 0/1

MCS Set = ff 00 00 00 01

<==== rt28xx_init, Status=0

0x1300 = 00064300

至此网卡驱动移植成功。但是如果需要让网卡连接入目前常见的WPA加密的网络,还需要移植wpa_supplicant工具。

另外还有一个名为wireless_tools的辅助工具,可以用它来检索在网卡所在的环境中存在的无线网络,如果对于要连接入的无线网络的ssid和相关信息已经清楚,可以不用移植,不过这个工具的移植很简单。

4、移植wireless_tools

源码下载地址:http://download.csdn.net/detail/colwer/4515005#comment(这个地址里的资源跟描述不一致……

tar zxvf wireless_tools.29.tar.gz

cd wireless_tools.29

vim Makefile

PREFIX = /usr/local/wirelesstool

CC =/usr/local/FriendlyARM/toolschain/4.5.1/bin/arm-linux-gcc

AR =/usr/local/FriendlyARM/toolschain/4.5.1/bin/arm-linux-ar

RANLIB =/usr/local/FriendlyARM/toolschain/4.5.1/bin/arm-linux-ranlib

make

make install

/usr/local/wirelesstool/lib目录下找到libiw.so.29,下载到开发板的/lib/目录下;/usr/local/wirelesstool/sbin目录下找到iwpriviwconfigiwlist, iwevent, iwspy等命令,下载到开发板的/usr/sbin目录下。这时就应该可以使用这些命令通过网卡搜索到环境中的无线网络。

ifconfig ra0 up

iwlist ra0 scan

Cell 06 - Address: 38:83:45:E5:CB:3E

                  Protocol:802.11b/g/n

                  ESSID:"idart-wlan311"

                  Mode:Managed

                  Frequency:2.437 GHz (Channel 6)

                  Quality=100/100Signal level=-43 dBmNoise level=-92 dBm

                  Encryption key:on

                  Bit Rates:22.5 Mb/s

                  IE: WPA Version 1

                      Group Cipher : CCMP

                      Pairwise Ciphers (1) : CCMP

                      Authentication Suites (1) : PSK

                  IE: IEEE 802.11i/WPA2 Version 1

                      Group Cipher : CCMP

                      Pairwise Ciphers (1) : CCMP

                      Authentication Suites (1) : PSK

                  IE: Unknown: DD0E0050F204104A0001101044000102

        Cell 07 - Address: 58:66:BA:EE:DB:40

                  Protocol:802.11b/g/n

                  ESSID:"ChinaNet"

                  Mode:Managed

                  Frequency:2.437 GHz (Channel 6)

                  Quality=42/100Signal level=-73 dBmNoise level=-76 dBm

                  Encryption key:off

                  Bit Rates:54 Mb/s

        Cell 08 - Address: 58:66:BA:EE:DB:41

                  Protocol:802.11b/g/n

                  ESSID:"SYSUWLAN"

                Mode:Managed

                  Frequency:2.437 GHz (Channel 6)

                  Quality=37/100Signal level=-75 dBmNoise level=-78 dBm

                  Encryption key:off

                  Bit Rates:54 Mb/s

至此wireliss_tools移植成功。

设置ESSID 实验室的无线网络没有密码因此可以直接设置联网

  # iwconfig ra0 ESSID Mywifi

此时已经可以ping同其他电脑了!!!!!!!!

下面移植的工具我一直没有成功,提示错误,因此目前还没有解决有密码的wifi网络问题!!


/ $ wpa_supplicant -B -irausb0 -c /etc/wpa_supplicant.conf -Dralink

/usr/sbin/wpa_supplicant: /usr/sbin/wpa_supplicant: 1: Syntax error: "(" unexpected


5、移植wpa_supplicant

源码下载地址:http://hostap.epitest.fi/wpa_supplicant/

它的移植还需要openssl,下载地址:http://www.openssl.org/source/

我使用的是wpa_supplicant-0.6.10openssl-0.9.8e

将两个包解压后,需要为opensll打上wpa的补丁,然后交叉编译

cp wpa_supplicant-0.6.10/patches/openssl-0.9.8e-tls-extensions.patch openssl-0.9.8e/

cd openssl-0.9.8e

mkdir /usr/local/ssl

vim Makefile

INSTALLTOP=/usr/local/ssl

OPENSSLDIR=/usr/local/ssl

……

CC= arm-linux-gcc

AR= arm-linux- ar $(ARFLAGS) r

RANLIB= arm-linux-ranlib

make

make install

/usr/local/ssl目录下安装了ssl库。

然后进入到wpa_supplicant的目录,修改配置文件和Makefile

cd ../wpa_supplicant-0.6.10/wpa_supplicant

cp defconfig .config

vim .config

# Uncomment following two lines and fix the paths if you have installed OpenSSL

# or GnuTLS in non-default location

CFLAGS += -I/usr/local/ssl/include

LIBS += -L/usr/local/ssl/lib

vim Makefile

#ifndef CC

CC=arm-linux-gcc

#endif

然后make,便可以在当前目录下得到需要的wpa_supplicant工具

wpa_supplicant和配置文件wpa_supplicant.conf下载到开发板中,wpa_supplicant替换掉原本开发板/usr/sbin/目录下的wpa_supplicantwpa_supplicant.conf放在/etc目录下,对wpa_supplicant.conf文件进行编辑:

ctrl_interface=/var/run/wpa_supplicant

network={

      ssid="idart-wlan311"

      scan_ssid=1

      key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE

      pairwise=TKIP CCMP

      group=CCMP TKIP WEP104 WEP40

      psk="XXXXXXXX"

}

其中的psk为无线网的密码

然后把文件末尾提供的一些example全部删除,否则在使用wpa_supplicant时会报一些类型无法识别的错误。

最后进行测试,测试之前要关闭有线网卡eth0,原因是如果不关闭的话在之后添加默认路由时会被设置为有线网卡的默认路由,这个应该有别的解决方法,不过我没有仔细去查。

ifconfig eth0 down

ifconfig ra0 up

ifconfig ra0 192.168.1.248 netmask 255.255.255.0

route add default gw 192.168.1.1

wpa_supplicant -B -ira0 -c /etc/wpa_supplicant.conf –Dwext

===>rt_ioctl_giwscan. 28(28) BSS returned, data->length = 3351

==>rt_ioctl_siwfreq::SIOCSIWFREQ(Channel=6)

RTMP_TimerListAdd: add timer obj d15785c4!

6ping通外网

ping www.google.com

Rcv Wcid(1) AddBAReq

Start Seq = 00000000

RTMP_TimerListAdd: add timer obj d157a5e4!

PING www.google.com (74.125.128.106): 56 data bytes

64 bytes from 74.125.128.106: seq=0 ttl=40 time=86.383 ms

64 bytes from 74.125.128.106: seq=1 ttl=40 time=84.996 ms

64 bytes from 74.125.128.106: seq=2 ttl=40 time=102.010 ms

64 bytes from 74.125.128.106: seq=3 ttl=40 time=86.005 ms

^C

--- www.google.com ping statistics ---

4 packets transmitted, 4 packets received, 0% packet loss

round-trip min/avg/max = 84.996/89.848/102.010 ms

另一篇:

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 not permitted

修改MODULE NETIF UTIL三个目录下的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 following interfaces,
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" for details.
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.o module.
#
# Use "vi RT2870STA.dat" to modify settings according to your need.
#
# 1.) set NetworkType to "Adhoc" for using Adhoc-mode, otherwise using Infrastructure
# 2.) set Channel to "0" for auto-select on Infrastructure mode
# 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里。
#define STA_PROFILE_PATH "/etc/Wireless/RT2870STA/RT2870STA.dat"



关于RT3070(RT2870)和wpa_supplicant的使用


前段时间搞了一下RT73与wpa_supplicant,调通了,无论是什么加密方式和认证类型,RT73都可以良好的工作。可又由于RT73停产了,*要使用RT3070。刚开始我以为应该和RT73差不多,果不其然,用法十分接近,但是也有一点点区别的。

1.首先RT73使用的是rausb0表示的,而RT3070使用ra0表示。

2.RT3070的驱动差不多是RT73的两倍多。

3.另外,在使用wpa_supplicant上也有点小区别,主要是wpa_supplicant版本的问题。

下面,我就说一下我的使用过程,希望可以帮助到大家!

首先是驱动的编译,从网上下了好多RT3070的驱动,都没交叉编译过去,只有2009_1106_RT3070_Linux_STA_V2.1.1.0.bz2这一版本的编译过去了,呵呵!

交叉编译过程:

1.tar -jxvf 2009_1106_RT3070_Linux_STA_V2.1.1.0.bz2

2. cd 2009_1106_RT3070_Linux_STA_V2.1.1.0

3.vi makefile

[c-sharp]  view plain copy print ?
  1. #PLATFORM: Target platform  
  2. #PLATFORM = PC  
  3. PLATFORM = 5VT  
  4. #PLATFORM = IKANOS_V160  
  5. #PLATFORM = IKANOS_V180  
  6. #PLATFORM = SIGMA  
  7. #PLATFORM = SIGMA_8622  
  8. #PLATFORM = INIC  
  9. #PLATFORM = STAR  
  10. #PLATFORM = IXP  
  11. #PLATFORM = INF_TWINPASS  
  12. #PLATFORM = INF_DANUBE  
  13. #PLATFORM = BRCM_6358  
  14. #PLATFORM = INF_AMAZON_SE  
  15. #PLATFORM = CAVM_OCTEON  
  16. #PLATFORM = CMPC  
  17. #PLATFORM = RALINK_2880  

 

[c-sharp]  view plain copy print ?
  1. ifeq ($(PLATFORM),5VT)  
  2. LINUX_SRC = /home/Hi3511_VSSDK_V1.1.2.2/pub/kbuild-FULL_REL  
  3. CROSS_COMPILE = arm-hismall-linux-  
  4. endif  

4.cd os/linux

5.vi config.mk

[c-sharp]  view plain copy print ?
  1. #ifdef WPA_SUPPLICANT_SUPPORT  
  2. # Support Wpa_Supplicant  
  3. HAS_WPA_SUPPLICANT=y  
  4. #endif // WPA_SUPPLICANT_SUPPORT //  
  5.  
  6. #ifdef NATIVE_WPA_SUPPLICANT_SUPPORT  
  7. # Support Native WpaSupplicant for Network Maganger  
  8. HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y  
  9. #endif // NATIVE_WPA_SUPPLICANT_SUPPORT //  

6.cd ../../common

vi rtusb_io.c:

[c-sharp]  view plain copy print ?
  1. if (ret < 0) {  
  2.     //DBGPRINT(RT_DEBUG_OFF, ("#/n"));  
  3.                 RTMPusecDelay(5000);  
  4.             }  

否则,加载驱动后会一直打印"#",很烦!!!!!

7.cd ../../..

8.make

这时,应该就编译通过了。在2009_1106_RT3070_Linux_STA_V2.1.1.0/os/linux目录下生成了rt3070sta.ko,也就是RT3070的驱动了。

9.把RT2870STA.dat拷贝到/etc/Wireless/RT2870STA目录下

加载驱动过程

insmod rt3070sta.ko

看一下打印消息:

[c-sharp]  view plain copy print ?
  1. rtusb init --->  
  2.   
  3.   
  4. === pAd = ca901000, size = 465920 ===  
  5.   
  6. <-- RTMPAllocAdapterBlock, Status=0  
  7. usbcore: registered new driver rt2870  

iwconfig看一下

[c-sharp]  view plain copy print ?
  1. ra0       RT2870 Wireless  ESSID:""  
  2.           Mode:Auto  Frequency=2.412 GHz  
  3.           Link Quality=10/100  Signal level:-256 dBm  Noise level:-143 dBm  
  4.           Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0  
  5.           Tx excessive retries:0  Invalid misc:0   Missed beacon:0  

注意wireless_tools之前要移植到开发板上!

接下来就是wpa_supplicant的交叉编译,这个比较麻烦,在这里就不详细说明了,给个网址给大家,我也是参考着做的:

http://blog.csdn.net/farsight2009/archive/2010/06/10/5660878.aspx

不过,我使用的是0.6.10这个版本,其他版本我都没用起来!

由于这个版本比较高,上述网址中的

[c-sharp]  view plain copy print ?
  1. #cp ../2009_0713_RT73_Linux_STA_Drv1.1.0.3/WPA_Supplicant-0.5.8/driver_ralink.* ./  
  2.         #cp ../2009_0713_RT73_Linux_STA_Drv1.1.0.3/WPA_Supplicant-0.5.8/driver.h ./  
  3.         #cp ../2009_0713_RT73_Linux_STA_Drv1.1.0.3/WPA_Supplicant-0.5.8/events.c ./  
  4.         #cp ../2009_0713_RT73_Linux_STA_Drv1.1.0.3/WPA_Supplicant-0.5.8/wpa_supplicant.c ./  
  5.         #cp ../2009_0713_RT73_Linux_STA_Drv1.1.0.3/WPA_Supplicant-0.5.8/wpa_supplicant_i.h ./  
  6.         #cp ../2009_0713_RT73_Linux_STA_Drv1.1.0.3/WPA_Supplicant-0.5.8/defconfig ./  
  7.         #cp ../2009_0713_RT73_Linux_STA_Drv1.1.0.3/WPA_Supplicant-0.5.8/drivers.c ./  
  8.         #cp ../2009_0713_RT73_Linux_STA_Drv1.1.0.3/WPA_Supplicant-0.5.8/Makefile ./  
  9.   
  10.   
  11. 本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/farsight2009/archive/2010/06/10/5660878.aspx  

这些部分就可以略去了,不用做了,呵呵!

顺利地话,就可以在wpa_supplicant-0.6.10/wpa_supplicant下生成wpa_supplicant了!接着就是把wpa_supplicant拷贝到开发板中。

关于wpa_supplicant的使用:

1.把wpa_supplicant.conf拷贝到/etc目录下,当然要根据情况修改wpa_supplicant.conf的内容了!

这里我提供一个我修改的模板,屡试不爽!

[c-sharp]  view plain copy print ?
  1. ctrl_interface=/var/run/wpa_supplicant  
  2. network={  
  3.     ssid="XXXXXX"  
  4.     scan_ssid=1  
  5.     key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE   
  6.     pairwise=TKIP CCMP    
  7.     group=CCMP TKIP WEP104 WEP40      
  8.     psk="XXXXXX"  
  9. }  

其中XXXXXX要替换成相应的ssid和密码!无论是什么加密方式和认证类型,都搞定!WEP除外,因为WEP加密比较简单,在后面会提到,呵呵!!!

2.mkdir -p /var/run/wpa_supplicant

3.最后就是用命令

 wpa_supplicant -B -ira0 -c /etc/wpa_supplicant.conf -Dwext

看一下超级终端的打印:

[c-sharp]  view plain copy print ?
  1. <-- RTMPAllocTxRxRingMemory, Status=0  
  2. -->RTUSBVenderReset  
  3. <--RTUSBVenderReset  
  4. Key1Str is Invalid key length(0) or Type(0)  
  5. Key2Str is Invalid key length(0) or Type(0)  
  6. Key3Str is Invalid key length(0) or Type(0)  
  7. Key4Str is Invalid key length(0) or Type(0)  
  8. 1. Phy Mode = 9  
  9. 2. Phy Mode = 9  
  10. NVM is Efuse and its size =2d[2d0-2fc]  
  11. 3. Phy Mode = 9  
  12. RTMPSetPhyMode: channel is out of range, use first channel=1  
  13. MCS Set = ff 00 00 00 01  
  14. <==== rt28xx_init, Status=0  
  15. 0x1300 = 00064300  
  16. /mnt $ ===>rt_ioctl_giwscan. 4(4) BSS returned, data->length = 447  
  17. ==>rt_ioctl_siwfreq::SIOCSIWFREQ[cmd=0x8b04] (Channel=1)  

 

这过程可能要花费几秒钟!

接着ifconfig一下它的ip,ping一下无线路由器,应该能ping通的。

当然,这些都是让RT3070工作在managed模式下的,工作在ad-hoc模式下的配置跟简单,不需要使用wpa_supplicant!

可以参考里面的iwpriv_usage.txt进行配置,我配置了一下,发现其中有几种情况配置不成功,这里我把配置成功的罗列下来:

[c-sharp]  view plain copy print ?
  1. ===========================================================================  
  2. Config STA to link with AP which is SHARED/WEP(Authentication/Encryption)  
  3.     1. iwpriv ra0 set NetworkType=Infra  
  4.     2. iwpriv ra0 set AuthMode=SHARED  
  5.     3. iwpriv ra0 set EncrypType=WEP  
  6.     4. iwpriv ra0 set DefaultKeyID=1  
  7.     5. iwpriv ra0 set Key1="AP's wep key"  
  8.     6. iwpriv ra0 set SSID="AP's SSID"  
  9. ===========================================================================  
  10. Config STA to link with AP which is OPEN/WEP(Authentication/Encryption)  
  11.     1. iwpriv ra0 set NetworkType=Infra  
  12.     2. iwpriv ra0 set AuthMode=OPEN  
  13.     3. iwpriv ra0 set EncrypType=WEP  
  14.     4. iwpriv ra0 set DefaultKeyID=1  
  15.     5. iwpriv ra0 set Key1="AP's wep key"  
  16.     6. iwpriv ra0 set SSID="AP's SSID"  
  17. ===========================================================================  
  18. Config STA to link with AP which is OPEN or SHARED/WEP(Authentication/Encryption)  
  19.     1. iwpriv ra0 set NetworkType=Infra  
  20.     2. iwpriv ra0 set AuthMode=WEPAUTO  
  21.     3. iwpriv ra0 set EncrypType=WEP  
  22.     4. iwpriv ra0 set DefaultKeyID=1  
  23.     5. iwpriv ra0 set Key1="AP's wep key"  
  24.     6. iwpriv ra0 set SSID="AP's SSID"  
  25. ===========================================================================  
  26. Config STA to create/link as adhoc mode, which is OPEN/NONE(Authentication/Encryption)  
  27.     1. iwpriv ra0 set NetworkType=Adhoc  
  28.     2. iwpriv ra0 set AuthMode=OPEN  
  29.     3. iwpriv ra0 set EncrypType=NONE  
  30.     4. iwpriv ra0 set SSID="Adhoc's SSID"  
  31. ===========================================================================  
  32. Config STA to create/link as adhoc mode, which is OPEN/WEP(Authentication/Encryption)  
  33.     1. iwpriv ra0 set NetworkType=Adhoc  
  34.     2. iwpriv ra0 set AuthMode=OPEN  
  35.     3. iwpriv ra0 set EncrypType=WEP  
  36.     4. iwpriv ra0 set DefaultKeyID=1  
  37.     5. iwpriv ra0 set Key1="AP's wep key"  
  38.     6. iwpriv ra0 set SSID="Adhoc's SSID"  
  39. ===========================================================================  
  40. Config STA to create/link as adhoc mode, which is SHARED/WEP(Authentication/Encryption)  
  41.     1. iwpriv ra0 set NetworkType=Adhoc  
  42.     2. iwpriv ra0 set AuthMode=SHARED  
  43.     3. iwpriv ra0 set EncrypType=WEP  
  44.     4. iwpriv ra0 set DefaultKeyID=1  
  45.     5. iwpriv ra0 set Key1="AP's wep key"  
  46.     6. iwpriv ra0 set SSID="Adhoc's SSID"  
  47. ===========================================================================  
  48. Config STA to create/link as adhoc mode, which is OPEN or SHARED/WEP(Authentication/Encryption)  
  49.     1. iwpriv ra0 set NetworkType=Adhoc  
  50.     2. iwpriv ra0 set AuthMode=WEPAUTO  
  51.     3. iwpriv ra0 set EncrypType=WEP  
  52.     4. iwpriv ra0 set DefaultKeyID=1  
  53.     5. iwpriv ra0 set Key1="AP's wep key"  
  54.     6. iwpriv ra0 set SSID="Adhoc's SSID"  

 

=============================The End==============================

 

==========================================================================================================

发现做达芬奇平台有很多qq交流群,但是海思平台的QQ交流群却很少,至少我在网上没有找到,于是我打算创建一个。
小弟自从毕业已经搞海思的平台有2年半了,刚开始主要做上层,做过一个流媒体播放器,可以在手机上观看实时视频。转向做驱动也有接近2年的时间了,想创建一个群用于交流,没有其他什么意思,希望志同道合的朋友们用于加入,踊跃发言!谢谢!最后注明QQ群号码:
213622826

==========================================================================================================