分类: LINUX
2014-05-20 12:53:22
原文地址:无线网卡移植 作者:transistor0
-------- Linux PCMCIA Configuration Script --------
The default responses for each question are correct for most users.
Consult the PCMCIA-HOWTO for additional info about each option.
Linux kernel source directory [/usr/src/linux]: /home/zjx/dma-pxa270L/linux-2.6.9//此处填入内核目录
The kernel source tree is version 2.6.9-270SL1.
WARNING: the current kernel is version 2.4.20-8.
The current kernel build date is Thu Mar 13 17:54:28 2003.
Build ''trusting'' versions of card utilities (y/n) [n]: y
Include 32-bit (CardBus) card support (y/n) [y]: n
Include PnP BIOS resource checking (y/n) [n]: n
Module install directory [/lib/modules/2.6.9-270SL1]:
…
The forms library is not available.
Configuration successful.
…
进入cardmgr目录
[root@localhost pcmcia-cs-3.2.8]# cd cardmgr/
[root@localhost cardmgr]# make
[root@localhost cardmgr]# cd ..
把cardmgr目录下生成的cardctl、cardmgr拷贝到文件系统的/sbin目录下,以及把etc目录下的所有文件拷贝到文件系统/etc/pcmcia目录下
cp cardmgr/cardctl /home/zjx/rootfs/dma_pxa270/sbin/
cp cardmgr/cardmgr /home/zjx/rootfs/dma_pxa270/sbin/
cp etc /home/zjx/rootfs/dma_pxa270/etc/pcmcia/ -R
同时需要把/hostap-driver-0.4.9/driver/etc下的hostap_cs.conf拷贝到/home/zjx/rootfs/dma_pxa270/etc/pcmcia目录下。
3、从
下载Wireless Extensions v18的补丁文件,保存为WE.v18.patch
进入linux-2.6.9内核目录,运行patch –p1 <../WE.v18.patch
重新编译内核make zImage。
4、从
下载wireless_tools.28.tar.gz
tar zxvf wireless_tools.28.tar.gz
cd wireless_tools.28
把Makefile中的CC改成CC=arm-linux-gcc
编译make
把生成的iwconfig iwevent iwgetid iwlist iwspy iwpriv拷贝到文件系统/sbin目录下
[root@localhost wireless_tools.28]# cp iwconfig iwevent iwgetid iwlist iwspy iwpriv /home/zjx/rootfs/dma_pxa270/sbin/
把libiw.so.28拷贝到文件系统/lib目录下
[root@localhost wireless_tools.28]# cp libiw.so.28 /home/zjx/rootfs/dma_pxa270/lib/
重新制作文件系统。
5、把编译好的内核及文件系统烧到板子上
6、启动开发板进入shell,插入无线网卡。
7、运行cardmgr:
[root@Linux /]#cardmgr
cardmgr[711]: watching 1 socket
<6>cs: memory probe 0x0c0000-0x0fffff: clean.
[root@Linux /]#cardmgr[712]: socket 0: Senao NL-2011CD PLUS Ext2 Mercury
cardmgr[712]: executing: ''modprobe hostap 2>&1''
cardmgr[712]: + insmod: hostap.ko: no module by that name found
cardmgr[712]: + modprobe: failed to load module hostap
cardmgr[712]: modprobe exited with status 1
No module found in object
cardmgr[712]: executing: ''insmod /lib/modules/2.6.9-270SL1/pcmcia/hostap.o 2>&1''
cardmgr[712]: + Using /lib/modules/2.6.9-270SL1/pcmcia/hostap.o
cardmgr[712]: + insmod: cannot insert `/libhostap_cs: setting Vcc=33 (constant)
/modules/2.6.9-270SL1/pcmcia/hostap.o'': Invalid module format (-hostap_cs: CS_EVENT_CARD_INSERTION
1): Exec format error
cardmgr[712]: insmod exited with status hostap_cs: setting Vcc=33 (from config)
1
Checking CFTABLE_ENTRY 0x01 (default 0x01)
IO window settings: cfg->io.nwin=1 dflt.io.nwin=1
io->flags = 0x0046, io.base=0x0000, len=64
hostap_cs: Registered netdevice wifi0
rock pcmica: mst_pcmcia_configure_socket power = 0x8
rock pcmica: mst_pcmcia_configure_socket power = 0x8
IRQ41 (GPIO9): falling edges
hostap_cs: index 0x01: Vcc 3.3, irq 41, io 0xc48a0000-0xc48a003f
prism2_hw_init: initialized in 200 ms
wifi0: NIC: id=0x801b v1.0.0
wifi0: PRI: id=0x15 v1.1.1
wifi0: STA: id=0x1f v1.8.0
wifi0: registered netdevice wlan0
cardmgr[712]: start cmd exited with status 1
8、按以下步骤进行操作:
[root@Linux /]#ifconfig eth0 down
[root@Linux /]#ifconfig wlan0 192.168.1.23
[root@Linux /]#iwconfig wlan0 essid linksys //必须跟AP的ssid一致
[root@Linux /]#iwconfig wlan0 mode Manager//设置iw_mode=2,另外需要注意channel要与AP保持一致,可运行iwconfig wlan0 channel ?设置成与AP一致的channel
[root@Linux /]#iwconfig
[root@Linux pcmcia]#iwconfig
lo no wireless extensions.
eth0 no wireless extensions.
irda0 no wireless extensions.
usb0 no wireless extensions.
Warning: Driver for device wifi0 has been compiled with version 18
of Wireless Extension, while this program is using version 15.
Some things may be broken...
wifi0 IEEE 802.11b ESSID:"linksys"
Mode:Managed Frequency:2.422GHz Access Point: 00:06:25:6D:D9:A1
Bit Rate:11Mb/s Sensitivity=1/0
Retry min limit:8 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
wlan0 IEEE 802.11b ESSID:"linksys"
Mode:Managed Frequency:2.422GHz Access Point: 00:06:25:6D:D9:A1
Bit Rate:11Mb/s Sensitivity=1/0
Retry min limit:8 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality:50/0 Signal level:-28 dBm Noise level:-78 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:50 Missed beacon:0
9.Ping AP:
[root@Linux /]#ping 192.168.1.44
PING 192.168.1.44 (192.168.1.44): 56 data bytes
64 bytes from 192.168.1.44: icmp_seq=0 ttl=150 time=8.1 ms
64 bytes from 192.168.1.44: icmp_seq=1 ttl=150 time=3.7 ms
64 bytes from 192.168.1.44: icmp_seq=2 ttl=150 time=3.7 ms