Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3170463
  • 博文数量: 685
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 5303
  • 用 户 组: 普通用户
  • 注册时间: 2014-04-19 14:17
个人简介

文章分类

全部博文(685)

文章存档

2015年(116)

2014年(569)

分类: 嵌入式

2014-09-17 14:37:31

原文地址:http://blog.sina.com.cn/s/blog_6701bbda0101kvjb.html
在B-LINK的驱动光盘里找到linux/150M/RTL8188CUS_linux_v3.0.2164.20110715.zip,解压得到RTL8192CU_8188CUS_8188CE-VAU_linux_v3.0.2164.20110715/driver/文件夹下的rtl8192_8188CU_linux_v3.0.2164.20110715.tar.gz,把它解压到/home/hxy/FriendlyARM/wifi/linux-2.6.32.2/drivers/net/wireless路径下。
cd /home/hxy/FriendlyARM/wifi/linux-2.6.32.2/drivers/net/wireless
mv
rtl8192_8188CU_linux_v3.0.2164.20110715 rtl8192_8188
vim Kconfig 添加:
config RTL8192_8188
tristate "Realtek 8192 and 8188 USB support"
depends on MAC80211 && USB && WLAN_80211
select EEPROM_93CX6
---help---:
This is a driver for RTL8187 and RTL8187B based cards.
vim Makefile 添加:
obj-$(CONFIG_RTL8192_8188) += rtl8192_8188/
cd rtl8192_8188/
vim Makefile
修改
CONFIG_PLATFORM_I386_PC = n
CONFIG_PLATFORM_ARM_S3C2K4 = y //修改芯片架构
CONFIG_POWER_SAVING = n //去掉节能模式
ifeq ($(CONFIG_PLATFORM_ARM_S3C2K4), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
ARCH := arm
CROSS_COMPILE := arm-linux-
KVER := 2.6.32.2
KSRC := /home/hxy/FriendlyARM/wifi/linux-$(KVER)
endif
(参考http://blog.csdn.net/mrjy1475726263/article/details/8886925)
cd ../../../../
make menuconfig
选择:

Device Drivers --->
[*] Network device support --->
Wireless LAN --->
<*> Realtek 8192 and 8188 USB support

(题外:手千万不能太贱,make distclean是把整个内核的配置全清除了!!!好在linux-2.6.32.2-mini2440-20100728.tar.gz和linux-2.6.32.2-mini2440-20110413.tar.gz大抵无异。用之前的20110413的吧,得做备份才行!这是个教训,好在错得及时。
zip,tar cvzf *.tar.gz 要打包的路径,可用于备份。)


/home/hxy/FriendlyARM/wifi/linux-2.6.32.2下修改版本号:
vim Makefile
EXTRAVERSION = .2-FriendlyARM
make zImage
cd
drivers/net/wireless/rtl8192_8188
make

把生成的8192cu.ko拷到/lib/modules/2.6.32.2-FriendlyARM/路径下。
cd /lib/modules/2.6.32.2-FriendlyARM/
depmod /lib/modules/2.6.32.2-FriendlyARM/
modprobe 8192cu

(或者把8192cu.ko拷到/lib/modules/2.6.32.2-FriendlyARM/net/wireless路径下。
直接modprobe 8192cu)

(或者insmod 8192cu.ko
rtw driver version=v3.0.2164.20110715
usbcore: registered new interface driver rtl8192cu)

记得把usb-wifi-kits-for-mini2440-linux-2.6.32.2-20100728.tar.gz这个压缩包拷贝到mini2440的linux系统根目录中。
tar xvzf
usb-wifi-kits-for-mini2440-linux-2.6.32.2-20100728.tar.gz
cp -r lib /lib
cp -r usr /usr
即可驱动成功,但是仍提示有错。插上无线网卡,提示识别出了器件:
usb 1-1: configuration #1 chosen from 1 choice
usb 1-1: USB disconnect, address 3
usb 1-1: new full speed USB device using s3c2410-ohci and address 4
usb 1-1: configuration #1 chosen from 1 choice
register rtw_netdev_ops to netdev_ops
CHIP TYPE: RTL8188C_8192C

usb_endpoint_descriptor(0):
bLength=7
bDescriptorType=5
bEndpointAddress=81
wMaxPacketSize=40
bInterval=0
RT_usb_endpoint_is_bulk_in = 1

usb_endpoint_descriptor(1):
bLength=7
bDescriptorType=5
bEndpointAddress=2
wMaxPacketSize=40
bInterval=0
RT_usb_endpoint_is_bulk_out = 2

usb_endpoint_descriptor(2):
bLength=7
bDescriptorType=5
bEndpointAddress=3
wMaxPacketSize=40
bInterval=0
RT_usb_endpoint_is_bulk_out = 3

usb_endpoint_descriptor(3):
bLength=7
bDescriptorType=5
bEndpointAddress=84
wMaxPacketSize=40
bInterval=1
RT_usb_endpoint_is_int_in = 4, Interval = 1
nr_endpoint=4, in_num=2, out_num=2

NON USB_SPEED_HIGH
Chip Version ID: VERSION_NORMAL_UMC_CHIP_88C_B_CUT.
RF_Type is 3!!
EEPROM type is E-FUSE
====> ReadAdapterInfo8192C
Boot from EFUSE, Autoload OK !
EEPROMVID = 0x0bda
EEPROMPID = 0x8176
EEPROMCustomerID : 0x00
EEPROMSubCustomerID: 0x00
RT_CustomerID: 0x00
_ReadMACAddress MAC Address from EFUSE = 48:02:2a:35:49:60
EEPROMRegulatory = 0x0
_ReadBoardType(0)
BT Coexistance = disable
RT_ChannelPlan: 0x08
_ReadPSSetting...bHWPwrPindetect(0)-bHWPowerdown(10) ,bSupportRemoteWakeup(1)
### PS params=> power_mgnt(0),usbss_enable(0) ###
### AntDivCfg(0)
readAdapterInfo_8192CU(): REPLACEMENT = 0
<==== ReadAdapterInfo8192C in 2185 ms

padapter->pwrctrlpriv.bSupportRemoteWakeup~~~~~~

padapter->pwrctrlpriv.bSupportRemoteWakeup~~~[1]~~~
rtw_macaddr_cfg MAC Address = 48:02:2a:35:49:60
MAC Address from pnetdev->dev_addr= 48:02:2a:35:49:60
bDriverStopped:1, bSurpriseRemoved:0, bup:0, hw_init_completed:0


[root@FriendlyARM /]# scan-wifi
cfg80211: module is already loaded
modprobe: 'net/wireless/cfg80211.ko': invalid parameter
mac80211: module is already loaded
modprobe: 'net/mac80211/mac80211.ko': invalid parameter
Unable to handle kernel paging request at virtual address e1a00004
pgd = c200c000
[e1a00004] *pgd=00000000
Internal error: Oops: 80000005 [#1]
last sysfs file: /sys/devices/virtual/vc/vcsa4/dev
Modules linked in: compat_firmware_class(+)
CPU: 0 Not tainted (2.6.32.2-FriendlyARM #11)
PC is at 0xe1a00004
LR is at sys_init_module+0x98/0x1e0
pc : [] lr : [] psr: 80000013
sp : c3bdff88 ip : 00000000 fp : 00000000
r10: be91ee98 r9 : c3bde000 r8 : c0035024
r7 : 00002b31 r6 : 000a3cd0 r5 : 00000000 r4 : bf06aff8
r3 : 00030074 r2 : 00000001 r1 : 00000000 r0 : 00000000
Flags: Nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control: c000717f Table: 3200c000 DAC: 00000015
Process modprobe (pid: 924, stack limit = 0xc3bde270)
Stack: (0xc3bdff88 to 0xc3be0000)
ff80: 000cdc88 00002b31 000a3cd0 000cc380 00000000 000b8bb4
ffa0: 00000080 c0034ea0 000cc380 00000000 000cdc88 00002b31 000a3cd0 00000000
ffc0: 000cc380 00000000 000b8bb4 00000080 000b8028 000a3cd0 be91ee98 00000000
ffe0: 00000000 be91ea8c 00017afc 401c8984 60000010 000cdc88 30612031 30612431
Code: bad PC value
---[ end trace ada6f384b2416aa3 ]---
Segmentation fault
Unable to handle kernel NULL pointer dereference at virtual address 00000008
pgd = c205c000
[00000008] *pgd=32004031, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#2]
last sysfs file: /sys/devices/virtual/vc/vcsa4/dev
Modules linked in: compat_firmware_class(+)
CPU: 0 Tainted: G D (2.6.32.2-FriendlyARM #11)
PC is at m_show+0x48/0x144
LR is at m_show+0x38/0x144
pc : [] lr : [] psr: 00000013
sp : c200def8 ip : c3b4d000 fp : bf06affc
r10: c3bcd980 r9 : bf06affc r8 : bf06b120
r7 : 00000000 r6 : bf06affc r5 : c39f1d40 r4 : bf06aff8
r3 : 00000000 r2 : c200def0 r1 : c39f1d40 r0 : 00000000
Flags: nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control: c000717f Table: 3205c000 DAC: 00000015
Process modprobe (pid: 926, stack limit = 0xc200c270)
Stack: (0xc200def8 to 0xc200e000)
dee0: c39f1d40 bf06affc
df00: c39f1d40 4001f000 00000400 c200df88 00000000 c00af670 00000001 c39f1d68
df20: 00100077 00000000 00000000 00000000 00000000 c38892a0 c3bcd980 4001f000
df40: c200df88 c0035024 c200c000 000c4d7c 00000000 c00d1fa0 00000400 c3bcd980
df60: 4001f000 c0099734 c3bcd980 4001f000 c3bcd980 00000400 000cdc88 00000003
df80: c0035024 c0099884 00000000 00000000 00000400 00000000 000cdc88 40229000
dfa0: 00000000 c0034ea0 000cdc88 40229000 00000004 4001f000 00000400 00000000
dfc0: 000cdc88 40229000 000cdc88 00000003 4001cc00 00000000 000c4d7c 00000000
dfe0: 00000000 bed05a58 401681a4 401b9ebc 60000010 00000004 00000000 00000000
[] (m_show+0x48/0x144) from [] (seq_read+0x1dc/0x484)
[] (seq_read+0x1dc/0x484) from [] (proc_reg_read+0x44/0x58)
[] (proc_reg_read+0x44/0x58) from [] (vfs_read+0xac/0x154)
[] (vfs_read+0xac/0x154) from [] (sys_read+0x3c/0x68)
[] (sys_read+0x3c/0x68) from [] (ret_fast_syscall+0x0/0x28)
Code: e2868f49 e5947128 e3a03000 ea000006 (e5972008)
---[ end trace ada6f384b2416aa4 ]---
Segmentation fault
网上说该用最新的内核linux-2.6.32.2-mini2440-20100728.tar.gz,试过了一样的结果。我猜想这款无线网卡可能太新了,这些内核都不兼容。以后有时间移植一个最新的内核试试吧)
Ctrl+c,随手一试,将出现以下信息:
^C+871x_drv - drv_open, bup=0
===> FirmwareDownload91C() fw:Rtl819XFwImageArray_UMC_B
fw_ver=v75, fw_subver=0, sig=0x88c0
fw download ok!
Set RF Chip ID to RF_6052 and RF type to 1T1R.
pwrdown, 0x5c(BIT7)=00
eRfPowerStateToSet=0
IQK:Start!!!
Path A IQK Success!!
Path A IQK Success!!
IQK: final_candidate is 0
IQK: RegE94=100 RegE9C=e RegEA4=fc RegEAC=5 RegEB4=0 RegEBC=0 RegEC4=0 RegECC=0
Path A IQ Calibration Success !
pdmpriv->TxPowerTrackControl = 1
MAC Address from REG_MACID = 48:02:2a:35:49:60
MAC Address = 48:02:2a:35:49:60
-871x_drv - drv_open, bup=1
IQK:Start!!!
Path A IQK Success!!
Path A IQK Success!!
IQK: final_candidate is 0
IQK: RegE94=101 RegE9C=a RegEA4=f9 RegEAC=6 RegEB4=0 RegEBC=0 RegEC4=0 RegECC=0
Path A IQ Calibration Success !
ifconfig
eth0 Link encap:Ethernet HWaddr 08:90:90:90:90:90
inet addr:192.168.1.230 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 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:51 Base address:0x2300

lo 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)

wlan0 Link encap:Ethernet HWaddr 48:02:2A:35:49:60
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:33 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)

再来个scan-wifi,等了很久,直接Ctrl+c,出现:
^Csurvey done event(32)
CMCC
116% ChinaNet-uxNL
60% CMCC-AUTO(Security)
113% TP-LINK_1387D9(Security)
63% CMCC
66% Magic-systech test
67% XM-LAN(Security)
79% CMCC-AUTO(Security)
71% hquic(Security)
70% OpenWrt(Security)
84% ChinaNet-QD7d(Security)
33% 11 Access Point Found

start-wifi wpa2 hquic 12345678
Sending discover...
Sending discover...
Sending discover...
Sending discover...
Sending discover...
Sending discover...
Sending discover...
Sending discover...
Sending discover...
Sending discover...
Sending discover..
.
漫长的等待。。
等不了了,按理说,到这一步,应该是能够联上网络的,然而。。。算了,作罢吧。
至此,
网卡的移植可告一段落了,马马虎虎,不论成败。
参考 xvlf compat-wireless.tar.bz2

移植TL-WN322G+这款网卡。问题也很多。时间很紧迫,暂且搁下吧,尽管很不舍得。

1.到 下载最新的compat-wireless并解压缩
2.hxy@hxy-HP-xw4600-Workstation:~/FriendlyARM/wifi/linux-2.6.32.2$ vim .config
添加:
CONFIG_ATH_COMMON=m
CONFIG_ATH9K_HW=m
CONFIG_ATH9K_COMMON=m
CONFIG_ATH9K_HTC=m

修改:
CONFIG_MAC80211=m
CONFIG_CFG80211=m

cd ~/FriendlyARM/wifi/compat-wireless-2012-12-18
vim Makefile
注释掉:#obj-$(CONFIG_COMPAT_VIDEO_MODULES) += drivers/gpu/drm/
make ARCH=arm CROSS_COMPILE=arm-linux- KLIB:=~/FriendlyARM/wifi/linux-2.6.32.2 KLIB_BUILD :=~/FriendlyARM/wifi/linux-2.6.32.2
遇有错的语句,就找到相应的句子把它屏蔽掉,不知道这样子有没有好果子吃。至少,编译通过了,我这么安慰自己。
Mini2440内核移植USB无线网卡
把里头编译好的文件复制到开发板
[root@FriendlyARM ath9k]# modprobe ath9k_htc
cfg80211: Unknown symbol compat_genl_unregister_family
cfg80211: Unknown symbol compat_genl_register_family_with_ops
cfg80211: Unknown symbol compat_dependency_symbol
cfg80211: Unknown symbol compat_schedule_work
cfg80211: Unknown symbol compat_schedule_delayed_work
modprobe: 'net/wireless/cfg80211.ko': unknown symbol in module or invalid paramr
ath: Unknown symbol wiphy_apply_custom_regulatory
ath: Unknown symbol freq_reg_info
modprobe: 'drivers/net/wireless/ath/ath.ko': unknown symbol in module or invalir
ath9k_hw: Unknown symbol ath_hw_setbssidmask
ath9k_hw: Unknown symbol ath_regd_get_band_ctl
modprobe: 'drivers/net/wireless/ath/ath9k/ath9k_hw.ko': unknown symbol in modulr
Unable to handle kernel paging request at virtual address e1a00004
pgd = c3044000
[e1a00004] *pgd=00000000
Internal error: Oops: 80000005 [#1]
last sysfs file: /sys/devices/platform/s3c2410-ohci/usb1/1-1/dev
Modules linked in: compat_firmware_class(+)
CPU: 0 Not tainted (2.6.32.2-FriendlyARM #10)
PC is at 0xe1a00004
LR is at sys_init_module+0x98/0x1e0
pc : [] lr : [] psr: 80000013
sp : c3b93f88 ip : 00000000 fp : 00000000
r10: be882e08 r9 : c3b92000 r8 : c0035024
r7 : 00002b31 r6 : 000a3cd0 r5 : 00000000 r4 : bf0e2ff8
r3 : 00030074 r2 : 00000001 r1 : 00000000 r0 : 00000000
Flags: Nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control: c000717f Table: 33044000 DAC: 00000015
Process modprobe (pid: 1117, stack limit = 0xc3b92270)
Stack: (0xc3b93f88 to 0xc3b94000)
3f80: 000cdc88 00002b31 000a3cd0 000c5cd8 00000000 000b828c
3fa0: 00000080 c0034ea0 000c5cd8 00000000 000cdc88 00002b31 000a3cd0 00000000
3fc0: 000c5cd8 00000000 000b828c 00000080 000b8028 000a3cd0 be882e08 00000000
3fe0: 00000000 be882a4c 00017afc 401c8984 60000010 000cdc88 00000000 00000000
Code: bad PC value
---[ end trace 7189b8b7ef8cf3a2 ]---
Segmentation fault

于是彻底服气了。
Mini2440内核移植USB无线网卡

(还是很不服气。于是,又想办法,在
下载linux-2.6.32.61.tar等几个新内核。把内核里的网卡驱动换成新内核的驱动代码,编译,或有错,或效果一样没变。
后来发现所需要的驱动代码里的ath9k并不能make menuconfig进内核里,必须添加PCI模块,找来找去,没找到相应的办法,只好把PCI改成USB,如下:
vim drivers/net/wireless/ath/ath9k/Kconfig
tristate "Atheros 802.11n wireless cards support"
depends on PCI && MAC80211 && WLAN_80211
修改成
tristate "ATH9K Atheros 802.11n wireless cards support"
depends on USB && MAC80211 && WLAN_80211

结果不尽如人意,还是不行。还是应该试试怎么添加PCI。
——2013.7.20)
PCI还是未能添加,倒是下载了compat-wireless-2011-01-16,利用里头的Kconfig,解决了找到ATH9K_HTC的配置问题。compat-wireless-2011-01-16也make通过了,找到对应的模块ath9k_common.ko,ath9k_htc.ko,ath9k_hw.ko,cfg80211.ko,mac80211.ko,ar9271.fw,下载到开发板上,代替内核生成的模块。然而依然不行:
[root@FriendlyARM ath9k]# modprobe ath9k_htc
cfg80211: Unknown symbol compat_genl_unregister_family
cfg80211: Unknown symbol compat_genl_register_family_with_ops
modprobe: 'net/wireless/cfg80211.ko': unknown symbol in module or invalid parameter
ath: Unknown symbol wiphy_apply_custom_regulatory
ath: Unknown symbol freq_reg_info
modprobe: 'drivers/net/wireless/ath/ath.ko': unknown symbol in module or invalid parameter
ath9k_hw: Unknown symbol ath_hw_setbssidmask
ath9k_hw: Unknown symbol ath_hw_cycle_counters_update
ath9k_hw: Unknown symbol ath_regd_get_band_ctl
ath9k_hw: Unknown symbol ath_hw_get_listen_time
ath9k_hw: Unknown symbol ath_printk
modprobe: 'drivers/net/wireless/ath/ath9k/ath9k_hw.ko': unknown symbol in module or invalid parameter
Unable to handle kernel paging request at virtual address e1a00004
——2013.7.21
参考 做下来,仅编译生成了kfifo.ko,没有rfkill_backport.ko模块,不知道错在哪里。
——2013.7.23不搞了。在此备个份linux-2.6.32.2-mini2440-20100728.tar.gz。



阅读(1892) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~