Rui rtl8188cus wireless NIC Driver Transplantation

Source: Internet
Author: User

15:58:23 | classification: ARM9.
Linux | font size subscription

Host ubuntu10.10. Compilation tool: Arm-Linux-GCC 4.3.3 embedded platform S3C2440 kernel Linux. 2.6.37.4.

 

Just got a Mercury wireless network card. My first reaction was to take a look. Rui rtl8188cuz chip. I can see that the CD files that come with the NIC are Linux drivers. A Word document in it helps me a lot. How to support new platform. Doc. It will teach you how to modify makefile. First copy the driver file to the host. Modify makefile. Config_platform_i1__pc = y
Config_platform_android_x86 = N
Config_platform_arm_s3c2k4 = N
Config_platform_arm_pxa2xx = N
Config_platform_arm_initi6k4 = N
Config_platform_mips_rmi = N
Config_platform_rtd2880b = N
Config_platform_mips_ar9132 = N
Config_platform_mt53xx = N
Config_platform_rtk_dmp = N
Config_platform_arm_tcc8900 = N
Config_platform_arm_mx51_241h = N
Config_platform_actions_atj227x = N
Config_platform_ti_dm365 = N
Config_platform_rk2818 = N
Config_platform_mips_jz4760 = n. The default value is i386 -- PC. Select your own platform. I only need arm_s3c2k4 = Y, i1__pc = n, and then modify the compilation tool. Kernel path.

Ifeq ($ (config_platform_arm_s3c2k4), Y)
Extra_cflags + =-dconfig_little_endian
Arch: = arm
Cross_compile: = arm-Linux-
Kver: = 2.6.37.4
Ksrc: =/home/lilei/linux-2.6.37.4
Endif

Cross -- complize corresponds to the compilation tool. Kver corresponds to the kernel version. Then, ksrc is the kernel path. This must be correct. Okay. The makefile has been changed. Isn't it easy. Make compilation after modification

 

What is the situation? First go to the Internet to receive it. Is there any such situation. No. By yourself. Find the corresponding C file. Comment out the init-mutex function. Compile in make. Hey. Success.

 

8192cu. Ko is the file we want. Copy to the Development Board. Insmod 8192cu. Ko, I am dumb. Error message. I think it is a driver problem. The init-mutesx function is not running. Let me check the official website of RealTek. I see the driver provided on the official website. The kernel 2.6.3... is supported. I can see that the driver on the official website is the 201104 month. The drive on my CD is the 201101 month. No matter. Try the driver on the official website, modify the makefile as above, and then make. Do not compile it successfully at once. Copy the generated 8192cu. Ko to the Development Board. Overwrite the original one. Remember to add permissions to this file.
Chmod 777 8192cu. Ko. Insmod 8182cu. KO [root @ xc2440/] # insmod 8192cu. Ko
RTW driver version = v2.0.1502.20110402
Register rtl8192_netdev_ops to netdev_ops8192_usb_endpoint_descriptor (0 ):
Blength = 7
Bdescriptortype = 5
Bendpointaddress = 81
Wmaxpacketsize = 40
Binterval = 08192_usb_endpoint_descriptor (1 ):
Blength = 7
Bdescriptortype = 5
Bendpointaddress = 2
Wmaxpacketsize = 40
Binterval = 08192_usb_endpoint_descriptor (2 ):
Blength = 7
Bdescriptortype = 5
Bendpointaddress = 3
Wmaxpacketsize = 40
Binterval = 08192_usb_endpoint_descriptor (3 ):
Blength = 7
Bdescriptortype = 5
Bendpointaddress = 84
Wmaxpacketsize = 40
Binterval = 1
Nr_endpoint = 4, in_num = 2, out_num = 28192cu: Non usb_speed_high
Chip version ID: version_normal_tsmc_chip_88c.
Initial psecuritypriv-> sw_encrypt: 0
1) EEPROM type is E-FUSE
====> Readadapterinfo8192c
Boot from efuse, autoload success!
Rtw_efuse_get_max_phy_size... eeprompriv. efuse_phy_max_size (504)
Eepromvid = 0x0133
Eeprompid = 0x8176
Eepromcustomerid: 0x00
Eepromsubcustomerid: 0x00
Rt_customerid: 0x00
Rt_channelplan: (0x02: 0x02)
_ Readboardtype (0)
### Antdivcfg (0)
BT coexistance = Disable
_ Readhwpdselection... bhwpwrpindetect (0)-bhwpowerdown (0), bsupportremotewakeup (0)
### PS Params => power_mgnt (0), usbss_enable (0 )###
_ Initadaptervariablesbyprom (): Replacement = 1
<=== Readadapterinfo8192c
MAC address from efuse = 5C: 63: BF: 2D: F0: FF
Usbcore: registered new interface driver rtw_usb_drv. Check whether there are any wireless devices. [Root @ xc2440/] # ifconfig
Eth0 link encap: Ethernet hwaddr 08: 09: 0a: A0: 90: 80
Inet ADDR: 192.168.1.10 bcast: 192.168.1.255 mask: 255.255.255.0
Up broadcast multicast MTU: 1500 Metric: 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 FIG: 1000
RX Bytes: 0 (0.0 B) TX Bytes: 0 (0.0 B)
Interrupt: 62 base address: 0x8000lo link encap: local loopback
Inet ADDR: 127.0.0.1 mask: 255.0.0.0
Up loopback running MTU: 16436 Metric: 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: 0
RX Bytes: 0 (0.0 B) TX Bytes: 0 (0.0 B) No... Forget. Ifconfig wlan0 up start the wireless device [root @ xc2440/] # ifconfig wlan0 up
+ 8192cu_drv-drv_open, bup = 0
==> Firmwaredownload91c () FW: rtl819xfwimagearray_tsmc
Fw_ver = v68, fw_subver = 1, Sig = 0x88c0
FW download OK!
Set RF chip ID to rf_6052 and RF type to 1t1r.
Rf_chip = 0x4, rf_type = 0x3
Iqk: Start !!!
Path A iqk success !!
Path A iqk success !!
Iqk: final_candidate is 0
Iqk: rege94 = FF rege9c = 11 regea4 = Fe regeac = 2 regeb4 = 0 regebc = 0 regec4 = 0 regecc = 0
Path a IQ calibration success!
MAC address from reg = 5c-63-bf-2d-f0-ff
Pdmpriv-> txpowertrackcontrol = 1
MAC address = 5c-63-bf-2d-f0-ff
-871x_drv-drv_open, bup = 1: Configure ipifconfig wlan0 192.168.1.166. Then, query the nearby wireless network.

