很早就想在2440上移植无线网卡驱动了,在网上也看了不少相关的资料,但真正做起来才发现有不少问题。
一开始,我用从同学那里拿来的TL-WN725N(这卡便宜啊,50左右成交,TB上坑爹的2440无线网卡最低也要90+),但是不知为什么把驱动编译好了,插上网卡,执行insmod,再执行ifconfig wlan0 up时老出错。
root@VTK321 /(-_-!)>usb 1-1: new full speed USB device using s3c2410-ohci and ad
dress 2
usb 1-1: New USB device found, idVendor=0bda, idProduct=8176
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: 802.11n WLAN Adapter
usb 1-1: Manufacturer: Realtek
usb 1-1: SerialNumber: 00e04c000001
usb 1-1: configuration #1 chosen from 1 choice
root@VTK321 /(-_-!)>insmod 8192cu.ko
rtw driver version=v3.4.3_4369.20120622
Build at: Nov 30 2012 16:32:00
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_TSMC_CHIP_88C.
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 = ec:88:8f:bf:fa:e7
EEPROMRegulatory = 0x0
_ReadBoardType(0)
BT Coexistance = disable
RT_ChannelPlan: 0x02
_ReadPSSetting...bHWPwrPindetect(0)-bHWPowerdown(0) ,bSupportRemoteWakeup(0)
### PS params=> power_mgnt(1),usbss_enable(0) ###
### AntDivCfg(0)
readAdapterInfo_8192CU(): REPLACEMENT = 1
<==== ReadAdapterInfo8192C in 2165 ms
rtw_macaddr_cfg MAC Address = ec:88:8f:bf:fa:e7
MAC Address from pnetdev->dev_addr= ec:88:8f:bf:fa:e7
bDriverStopped:1, bSurpriseRemoved:0, bup:0, hw_init_completed:0
usbcore: registered new interface driver rtl8192cu
root@VTK321 /(-_-!)>
//------------------------------------------------------------------------------------------------------------------------------------------------------------//
root@VTK321 /(-_-!)>ifconfig wlan0 up
+871x_drv - drv_open, bup=0
===> FirmwareDownload91C() fw:Rtl819XFwImageArray_TSMC
FirmwareDownload92C accquire FW from embedded image
fw_ver=v80, fw_subver=0, sig=0x88c0
fw download ok!
Set RF Chip ID to RF_6052 and RF type to 1T1R.
IOL rtl8192c_IOL_exec_cmds_sync complete in 20ms
IOL rtl8192c_IOL_exec_cmds_sync complete in 20ms
IOL rtl8192c_IOL_exec_cmds_sync complete in 65ms
IOL rtl8192c_IOL_exec_cmds_sync complete in 60ms
IOL rtl8192c_IOL_exec_cmds_sync complete in 250ms
IQK:Start!!!
Path A Rx IQK fail!!
Path A Rx IQK fail!!
Path A IQK Only Tx Success!!
Path A Rx IQK fail!!
Path A Rx IQK fail!!
Path A IQK Only Tx Success!!
IQK: final_candidate is 0
IQK: RegE94=100 RegE9C=f RegEA4=0 RegEAC=0 RegEB4=0 RegEBC=0 RegEC4=0 RegECC=0
Path A IQ Calibration Success !
_PHY_PathAFillIQKMatrix only Tx OK
pdmpriv->TxPowerTrackControl = 1
MAC Address from REG_MACID = ec:88:8f:bf:fa:e7
rtl8192cu_hal_init in 1755ms
MAC Address = ec:88:8f:bf:fa:e7
-871x_drv - drv_open, bup=1
root@VTK321 /(-_-!)>==>pwr_state_check_handler .fw_state(0)
==> rtw_ps_cmd , enqueue CMD
==>rtw_ps_processor .fw_state(0)
==>ips_enter cnts:1
==>power_saving_ctrl_wk_hdl change rf to OFF...LED(0x00020808)....
===> rtw_ips_pwr_down...................
====> rtw_ips_dev_unload...
usb_read_port_cancel
usb_write_port_cancel
==> rtl8192cu_hal_deinit
bkeepfwalive(0)
card disble without HWSM...........
<=== rtw_ips_pwr_down..................... in 315ms
从反馈信息看到设备是挂上了,但是一直提示usb读写取消。
先是怀疑驱动错了,但是网上移植方法都大同小异,而且都是这样的。接着换板子,还是一样情况。最后换网卡,换成磊科NW336(rtl8188cus芯片)也还是一样,不过却发现NW336的指示灯一开始亮了,当出现==>pwr_state_check_handler .fw_state(0)时就灭了。于是翻查芯片的手册,看到8188具有省电模式,在Makefile中默认选上,而且加载驱动时,也默认最小省电模式(没错,就是上面代码红色的地方,旁边的应该是usb自动休眠,也是坑爹玩意)。
You can easy set the power saving to Min-PS (rtw_power_mgnt=1) by modify
the CONFIG_POWER_SAVING to y, at the line 20 of Makefile file.
Ex:
CONFIG_POWER_SAVING = y
于是尝试了一下,执行insmod 8192cu.ko rtw_power_mgnt=0(关闭省电模式),然后ifconfig wlan0 up,
等了一下,没出现usb读写取消的信息,NW336的指示灯也亮着,于是执行iwlist scanning,网卡很快就搜到了AP。
看来就是省电模式和2440有冲突啊。苦战了N久,终于搞定了.................
PS:如果不想每次insmod都带参数,在Makefile里把CONFIG_POWER_SAVING设成N就行了!!!