Migrate RT2870 wireless network card driver to s3c2416

Publisher:自由漫步Latest update time:2023-09-14 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The company's project requires a USB wireless network card, and the chip is Ralink's RT2870. The following are the steps to transplant its driver to s3c2416.
1. Download the driver source code. The download address of Ralink official website is:
http://www.ralinktech.com/en/04_support/support.php?sn=501

2. Unzip 2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO.bz2

3. Enter the directory, Modify the Makefile
to comment out PLATFORM = PC, and remove the # of #PLATFORM = SMDK, that is, PLATFORM is defined as SMDK.
Change the two sentences after ifeq ($(PLATFORM),SMDK) to:
LINUX_SRC = /root/Download /linux-2.6.32.2 (This is defined according to the kernel source code path of your own development board)
CROSS_COMPILE = /usr/local/arm/4.4.3/bin/arm-linux- (the path where the cross-compilation tool chain is located)

 

  First check whether wireless has been added to the kernel configuration: enter the development board kernel make menuconfig 

 DeviceDrivers --->     

                Networkdevice support --->

WirelessLAN (non-hamradio) ---> 

  [*]Wireless LAN drivers (non-hamradio) & WirelessExtensions                    

     [*] Wireless Extension API overRtNetlink                                       

         --- Obsolete Wireless cards support(pre-802.11)                                  

<> STRIP (Metricom starmode radioIP)                                          

<> USB ZD1201 based Wireless devicesupport                                    

<> IEEE 802.11 for H

Otherwise, even if you compile the module, you will not be able to use it.

After configuring, save it, it is best to make it!

 Generate a new kernel. The purpose of this is to fully configure some required files to avoid errors when compiling the module. At first, I actually compiled a 12M driver module. Later, I succeeded. In fact, it was only more than 800 KB. The size of the final rt5370sta.ko is for reference only.

Note: If the compiled module is relatively large (about 10M), you can try this method:

Use the command: arm-linux-strip -S ****.ko to solve the problem.

The principle is to remove debugging information. If an error occurs, it may be that your arm-linux-gcc does not specify the path. Just add your cross-compilation path in front. Mine is over 800K in size.
The second value is the path to the cross-compilation tool. Modify it according to your own situation.

4. Execute make

5. Download the module and configuration files
and transfer the final ko file rt5370sta.ko generated by make in the os/linux directory to the /lib/modules/2.6.32.2-FriendlyARM directory of the development board. At the same time, transfer the RT2870STA.dat file in the source code root directory to the /etc/Wireless/RT2870STA/ directory. If not, just create a new directory.

6. Install the module.
insmod rt5370sta.ko

If the following error occurs, it means that your kernel source code is wrong. Follow the instructions in step 3 to process the kernel source code again.
rt5370sta: version magic '2.6.32.59 mod_unload ARMv4 ' should be '2.6.32.2-Frie'
insmod: cannot insert 'rt5370sta.ko': invalid module format

The last step is to insert the network card. Ifconfig cannot see the network card at this time, you have to To enable the network card, use the following command:
ifconfig ra0 up
My situation is as follows:

Click (here) to collapse or open

  1. [root@FriendlyARM /]# ifconfig ra0 up 

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

  3. -->RTUSBVenderReset 

  4. <--RTUSBVenderReset 

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

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

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

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

  9. 1. Phy Mode = 5 

  10. 2. Phy Mode = 5 

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

  12. phy mode> The chip does not support 5G band 

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

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

  15. 3. Phy Mode = 9 

  16. AntCfgInit: primary/secondary ant 0/1 

  17. AsicSetRxAnt, switch to main antenna 

  18. MCS Set = ff 00 00 00 01 

  19. <==== rt28xx_init, Status=0 

  20. 0x1300 = 00064300

Ifconfig again, you can see the ra0 network card.


Reference address:Migrate RT2870 wireless network card driver to s3c2416

Previous article:Some additions to the article "s3c2416 Naked Running Environment Configuration"
Next article:Analyze and implement S3C2416 sleep and wake-up from sys/power/state

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号