linux -- 嵌入式linux下wifi无线网卡驱动
插入模块驱动
[root@WEIYAN wifi]$ insmod zd1211rw.ko
usb 1-1: reset full speed USB device using s3c2410-ohci and address 3
zd1211rw 1-1:1.0: phy2
usbcore: registered new interface driver zd1211rw
打开无线网卡
[root@WEIYAN wifi]$ ifconfig wlan0 up
zd1211rw 1-1:1.0: firmware version 4725
zd1211rw 1-1:1.0: zd1211b chip 0ace:1215 v4810 full 00-1d-0f UW2453_RF pa0 -7---
[root@WEIYAN wifi]$ ifconfig wlan0 up
zd1211rw 1-1:1.0: firmware version 4725
zd1211rw 1-1:1.0: zd1211b chip 0ace:1215 v4810 full 00-1d-0f UW2453_RF pa0 -7---
扫描频道
[root@WEIYAN wifi]$ ./wftools/iwlist wlan0 scanning
wlan0 Scan completed :
Cell 01 - Address: 00:0E:4E:81:02:4D
ESSID:"WEIYAN"
Mode:Master
Channel:6
Frequency:2.437 GHz (Channel 6)
Quality=11/100 Signal level=62/100
Encryption key:off
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s
Extra:tsf=00000000004c3c37
[root@WEIYAN wifi]$ ./wftools/iwlist wlan0 scanning
wlan0 Scan completed :
Cell 01 - Address: 00:0E:4E:81:02:4D
ESSID:"WEIYAN"
Mode:Master
Channel:6
Frequency:2.437 GHz (Channel 6)
Quality=11/100 Signal level=62/100
Encryption key:off
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s
Extra:tsf=00000000004c3c37
设置essid和无线网卡ip地址,并关闭原来的dm9000
[root@WEIYAN wifi]$ ./wftools/iwconfig wlan0 essid WEIYAN
[root@WEIYAN wifi]$ ./wftools/iwconfig wlan0 192.168.1.100
[root@WEIYAN wifi]$ ifconfig eth0 down
[root@WEIYAN wifi]$ ./wftools/iwconfig wlan0 essid WEIYAN
[root@WEIYAN wifi]$ ./wftools/iwconfig wlan0 192.168.1.100
[root@WEIYAN wifi]$ ifconfig eth0 down
测试与路由的连通性
[root@WEIYAN wifi]$ ping 192.168.1.254
PING 192.168.1.254 (192.168.1.254): 56 data bytes
64 bytes from 192.168.1.254: seq=0 ttl=255 time=10.997 ms
64 bytes from 192.168.1.254: seq=1 ttl=255 time=4.399 ms
64 bytes from 192.168.1.254: seq=2 ttl=255 time=3.915 ms
[root@WEIYAN wifi]$ ping 192.168.1.254
PING 192.168.1.254 (192.168.1.254): 56 data bytes
64 bytes from 192.168.1.254: seq=0 ttl=255 time=10.997 ms
64 bytes from 192.168.1.254: seq=1 ttl=255 time=4.399 ms
64 bytes from 192.168.1.254: seq=2 ttl=255 time=3.915 ms
通过无线网卡的nfs挂载测试
[root@WEIYAN wifi]$ mount -t nfs -o nolock 192.168.1.108:/new_disk/tftp/ /mnt
[root@WEIYAN wifi]$ ls /mnt
1.mp3 g_file_storage.ko mplayer tslib.tar.gz
2.mpg gspca.ko mplayer_no_v4l u-boot.bin
3.wav led_drv.ko rootfs.jffs2 uImage
abxtest madplay rootfs.yaffs2
[root@WEIYAN wifi]$ mount -t nfs -o nolock 192.168.1.108:/new_disk/tftp/ /mnt
[root@WEIYAN wifi]$ ls /mnt
1.mp3 g_file_storage.ko mplayer tslib.tar.gz
2.mpg gspca.ko mplayer_no_v4l u-boot.bin
3.wav led_drv.ko rootfs.jffs2 uImage
abxtest madplay rootfs.yaffs2
通过无线网卡播放mp3
[root@WEIYAN wifi]$ /opt/madplay /mnt/1.mp3
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert Leslie et al.
UDA1341:audio_set_dsp_speed:44100 prescaler:99
Title: 05.Forever Love
192k
Artist: 王力宏
Orchestra: http://bbs.hz0752.net
CoUDA1341:audio_set_dsp_speed:22050 prescaler:231
nductor: http://bbs.hz0752.net
Lyricist: http://bbs.hz0752.net
Album: 心中的日月
Track: 05
Year: 2004
Publisher: http://bbs.hz0752.net
Genre: Pop
Station: http://bbs.hz0752.net
Comment: 清晰
1039 frames decoded (0:00:27.1), +0.8 dB peak amplitude, 40 clipped samples
[root@WEIYAN wifi]$ /opt/madplay /mnt/1.mp3
MPEG Audio Decoder 0.15.2 (beta) - Copyright (C) 2000-2004 Robert Leslie et al.
UDA1341:audio_set_dsp_speed:44100 prescaler:99
Title: 05.Forever Love
192k
Artist: 王力宏
Orchestra: http://bbs.hz0752.net
CoUDA1341:audio_set_dsp_speed:22050 prescaler:231
nductor: http://bbs.hz0752.net
Lyricist: http://bbs.hz0752.net
Album: 心中的日月
Track: 05
Year: 2004
Publisher: http://bbs.hz0752.net
Genre: Pop
Station: http://bbs.hz0752.net
Comment: 清晰
1039 frames decoded (0:00:27.1), +0.8 dB peak amplitude, 40 clipped samples
通过无线网卡播放视频
[root@WEIYAN wifi]$ /opt/mplayer /mnt/2.mpg -ac mad
MPlayer 1.0rc2-3.4.1 (C) 2000-2007 MPlayer Team
CPU: ARM
[root@WEIYAN wifi]$ /opt/mplayer /mnt/2.mpg -ac mad
MPlayer 1.0rc2-3.4.1 (C) 2000-2007 MPlayer Team
CPU: ARM
Playing /mnt/2.mpg.
MPEG-PS file format detected.
VIDEO: MPEG1 384x288 (aspect 1) 29.970 fps 1638.4 kbps (204.8 kbyte/s)
==========================================================================
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
A: 25.9 V: 26.1 A-V: -0.149 ct: 1.128 782/782 79% 47% 17.5% 428 0
MPEG-PS file format detected.
VIDEO: MPEG1 384x288 (aspect 1) 29.970 fps 1638.4 kbps (204.8 kbyte/s)
==========================================================================
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
A: 25.9 V: 26.1 A-V: -0.149 ct: 1.128 782/782 79% 47% 17.5% 428 0
Exiting... (End of file)