[Root @ xc2440/] # iwlist wlan0 Scanning
Survey done event (0x18)
Wlan0 scan completed:
Cell 01-Address: 54: E6: FC: 7e: AB: BC
Essid: "zero_net"
Protocol: IEEE 802.11bgn
Mode: Master
Frequency: 2.427 GHz (Channel 4)
Encryption key: On
Bit Rates: 150 MB/S
Extra: rsn_ie = 30140100000fac040100000fac040100000fac020000
IE: IEEE 802.11i/wpa2 version 1
Group cipher: CCMP
Pairwise ciphers (1): CCMP
Authentication suites (1): PSK
IE: Unknown: dd0e0050f20da-4a0001101044000102
Quality = 70/100 signal level = 70/100
Cell 02-Address: 6C: E8: 73: B8: 61: F0
Essid: "lilei"
Protocol: IEEE 802.11bg
Mode: Master
Frequency: 2.412 GHz (Channel 1)
Encryption key: On
Bit Rates: 54 MB/S
Quality = 100/100 signal level = 100/100

Wireless_tools.29.tar.gz. All files can be stored online, and makefile can be modified as well.
# Compiler to use (modify this for cross compile ).
Cc = arm-Linux-gcc
# Other tools you need to modify for cross compile (static lib only ).
AR = arm-Linux-ar
Ranlib = arm-Linux-ranlib

Make compilation. The iwpriv, iwconfig, iwlist, iwspy, and copy files are generated to the Development Board/sbin directory. Copy the libiw in the same directory at the same time. So. 29 to the Development Board/lib directory. Start to establish a connection.

Iwconfig wlan0 key #####

Iwconfig wlan0 Essid "network name"

The following shows the connection status through iwconfig wlan0:

[Root @ xc2440/] # iwconfig wlan0
Wlan0 IEEE 802.11bg Essid: "lilei" nickname: "<WiFi @ RealTek>"
Mode: managed frequency: 2.412 GHz Access Point: 6C: E8: 73: B8: 61: F0
Bit Rate: 54 Mb/s sensiti.pdf: 45/0
Retry: Off RTS thr: Off fragment thr: Off
Encryption key: 1122-3344-55 security mode: Open
Power Management: Off
Link quality = 99/100 signal level =-45 dBm
RX invalid nwid: 0 RX invalid crypt: 0 RX invalid frag: 0
TX excessive retries: 0 invalid MISC: 0 missed Beacon: 0.

Okay. First, block the dm9000 Nic on the Development Board. Ifconfig eth0 down.

Ping 192.168.1.1. I am connected to the network from the wireless router.

[Root @ xc2440/] # ifconfig eth0 down
[Root @ xc2440/] # Ping 192.168.1.1
Ping 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: seq = 0 TTL = 64 time = 91.224 MS
64 bytes from 192.168.1.1: seq = 1 TTL = 64 time = 3.603 MS
64 bytes from 192.168.1.1: seq = 2 TTL = 64 time = 4.004 MS
64 bytes from 192.168.1.1: seq = 3 TTL = 64 time = 3.974 MS
64 bytes from 192.168.1.1: seq = 4 TTL = 64 time = 4.063 MS
64 bytes from 192.168.1.1: seq = 5 TTL = 64 time = 4.020 MS
64 bytes from 192.168.1.1: seq = 6 TTL = 64 time = 3.964 MS
64 bytes from 192.168.1.1: seq = 7 TTL = 64 time = 4.205 MS
64 bytes from 192.168.1.1: seq = 8 TTL = 64 time = 4.075 MS
64 bytes from 192.168.1.1: seq = 9 TTL = 64 time = 3.771 Ms. Ping. A connection has been established. Hey. So excited,

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.